summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore49
-rw-r--r--.hgtags7
-rw-r--r--CREDITS21
-rw-r--r--ChangeLog84
-rw-r--r--Makefile.am33
-rw-r--r--NEWS7
-rw-r--r--README13
-rw-r--r--README-VDPAU40
-rw-r--r--TODO33
-rwxr-xr-xautogen.sh8
-rw-r--r--configure.ac3873
-rw-r--r--contrib/Makefile.am20
-rw-r--r--contrib/README.contrib22
-rw-r--r--contrib/a52dec/Makefile.am13
-rw-r--r--contrib/a52dec/a52.h (renamed from src/liba52/a52.h)0
-rw-r--r--contrib/a52dec/a52_internal.h (renamed from src/liba52/a52_internal.h)0
-rw-r--r--contrib/a52dec/bit_allocate.c265
-rw-r--r--contrib/a52dec/bitstream.c95
-rw-r--r--contrib/a52dec/bitstream.h81
-rw-r--r--contrib/a52dec/crc.c73
-rw-r--r--contrib/a52dec/diff_against_release.patch (renamed from src/liba52/diff_against_release.patch)0
-rw-r--r--contrib/a52dec/downmix.c (renamed from src/liba52/downmix.c)0
-rw-r--r--contrib/a52dec/imdct.c431
-rw-r--r--contrib/a52dec/parse.c897
-rw-r--r--contrib/a52dec/tables.h (renamed from src/liba52/tables.h)0
-rw-r--r--contrib/gsm610/Makefile.am27
-rw-r--r--contrib/gsm610/add.c (renamed from src/libxineadec/gsm610/add.c)0
-rw-r--r--contrib/gsm610/decode.c (renamed from src/libxineadec/gsm610/decode.c)0
-rw-r--r--contrib/gsm610/gsm.h (renamed from src/libxineadec/gsm610/gsm.h)0
-rw-r--r--contrib/gsm610/gsm_config.h (renamed from src/libxineadec/gsm610/gsm_config.h)0
-rw-r--r--contrib/gsm610/gsm_create.c (renamed from src/libxineadec/gsm610/gsm_create.c)0
-rw-r--r--contrib/gsm610/gsm_decode.c (renamed from src/libxineadec/gsm610/gsm_decode.c)0
-rw-r--r--contrib/gsm610/gsm_destroy.c (renamed from src/libxineadec/gsm610/gsm_destroy.c)0
-rw-r--r--contrib/gsm610/long_term.c964
-rw-r--r--contrib/gsm610/lpc.c354
-rw-r--r--contrib/gsm610/private.h (renamed from src/libxineadec/gsm610/private.h)0
-rw-r--r--contrib/gsm610/proto.h (renamed from src/libxineadec/gsm610/proto.h)0
-rw-r--r--contrib/gsm610/rpe.c493
-rw-r--r--contrib/gsm610/short_term.c432
-rw-r--r--contrib/gsm610/table.c (renamed from src/libxineadec/gsm610/table.c)0
-rw-r--r--contrib/gsm610/unproto.h (renamed from src/libxineadec/gsm610/unproto.h)0
-rw-r--r--contrib/libdca/COPYING339
-rw-r--r--contrib/libdca/Makefile.am17
-rw-r--r--contrib/libdca/bitstream.c112
-rw-r--r--contrib/libdca/bitstream.h68
-rw-r--r--contrib/libdca/dca_internal.h204
-rw-r--r--contrib/libdca/downmix.c694
-rw-r--r--contrib/libdca/include/dca.h86
-rw-r--r--contrib/libdca/include/dts.h55
-rw-r--r--contrib/libdca/parse.c1292
-rw-r--r--contrib/libdca/tables.h48
-rw-r--r--contrib/libdca/tables_adpcm.h4123
-rw-r--r--contrib/libdca/tables_fir.h2086
-rw-r--r--contrib/libdca/tables_huffman.h1072
-rw-r--r--contrib/libdca/tables_quantization.h89
-rw-r--r--contrib/libdca/tables_vq.h2076
-rw-r--r--contrib/libdha/.hgignore (renamed from src/video_out/libdha/.hgignore)0
-rw-r--r--contrib/libdha/AsmMacros.h (renamed from src/video_out/libdha/AsmMacros.h)0
-rw-r--r--contrib/libdha/Makefile.am45
-rw-r--r--contrib/libdha/README (renamed from src/video_out/libdha/README)0
-rw-r--r--contrib/libdha/bin/Makefile.am4
-rw-r--r--contrib/libdha/bin/README (renamed from src/video_out/libdha/bin/README)0
-rw-r--r--contrib/libdha/bin/mapdev.copyright (renamed from src/video_out/libdha/bin/mapdev.copyright)0
-rw-r--r--contrib/libdha/bin/mapdev.vxd (renamed from src/video_out/libdha/bin/mapdev.vxd)bin5780 -> 5780 bytes
-rw-r--r--contrib/libdha/cpu_flush.c (renamed from src/video_out/libdha/cpu_flush.c)0
-rw-r--r--contrib/libdha/irq.c (renamed from src/video_out/libdha/irq.c)0
-rw-r--r--contrib/libdha/kernelhelper/Makefile.am51
-rw-r--r--contrib/libdha/kernelhelper/README (renamed from src/video_out/libdha/kernelhelper/README)0
-rw-r--r--contrib/libdha/kernelhelper/dhahelper.c (renamed from src/video_out/libdha/kernelhelper/dhahelper.c)0
-rw-r--r--contrib/libdha/kernelhelper/dhahelper.h (renamed from src/video_out/libdha/kernelhelper/dhahelper.h)0
-rw-r--r--contrib/libdha/kernelhelper/test.c (renamed from src/video_out/libdha/kernelhelper/test.c)0
-rw-r--r--contrib/libdha/libdha.c (renamed from src/video_out/libdha/libdha.c)0
-rw-r--r--contrib/libdha/libdha.h (renamed from src/video_out/libdha/libdha.h)0
-rw-r--r--contrib/libdha/mmi.c (renamed from src/video_out/libdha/mmi.c)0
-rw-r--r--contrib/libdha/mtrr.c (renamed from src/video_out/libdha/mtrr.c)0
-rw-r--r--contrib/libdha/oth/Makefile.am4
-rw-r--r--contrib/libdha/oth/pci.db (renamed from src/video_out/libdha/oth/pci.db)0
-rw-r--r--contrib/libdha/pci.c (renamed from src/video_out/libdha/pci.c)0
-rw-r--r--contrib/libdha/pci_db2c.awk (renamed from src/video_out/libdha/pci_db2c.awk)0
-rw-r--r--contrib/libdha/ports.c (renamed from src/video_out/libdha/ports.c)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_alpha.h (renamed from src/video_out/libdha/sysdep/AsmMacros_alpha.h)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_arm32.h (renamed from src/video_out/libdha/sysdep/AsmMacros_arm32.h)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_generic.h (renamed from src/video_out/libdha/sysdep/AsmMacros_generic.h)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_ia64.h (renamed from src/video_out/libdha/sysdep/AsmMacros_ia64.h)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_powerpc.h (renamed from src/video_out/libdha/sysdep/AsmMacros_powerpc.h)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_sparc.h (renamed from src/video_out/libdha/sysdep/AsmMacros_sparc.h)0
-rw-r--r--contrib/libdha/sysdep/AsmMacros_x86.h (renamed from src/video_out/libdha/sysdep/AsmMacros_x86.h)0
-rw-r--r--contrib/libdha/sysdep/Makefile.am36
-rw-r--r--contrib/libdha/sysdep/libdha_os2.c (renamed from src/video_out/libdha/sysdep/libdha_os2.c)0
-rw-r--r--contrib/libdha/sysdep/libdha_win32.c (renamed from src/video_out/libdha/sysdep/libdha_win32.c)0
-rw-r--r--contrib/libdha/sysdep/pci_386bsd.c (renamed from src/video_out/libdha/sysdep/pci_386bsd.c)0
-rw-r--r--contrib/libdha/sysdep/pci_alpha.c (renamed from src/video_out/libdha/sysdep/pci_alpha.c)0
-rw-r--r--contrib/libdha/sysdep/pci_arm32.c (renamed from src/video_out/libdha/sysdep/pci_arm32.c)0
-rw-r--r--contrib/libdha/sysdep/pci_bsdi.c (renamed from src/video_out/libdha/sysdep/pci_bsdi.c)0
-rw-r--r--contrib/libdha/sysdep/pci_freebsd.c (renamed from src/video_out/libdha/sysdep/pci_freebsd.c)0
-rw-r--r--contrib/libdha/sysdep/pci_generic_cpu.c (renamed from src/video_out/libdha/sysdep/pci_generic_cpu.c)0
-rw-r--r--contrib/libdha/sysdep/pci_generic_os.c (renamed from src/video_out/libdha/sysdep/pci_generic_os.c)0
-rw-r--r--contrib/libdha/sysdep/pci_ia64.c (renamed from src/video_out/libdha/sysdep/pci_ia64.c)0
-rw-r--r--contrib/libdha/sysdep/pci_isc.c (renamed from src/video_out/libdha/sysdep/pci_isc.c)0
-rw-r--r--contrib/libdha/sysdep/pci_linux.c (renamed from src/video_out/libdha/sysdep/pci_linux.c)0
-rw-r--r--contrib/libdha/sysdep/pci_lynx.c (renamed from src/video_out/libdha/sysdep/pci_lynx.c)0
-rw-r--r--contrib/libdha/sysdep/pci_mach386.c (renamed from src/video_out/libdha/sysdep/pci_mach386.c)0
-rw-r--r--contrib/libdha/sysdep/pci_netbsd.c (renamed from src/video_out/libdha/sysdep/pci_netbsd.c)0
-rw-r--r--contrib/libdha/sysdep/pci_openbsd.c (renamed from src/video_out/libdha/sysdep/pci_openbsd.c)0
-rw-r--r--contrib/libdha/sysdep/pci_os2.c (renamed from src/video_out/libdha/sysdep/pci_os2.c)0
-rw-r--r--contrib/libdha/sysdep/pci_powerpc.c (renamed from src/video_out/libdha/sysdep/pci_powerpc.c)0
-rw-r--r--contrib/libdha/sysdep/pci_sco.c (renamed from src/video_out/libdha/sysdep/pci_sco.c)0
-rw-r--r--contrib/libdha/sysdep/pci_sparc.c (renamed from src/video_out/libdha/sysdep/pci_sparc.c)0
-rw-r--r--contrib/libdha/sysdep/pci_svr4.c (renamed from src/video_out/libdha/sysdep/pci_svr4.c)0
-rw-r--r--contrib/libdha/sysdep/pci_win32.c (renamed from src/video_out/libdha/sysdep/pci_win32.c)0
-rw-r--r--contrib/libdha/sysdep/pci_x86.c (renamed from src/video_out/libdha/sysdep/pci_x86.c)0
-rw-r--r--contrib/libdha/test.c (renamed from src/video_out/libdha/test.c)0
-rw-r--r--contrib/libfaad/Makefile.am116
-rw-r--r--contrib/libfaad/analysis.h (renamed from src/libfaad/analysis.h)0
-rw-r--r--contrib/libfaad/bits.c (renamed from src/libfaad/bits.c)0
-rw-r--r--contrib/libfaad/bits.h (renamed from src/libfaad/bits.h)0
-rw-r--r--contrib/libfaad/cfft.c (renamed from src/libfaad/cfft.c)0
-rw-r--r--contrib/libfaad/cfft.h (renamed from src/libfaad/cfft.h)0
-rw-r--r--contrib/libfaad/cfft_tab.h (renamed from src/libfaad/cfft_tab.h)0
-rw-r--r--contrib/libfaad/codebook/hcb.h (renamed from src/libfaad/codebook/hcb.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_1.h (renamed from src/libfaad/codebook/hcb_1.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_10.h (renamed from src/libfaad/codebook/hcb_10.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_11.h (renamed from src/libfaad/codebook/hcb_11.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_2.h (renamed from src/libfaad/codebook/hcb_2.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_3.h (renamed from src/libfaad/codebook/hcb_3.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_4.h (renamed from src/libfaad/codebook/hcb_4.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_5.h (renamed from src/libfaad/codebook/hcb_5.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_6.h (renamed from src/libfaad/codebook/hcb_6.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_7.h (renamed from src/libfaad/codebook/hcb_7.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_8.h (renamed from src/libfaad/codebook/hcb_8.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_9.h (renamed from src/libfaad/codebook/hcb_9.h)0
-rw-r--r--contrib/libfaad/codebook/hcb_sf.h (renamed from src/libfaad/codebook/hcb_sf.h)0
-rw-r--r--contrib/libfaad/common.c (renamed from src/libfaad/common.c)0
-rw-r--r--contrib/libfaad/common.h (renamed from src/libfaad/common.h)0
-rw-r--r--contrib/libfaad/decoder.c (renamed from src/libfaad/decoder.c)0
-rw-r--r--contrib/libfaad/decoder.h (renamed from src/libfaad/decoder.h)0
-rw-r--r--contrib/libfaad/diff_from_faad2-2.6.1.patch11
-rw-r--r--contrib/libfaad/drc.c (renamed from src/libfaad/drc.c)0
-rw-r--r--contrib/libfaad/drc.h (renamed from src/libfaad/drc.h)0
-rw-r--r--contrib/libfaad/drm_dec.c (renamed from src/libfaad/drm_dec.c)0
-rw-r--r--contrib/libfaad/drm_dec.h (renamed from src/libfaad/drm_dec.h)0
-rw-r--r--contrib/libfaad/error.c (renamed from src/libfaad/error.c)0
-rw-r--r--contrib/libfaad/error.h (renamed from src/libfaad/error.h)0
-rw-r--r--contrib/libfaad/filtbank.c (renamed from src/libfaad/filtbank.c)0
-rw-r--r--contrib/libfaad/filtbank.h (renamed from src/libfaad/filtbank.h)0
-rw-r--r--contrib/libfaad/fixed.h (renamed from src/libfaad/fixed.h)0
-rw-r--r--contrib/libfaad/hcr.c (renamed from src/libfaad/hcr.c)0
-rw-r--r--contrib/libfaad/huffman.c (renamed from src/libfaad/huffman.c)0
-rw-r--r--contrib/libfaad/huffman.h (renamed from src/libfaad/huffman.h)0
-rw-r--r--contrib/libfaad/ic_predict.c (renamed from src/libfaad/ic_predict.c)0
-rw-r--r--contrib/libfaad/ic_predict.h (renamed from src/libfaad/ic_predict.h)0
-rw-r--r--contrib/libfaad/iq_table.h (renamed from src/libfaad/iq_table.h)0
-rw-r--r--contrib/libfaad/is.c (renamed from src/libfaad/is.c)0
-rw-r--r--contrib/libfaad/is.h (renamed from src/libfaad/is.h)0
-rw-r--r--contrib/libfaad/kbd_win.h (renamed from src/libfaad/kbd_win.h)0
-rw-r--r--contrib/libfaad/lt_predict.c (renamed from src/libfaad/lt_predict.c)0
-rw-r--r--contrib/libfaad/lt_predict.h (renamed from src/libfaad/lt_predict.h)0
-rw-r--r--contrib/libfaad/mdct.c (renamed from src/libfaad/mdct.c)0
-rw-r--r--contrib/libfaad/mdct.h (renamed from src/libfaad/mdct.h)0
-rw-r--r--contrib/libfaad/mdct_tab.h (renamed from src/libfaad/mdct_tab.h)0
-rw-r--r--contrib/libfaad/mp4.c (renamed from src/libfaad/mp4.c)0
-rw-r--r--contrib/libfaad/mp4.h (renamed from src/libfaad/mp4.h)0
-rw-r--r--contrib/libfaad/ms.c (renamed from src/libfaad/ms.c)0
-rw-r--r--contrib/libfaad/ms.h (renamed from src/libfaad/ms.h)0
-rwxr-xr-xcontrib/libfaad/neaacdec.h255
-rw-r--r--contrib/libfaad/output.c (renamed from src/libfaad/output.c)0
-rw-r--r--contrib/libfaad/output.h (renamed from src/libfaad/output.h)0
-rw-r--r--contrib/libfaad/pns.c (renamed from src/libfaad/pns.c)0
-rw-r--r--contrib/libfaad/pns.h (renamed from src/libfaad/pns.h)0
-rw-r--r--contrib/libfaad/ps_dec.c (renamed from src/libfaad/ps_dec.c)0
-rw-r--r--contrib/libfaad/ps_dec.h (renamed from src/libfaad/ps_dec.h)0
-rw-r--r--contrib/libfaad/ps_syntax.c (renamed from src/libfaad/ps_syntax.c)0
-rw-r--r--contrib/libfaad/ps_tables.h (renamed from src/libfaad/ps_tables.h)0
-rw-r--r--contrib/libfaad/pulse.c (renamed from src/libfaad/pulse.c)0
-rw-r--r--contrib/libfaad/pulse.h (renamed from src/libfaad/pulse.h)0
-rw-r--r--contrib/libfaad/rvlc.c (renamed from src/libfaad/rvlc.c)0
-rw-r--r--contrib/libfaad/rvlc.h (renamed from src/libfaad/rvlc.h)0
-rw-r--r--contrib/libfaad/sbr_dct.c (renamed from src/libfaad/sbr_dct.c)0
-rw-r--r--contrib/libfaad/sbr_dct.h (renamed from src/libfaad/sbr_dct.h)0
-rw-r--r--contrib/libfaad/sbr_dec.c (renamed from src/libfaad/sbr_dec.c)0
-rw-r--r--contrib/libfaad/sbr_dec.h (renamed from src/libfaad/sbr_dec.h)0
-rw-r--r--contrib/libfaad/sbr_e_nf.c (renamed from src/libfaad/sbr_e_nf.c)0
-rw-r--r--contrib/libfaad/sbr_e_nf.h (renamed from src/libfaad/sbr_e_nf.h)0
-rw-r--r--contrib/libfaad/sbr_fbt.c (renamed from src/libfaad/sbr_fbt.c)0
-rw-r--r--contrib/libfaad/sbr_fbt.h (renamed from src/libfaad/sbr_fbt.h)0
-rw-r--r--contrib/libfaad/sbr_hfadj.c (renamed from src/libfaad/sbr_hfadj.c)0
-rw-r--r--contrib/libfaad/sbr_hfadj.h (renamed from src/libfaad/sbr_hfadj.h)0
-rw-r--r--contrib/libfaad/sbr_hfgen.c (renamed from src/libfaad/sbr_hfgen.c)0
-rw-r--r--contrib/libfaad/sbr_hfgen.h (renamed from src/libfaad/sbr_hfgen.h)0
-rw-r--r--contrib/libfaad/sbr_huff.c (renamed from src/libfaad/sbr_huff.c)0
-rw-r--r--contrib/libfaad/sbr_huff.h (renamed from src/libfaad/sbr_huff.h)0
-rw-r--r--contrib/libfaad/sbr_noise.h (renamed from src/libfaad/sbr_noise.h)0
-rw-r--r--contrib/libfaad/sbr_qmf.c (renamed from src/libfaad/sbr_qmf.c)0
-rw-r--r--contrib/libfaad/sbr_qmf.h (renamed from src/libfaad/sbr_qmf.h)0
-rw-r--r--contrib/libfaad/sbr_qmf_c.h (renamed from src/libfaad/sbr_qmf_c.h)0
-rw-r--r--contrib/libfaad/sbr_syntax.c (renamed from src/libfaad/sbr_syntax.c)0
-rw-r--r--contrib/libfaad/sbr_syntax.h (renamed from src/libfaad/sbr_syntax.h)0
-rw-r--r--contrib/libfaad/sbr_tf_grid.c (renamed from src/libfaad/sbr_tf_grid.c)0
-rw-r--r--contrib/libfaad/sbr_tf_grid.h (renamed from src/libfaad/sbr_tf_grid.h)0
-rw-r--r--contrib/libfaad/sine_win.h (renamed from src/libfaad/sine_win.h)0
-rw-r--r--contrib/libfaad/specrec.c (renamed from src/libfaad/specrec.c)0
-rw-r--r--contrib/libfaad/specrec.h (renamed from src/libfaad/specrec.h)0
-rw-r--r--contrib/libfaad/ssr.c (renamed from src/libfaad/ssr.c)0
-rw-r--r--contrib/libfaad/ssr.h (renamed from src/libfaad/ssr.h)0
-rw-r--r--contrib/libfaad/ssr_fb.c (renamed from src/libfaad/ssr_fb.c)0
-rw-r--r--contrib/libfaad/ssr_fb.h (renamed from src/libfaad/ssr_fb.h)0
-rw-r--r--contrib/libfaad/ssr_ipqf.c (renamed from src/libfaad/ssr_ipqf.c)0
-rw-r--r--contrib/libfaad/ssr_ipqf.h (renamed from src/libfaad/ssr_ipqf.h)0
-rw-r--r--contrib/libfaad/ssr_win.h (renamed from src/libfaad/ssr_win.h)0
-rw-r--r--contrib/libfaad/structs.h (renamed from src/libfaad/structs.h)0
-rw-r--r--contrib/libfaad/syntax.c (renamed from src/libfaad/syntax.c)0
-rw-r--r--contrib/libfaad/syntax.h (renamed from src/libfaad/syntax.h)0
-rw-r--r--contrib/libfaad/tns.c (renamed from src/libfaad/tns.c)0
-rw-r--r--contrib/libfaad/tns.h (renamed from src/libfaad/tns.h)0
-rw-r--r--contrib/libmad/COPYING340
-rw-r--r--contrib/libmad/D.dat607
-rw-r--r--contrib/libmad/Makefile.am45
-rw-r--r--contrib/libmad/bit.c237
-rw-r--r--contrib/libmad/bit.h47
-rw-r--r--contrib/libmad/decoder.c582
-rw-r--r--contrib/libmad/decoder.h91
-rw-r--r--contrib/libmad/fixed.c81
-rw-r--r--contrib/libmad/fixed.h499
-rw-r--r--contrib/libmad/frame.c503
-rw-r--r--contrib/libmad/frame.h118
-rw-r--r--contrib/libmad/global.h58
-rw-r--r--contrib/libmad/huffman.c3109
-rw-r--r--contrib/libmad/huffman.h66
-rw-r--r--contrib/libmad/imdct_s.dat62
-rw-r--r--contrib/libmad/layer12.c534
-rw-r--r--contrib/libmad/layer12.h31
-rw-r--r--contrib/libmad/layer3.c2698
-rw-r--r--contrib/libmad/layer3.h30
-rw-r--r--contrib/libmad/qc_table.dat77
-rw-r--r--contrib/libmad/rq_table.dat8747
-rw-r--r--contrib/libmad/sf_table.dat106
-rw-r--r--contrib/libmad/stream.c161
-rw-r--r--contrib/libmad/stream.h108
-rw-r--r--contrib/libmad/synth.c857
-rw-r--r--contrib/libmad/synth.h69
-rw-r--r--contrib/libmad/timer.c485
-rw-r--r--contrib/libmad/timer.h100
-rw-r--r--contrib/libmad/version.c91
-rw-r--r--contrib/libmad/version.h47
-rw-r--r--contrib/libmpcdec/COPYING31
-rw-r--r--contrib/libmpcdec/Makefile.am16
-rw-r--r--contrib/libmpcdec/diff_from_libmpcdec_1.2.5.patch20
-rw-r--r--contrib/libmpcdec/huffsv46.c75
-rw-r--r--contrib/libmpcdec/huffsv7.c81
-rw-r--r--contrib/libmpcdec/idtag.c83
-rw-r--r--contrib/libmpcdec/mpc_decoder.c1271
-rw-r--r--contrib/libmpcdec/mpc_reader.c96
-rw-r--r--contrib/libmpcdec/mpcdec/config_types.h50
-rw-r--r--contrib/libmpcdec/mpcdec/decoder.h124
-rw-r--r--contrib/libmpcdec/mpcdec/huffman.h58
-rw-r--r--contrib/libmpcdec/mpcdec/internal.h65
-rw-r--r--contrib/libmpcdec/mpcdec/math.h144
-rw-r--r--contrib/libmpcdec/mpcdec/mpcdec.h145
-rw-r--r--contrib/libmpcdec/mpcdec/reader.h82
-rw-r--r--contrib/libmpcdec/mpcdec/requant.h51
-rw-r--r--contrib/libmpcdec/mpcdec/streaminfo.h91
-rw-r--r--contrib/libmpcdec/requant.c120
-rw-r--r--contrib/libmpcdec/streaminfo.c281
-rw-r--r--contrib/libmpcdec/synth_filter.c440
-rw-r--r--contrib/libxdg-basedir/Makefile.am8
-rw-r--r--contrib/libxdg-basedir/basedir.c569
-rw-r--r--contrib/libxdg-basedir/basedir.h133
-rw-r--r--contrib/libxdg-basedir/basedir_fs.h100
-rw-r--r--contrib/nosefart/Makefile.am38
-rw-r--r--contrib/nosefart/diff_to_nosefart_cvs.patch117
-rw-r--r--contrib/nosefart/dis6502.c (renamed from src/libxineadec/nosefart/dis6502.c)0
-rw-r--r--contrib/nosefart/dis6502.h (renamed from src/libxineadec/nosefart/dis6502.h)0
-rw-r--r--contrib/nosefart/fds_snd.c (renamed from src/libxineadec/nosefart/fds_snd.c)0
-rw-r--r--contrib/nosefart/fds_snd.h (renamed from src/libxineadec/nosefart/fds_snd.h)0
-rw-r--r--contrib/nosefart/fmopl.c (renamed from src/libxineadec/nosefart/fmopl.c)0
-rw-r--r--contrib/nosefart/fmopl.h (renamed from src/libxineadec/nosefart/fmopl.h)0
-rw-r--r--contrib/nosefart/log.c (renamed from src/libxineadec/nosefart/log.c)0
-rw-r--r--contrib/nosefart/log.h53
-rw-r--r--contrib/nosefart/memguard.c (renamed from src/libxineadec/nosefart/memguard.c)0
-rw-r--r--contrib/nosefart/memguard.h (renamed from src/libxineadec/nosefart/memguard.h)0
-rw-r--r--contrib/nosefart/mmc5_snd.c (renamed from src/libxineadec/nosefart/mmc5_snd.c)0
-rw-r--r--contrib/nosefart/mmc5_snd.h (renamed from src/libxineadec/nosefart/mmc5_snd.h)0
-rw-r--r--contrib/nosefart/nes6502.c (renamed from src/libxineadec/nosefart/nes6502.c)0
-rw-r--r--contrib/nosefart/nes6502.h (renamed from src/libxineadec/nosefart/nes6502.h)0
-rw-r--r--contrib/nosefart/nes_apu.c (renamed from src/libxineadec/nosefart/nes_apu.c)0
-rw-r--r--contrib/nosefart/nes_apu.h (renamed from src/libxineadec/nosefart/nes_apu.h)0
-rw-r--r--contrib/nosefart/nsf.c (renamed from src/libxineadec/nosefart/nsf.c)0
-rw-r--r--contrib/nosefart/nsf.h186
-rw-r--r--contrib/nosefart/osd.h94
-rw-r--r--contrib/nosefart/types.h (renamed from src/libxineadec/nosefart/types.h)0
-rw-r--r--contrib/nosefart/version.h (renamed from src/libxineadec/nosefart/version.h)0
-rw-r--r--contrib/nosefart/vrc7_snd.c (renamed from src/libxineadec/nosefart/vrc7_snd.c)0
-rw-r--r--contrib/nosefart/vrc7_snd.h (renamed from src/libxineadec/nosefart/vrc7_snd.h)0
-rw-r--r--contrib/nosefart/vrcvisnd.c (renamed from src/libxineadec/nosefart/vrcvisnd.c)0
-rw-r--r--contrib/nosefart/vrcvisnd.h (renamed from src/libxineadec/nosefart/vrcvisnd.h)0
-rw-r--r--contrib/vidix/Makefile.am19
-rw-r--r--contrib/vidix/README (renamed from src/video_out/vidix/README)0
-rw-r--r--contrib/vidix/drivers/Makefile.am63
-rw-r--r--contrib/vidix/drivers/cyberblade_regs.h (renamed from src/video_out/vidix/drivers/cyberblade_regs.h)0
-rw-r--r--contrib/vidix/drivers/cyberblade_vid.c (renamed from src/video_out/vidix/drivers/cyberblade_vid.c)0
-rw-r--r--contrib/vidix/drivers/genfb_vid.c (renamed from src/video_out/vidix/drivers/genfb_vid.c)0
-rw-r--r--contrib/vidix/drivers/glint_regs.h (renamed from src/video_out/vidix/drivers/glint_regs.h)0
-rw-r--r--contrib/vidix/drivers/mach64.h (renamed from src/video_out/vidix/drivers/mach64.h)0
-rw-r--r--contrib/vidix/drivers/mach64_vid.c (renamed from src/video_out/vidix/drivers/mach64_vid.c)0
-rw-r--r--contrib/vidix/drivers/mga_vid.c (renamed from src/video_out/vidix/drivers/mga_vid.c)0
-rw-r--r--contrib/vidix/drivers/nvidia_vid.c (renamed from src/video_out/vidix/drivers/nvidia_vid.c)0
-rw-r--r--contrib/vidix/drivers/pm2_vid.c (renamed from src/video_out/vidix/drivers/pm2_vid.c)0
-rw-r--r--contrib/vidix/drivers/pm3_regs.h (renamed from src/video_out/vidix/drivers/pm3_regs.h)0
-rw-r--r--contrib/vidix/drivers/pm3_vid.c (renamed from src/video_out/vidix/drivers/pm3_vid.c)0
-rw-r--r--contrib/vidix/drivers/radeon.h (renamed from src/video_out/vidix/drivers/radeon.h)0
-rw-r--r--contrib/vidix/drivers/radeon_vid.c (renamed from src/video_out/vidix/drivers/radeon_vid.c)0
-rw-r--r--contrib/vidix/drivers/savage_regs.h (renamed from src/video_out/vidix/drivers/savage_regs.h)0
-rw-r--r--contrib/vidix/drivers/savage_vid.c (renamed from src/video_out/vidix/drivers/savage_vid.c)0
-rw-r--r--contrib/vidix/drivers/sis_bridge.c (renamed from src/video_out/vidix/drivers/sis_bridge.c)0
-rw-r--r--contrib/vidix/drivers/sis_defs.h (renamed from src/video_out/vidix/drivers/sis_defs.h)0
-rw-r--r--contrib/vidix/drivers/sis_regs.h (renamed from src/video_out/vidix/drivers/sis_regs.h)0
-rw-r--r--contrib/vidix/drivers/sis_vid.c (renamed from src/video_out/vidix/drivers/sis_vid.c)0
-rw-r--r--contrib/vidix/drivers/unichrome_regs.h (renamed from src/video_out/vidix/drivers/unichrome_regs.h)0
-rw-r--r--contrib/vidix/drivers/unichrome_vid.c (renamed from src/video_out/vidix/drivers/unichrome_vid.c)0
-rw-r--r--contrib/vidix/fourcc.h (renamed from src/video_out/vidix/fourcc.h)0
-rw-r--r--contrib/vidix/vidix.h (renamed from src/video_out/vidix/vidix.h)0
-rw-r--r--contrib/vidix/vidix.txt (renamed from src/video_out/vidix/vidix.txt)0
-rw-r--r--contrib/vidix/vidixlib.c (renamed from src/video_out/vidix/vidixlib.c)0
-rw-r--r--contrib/vidix/vidixlib.h (renamed from src/video_out/vidix/vidixlib.h)0
-rw-r--r--debian/changelog8
-rw-r--r--debian/control48
-rw-r--r--debian/dh_xine.in6
-rw-r--r--debian/libxine-dev.install12
-rw-r--r--debian/libxine1-doc.docs8
-rw-r--r--debian/libxine1-doc.manpages1
-rw-r--r--debian/libxine1.install10
-rw-r--r--debian/libxine2-dev.install12
-rw-r--r--debian/libxine2-doc.docs8
-rw-r--r--debian/libxine2-doc.install1
-rw-r--r--debian/libxine2.install10
-rw-r--r--debian/reportbug.presubj4
-rwxr-xr-xdebian/rules25
-rw-r--r--doc/Doxyfile.in1039
-rw-r--r--doc/Makefile.am5
-rw-r--r--doc/README6
-rw-r--r--doc/README.dvb7
-rw-r--r--doc/README.macosx141
-rw-r--r--doc/README.syncfb280
-rw-r--r--doc/faq/Makefile.am55
-rw-r--r--doc/faq/faq.docbook2290
-rw-r--r--doc/faq/faq.sgml2280
-rw-r--r--doc/faq/faq.xsl4
-rw-r--r--doc/hackersguide/Makefile.am84
-rw-r--r--doc/hackersguide/architecture.fig560
-rw-r--r--doc/hackersguide/architecture.svg2134
-rw-r--r--doc/hackersguide/hackersguide.docbook51
-rw-r--r--doc/hackersguide/hackersguide.sgml48
-rw-r--r--doc/hackersguide/internals.docbook762
-rw-r--r--doc/hackersguide/internals.sgml762
-rw-r--r--doc/hackersguide/intro.docbook (renamed from doc/hackersguide/intro.sgml)0
-rw-r--r--doc/hackersguide/library.docbook410
-rw-r--r--doc/hackersguide/library.fig313
-rw-r--r--doc/hackersguide/library.sgml410
-rw-r--r--doc/hackersguide/library.svg1732
-rw-r--r--doc/hackersguide/output.docbook668
-rw-r--r--doc/hackersguide/output.sgml668
-rw-r--r--doc/hackersguide/overlays.fig64
-rw-r--r--doc/hackersguide/overlays.svg256
-rw-r--r--doc/hackersguide/overview.docbook (renamed from doc/hackersguide/overview.sgml)0
-rw-r--r--doc/hackersguide/post_frame.fig347
-rw-r--r--doc/hackersguide/post_frame.svg1564
-rw-r--r--doc/hackersguide/stream.docbook (renamed from doc/hackersguide/stream.sgml)0
-rw-r--r--doc/man/Makefile.am1
-rw-r--r--doc/man/en/Makefile.am1
-rw-r--r--doc/man/en/xine-config.134
-rw-r--r--doc/man/en/xine.53
-rw-r--r--include/Makefile.am68
-rw-r--r--include/xine.h2310
-rw-r--r--include/xine.h.in2300
-rw-r--r--include/xine/alphablend.h112
-rw-r--r--include/xine/array.h (renamed from src/xine-utils/array.h)0
-rw-r--r--include/xine/attributes.h (renamed from src/xine-utils/attributes.h)0
-rw-r--r--include/xine/audio_decoder.h113
-rw-r--r--include/xine/audio_out.h360
-rw-r--r--include/xine/broadcaster.h (renamed from src/xine-engine/broadcaster.h)0
-rw-r--r--include/xine/buffer.h734
-rw-r--r--include/xine/compat.h (renamed from src/xine-utils/compat.h)0
-rw-r--r--include/xine/configfile.h245
-rw-r--r--include/xine/demux.h227
-rw-r--r--include/xine/info_helper.h (renamed from src/xine-engine/info_helper.h)0
-rw-r--r--include/xine/input_plugin.h407
-rw-r--r--include/xine/io_helper.h141
-rw-r--r--include/xine/list.h (renamed from src/xine-utils/list.h)0
-rw-r--r--include/xine/metronom.h359
-rw-r--r--include/xine/os_types.h (renamed from lib/os_types.h)0
-rw-r--r--include/xine/osd.h302
-rw-r--r--include/xine/plugin_catalog.h75
-rw-r--r--include/xine/pool.h (renamed from src/xine-utils/pool.h)0
-rw-r--r--include/xine/post.h410
-rw-r--r--include/xine/refcounter.h42
-rw-r--r--include/xine/resample.h (renamed from src/xine-engine/resample.h)0
-rw-r--r--include/xine/ring_buffer.h (renamed from src/xine-utils/ring_buffer.h)0
-rw-r--r--include/xine/scratch.h (renamed from src/xine-engine/scratch.h)0
-rw-r--r--include/xine/sorted_array.h (renamed from src/xine-utils/sorted_array.h)0
-rw-r--r--include/xine/spu.h44
-rw-r--r--include/xine/spu_decoder.h160
-rw-r--r--include/xine/vdr.h666
-rw-r--r--include/xine/version.h.in25
-rw-r--r--include/xine/video_decoder.h118
-rw-r--r--include/xine/video_out.h538
-rw-r--r--include/xine/video_overlay.h64
-rw-r--r--include/xine/vo_scale.h195
-rw-r--r--include/xine/xine_buffer.h132
-rw-r--r--include/xine/xine_internal.h544
-rw-r--r--include/xine/xine_plugin.h105
-rw-r--r--include/xine/xineintl.h (renamed from src/xine-engine/xineintl.h)0
-rw-r--r--include/xine/xineutils.h518
-rw-r--r--include/xine/xmllexer.h79
-rw-r--r--include/xine/xmlparser.h114
-rw-r--r--lib/Makefile.am4
-rw-r--r--lib/os_internal.h73
-rw-r--r--lib/timedlock.c33
-rw-r--r--m4/Makefile.am1
-rw-r--r--m4/_xine.m4536
-rw-r--r--m4/aa.m4272
-rw-r--r--m4/arts.m4168
-rw-r--r--m4/audio_out.m4225
-rw-r--r--m4/decoders.m4520
-rw-r--r--m4/directx.m494
-rw-r--r--m4/dl.m453
-rw-r--r--m4/dvdnav.m4194
-rw-r--r--m4/gas.m4197
-rw-r--r--m4/glibc2.m430
-rw-r--r--m4/glibc21.m430
-rw-r--r--m4/input.m4185
-rw-r--r--m4/intdiv0.m484
-rw-r--r--m4/inttypes.m425
-rw-r--r--m4/ioctl_request.m452
-rw-r--r--m4/irixal.m419
-rw-r--r--m4/isc-posix.m424
-rw-r--r--m4/lcmessage.m430
-rw-r--r--m4/lib-ld.m4110
-rw-r--r--m4/libFLAC.m427
-rw-r--r--m4/libfame.m4183
-rw-r--r--m4/macosx.m443
-rw-r--r--m4/objc.m4253
-rw-r--r--m4/opengl.m474
-rw-r--r--m4/optimizations.m4244
-rw-r--r--m4/package.m472
-rw-r--r--m4/pkg.m46
-rw-r--r--m4/printf-posix.m444
-rw-r--r--m4/programs.m4124
-rw-r--r--m4/progtest.m492
-rw-r--r--m4/signed.m417
-rw-r--r--m4/summary.m4361
-rw-r--r--m4/types.m4245
-rw-r--r--m4/uintmax_t.m430
-rw-r--r--m4/video_out.m4494
-rw-r--r--m4/wchar_t.m420
-rw-r--r--m4/wint_t.m428
-rw-r--r--m4/xine.m4285
-rw-r--r--m4/xsize.m413
-rw-r--r--m4/xv.m493
-rw-r--r--misc/.hgignore1
-rw-r--r--misc/Makefile.am62
-rw-r--r--misc/Makefile.common17
-rw-r--r--misc/Makefile.quiet2
-rw-r--r--misc/SlackBuild.in14
-rw-r--r--misc/build_rpms.sh.in12
-rw-r--r--misc/fonts/Makefile.am45
-rw-r--r--misc/libxine.pc.in2
-rwxr-xr-x[-rw-r--r--]misc/relchk.sh.in2
-rw-r--r--misc/xine-config.in3
-rw-r--r--misc/xine-lib.spec.in23
-rw-r--r--po/POTFILES.in46
-rw-r--r--po/cs.po2837
-rw-r--r--po/de.po2768
-rw-r--r--po/en_US.po2473
-rw-r--r--po/eo.po2643
-rw-r--r--po/es.po2885
-rw-r--r--po/eu.po2559
-rw-r--r--po/fr.po2522
-rw-r--r--po/it.po2809
-rw-r--r--po/ja.po2546
-rw-r--r--po/libxine1.pot5280
-rw-r--r--po/libxine2.pot5319
-rw-r--r--po/pl.po2555
-rw-r--r--po/pt_BR.po2487
-rw-r--r--po/sk.po2632
-rw-r--r--po/tr.po2790
-rw-r--r--src/Makefile.am23
-rw-r--r--src/audio_dec/Makefile.am93
-rw-r--r--src/audio_dec/ff_dvaudio_decoder.c393
-rw-r--r--src/audio_dec/ff_dvdata.h2737
-rw-r--r--src/audio_dec/fooaudio.c340
-rw-r--r--src/audio_dec/gsm610.c281
-rw-r--r--src/audio_dec/xine_a52_decoder.c864
-rw-r--r--src/audio_dec/xine_dts_decoder.c590
-rw-r--r--src/audio_dec/xine_faad_decoder.c506
-rw-r--r--src/audio_dec/xine_lpcm_decoder.c409
-rw-r--r--src/audio_dec/xine_mad_decoder.c446
-rw-r--r--src/audio_dec/xine_musepack_decoder.c540
-rw-r--r--src/audio_out/Makefile.am102
-rw-r--r--src/audio_out/audio_alsa_out.c34
-rw-r--r--src/audio_out/audio_arts_out.c416
-rw-r--r--src/audio_out/audio_coreaudio_out.c30
-rw-r--r--src/audio_out/audio_directx2_out.c29
-rw-r--r--src/audio_out/audio_directx_out.c26
-rw-r--r--src/audio_out/audio_esd_out.c32
-rw-r--r--src/audio_out/audio_file_out.c32
-rw-r--r--src/audio_out/audio_fusionsound_out.c71
-rw-r--r--src/audio_out/audio_irixal_out.c8
-rw-r--r--src/audio_out/audio_jack_out.c52
-rw-r--r--src/audio_out/audio_none_out.c30
-rw-r--r--src/audio_out/audio_oss_out.c46
-rw-r--r--src/audio_out/audio_pulse_out.c20
-rw-r--r--src/audio_out/audio_sndio_out.c22
-rw-r--r--src/audio_out/audio_sun_out.c34
-rw-r--r--src/combined/Makefile.am64
-rw-r--r--src/combined/combined_wavpack.c44
-rw-r--r--src/combined/combined_wavpack.h48
-rw-r--r--src/combined/decoder_flac.c454
-rw-r--r--src/combined/decoder_wavpack.c338
-rw-r--r--src/combined/demux_flac.c771
-rw-r--r--src/combined/demux_flac.h26
-rw-r--r--src/combined/demux_wavpack.c414
-rw-r--r--src/combined/ffmpeg/Makefile.am58
-rw-r--r--src/combined/ffmpeg/ff_audio_decoder.c25
-rw-r--r--src/combined/ffmpeg/ff_dvaudio_decoder.c432
-rw-r--r--src/combined/ffmpeg/ff_mpeg_parser.h2
-rw-r--r--src/combined/ffmpeg/ff_video_decoder.c68
-rw-r--r--src/combined/ffmpeg/ffmpeg_decoder.c284
-rw-r--r--src/combined/ffmpeg/ffmpeg_decoder.h4
-rw-r--r--src/combined/ffmpeg/ffmpeg_encoder.c336
-rwxr-xr-xsrc/combined/ffmpeg/mkcodeclist.pl9
-rw-r--r--src/combined/ffmpeg/xine_audio.list1
-rw-r--r--src/combined/ffmpeg/xine_video.list3
-rw-r--r--src/combined/flac_decoder.c432
-rw-r--r--src/combined/flac_demuxer.c726
-rw-r--r--src/combined/nsf_combined.c42
-rw-r--r--src/combined/nsf_combined.h22
-rw-r--r--src/combined/nsf_decoder.c251
-rw-r--r--src/combined/nsf_demuxer.c353
-rw-r--r--src/combined/wavpack_combined.c44
-rw-r--r--src/combined/wavpack_combined.h45
-rw-r--r--src/combined/wavpack_decoder.c328
-rw-r--r--src/combined/wavpack_demuxer.c376
-rw-r--r--src/combined/xine_ogg_demuxer.c2260
-rw-r--r--src/combined/xine_speex_decoder.c404
-rw-r--r--src/combined/xine_theora_decoder.c369
-rw-r--r--src/combined/xine_vorbis_decoder.c366
-rw-r--r--src/demuxers/Makefile.am79
-rw-r--r--src/demuxers/asfheader.c43
-rw-r--r--src/demuxers/demux.h212
-rw-r--r--src/demuxers/demux_4xm.c60
-rw-r--r--src/demuxers/demux_aac.c81
-rw-r--r--src/demuxers/demux_ac3.c62
-rw-r--r--src/demuxers/demux_aiff.c67
-rw-r--r--src/demuxers/demux_asf.c105
-rw-r--r--src/demuxers/demux_aud.c63
-rw-r--r--src/demuxers/demux_avi.c71
-rw-r--r--src/demuxers/demux_cdda.c58
-rw-r--r--src/demuxers/demux_dts.c62
-rw-r--r--src/demuxers/demux_eawve.c56
-rw-r--r--src/demuxers/demux_elem.c59
-rw-r--r--src/demuxers/demux_film.c68
-rw-r--r--src/demuxers/demux_flac.c76
-rw-r--r--src/demuxers/demux_fli.c63
-rw-r--r--src/demuxers/demux_flv.c51
-rw-r--r--src/demuxers/demux_idcin.c67
-rw-r--r--src/demuxers/demux_iff.c178
-rw-r--r--src/demuxers/demux_image.c64
-rw-r--r--src/demuxers/demux_ipmovie.c56
-rw-r--r--src/demuxers/demux_matroska-chapters.c6
-rw-r--r--src/demuxers/demux_matroska.c146
-rw-r--r--src/demuxers/demux_matroska.h6
-rw-r--r--src/demuxers/demux_mng.c57
-rw-r--r--src/demuxers/demux_mod.c77
-rw-r--r--src/demuxers/demux_mpc.c67
-rw-r--r--src/demuxers/demux_mpeg.c70
-rw-r--r--src/demuxers/demux_mpeg_block.c79
-rw-r--r--src/demuxers/demux_mpeg_pes.c87
-rw-r--r--src/demuxers/demux_mpgaudio.c117
-rw-r--r--src/demuxers/demux_nsf.c386
-rw-r--r--src/demuxers/demux_nsv.c73
-rw-r--r--src/demuxers/demux_ogg.c2312
-rw-r--r--src/demuxers/demux_playlist.c722
-rw-r--r--src/demuxers/demux_pva.c63
-rw-r--r--src/demuxers/demux_qt.c678
-rw-r--r--src/demuxers/demux_rawdv.c64
-rw-r--r--src/demuxers/demux_real.c84
-rw-r--r--src/demuxers/demux_realaudio.c61
-rw-r--r--src/demuxers/demux_roq.c61
-rw-r--r--src/demuxers/demux_shn.c62
-rw-r--r--src/demuxers/demux_slave.c53
-rw-r--r--src/demuxers/demux_smjpeg.c66
-rw-r--r--src/demuxers/demux_snd.c68
-rw-r--r--src/demuxers/demux_str.c61
-rw-r--r--src/demuxers/demux_ts.c151
-rw-r--r--src/demuxers/demux_tta.c66
-rw-r--r--src/demuxers/demux_vc1es.c406
-rw-r--r--src/demuxers/demux_vmd.c62
-rw-r--r--src/demuxers/demux_voc.c62
-rw-r--r--src/demuxers/demux_vox.c62
-rw-r--r--src/demuxers/demux_vqa.c62
-rw-r--r--src/demuxers/demux_wav.c61
-rw-r--r--src/demuxers/demux_wc3movie.c60
-rw-r--r--src/demuxers/demux_yuv4mpeg2.c62
-rw-r--r--src/demuxers/demux_yuv_frames.c51
-rw-r--r--src/demuxers/ebml.c59
-rw-r--r--src/demuxers/ebml.h8
-rw-r--r--src/demuxers/group_audio.c56
-rw-r--r--src/demuxers/group_audio.h10
-rw-r--r--src/demuxers/group_games.c26
-rw-r--r--src/demuxers/group_games.h2
-rw-r--r--src/demuxers/id3.c139
-rw-r--r--src/demuxers/id3.h24
-rw-r--r--src/demuxers/iff.h2
-rw-r--r--src/demuxers/matroska.h6
-rw-r--r--src/dxr3/Makefile.am44
-rw-r--r--src/dxr3/dxr3.h22
-rw-r--r--src/dxr3/dxr3_decode_spu.c55
-rw-r--r--src/dxr3/dxr3_decode_video.c56
-rw-r--r--src/dxr3/dxr3_mpeg_encoders.c53
-rw-r--r--src/dxr3/dxr3_scr.h2
-rw-r--r--src/dxr3/ffmpeg_encoder.c339
-rw-r--r--src/dxr3/video_out_dxr3.c83
-rw-r--r--src/dxr3/video_out_dxr3.h4
-rw-r--r--src/input/Makefile.am120
-rw-r--r--src/input/base64.c131
-rw-r--r--src/input/base64.h91
-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/http_helper.c26
-rw-r--r--src/input/http_helper.h27
-rw-r--r--src/input/input_bluray.c47
-rw-r--r--src/input/input_cdda.c355
-rw-r--r--src/input/input_dvb.c189
-rw-r--r--src/input/input_dvd.c110
-rw-r--r--src/input/input_file.c51
-rw-r--r--src/input/input_gnome_vfs.c29
-rw-r--r--src/input/input_http.c211
-rw-r--r--src/input/input_mms.c41
-rw-r--r--src/input/input_net.c31
-rw-r--r--src/input/input_plugin.h393
-rw-r--r--src/input/input_pnm.c31
-rw-r--r--src/input/input_pvr.c35
-rw-r--r--src/input/input_rtp.c32
-rw-r--r--src/input/input_rtsp.c31
-rw-r--r--src/input/input_smb.c33
-rw-r--r--src/input/input_stdin_fifo.c32
-rw-r--r--src/input/input_v4l.c82
-rw-r--r--src/input/input_v4l2.c31
-rw-r--r--src/input/input_vcd.c32
-rw-r--r--src/input/libdvdnav/Makefile.am9
-rw-r--r--src/input/libdvdnav/diff_against_cvs.patch33
-rw-r--r--src/input/libdvdnav/dvd_reader.c2
-rw-r--r--src/input/libdvdnav/ifo_types.h22
-rw-r--r--src/input/libreal/Makefile.am21
-rw-r--r--src/input/libreal/asmrp.c2
-rw-r--r--src/input/libreal/real.c11
-rw-r--r--src/input/libreal/rmff.c47
-rw-r--r--src/input/libreal/rmff.h12
-rw-r--r--src/input/libreal/sdpplin.c96
-rw-r--r--src/input/librtsp/Makefile.am17
-rw-r--r--src/input/librtsp/rtsp.c27
-rw-r--r--src/input/librtsp/rtsp.h10
-rw-r--r--src/input/librtsp/rtsp_session.c22
-rw-r--r--src/input/media_helper.h2
-rw-r--r--src/input/mms.c12
-rw-r--r--src/input/mms.h2
-rw-r--r--src/input/mmsh.c8
-rw-r--r--src/input/mmsh.h2
-rw-r--r--src/input/net_buf_ctrl.c23
-rw-r--r--src/input/net_buf_ctrl.h8
-rw-r--r--src/input/pnm.c8
-rw-r--r--src/input/pnm.h2
-rw-r--r--src/input/sha1.c327
-rw-r--r--src/input/sha1.h60
-rw-r--r--src/input/vcd/Makefile.am26
-rw-r--r--src/input/vcd/libcdio/FreeBSD/freebsd.c639
-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_linux.c1198
-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/vcdio.c106
-rw-r--r--src/input/vcd/vcdio.h26
-rw-r--r--src/input/vcd/vcdplayer.c288
-rw-r--r--src/input/vcd/vcdplayer.h84
-rw-r--r--src/input/vcd/xine-extra.h6
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c41
-rw-r--r--src/liba52/Makefile.am39
-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/imdct.c431
-rw-r--r--src/liba52/parse.c894
-rw-r--r--src/liba52/xine_a52_decoder.c875
-rw-r--r--src/libdts/Makefile.am29
-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/libdts/xine_dts_decoder.c628
-rw-r--r--src/libfaad/Makefile.am132
-rw-r--r--src/libfaad/codebook/Makefile.am15
-rw-r--r--src/libfaad/diff_to_faad2_cvs.patch101
-rw-r--r--src/libfaad/xine_faad_decoder.c517
-rw-r--r--src/libffmpeg/Makefile.am12
-rw-r--r--src/libffmpeg/diff_to_ffmpeg_cvs.txt619
-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.am57
-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.am58
-rw-r--r--src/libmad/bit.c238
-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.c535
-rw-r--r--src/libmad/layer12.h31
-rw-r--r--src/libmad/layer3.c2699
-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/libmad/xine_mad_decoder.c459
-rw-r--r--src/libmpeg2/Makefile.am31
-rw-r--r--src/libmpeg2/cpu_state.c183
-rw-r--r--src/libmpeg2/decode.c1010
-rw-r--r--src/libmpeg2/header.c419
-rw-r--r--src/libmpeg2/idct.c348
-rw-r--r--src/libmpeg2/idct_altivec.c233
-rw-r--r--src/libmpeg2/idct_mmx.c740
-rw-r--r--src/libmpeg2/libmpeg2_accel.c223
-rw-r--r--src/libmpeg2/motion_comp.c154
-rw-r--r--src/libmpeg2/motion_comp_mmx.c1012
-rw-r--r--src/libmpeg2/mpeg2_internal.h294
-rw-r--r--src/libmpeg2/slice.c1833
-rw-r--r--src/libmpeg2/slice_xvmc.c1988
-rw-r--r--src/libmpeg2/slice_xvmc_vld.c229
-rw-r--r--src/libmpeg2/stats.c317
-rw-r--r--src/libmpeg2/xine_mpeg2_decoder.c186
-rw-r--r--src/libmpeg2new/Makefile.am18
-rw-r--r--src/libmpeg2new/include/Makefile.am4
-rw-r--r--src/libmpeg2new/include/attributes.h33
-rw-r--r--src/libmpeg2new/libmpeg2/Makefile.am20
-rw-r--r--src/libmpeg2new/libmpeg2/idct_alpha.c379
-rw-r--r--src/libmpeg2new/libmpeg2/idct_altivec.c288
-rw-r--r--src/libmpeg2new/libmpeg2/rgb.c598
-rw-r--r--src/libmpeg2new/libmpeg2/rgb_mmx.c321
-rw-r--r--src/libmpeg2new/libmpeg2/rgb_vis.c384
-rw-r--r--src/libmpeg2new/xine_mpeg2new_decoder.c525
-rw-r--r--src/libmusepack/Makefile.am27
-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/libmusepack/xine_musepack_decoder.c547
-rw-r--r--src/libreal/Makefile.am10
-rw-r--r--src/libreal/real_common.c4
-rw-r--r--src/libreal/real_common.h2
-rw-r--r--src/libreal/xine_real_audio_decoder.c29
-rw-r--r--src/libreal/xine_real_video_decoder.c29
-rw-r--r--src/libspucc/Makefile.am11
-rw-r--r--src/libspucc/cc_decoder.c1486
-rw-r--r--src/libspucc/cc_decoder.h83
-rw-r--r--src/libspucc/xine_cc_decoder.c376
-rw-r--r--src/libspucmml/Makefile.am9
-rw-r--r--src/libspucmml/xine_cmml_decoder.c537
-rw-r--r--src/libspudec/Makefile.am27
-rw-r--r--src/libspudec/spu.c1035
-rw-r--r--src/libspudec/spu.h146
-rw-r--r--src/libspudec/xine_spu_decoder.c407
-rw-r--r--src/libspudvb/Makefile.am9
-rw-r--r--src/libspudvb/xine_spudvb_decoder.c992
-rw-r--r--src/libspuhdmv/Makefile.am9
-rw-r--r--src/libspuhdmv/xine_hdmv_decoder.c1095
-rw-r--r--src/libsputext/Makefile.am14
-rw-r--r--src/libsputext/demux_sputext.c1493
-rw-r--r--src/libsputext/xine_sputext_decoder.c1215
-rw-r--r--src/libw32dll/DirectShow/Makefile.am35
-rw-r--r--src/libw32dll/Makefile.am40
-rw-r--r--src/libw32dll/dmo/Makefile.am28
-rw-r--r--src/libw32dll/qt_decoder.c51
-rw-r--r--src/libw32dll/qtx/Makefile.am1
-rw-r--r--src/libw32dll/qtx/qtxsdk/Makefile.am1
-rw-r--r--src/libw32dll/w32codec.c55
-rw-r--r--src/libw32dll/wine/Makefile.am61
-rw-r--r--src/libw32dll/wine/debugtools.h2
-rw-r--r--src/libw32dll/wine/ext.h2
-rw-r--r--src/libw32dll/wine/registry.c41
-rw-r--r--src/libw32dll/wine/win32.c6
-rw-r--r--src/libw32dll/wine/windef.h7
-rw-r--r--src/libxineadec/Makefile.am48
-rw-r--r--src/libxineadec/fooaudio.c352
-rw-r--r--src/libxineadec/gsm610.c293
-rw-r--r--src/libxineadec/gsm610/Makefile.am25
-rw-r--r--src/libxineadec/gsm610/long_term.c964
-rw-r--r--src/libxineadec/gsm610/lpc.c354
-rw-r--r--src/libxineadec/gsm610/rpe.c493
-rw-r--r--src/libxineadec/gsm610/short_term.c432
-rw-r--r--src/libxineadec/nosefart/Makefile.am34
-rw-r--r--src/libxineadec/nosefart/diff_to_nosefart_cvs.patch325
-rw-r--r--src/libxineadec/nosefart/log.h53
-rw-r--r--src/libxineadec/nosefart/nsf.h184
-rw-r--r--src/libxineadec/nosefart/osd.h98
-rw-r--r--src/libxineadec/nsf.c297
-rw-r--r--src/libxineadec/xine_lpcm_decoder.c417
-rw-r--r--src/libxineadec/xine_speex_decoder.c422
-rw-r--r--src/libxineadec/xine_vorbis_decoder.c385
-rw-r--r--src/libxinevdec/Makefile.am47
-rw-r--r--src/libxinevdec/bitplane.c1586
-rw-r--r--src/libxinevdec/foovideo.c305
-rw-r--r--src/libxinevdec/gdkpixbuf.c316
-rw-r--r--src/libxinevdec/image.c323
-rw-r--r--src/libxinevdec/rgb.c467
-rw-r--r--src/libxinevdec/xine_theora_decoder.c398
-rw-r--r--src/libxinevdec/yuv.c394
-rw-r--r--src/post/Makefile.am4
-rw-r--r--src/post/audio/Makefile.am10
-rw-r--r--src/post/audio/audio_filters.c16
-rw-r--r--src/post/audio/audio_filters.h2
-rw-r--r--src/post/audio/stretch.c31
-rw-r--r--src/post/audio/upmix.c29
-rw-r--r--src/post/audio/upmix_mono.c27
-rw-r--r--src/post/audio/volnorm.c29
-rw-r--r--src/post/deinterlace/Makefile.am11
-rw-r--r--src/post/deinterlace/deinterlace.c2
-rw-r--r--src/post/deinterlace/plugins/Makefile.am51
-rw-r--r--src/post/deinterlace/plugins/greedy.c5
-rw-r--r--src/post/deinterlace/plugins/greedy2frame.c4
-rw-r--r--src/post/deinterlace/plugins/greedy2frame_template.c2
-rw-r--r--src/post/deinterlace/plugins/greedyh.asm1
-rw-r--r--src/post/deinterlace/plugins/kdetv_greedyh.c4
-rw-r--r--src/post/deinterlace/plugins/kdetv_tomsmocomp.c4
-rw-r--r--src/post/deinterlace/plugins/linearblend.c5
-rw-r--r--src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc2
-rw-r--r--src/post/deinterlace/plugins/vfir.c5
-rw-r--r--src/post/deinterlace/speedy.c5
-rw-r--r--src/post/deinterlace/xine_plugin.c30
-rw-r--r--src/post/goom/Makefile.am48
-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
-rw-r--r--src/post/goom/goom_core.c2
-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/goom/xine_goom.c24
-rw-r--r--src/post/mosaico/Makefile.am8
-rw-r--r--src/post/mosaico/mosaico.c31
-rw-r--r--src/post/mosaico/switch.c31
-rw-r--r--src/post/planar/Makefile.am41
-rw-r--r--src/post/planar/boxblur.c33
-rw-r--r--src/post/planar/denoise3d.c33
-rw-r--r--src/post/planar/eq.c33
-rw-r--r--src/post/planar/eq2.c33
-rw-r--r--src/post/planar/expand.c31
-rw-r--r--src/post/planar/fill.c30
-rw-r--r--src/post/planar/invert.c31
-rw-r--r--src/post/planar/noise.c49
-rw-r--r--src/post/planar/planar.c26
-rw-r--r--src/post/planar/pp.c59
-rw-r--r--src/post/planar/unsharp.c32
-rw-r--r--src/post/visualizations/Makefile.am10
-rw-r--r--src/post/visualizations/fft.c12
-rw-r--r--src/post/visualizations/fft.h1
-rw-r--r--src/post/visualizations/fftgraph.c29
-rw-r--r--src/post/visualizations/fftscope.c29
-rw-r--r--src/post/visualizations/fooviz.c31
-rw-r--r--src/post/visualizations/oscope.c29
-rw-r--r--src/post/visualizations/visualizations.c10
-rw-r--r--src/post/visualizations/visualizations.h2
-rw-r--r--src/spu_dec/Makefile.am42
-rw-r--r--src/spu_dec/cc_decoder.c1517
-rw-r--r--src/spu_dec/cc_decoder.h80
-rw-r--r--src/spu_dec/cmml_decoder.c525
-rw-r--r--src/spu_dec/nav_read.c (renamed from src/libspudec/nav_read.c)0
-rw-r--r--src/spu_dec/spu_decoder.c386
-rw-r--r--src/spu_dec/spudec.c1034
-rw-r--r--src/spu_dec/spudec.h146
-rw-r--r--src/spu_dec/spudvb_decoder.c1218
-rw-r--r--src/spu_dec/spuhdmv_decoder.c1072
-rw-r--r--src/spu_dec/sputext_decoder.c1211
-rw-r--r--src/spu_dec/sputext_demuxer.c1452
-rw-r--r--src/spu_dec/xine_cc_decoder.c361
-rw-r--r--src/vdr/Makefile.am14
-rw-r--r--src/vdr/combined_vdr.c44
-rw-r--r--src/vdr/combined_vdr.h82
-rw-r--r--src/vdr/input_vdr.c2771
-rw-r--r--src/vdr/post_vdr_audio.c266
-rw-r--r--src/vdr/post_vdr_video.c483
-rw-r--r--src/video_dec/Makefile.am45
-rw-r--r--src/video_dec/bitplane.c1550
-rw-r--r--src/video_dec/foovideo.c285
-rw-r--r--src/video_dec/gdkpixbuf.c299
-rw-r--r--src/video_dec/image.c306
-rw-r--r--src/video_dec/libmpeg2/Makefile.am34
-rw-r--r--src/video_dec/libmpeg2/cpu_state.c184
-rw-r--r--src/video_dec/libmpeg2/decode.c1006
-rw-r--r--src/video_dec/libmpeg2/header.c419
-rw-r--r--src/video_dec/libmpeg2/idct.c348
-rw-r--r--src/video_dec/libmpeg2/idct_altivec.c233
-rw-r--r--src/video_dec/libmpeg2/idct_mlib.c (renamed from src/libmpeg2/idct_mlib.c)0
-rw-r--r--src/video_dec/libmpeg2/idct_mlib.h (renamed from src/libmpeg2/idct_mlib.h)0
-rw-r--r--src/video_dec/libmpeg2/idct_mmx.c741
-rw-r--r--src/video_dec/libmpeg2/libmpeg2_accel.c223
-rw-r--r--src/video_dec/libmpeg2/libmpeg2_accel.h (renamed from src/libmpeg2/libmpeg2_accel.h)0
-rw-r--r--src/video_dec/libmpeg2/motion_comp.c154
-rw-r--r--src/video_dec/libmpeg2/motion_comp_altivec.c (renamed from src/libmpeg2/motion_comp_altivec.c)0
-rw-r--r--src/video_dec/libmpeg2/motion_comp_mlib.c (renamed from src/libmpeg2/motion_comp_mlib.c)0
-rw-r--r--src/video_dec/libmpeg2/motion_comp_mmx.c1013
-rw-r--r--src/video_dec/libmpeg2/motion_comp_vis.c (renamed from src/libmpeg2/motion_comp_vis.c)0
-rw-r--r--src/video_dec/libmpeg2/mpeg2.h (renamed from src/libmpeg2/mpeg2.h)0
-rw-r--r--src/video_dec/libmpeg2/mpeg2_internal.h294
-rw-r--r--src/video_dec/libmpeg2/slice.c1833
-rw-r--r--src/video_dec/libmpeg2/slice_xvmc.c1988
-rw-r--r--src/video_dec/libmpeg2/slice_xvmc_vld.c229
-rw-r--r--src/video_dec/libmpeg2/stats.c317
-rw-r--r--src/video_dec/libmpeg2/vis.h (renamed from src/libmpeg2/vis.h)0
-rw-r--r--src/video_dec/libmpeg2/vlc.h (renamed from src/libmpeg2/vlc.h)0
-rw-r--r--src/video_dec/libmpeg2/xine_mpeg2_decoder.c173
-rw-r--r--src/video_dec/libmpeg2/xvmc.h (renamed from src/libmpeg2/xvmc.h)0
-rw-r--r--src/video_dec/libmpeg2/xvmc_vld.h (renamed from src/libmpeg2/xvmc_vld.h)0
-rw-r--r--src/video_dec/libmpeg2new/Makefile.am20
-rw-r--r--src/video_dec/libmpeg2new/include/Makefile.am5
-rw-r--r--src/video_dec/libmpeg2new/include/alpha_asm.h (renamed from src/libmpeg2new/include/alpha_asm.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/attributes.h33
-rw-r--r--src/video_dec/libmpeg2new/include/mmx.h (renamed from src/libmpeg2new/include/mmx.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/mpeg2.h (renamed from src/libmpeg2new/include/mpeg2.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/mpeg2convert.h (renamed from src/libmpeg2new/include/mpeg2convert.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/sse.h (renamed from src/libmpeg2new/include/sse.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/tendra.h (renamed from src/libmpeg2new/include/tendra.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/video_out.h (renamed from src/libmpeg2new/include/video_out.h)0
-rw-r--r--src/video_dec/libmpeg2new/include/vis.h (renamed from src/libmpeg2new/include/vis.h)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/Makefile.am23
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/alloc.c (renamed from src/libmpeg2new/libmpeg2/alloc.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/configure.incl (renamed from src/libmpeg2new/libmpeg2/configure.incl)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/convert_internal.h (renamed from src/libmpeg2new/libmpeg2/convert_internal.h)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/cpu_accel.c (renamed from src/libmpeg2new/libmpeg2/cpu_accel.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/cpu_state.c (renamed from src/libmpeg2new/libmpeg2/cpu_state.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/decode.c (renamed from src/libmpeg2new/libmpeg2/decode.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/header.c (renamed from src/libmpeg2new/libmpeg2/header.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/idct.c (renamed from src/libmpeg2new/libmpeg2/idct.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/idct_alpha.c379
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/idct_altivec.c288
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/idct_mlib.c (renamed from src/libmpeg2new/libmpeg2/idct_mlib.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/idct_mmx.c (renamed from src/libmpeg2new/libmpeg2/idct_mmx.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/libmpeg2.pc.in (renamed from src/libmpeg2new/libmpeg2/libmpeg2.pc.in)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/libmpeg2convert.pc.in (renamed from src/libmpeg2new/libmpeg2/libmpeg2convert.pc.in)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/motion_comp.c (renamed from src/libmpeg2new/libmpeg2/motion_comp.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/motion_comp_alpha.c (renamed from src/libmpeg2new/libmpeg2/motion_comp_alpha.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/motion_comp_altivec.c (renamed from src/libmpeg2new/libmpeg2/motion_comp_altivec.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/motion_comp_mlib.c (renamed from src/libmpeg2new/libmpeg2/motion_comp_mlib.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/motion_comp_mmx.c (renamed from src/libmpeg2new/libmpeg2/motion_comp_mmx.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/motion_comp_vis.c (renamed from src/libmpeg2new/libmpeg2/motion_comp_vis.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/mpeg2_internal.h (renamed from src/libmpeg2new/libmpeg2/mpeg2_internal.h)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/rgb.c598
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/rgb_mmx.c321
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/rgb_vis.c384
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/slice.c (renamed from src/libmpeg2new/libmpeg2/slice.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/uyvy.c (renamed from src/libmpeg2new/libmpeg2/uyvy.c)0
-rw-r--r--src/video_dec/libmpeg2new/libmpeg2/vlc.h (renamed from src/libmpeg2new/libmpeg2/vlc.h)0
-rw-r--r--src/video_dec/libmpeg2new/xine_mpeg2new_decoder.c512
-rw-r--r--src/video_dec/libvdpau/Makefile.am42
-rw-r--r--src/video_dec/libvdpau/alterh264_bits_reader.h127
-rw-r--r--src/video_dec/libvdpau/alterh264_decode.c2448
-rw-r--r--src/video_dec/libvdpau/alterh264_decode.h339
-rw-r--r--src/video_dec/libvdpau/bits_reader.h82
-rw-r--r--src/video_dec/libvdpau/cpb.c49
-rw-r--r--src/video_dec/libvdpau/cpb.h67
-rw-r--r--src/video_dec/libvdpau/dpb.c622
-rw-r--r--src/video_dec/libvdpau/dpb.h117
-rw-r--r--src/video_dec/libvdpau/h264_parser.c2038
-rw-r--r--src/video_dec/libvdpau/h264_parser.h110
-rw-r--r--src/video_dec/libvdpau/nal.c213
-rw-r--r--src/video_dec/libvdpau/nal.h501
-rw-r--r--src/video_dec/libvdpau/vdpau_h264.c1014
-rw-r--r--src/video_dec/libvdpau/vdpau_mpeg12.c1101
-rw-r--r--src/video_dec/libvdpau/vdpau_mpeg4.c1194
-rw-r--r--src/video_dec/libvdpau/vdpau_vc1.c1176
-rw-r--r--src/video_dec/rgb.c451
-rw-r--r--src/video_dec/yuv.c377
-rw-r--r--src/video_out/Makefile.am150
-rw-r--r--src/video_out/deinterlace.c863
-rw-r--r--src/video_out/deinterlace.h46
-rw-r--r--src/video_out/libdha/Makefile.am42
-rw-r--r--src/video_out/libdha/bin/Makefile.am3
-rw-r--r--src/video_out/libdha/kernelhelper/Makefile.am53
-rw-r--r--src/video_out/libdha/oth/Makefile.am3
-rw-r--r--src/video_out/libdha/sysdep/Makefile.am35
-rw-r--r--src/video_out/macosx/Makefile.am26
-rw-r--r--src/video_out/macosx/XineOpenGLView.m6
-rw-r--r--src/video_out/video_out_aa.c66
-rw-r--r--src/video_out/video_out_caca.c78
-rw-r--r--src/video_out/video_out_directfb.c75
-rw-r--r--src/video_out/video_out_directfb_fb.c25
-rw-r--r--src/video_out/video_out_directfb_x.c25
-rw-r--r--src/video_out/video_out_directx.c29
-rw-r--r--src/video_out/video_out_fb.c142
-rw-r--r--src/video_out/video_out_macosx.m29
-rw-r--r--src/video_out/video_out_none.c30
-rw-r--r--src/video_out/video_out_opengl.c68
-rw-r--r--src/video_out/video_out_pgx32.c31
-rw-r--r--src/video_out/video_out_pgx64.c35
-rw-r--r--src/video_out/video_out_raw.c100
-rw-r--r--src/video_out/video_out_sdl.c31
-rw-r--r--src/video_out/video_out_stk.c34
-rw-r--r--src/video_out/video_out_syncfb.c1133
-rw-r--r--src/video_out/video_out_syncfb.h236
-rw-r--r--src/video_out/video_out_vdpau.c3273
-rw-r--r--src/video_out/video_out_vidix.c62
-rw-r--r--src/video_out/video_out_xcbshm.c131
-rw-r--r--src/video_out/video_out_xcbxv.c314
-rw-r--r--src/video_out/video_out_xshm.c141
-rw-r--r--src/video_out/video_out_xv.c333
-rw-r--r--src/video_out/video_out_xvmc.c170
-rw-r--r--src/video_out/video_out_xxmc.c226
-rw-r--r--src/video_out/vidix/Makefile.am21
-rw-r--r--src/video_out/vidix/drivers/Makefile.am66
-rw-r--r--src/video_out/x11osd.c2
-rw-r--r--src/video_out/x11osd.h2
-rw-r--r--src/video_out/xcbosd.c2
-rw-r--r--src/video_out/xcbosd.h2
-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.h9
-rw-r--r--src/video_out/yuv2rgb.c13
-rw-r--r--src/video_out/yuv2rgb_mlib.c4
-rw-r--r--src/video_out/yuv2rgb_mmx.c11
-rw-r--r--src/xine-engine/Makefile.am81
-rw-r--r--src/xine-engine/accel_vdpau.h65
-rw-r--r--src/xine-engine/accel_xvmc.h7
-rw-r--r--src/xine-engine/alphablend.c6
-rw-r--r--src/xine-engine/alphablend.h121
-rw-r--r--src/xine-engine/audio_decoder.c5
-rw-r--r--src/xine-engine/audio_decoder.h98
-rw-r--r--src/xine-engine/audio_out.c64
-rw-r--r--src/xine-engine/audio_out.h343
-rw-r--r--src/xine-engine/broadcaster.c17
-rw-r--r--src/xine-engine/buffer.c25
-rw-r--r--src/xine-engine/buffer.h698
-rw-r--r--src/xine-engine/buffer_types.c41
-rw-r--r--src/xine-engine/configfile.c376
-rw-r--r--src/xine-engine/configfile.h217
-rw-r--r--src/xine-engine/demux.c61
-rw-r--r--src/xine-engine/events.c2
-rw-r--r--src/xine-engine/info_helper.c2
-rw-r--r--src/xine-engine/input_cache.c8
-rw-r--r--src/xine-engine/input_rip.c6
-rw-r--r--src/xine-engine/io_helper.c17
-rw-r--r--src/xine-engine/io_helper.h141
-rw-r--r--src/xine-engine/load_plugins.c337
-rw-r--r--src/xine-engine/lrb.c2
-rw-r--r--src/xine-engine/lrb.h6
-rw-r--r--src/xine-engine/metronom.c13
-rw-r--r--src/xine-engine/metronom.h364
-rw-r--r--src/xine-engine/osd.c505
-rw-r--r--src/xine-engine/osd.h365
-rw-r--r--src/xine-engine/plugin_catalog.h99
-rw-r--r--src/xine-engine/post.c33
-rw-r--r--src/xine-engine/post.h390
-rw-r--r--src/xine-engine/refcounter.c4
-rw-r--r--src/xine-engine/refcounter.h42
-rw-r--r--src/xine-engine/resample.c4
-rw-r--r--src/xine-engine/scratch.c5
-rw-r--r--src/xine-engine/spu.c62
-rw-r--r--src/xine-engine/spu_decoder.h144
-rw-r--r--src/xine-engine/tvmode.c65
-rw-r--r--src/xine-engine/video_decoder.c7
-rw-r--r--src/xine-engine/video_decoder.h104
-rw-r--r--src/xine-engine/video_out.c421
-rw-r--r--src/xine-engine/video_out.h455
-rw-r--r--src/xine-engine/video_overlay.c14
-rw-r--r--src/xine-engine/video_overlay.h103
-rw-r--r--src/xine-engine/vo_scale.c39
-rw-r--r--src/xine-engine/vo_scale.h200
-rw-r--r--src/xine-engine/xine.c330
-rw-r--r--src/xine-engine/xine_interface.c39
-rw-r--r--src/xine-engine/xine_internal.h543
-rw-r--r--src/xine-engine/xine_plugin.h105
-rw-r--r--src/xine-engine/xine_private.h84
-rw-r--r--src/xine-utils/Makefile.am34
-rw-r--r--src/xine-utils/array.c4
-rw-r--r--src/xine-utils/color.c3
-rw-r--r--src/xine-utils/copy.c2
-rw-r--r--src/xine-utils/cpu_accel.c34
-rw-r--r--src/xine-utils/list.c4
-rw-r--r--src/xine-utils/memcpy.c47
-rw-r--r--src/xine-utils/monitor.c2
-rw-r--r--src/xine-utils/pool.c6
-rw-r--r--src/xine-utils/ring_buffer.c8
-rw-r--r--src/xine-utils/sorted_array.c4
-rw-r--r--src/xine-utils/utils.c376
-rw-r--r--src/xine-utils/xine_buffer.c2
-rw-r--r--src/xine-utils/xine_buffer.h136
-rw-r--r--src/xine-utils/xine_check.c2
-rw-r--r--src/xine-utils/xine_mutex.c2
-rw-r--r--src/xine-utils/xineutils.h546
-rw-r--r--src/xine-utils/xmllexer.c161
-rw-r--r--src/xine-utils/xmllexer.h77
-rw-r--r--src/xine-utils/xmlparser.c419
-rw-r--r--src/xine-utils/xmlparser.h97
-rwxr-xr-xversion.sh58
-rw-r--r--win32/Makefile.am14
-rwxr-xr-x[-rw-r--r--]win32/README0
-rwxr-xr-x[-rw-r--r--]win32/config.h0
-rw-r--r--win32/include/Makefile.am14
-rw-r--r--win32/include/msvc/inttypes.h10
-rw-r--r--win32/include/msvc/stdint.h8
-rwxr-xr-x[-rw-r--r--]win32/include/sys/socket.h10
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_audio.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_lpcm.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_nsv.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_pva.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_real.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_slave.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_yuv4mpeg2.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_dmx_yuv_frames.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_inp_cdda.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_inp_http.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_inp_net.dsp0
-rwxr-xr-x[-rw-r--r--]win32/xineplug_vo_out_sdl.dsp0
1544 files changed, 153436 insertions, 372228 deletions
diff --git a/.hgignore b/.hgignore
index 38b9d4414..7b5551500 100644
--- a/.hgignore
+++ b/.hgignore
@@ -2,11 +2,17 @@ syntax: glob
*~
*.orig
+xine-lib-*.tar.{gz,bz2,xz}
+
+*.o
+*.a
*.lo
*.la
-*.o
-.libs/*
+*.so
+*.loT
+.libs
.deps/*
+.depend
Makefile
Makefile.in
@@ -37,22 +43,36 @@ autom4te.cache
build-stamp
configure-stamp
debian/files
-debian/libxine-dev
-debian/libxine1
-debian/libxine1-dbg
-debian/libxine1-doc
+debian/libxine2-dev
+debian/libxine2
+debian/libxine2-dbg
+debian/libxine2-doc
debian/tmp
debian/*.debhelper
debian/*.debhelper.log
debian/*.substvars
+contrib/ffmpeg/*.pc
+contrib/ffmpeg/.vhookdep
+contrib/ffmpeg/config.err
+contrib/ffmpeg/config.h
+contrib/ffmpeg/config.mak
+contrib/ffmpeg/doc/*.1
+contrib/ffmpeg/doc/*.html
+contrib/ffmpeg/version.h
+contrib/libdha/pci_dev_ids.c
+contrib/libdha/pci_ids.h
+contrib/libdha/pci_names.[ch]
+contrib/libdha/pci_vendors.h
+
doc/faq/faq.html
doc/faq/faq.txt
doc/hackersguide/*.png
doc/hackersguide/hackersguide.html
doc/man/*/xine-list-*.1
+doc/Doxyfile
-include/xine.h
+include/xine/version.h
m4/codeset.m4
m4/gettext.m4
@@ -60,12 +80,14 @@ m4/iconv.m4
m4/intmax.m4
m4/inttypes-pri.m4
m4/inttypes_h.m4
+m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/longdouble.m4
m4/longlong.m4
m4/nls.m4
m4/po.m4
+m4/progtest.m4
m4/size_max.m4
m4/stdint_h.m4
m4/ulonglong.m4
@@ -79,6 +101,16 @@ m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
+m4/glibc2.m4
+m4/glibc21.m4
+m4/intdiv0.m4
+m4/intlmacosx.m4
+m4/lcmessage.m4
+m4/printf-posix.m4
+m4/uintmax_t.m4
+m4/wchar_t.m4
+m4/wint_t.m4
+m4/xsize.m4
misc/Makefile.plugins
misc/SlackBuild
@@ -87,7 +119,9 @@ misc/libxine.pc
misc/relchk.sh
misc/xine-config
misc/xine-lib.spec
+misc/xine-fontconv
misc/xine-list-*
+misc/cdda_server
po/Makevars.extra
po/POTFILES
@@ -103,3 +137,4 @@ src/video_out/libdha/pci_dev_ids.c
src/video_out/libdha/pci_ids.h
src/video_out/libdha/pci_names.[ch]
src/video_out/libdha/pci_vendors.h
+src/xine-utils/xmltest
diff --git a/.hgtags b/.hgtags
index 62c06b846..d6e17a422 100644
--- a/.hgtags
+++ b/.hgtags
@@ -62,10 +62,15 @@ fd12068ebd3fab2438f77b06e312c4244e97950a DXR3_095
7b60f85a95345c41fb074dc5e3f7355d9e72968e xine-lib-1_1_6-release
ab1531337553ad5eac24a69ac665eae33916b423 xine-lib-1_1_7-release
e0a332b9d3e8bb3fad4d7feac1e519292b062056 xine-lib-1_1_8-release
+634308ab9b8276819617cab0bb6d77e10603a375 last-internal-ffmpeg
b6be674453e922114b55d4613cb197c77d19f094 xine-lib-1_1_9-release
9438947f88ad2bed1832385301c6b4e62709625a xine-lib-1_1_9_1-release
7f1232425c6d715c404e6df1292075b33ecb8305 xine-lib-1_1_10-release
0e9e4df266f639ac7ba9e0c204f205686b56d5f9 xine-lib-1_1_10_1-release
+0735b106d018658f72be4a0648b4031c34c7f1e1 vdr-xine-version-711
+af8d20ae15d8c619ce0e215817d4b8fdba814407 vdr-xine-version-801
+c3a5e9ba6dfc694408275a54114d571d68acbd25 vdr-xine-version-712
+ffe7962edb79c2ed967b82a82ccfb2ac7eb148a2 vdr-xine-version-802
10a6bc10e58f45f6cb79f634bdb6b7daa3167742 xine-lib-1_1_11-release
2a2cc543b27b64a6587dfaef4f1d986eb2f2710a xine-lib-1_1_11_1-release
66e1654718fb0581846d60c60bc09ae3b6b8c0cf xine-lib-1_1_12-release
@@ -156,3 +161,5 @@ ff764395a361257b11d73583a0e0851e0f5f2ee5 1.1.17
acba7a8c29cca74b112c2c6db4310ddeb1524696 1.1.19
342128b2fcf59bfe8844b282a228581aa8bbbbde 1.1.20
dde68fe11b973767f0b743ced2b41a244e1e0b78 1.1.20.1
+01846b148cbaa03141bae2e51f8d9df00a2843fb 1.2.0
+ac2c5ea4bc52322c176c2e601a36c298091bfc9b 1.2.1
diff --git a/CREDITS b/CREDITS
index e1723ff20..c94c171d7 100644
--- a/CREDITS
+++ b/CREDITS
@@ -12,18 +12,16 @@ updates (the word 'maintainer' is intentionally avoided here).
project version mediator
-----------------------------------------------------------------------
-ffmpeg 51.29.0 Mike Melanson
goom 2k4-0
gsm610 1.0.10 Mike Melanson
liba52 0.7.4
-libcdio 0.71 [o]
-libdts 0.0.2
+libca 0.0.5
libdvdnav 0.1.10 Michael Roitzsch
-libfaad cvs-2005-01-30 [GPL] Miguel Freitas
+libfaad 2.6.1 Miguel Freitas
libmad 0.15.1b Miguel Freitas
libmpeg2 0.2.1 [*]
-libmusepack svn 13/01/05 James Stembridge
-libvcd 0.7.21 [o]
+libmpcdec 1.2.5
+libxdg-basedir 0.1.3 Diego Pettenò
nosefart 2.7-mls Mike Melanson
tvtime 0.9.8.4 Miguel Freitas
wine
@@ -31,11 +29,6 @@ vidix cvs 6/03/05 James Stembridge
-----------------------------------------------------------------------
-[GPL] this is the latest GPL compatible version of FAAD2. later cvs
- snapshots have added an advertisement clause so we cannot update until
- the situation gets fixed.
-
-
[*] common question: lastest version of libmpeg2 is 0.3.1, why don't
you update?
@@ -63,9 +56,3 @@ you update?
update plan for libmpeg2: we should leave our patched libmpeg2 for
hardware accelerated decoding (xvmc) only and use "libmpeg2new" (containing
updated libmpeg2) for software decoding.
-
-
-[o] These libraries are not well maintained and subsetted from the
- packages where they come from. The external versions of libcdio
- and libvcdinfo are preferred. You also get regression tests and
- CD/VCD diagnostic tools.
diff --git a/ChangeLog b/ChangeLog
index 3ebd5595e..b540b62f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,87 @@
+xine-lib (1.2.1.1) 2012-??-??
+ * Fix musepack decoder compilation if libmpcdec headers aren't available.
+ * Configure tests for xinerama & VideoCD support now soft-fail properly.
+ * The DVB plugin is working again.
+
+xine-lib (1.2.1) 2012-02-04
+ * The "I'm at Tyneside LUG" release.
+ * Enable PulseAudio, JACK and VDPAU on the Hurd.
+ * Rewrite of VDPAU OSD handling.
+ * sndio plugin is now buildable.
+ * Various bug fixes.
+
+xine-lib (1.2.0) 2012-01-01
+ * Add support for VDR.
+ * Add support for VDPAU.
+ * xine-config is deprecated in favour of pkg-config libxine.
+ Use "pkgconfig --variable=foo libxine" where you previously used
+ "xine-config --foo".
+ * Reorder and modify public structures to reduce the holes caused by padding
+ especially on 64-bit architectures.
+ * Remove the buttons array from video_overlay, as the feature linked to that
+ was never implemented. This change reduces by 10MB the memory usage of
+ xine-lib during playback (1/3 of the memory used while playing an mp3).
+ * Update libmpcdec (formerly libmusepack) to version 1.2.6 (newer than the
+ previous Subversion snapshot) and contextually move it to
+ contrib/libmpcdec to separate from xine's own code.
+ * Save plugins' cache in the defined cache home directory as per XDG Base
+ Directory Specification.
+ * Use XDG-defined cache home directory for cddb cache.
+ * Use XDG-defined cache home directory for win32codecs fake registry.
+ * Use XDG-defined data directories to look up fonts files both while using
+ FreeType2 and the standard bitmap fonts for OSD.
+ * Replace internal libdts 0.0.2 with libdca 0.0.5, and contextually move it
+ to contrib/libdca to separate from xine's own code.
+ * Add another message code to allow for auth prompts. Previously, it was
+ not possible to distinguish between '401 Authentication Required' and
+ '403 Forbidden'.
+ * Merge the demuxer and the decoder for NSF files in a combined plugin.
+ * Move modplug demuxing to its own plugin. This way, binary distributions
+ can make it optional as it requires quite a bit of CPU time during
+ initialisation, even for audio files that nothing have to do with modplug.
+ * Collapse the Ogg demuxer, and the Theora, Vorbis and Speex decoders in the
+ same 'xiph' plugin.
+ * Remove aRTs output plugin; ALSA's DMix can allow both xine and aRTs to
+ access the audio device at the same time for Linux, and if other
+ operating systems lack a proper software mixing facility you can
+ consider alternative daemons. Note: aRTs will not be present in KDE 4.
+ * Convert the FAQ and the Hacker's Guide from DocBook SGML to DocBook 4.4
+ XML, and the figures from fig files to SVG files.
+ * The XML parser no longer ignores <?...?> elements.
+ Such elements are handled as if they were after the XML content for
+ compatibility reasons, though they must appear before it.
+ * The XML parser handles CDATA elements.
+ * Text handling within XML is improved.
+ * DVB subtitles' opacity is now controllable.
+ * Extend DVB subtitling capabilities. (Still bitmap-only.)
+ * The internal copies of libcdio and libvcd are no longer present,
+ you need to use an installed copy of them if you want VCD support.
+ * Replace get_* functions for literals with direct string access.
+ * Use default dispose() functions when they just need to call free() in
+ various plugins.
+ * Rename METHOD_BY_EXTENSION to METHOD_BY_MRL as it also checks prefixes
+ for specific input protocols.
+ * Check for supported extensions before opening the plugin and remove
+ redundant core from plugins.
+ * Use libavutil-provided implementations for CRC, SHA1 and BASE64 algorithms,
+ this makes use of libavutil even outside the FFmpeg decoding plugin,
+ but avoid duplication of algorithms between different plugins.
+ * Use av_mallocz() when xine_xmalloc_aligned() wouldn't be needed.
+ * FFmpeg is now required as an external dependency; if you want to build
+ xine-lib from source, please download a copy of FFmpeg from their SVN
+ server.
+ * Remove SyncFB video output plugin, the kernel module needed is no more
+ active and thus it's no more usable. If you were using SyncFB somehow,
+ please use DirectFB or VIDIX instead.
+ * The Xv and XxMC video output plugins now support Xv port selection via
+ two methods: port number and port type (currently "any", "overlay" and
+ "textured video"). Port number takes precedence; the plugins will fall
+ back on another port of the same type (if a type was specified) then on
+ whatever they can find.
+ XvMC does not support port selection at present.
+ * Report more video output capabilities via (port)->get_capabilities():
+ colour controls, zooming, colour keying.
+
xine-lib (1.1.21) ????-??-??
* mpeg-ts fixes and enhancements
* Improved syncing of DVB subtitles
diff --git a/Makefile.am b/Makefile.am
index 8c1d8b790..02c819dc5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -2,15 +2,17 @@
## Process this file with automake to produce Makefile.in
##
-AUTOMAKE_OPTIONS = 1.8 no-dist-gzip dist-bzip2
+include $(top_srcdir)/misc/Makefile.quiet
+
+AUTOMAKE_OPTIONS = 1.9 no-dist-gzip dist-bzip2
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = doc m4 po misc include lib src win32
+SUBDIRS = doc m4 po misc include lib src win32 contrib
DEBFILES = debian/README.Debian debian/changelog debian/control \
debian/copyright debian/rules debian/compat \
- debian/shlibdeps.sh debian/libxine-dev.install debian/libxine1.install
+ debian/shlibdeps.sh debian/libxine2-dev.install debian/libxine1.install
EXTRA_DIST = config.rpath autogen.sh \
configure \
@@ -21,10 +23,10 @@ EXTRA_DIST = config.rpath autogen.sh \
libtool \
ltmain.sh \
missing \
- depcomp \
- @DEPCOMP@
+ depcomp
-CONFIG_CLEAN_FILES = libtool
+CLEANFILES = a.out
+CONFIG_CLEAN_FILES = libtool po/Makevars.extra
dist_doc_DATA = COPYING NEWS README TODO CREDITS ChangeLog
@@ -41,22 +43,8 @@ pass2:
@$(MAKE) MULTIPASS_CFLAGS='$(PASS2_CFLAGS)'
-debug:
- @list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $@) || exit;\
- done;
-
-debug-install: install-debug
-
-install-debug: debug
- @list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $@) || exit; \
- done;
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
-
prune-cache:
- -rm -f config.cache
+ -rm -rf config.cache autom4te.cache
release-check:
@@ -92,6 +80,9 @@ install-data-hook:
$(top_srcdir)/post-install.sh ; \
fi
+dist-hook:
+ cp -p $(srcdir)/version.sh $(distdir)
+
mostlyclean-generic:
-rm -f *~ \#* .*~ .\#*
diff --git a/NEWS b/NEWS
index 7aa22b154..efb296e67 100644
--- a/NEWS
+++ b/NEWS
@@ -1,2 +1,5 @@
-This file is unused.
-The ChangeLog file lists changes for new versions.
+xine-lib 1.2.0
+==============
+
+As of this release, xine-config is deprecated. You should use pkg-config
+libxine instead - see xine-config's man page for details.
diff --git a/README b/README
index 614fa8c3d..ce6e85d0d 100644
--- a/README
+++ b/README
@@ -9,19 +9,6 @@
xine-lib is a free multimedia engine, released under the GNU GPL. See COPYING
for details.
-
-IMPORTANT:
-
-If you're reading this and you maintain an application which uses xine-lib
-1.1, you should be considering moving to xine-lib 1.2. You may need to
-adapt your software a bit: various deprecated/obsolete interfaces, present
-in 1.1, have gone in 1.2.
-
-The 1.1 series is, as of early 2012, receiving bug fixes only. It is
-regarded as deprecated, and is likely to become obsolete and (mostly)
-unmaintained in 2013, or possibly a little sooner.
-
-
see the doc/ directory for more information about xine-lib. You will find
various README files, FAQ and developer documentation (xine hacker's guide)
there. Developers will find additional documentation for xine interfaces
diff --git a/README-VDPAU b/README-VDPAU
new file mode 100644
index 000000000..c664e36af
--- /dev/null
+++ b/README-VDPAU
@@ -0,0 +1,40 @@
+FAQ:
+
+Q:
+ Why my file plays fine with mplayer-vdpau and not with xine-vdpau?
+A:
+ We are not using the nvidia's libavcodec patch.
+ We are writing decoders from scratch.
+ So don't expect them to be as mature as ffmpeg ones. Not yet.
+
+Q:
+ Why mpeg2 doesn't use less cpu than software decoder?
+A:
+ Because at that moment it does a lot of memcpy. This will be fixed soon, but that's not
+ a priority. Stability is our focus.
+
+Q:
+ Is deinterlacing working?
+A:
+ Yes. It's already quite good (doing 50i->50p), but could even be better in the future.
+
+Q:
+ How do i get it working with VDR, Kaffeine, whatever.
+A:
+ Ask VDR, Kaffeine, whatever developers.
+ (Note: for kaffeine you are lucky, i'm going to tell you the tip.
+ Build kaffeine like that: ./configure --without-xcb && make && make install)
+
+Q:
+ How can i contact you?
+A:
+ IRC: #xine-vdpau on freenode
+ MAIL: http://lists.kafic.ba/mailman/listinfo/xine-vdpau
+ Eventually, nvnews.
+
+Q:
+ What information do I need if there's a problem?
+A:
+ Run 'xine --verbose /path/to/a/working/sample' (or equivalent for your
+ chosen front end). You will probably be asked for this anyway, so it
+ helps to have it handy.
diff --git a/TODO b/TODO
index 02703d8c3..81e346b7a 100644
--- a/TODO
+++ b/TODO
@@ -1,11 +1,36 @@
+For 1.3 series
+==============
+- analyse impact of breaking xine.h down in multiple public headers, and
+ rename the xine/ directory for include files in xinecore/ (for plugins
+ only), while leaving xine/ for public include files;
+
+For 1.2 series
+==============
+- Security-Related: start using xine_xcalloc rather than xine_xmalloc when
+ the number of elements is not a build-time constant.
+- mimetype-based demuxer selection, solves the effects of shoutcast's bug;
+- Doxygen API documentation for both internal and public functions;
+- removal of (deprecated) software deinterlacers from video output plugins;
+- reduction of exported symbols by hiding (-fvisibility=hidden or attribute)
+ the internal libxine-only functions;
+- move the contributed code (not developed by xine project) in the contrib/
+ directory of the source tree;
+- reduce memory footprint (e.g. variable fifo buffer sizes...);
+- handle gracefully the runtime removal of the audio output device (being
+ it a physical removal for USB devices or a missing output on a client-server
+ design like PulseAudio, ESounD or Jack);
+- review media_eject_media, possibly rewrite to use libcdio;
+- improve error reporting (for when demuxer/decoder plugins aren't found);
+- HTTPS.
+- review translable strings, try to follow a defined schema for naming and
+ error reporting;
+
known bugs
==========
- frame allocation problem with h264 streams using > 15 reference frames
-- our faad2 has problems with 5.1 streams. faad2 cvs is GPL incompatible.
- dvdnav time search function does not use the time table, but interpolates
only cell times
-- crash with RV10 streams
- apparently, dvb:// (but not dvb://CHANNEL) is broken for ATSC
@@ -51,10 +76,6 @@ optional
- helix streaming server support
- detect broken savage drivers in health check, disable Xv in that case
-- directfb video output plugin
-- reduce memory footprint (e.g. variable fifo buffer sizes...)
-- opengl video output plugin (matthias, sopra at stuttgart university)
-- irix audio output plugin (matthias)
beyond 1.0
----------
diff --git a/autogen.sh b/autogen.sh
index 9265c9af7..44fa9b33d 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -25,11 +25,11 @@
PROG=xine-lib
# Minimum value required to build
-WANT_AUTOMAKE_1_9=1 export WANT_AUTOMAKE_1_9
-WANT_AUTOMAKE=1.9 export WANT_AUTOMAKE
+export WANT_AUTOMAKE_1_9=1
+export WANT_AUTOMAKE=1.9
AUTOMAKE_MIN=1.9.0
AUTOCONF_MIN=2.59
-LIBTOOL_MIN=1.4.0
+LIBTOOL_MIN=1.5.20
# Check how echo works in this /bin/sh
case `echo -n` in
@@ -192,7 +192,7 @@ run_automake () {
echo $_echo_n " + Running automake: $_echo_c";
- automake --gnu --add-missing --copy;
+ automake --gnu --add-missing --copy -Wno-portability;
echo "done."
}
diff --git a/configure.ac b/configure.ac
index f4f9b6563..c55f23a0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,153 +1,181 @@
-dnl
-dnl Configure.ac for xine
-dnl
+AC_PREREQ(2.59)
+
+m4_include([m4/objc.m4])
-AC_INIT
+dnl Note that autoconf/autoheader/automake cache using autom4te, so version.sh
+dnl will only be run if configure.ac has changed. This must be done before
+dnl AC_INIT so that XINE_VERSION_SPEC, which is an m4 macro, is available.
+m4_esyscmd([./version.sh])
+
+dnl Initialize autoconf, autoheader, and automake
+AC_INIT([xine-lib], XINE_VERSION_SPEC, [xine-bugs@lists.sourceforge.net])
+AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/xine-engine/xine.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_LIBOBJ_DIR([lib])
+AC_CONFIG_HEADERS([include/configure.h])
+AM_MAINTAINER_MODE
-dnl
-dnl Require autoconf version 2.60
-dnl
-AC_PREREQ(2.59)
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
-dnl Making releases:
-dnl XINE_SUB += 1; XINE_PATCH = ''; continue with XINE_LT_* values below
-dnl
-XINE_MAJOR=1
-XINE_MINOR=1
-XINE_SUB=21
-dnl XINE_PATCH should be left empty or set to ".1" or ".2" or something similar
-XINE_PATCH=
-dnl Release series number (usually $XINE_MAJOR.$XINE_MINOR)
-XINE_SERIES=1.1
-
-dnl if test $XINE_SUB -eq 0 ; then
-dnl XINE_SUBPART="";
-dnl else
- XINE_SUBPART=".$XINE_SUB$XINE_PATCH"
-dnl fi
+AH_TOP([#ifndef __XINE_LIB_CONFIG_H__
+#define __XINE_LIB_CONFIG_H__ 1
+])
+AH_BOTTOM([#ifdef ASMALIGN_1SLN
+# define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"
+#else
+# define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"
+#endif
-dnl The libtool version numbers (XINE_LT_*). Don't even think about faking this!
-dnl
-dnl immediately before every release do:
-dnl ===================================
-dnl if (the interface is totally unchanged from previous release)
-dnl XINE_LT_REVISION ++;
-dnl else { /* interfaces have been added, removed or changed */
-dnl XINE_LT_REVISION = 0;
-dnl XINE_LT_CURRENT ++;
-dnl if (any interfaces have been _added_ since last release)
-dnl XINE_LT_AGE ++;
-dnl if (any interfaces have been _removed_ or _incompatibly changed_)
-dnl XINE_LT_AGE = 0;
-dnl }
-dnl
-dnl If you want to know more about what you are doing, here are some details:
-dnl * XINE_LT_CURRENT is the current API version
-dnl * XINE_LT_REVISION is an internal revision number which is increased when
-dnl the API itself did not change
-dnl * XINE_LT_AGE is the number of previous API versions still supported by
-dnl this library
-dnl * libtool has its own numbering scheme, because local library numbering
-dnl schemes are platform dependent
-dnl * for GNU/Linux, the library will be named
-dnl libname.so.(XINE_LT_CURRENT - XINE_LT_AGE).XINE_LT_AGE.XINE_LT_REVISION
-
-XINE_LT_CURRENT=31
-XINE_LT_REVISION=1
-XINE_LT_AGE=30
-
-dnl for a release tarball do "rm .cvsversion" before "make dist"
-if test -f "${srcdir-.}/.cvsversion"; then
- XINE_PRE="hg"
-else
- XINE_PRE=""
+#endif /* __XINE_LIB_CONFIG_H__ */
+])
+
+test x"$prefix" = x"NONE" && prefix="${ac_default_prefix}"
+test x"$exec_prefix" = x"NONE" && exec_prefix='${prefix}'
+
+dnl Use features of autoconf 2.61, but stay compatible with older versions.
+if test x"$datarootdir" = x""; then
+ datarootdir='${datadir}'
+ AC_SUBST(datarootdir)
+fi
+
+if test x"$docdir" = x""; then
+ docdir='${datarootdir}/doc/${PACKAGE}'
+ AC_SUBST(docdir)
fi
+if test x"$htmldir" = x""; then
+ htmldir='${docdir}'
+ AC_SUBST(htmldir)
+fi
+
+
+dnl -------------------------
+dnl Setup version information
+dnl -------------------------
+
+dnl Do not change these manually; they come from running ./version.sh when
+dnl autoconf runs. This must all be done after AC_INIT is done, but running
+dnl the version.sh script must be done before AC_INIT.
+XINE_MAJOR=XINE_VERSION_MAJOR
AC_SUBST(XINE_MAJOR)
+AC_DEFINE_UNQUOTED([XINE_MAJOR], [$XINE_MAJOR], [xine major version number])
+XINE_MINOR=XINE_VERSION_MINOR
AC_SUBST(XINE_MINOR)
+AC_DEFINE_UNQUOTED([XINE_MINOR], [$XINE_MINOR], [xine minor version number])
+XINE_SUB=XINE_VERSION_SUB
AC_SUBST(XINE_SUB)
+AC_DEFINE_UNQUOTED([XINE_SUB], [$XINE_SUB], [xine sub version number])
+XINE_PATCH=XINE_VERSION_PATCH
AC_SUBST(XINE_PATCH)
+AC_DEFINE_UNQUOTED([XINE_PATCH], [$XINE_PATCH], [xine patch version number])
+XINE_SERIES=XINE_VERSION_SERIES
AC_SUBST(XINE_SERIES)
-AC_SUBST(XINE_IFACE_AGE)
-AC_SUBST(XINE_BIN_AGE)
-
-AC_DEFINE_UNQUOTED(XINE_MAJOR, $XINE_MAJOR,[xine major version number])
-AC_DEFINE_UNQUOTED(XINE_MINOR, $XINE_MINOR,[xine minor version number])
-AC_DEFINE_UNQUOTED(XINE_SUB, $XINE_SUB, [xine sub version number])
-AC_DEFINE_UNQUOTED(XINE_PATCH, $XINE_PATCH, [xine patch version number])
+XINE_LT_CURRENT=__XINE_LT_CURRENT
AC_SUBST(XINE_LT_CURRENT)
+AC_DEFINE_UNQUOTED(XINE_LT_CURRENT, $XINE_LT_CURRENT, [xine interface version number])
+XINE_LT_REVISION=__XINE_LT_REVISION
AC_SUBST(XINE_LT_REVISION)
+XINE_LT_AGE=__XINE_LT_AGE
AC_SUBST(XINE_LT_AGE)
-
-AC_DEFINE_UNQUOTED(XINE_LT_CURRENT, $XINE_LT_CURRENT, [xine interface version number])
AC_DEFINE_UNQUOTED(XINE_LT_AGE, $XINE_LT_AGE, [xine interface version age])
-SPEC_VERSION=$XINE_MAJOR.$XINE_MINOR${XINE_SUBPART}$XINE_PRE
-TAR_NAME="xine-lib-"$SPEC_VERSION
-dnl TAR_NAME="xine-lib-"$XINE_MAJOR-$XINE_PRE
-dnl SPEC_VERSION=${XINE_MAJOR}_$XINE_PRE
+LIBNAME="libxine$(($XINE_LT_CURRENT-$XINE_LT_AGE))"
+AC_SUBST(LIBNAME)
+AC_DEFINE_UNQUOTED([XINE_TEXTDOMAIN], "$LIBNAME", [catalog message text domain])
+
+dnl Always set flags to begin with -g so that debug information will be
+dnl included. In release bulids, this can be stripped out later if desired.
+dnl More importantly, it prevents autoconf from initializing the defaults to
+dnl include -O2, which is not desirable in a debug build, and it messes with
+dnl other optimizations that we'll want to be setting ourselves later.
+CFLAGS="-g $CFLAGS"
+CPPFLAGS="-D_REENTRANT -DXINE_COMPILE $CPPFLAGS"
+LDFLAGS="-g $LDFLAGS"
+OBJCFLAGS="-g $OBJCFLAGS"
+
+
+dnl ------------------------------
+dnl Build modes: debug and profile
+dnl ------------------------------
+
+AC_ARG_ENABLE([debug],
+ [AS_HELP_STRING([--enable-debug], [build with debugging code enabled])],
+ [], [enable_debug="no"])
+if test x"$enable_debug" != x"no"; then
+ CPPFLAGS="-DDEBUG $CPPFLAGS"
+else
+ CPPFLAGS="-DNDEBUG $CPPFLAGS"
+fi
+AM_CONDITIONAL([DEBUG_BUILD], [test x"$enable_debug" != x"no"])
-AC_SUBST(TAR_NAME)
-AC_SUBST(SPEC_VERSION)
+AC_ARG_ENABLE([profiling],
+ [AS_HELP_STRING([--enable-profiling], [build with profiling code enabled])],
+ [], [enable_profiling="no"])
+if test x"$enable_profiling" != x"no"; then
+ CFLAGS="-pg $CFLAGS"
+ OBJCFLAGS="-pg $OBJCFLAGS"
+ LDFLAGS="-pg $LDFLAGS"
+fi
+AM_CONDITIONAL([PROFILING_BUILD], [test x"$enable_profiling" != x"no"])
-LIBNAME=libxine$XINE_MAJOR
-AC_SUBST(LIBNAME)
-AC_DEFINE_UNQUOTED(XINE_TEXTDOMAIN, "$LIBNAME", [catalog message text domain])
+dnl --------------
+dnl Build features
+dnl --------------
-dnl
-AM_INIT_AUTOMAKE("xine-lib", $SPEC_VERSION)
-dnl AM_INIT_AUTOMAKE("xine-lib", $XINE_MAJOR-$XINE_PRE)
+AC_ARG_ENABLE([ipv6],
+ [AS_HELP_STRING([--enable-ipv6], [enable use of IPv6])],
+ [if test x"$enableval" != x"no"; then
+ AC_DEFINE([ENABLE_IPV6], 1, [Enable this when IPv6 is requested])
+ fi])
-dnl ---------------------------------------------
-dnl Made possible to build for another arch.
-dnl ---------------------------------------------
+AC_ARG_ENABLE([antialiasing],
+ [AS_HELP_STRING([--enable-antialiasing], [enable font antialiasing])],
+ [if test x"$enableval" != x"no"; then
+ AC_DEFINE([ENABLE_ANTIALIASING], 1, [Define this to 1 to enable font antialising.])
+ fi])
-AC_CANONICAL_HOST
-AC_CANONICAL_BUILD
-test "$host" = "$build" && check_athlon=yes
+dnl ----------------------------------------------
+dnl Cross compilation, Mac OS X Universal Binaries
+dnl ----------------------------------------------
-AC_CONFIG_HEADERS([include/configure.h])
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
+dnl check for Mac OS X universal binary support early, because certain flags
+dnl must be set prior to looking for cc/libtool, etc.
+MACOSX_UNIVERSAL_BINARIES
-dnl ---------------------------------------------
-dnl Check for programs.
-dnl ---------------------------------------------
+dnl Check to see if $host is empty. If it is, try $host_alias instead.
+dnl If $host is empty, it's because the user has run ./configure with a host
+dnl parameter unknown to config.sub. This used to be set in xv handling, but
+dnl it's also used in a bunch of other places unrelated to Xwindows support,
+dnl so if X is disabled, other things could go badly.
+host_or_hostalias="$host"
+test x"$host_or_hostalias" = x"" && host_or_hostalias="$host_alias"
-AC_PROG_CC
-AM_PROG_AS
-case "$host_os" in
- *darwin*)
- m4_ifdef([AC_PROG_OBJC],
- [AC_PROG_OBJC],
- [AC_CHECK_TOOL([OBJC], [gcc])
- AC_SUBST([OBJC])
- AC_SUBST([OBJCFLAGS])
- ])
- CPPFLAGS="$CPPFLAGS -DCONFIG_DARWIN"
- ;;
-esac
+dnl -------------------
+dnl checks for programs
+dnl -------------------
+AC_PROG_CC
+AM_PROG_CC_C_O
AC_GNU_SOURCE
-dnl Save CFLAGS, AC_ISC_POSIX set some unwanted default CFLAGS
-saved_CFLAGS="$CFLAGS"
AC_ISC_POSIX
-AC_PATH_MAGIC
-CFLAGS="$saved_CFLAGS"
-AC_HEADER_STDC
+
+AC_PROG_OBJC
+
+CC_PROG_AS
AC_PROG_MAKE_SET
AC_PROG_EGREP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_AWK
-AC_C_INLINE
AC_PATH_PROG([PERL], [perl], [no])
if test "$PERL" = no; then
@@ -157,42 +185,29 @@ AC_SUBST([PERL])
AC_CHECK_TOOL([STRINGS], [strings], [false])
+PKG_PROG_PKG_CONFIG
+
dnl ---------------------------------------------
dnl Libtool
dnl ---------------------------------------------
-AC_LIBTOOL_DLOPEN
AC_DISABLE_STATIC
+AC_LIBTOOL_DLOPEN
AC_LIBTOOL_WIN32_DLL
+AC_PATH_MAGIC
AC_PROG_LIBTOOL
AC_PROG_LIBTOOL_SANITYCHECK
-AC_SUBST(LIBTOOL_DEPS)
-if ${CONFIG_SHELL} ./libtool --features | grep "enable static" >/dev/null; then
- STATIC="-static"
-else
- STATIC=
-fi
-AC_SUBST(STATIC)
-
-
-dnl ---------------------------------------------
-dnl Requirements for macros whose first invocations are conditional
-dnl ---------------------------------------------
-PKG_PROG_PKG_CONFIG
-CC_CHECK_WERROR
+dnl --------------------
+dnl checks for libraries
+dnl --------------------
-dnl ---------------------------------------------
-dnl NLS Support
-dnl ---------------------------------------------
-
-dnl ALL_LINGUAS="cs da de el en@quot en@boldquot es et fr gl id it ja ko nl nn no pl pt pt_BR ru sl sv tr zh"
AM_ICONV
AC_ARG_ENABLE([iconvtest],
- AS_HELP_STRING([--disable-iconvtest], [don't require iconv library]))
-if test "x$enable_iconvtest" != xno; then
- if test "x$am_cv_func_iconv" != xyes; then
- AC_MSG_ERROR([
+ [AS_HELP_STRING([--disable-iconvtest], [don't require iconv library])])
+if test x"$enable_iconvtest" != x"no"; then
+ if test x"$am_cv_func_iconv" != x"yes"; then
+ AC_MSG_ERROR([
****************************************************************
* iconv library not found. It's necessary for proper *
* manipulation with texts so xine requires it as default. *
@@ -201,2324 +216,806 @@ if test "x$enable_iconvtest" != xno; then
* by option --with-libiconv-prefix. *
* *
* If you don't want iconv support use the option *
-* --disable-iconvtest. *
+* --disable-iconvtest. *
****************************************************************
- ])
- fi
+])
+ fi
fi
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.17])
AC_PROG_GMSGFMT_PLURAL
-AC_CHECK_FUNCS([nl_langinfo])
-
-dnl ---------------------------------------------
-dnl Checks for typedefs, structures, and compiler characteristics.
-dnl ---------------------------------------------
-
-AC_C_BIGENDIAN
-AC_C_CONST
-dnl AC_C_ALWAYS_INLINE removal allows ffmpeg to be more widely buildable
-AC_TYPE_OFF_T
-AC_TYPE_SIZE_T
-AC_CHECK_SIZEOF(long)
-dnl AC_CHECK_TYPES([ptrdiff_t])
-dnl For systems without inttypes.h would be needed extend generated replacement.
-AC_CHECK_GENERATE_INTTYPES([include])
-AM_CONDITIONAL(GENERATED_INTTYPES_H, test "x$ac_cv_header_inttypes_h" != x"yes")
-AC_CHECK_TYPE(ssize_t, :, AC_DEFINE(ssize_t, __int64, [define ssize_t to __int64 if it's missing in default includes]))
-
-dnl ---------------------------------------------
-dnl threads and OS specific stuff
-dnl ---------------------------------------------
-
-CC_PTHREAD_FLAGS(, [AC_MSG_ERROR([Pthread support is needed])])
-CC_PTHREAD_RECURSIVE_MUTEX(, [AC_MSG_ERROR([recursive mutex support is needed - please report])])
-dnl <pthread.h> is implicitly included by xine-internals.h, so the include dir is needed everywhere
-CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
-
-AC_CHECK_DECL(sysi86,[
- AC_DEFINE(HAVE_SYSI86,1,[Define this if the 'sysi86' function is declared in sys/sysi86.h])
- ],,[
-#include <sys/sysi86.h>
-])
-
-AC_GETOPT_LONG
-
-
-dnl ---------------------------------------------
-dnl Windows & Hurd ports checks
-dnl ---------------------------------------------
-have_supported_dvb=yes
-SYS=other
-
-case "$host_os" in
- gnu*)
- have_supported_dvb=no
- SYS=hurd
- ;;
- mingw* | cygwin*)
- have_supported_dvb=no
- dnl check if we are using the cygwin, mingw or cygwin with mno-cygwin mode
- dnl in which case we are actually dealing with a mingw32 compiler
- case "$host" in
- *-*-mingw32*)
- SYS=mingw32
- ;;
- *-*-cygwin*)
- AC_EGREP_CPP(pattern,
- [#ifdef WIN32
- yes
- #endif],
- SYS=mingw32, SYS=cygwin)
- ;;
- esac
-
- if test "$SYS" = "mingw32"; then
- WIN32_CPPFLAGS='-I$(top_srcdir)/win32/include'
- LIBS="-lwinmm -lwsock32 $LIBS"
- LDFLAGS="-Wl,--enable-stdcall-fixup $LDFLAGS"
- dnl iberty has been needed only in older versions
- AC_CHECK_LIB(iberty, strncomp, [GOOM_LIBS="-liberty"])
+AC_CHECK_LIB([c], [dlopen], [DYNAMIC_LD_LIBS=""],
+ [AC_CHECK_LIB([dl], [dlopen], [DYNAMIC_LD_LIBS="-ldl"],
+ [AC_MSG_CHECKING(for dlopen under win32)
+ AC_LANG_PUSH([C])
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="-I${srcdir}/win32/include $CPPFLAGS"
+ ac_save_LIBS="$LIBS" LIBS="$LIBS -lkernel32"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
+ #include <dlfcn.h>]], [[dlopen(NULL, 0)]])],
+ [DYNAMIC_LD_LIBS="-lkernel32"
+ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
+ CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS"
+ AC_LANG_POP([C])], [AC_MSG_ERROR([dynamic linker needed])])])
+AC_SUBST([DYNAMIC_LD_LIBS])
+
+AC_ARG_WITH([external-libxdg-basedir],
+ [AS_HELP_STRING([--without-external-libxdg-basedir], [use internal copy of libxdg-basedir])])
+
+have_xdg_basedir=no
+if test x"$with_external_libxdg_basedir" != x"no"; then
+ PKG_CHECK_MODULES([XDG_BASEDIR], [libxdg-basedir >= 1], [have_xdg_basedir=yes], [have_xdg_basedir=no])
+
+ if test x"$have_xdg_basedir" = x"no" -a x"$with_external_libxdg_basedir" = x"yes"; then
+ AC_MSG_ERROR([--with-external-libxdg-basedir used but no libxdg-basedir found])
fi
- ;;
-esac
-AC_SUBST(GOOM_LIBS)
-AC_SUBST(WIN32_CPPFLAGS)
-AM_CONDITIONAL(WIN32, test "x$SYS" = "xmingw32")
-AM_CONDITIONAL([HURD], [test "x$SYS" = "xhurd"])
-AM_CONDITIONAL([DVB], [test "$have_supported_dvb" = "yes"])
-
-
-dnl ---------------------------------------------
-dnl dynamic linker
-dnl ---------------------------------------------
-AM_DL()
-
-
-dnl ---------------------------------------------
-dnl determine libdir name
-dnl ---------------------------------------------
-
-AC_MSG_CHECKING([libdir name])
-case $host in
-*-*-linux*)
- # Test if the compiler is 64bit
- echo 'int i;' > conftest.$ac_ext
- xine_cv_cc_64bit_output=no
- if AC_TRY_EVAL(ac_compile); then
- case `"$MAGIC_CMD" conftest.$ac_objext` in
- *"ELF 64"*)
- xine_cv_cc_64bit_output=yes
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
-esac
-
-case $host_cpu:$xine_cv_cc_64bit_output in
-powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
- XINE_LIBNAME="lib64"
- ;;
-*:*)
- XINE_LIBNAME="lib"
- ;;
-esac
-AC_MSG_RESULT([$XINE_LIBNAME])
-
-
-dnl ---------------------------------------------
-dnl mpeg2lib and ffmpeg stuff
-dnl ---------------------------------------------
-
-AC_SUBST(LIBMPEG2_CFLAGS)
-
-AC_ARG_ENABLE([libmpeg2new],
- AS_HELP_STRING([--enable-libmpeg2new], [build the newer MPEG2 decoder (buggy)]))
-AM_CONDITIONAL(ENABLE_MPEG2NEW, test "x$enable_libmpeg2new" = "xyes")
-
-AC_ARG_WITH([external-ffmpeg], AS_HELP_STRING([--with-external-ffmpeg], [use external ffmpeg library]))
-
-case "x$with_external_ffmpeg" in
- xno)
- ;;
- xyes)
- PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 51.20.0])
- ;;
- *)
- with_external_ffmpeg=yes
- PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 51.20.0], [],
- [AC_MSG_RESULT(no); with_external_ffmpeg=no])
- ;;
-esac
-if test "x$with_external_ffmpeg" != "xno"; then
- PKG_CHECK_MODULES([FFMPEG_UTIL], [libavutil])
- PKG_CHECK_MODULES([FFMPEG_POSTPROC], [libpostproc])
- AC_SUBST([FFMPEG_CFLAGS])
- AC_SUBST([FFMPEG_LIBS])
- AC_SUBST([FFMPEG_POSTPROC_CFLAGS])
- AC_SUBST([FFMPEG_POSTPROC_LIBS])
- AC_DEFINE([HAVE_FFMPEG], [1], [Define this if you have ffmpeg library])
-
- dnl Check presence of ffmpeg/avutil.h to see if it's old or new
- dnl style for headers. The new style would be preferred actually...
- AC_CHECK_HEADERS([ffmpeg/avutil.h])
- AC_CHECK_HEADERS([libavutil/avutil.h])
- if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then
- AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!])
- fi
-
- AC_MSG_RESULT([using external ffmpeg])
-else
- AC_MSG_RESULT([using internal ffmpeg - NOT RECOMMENDED OR SUPPORTED])
- LIBFFMPEG_CPPFLAGS="-DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DXINE_MPEG_ENCODER -D_ISOC9X_SOURCE -DCONFIG_DECODERS"
- AC_CHECK_TYPES(int_fast8_t, [], [LIBFFMPEG_CPPFLAGS="$LIBFFMPEG_CPPFLAGS -DEMULATE_FAST_INT"])
- AC_SUBST([LIBFFMPEG_CPPFLAGS])
fi
-AM_CONDITIONAL(HAVE_FFMPEG, test "x$with_external_ffmpeg" = "xyes")
-
-
-AC_ARG_ENABLE([ffmpeg_uncommon_codecs],
- AS_HELP_STRING([--disable-ffmpeg-uncommon-codecs], [don't build uncommon ffmpeg codecs]))
-
-AC_ARG_ENABLE([ffmpeg_popular_codecs],
- AS_HELP_STRING([--disable-ffmpeg-popular-codecs], [don't build popular ffmpeg codecs]))
-
-AS_MKDIR_P(src/libffmpeg)
-ffmpeg_config_h=src/libffmpeg/ffmpeg_config.h
-echo "/* Automatically generated */" > $ffmpeg_config_h
-
-dnl uncommon ffmpeg codecs
-ffmpeg_uncommon_codecs="AASC ASV1 ASV2 AVS CSCD CYUV DVVIDEO EIGHTBPS FLIC FLV FOURXM FRAPS HUFFYUV IDCIN INTERPLAY_VIDEO KMVC LOCO MMVIDEO NUV QDRAW QPEG ROQ RPZA SMACKER SMC SNOW TRUEMOTION1 TRUEMOTION2 TSCC ULTI VCR1 VMDVIDEO WNV1 XAN_WC3 XL ZMBV ALAC AMR_NB AMR_WB LIBGSM MACE3 MACE6 SHORTEN SMACKAUD TRUESPEECH TTA VMDAUDIO PCM_ALAW PCM_MULAW PCM_S8 PCM_S16BE PCM_S16LE PCM_S24BE PCM_S24DAUD PCM_S24LE PCM_S32BE PCM_S32LE PCM_U8 PCM_U16BE PCM_U16LE PCM_U24BE PCM_U24LE PCM_U32BE PCM_U32LE INTERPLAY_DPCM ROQ_DPCM SOL_DPCM VQA XAN_DPCM ADPCM_4XM ADPCM_CT ADPCM_EA ADPCM_IMA_DK3 ADPCM_IMA_DK4 ADPCM_IMA_QT ADPCM_IMA_SMJPEG ADPCM_IMA_WAV ADPCM_IMA_WS ADPCM_MS ADPCM_SBPRO_2 ADPCM_SBPRO_3 ADPCM_SBPRO_4 ADPCM_XA ADPCM_YAMAHA"
-for ucname in $ffmpeg_uncommon_codecs; do
- config_name="CONFIG_${ucname}_DECODER"
- enabled_name="ENABLE_${ucname}_DECODER"
-
- if test "x$enable_ffmpeg_uncommon_codecs" != xno; then
- echo "#define $config_name 1" >> $ffmpeg_config_h
- echo "#define $enabled_name 1" >> $ffmpeg_config_h
- else
- echo "#define $enabled_name 0" >> $ffmpeg_config_h
- fi
-done
-
-dnl popular ffmpeg codecs
-ffmpeg_popular_codecs="CINEPAK FLASHSV H261 H263 H263I H264 INDEO2 INDEO3 MJPEG MJPEGB MPEG1VIDEO MPEG2VIDEO MPEG4 MPEGVIDEO MSMPEG4V1 MSMPEG4V2 MSMPEG4V3 MSRLE MSVIDEO1 QTRLE RV10 RV20 RV30 RV40 SVQ1 SVQ3 VC1 VP3 VP5 VP6 VP6F VP8 WMV1 WMV2 WMV3 COOK DTS EAC3 AAC_LATM FLAC MP2 MP3 QDM2 RA_144 RA_288 WAVPACK WMAV1 WMAV2 WMAPRO ADPCM_SWF"
-
-for ucname in $ffmpeg_popular_codecs; do
- config_name="CONFIG_${ucname}_DECODER"
- enabled_name="ENABLE_${ucname}_DECODER"
-
- if test "x$enable_ffmpeg_popular_codecs" != xno; then
- echo "#define $config_name 1" >> $ffmpeg_config_h
- echo "#define $enabled_name 1" >> $ffmpeg_config_h
- else
- echo "#define $enabled_name 0" >> $ffmpeg_config_h
- fi
-done
-
-dnl disabled ffmpeg codecs
-ffmpeg_disabled_codecs="BMP CAVS CLJR DSICINVIDEO FFV1 FFVHUFF GIF MDEC MPEG_XVMC MSZH PNG RAWVIDEO SP5X TARGA TIERTEXSEQVIDEO TIFF VMNC ZLIB DSICINAUDIO IMC MP3ADU MP3ON4 MPC7 SONIC WS_SND1 ADPCM_ADX ADPCM_G726 DVBSUB DVDSUB THEORA AAC MPEG4AAC AC3 VORBIS"
-for ucname in $ffmpeg_disabled_codecs; do
- config_name="CONFIG_${ucname}_DECODER"
- enabled_name="ENABLE_${ucname}_DECODER"
-
- echo "#define $enabled_name 0" >> $ffmpeg_config_h
-done
-
-dnl disabled ffmpeg encoders
-ffmpeg_extra_encoders="H263P JPEGLS LJPEG PAM PBM PGM PGMYUV PPM SONIC_LS"
-for ucname in $ffmpeg_uncommon_codecs $ffmpeg_popular_codecs $ffmpeg_disabled_codecs $ffmpeg_extra_encoders; do
- config_name="CONFIG_${ucname}_ENCODER"
- enabled_name="ENABLE_${ucname}_ENCODER"
-
- echo "#define $enabled_name 0" >> $ffmpeg_config_h
-done
-
-dnl disabled parsers
-ffmpeg_parsers="AAC AC3 CAVSVIDEO DVBSUB DVDSUB H261 H263 H264 MJPEG MPEG4VIDEO MPEGAUDIO MPEGVIDEO PNM"
-for ucname in $ffmpeg_parsers; do
- config_name="CONFIG_${ucname}_PARSER"
- enabled_name="ENABLE_${ucname}_PARSER"
-
- echo "#define $enabled_name 0" >> $ffmpeg_config_h
-done
-
-LIBMPEG2_CFLAGS=""
-
-AC_CHECK_DECL(lrintf,[
- AC_DEFINE(HAVE_LRINTF,1,[Define this if the 'lrintf' function is declared in math.h])
- AC_DEFINE(_ISOC9X_SOURCE,1,[Define this if you are ISO C9X compliant])
- ],,[
-#define _ISOC9X_SOURCE
-#include <math.h>
-])
-AC_CHECK_DECL(rintf,[
- AC_DEFINE(HAVE_RINTF,1,[Define this if the 'rintf' function is declared in math.h])
- ],,[
-#include <math.h>
-])
-
-AC_CHECK_FUNCS(memalign)
-
-AC_ARG_ENABLE([altivec],
- AS_HELP_STRING([--disable-altivec], [do not use assembly codes for Motorola 74xx CPUs]))
-
-AC_ARG_ENABLE([vis],
- AS_HELP_STRING([--disable-vis], [do not use assembly codes for Sun UltraSPARC CPUs]))
-
-AC_ARG_ENABLE([mlib],
- AS_HELP_STRING([--enable-mlib], [build Sun mediaLib support]))
-
-AC_ARG_ENABLE([mlib-lazyload],
- AS_HELP_STRING([--enable-mlib-lazyload], [check for Sun mediaLib at runtime]))
-
-if test "x$enable_mlib" = xyes; then
- if test "x$MLIBHOME" = x; then
- mlibhome=/opt/SUNWmlib
- else
- mlibhome="$MLIBHOME"
- fi
-
- AC_CHECK_LIB(mlib, mlib_VideoAddBlock_U8_S16,
- [ saved_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I$mlibhome/include"
- AC_CHECK_HEADER(mlib_video.h,
- [ if test "x$enable_mlib_lazyload" = xyes; then
- if test "$GCC" = yes; then
- MLIB_LIBS="-L$mlibhome/lib -Wl,-z,lazyload,-lmlib,-z,nolazyload"
- else
- MLIB_LIBS="-L$mlibhome/lib -z lazyload -lmlib -z nolazyload"
- fi
- AC_DEFINE(MLIB_LAZYLOAD,1,[Define this if you want to load mlib lazily])
- else
- MLIB_LIBS="-L$mlibhome/lib -lmlib"
- fi
- MLIB_CFLAGS="-I$mlibhome/include"
- LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS $MLIB_CFLAGS"
- LIBFFMPEG_CFLAGS="$LIBFFMPEG_CFLAGS $MLIB_CFLAGS"
- AC_DEFINE(HAVE_MLIB,1,[Define this if you have mlib installed])
- AC_DEFINE(LIBMPEG2_MLIB,1,[Define this if you have mlib installed])
- ac_have_mlib=yes
- ],)
- CPPFLAGS="$saved_CPPFLAGS"
- ], , -L$mlibhome/lib)
-fi
-AM_CONDITIONAL(HAVE_MLIB, test "x$ac_have_mlib" = "xyes")
-AC_SUBST(MLIB_LIBS)
-AC_SUBST(MLIB_CFLAGS)
-
-dnl ---------------------------------------------
-dnl Checks for X11
-dnl ---------------------------------------------
-
-if test "x$with_x" != "xno"; then
- PKG_CHECK_MODULES([X], [x11 xext], , [
- AC_PATH_XTRA
-
- dnl Set xv_path if its not done already
- dnl we do it here before rewriting X_LIBS
- if test x$xv_path = x; then
- xv_path=`echo $X_LIBS | sed -e 's/\-L\(.*\)/\1/'`
- fi
-
- dnl ----------------------------------------------
- dnl Check for XShm support (required with X)
- dnl ----------------------------------------------
-
- if test "x$no_x" != "xyes"; then
- ac_save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $X_CFLAGS"
- AC_CHECK_HEADERS([X11/extensions/XShm.h], [true],
- [AC_MSG_ERROR([XShm extension is required])], [[#include <X11/Xlib.h>]])
- AC_CHECK_LIB([Xext], [main], [true],
- [AC_MSG_ERROR([libXext is required])], [$X_LIBS])
- CPPFLAGS="$ac_save_CPPFLAGS"
- X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 -lXext"
- fi
- ])
+if test x"$have_xdg_basedir" = xyes; then
+ XDG_BASEDIR_REQUIRES="libxdg-basedir"
else
- no_x="yes"
-fi
-
-if test "x$no_x" != "xyes"; then
- AC_DEFINE(HAVE_X11,1,[Define this if you have X11R6 installed])
+ XDG_BASEDIR_CPPFLAGS='-I$(top_srcdir)/contrib/libxdg-basedir'
+ XDG_BASEDIR_LIBS='$(top_builddir)/contrib/libxdg-basedir/libxdg-basedir.la'
+ XDG_BASEDIR_DEPS='$(top_builddir)/contrib/libxdg-basedir/libxdg-basedir.la'
fi
-AM_CONDITIONAL(HAVE_X11, [test "x$no_x" != "xyes"])
-
-
-dnl ---------------------------------------------
-dnl Locate libraries needed for X health check
-dnl ---------------------------------------------
-soname_script="/[[0-9]]$/! d; s%^.*/%%
-t q
-b
-:q
-q"
-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.so"* "${x_libraries:-/usr/lib}/libX11.so"* 2>/dev/null | sed -e \"${soname_script}\"`"
-AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.so}", [The soname of libX11, needed for dlopen()])
-x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.so"* "${x_libraries:-/usr/lib}/libXv.so"* 2>/dev/null | sed -e \"${soname_script}\"`"
-AC_DEFINE_UNQUOTED([LIBXV_SO], "${x_lib_location:-libXv.so}", [The soname of libXv, needed for dlopen()])
+AC_SUBST([XDG_BASEDIR_REQUIRES])
+AC_SUBST([XDG_BASEDIR_CPPFLAGS])
+AC_SUBST([XDG_BASEDIR_LIBS])
+AC_SUBST([XDG_BASEDIR_DEPS])
-
-dnl ---------------------------------------------
-dnl socket library
-dnl ---------------------------------------------
+AM_CONDITIONAL([EXTERNAL_LIBXDG_BASEDIR], [test x"$have_xdg_basedir" = xyes])
dnl Test for socket and network support library
-NET_LIBS=""
-AC_CHECK_LIB(socket, socket, NET_LIBS="-lsocket $NET_LIBS",)
-AC_CHECK_LIB(nsl, gethostbyname, NET_LIBS="-lnsl $NET_LIBS",)
+AC_CHECK_LIB([socket], [socket], [NET_LIBS="-lsocket $NET_LIBS"])
+AC_CHECK_LIB([nsl], [gethostbyname], [NET_LIBS="-lnsl $NET_LIBS"])
+AC_CHECK_LIB([resolv], [hstrerror], [NET_LIBS="-lresolv $NET_LIBS"])
AC_SUBST(NET_LIBS)
-
-dnl ---------------------------------------------
-dnl socklen_t
-dnl ---------------------------------------------
-AC_CHECK_SOCKLEN_T
-
-
-dnl ---------------------------------------------
-dnl IPv6
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([ipv6],
- AS_HELP_STRING([--enable-ipv6], [enable use of IPv6]))
-
-if test "x$enable_ipv6" = "xyes"; then
- AC_DEFINE([ENABLE_IPV6], [1], [Enable this when IPv6 is requested])
-fi
-
-dnl ---------------------------------------------
-dnl zlib
-dnl ---------------------------------------------
-
-AC_ARG_WITH(zlib-prefix,
- AS_HELP_STRING(
- [--with-zlib-prefix=PREFIX],
- [path to zlib compression library]),
- [zlib_prefix="$withval"],
- [zlib_prefix="no"])
-
-if test "x$zlib_prefix" = "xno"; then
- ZLIB_LIBS="-lz"
-else
- ZLIB_CPPFLAGS="-I$zlib_prefix/include"
- ZLIB_LIBS="-L$zlib_prefix/lib -lz"
-fi
-
-ac_save_CPPFLAGS="$CPPFLAGS"
-ac_save_LIBS="$LIBS"
-CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS"
-LIBS="$LIBS $ZLIB_LIBS"
-
-AC_CHECK_LIB(z, gzsetparams,
- [AC_CHECK_HEADER(zlib.h,
- have_zlib=yes)])
-
-CPPFLAGS="$ac_save_CPPFLAGS"
-LIBS="$ac_save_LIBS"
-
-if test "x$have_zlib" != "xyes"; then
- AC_MSG_ERROR(zlib needed)
-fi
-AC_SUBST(ZLIB_CPPFLAGS)
-AC_SUBST(ZLIB_LIBS)
-
-
-dnl ---------------------------------------------
-dnl check posix timers
-dnl ---------------------------------------------
-
-AC_CHECK_LIB(rt, clock_getres,
+AC_CHECK_LIB([rt], [clock_getres],
[RT_LIBS="-lrt"
- AC_DEFINE(HAVE_POSIX_TIMERS,1,
- [Define this if you have POSIX timers.])],
- AC_MSG_RESULT([*** no POSIX timers available.]))
+ AC_DEFINE(HAVE_POSIX_TIMERS, 1, [Define this if you have POSIX timers.])],
+ [AC_MSG_RESULT([*** no POSIX timers available.])])
AC_SUBST(RT_LIBS)
-dnl ---------------------------------------------
-dnl Check for OpenGL & [GLut | GLU]
-dnl ---------------------------------------------
-
-AM_PATH_OPENGL()
-
+AC_CHECK_LIB([posix4], [sched_get_priority_min])
-dnl ---------------------------------------------
-dnl Check for platform which supports syncfb
-dnl ---------------------------------------------
+AC_CHECK_LIB([kstat], [kstat_open],
+ [KSTAT_LIBS=-lkstat
+ AC_DEFINE([HAVE_KSTAT], 1, [Define this if you have kernel statistics available via kstat interface])])
+AC_SUBST(KSTAT_LIBS)
-AC_ARG_ENABLE([syncfb],
- AS_HELP_STRING([--disable-syncfb], [do not build syncfb plugin]))
+AC_ARG_WITH([zlib-prefix],
+ [AS_HELP_STRING([--with-zlib-prefix=PREFIX], [path to zlib compression library])],
+ [if test x"$withval" != x"no"; then
+ ZLIB_CPPFLAGS="-I$withval/include"
+ ZLIB_LIBS="-L$withval/lib"
+ fi])
+
+AC_CHECK_LIB([z], [gzsetparams],
+ [ZLIB_LIBS="$ZLIB_LIBS -lz"
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS"
+ AC_CHECK_HEADER([zlib.h], [have_zlib=yes], [have_zlib=no])
+ CPPFLAGS="$ac_save_CPPFLAGS"],
+ [have_zlib=no],
+ ["$ZLIB_LIBS"])
+
+test x"$have_zlib" != x"yes" && AC_MSG_ERROR(zlib needed)
+AC_SUBST(ZLIB_CPPFLAGS)
+AC_SUBST(ZLIB_LIBS)
-case "$host_os" in
- *linux*) ;;
- *)
- if test "x$enable_syncfb" = "xyes"; then
- AC_MSG_ERROR([You cannot build SyncFB support on non-Linux systems.])
+dnl FreeType2 (optional; disabled by default)
+AC_ARG_WITH([freetype],
+ [AS_HELP_STRING([--with-freetype], [Build with FreeType2 library])],
+ [], [with_freetype=no])
+if test x"$with_freetype" != x"no"; then
+ PKG_CHECK_MODULES([FT2], [freetype2], [have_freetype=yes], [have_freetype=no])
+ if test x"$have_freetype" = x"no"; then
+ AC_MSG_ERROR([FreeType2 support requested but FreeType2 library not found])
+ elif test x"$have_freetype" = x"yes"; then
+ AC_DEFINE([HAVE_FT2], 1, [Define this if you have freetype2 library])
fi
- enable_syncfb=no ;;
-esac
-
-AM_CONDITIONAL(HAVE_SYNCFB, test "x$enable_syncfb" != "xno")
-
-
-dnl ----------------------------------------------
-dnl Check for usable video-for-linux (v4l) support
-dnl ----------------------------------------------
-AC_ARG_ENABLE([v4l],
- AS_HELP_STRING([--disable-v4l], [do not build Video4Linux input plugins]))
-
-have_v4l=no
-have_v4l2=no
-if test "x$enable_v4l" != "xno"; then
- AC_CHECK_HEADERS([linux/videodev.h], [have_v4l=yes], [])
- AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h sys/videodev2.h], [have_v4l2=yes], [])
- AC_CHECK_HEADERS([asm/types.h])
- if test "x$enable_v4l" = "xyes" && test "x$have_v4l$have_v4l2" = "xnono"; then
- AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.])
- fi
fi
-AM_CONDITIONAL(HAVE_V4L, [test "x$have_v4l" = "xyes"])
-AM_CONDITIONAL(HAVE_V4L2, [test "x$have_v4l2" = "xyes"])
-
-dnl ----------------------------------------------
-dnl Check for libv4l support
-dnl ----------------------------------------------
-AC_ARG_ENABLE([libv4l],
- AS_HELP_STRING([--disable-libv4l], [do not build with libv4l support]))
-
-if test "x$have_v4l2" = xyes && test "x$enable_libv4l" != xno; then
- have_libv4l=no
- PKG_CHECK_MODULES([V4L2], [libv4l2],
- [have_libv4l=yes
- AC_DEFINE([HAVE_LIBV4L2_H], [1], [Define this if you have libv4l installed])],
- [have_libv4l=no])
- if test "x$enable_libv4l" = "xyes" && test "x$have_libv4l" = "xno"; then
- AC_MSG_ERROR([libv4l requested but not found.])
- fi
+dnl fontconfig (optional; disabled by default)
+AC_ARG_WITH([fontconfig],
+ [AS_HELP_STRING([--with-fontconfig], [Build with fontconfig library])],
+ [], [with_fontconfig=no])
+if test x"$with_fontconfig" = x"yes"; then
+ if test x"$have_freetype" != x"yes"; then
+ AC_MSG_ERROR([fontconfig support requested, but FreeType2 not enabled.])
+ fi
+ PKG_CHECK_MODULES([FONTCONFIG], [fontconfig], [have_fontconfig=yes], [have_fontconfig=no])
+ if test x"$have_fontconfig" = x"no"; then
+ AC_MSG_ERROR([fontconfig support requested but fontconfig library not found])
+ elif test x"$have_fontconfig" = x"yes"; then
+ AC_DEFINE([HAVE_FONTCONFIG], 1, [Define this if you have fontconfig library])
+ fi
fi
-dnl ----------------------------------------------
-dnl Check for Xv and XvMC support
-dnl ----------------------------------------------
-
-dnl With recent XFree86 or Xorg, dynamic linking is preferred!
-dnl Only dynamic linking is possible when using libtool < 1.4.0
-
-AC_ARG_WITH(xv-path, AS_HELP_STRING([--with-xv-path=path], [where libXv is installed]),
- xv_path="$withval",)
+dnl -----------------------
+dnl checks for header files
+dnl -----------------------
-AC_ARG_ENABLE([static-xv],
- AS_HELP_STRING([--enable-static-xv],[Enable this to force linking against libXv.a]))
-
-if test "x$enable_static_xv" = "xyes"; then
- xv_prefer_shared="no"
-else
- xv_prefer_shared="yes"
-fi
+AC_HEADER_STDC
-if test "x$no_x" != "xyes"; then
- PKG_CHECK_MODULES([XV], [xv], [
- ac_have_xv="yes"
- AC_DEFINE([HAVE_XV], [1], [Define this if you have libXv installed])
- ], [AC_FIND_LIBXV])
-fi
-AM_CONDITIONAL(HAVE_XV, test "x$ac_have_xv" = "xyes")
+AC_CHECK_HEADERS([alloca.h])
+AC_CHECK_HEADERS([assert.h byteswap.h dirent.h errno.h execinfo.h fcntl.h glob.h])
+AC_CHECK_HEADERS([libgen.h malloc.h netdb.h stdbool.h ucontext.h])
+AC_CHECK_HEADERS([sys/ioctl.h sys/mixer.h sys/mman.h sys/param.h sys/times.h sys/wait.h])
+dnl This is duplicative due to AC_HEADER_STDC, but src/input/vcd stuff needs to
+dnl have HAVE_STDIO_H defined, or it won't compile.
+AC_CHECK_HEADERS([stdio.h])
-host_or_hostalias="$host"
-if test "$host_or_hostalias" = ""; then
- dnl user has called ./configure with a host parameter unknown to
- dnl config.sub; the canonical "$host" is empty
- dnl
- dnl Try the following switch with user's original host_alias
- dnl input instead.
- dnl
- host_or_hostalias="$host_alias"
-fi
-
-case "$host_or_hostalias" in
- hppa*)
- if test "x$ac_have_xv_static" = "xyes"; then
- echo "warning: hppa linker - disabling static libXv"
- XV_LIBS="libXv.so"
- fi
- ;;
-
- ppc-*-linux* | powerpc-*)
- ppc_arch="yes"
- ;;
-
- *)
+dnl cdrom ioctls (common for dvdnav and vcd)
+case "$host_os" in
+ linux*)
+ AC_CHECK_HEADERS([linux/cdrom.h],
+ [AC_DEFINE([HAVE_LINUX_CDROM], 1, [Define 1 if you have Linux-type CD-ROM support])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <linux/cdrom.h>]],
+ [[struct cdrom_generic_command test; int has_timeout = sizeof(test.timeout);]])],
+ [AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1], [Define 1 if timeout is in cdrom_generic_command struct])])])
;;
esac
-AM_CONDITIONAL(PPC_ARCH, test "x$ppc_arch" = "xyes")
-
-dnl
-dnl Check if we can enable the xxmc plugin.
-dnl
-
-AC_ARG_ENABLE([xvmc],
- AS_HELP_STRING([--disable-xvmc], [Disable XxMC and XvMC outplut plugins]) )
+AC_CHECK_HEADERS([sys/dvdio.h sys/cdio.h sys/scsiio.h])
-if test "x$no_x" = "x" && test "x$enable_xvmc" != "xno"; then
-AC_ARG_WITH(xxmc-path, AS_HELP_STRING([--with-xxmc-path=path], [where libXvMC libraries for the
- xxmc plugin are installed. Defalts to the default X library path.]),
- xxmc_path="$withval", xxmc_path="$x_libraries")
-AC_ARG_WITH(xxmc-lib, AS_HELP_STRING([--with-xxmc-lib=XXXX], [The name of the XvMC library
- libXXXX.so for the xxmc plugin.]),xxmc_stub="$withval",
- xxmc_stub="XvMCW")
+dnl ----------------
+dnl checks for types
+dnl ----------------
-saved_libs="$LIBS"
-saved_CPPFLAGS="$CPPFLAGS"
-if test "x$x_includes" != "x"; then
- CPPFLAGS="$CPPFLAGS -I$x_includes"
-fi
-
-XXMC_LIBS="${xxmc_path:+-L}$xxmc_path -l$xxmc_stub"
-AC_MSG_CHECKING(whether to enable the xxmc plugin with vld extensions)
-AC_MSG_RESULT()
-dnl Check if vld "extended" XvMC is available
-if test "x$xxmc_stub" = "xXvMCW" && test "x$ac_have_xv" = "xyes"; then
- AC_CHECK_LIB($xxmc_stub, XvMCPutSlice,
- ac_have_xxmc="yes",
- [ac_have_xxmc="no"
- AC_MSG_RESULT([*** Could not link with -l$xxmc_stub for vld extensions.])],
- [${xxmc_path:+-L}$xxmc_path $X_LIBS $X_PRE_LIBS $XV_LIBS -lXext $X_EXTRA_LIBS])
-else
- if test "x$ac_have_xv" = "xyes"; then
- AC_CHECK_LIB($xxmc_stub, XvMCPutSlice,
- [ac_have_xxmc="yes"
- XXMC_LIBS="$XXMC_LIBS -lXvMC"],
- [ac_have_xxmc="no"
- AC_MSG_RESULT([*** Could not link with -l$xxmc_stub -lXvMC for vld extensions.])],
- [${xxmc_path:+-L}$xxmc_path -lXvMC $X_LIBS $X_PRE_LIBS $XV_LIBS -lXext $X_EXTRA_LIBS])
- else
- ac_have_xxmc="no",
- fi
-fi
-
-if test "x$ac_have_xxmc" = "xyes"; then
- AC_CHECK_HEADERS(X11/extensions/vldXvMC.h,
- [ac_have_vldxvmc_h="yes"],
- ac_have_vldxvmc="no",)
- if test "x$ac_have_vldxvmc_h" = "xyes"; then
- AC_DEFINE([HAVE_VLDXVMC], [1],
- [Define 1 if you have vldXvMC.h])
- fi
-fi
-dnl Try fallback to standard XvMC if vld failed
-if test "x$ac_have_xxmc" = "xno"; then
- if test "x$xxmc_stub" = "xXvMCW"; then
- AC_CHECK_LIB($xxmc_stub, XvMCCreateContext,
- ac_have_xxmc="yes",
- [ac_have_xxmc="no"
- AC_MSG_RESULT([*** Could not link with -l$xxmc_stub for standard XvMC.])],
- [${xxmc_path:+-L}$xxmc_path $X_LIBS $X_PRE_LIBS $XV_LIBS -lXext $X_EXTRA_LIBS])
- else
- if test "x$ac_have_xv" = "xyes"; then
- AC_CHECK_LIB($xxmc_stub, XvMCCreateContext,
- [ac_have_xxmc="yes"
- XXMC_LIBS="$XXMC_LIBS -lXvMC"],
- [ac_have_xxmc="no"
- AC_MSG_RESULT([*** Could not link with -lXvMC for standard XvMC.])],
- [${xxmc_path:+-L}$xxmc_path -lXvMC $X_LIBS $X_PRE_LIBS $XV_LIBS -lXext $X_EXTRA_LIBS])
- else
- ac_have_xxmc="no",
- fi
- fi
-fi
-if test "x$ac_have_xxmc" = "xyes"; then
- AC_CHECK_HEADERS(X11/extensions/XvMC.h,,
- ac_have_xxmc="no",)
-fi
-if test "x$ac_have_xxmc" = "xyes"; then
- AC_DEFINE(HAVE_XXMC,1,[Define this to compile the xxmc plugin.])
- if test "x$ac_have_vldxvmc_h" = "xyes"; then
- AC_MSG_RESULT([*** Enabling xxmc plugin with vld extensions.])
- else
- AC_MSG_RESULT([*** Enabling xxmc plugin for standard XvMC *only*.])
- fi
-else
- AC_MSG_RESULT([*** Disabling xxmc plugin due to above errors.])
-fi
-LIBS="$saved_libs"
-fi
-AM_CONDITIONAL(HAVE_VLDXVMC, test "x$ac_have_vldxvmc_h" = "xyes")
-AM_CONDITIONAL(HAVE_XXMC, test "x$ac_have_xxmc" = "xyes")
-AC_SUBST(XXMC_LIBS)
-
-dnl
-dnl Check if we can enable the xvmc plugin.
-dnl
-if test "x$no_x" = "x" && test "x$enable_xvmc" != "xno"; then
-
-AC_ARG_WITH(xvmc-path, AS_HELP_STRING([--with-xvmc-path=path], [where libXvMC libraries for the
- xvmc plugin are installed. Defalts to the default X library path.]),
- xvmc_path="$withval", xvmc_path="$x_libraries")
-AC_ARG_WITH(xvmc-lib, AS_HELP_STRING([--with-xvmc-lib=XXXX], [The name of the XvMC library
- libXXXX.so for the xvmc plugin.]),xvmc_stub="$withval",
- xvmc_stub="XvMCW")
-saved_libs="$LIBS"
-XVMC_LIBS="${xvmc_path:+-L}$xvmc_path -l$xvmc_stub"
-AC_MSG_CHECKING(whether to enable the xvmc plugin)
-AC_MSG_RESULT()
-if test "x$xvmc_stub" = "xXvMCW"; then
- AC_CHECK_LIB($xvmc_stub, XvMCCreateContext,
- ac_have_xvmc="yes",
- [ac_have_xvmc="no"
- AC_MSG_RESULT([*** Could not link with -l$xvmc_stub.])],
- [${xvmc_path:+-L}$xvmc_path $X_LIBS $X_PRE_LIBS $XV_LIBS -lXext $X_EXTRA_LIBS])
-else
- if test "x$ac_have_xv" = "xyes"; then
- AC_CHECK_LIB($xvmc_stub, XvMCCreateContext,
- [ac_have_xvmc="yes"
- XVMC_LIBS="$XVMC_LIBS -lXvMC"],
- [ac_have_xvmc="no"
- AC_MSG_RESULT([*** Could not link with -lXvMC.])],
- [${xvmc_path:+-L}$xvmc_path -lXvMC $X_LIBS $X_PRE_LIBS $XV_LIBS -lXext $X_EXTRA_LIBS])
- else
- ac_have_xvmc="no",
- fi
-fi
-if test "x$ac_have_xvmc" = "xyes"; then
- AC_CHECK_HEADERS(X11/extensions/XvMC.h,,
- ac_have_xvmc="no",)
-fi
-if test "x$ac_have_xvmc" = "xyes"; then
- AC_DEFINE(HAVE_XVMC,1,[Define this if you have an XvMC library and XvMC.h installed.])
- AC_MSG_RESULT([*** Enabling old xvmc plugin.])
-else
- AC_MSG_RESULT([*** Disabling old xvmc plugin due to above errors.])
-fi
-CPPFLAGS="$saved_CPPFLAGS"
-LIBS="$saved_libs"
-fi
-AM_CONDITIONAL(HAVE_XVMC, test "x$ac_have_xvmc" = "xyes")
-AC_SUBST(XVMC_LIBS)
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_CHECK_SIZEOF([int])
+AC_CHECK_SIZEOF([long])
+AC_CHECK_GENERATE_INTTYPES([include])
+AM_CONDITIONAL([GENERATED_INTTYPES_H], [test "x$ac_cv_header_inttypes_h" != x"yes"])
+AC_CHECK_TYPE([ssize_t], [],
+ [AC_DEFINE([ssize_t], [__int64], [define ssize_t to __int64 if it's missing in default includes])])
+AC_CHECK_SOCKLEN_T
+AC_CACHE_CHECK([type of request parameter for ioctl()], [ac_cv_ioctl_request], [
+ for ac_ioctl_request_type in "unsigned long" "int"; do
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/ioctl.h>
+ int ioctl(int fd, $ac_ioctl_request_type request, ...);]], [[]])],
+ [ac_cv_ioctl_request=$ac_ioctl_request_type], [])
+ done
+ if test x"$ac_cv_ioctl_request" = x""; then
+ AC_MSG_ERROR([Unable to determine the type for ioctl() request parameter])
+ fi
+])
+AC_DEFINE_UNQUOTED([IOCTL_REQUEST_TYPE], [$ac_cv_ioctl_request], [Type of the request parameter for ioctl()])
-dnl ---------------------------------------------
-dnl Check for xcb
-dnl ---------------------------------------------
-AC_ARG_WITH([xcb], AS_HELP_STRING([--without-xcb], [Doesn't build XCB video out plugins]))
-if test "x$with_xcb" != "xno"; then
- PKG_CHECK_MODULES([XCB], [xcb-shape >= 1.0], [have_xcb="yes"], [have_xcb="no"])
-fi
+dnl ---------------------
+dnl checks for structures
+dnl ---------------------
-AC_SUBST(XCB_CFLAGS)
-AC_SUBST(XCB_LIBS)
-AM_CONDITIONAL(HAVE_XCB, test "x$have_xcb" = "xyes" )
+AC_CHECK_MEMBER([struct tm.tm_gmtoff],
+ [AC_DEFINE([HAVE_TM_GMTOFF], 1, [Define if struct tm has the tm_gmtoff member.])],
+ [], [#include <time.h>])
-dnl ---------------------------------------------
-dnl Check for xcb-shm
-dnl ---------------------------------------------
+dnl -----------------------------------
+dnl checks for compiler characteristics
+dnl -----------------------------------
-if test "x$have_xcb" = "xyes"; then
- PKG_CHECK_MODULES([XCBSHM], [xcb-shm], [have_xcbshm="yes"], [have_xcbshm="no"])
+if test x"$GCC" = x"yes"; then
+ GCC_VERSION="`$CC -dumpversion`"
+ GCC_VERSION_MAJOR="`echo "$GCC_VERSION" | cut -d '.' -f1`"
+ GCC_VERSION_MINOR="`echo "$GCC_VERSION" | cut -d '.' -f2`"
+ GCC_VERSION_PATCHLEVEL="`echo "$GCC_VERSION" | cut -d '.' -f3`"
fi
-AC_SUBST(XCBSHM_CFLAGS)
-AC_SUBST(XCBSHM_LIBS)
-AM_CONDITIONAL(HAVE_XCBSHM, test "x$have_xcbshm" = "xyes" )
-
-
-dnl ---------------------------------------------
-dnl Check for xcb-xv
-dnl ---------------------------------------------
-
-if test "x$have_xcb" = "xyes"; then
- PKG_CHECK_MODULES([XCBXV], [xcb-xv], [have_xcbxv="yes"], [have_xcbxv="no"])
-fi
-
-AC_SUBST(XCBXV_CFLAGS)
-AC_SUBST(XCBXV_LIBS)
-AM_CONDITIONAL(HAVE_XCBXV, test "x$have_xcbxv" = "xyes" )
+CC_CHECK_WERROR
+CC_PTHREAD_FLAGS([], [AC_MSG_ERROR([Pthread support is needed])])
+CC_PTHREAD_RECURSIVE_MUTEX([], [AC_MSG_ERROR([recursive mutex support is needed - please report])])
+dnl <pthread.h> is implicitly included by xine-internals.h, so the include dir is needed everywhere
+CPPFLAGS="$CPPFLAGS $PTHREAD_CFLAGS"
-dnl ---------------------------------------------
-dnl Checks for Xinerama extension
-dnl ---------------------------------------------
+dnl REVISIT: AC_C_ALWAYS_INLINE removal allows ffmpeg to be more widely buildable
+AC_C_BIGENDIAN
+AC_C_CONST
+AC_C_INLINE
+AC_C_RESTRICT
-AC_ARG_ENABLE([xinerama],
- AS_HELP_STRING([--disable-xinerama], [do not build Xinerama support]))
-
-if test "x$enable_xinerama" != "xno"; then
- PKG_CHECK_MODULES([XINERAMA], [xinerama], [ac_have_xinerama=yes], [
- AC_CHECK_LIB(Xinerama, XineramaQueryExtension,
- [XINERAMA_LIBS="-lXinerama"
- ac_have_xinerama="yes"],,
- [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
- ])
- if test "x$ac_have_xinerama" = "xyes"; then
- AC_DEFINE(HAVE_XINERAMA,1,[Define this if you have libXinerama installed])
- X_LIBS="${X_LIBS} ${XINERAMA_LIBS}"
- fi
-else
- ac_have_xinerama=no
-fi
-dnl AM_CONDITIONAL(HAVE_XINERAMA, test "x$ac_have_xinerama" = "xyes")
+dnl empty_array_size - src/input/vcd
+AC_MSG_CHECKING([how to create empty arrays])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[]; } baz]])],
+ [empty_array_size=""],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[0]; } baz]])],
+ [empty_array_size="0"],
+ [AC_MSG_ERROR([compiler is unable to create empty arrays])])])
-
-dnl ---------------------------------------------
-dnl Checks for Ascii-Art library
-dnl ---------------------------------------------
+AC_DEFINE_UNQUOTED([EMPTY_ARRAY_SIZE], [$empty_array_size], [what to put between the brackets for empty arrays])
+AC_MSG_RESULT([[[$empty_array_size]]])
-AC_ARG_ENABLE([aalib],
- AS_HELP_STRING([--disable-aalib], [do not build AALIB support]),
- [with_aalib=$enableval], [with_aalib=yes])
+dnl ISOC99_PRAGMA - src/input/vcd/libvcd
+AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Pragma("pack(1)")]])],
+ [ISOC99_PRAGMA=yes
+ AC_DEFINE([HAVE_ISOC99_PRAGMA], [], [Supports ISO _Pragma() macro])],
+ [ISOC99_PRAGMA=no])
+AC_MSG_RESULT([$ISOC99_PRAGMA])
-if test "x$with_aalib" = "xyes"; then
- AM_PATH_AALIB(1.4,, AC_MSG_RESULT([*** All of AALIB dependent parts will be disabled ***]))
-else
- no_aalib=yes
-fi
-AM_CONDITIONAL(HAVE_AA, test "x$no_aalib" != "xyes")
+dnl ASM ALIGN is power of two ?
+dnl src/post/planar
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[asm(".align 3");]])],
+ [AC_DEFINE([ASMALIGN_1SLN], [1],
+ [define if '.align n' means alignment to (1 << n) - byte boundaries])])
-dnl ---------------------------------------------
-dnl Checks for Color AsCii Art library
-dnl ---------------------------------------------
+CC_ATTRIBUTE_ALIGNED
-AC_ARG_WITH([caca],
- AS_HELP_STRING([--without-caca], [Do not build CACA support]))
+CC_ATTRIBUTE_VISIBILITY([protected],
+ [visibility_export="protected"],
+ [CC_ATTRIBUTE_VISIBILITY([default], [visibility_export="default"])])
+CC_ATTRIBUTE_VISIBILITY([internal])
-if test "x$with_caca" != "xno"; then
- have_caca=yes
- PKG_CHECK_MODULES([CACA], [caca >= 0.99beta14 cucul >= 0.99beta14 ],
- [], [AC_MSG_RESULT(no); have_caca="no"])
- if test "x$with_caca" = "xyes" && test "x$have_caca" = "xno"; then
- AC_MSG_ERROR([CACA support requested, but libcaca 0.99 not found])
- fi
+if test x"$visibility_export" != x""; then
+ CC_FLAG_VISIBILITY([VISIBILITY_FLAG="-fvisibility=hidden"
+ EXPORTED='__attribute__((visibility("default")))'])
fi
+AC_DEFINE_UNQUOTED([EXPORTED], [$EXPORTED], [Mark a symbol as being exported if visibility is changed])
+AC_SUBST([VISIBILITY_FLAG])
-AM_CONDITIONAL([HAVE_CACA], [test "x$have_caca" = "xyes"])
-
-dnl ---------------------------------------------
-dnl Check solaris framebuffer device support
-dnl ---------------------------------------------
-
-AC_CHECK_HEADER(sys/fbio.h, ac_have_sunfb=yes,)
-AM_CONDITIONAL(HAVE_SUNFB, [test "x$ac_have_sunfb" = "xyes"])
-
-
-dnl ---------------------------------------------
-dnl Check for Sun DGA
-dnl ---------------------------------------------
-
-saved_LDFLAGS="$LDFLAGS"
-LDFLAGS="$LDFLAGS -L/usr/openwin/lib"
-saved_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS -I/usr/openwin/include"
-AC_CHECK_LIB(dga, XDgaGrabDrawable, [
- AC_CHECK_HEADER(dga/dga.h, [
- SUNDGA_CFLAGS="-I/usr/openwin/include"
- SUNDGA_LIBS="-L/usr/openwin/lib -R/usr/openwin/lib -ldga"
- ac_have_sundga=yes
- ])
-])
-LDFLAGS="$saved_LDFLAGS"
-CPPFLAGS="$saved_CPPFLAGS"
-AM_CONDITIONAL(HAVE_SUNDGA, [test "x$ac_have_sundga" = "xyes"])
-AC_SUBST(SUNDGA_CFLAGS)
-AC_SUBST(SUNDGA_LIBS)
-
-
-dnl ---------------------------------------------
-dnl Check linux framebuffer device support
-dnl ---------------------------------------------
-
-AC_CHECK_HEADER(linux/fb.h,
- [AC_DEFINE(HAVE_FB,1,[Define this if you have linux framebuffer support])
- have_fb=yes],)
-AC_ARG_ENABLE(fb, AS_HELP_STRING([--disable-fb], [do not build linux framebuffer support]),
- have_fb=$enableval)
-AM_CONDITIONAL(HAVE_FB, [test "x$have_fb" = "xyes"])
-
-
-dnl ---------------------------------------------
-dnl Check whether to build Mac OS X video output driver
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE(macosx_video, AS_HELP_STRING([--enable-macosx-video], [enable support for Mac OS X OpenGL video output]),
- have_macosx_video=$enableval)
-AM_CONDITIONAL(HAVE_MACOSX_VIDEO, [test "x$have_macosx_video" = "xyes"])
-
+CC_ATTRIBUTE_SENTINEL
+CC_ATTRIBUTE_FORMAT
+CC_ATTRIBUTE_FORMAT_ARG
+CC_ATTRIBUTE_DEPRECATED
+CC_ATTRIBUTE_UNUSED
+CC_ATTRIBUTE_MALLOC
-dnl ---------------------------------------------
-dnl Check whether to build Mac OS X audio output driver
-dnl ---------------------------------------------
+CC_ATTRIBUTE_PACKED([],
+ [AC_MSG_WARN([Your compiler doesn't support __attribute__((packed)); xine might not work as expected.])])
+CC_ATTRIBUTE_CONST
-AC_ARG_ENABLE(coreaudio, AS_HELP_STRING([--enable-coreaudio], [enable support for Mac OS X Coreaudio output]),
- have_coreaudio=$enableval)
-AM_CONDITIONAL(HAVE_COREAUDIO, [test "x$have_coreaudio" = "xyes"])
+CC_CHECK_CFLAGS([-pipe], [miscflags="$miscflags -pipe"])
+dnl Set warning flags for warnings that we do not want to skip. In all cases,
+dnl these warnings should be enabled. Set these into CFLAGS and OBJCFLAGS
+dnl later after all testing is done.
-dnl ---------------------------------------------
-dnl Check for DirectFB
-dnl ---------------------------------------------
-AC_ARG_ENABLE(directfb,
- AS_HELP_STRING([--enable-directfb], [enable use of DirectFB]),
- enable_directfb=$enableval,
- enable_directfb=no)
+CC_CHECK_CFLAGS([-Wall], [warnflags="$warnflags -Wall"])
-if test "x$enable_directfb" = "xyes"; then
- PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.22], [have_directfb="yes"], [have_directfb="no"])
+CC_CHECK_CFLAGS([-Wformat=2], [wformat="-Wformat=2"],
+ [CC_CHECK_CFLAGS([-Wformat], [wformat="-Wformat"])])
+if test x"$wformat" != x""; then
+ CC_CHECK_CFLAGS([-Wno-format-zero-length], [wformat="$wformat -Wno-format-zero-length"])
fi
+CC_CHECK_CFLAGS([-Wmissing-format-attribute], [wformat="$wformat -Wmissing-format-attribute"])
+warnflags="$warnflags $wformat"
-AC_SUBST(DIRECTFB_CFLAGS)
-AC_SUBST(DIRECTFB_LIBS)
-AM_CONDITIONAL(HAVE_DIRECTFB, test "x$have_directfb" = "xyes" )
-
-
-dnl ---------------------------------------------
-dnl check for SDL
-dnl ---------------------------------------------
-
-AC_ARG_WITH([sdl],
- AS_HELP_STRING([--without-sdl], [Build without SDL video output]))
-
-if test "x$with_sdl" != "xno"; then
- PKG_CHECK_MODULES([SDL], [sdl], [have_sdl=yes], [have_sdl=no])
- if test "x$with_sdl" = "xyes" && test "x$have_sdl" = "xno"; then
- AC_MSG_ERROR([SDL support requested, but SDL not found])
- elif test "x$have_sdl" = "xyes"; then
- AC_DEFINE([HAVE_SDL], [1], [Define this if you have SDL installed])
- fi
-fi
+dnl WARNING: This warning flag, if set into CFLAGS now, can break some autoconf tests.
+CC_CHECK_CFLAGS([-Werror-implicit-function-declaration], [warnflags="$warnflags -Werror-implicit-function-declaration"])
-AM_CONDITIONAL([HAVE_SDL], [test "x$have_sdl" = "xyes"])
+CC_CHECK_CFLAGS([-Wstrict-aliasing=2], [warnflags="$warnflags -Wstrict-aliasing=2"],
+ [CC_CHECK_CFLAGS([-Wstrict-aliasing], [warnflags="$warnflags -Wstrict-aliasing"])])
-AC_SUBST([SDL_CFLAGS])
-AC_SUBST([SDL_LIBS])
+CC_CHECK_CFLAGS([-Wchar-subscripts], [warnflags="$warnflags -Wchar-subscripts"])
+CC_CHECK_CFLAGS([-Wmissing-declarations], [warnflags="$warnflags -Wmissing-declarations"])
+CC_CHECK_CFLAGS([-Wmissing-prototypes], [warnflags="$warnflags -Wmissing-prototypes"])
+CC_CHECK_CFLAGS([-Wwrite-strings], [warnflags="$warnflags -Wwrite-strings"])
-dnl ---------------------------------------------
-dnl check for Libstk
-dnl ---------------------------------------------
+dnl Some combinations of gcc and glibc produce useless warnings on memset when
+dnl compiling with -Wpointer-arith, so check for this first.
+AC_MSG_CHECKING([for sane -Wpointer-arith])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[int a; memset(&a, 0, sizeof(int))]])],
+ [warnflags="$warnflags -Wpointer-arith"
+ AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])])
-AC_ARG_WITH([libstk],
- AS_HELP_STRING([--with-libstk], [Build with STK surface video driver]))
+CC_CHECK_LDFLAGS([-Wl,--gc-sections], [GCSECTIONS="-Wl,--gc-sections"])
+AC_SUBST([GCSECTIONS])
-if test "x$with_libstk" = "xyes"; then
- PKG_CHECK_MODULES([LIBSTK], [libstk >= 0.2.0], [have_libstk=yes], [have_libstk=no])
- if test "x$with_libstk" = "xyes" && test "x$have_libstk" = "xno"; then
- AC_MSG_ERROR([libstk support requested, but libstk not found])
- fi
-fi
+dnl FreeBSD (et al.) does not complete linking for shared objects when pthreads
+dnl are requested, as different implementations are present; to avoid problems
+dnl use -Wl,-z,defs only for those platforms not behaving this way.
+case "$host_or_hostalias" in
+ *-freebsd*) ;;
-AM_CONDITIONAL([HAVE_STK], [test "x$have_libstk" = "xyes"])
+ dnl check if we are using the cygwin, mingw or cygwin with mno-cygwin mode
+ dnl in which case we are actually dealing with a mingw32 compiler
+ dnl This cannot be done until AC_PROG_EGREP and AC_PROG_CC are both done.
+ *-*-mingw* | *-*-cygwin*)
+ CC_CHECK_LDFLAGS([-Wl,-z,defs], [NOUNDEF="-Wl,-z,defs"])
+ case "$host_or_hostalias" in
+ *-*-mingw32*)
+ WIN32_SYS=mingw32
+ ;;
+ *-*-cygwin*)
+ AC_EGREP_CPP([yes],
+ [#ifdef WIN32
+ yes
+ #endif],
+ [WIN32_SYS=mingw32], [WIN32_SYS=cygwin])
+ ;;
+ esac
+
+ if test "$WIN32_SYS" = "mingw32"; then
+ WIN32_INCLUDES='-I$(top_srcdir)/win32/include'
+ LIBS="-lwinmm -lwsock32 $LIBS"
+ LDFLAGS="-Wl,--enable-stdcall-fixup $LDFLAGS"
+ dnl iberty has been needed only in older versions
+ AC_CHECK_LIB(iberty, strncomp, [GOOM_LIBS="-liberty"])
+ AC_SUBST(GOOM_LIBS)
+ fi
+ LDFLAGS="-no-undefined $LDFLAGS"
+ ;;
-dnl ---------------------------------------------
-dnl check for pulseaudio
-dnl ---------------------------------------------
+ *)
+ CC_CHECK_LDFLAGS([-Wl,-z,defs], [NOUNDEF="-Wl,-z,defs"])
+ ;;
+esac
-AC_ARG_WITH([pulseaudio],
- AS_HELP_STRING([--without-pulseaudio], [Do not build Pulseaudio support]))
+AC_SUBST(NOUNDEF)
+AM_CONDITIONAL([WIN32], [test x"$WIN32_SYS" = x"mingw32"])
-if test "x$with_pulseaudio" != "xno"; then
- PKG_CHECK_MODULES([PULSEAUDIO], [libpulse], [have_pulseaudio="yes"], [have_pulseaudio="no"])
+AC_ARG_ENABLE([altivec],
+ [AS_HELP_STRING([--disable-altivec], [do not use assembly codes for Motorola 74xx CPUs])],
+ [], [enable_altivec="yes"])
+
+dnl No optimization at all. For gcc, this is the optimization level.
+O0_CFLAGS="-O0"
+
+dnl Lowest level of optimization. For gcc, this enables:
+dnl -fdefer-pop -fdelayed-branch -fguess-branch-probability -fcprop-registers
+dnl -floop-optimize -fif-conversion -fif-conversion2 -ftree-ccp -ftree-dce
+dnl -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-ter -ftree-lrs
+dnl -ftree-sra -ftree-copyrename -ftree-fre -ftree-ch -fmerge-constants
+dnl On platforms where -fomit-frame-pointer does not interfere with debugging,
+dnl it is also enabled by -O1.
+O1_CFLAGS="-O1"
+
+dnl Middle level of optimization. For gcc, this enables -O1 and:
+dnl -fthread-jumps -fcrossjumping -foptimize-sibling-calls -fcse-follow-jumps
+dnl -fcse-skip-blocks -fgcse -fgcse-lm -fexpensive-optimizations
+dnl -fstrength-reduce -frerun-cse-after-loop -frerun-loop-opt -fcaller-saves
+dnl -fforce-mem -fpeephole2 -fschedule-insns -fschedule-insns2
+dnl -fsched-interblock -fsched-spec -fregmove -fstrict-aliasing
+dnl -fdelete-null-pointer-checks -freorder-blocks -freorder-functions
+dnl -funit-at-a-time -falign-functions -falign-jumps -falign-loops
+dnl -falign-labels -ftree-pre
+dnl Note that Apple's version of gcc differs slightly, because it does not enable
+dnl -fstrict-aliasing -freorder-blocks -fsched-interblock
+O2_CFLAGS="-O2"
+
+dnl Highest level of optimization. For gcc, this enables -O2 and:
+dnl -finline-functions -funswitch-loops -fgcse-after-reload
+O3_CFLAGS="-O3"
+
+dnl gcc 3.3.5 (at least) is known to be buggy wrt optimization with
+dnl -finline-functions, so use -fno-inline-functions for gcc < 3.4.0
+if test x"$GCC" = x"yes"; then
+ if test "$GCC_VERSION_MAJOR" -lt 3; then
+ O3_CFLAGS="$O3_CFLAGS -fno-inline-functions"
+ else
+ if test "$GCC_VERSION_MAJOR" -eq 3 -a "$GCC_VERSION_MINOR" -lt 4; then
+ O3_CFLAGS="$O3_CFLAGS -fno-inline-functions"
+ fi
+ fi
fi
-AM_CONDITIONAL(HAVE_PULSEAUDIO, [test "x$have_pulseaudio" = x"yes"])
-AC_SUBST([PULSEAUDIO_CFLAGS])
-AC_SUBST([PULSEAUDIO_LIBS])
-
-dnl ---------------------------------------------
-dnl check for DirectX
-dnl ---------------------------------------------
-
-AM_PATH_DIRECTX()
+CC_CHECK_CFLAGS([-ffast-math], [optflags="$optflags -ffast-math"])
+CC_CHECK_CFLAGS([-fexpensive-optimizations], [optflags="$optflags -fexpensive-optimizations"])
-
-dnl ---------------------------------------------
-dnl dxr3 / hollywood plus card
-dnl ---------------------------------------------
+dnl initialize arch_86 as it is later tested for != "no"
+arch_x86=no
case "$host_or_hostalias" in
- *-linux*)
- AC_CHECK_DXR3()
- if test "x$have_libfame" = "xyes" ; then
- AC_DEFINE_UNQUOTED(HAVE_LIBFAME,1,[Define this if you have libfame mpeg encoder installed (fame.sf.net)])
- AM_PATH_LIBFAME(0.8.10,
- AC_DEFINE(HAVE_NEW_LIBFAME,1,[Define this if you have libfame 0.8.10 or above]))
- fi
- if test "x$have_librte" = "xyes" ; then
- AC_DEFINE_UNQUOTED(HAVE_LIBRTE,1,[Define this if you have librte mpeg encoder installed (zapping.sf.net)])
- fi
- ;;
- *)
- have_dxr3="no"
- have_libfame="no"
- have_librte="no"
- have_encoder="no"
- ;;
-esac
-AM_CONDITIONAL(HAVE_DXR3, test "x$have_dxr3" = "xyes")
-AM_CONDITIONAL(HAVE_LIBFAME, test "x$have_libfame" = "xyes")
-AM_CONDITIONAL(HAVE_LIBRTE, test "x$have_librte" = "xyes")
-
-
-dnl ---------------------------------------------
-dnl Vidix/libdha
-dnl ---------------------------------------------
-
-AC_LINUX_PATH(/usr/src/linux)
-AC_SUBST([LINUX_INCLUDE])
-
-AC_ARG_ENABLE(vidix, AS_HELP_STRING([--disable-vidix], [do not build vidix support]),
- check_vidix=$enableval, check_vidix=yes)
-AC_ARG_ENABLE(dha-kmod, AS_HELP_STRING([--enable-dha-kmod], [build DHA kernel module]),
- enable_dha_kmod=$enableval,enable_dha_kmod=no)
-
-enable_vidix="no"
-
-AC_MSG_CHECKING(for vidix support)
-if test "x$check_vidix" = "xyes" -a "x$ac_cv_prog_AWK" != "xno"; then
- if test "x$no_x" != "xyes" -o "x$have_fb" = "xyes"; then
- case "$host_or_hostalias" in
- i?86-*-linux* | k?-*-linux* | athlon-*-linux*)
- enable_vidix="yes"
- enable_linux="yes"
- ;;
- i?86-*-freebsd* | k?-*-freebsd* | athlon-*-freebsd* | i?86-*-kfreebsd*)
- enable_vidix="yes"
- enable_dha_kmod="no"
+ alphaev56-*)
+ cpuflags="-mcpu=ev56 -mieee $cpuflags"
+ AC_DEFINE([ARCH_ALPHA], [], [Define this if you're running Alpha architecture])
;;
- *)
- enable_dha_kmod="no"
- enable_vidix="no"
+ alpha*)
+ cpuflags="-mieee $cpuflags"
+ AC_DEFINE([ARCH_ALPHA], [], [Define this if you're running Alpha architecture])
;;
- esac
- fi
-fi
-AC_MSG_RESULT($enable_vidix)
-
-AC_MSG_CHECKING(for DHA linux kernel module build)
-if test "x$enable_dha_kmod" = "xyes"; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
-fi
-
-AM_CONDITIONAL(HAVE_VIDIX, test "x$enable_vidix" = "xyes")
-AM_CONDITIONAL(HAVE_LINUX, test "x$enable_linux" = "xyes")
-AM_CONDITIONAL(BUILD_DHA_KMOD, test "x$enable_dha_kmod" = "xyes")
-AC_CHECK_PROG(MKNOD, mknod, mknod, no)
-AC_CHECK_PROG(DEPMOD, depmod, depmod, no, "$PATH:/sbin")
-
-
-dnl ---------------------------------------------
-dnl Ogg/Vorbis libs.
-dnl ---------------------------------------------
-
-AC_ARG_WITH([vorbis],
- AS_HELP_STRING([--without-vorbis], [Build without Vorbis audio decoder]))
-
-if test "x$with_vorbis" != "xno"; then
- PKG_CHECK_MODULES([VORBIS], [ogg vorbis], [have_vorbis=yes], [have_vorbis=no])
- if test "x$with_vorbis" = "xyes" && test "x$have_vorbis" = "xno"; then
- AC_MSG_ERROR([Vorbis support requested, but libvorbis not found])
- fi
-fi
-AM_CONDITIONAL([HAVE_VORBIS], [test "x$have_vorbis" = "xyes"])
-
-AC_SUBST([VORBIS_CFLAGS])
-AC_SUBST([VORBIS_LIBS])
-
-dnl ---------------------------------------------
-dnl Ogg/Theora libs.
-dnl ---------------------------------------------
-
-AC_ARG_WITH([theora],
- AS_HELP_STRING([--without-theora], [Build without Theora video decoder]))
-
-if test "x$with_theora" != "xno"; then
- PKG_CHECK_MODULES([THEORA], [ogg theora], [have_theora=yes], [have_theora=no])
- if test "x$with_theora" = "xyes" && test "x$have_theora" = "xno"; then
- AC_MSG_ERROR([Theora support requested, but libtheora not found])
- elif test "x$have_theora" = "xyes"; then
- AC_DEFINE([HAVE_THEORA], [1], [Define this if you have theora])
- fi
-fi
-AM_CONDITIONAL([HAVE_THEORA], [test "x$have_theora" = "xyes"])
-
-AC_SUBST([THEORA_CFLAGS])
-AC_SUBST([THEORA_LIBS])
-
-dnl ---------------------------------------------
-dnl Ogg/Speex libs.
-dnl ---------------------------------------------
-AC_ARG_WITH([speex],
- AS_HELP_STRING([--without-speex], [Build without Speex audio decoder]))
-
-if test "x$with_speex" != "xno"; then
- PKG_CHECK_MODULES([SPEEX], [ogg speex], [have_speex=yes], [have_speex=no])
- if test "x$with_speex" = "xyes" && test "x$have_speex" = "xno"; then
- AC_MSG_ERROR([Speex support requested, but libspeex not found])
- elif test "x$have_speex" = "xyes"; then
- AC_DEFINE([HAVE_SPEEX], [1], [Define this if you have speex])
- fi
-fi
-AM_CONDITIONAL([HAVE_SPEEX], [test "x$have_speex" = "xyes"])
-
-AC_SUBST([SPEEX_CFLAGS])
-AC_SUBST([SPEEX_LIBS])
-
-dnl ---------------------------------------------
-dnl check for libFLAC
-dnl ---------------------------------------------
-
-AC_ARG_WITH([libflac],
- AS_HELP_STRING([--without-libflac], [don't build libFLAC-based decoder and demuxer]))
-
-have_libflac="no"
-if test "x$with_libflac" != "xno"; then
- AM_PATH_LIBFLAC([have_libflac="yes"])
-fi
-
-AM_CONDITIONAL([HAVE_LIBFLAC], [test "x$have_libflac" = "xyes"])
-
-dnl ---------------------------------------------
-dnl External version of a52dec
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE(a52dec, AS_HELP_STRING([--disable-a52dec], [Disable support for a52dec decoding library (default: enabled)]),
- [enable_a52dec="$enableval"], [enable_a52dec="yes"])
-AC_ARG_WITH(external-a52dec, AS_HELP_STRING([--with-external-a52dec], [use external a52dec library (not recommended)]),
- [external_a52dec="$withval"], [external_a52dec="no"])
-
-have_a52="no"
-
-if test "x$enable_a52dec" = "xno"; then
- AC_MSG_RESULT([a52dec support disabled])
-elif test "x$external_a52dec" = "xyes"; then
- have_a52="yes"
- AC_CHECK_HEADERS([a52dec/a52.h],, have_a52="no",
-[
- #ifdef HAVE_SYS_TYPES_H
- # include <sys/types.h>
- #endif
- #ifdef HAVE_INTTYPES_H
- # include <inttypes.h>
- #endif
- #ifdef HAVE_STDINT_H
- # include <stdint.h>
- #endif
-
- #include <a52dec/a52.h>
-])
- SAVE_LIBS="$LIBS"
- AC_CHECK_LIB([a52], [a52_init],, have_a52="no", [-lm])
- LIBS="$SAVE_LIBS"
-
- if test "x$have_a52" = "xno"; then
- AC_MSG_RESULT([*** no usable version of a52dec found, using internal copy ***])
- fi
-else
- AC_MSG_RESULT([Use included a52dec support])
-fi
-
-AM_CONDITIONAL(A52, test "x$enable_a52dec" = "xyes")
-AM_CONDITIONAL(EXTERNAL_A52DEC, test "x$have_a52" = "xyes")
-
-dnl ---------------------------------------------
-dnl External version of libmad
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE(mad, AS_HELP_STRING([--disable-mad], [Disable support for MAD decoding library (default: enabled)]),
- [enable_libmad="$enableval"], [enable_libmad="yes"])
-AC_ARG_WITH(external-libmad, AS_HELP_STRING([--with-external-libmad], [use external libmad library (not recommended)]),
- [external_libmad="$withval"], [external_libmad="no"])
-
-have_mad="no"
-
-if test "x$enable_libmad" = "xno"; then
- AC_MSG_RESULT([libmad support disabled])
-elif test "x$external_libmad" = "xyes"; then
- PKG_CHECK_MODULES(LIBMAD, [mad], have_mad=yes, have_mad=no)
- AC_CHECK_HEADERS([mad.h])
- AC_SUBST(LIBMAD_LIBS)
- AC_SUBST(LIBMAD_CFLAGS)
- if test "x$have_mad" = "xno"; then
- AC_MSG_RESULT([*** no usable version of libmad found, using internal copy ***])
- fi
-else
- AC_MSG_RESULT([Use included libmad support])
-fi
-
-AM_CONDITIONAL(MAD, test "x$enable_libmad" = "xyes")
-AM_CONDITIONAL(EXTERNAL_LIBMAD, test "x$have_mad" = "xyes")
-
-dnl ---------------------------------------------
-dnl External libmpcdec support
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([musepack], AS_HELP_STRING([--disable-musepack], [Disable support for MusePack decoding (default: enabled)]))
-AC_ARG_WITH([external-libmpcdec], AS_HELP_STRING([--with-external-libmpcdec], [Use external libmpc library]))
-
-if test "x$enable_musepack" = "xno"; then
- AC_MSG_RESULT([musepack support disabled])
-elif test "x$with_external_libmpcdec" = "xyes"; then
- AC_CHECK_LIB([mpcdec], [mpc_demux_decode], [have_mpcdec=yes],
- [AC_CHECK_LIB([mpcdec], [mpc_decoder_decode], [have_mpcdec=yes])])
- AC_CHECK_HEADERS([mpc/mpcdec.h], [],
- [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [], [have_mpcdec=no])])
- if test "x$have_mpcdec" != "xyes"; then
- AC_MSG_ERROR([Unable to find mpcdec])
- fi
- AC_DEFINE([HAVE_LIBMPC], [1], [Define if external libmpc is used])
-else
- AC_MSG_RESULT([Use included libmusepack])
-fi
-
-AM_CONDITIONAL([MUSEPACK], [test "x$enable_musepack" != "xno"])
-AM_CONDITIONAL([EXTERNAL_MPCDEC], [test "x$have_mpcdec" = "xyes"])
-
-dnl ---------------------------------------------
-dnl MNG libs.
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([mng],
- AS_HELP_STRING([--disable-mng], [do not build mng support]),
- [with_mng=$enableval], [with_mng=yes])
-
-if test "x$with_mng" = "xyes"; then
- AC_CHECK_LIB(mng, mng_initialize,
- [ AC_CHECK_HEADER(libmng.h,
- [ have_libmng=yes
- MNG_LIBS="-lmng" ],
- AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))],
- AC_MSG_RESULT([*** All libmng dependent parts will be disabled ***]))
- AC_SUBST(MNG_LIBS)
-else
- have_libmng=no
-fi
-AM_CONDITIONAL(HAVE_LIBMNG, test "x$have_libmng" = "xyes")
-
-dnl ---------------------------------------------
-dnl MagickWand API of Imagemagick.
-dnl ---------------------------------------------
-
-AC_ARG_WITH([imagemagick],
- AS_HELP_STRING([--without-imagemagick], [Build without ImageMagick image decoder (or GraphicsMagick's compat layer)]))
-
-if test "x$with_imagemagick" != "xno"; then
- PKG_CHECK_MODULES([WAND], [Wand], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
- if test "x$have_imagemagick" = 'xno'; then
- PKG_CHECK_MODULES([MAGICKWAND], [MagickWand], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
- dnl Avoid $(WAND_FLAGS) $(MAGICKWAND_FLAGS) ...
- WAND_CFLAGS="$MAGICKWAND_CFLAGS"
- WAND_LIBS="$MAGICKWAND_LIBS"
- fi
- if test "x$have_imagemagick" = 'xno'; then
- PKG_CHECK_MODULES([GRAPHICSMAGICK], [ImageMagick], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
- PKG_CHECK_MODULES([GRAPHICSMAGICKWAND], [GraphicsMagickWand], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
- dnl The following assignments are safe, since they include
- dnl the flags for plain GraphicsMagick
- WAND_CFLAGS="$GRAPHICSMAGICKWAND_CFLAGS"
- WAND_LIBS="$GRAPHICSMAGICKWAND_LIBS"
- AC_DEFINE([HAVE_GRAPHICSMAGICK], [1], [Define this if you have GraphicsMagick installed])
- fi
- if test "x$with_imagemagick" = "xyes" && test "x$have_imagemagick" = "xno"; then
- AC_MSG_ERROR([ImageMagick support requested, but neither Wand, MagickWand, nor GraphicsMagick were found])
- elif test "x$have_imagemagick" = "xyes"; then
- AC_DEFINE([HAVE_WAND], [1], [Define this if you have ImageMagick or GraphicsMagick's compat layer installed])
- fi
-fi
-
-AM_CONDITIONAL([HAVE_WAND], [test "x$have_imagemagick" = "xyes"])
-AC_SUBST(WAND_CFLAGS)
-AC_SUBST(WAND_LIBS)
-
-dnl ---------------------------------------------
-dnl freetype2 lib.
-dnl ---------------------------------------------
-AC_ARG_WITH([freetype],
- AS_HELP_STRING([--with-freetype], [Build with FreeType2 library]))
-
-if test "x$with_freetype" = "xyes"; then
- PKG_CHECK_MODULES([FT2], [freetype2], [have_freetype=yes], [have_freetype=no])
- if test "x$have_freetype" = "xno"; then
- AC_MSG_ERROR([FreeType2 support requested but FreeType2 library not found])
- elif test "x$have_freetype" = "xyes"; then
- AC_DEFINE([HAVE_FT2], [1], [Define this if you have freetype2 library])
- fi
-fi
-AC_SUBST([FT2_CFLAGS])
-AC_SUBST([FT2_LIBS])
-dnl ---------------------------------------------
-dnl fontconfig
-dnl ---------------------------------------------
-AC_ARG_WITH([fontconfig],
- AS_HELP_STRING([--with-fontconfig], [Build with fontconfig library]))
-
-if test "x$with_fontconfig" = "xyes"; then
- if test "x$have_freetype" != "xyes"; then
- AC_MSG_ERROR([fontconfig support requested, but FreeType2 not enabled.])
- fi
-
- PKG_CHECK_MODULES([FONTCONFIG], [fontconfig], [have_fontconfig=yes], [have_fontconfig=no])
- if test "x$have_fontconfig" = "xno"; then
- AC_MSG_ERROR([fontconfig support requested but fontconfig library not found])
- elif test "x$have_fontconfig" = "xyes"; then
- AC_DEFINE([HAVE_FONTCONFIG], [1], [Define this if you have fontconfig library])
- fi
-fi
-AC_SUBST([FONTCONFIG_CFLAGS])
-AC_SUBST([FONTCONFIG_LIBS])
-
-
-dnl ---------------------------------------------
-dnl OSS style audio interface
-dnl ---------------------------------------------
-AC_ARG_ENABLE([oss],
- AS_HELP_STRING([--disable-oss], [Do not build OSS audio output support]))
-
-if test "x$enable_oss" != "xno"; then
- AC_CHECK_HEADERS([sys/soundcard.h machine/soundcard.h soundcard.h], [break])
- AC_CHECK_DECL([SNDCTL_DSP_SETFRAGMENT], [have_ossaudio=yes], [], [
- #ifdef HAVE_SYS_SOUNDCARD_H
- # include <sys/soundcard.h>
- #endif
- #ifdef HAVE_MACHINE_SOUNDCARD_H
- # include <sys/soundcard.h>
- #endif
- #ifdef HAVE_SOUNDCARD_H
- # include <soundcard.h>
- #endif
- ])
-
- if test "x$have_ossaudio" = "xyes"; then
- AC_IOCTL_REQUEST
- fi
-fi
-
-AM_CONDITIONAL(HAVE_OSS, test "x$have_ossaudio" = "xyes")
-
-
-dnl ---------------------------------------------
-dnl Alsa support
-dnl ---------------------------------------------
-
-AC_ARG_WITH([alsa],
- AS_HELP_STRING([--without-alsa], [Build without ALSA audio output]))
-
-if test "x$with_alsa" != "xno"; then
- PKG_CHECK_MODULES([ALSA], [alsa >= 0.9.0], [have_alsa=yes], [have_alsa=no])
- AC_SUBST([ALSA_LIBS])
- AC_SUBST([ALSA_CFLAGS])
- if test "x$have_alsa" = "xyes"; then
- AC_DEFINE([HAVE_ALSA], [1], [Define this if you have ALSA installed])
- elif test "x$with_alsa" = "xyes"; then
- AC_MSG_ERROR([ALSA support requested but not found.])
- fi
-fi
-
-AM_CONDITIONAL([HAVE_ALSA], [test "x$have_alsa" = "xyes"])
-
-dnl ---------------------------------------------
-dnl ESD support
-dnl ---------------------------------------------
-
-AC_ARG_WITH([esound],
- AS_HELP_STRING([--without-esound], [Build without ESounD audio output]))
-
-if test "x$with_esound" != "xno"; then
- PKG_CHECK_MODULES([ESD], [esound], [have_esound=yes], [have_esound=no])
- if test "x$with_esound" = "xyes" && test "x$have_esound" = "xno"; then
- AC_MSG_ERROR([ESounD support requested, but libesd not found])
- elif test "x$have_esound" = "xyes"; then
- AC_DEFINE([HAVE_ESD], [1], [Define this if you have ESounD installed])
- fi
-fi
-
-AM_CONDITIONAL([HAVE_ESD], [test "x$have_esound" = "xyes"])
-
-AC_SUBST([ESD_CFLAGS])
-AC_SUBST([ESD_LIBS])
-
-
-dnl ---------------------------------------------
-dnl ARTS support
-dnl ---------------------------------------------
-
-AC_ARG_WITH([arts],
- AS_HELP_STRING([--with-arts], [Build with ARTS audio output]),
- [with_arts=$withval], [with_arts=no])
-
-if test "x$with_arts" = "xyes"; then
- AM_PATH_ARTS(0.9.5,
- AC_DEFINE(HAVE_ARTS,1,[Define this if you have ARTS (libartsc) installed]),
- AC_MSG_RESULT(*** All of ARTS dependent parts will be disabled ***))
-else
- no_arts=yes
-fi
-AM_CONDITIONAL(HAVE_ARTS, test "x$no_arts" != "xyes")
-
-
-dnl ---------------------------------------------
-dnl FusionSound support
-dnl ---------------------------------------------
-
-AC_ARG_WITH([fusionsound],
- AS_HELP_STRING([--with-fusionsound], [Build with FunsionSound audio output]),
- [with_fusionsound=$withval], [with_fusionsound=no])
-
-if test "x$with_fusionsound" = "xyes"; then
- PKG_CHECK_MODULES(FUSIONSOUND, fusionsound >= 0.9.23,
- AC_DEFINE(HAVE_FUSIONSOUND,1,[Define to 1 if you have FusionSound.]),
- AC_MSG_RESULT(*** All of FusionSound dependent parts will be disabled ***))
- AC_SUBST(FUSIONSOUND_CFLAGS)
- AC_SUBST(FUSIONSOUND_LIBS)
-else
- no_fusionsound=yes
-fi
-AM_CONDITIONAL(HAVE_FUSIONSOUND, test "x$no_fusionsound" != "xyes")
-
-
-dnl ---------------------------------------------
-dnl JACK support
-dnl ---------------------------------------------
-
-AC_ARG_WITH([jack],
- AS_HELP_STRING([--without-jack], [Build without Jack support]))
-
-if test "x$with_jack" != "xno"; then
- PKG_CHECK_MODULES([JACK], [jack >= 0.100], [have_jack=yes], [have_jack=no])
-
- if test "x$with_jack" = "xyes" && test "x$have_jack" = "xno"; then
- AC_MSG_ERROR([Jack support requested, but Jack not found])
- fi
-fi
-
-AM_CONDITIONAL([HAVE_JACK], [test "x$have_jack" = "xyes"])
-
-
-dnl ---------------------------------------------
-dnl sndio support
-dnl ---------------------------------------------
-
-AC_ARG_WITH([sndio],
- AS_HELP_STRING([--without-sndio], [Build without sndio support]))
-
-if test "x$with_sndio" != "xno"; then
- AC_CHECK_LIB(sndio, sio_open, [SNDIO_LIBS=-lsndio; have_sndio=yes],
- [have_sndio=no])
-
- if test "x$with_sndio" = "xyes" && test "x$have_sndio" = "xno"; then
- AC_MSG_ERROR([sndio support requested, but sndio not found])
- fi
-fi
-
-AM_CONDITIONAL([HAVE_SNDIO], [test "x$have_sndio" = "xyes"])
-
-AC_SUBST([SNDIO_CFLAGS])
-AC_SUBST([SNDIO_LIBS])
-
-
-dnl ---------------------------------------------
-dnl gnome-vfs support
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([gnomevfs],
- AS_HELP_STRING([--disable-gnomevfs], [do not build gnome-vfs support]),
- [with_gnome_vfs=$enableval], [with_gnome_vfs=yes])
-
-if test "x$with_gnome_vfs" = "xyes"; then
- PKG_CHECK_MODULES(GNOME_VFS, gnome-vfs-2.0,
- no_gnome_vfs=no,
- no_gnome_vfs=yes)
- AC_SUBST(GNOME_VFS_CFLAGS)
- AC_SUBST(GNOME_VFS_LIBS)
- if test "x$no_gnome_vfs" != "xyes"; then
- AC_DEFINE(HAVE_GNOME_VFS,1,[Define this if you have gnome-vfs installed])
- else
- AC_MSG_RESULT(*** All of the gnome-vfs dependent parts will be disabled ***)
- fi
-else
- no_gnome_vfs=yes
-fi
-AM_CONDITIONAL(HAVE_GNOME_VFS, test "x$no_gnome_vfs" != "xyes")
-
-dnl ---------------------------------------------
-dnl gdk-pixbuf support
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([gdkpixbuf],
- AS_HELP_STRING([--disable-gdkpixbuf], [do not build gdk-pixbuf support]))
-
-if test "x$enable_gdkpixbuf" != "xno"; then
- PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0,
- no_gdkpixbuf=no,
- no_gdkpixbuf=yes)
- AC_SUBST(GDK_PIXBUF_CFLAGS)
- AC_SUBST(GDK_PIXBUF_LIBS)
- if test "x$no_gdkpixbuf" != "xyes"; then
- AC_DEFINE(HAVE_GDK_PIXBUF,1,[Define this if you have gdk-pixbuf installed])
- else
- AC_MSG_RESULT(*** All of the gdk-pixbuf dependent parts will be disabled ***)
- fi
-else
- no_gdkpixbuf=yes
-fi
-AM_CONDITIONAL(HAVE_GDK_PIXBUF, test "x$no_gdkpixbuf" != "xyes")
-
-dnl ---------------------------------------------
-dnl libbluray support
-dnl ---------------------------------------------
-AC_ARG_ENABLE([bluray],
- AS_HELP_STRING([--disable-bluray], [Do not build BluRay support]),
- [with_bluray=$enableval], [with_bluray=yes])
-
-if test "x$with_bluray" != "xno"; then
- PKG_CHECK_MODULES([LIBBLURAY], [libbluray >= 0.2.1],
- [have_libbluray=yes],
- AC_MSG_RESULT(*** All of the libbluray dependent parts will be disabled ***))
- AC_SUBST(LIBBLURAY_CFLAGS)
- AC_SUBST(LIBBLURAY_LIBS)
-fi
-AM_CONDITIONAL(HAVE_LIBBLURAY, test "x$have_libbluray" = "xyes")
-
-dnl ---------------------------------------------
-dnl libsmbclient support
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([samba],
- AS_HELP_STRING([--disable-samba], [do not build Samba support]),
- [with_samba=$enableval], [with_samba=yes])
-
-if test "x$with_samba" = "xyes"; then
- AC_CHECK_LIB(smbclient, smbc_init,
- [ AC_CHECK_HEADER(libsmbclient.h,
- [ have_libsmbclient=yes
- LIBSMBCLIENT_LIBS="-lsmbclient" ],
- AC_MSG_RESULT([*** All libsmbclient dependent parts will be disabled ***]))],
- AC_MSG_RESULT([*** All libsmbclient dependent parts will be disabled ***]))
- AC_SUBST(LIBSMBCLIENT_LIBS)
-fi
-AM_CONDITIONAL(HAVE_LIBSMBCLIENT, test "x$have_libsmbclient" = "xyes")
-
-
-dnl ---------------------------------------------
-dnl SUN style audio interface
-dnl ---------------------------------------------
-AC_ARG_ENABLE([sunaudio],
- AS_HELP_STRING([--disable-sunaudio], [Do not build Sun audio output support]))
-
-if test "x$enable_sunaudio" != "xno"; then
- AC_MSG_CHECKING(for Sun audio support)
- have_sunaudio=no
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
- #include <sys/types.h>
- #include <sys/audioio.h>
- ]], [[
- audio_info_t audio_info;
- AUDIO_INITINFO(&audio_info);
- ]])],[
- have_sunaudio=yes
- ],[])
- AC_MSG_RESULT($have_sunaudio)
- AM_CONDITIONAL(HAVE_SUNAUDIO, test "x$have_sunaudio" = "xyes")
-
- if test "x$have_sunaudio" = "xyes"; then
- dnl NetBSD and OpenBSD don't have this, but check for it
- dnl rather than assuming that it doesn't happen elsewhere.
- AC_CHECK_MEMBERS([audio_info_t.output_muted])
- fi
-fi
-
-AM_CONDITIONAL(HAVE_SUNAUDIO, test "x$have_sunaudio" = "xyes")
-
-
-dnl ---------------------------------------------
-dnl IRIX style audio interface
-dnl ---------------------------------------------
-
-AM_CHECK_IRIXAL([AC_DEFINE(HAVE_IRIXAL,1,
- [Define this if you have a usable IRIX al interface available])],
- [AC_MSG_RESULT([*** All of IRIX AL dependent parts will be disabled ***])])
-AM_CONDITIONAL(HAVE_IRIXAL, [test "x$am_cv_have_irixal" = xyes])
-
-
-dnl ---------------------------------------------
-dnl Solaris kstat kernel statistics
-dnl ---------------------------------------------
-
-AC_CHECK_LIB(kstat, kstat_open,
- [KSTAT_LIBS=-lkstat
- AC_DEFINE(HAVE_KSTAT,1,[Define this if you have kernel statistics available via kstat interface])])
-AC_SUBST(KSTAT_LIBS)
-
-
-dnl ---------------------------------------------
-dnl cdrom ioctls
-dnl ---------------------------------------------
-
-AC_CHECK_HEADERS([linux/cdrom.h sys/dvdio.h], [break])
-AC_CHECK_HEADERS([sys/cdio.h sys/scsiio.h])
-AM_CHECK_CDROM_IOCTLS(
- [AC_DEFINE(HAVE_CDROM_IOCTLS,1,[Define this if you have CDROM ioctls])],
- [AC_MSG_RESULT([*** (S)VCD support will be disabled ***])])
-AM_CONDITIONAL(HAVE_CDROM_IOCTLS, [test "x$have_cdrom_ioctls" = "xyes"])
-
-
-dnl ---------------------------------------------
-dnl check for a usable version of libdvdnav
-dnl ---------------------------------------------
-
-AC_ARG_WITH(external-dvdnav, AS_HELP_STRING([--with-external-dvdnav], [use external dvdnav library (not recommended)]),
- [external_dvdnav="$withval"], [no_dvdnav="yes"; external_dvdnav="no"])
-
-if test "x$external_dvdnav" = "xyes"; then
- AM_PATH_DVDNAV(0.1.9,
- AC_DEFINE(HAVE_DVDNAV,1,[Define this if you have a suitable version of libdvdnav]),
- [AC_MSG_RESULT([*** no usable version of libdvdnav found, using internal copy ***])])
- AC_CHECK_LIB(dvdread, navRead_DSI, DVDNAV_LIBS="$DVDNAV_LIBS -ldvdread",)
-else
- AC_MSG_RESULT([Use included DVDNAV support])
-fi
+ armv4l-*-linux*)
+ cpuflags="-mcpu=strongarm1100 -ffast-math -fsigned-char $cpuflags"
+ DEFAULT_OCFLAGS='$(O2_CFLAGS)'
+ AC_DEFINE([ARCH_ARM], [], [Define this if you're running ARM architecture])
+ ;;
-AM_CONDITIONAL(HAVE_DVDNAV, [test "x$no_dvdnav" != "xyes"])
+ sparc*-*-linux*)
+ case "`uname -m`" in
+ sparc) cpuflags="-mcpu=supersparc -mtune=supersparc" ;;
+ sparc64) cpuflags="-mcpu=ultrasparc -mtune=ultrasparc" ;;
+ esac
+ test x"$enable_vis" != x"no" && has_vis=yes
+ AC_DEFINE([ARCH_SPARC], [], [Define this if you're running SPARC architecture])
+ ;;
+ sparc-*-solaris*)
+ if test x"$GCC" = x"yes"; then
+ case "`uname -m`" in
+ sun4c) cpuflags="-mcpu=v7 -mtune=supersparc" ;;
+ sun4m) cpuflags="-mcpu=v8 -mtune=supersparc" ;;
+ sun4u)
+ if test x"$GCC_VERSION_MAJOR" -lt 3; then
+ # -mcpu=ultrasparc triggers a GCC 2.95.x compiler bug
+ # when compiling video_out.c:
+ # gcc: Internal compiler error: program cc1 got fatal signal 11
+ # avoid -mcpu=ultrasparc with gcc 2.*
+ cpuflags="-mcpu=v8 -mtune=ultrasparc"
+ else
+ cpuflags="-mcpu=ultrasparc -mtune=ultrasparc"
+ fi
+ ;;
+ esac
+ if test "$GCC_VERSION_MAJOR" -ge 3; then
+ test x"$enable_vis" != x"no" && has_vis=yes
+ fi
+ else
+ case "`uname -m`" in
+ sun4c) cpuflags="-xarch=v7" ;;
+ sun4m) cpuflags="-xarch=v8" ;;
+ sun4u) cpuflags="-xarch=v8plusa" ;;
+ esac
+ O1_CFLAGS="-fast -xCC"
+ O2_CFLAGS="$O1_CFLAGS"
+ O3_CFLAGS="$O1_CFLAGS"
+ fi
+ AC_DEFINE([ARCH_SPARC], [], [Define this if you're running SPARC architecture])
+ ;;
-dnl ---------------------------------------------
-dnl Video CD
-dnl ---------------------------------------------
+ x86_64-*)
+ arch_x86=64
+ AC_DEFINE([ARCH_X86_64], [], [Define this if you're running x86 architecture 64 bits])
+ ;;
-AC_ARG_ENABLE(vcd, AS_HELP_STRING([--disable-vcd], [do not compile VCD plugin]),
- enable_vcd=$enableval, enable_vcd=yes)
+ *-*-darwin*)
+ case "$host_or_hostalias" in
+ universal-*)
+ arch_ppc=yes
+ arch_x86=32
+ ;;
+ i386-* | x86_64-*)
+ arch_x86=32
+ AC_DEFINE([ARCH_X86_32], [], [Define this if you're running x86 architecture 32 bits])
+ ;;
+ ppc* | powerpc*)
+ arch_ppc=yes
+ dnl avoid ppc compilation crash
+ AS="$CC"
+ AC_DEFINE([ARCH_PPC], [], [Define this if you're running PowerPC architecture])
+
+ AC_CHECK_HEADER([altivec.h], [], [enable_altivec=no])
+ if test x"$enable_altivec" != x"no"; then
+ AC_DEFINE([ENABLE_ALTIVEC], [], [Define this if you want to use altivec on PowerPC CPUs])
+ cpuflags="$cpuflags -faltivec -maltivec"
+ LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -force_cpusubtype_ALL"
+ fi
+ ;;
+ esac
+
+ enable_impure_text=yes
+ HOST_OS_DARWIN=1
+ dnl HOST_OS_DARWIN is used by a bunch of difference stuff, including
+ dnl libdvdnav, libmpeg2, and xine itself (xine-engine, xine-utils)
+ AC_DEFINE([HOST_OS_DARWIN], 1, [Define this if built on Mac OS X/Darwin])
+ dnl CONFIG_DARWIN is used by ffmpeg, so anything that pulls ffmpeg
+ dnl headers needs to have this set.
+ AC_DEFINE([CONFIG_DARWIN], 1, [Define this if built on Mac OS X/Darwin])
+ CPPFLAGS="-D_INTL_REDIRECT_MACROS $CPPFLAGS"
+ ;;
-dnl Force build of both vcd plugins, for now.
-dnl AC_ARG_ENABLE(vcdo, AS_HELP_STRING([--disable-vcdo], [do not compile old VCD plugin]),
-dnl enable_vcdo=$enableval, enable_vcdo=yes)
-dnl
-enable_vcdo="yes"
-
-AC_ARG_WITH(internal-vcdlibs, AS_HELP_STRING([--with-internal-vcdlibs], [force using internal libcdio/libvcd/libvcdinfo]),
- [internal_vcdnav="$withval"], [internal_vcdnav="no"])
-
-if test "x$enable_vcd" = "xyes"; then
- dnl empty_array_size
- AC_MSG_CHECKING([how to create empty arrays])
-
- empty_array_size="xxx"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[]; } doo;]])],[empty_array_size=""],[])
-
- if test "x$empty_array_size" = "xxxx";then
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[struct { int foo; int bar[0]; } doo;]])],[empty_array_size="0"],[])
- fi
-
- if test "x$empty_array_size" = "xxxx"
- then
- AC_MSG_ERROR([compiler is unable to creaty empty arrays])
- else
- AC_DEFINE_UNQUOTED(EMPTY_ARRAY_SIZE, $empty_array_size,
- [what to put between the brackets for empty arrays])
- changequote(`,')
- msg="[${empty_array_size}]"
- changequote([,])
- AC_MSG_RESULT($msg)
- fi
- dnl empty_array_size
-
- if test "x$internal_vcdnav" = "xno" ; then
- PKG_CHECK_MODULES([LIBCDIO], [libcdio >= 0.71], [], [internal_vcdnav=yes])
- PKG_CHECK_MODULES([LIBVCDINFO], [libvcdinfo >= 0.7.23], [], [internal_vcdnav=yes])
- if test "x$internal_vcdnav" = "xyes"; then
- AC_MSG_RESULT([Use included libcdio/libvcdinfo support])
- fi
- fi
-
- dnl check twice, fallback is internal copy
- if test "x$internal_vcdnav" = "xno"; then
- AC_DEFINE([HAVE_VCDNAV], [1], [Define this if you use external libcdio/libvcdinfo])
- else
- AC_DEFINE_UNQUOTED(HOST_ARCH, "$host_os/$host_cpu", [host os/cpu identifier])
-
- AC_DEFINE(_DEVELOPMENT_, [], enable warnings about being development release)
- AC_HEADER_STDC
- AC_CHECK_HEADERS(sys/stat.h stdint.h glob.h inttypes.h stdbool.h)
-
- if test "x$ac_cv_header_stdint_h" != "xyes"
- then
- AC_CHECK_SIZEOF(int, 4)
- AC_CHECK_SIZEOF(long, 4)
- AC_CHECK_SIZEOF(long long, 8)
- fi
+ ppc-*-linux* | powerpc-*)
+ arch_ppc=yes
- dnl ISOC99_PRAGMA
- AC_MSG_CHECKING([whether $CC supports ISOC99 _Pragma()])
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[_Pragma("pack(1)")]])],[
- ISOC99_PRAGMA=yes
- AC_DEFINE(HAVE_ISOC99_PRAGMA, [], [Supports ISO _Pragma() macro])
- ],[ISOC99_PRAGMA=no])
- AC_MSG_RESULT($ISOC99_PRAGMA)
-
- dnl
- dnl bitfield order
- dnl
- AC_MSG_CHECKING([bitfield ordering in structs])
-
- dnl basic compile test for all platforms
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-int main() {
- struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
- __attribute__((packed))
-#endif
- bf = { 1,1,1,1 };
- switch (0) case 0: case sizeof(bf) == 1:;
- return 0;
-}
-])], [], AC_MSG_ERROR([compiler doesn't support bitfield structs]))
+ dnl avoid ppc compilation crash
+ AS="$CC"
+ AC_DEFINE([ARCH_PPC], [], [Define this if you're running PowerPC architecture])
+ AC_CHECK_HEADER([altivec.h], [], [enable_altivec=no])
+ if test x"$enable_altivec" != x"no"; then
+ AC_DEFINE([ENABLE_ALTIVEC], [], [Define this if you want to use altivec on PowerPC CPUs])
+ cpuflags="$cpuflags -maltivec"
+ fi
+ ;;
- dnl run test
- AC_RUN_IFELSE([AC_LANG_SOURCE([
-int main() {
- struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
- __attribute__((packed))
-#endif
- bf = { 1,1,1,1 };
- if (sizeof (bf) != 1) return 1;
- return *((unsigned char*) &bf) != 0x4b; }
-])], bf_lsbf=1, [
- AC_RUN_IFELSE([AC_LANG_SOURCE([
-int main() {
- struct { char bit_0:1, bit_12:2, bit_345:3, bit_67:2; }
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
- __attribute__((packed))
-#endif
- bf = { 1,1,1,1 };
- if (sizeof (bf) != 1) return 1;
- return *((unsigned char*) &bf) != 0xa5; }
-])], bf_lsbf=0, AC_MSG_ERROR([unsupported bitfield ordering]))
- ],
- [case "$host" in
- *-*-mingw32* | *-*-cygwin*)
- bf_lsbf=1
- ;;
- *)
- AC_MSG_RESULT([unknown])
- AC_MSG_ERROR([value of bitfield test isn't known for $host
-*********************************************************************
-Value of bitfield test can't be found out for cross-compiling and we
-don't know its value for host "$host".
-
-Because it's needed for VCD plugin, disable VCD by configure option
---disable-vcd or use external VCD library.
-*********************************************************************])
- esac]
-)
-
- if test "x$cross_compiling" = "xyes"; then
- TEXT=" (guessed)"
- else
- TEXT=""
- fi
- if test "x$bf_lsbf" = "x1"; then
- AC_MSG_RESULT(LSBF${TEXT})
- AC_DEFINE(BITFIELD_LSBF, [], [compiler does lsbf in struct bitfields])
- else
- AC_MSG_RESULT(MSBF${TEXT})
- fi
+ i?86-* | k?-* | athlon-* | pentium*)
+ arch_x86=32
+ enable_impure_text=yes
+
+ case "$host_or_hostalias" in
+ *-*-cygwin* | *-*-mingw32*)
+ CC_CHECK_CFLAGS([-fno-omit-frame-pointer], [W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-omit-frame-pointer"])
+ CC_CHECK_CFLAGS([-fno-inline-functions], [W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-inline-functions"])
+ CC_CHECK_CFLAGS([-fno-rename-registers], [W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-rename-registers"])
+ AC_SUBST(W32_NO_OPTIMIZE)
+ case "$host_or_hostalias" in
+ *-*-cygwin*) LIBS="$LIBS @INTLLIBS@ -lkernel32" ;;
+ esac
+ ;;
+ esac
+
+ AC_DEFINE([ARCH_X86_32], [], [Define this if you're running x86 architecture 32 bits])
+
+ if test x"$GCC" = x"yes" -o x"${CC##*/}" = x"icc"; then
+ if test x"$GCC" = x"yes"; then
+ # GCC optimizations
+ CC_CHECK_CFLAGS([-mtune=i386], [sarchopt="-mtune"],
+ [CC_CHECK_CFLAGS([-mcpu=i386], [sarchopt="-mcpu"],
+ [CC_CHECK_CFLAGS([-march=i386], [sarchopt="-march"], [sarchopt="no"])])])
+ if test "$sarchopt" != "no"; then
+ case "$host_or_hostalias" in
+ i386-*) archopt_val="i386" ;;
+ i486-*) archopt_val="i486" ;;
+ i586-*) archopt_val="pentium" ;;
+ pentium-mmx-*) archopt_val="pentium-mmx" ;;
+ k6-2* | k6-3-*) archopt_val="k6-2" ;;
+ k6-*) archopt_val="k6" ;;
+ pentium3-*) archopt_val="pentium3" ;;
+ pentium4-*) archopt_val="pentium4" ;;
+
+ athlon-4-* | athlon-xp-* | althon-mp-*) archopt_val="athlon-4" ;;
+ k7-* | athlon-tbird-* | athlon-*) archopt_val="athlon" ;;
+
+ pentiumpro-* | pentium2-* | i686-*)
+ archopt_val="pentiumpro"
+ if test x"$cross_compiling" != x"yes"; then
+ if test -f /proc/cpuinfo; then
+ modelname=`cat /proc/cpuinfo | grep "model\ name\ :" | sed -e 's/ //g' | cut -d ':' -f2`
+ case "$modelname" in
+ *Athlon* | *Duron* | *K7*)
+ dnl Special check for k7 cpu CC support
+ CC_CHECK_CFLAGS([$sarchopt=athlon],
+ [archopt_val="athlon"], [archopt_val="i686"])
+ ;;
+ VIAEzra)
+ archopt_val="c3"
+ ;;
+ esac
+ fi
+ fi
+ ;;
+ esac
+ test x"$archopt_val" != x"" && cpuflags="$cpuflags $sarchopt=$archopt_val"
+ fi
+ else
+ # Intel optimizations
+ O3_CFLAGS="$O3_CFLAGS -unroll -ipo -ipo_obj"
+ fi
+ fi
+ ;;
+esac
- AC_CHECK_HEADERS([errno.h fcntl.h \
- stdbool.h stdlib.h stdint.h stdio.h string.h \
- strings.h linux/version.h sys/cdio.h sys/stat.h \
- sys/types.h ])
-
- LIBCDIO_CFLAGS='-I$(top_srcdir)/src/input/vcd/libcdio'
- LIBCDIO_LIBS='$(top_builddir)/src/input/vcd/libcdio/libcdio.la'
- LIBISO9660_LIBS='$(top_builddir)/src/input/vcd/libcdio/libiso9660.la'
- LIBVCD_CFLAGS='-I$(top_srcdir)/src/input/vcd/libvcd'
- LIBVCD_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcd.la'
- LIBVCDINFO_LIBS='$(top_builddir)/src/input/vcd/libvcd/libvcdinfo.la'
-
- case $host_os in
- darwin*)
- AC_CHECK_HEADERS(IOKit/IOKitLib.h CoreFoundation/CFBase.h,
- [have_iokit_h="yes"])
- if test "x$have_iokit_h" = "xyes" ; then
- AC_DEFINE([HAVE_DARWIN_CDROM], [1],
- [Define 1 if you have Darwin OS X-type CD-ROM support])
- fi
- ;;
- linux*)
- AC_CHECK_HEADERS(linux/version.h)
- AC_CHECK_HEADERS(linux/cdrom.h, [have_linux_cdrom_h="yes"])
- if test "x$have_linux_cdrom_h" = "xyes" ; then
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
-#include <linux/cdrom.h>
-struct cdrom_generic_command test;
-int has_timeout=sizeof(test.timeout);]])],
- [AC_DEFINE([HAVE_LINUX_CDROM_TIMEOUT], [1],
- [Define 1 if timeout is in cdrom_generic_command struct])],[])
- AC_DEFINE([HAVE_LINUX_CDROM], [1],
- [Define 1 if you have Linux-type CD-ROM support])
- fi
- ;;
- bsdi*)
- AC_CHECK_HEADERS(dvd.h, [have_bsdi_dvd_h="yes"])
- if test "x$have_bsdi_dvd_h" = "xyes" ; then
- AC_DEFINE([HAVE_BSDI_CDROM], [1],
- [Define 1 if you have BSDI-type CD-ROM support])
- fi
- ;;
- sunos*|sun*|solaris*)
- AC_CHECK_HEADERS(sys/cdio.h)
- AC_DEFINE([HAVE_SOLARIS_CDROM], [1],
- [Define 1 if you have Solaris CD-ROM support])
- ;;
- cygwin*)
- AC_DEFINE([CYGWIN], [1],
- [Define 1 if you are compiling using cygwin])
- AC_DEFINE([HAVE_WIN32_CDROM], [1],
- [Define 1 if you have MinGW CD-ROM support])
- LIBCDIO_LIBS="$LIBCDIO_LIBS -lwinmm"
- LIBVCD_LIBS="$LIBVCD_LIBS -lwinmm"
- ;;
- mingw*)
- AC_DEFINE([MINGW32], [1],
- [Define 1 if you are compiling using MinGW])
- AC_DEFINE([HAVE_WIN32_CDROM], [1],
- [Define 1 if you have MinGW CD-ROM support])
- ;;
- freebsd4.*|kfreebsd*-gnu)
- AC_DEFINE([HAVE_FREEBSD_CDROM], [1],
- [Define 1 if you have FreeBSD CD-ROM support])
- ;;
- *)
- AC_MSG_WARN(Don't have OS CD-reading support for ${host_os}...)
- AC_MSG_WARN(Will use generic support.)
- ;;
+AC_ARG_ENABLE([vis],
+ [AS_HELP_STRING([--disable-vis], [do not use assembly codes for Sun UltraSPARC CPUs])],
+ [], [enable_vis="yes"])
+if test "x$has_vis" = "xyes"; then
+ AC_DEFINE([ENABLE_VIS], [], [Define this if you have Sun UltraSPARC CPU])
+ case "$cpuflags" in
+ *-mcpu=*) ;;
+ *) cpuflags="$cpuflags -mcpu=v9" ;;
esac
- AC_SUBST(LINUX_CDROM_TIMEOUT)
- AC_SUBST(HAVE_BSDI_CDROM)
- AC_SUBST(HAVE_DARWIN_CDROM)
- AC_SUBST(HAVE_FREEBSD_CDROM)
- AC_SUBST(HAVE_LINUX_CDROM)
- AC_SUBST(HAVE_SOLARIS_CDROM)
- AC_SUBST(HAVE_WIN32_CDROM)
- AC_SUBST(LINUX_CDROM_TIMEOUT)
- AC_SUBST(LIBVCD_SYSDEP)
-
- AC_CHECK_FUNCS( bzero memcpy )
-
- AC_CHECK_MEMBER([struct tm.tm_gmtoff],
- [AC_DEFINE(HAVE_TM_GMTOFF, 1,
- [Define if struct tm has the tm_gmtoff member.])],
- ,
- [#include <time.h>])
- fi
fi
-
-AC_DEFINE([LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration])
-AC_DEFINE([EXTERNAL_LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration])
-AC_SUBST(LIBCDIO_CFLAGS)
-AC_SUBST(LIBCDIO_LIBS)
-AC_SUBST(LIBISO9660_LIBS)
-AC_SUBST(LIBVCD_CFLAGS)
-AC_SUBST(LIBVCD_LIBS)
-AC_SUBST(LIBVCDINFO_LIBS)
-AM_CONDITIONAL(HAVE_VCDNAV, [test "x$internal_vcdnav" = "xno"])
-AM_CONDITIONAL(ENABLE_VCD, [test "x$enable_vcd" = "xyes"])
-
-
-dnl ---------------------------------------------
-dnl ASF build can be optional
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([asf], AS_HELP_STRING([--disable-asf], [do not build ASF demuxer]))
-AM_CONDITIONAL(BUILD_ASF, test "x$enable_asf" != "xno")
-
-
-dnl ---------------------------------------------
-dnl Nosefart build can be optional
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([nosefart], AS_HELP_STRING([--disable-nosefart], [do not build nosefart player]))
-if test "x$enable_nosefart" != "xno"; then
- AC_DEFINE([HAVE_NOSEFART], 1, [Define this if Nosefart is being built.])
-fi
-AM_CONDITIONAL(BUILD_NOSEFART, test "x$enable_nosefart" != "xno")
-
-dnl ---------------------------------------------
-dnl FAAD build can be optional
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([faad], AS_HELP_STRING([--disable-faad], [do not build FAAD decoder]))
-AC_ARG_WITH(external-libfaad, AS_HELP_STRING([--with-external-libfaad], [use external libfaad (recommended)]),
- [external_libfaad="$withval"], [external_libfaad="yes"])
-
-have_faad=no
-if test "x$enable_faad" = "xno"; then
- AC_MSG_RESULT([faad support disabled])
-elif test "x$with_external_libfaad" != "xno"; then
- AC_CHECK_LIB([faad], [NeAACDecInit], [have_faad=yes])
- if test "x$have_faad" = xyes; then
- AC_CHECK_HEADERS([faad.h], , [have_faad=no])
- if test "x$have_faad" != "xyes"; then
- AC_MSG_ERROR([Unable to find libfaad])
- fi
- AC_DEFINE([EXTERNAL_LIBFAAD], [1], [Define if external libfaad is used])
- fi
+AM_CONDITIONAL([ENABLE_VIS], test x"$has_vis" = x"yes")
+
+O1_CFLAGS="$O1_CFLAGS $optflags $cpuflags"
+O2_CFLAGS="$O2_CFLAGS $optflags $cpuflags"
+O3_CFLAGS="$O3_CFLAGS $optflags $cpuflags"
+
+dnl Allow turning off/on of optimizations. By default, optimizations are
+dnl enabled if --enable-debug is not specified. Even with --enable-debug,
+dnl optimizations can be enabled by explicitly specifying --enable-optimizations
+AC_ARG_ENABLE([optimizations],
+ [AS_HELP_STRING([--disable-optimizations], [Don't try to guess what optimization to enable])],
+ [], [test x"$enable_debug" != x"no" && enable_optimizations="no"])
+AM_CONDITIONAL([DISABLE_OPTIMIZATIONS], [test x"$enable_optimizations" = x"no"])
+if test x"$enable_optimizations" = x"no"; then
+ DEFAULT_OCFLAGS='$(O0_CFLAGS)'
else
- AC_MSG_RESULT([Use included libfaad])
+ dnl For multi-pass compilation: never when cross-compiling
+ if test x"$cross_compiling" != x"yes"; then
+ if test x"$GCC" = x"yes"; then
+ CC_CHECK_CFLAGS([-fprofile-arcs], [CC_CHECK_CFLAGS([-fbranch-probabilities],
+ [PASS1_CFLAGS="-fprofile-arcs $PASS1_CFLAGS"
+ PASS2_CFLAGS="-fbranch-probabilities $PASS2_CFLAGS"])])
+ else
+ pass1flags="-prof_dir \$(PWD)/\$(top_builddir)/ -prof_genx"
+ pass2flags="-prof_dir \$(PWD)/\$(top_builddir)/ -prof_use"
+ CC_CHECK_CFLAGS(["$pass1flags"], [CC_CHECK_CFLAGS(["$pass2flags"],
+ [PASS1_CFLAGS="$pass1flags $PASS1_CFLAGS"
+ PASS2_CFLAGS="$pass2flags $PASS2_CFLAGS"])])
+ fi
+ fi
fi
+AC_SUBST(O0_CFLAGS)
+AC_SUBST(O1_CFLAGS)
+AC_SUBST(O2_CFLAGS)
+AC_SUBST(O3_CFLAGS)
-AM_CONDITIONAL(BUILD_FAAD, test "x$enable_faad" != "xno")
-AM_CONDITIONAL(EXTERNAL_LIBFAAD, test "x$have_faad" = "xyes")
-
-dnl ---------------------------------------------
-dnl Optional and external libdts
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE(dts, AS_HELP_STRING([--disable-dts], [Disable support for DTS decoding library (default: enabled)]),
- [enable_libdts="$enableval"], [enable_libdts="yes"])
-AC_ARG_WITH(external-libdts, AS_HELP_STRING([--with-external-libdts], [use external libdts library (not recommended)]),
- [external_libdts="$withval"], [external_libdts="no"])
-
-have_dts="no"
-
-if test "x$enable_libdts" = "xno"; then
- AC_MSG_RESULT([libdts support disabled])
-elif test "x$external_libdts" = "xyes"; then
- PKG_CHECK_MODULES(LIBDTS, [libdts], have_dts=yes, have_dts=no)
- AC_CHECK_HEADERS([dts.h])
- AC_SUBST(LIBDTS_LIBS)
- AC_SUBST(LIBDTS_CFLAGS)
- if test "x$have_dts" = "xno"; then
- AC_MSG_RESULT([*** no usable version of libdts found, using internal copy ***])
- fi
-else
- AC_MSG_RESULT([Use included libdts support])
-fi
+AC_SUBST(PASS1_CFLAGS)
+AC_SUBST(PASS2_CFLAGS)
-AM_CONDITIONAL(DTS, test "x$enable_libdts" = "xyes")
-AM_CONDITIONAL(EXTERNAL_LIBDTS, test "x$have_dts" = "xyes")
+test x"$DEFAULT_OCFLAGS" = x"" && DEFAULT_OCFLAGS='$(O3_CFLAGS)'
+AC_SUBST(DEFAULT_OCFLAGS)
-dnl ---------------------------------------------
-dnl libmodplug support
-dnl ---------------------------------------------
-AC_ARG_ENABLE([modplug],
- AS_HELP_STRING([--enable-modplug], [Enable modplug support]) )
-
-if test "x$enable_modplug" != "xno"; then
- PKG_CHECK_MODULES([LIBMODPLUG], [libmodplug >= 0.7],
- [AC_DEFINE([HAVE_MODPLUG], 1, [define this if you have libmodplug installed])],
- [enable_modplug=no])
- if test "`"$PKG_CONFIG" --modversion libmodplug`" = 0.8.8; then
- AC_MSG_ERROR([you have a broken version of libmodplug (0.8.8); cowardly refusing to use it])
- fi
+if test x"$arch_x86" != x"no" && test x"$enable_macosx_universal" = x"no"; then
+ AC_DEFINE([ARCH_X86], [], [Define this if you're running x86 architecture])
+ AC_DEFINE([HAVE_MMX], [], [Define this if you can compile MMX asm instructions])
fi
+AM_CONDITIONAL([ARCH_PPC], test x"$arch_ppc" = x"yes")
+AM_CONDITIONAL([ARCH_X86], test x"$arch_x86" != x"no")
+AM_CONDITIONAL([ARCH_X86_32], test x"$arch_x86" = x"32")
+AM_CONDITIONAL([ARCH_X86_64], test x"$arch_x86" = x"64")
+AM_CONDITIONAL([HAVE_MMX], test x"$arch_x86" != x"no")
+AM_CONDITIONAL([HOST_OS_DARWIN], test x"$HOST_OS_DARWIN" = x"1")
-AC_SUBST(LIBMODPLUG_CFLAGS)
-AC_SUBST(LIBMODPLUG_LIBS)
-dnl AM_CONDITIONAL(HAVE_MODPLUG, [test "x$have_modplug" = x"yes"])
-
-dnl ---------------------------------------------
-dnl Wavpack library
-dnl ---------------------------------------------
-AC_ARG_WITH([wavpack],
- AS_HELP_STRING([--with-wavpack], [Enable Wavpack decoder (requires libwavpack)]) )
-
-if test "x$with_wavpack" = "xyes"; then
- PKG_CHECK_MODULES([WAVPACK], [wavpack], [have_wavpack=yes])
+if test x"$enable_impure_text" = x"yes"; then
+ case "$host_or_hostalias" in
+ *solaris*)
+ if test "$GCC" = yes; then
+ IMPURE_TEXT_LDFLAGS="-mimpure-text"
+ else
+ IMPURE_TEXT_LDFLAGS="-z textoff"
+ fi
+ ;;
+ *darwin*)
+ IMPURE_TEXT_LDFLAGS="-Wl,-read_only_relocs,warning"
+ ;;
+ esac
fi
+AC_SUBST(IMPURE_TEXT_LDFLAGS)
-AM_CONDITIONAL([HAVE_WAVPACK], [test "x$have_wavpack" = "xyes"])
-
-
-dnl --------------------------------------------
-dnl Real binary codecs support
-dnl --------------------------------------------
-AC_ARG_ENABLE([real-codecs],
- AS_HELP_STRING([--disable-real-codecs], [Disable Real binary codecs support]))
-AC_ARG_WITH([real-codecs-path],
- AS_HELP_STRING([--with-real-codecs-path=dir], [Specify directory for Real binary codecs]), [
- AC_DEFINE_UNQUOTED([REAL_CODEC_PATH], ["$withval"], [Specified path for Real binary codecs])
- ])
+dnl ----------------------------
+dnl checks for library functions
+dnl ----------------------------
-dnl On some systems, we cannot enable Real codecs support to begin with.
-dnl This includes Darwin, that uses Mach-O rather than ELF.
-case $host in
- *-darwin*) enable_real_codecs="no" ;;
-esac
-
-if test "x$enable_real_codecs" != "xno"; then
- dnl For those that have a replacement, break at the first one found
- AC_CHECK_SYMBOLS([__environ _environ environ], [break], [need_weak_aliases=yes])
- AC_CHECK_SYMBOLS([stderr __stderrp], [break], [need_weak_aliases=yes])
+dnl NLS: src/input/mms.c src/input/vcd, xine-utils
+AC_CHECK_FUNCS([nl_langinfo])
- dnl For these there are no replacements
- AC_CHECK_SYMBOLS([___brk_addr __ctype_b])
+dnl src/libfaad
+AC_CHECK_DECL([lrintf],
+ [AC_DEFINE([HAVE_LRINTF], 1, [Define this if the 'lrintf' function is declared in math.h])
+ AC_DEFINE([_ISOC9X_SOURCE], 1, [Define this if you are ISO C9X compliant])],
+ [],
+ [#define _ISOC9X_SOURCE
+ #include <math.h>])
- if test "x$need_weak_aliases" = "xyes"; then
- CC_ATTRIBUTE_ALIAS(, [AC_MSG_ERROR([You need weak aliases support for Real codecs on your platform])])
- fi
-fi
+dnl contrib/libdca, src/video_out/vidix/drivers/mach64_vid.c
+AC_CHECK_FUNCS([memalign])
-AM_CONDITIONAL([ENABLE_REAL], [test "x$enable_real_codecs" != "xno"])
+dnl src/input/vcd/libcdio/portable.h
+AC_CHECK_FUNCS([bzero])
-dnl --------------------------------------------
-dnl mmap() support
-dnl --------------------------------------------
+dnl src/libfaad/common.h
+AC_CHECK_FUNCS([memcpy])
+dnl src/input/input_file.c
AC_ARG_ENABLE([mmap],
- AS_HELP_STRING([--enable-mmap], [Enable mmap() file loading (default: no)]))
-
-if test "x$enable_mmap" = "xyes"; then
- AC_CHECK_FUNCS([mmap])
-fi
-
-dnl ---------------------------------------------
-dnl antialising support
-dnl ---------------------------------------------
-
-AC_ARG_ENABLE([antialiasing],
- AS_HELP_STRING([--enable-antialiasing], [enable font antialiasing]))
-
-if test "x$enable_antialiasing" = "xyes"; then
- AC_DEFINE(ENABLE_ANTIALIASING,1,[Define this to 1 to enable font antialising.])
-fi
-
-dnl ---------------------------------------------
-dnl ip_mreqn
-dnl ---------------------------------------------
-
-AC_CHECK_IP_MREQN
-if test "x$have_ip_mreqn" = "xyes"; then
- AC_DEFINE(HAVE_IP_MREQN,1,[Define this if you have ip_mreqn in netinet/in.h])
+ AS_HELP_STRING([--enable-mmap], [Enable mmap() file loading (default: no)]))
+if test x"$enable_mmap" = x"yes"; then
+ AC_CHECK_FUNCS([mmap])
fi
-dnl ---------------------------------------------
-dnl restrict keyword finding (from gstreamer)
-dnl ---------------------------------------------
-restrict=""
-for restrict_keyword in restrict __restrict__ __restrict; do
- AC_MSG_CHECKING(for restrict keyword $restrict_keyword)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ void foo(char * $restrict_keyword p); ]])],[
- KEYWORD_FOUND=yes && AC_MSG_RESULT(yes) ],[
- KEYWORD_FOUND=no && AC_MSG_RESULT(no) ])
- if test "x$KEYWORD_FOUND" = xyes; then
- restrict="$restrict_keyword"
- break
- fi
-done
-if test "x$restrict" = x; then
- AC_MSG_ERROR(No restrict keyword found)
-fi
-AC_DEFINE_UNQUOTED(restrict, $restrict, [restrict keyword])
-
-dnl ---------------------------------------------
-dnl ASM ALIGN is power of two ?
-dnl Used by internal FFmpeg and Planar postprocess
-dnl ---------------------------------------------
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ asm (".align 3"); ]])],
- AC_DEFINE([ASMALIGN_1SLN], [1], [define if '.align n' means alignment to (1<<n)-byte boundaries]),
- :)
-AH_BOTTOM([#ifdef ASMALIGN_1SLN
-# define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"
-#else
-# define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"
-#endif
-])
+AC_CHECK_FUNCS([vsscanf sigaction sigset getpwuid_r nanosleep lstat memset readlink strchr va_copy])
-dnl ---------------------------------------------
-dnl Some extra checks.
-dnl ---------------------------------------------
+AC_CHECK_FUNCS([snprintf _snprintf], [have_required_function="yes"])
+ test x"$have_required_function" != x"yes" && AC_MSG_ERROR([required function not found])
+AC_CHECK_FUNCS([vsnprintf _vsnprintf], [have_required_function="yes"])
+ test x"$have_required_function" != x"yes" && AC_MSG_ERROR([required function not found])
+AC_CHECK_FUNCS([strcasecmp _stricmp], [have_required_function="yes"])
+ test x"$have_required_function" != x"yes" && AC_MSG_ERROR([required function not found])
+AC_CHECK_FUNCS([strncasecmp _strnicmp], [have_required_function="yes"])
+ test x"$have_required_function" != x"yes" && AC_MSG_ERROR([required function not found])
-AC_SYS_LARGEFILE
-AC_CHECK_LIB(posix4, sched_get_priority_min)
-AC_CHECK_FUNCS([vsscanf sigaction sigset getpwuid_r nanosleep lstat memset readlink strchr tzset va_copy])
-AC_CHECK_FUNCS([snprintf _snprintf], [some_snprintf="yes"; break])
-AC_CHECK_FUNCS([vsnprintf _vsnprintf], [some_vsnprintf="yes"; break])
-AC_CHECK_FUNCS([strcasecmp _stricmp], [some_strcasecmp="yes"; break])
-AC_CHECK_FUNCS([strncasecmp _strnicmp], [some_strncasecmp="yes"; break])
-if test "x$some_snprintf" != "xyes" -o \
- "x$some_vsnprintf" != "xyes" -o \
- "x$some_strcasecmp" != "xyes" -o \
- "x$some_strncasecmp" != "xyes"; then
- AC_MSG_ERROR([required function not found])
-fi
AC_FUNC_FSEEKO
-AC_CHECK_HEADERS(assert.h byteswap.h malloc.h execinfo.h ucontext.h sys/mman.h sys/mixer.h libgen.h netdb.h dirent.h sys/times.h sys/ioctl.h sys/param.h alloca.h)
-AC_REPLACE_FUNCS(asprintf basename gettimeofday setenv strcasestr strndup strpbrk strsep strtok_r timegm unsetenv memmem)
-
-AC_LIBSOURCE(hstrerror.c)
-AC_LINK_IFELSE([AC_LANG_SOURCE([#include <netdb.h>
-int main(void) {
- hstrerror(0);
-}])], ac_cv_function_system_hstrerror="yes")
-AC_CHECK_LIB([resolv], [hstrerror], [
- ac_cv_function_system_hstrerror="yes"
- NET_LIBS="-lresolv $NET_LIBS"
-])
-AC_SUBST(NET_LIBS)
-if test "x$ac_cv_function_system_hstrerror" = "xyes"; then
- AC_DEFINE(HAVE_HSTRERROR, 1, [Define to 1 if you have 'hstrerror' in <netdb.h>])
-else
- AC_LIBOBJ(hstrerror)
-fi
+AC_REPLACE_FUNCS([asprintf basename gettimeofday setenv strcasestr strndup strpbrk strsep strtok_r timegm unsetenv memmem])
-AC_LIBSOURCE(dirent_msvc.c)
-AC_CHECK_FUNC(opendir,
- [AC_DEFINE(HAVE_OPENDIR, 1, [Define to 1 if you have 'opendir' function])],
- [if test "x$SYS" = "xmingw32"; then
- AC_LIBOBJ(dirent_msvc)
- else
- AC_MSG_ERROR([dirent is needed (opendir, readdir, ...)])
- fi])
+AC_LIBSOURCE([hstrerror.c])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netdb.h>]], [[hstrerror(0)]])],
+ [AC_DEFINE([HAVE_HSTRERROR], 1, [Define to 1 if you have 'hstrerror' in <netdb.h>])],
+ [AC_LIBOBJ([hstrerror])])
+
+AC_LIBSOURCE([dirent_msvc.c])
+AC_CHECK_FUNC([opendir],
+ [AC_DEFINE([HAVE_OPENDIR], 1, [Define to 1 if you have 'opendir' function])],
+ [if test x"$WIN32_SYS" = x"mingw32"; then
+ AC_LIBOBJ([dirent_msvc])
+ else
+ AC_MSG_ERROR([dirent is needed (opendir, readdir, ...)])
+ fi])
XINE_CHECK_MINMAX([
AC_DEFINE(HAVE_MAX_MACRO, 1, [Define to 1 if you have 'MAX' macro in sys/param.h])
AC_DEFINE(HAVE_MIN_MACRO, 1, [Define to 1 if you have 'MIN' macro in sys/param.h])
],[])
-dnl ---------------------------------------------
-dnl cflags and debug cflags
-dnl ---------------------------------------------
-
-AC_SUBST(DEBUG_CFLAGS)
-DEBUG_CFLAGS="-g -DDEBUG $CFLAGS"
-
-dnl dummy
-ASFLAGS="$ASFLAGS"
-AC_SUBST(ASFLAGS)
-
-dnl ---------------------------------------------
-dnl Check for some __attribute__ support needed
-dnl ---------------------------------------------
-
-CC_ATTRIBUTE_ALIGNED
-
-CC_ATTRIBUTE_VISIBILITY([protected], [visibility_export="protected"],
- [CC_ATTRIBUTE_VISIBILITY([default], [visibility_export="default"])]
-)
-CC_ATTRIBUTE_VISIBILITY([internal])
-
-if test "x$visibility_export" != "x"; then
- CC_FLAG_VISIBILITY([
- AC_DEFINE([EXPORTED], [__attribute__((visibility("default")))],
- [Mark a symbol as being exported if visibility is changed])
- VISIBILITY_FLAG="-fvisibility=hidden"
- ], [AC_DEFINE([EXPORTED], [], [Dummy mark as being exported])
- ])
-else
- AC_DEFINE([EXPORTED], [], [Dummy mark as being exported])
-fi
-
-AC_SUBST([VISIBILITY_FLAG])
-
-CC_ATTRIBUTE_SENTINEL
-CC_ATTRIBUTE_FORMAT
-CC_ATTRIBUTE_FORMAT_ARG
-CC_ATTRIBUTE_DEPRECATED
-CC_ATTRIBUTE_UNUSED
-CC_ATTRIBUTE_MALLOC
-CC_ATTRIBUTE_PACKED
-CC_ATTRIBUTE_CONST
-
-AC_OPTIMIZATIONS
-
-arch_x86="no"
-enable_armv4l="no"
-
-case "$host_or_hostalias" in
- i?86-* | k?-* | athlon-* | pentium*-)
- dnl enable x86 specific parts of the code
- dnl
- dnl all of this stuff needs gcc/gas; it uses gnu c compiler extensions
- dnl like the extended asm() or __attribute(__cdecl__), or other direct
- dnl mmx/sse/3dnow assembler instructions.
- dnl
- AC_DEFINE_UNQUOTED(ARCH_X86_32,,[Define this if you're running x86 architecture 32 bits])
- AC_DEFINE(FPM_INTEL,1,[Define to select libmad fixed point arithmetic implementation])
- arch_x86="32"
- enable_impure_text="yes"
-
- case "$host_or_hostalias" in
- *-*-cygwin)
- LIBS="$LIBS @INTLLIBS@ -lkernel32"
- ;;
- esac
- ;;
- x86_64-*)
- AC_DEFINE_UNQUOTED(ARCH_X86_64,,[Define this if you're running x86 architecture 64 bits])
- AC_DEFINE(FPM_64BIT,1,[Define to select libmad fixed point arithmetic implementation])
- arch_x86="64"
- ;;
- powerpc-*-darwin*)
- dnl avoid ppc compilation crash
- AS="$CC"
- AC_DEFINE_UNQUOTED(FPM_PPC,,[Define to select libmad fixed point arithmetic implementation])
- AC_DEFINE_UNQUOTED(ARCH_PPC,,[Define this if you're running PowerPC architecture])
-
- AC_CHECK_HEADER([altivec.h], , enable_altivec=no)
-
- if test "x$enable_altivec" != xno; then
- AC_DEFINE_UNQUOTED(ENABLE_ALTIVEC,,[Define this if you want to use altivec on PowerPC CPUs])
- CFLAGS="$CFLAGS -faltivec -maltivec"
- LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -force_cpusubtype_ALL -faltivec -maltivec"
- fi
- ;;
- ppc-*-linux* | powerpc-*)
- dnl avoid ppc compilation crash
- AS="$CC"
- AC_DEFINE_UNQUOTED(FPM_PPC,,[Define to select libmad fixed point arithmetic implementation])
- AC_DEFINE_UNQUOTED(ARCH_PPC,,[Define this if you're running PowerPC architecture])
-
- AC_CHECK_HEADER([altivec.h], , enable_altivec=no)
-
- if test "x$enable_altivec" != xno; then
- AC_DEFINE_UNQUOTED(ENABLE_ALTIVEC,,[Define this if you have a Motorola 74xx CPU])
- CFLAGS="$CFLAGS -maltivec"
- LIBMPEG2_CFLAGS="$LIBMPEG2_CFLAGS -maltivec"
- fi
- ;;
- sparc*-*-linux*)
- if test "x$enable_vis" != xno; then
- has_vis=yes
- fi
+AC_LIBSOURCE([timedlock.c])
+ac_save_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_LIBS"
+AC_CHECK_FUNCS([pthread_mutex_timedlock],
+ [AC_DEFINE([HAVE_PTHREAD_MUTEX_TIMEDLOCK], 1, [Define to 1 if you have 'pthread_mutex_timedlock' in <pthread.h>])],
+ [AC_LIBOBJ([timedlock])])
+LIBS="$ac_save_LIBS"
- AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])
- AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
- ;;
- sparc-*-solaris*)
- if test "$GCC" = yes; then
- case `$CC --version 2>/dev/null` in
- 1.*|2.*) ;;
- *)
- if test "x$enable_vis" != xno; then
- has_vis=yes
- fi
- ;;
- esac
-
- AC_DEFINE_UNQUOTED(FPM_SPARC,,[Define to select libmad fixed point arithmetic implementation])
- else
- AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
- fi
- AC_DEFINE_UNQUOTED(ARCH_SPARC,,[Define this if you're running SPARC architecture])
- ;;
- mips-*)
- AC_DEFINE_UNQUOTED(FPM_MIPS,,[Define to select libmad fixed point arithmetic implementation])
- ;;
- alphaev56-* | alpha* | ia64-* | hppa*-linux-*)
- AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
- AC_DEFINE_UNQUOTED(ARCH_ALPHA,,[Define this if you're running Alpha architecture])
- ;;
- armv4l-*-linux*)
- AC_DEFINE_UNQUOTED(FPM_ARM,,[Define to select libmad fixed point arithmetic implementation])
- AC_DEFINE_UNQUOTED(ARCH_ARM,,[Define this if you're running ARM architecture])
- enable_armv4l="yes"
- ;;
- *)
- AC_DEFINE_UNQUOTED(FPM_DEFAULT,,[Define to select libmad fixed point arithmetic implementation])
- ;;
-esac
+AC_GETOPT_LONG
-if test "x$has_vis" = "xyes"; then
- AC_DEFINE_UNQUOTED(ENABLE_VIS,,[Define this if you have Sun UltraSPARC CPU])
- case "$CFLAGS" in
- *-mcpu=*) ;;
- *) CFLAGS="$CFLAGS -mcpu=v9" ;;
- esac
-fi
-AM_CONDITIONAL(ENABLE_VIS, test "x$has_vis" = "xyes")
+dnl --------------------------
+dnl checks for system services
+dnl --------------------------
-if test "x$arch_x86" != "xno"; then
- AC_DEFINE_UNQUOTED(ARCH_X86,,[Define this if you're running x86 architecture])
- AC_DEFINE_UNQUOTED(HAVE_MMX,,[Define this if you can compile MMX asm instructions])
-fi
-AM_CONDITIONAL(ARCH_X86, test "x$arch_x86" != "xno")
-AM_CONDITIONAL(ARCH_X86_32, test "x$arch_x86" = "x32")
-AM_CONDITIONAL(ARCH_X86_64, test "x$arch_x86" = "x64")
-AM_CONDITIONAL(HAVE_MMX, test "x$arch_x86" != "xno")
-
-case $host_os in
- darwin*)
- HOST_OS_DARWIN=1
- AC_DEFINE_UNQUOTED(HOST_OS_DARWIN, 1, [Define this if built on Mac OS X/Darwin])
- OBJCFLAGS="-D_INTL_REDIRECT_MACROS $OBJCFLAGS"
+dnl Even as of 2.61, autoconf is not smart enough to find the X include
+dnl and library paths on Mac OS X, so seed them automatically if they're
+dnl not specified on the configure command-line.
+case "$host_os" in
+ darwin*)
+ test x"$x_includes" = x"NONE" && x_includes="/usr/X11R6/include"
+ test x"$x_libraries" = x"NONE" && x_libraries="/usr/X11R6/lib"
;;
esac
-AM_CONDITIONAL(HOST_OS_DARWIN, test "x$HOST_OS_DARWIN" = "x1")
-dnl ---------------------------------------------
-dnl Set IMPURE_TEXT_LDFLAGS
-dnl ---------------------------------------------
+dnl Check for Xwindows using the autoconf AC_PATH_XTRA macro, which is an
+dnl extension of AC_PATH_X that sets X_CFLAGS and X_LIBS. It will also set
+dnl X_EXTRA_LIBS and X_PRE_LIBS.
+AC_PATH_XTRA
+if test x"$no_x" != x"yes"; then
+ X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+ AC_CHECK_LIB([Xext], [main],
+ [X_LIBS="$X_LIBS -lXext"], [AC_MSG_ERROR([libXext is required])],
+ [$X_LIBS])
+elif test x"$have_x" = x"no"; then
+ PKG_CHECK_MODULES([X], [x11 xext], [have_x=yes; no_x=no], [have_x=no; no_x=yes])
+fi
+
+dnl Check for XShm support (required for xine X support)
+if test x"$no_x" != x"yes"; then
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ AC_CHECK_HEADERS([X11/extensions/XShm.h], [],
+ [AC_MSG_ERROR([XShm extension is required])],
+ [#include <X11/Xlib.h>])
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ AC_DEFINE([HAVE_X11], 1, [Define this if you have X11R6 installed])
+fi
+AM_CONDITIONAL([HAVE_X11], [test x"$no_x" != x"yes"])
-IMPURE_TEXT_LDFLAGS=""
-if test "x$enable_impure_text" = xyes; then
- case "$host_or_hostalias" in
- *solaris*)
- if test "$GCC" = yes; then
- IMPURE_TEXT_LDFLAGS="-mimpure-text"
- else
- IMPURE_TEXT_LDFLAGS="-z textoff"
- fi
- ;;
- *-darwin*)
- IMPURE_TEXT_LDFLAGS="-Wl,-read_only_relocs,warning"
- ;;
- esac
-fi
-AC_SUBST(IMPURE_TEXT_LDFLAGS)
-
-dnl ---------------------------------------------
-dnl HAVE_ARMV4L is currently used in libavcodec makefile.am
-dnl ---------------------------------------------
-
-AM_CONDITIONAL(HAVE_ARMV4L, test "x$enable_armv4l" = "xyes")
+dnl Locate libraries needed for X health check
+soname_script="/[[0-9]]$/! d; s%^.*/%%
+t q
+b
+:q
+q"
+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libX11.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libX11.$acl_cv_shlibext"* 2>/dev/null | sed -e \"${soname_script}\"`"
+AC_DEFINE_UNQUOTED([LIBX11_SO], "${x_lib_location:-libX11.$acl_cv_shlibext}", [The soname of libX11, needed for dlopen()])
+x_lib_location="`ls -1 "${x_libraries:-/usr/local/lib}/libXv.$acl_cv_shlibext"* "${x_libraries:-/usr/lib}/libXv.$acl_cv_shlibext"* 2>/dev/null | sed -e \"${soname_script}\"`"
+AC_DEFINE_UNQUOTED([LIBXV_SO], "${x_lib_location:-libXv.$acl_cv_shlibext}", [The soname of libXv, needed for dlopen()])
+
+dnl _FILE_OFFSET_BITS (AC_SYS_LARGEFILE; ac_cv_sys_file_offset_bits)
+dnl _LARGE_FILES (AC_SYS_LARGEFILE; ac_cv_sys_large_files)
+dnl _LARGEFILE_SOURCE (AC_FUNC_SEEKO; ac_cv_sys_largfile_source)
+dnl _LARGEFILE64_SOURCE (glibc transitional; not tested or used anywhere)
+AC_SYS_LARGEFILE
+dnl Add macros to the compiler command line that are also in config.h for things
+dnl that do not #include config.h.
+dnl known: src/input/libreal, src/input/librtsp
+test x"$ac_cv_sys_file_offset_bits" != x"no" && CPPFLAGS="-D_FILE_OFFSET_BITS=64 $CPPFLAGS"
+test x"$ac_cv_sys_largefile_source" != x"no" && CPPFLAGS="-D_LARGEFILE_SOURCE $CPPFLAGS"
+test x"$ac_cv_sys_large_files" != x"" && test x"$ac_cv_sys_large_files" != x"no" && CPPFLAGS="-D_LARGE_FILES $CPPFLAGS"
-dnl ---------------------------------------------
-dnl Use features of autoconf 2.61, but stay compatible
-dnl with older versions.
-dnl ---------------------------------------------
-if test "x$datarootdir" = "x"; then
- datarootdir='${datadir}'
- AC_SUBST(datarootdir)
-fi
+dnl -------
+dnl Plugins
+dnl -------
-if test "x$docdir" = "x"; then
- docdir='${datarootdir}/doc/${PACKAGE}'
- AC_SUBST(docdir)
-fi
+XINE_AUDIO_OUT_PLUGINS
+XINE_VIDEO_OUT_PLUGINS
+XINE_INPUT_PLUGINS
+XINE_DECODER_PLUGINS
-if test "x$htmldir" = "x"; then
- htmldir='${docdir}'
- AC_SUBST(htmldir)
-fi
dnl ---------------------------------------------
dnl XINE_ROOTDIR does not work if architecture independent files are
dnl installed to another place than architecture dependent files !!!
dnl ---------------------------------------------
-if test "x$prefix" = xNONE; then
- prefix="${ac_default_prefix}"
-fi
-if test "x$exec_prefix" = xNONE; then
- exec_prefix='${prefix}'
-fi
-
dnl
dnl installation directories and directories relative to prefix
dnl
@@ -2528,11 +1025,11 @@ dnl use AC_SUBST for installation
dnl
makeexpand () {
- local i
- local j
- i="$1"
- while test "$i" != "$j"; do j="$i"; eval i="$j"; done
- echo "$i"
+ local i
+ local j
+ i="$1"
+ while test "$i" != "$j"; do j="$i"; eval i="$j"; done
+ echo "$i"
}
xinelibdir='${libdir}/xine'
@@ -2552,25 +1049,29 @@ XINE_REL_PLUGINDIR="$XINE_REL_PLUGINROOT.$XINE_LT_AGE"
XINE_REL_FONTDIR="`makeexpand "$XINE_FONTDIR" | sed -e "s,^${prefix}/,,"`"
XINE_REL_LOCALEDIR="`makeexpand "$XINE_LOCALEDIR" | sed -e "s,^${prefix}/,,"`"
XINE_PKGCONFIG_DIR="`makeexpand "$pkgconfigdir"`"
-dnl platform specific runtime directories
-if test "x$SYS" = "xmingw32" -o "x$SYS" = "xcygwin"; then
- AC_DEFINE(XINE_PLUGINROOT,[xine_get_pluginroot()],[Define this to general plugins directory location])
- AC_DEFINE(XINE_PLUGINDIR,[xine_get_plugindir()],[Define this to specific plugins directory location])
- AC_DEFINE(XINE_FONTDIR,[xine_get_fontdir()],[Define this to osd fonts dir location])
- AC_DEFINE(XINE_LOCALEDIR,[xine_get_localedir()],[Path where catalog files will be.])
+if test "x$WIN32_SYS" = "xmingw32" -o "x$WIN32_SYS" = "xcygwin"; then
+ dnl polish paths (MinGW runtime accepts both \ and / anyway)
+ XINE_REL_PLUGINROOT="`echo "$XINE_REL_PLUGINROOT" | sed -e 's/\\//\\\\\\\\/g'`"
+ XINE_REL_PLUGINDIR="$XINE_REL_PLUGINROOT.$XINE_LT_AGE"
+ XINE_REL_FONTDIR="`echo "$XINE_REL_FONTDIR" | sed -e 's/\\//\\\\\\\\/g'`"
+ XINE_REL_LOCALEDIR="`echo "$XINE_REL_LOCALEDIR" | sed -e 's/\\//\\\\\\\\/g'`"
+ AC_DEFINE([XINE_PLUGINROOT],[xine_get_pluginroot()],[Define this to general plugins directory location])
+ AC_DEFINE([XINE_PLUGINDIR], [xine_get_plugindir()], [Define this to specific plugins directory location])
+ AC_DEFINE([XINE_FONTDIR], [xine_get_fontdir()], [Define this to osd fonts dir location])
+ AC_DEFINE([XINE_LOCALEDIR], [xine_get_localedir()], [Path where catalog files will be.])
else
- XINE_PLUGINROOTPATH="`makeexpand "$XINE_PLUGINROOT"`"
- XINE_FONTPATH="`makeexpand "$XINE_FONTDIR"`"
- XINE_LOCALEPATH="`makeexpand "$XINE_LOCALEDIR"`"
- AC_DEFINE_UNQUOTED(XINE_PLUGINROOT,"$XINE_PLUGINROOTPATH",[Define this to general plugins directory location])
- AC_DEFINE_UNQUOTED(XINE_PLUGINDIR,"$XINE_PLUGINROOTPATH.$XINE_LT_AGE",[Define this to specific plugins directory location])
- AC_DEFINE_UNQUOTED(XINE_FONTDIR,"$XINE_FONTPATH",[Define this to osd fonts dir location])
- AC_DEFINE_UNQUOTED(XINE_LOCALEDIR, "$XINE_LOCALEPATH",[Path where catalog files will be.])
-fi
-AC_DEFINE_UNQUOTED(XINE_REL_PLUGINDIR,"$XINE_REL_PLUGINDIR",[Define this to specific plugin directory relative to execution prefix])
-AC_DEFINE_UNQUOTED(XINE_REL_PLUGINROOT,"$XINE_REL_PLUGINROOT",[Define this to general plugin directory relative to execution prefix])
-AC_DEFINE_UNQUOTED(XINE_REL_FONTDIR,"$XINE_REL_FONTDIR",[Define this to font directory relative to prefix])
-AC_DEFINE_UNQUOTED(XINE_REL_LOCALEDIR,"$XINE_REL_LOCALEDIR",[Define this to font directory relative to prefix])
+ XINE_PLUGINROOTPATH="`makeexpand "$XINE_PLUGINROOT"`"
+ XINE_FONTPATH="`makeexpand "$XINE_FONTDIR"`"
+ XINE_LOCALEPATH="`makeexpand "$XINE_LOCALEDIR"`"
+ AC_DEFINE_UNQUOTED([XINE_PLUGINROOT],["$XINE_PLUGINROOTPATH"], [Define this to general plugins directory location])
+ AC_DEFINE_UNQUOTED([XINE_PLUGINDIR], ["$XINE_PLUGINROOTPATH.$XINE_LT_AGE"], [Define this to soecific plugins directory location])
+ AC_DEFINE_UNQUOTED([XINE_FONTDIR], ["$XINE_FONTPATH"], [Define this to osd fonts dir location])
+ AC_DEFINE_UNQUOTED([XINE_LOCALEDIR], ["$XINE_LOCALEPATH"], [Path where catalog files will be.])
+fi
+AC_DEFINE_UNQUOTED([XINE_REL_PLUGINDIR], ["$XINE_REL_PLUGINDIR"], [Define this to specific plugin directory relative to execution prefix])
+AC_DEFINE_UNQUOTED([XINE_REL_PLUGINROOT],["$XINE_REL_PLUGINROOT"],[Define this to general plugin directory relative to execution prefix])
+AC_DEFINE_UNQUOTED([XINE_REL_FONTDIR], ["$XINE_REL_FONTDIR"], [Define this to font directory relative to prefix])
+AC_DEFINE_UNQUOTED([XINE_REL_LOCALEDIR], ["$XINE_REL_LOCALEDIR"], [Define this to font directory relative to prefix])
AC_SUBST(XINE_PLUGINDIR)
AC_SUBST(XINE_FONTDIR)
AC_SUBST(XINE_LOCALEDIR)
@@ -2583,8 +1084,10 @@ fi
AC_SUBST([LIBTOOL_DESTDIR_DEFAULT])
dnl Where aclocal m4 files should be installed
+xine_acflags='-I ${datarootdir}/aclocal'
XINE_ACFLAGS="-I ${datarootdir}/aclocal"
-AC_DEFINE_UNQUOTED(XINE_ACFLAGS, "$XINE_ACFLAGS", [Path where aclocal m4 files will be.])
+AC_DEFINE_UNQUOTED([XINE_ACFLAGS], ["$XINE_ACFLAGS"], [Path where aclocal m4 files will be.])
+AC_SUBST(xine_acflags)
AC_SUBST(XINE_ACFLAGS)
dnl Where architecture independent data (e.g. logo) will/should be installed
@@ -2597,62 +1100,6 @@ AC_SUBST(XINE_SCRIPTPATH)
dnl ---------------------------------------------
-dnl Some informations about xine-lib compilation
-dnl ---------------------------------------------
-
-XINE_BUILD_CC="`$CC -v 2>&1 | tail -1 2>/dev/null`"
-XINE_BUILD_OS="`uname -s -r -m`"
-XINE_BUILD_DATE="`date "+%a %d %b %Y %T"`"
-AC_SUBST(XINE_BUILD_CC)
-AC_SUBST(XINE_BUILD_OS)
-AC_SUBST(XINE_BUILD_DATE)
-
-
-dnl ---------------------------------------------
-dnl For win32 libraries location, needed by libw32dll.
-dnl ---------------------------------------------
-
-AC_ARG_WITH([w32-path],
- AS_HELP_STRING([--with-w32-path=path], [location of Win32 binary codecs]),
- [w32_path="$withval"], [w32_path="/usr/lib/codecs"])
-AC_SUBST(w32_path)
-
-AC_ARG_ENABLE([w32dll],
- AS_HELP_STRING([--disable-w32dll], [Disable Win32 DLL support]),
- , [enable_w32dll=$with_gnu_as])
-
-case $host in
- *-mingw* | *-cygwin)
- enable_w32dll="no" ;;
- i?86-* | k?-* | athlon-* | pentium*-)
- if test "x$enable_w32dll" != "xno"; then
- CC_PROG_AS
- fi
- test "x$enable_w32dll" = "x" && \
- enable_w32dll="$with_gnu_as"
- ;;
- *)
- enable_w32dll="no" ;;
-esac
-
-if test "x$enable_w32dll" = "xyes" && \
- test "x$with_gnu_as" = "xno"; then
-
- AC_MSG_ERROR([You need GNU as to enable Win32 codecs support])
-fi
-
-AM_CONDITIONAL(HAVE_W32DLL, test "x$enable_w32dll" != "xno")
-
-
-dnl ---------------------------------------------
-dnl some include paths ( !!! DO NOT REMOVE !!! )
-dnl ---------------------------------------------
-
-INCLUDES='-I$(top_srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_builddir)/src/xine-engine -I$(top_srcdir)/src/xine-engine -I$(top_srcdir)/src/xine-utils $(INTLDIR) -I$(top_builddir)/src/input -I$(top_srcdir)/src/input $(WIN32_CPPFLAGS) -I$(top_builddir)/lib -I$(top_srcdir)/lib'
-AC_SUBST(INCLUDES)
-
-
-dnl ---------------------------------------------
dnl Get where .m4 should be installed.
dnl ---------------------------------------------
@@ -2673,50 +1120,21 @@ dnl ;;
dnl esac
dnl fi
AC_SUBST(ACLOCAL_DIR)
-AM_CONDITIONAL([INSTALL_M4],[test "x$ACLOCAL_DIR" != "x"])
-
+AM_CONDITIONAL([INSTALL_M4], [test x"$ACLOCAL_DIR" != x""])
-dnl ---------------------------------------------
-dnl It seems automake 1.5 don't take care about this script
-dnl ---------------------------------------------
-
-if test ! -z "$am_depcomp"; then
- DEPCOMP="depcomp"
-fi
-AC_SUBST(DEPCOMP)
-
-
-dnl ---------------------------------------------
-dnl Check for documentation formatting tool
-dnl ---------------------------------------------
-
-AC_CHECK_PROG(SGMLTOOLS, sgmltools, sgmltools, no)
-AM_CONDITIONAL([HAVE_SGMLTOOLS], [test "$SGMLTOOLS" != "no"])
-
-AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev, no)
-AM_CONDITIONAL([HAVE_FIG2DEV], [test "$FIG2DEV" != "no"])
-
-dnl ---------------------------------------------
-dnl Newest automake workaround
-dnl ---------------------------------------------
-
-AC_SUBST(mkdir_p)
-if test -n "$ac_aux_dir"; then
- case "$ac_aux_dir" in
- /*) MKINSTALLDIRS="$ac_aux_dir/install-sh -d" ;;
- *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/install-sh -d" ;;
- esac
-else
- MKINSTALLDIRS="\$(top_srcdir)/install-sh -d"
-fi
-AC_SUBST(MKINSTALLDIRS)
dnl this is an internal function we should not use, but
dnl as long as neither autoconf nor automake offer an A[CM]_PROG_OBJC
dnl check we will have to call it
_AM_DEPENDENCIES([OBJC])
-AM_CONDITIONAL([BUILD_DMX_IMAGE], [test "x$have_imagemagick" = "xyes" -o "x$no_gdkpixbuf" != "xyes"])
+
+dnl ---------------------------------------------
+dnl some include paths ( !!! DO NOT REMOVE !!! )
+dnl ---------------------------------------------
+
+INCLUDES='-I$(top_srcdir) -I$(top_builddir)/include -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_builddir)/src/xine-engine -I$(top_srcdir)/src/xine-engine -I$(top_srcdir)/src/xine-utils $(INTLDIR) -I$(top_builddir)/src/input -I$(top_srcdir)/src/input $(WIN32_INCLUDES) -I$(top_builddir)/lib -I$(top_srcdir)/lib'
+AC_SUBST(INCLUDES)
dnl We check for warnings here rather than with optimisations since we
dnl want them to be _always_ enabled, to make sure the code is sane
@@ -2760,16 +1178,36 @@ AH_BOTTOM([
#endif
])
-
dnl Common cflags for all platforms
-CFLAGS="-D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
-DEBUG_CFLAGS="-D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $DEBUG_CFLAGS"
+CFLAGS="$UNIVERSAL_CFLAGS \$(MULTIPASS_CFLAGS) $miscflags $warnflags $CFLAGS"
+LDFLAGS="$UNIVERSAL_LDFLAGS $LDFLAGS"
+OBJCFLAGS="$UNIVERSAL_CFLAGS $miscflags $warnflags $OBJCFLAGS"
-if test "x$enable_debug" = "xyes"; then
- CFLAGS="$CFLAGS -DDEBUG"
-else
- CFLAGS="$CFLAGS -DNDEBUG"
-fi
+dnl Some informations about xine-lib compilation for xine-config
+XINE_BUILD_CC="`$CC -v 2>&1 | tail -1 2>/dev/null`"
+XINE_BUILD_OS="`uname -s -r -m`"
+XINE_BUILD_DATE="`date "+%a %d %b %Y %T"`"
+AC_SUBST(XINE_BUILD_CC)
+AC_SUBST(XINE_BUILD_OS)
+AC_SUBST(XINE_BUILD_DATE)
+
+
+dnl ---------------------------------------------
+dnl Check for documentation formatting tool
+dnl ---------------------------------------------
+
+AC_CHECK_PROG(XMLTO, xmlto, xmlto, no)
+AM_CONDITIONAL([HAVE_XMLTO], [test "$XMLTO" != "no"])
+
+AC_CHECK_PROG(RSVG, rsvg, rsvg, no)
+AM_CONDITIONAL([HAVE_RSVG], [test "$RSVG" != "no"])
+
+dnl ---------------------------------------------
+dnl ... and for PNG optimisation tool
+dnl ---------------------------------------------
+
+AC_CHECK_PROG(OPTIPNG, optipng, optipng, no)
+AM_CONDITIONAL([HAVE_OPTIPNG], [test "$OPTIPNG" != "no"])
dnl ---------------------------------------------
dnl Output configuration files
@@ -2782,15 +1220,31 @@ doc/man/Makefile
doc/man/en/Makefile
doc/hackersguide/Makefile
doc/faq/Makefile
+doc/Doxyfile
+contrib/Makefile
+contrib/a52dec/Makefile
+contrib/gsm610/Makefile
+contrib/libdca/Makefile
+contrib/libdha/Makefile
+contrib/libdha/bin/Makefile
+contrib/libdha/kernelhelper/Makefile
+contrib/libdha/oth/Makefile
+contrib/libdha/sysdep/Makefile
+contrib/libfaad/Makefile
+contrib/libmad/Makefile
+contrib/libmpcdec/Makefile
+contrib/libxdg-basedir/Makefile
+contrib/nosefart/Makefile
+contrib/vidix/Makefile
+contrib/vidix/drivers/Makefile
include/Makefile
-include/xine.h
+include/xine/version.h
lib/Makefile
m4/Makefile
misc/Makefile
misc/Makefile.plugins
misc/SlackBuild
misc/build_rpms.sh
-misc/fonts/Makefile
misc/libxine.pc
misc/relchk.sh
misc/xine-config
@@ -2799,59 +1253,22 @@ po/Makevars.extra
po/Makefile.in
src/Makefile
src/audio_out/Makefile
+src/audio_dec/Makefile
src/combined/Makefile
src/combined/ffmpeg/Makefile
src/demuxers/Makefile
src/dxr3/Makefile
src/input/Makefile
src/input/libdvdnav/Makefile
-src/input/dvb/Makefile
src/input/librtsp/Makefile
src/input/libreal/Makefile
src/input/vcd/Makefile
-src/input/vcd/libcdio/Makefile
-src/input/vcd/libcdio/cdio/Makefile
-src/input/vcd/libcdio/MSWindows/Makefile
-src/input/vcd/libcdio/image/Makefile
-src/input/vcd/libvcd/Makefile
-src/input/vcd/libvcd/libvcd/Makefile
-src/liba52/Makefile
-src/libdts/Makefile
-src/libfaad/Makefile
-src/libfaad/codebook/Makefile
-src/libffmpeg/Makefile
-src/libffmpeg/libavcodec/Makefile
-src/libffmpeg/libavcodec/armv4l/Makefile
-src/libffmpeg/libavcodec/i386/Makefile
-src/libffmpeg/libavcodec/mlib/Makefile
-src/libffmpeg/libavcodec/alpha/Makefile
-src/libffmpeg/libavcodec/ppc/Makefile
-src/libffmpeg/libavcodec/sparc/Makefile
-src/libffmpeg/libavcodec/libpostproc/Makefile
-src/libffmpeg/libavutil/Makefile
-src/libmad/Makefile
-src/libmpeg2/Makefile
-src/libmpeg2new/Makefile
-src/libmpeg2new/libmpeg2/Makefile
-src/libmpeg2new/include/Makefile
-src/libmusepack/Makefile
-src/libmusepack/musepack/Makefile
-src/libspudec/Makefile
-src/libspucc/Makefile
-src/libspucmml/Makefile
-src/libspudvb/Makefile
-src/libspuhdmv/Makefile
-src/libsputext/Makefile
src/libw32dll/Makefile
src/libw32dll/wine/Makefile
src/libw32dll/DirectShow/Makefile
src/libw32dll/dmo/Makefile
src/libw32dll/qtx/Makefile
src/libw32dll/qtx/qtxsdk/Makefile
-src/libxinevdec/Makefile
-src/libxineadec/Makefile
-src/libxineadec/gsm610/Makefile
-src/libxineadec/nosefart/Makefile
src/libreal/Makefile
src/post/Makefile
src/post/planar/Makefile
@@ -2861,19 +1278,19 @@ src/post/visualizations/Makefile
src/post/audio/Makefile
src/post/deinterlace/Makefile
src/post/deinterlace/plugins/Makefile
+src/spu_dec/Makefile
+src/video_dec/Makefile
+src/video_dec/libmpeg2/Makefile
+src/video_dec/libmpeg2new/Makefile
+src/video_dec/libmpeg2new/include/Makefile
+src/video_dec/libmpeg2new/libmpeg2/Makefile
+src/video_dec/libvdpau/Makefile
src/video_out/Makefile
-src/video_out/libdha/Makefile
-src/video_out/libdha/bin/Makefile
-src/video_out/libdha/kernelhelper/Makefile
-src/video_out/libdha/oth/Makefile
-src/video_out/libdha/sysdep/Makefile
src/video_out/macosx/Makefile
-src/video_out/vidix/Makefile
-src/video_out/vidix/drivers/Makefile
src/xine-utils/Makefile
src/xine-engine/Makefile
-win32/Makefile
-win32/include/Makefile])
+src/vdr/Makefile
+win32/Makefile])
AC_CONFIG_COMMANDS([default],[[chmod +x ./misc/SlackBuild ./misc/build_rpms.sh ./misc/relchk.sh]],[[]])
AC_OUTPUT
@@ -2904,7 +1321,11 @@ dnl It disables multi-pass compilation of xine-list.
dnl ---------------------------------------------
dnl Note: Brackets [] must be doubled as they are treated as m4 macro quotes.
-cat libtool | sed -e '/sys_lib_search_path_spec=/s/\/\([[ "]]\)/\1/g' > libtool.tmp
+if test x"$enable_macosx_universal" = x"no"; then
+ cat libtool | sed -e '/sys_lib_search_path_spec=/s/\/\([[ "]]\)/\1/g' > libtool.tmp
+else
+ cat libtool | sed -e 's,sys_lib_search_path_spec=.*$,sys_lib_search_path_spec=\"/Developer/SDKs/MacOSX10.4u.sdk/usr/lib\",' > libtool.tmp
+fi
mv -f libtool.tmp libtool
dnl removing make-specific variable
@@ -2913,486 +1334,4 @@ mv -f libtool.tmp libtool
chmod +x libtool
-dnl ---------------------------------------------
-dnl Libtool flag for Windows:
-dnl
-dnl The "-no-undefined" flag must be added after all other
-dnl configure checks, because it is only for libtool and
-dnl must not be passed to GCC by accident.
-dnl ---------------------------------------------
-case "$host_os" in
- mingw* | cygwin*)
- LDFLAGS="-no-undefined $LDFLAGS"
- ;;
-esac
-
-dnl ---------------------------------------------
-dnl Some infos:
-dnl ---------------------------------------------
-
-echo "xine-lib summary:"
-echo "----------------"
-
-dnl Input
-echo " * input plugins:"
-echo " - file - net"
-echo " - stdin_fifo - rtp"
-echo " - http - mms"
-echo " - pnm - rtsp"
-if test "$have_supported_dvb" = yes; then
- echo " - dvb"
-fi
-if test "x$external_dvdnav" = "xyes"; then
- echo " - dvd (external libs)"
-else
- echo " - dvd (internal libs)"
-fi
-if test "x$have_cdrom_ioctls" = "xyes"; then
- if test "x$enable_vcd" = "xyes"; then
- if test "x$internal_vcdnav" = "xno"; then
- echo " - vcd (external libs)"
- else
- echo " - vcd (internal libs)"
- fi
- fi
- echo " - vcdo"
- echo " - cdda"
-fi
-if test "x$no_gnome_vfs" = "xno"; then
- echo " - gnome-vfs"
-fi
-if test "x$have_v4l" = "xyes"; then
- echo " - v4l"
-fi
-if test "x$have_v4l2" = "xyes"; then
- echo " - v4l2"
-fi
-if test "x$have_libsmbclient" = "xyes"; then
- echo " - smbclient"
-fi
-if test "x$have_libbluray" = x"yes"; then
- echo " - bluray"
-fi
-echo ""
-
-dnl Demuxers
-echo " * demultiplexer plugins:"
-echo " - avi - mpeg"
-echo " - mpeg_block - mpeg_audio"
-echo " - mpeg_elem - mpeg_pes"
-echo " - mpeg_ts - qt/mpeg-4"
-echo " - film - roq"
-echo " - fli - smjpeg"
-echo " - idcin - wav"
-echo " - wc3 mve - voc"
-echo " - vqa - aiff"
-echo " - cdda - snd/au"
-echo " - yuv4mpeg2 - real/realaudio"
-echo " - ea wve - raw dv"
-echo " - interplay mve - psx str"
-echo " - ws aud - pva"
-echo " - vox"
-echo " - nsv - 4xm"
-echo " - FLAC - aac"
-echo " - iff - matroska"
-echo " - vmd - flv"
-if test "x$enable_asf" = "xyes"; then
- echo " - asf"
-fi
-if test "x$enable_nosefart" != "xno"; then
- echo " - nsf"
-fi
-if test "x$have_vorbis" = "xyes"; then
- echo " - ogg"
-fi
-if test "x$have_libmng" = "xyes"; then
- echo " - mng"
-fi
-if test "x$enable_modplug" != x"no"; then
- echo " - mod"
-fi
-if test "x$have_libflac" = "xyes"; then
- echo " - FLAC (with libFLAC)"
-fi
-if test "x$have_wavpack" = "xyes"; then
- echo " - WavPack"
-fi
-if test "x$enable_a52dec" = "xyes"; then
- if test "x$have_a52" = "xyes"; then
- echo " - ac3 (external library)"
- else
- echo " - ac3 (internal library)"
- fi
-fi
-echo ""
-
-dnl video decoders
-echo " * video decoder plugins:"
-echo " - MPEG 1,2 - Amiga Bitplane"
-echo " - Raw RGB - Raw YUV"
-if test "x$with_external_ffmpeg" = "xyes"; then
- echo " - ffmpeg (external library):"
-else
- echo " - ffmpeg (internal library):"
-fi
-echo " - MPEG-4 (ISO, Microsoft, DivX*, XviD)"
-echo " - Creative YUV - Motion JPEG"
-echo " - Cinepak - MS Video-1"
-echo " - FLI/FLC - MS RLE"
-echo " - Id RoQ - Id Cin"
-echo " - Apple Graphics - Apple Video"
-echo " - Apple Animation - Interplay Video"
-echo " - Westwood VQA - Origin Xan"
-echo " - H.263 - Intel Indeo 3"
-echo " - SVQ1 - SVQ3"
-echo " - Real Video 1.0 - Real Video 2.0"
-echo " - 4X Video - Sierra Video"
-echo " - Asus v1/v2 - HuffYUV"
-echo " - On2 VP3 - DV"
-echo " - 8BPS - Duck TrueMotion v1"
-echo " - ATI VCR1 - Flash Video"
-echo " - ZLIB - MSZH"
-if test "x$have_dxr3" = "xyes"; then
- echo " - dxr3_video"
-fi
-if test "x$enable_w32dll" = "xyes"; then
- echo " - w32dll"
-fi
-if test "x$have_imagemagick" = "xyes"; then
- echo " - image"
-fi
-if test x"no_gdkpixbuf" != "xyes"; then
- echo " - gdk-pixbuf"
-fi
-if test "x$have_theora" = "xyes"; then
- echo " - theora"
-fi
-echo ""
-
-dnl audio decoders
-echo " * audio decoder plugins:"
-echo " - GSM 06.10 - linear PCM"
-if test "x$with_external_ffmpeg" = "xyes"; then
- echo " - ffmpeg (external library):"
- echo " - Windows Media Audio v1/v2/Pro"
-else
- echo " - ffmpeg (internal library):"
- echo " - Windows Media Audio v1/v2"
-fi
-echo " - Windows Media Audio v1/v2/Pro"
-echo " - DV - logarithmic PCM"
-echo " - 14k4 - 28k8"
-echo " - MS ADPCM - IMA ADPCM"
-echo " - XA ADPCM - Game DPCM/ADPCM"
-echo " - Mace 3:13 - Mace 6:1"
-echo " - FLAC"
-echo " - E-AC-3"
-echo " - AAC LATM"
-if test "x$enable_nosefart" != "xno"; then
- echo " - Nosefart (NSF)"
-fi
-if test "x$have_libflac" = "xyes"; then
- echo " - FLAC (with libFLAC)"
-fi
-if test "x$have_vorbis" = "xyes"; then
- echo " - vorbis"
-fi
-if test "x$have_speex" = "xyes"; then
- echo " - speex"
-fi
-if test "x$enable_w32dll" = "xyes"; then
- echo " - w32dll"
-fi
-if test "x$enable_faad" = "xyes"; then
- echo " - faad"
-fi
-if test "x$enable_libmad" = "xyes"; then
- if test "x$have_mad" = "xyes"; then
- echo " - MAD (MPG 1/2/3) (external library)"
- else
- echo " - MAD (MPG 1/2/3) (internal library)"
- fi
-fi
-if test "x$enable_libdts" = "xyes"; then
- if test "x$have_dts" = "xyes"; then
- echo " - DTS (external library)"
- else
- echo " - DTS (internal library)"
- fi
-fi
-if test "x$enable_a52dec" = "xyes"; then
- if test "x$have_a52" = "xyes"; then
- echo " - A52/ra-dnet (external library)"
- else
- echo " - A52/ra-dnet (internal library)"
- fi
-fi
-if test "x$enable_musepack" != "xno"; then
- if test "x$have_mpcdec" = "xyes"; then
- echo " - MusePack (external library)"
- else
- echo " - MusePack (internal library)"
- fi
-fi
-if test "x$have_wavpack" = "xyes"; then
- echo " - WavPack"
-fi
-echo ""
-
-dnl spu decoders
-echo " * subtitle decoder plugins:"
-echo " - spu - spucc"
-echo " - spucmml - sputext"
-echo " - spudvb"
-if test "x$have_dxr3" = "xyes"; then
- echo " - dxr3_spu"
-fi
-echo ""
-
-dnl post plugins
-echo " * post effect plugins:"
-echo " * planar video effects:"
-echo " - invert - expand"
-echo " - eq - eq2"
-echo " - boxblur - denoise3d"
-echo " - unsharp - tvtime"
-echo " * SFX:"
-echo " - goom - oscope"
-echo " - fftscope - mosaico"
-echo ""
-
-dnl Video plugins
-echo " * video driver plugins:"
-if test "x$no_x" != "xyes"; then
- echo " - XShm (X11 shared memory)"
- dnl synfb
- if test "x$enable_syncfb" != "xno"; then
- echo " - SyncFB (for Matrox G200/G400 cards)"
- fi
- dnl Xv
- if test "x$ac_have_xv" = "xyes"; then
- if test "x$ac_have_xv_static" = "xyes"; then
- echo " - Xv (XVideo *static*)"
- else
- echo " - Xv (XVideo *shared*)"
- fi
- fi
- dnl XxMC
- if test "x$ac_have_xxmc" = "xyes"; then
- if test "x$ac_have_vldxvmc_h" = "xyes"; then
- echo " - XxMC (XVideo extended motion compensation)"
- else
- echo " - XxMC (XVideo motion compensation - vld extensions DISABLED)"
- fi
- fi
- dnl XvMC
- if test "x$ac_have_xvmc" = "xyes"; then
- echo " - XvMC (XVideo motion compensation)"
- fi
- if test "x$ac_have_opengl" = "xyes" -a "x$ac_have_glut" = "xyes" -o \
- "x$ac_have_opengl" = "xyes" -a "x$ac_have_glu" = "xyes"; then
- echo " - OpenGL"
- fi
- if test "x$ac_have_sunfb" = "xyes"; then
- if test "x$ac_have_sundga" = "xyes"; then
- echo " - PGX64 (for Sun XVR100/PGX64/PGX24 cards)"
- echo " - PGX32 (for Sun PGX32 cards)"
- fi
- fi
-fi
-if test "x$have_xcb" = "xyes"; then
- dnl xcb-shm
- if test "x$have_xcbshm" = "xyes"; then
- echo " - xcb-shm (X shared memory using XCB)"
- fi
- dnl xcb-xv
- if test "x$have_xcbxv" = "xyes"; then
- echo " - xcb-xv (XVideo using XCB)"
- fi
-fi
-if test "x$no_aalib" != "xyes"; then
- echo " - aa (Ascii ART)"
-fi
-if test "x$have_caca" = "xyes"; then
- echo " - caca (Color AsCii Art)"
-fi
-if test "x$have_fb" = "xyes"; then
- echo " - fb (Linux framebuffer device)"
-fi
-if test "x$have_sdl" = "xyes"; then
- echo " - sdl (Simple DirectMedia Layer)"
-fi
-if test "x$have_libstk" = "xyes"; then
- echo " - stk (Libstk Set-top Toolkit)"
-fi
-if test "x$have_directfb" = "xyes"; then
- echo " - directfb (DirectFB driver)"
-fi
-if test "x$have_dxr3" = "xyes"; then
- if test "x$have_encoder" = "xyes"; then
- echo " - dxr3 (Hollywood+ and Creative dxr3, both mpeg and non-mpeg video)"
- else
- echo " - dxr3 (Hollywood+ and Creative dxr3, mpeg video only)"
- fi
-fi
-if test "x$enable_vidix" = "xyes"; then
- echo $ECHO_N " - vidix ("
-
- if test "x$no_x" != "xyes"; then
- echo $ECHO_N "X11"
- if test "x$have_fb" = "xyes"; then
- echo $ECHO_N " and "
- fi
- fi
-
- if test "x$have_fb" = "xyes"; then
- echo $ECHO_N "framebuffer"
- fi
-
- echo $ECHO_N " support"
-
- if test "x$enable_dha_kmod" = "xyes"; then
- echo " with dhahelper)"
- else
- echo ")"
- fi
-fi
-if test "x$have_directx" = "xyes"; then
- echo " - directx (DirectX video driver)"
-fi
-if test "x$have_macosx_video" = "xyes"; then
- echo " - Mac OS X OpenGL"
-fi
-
-echo ""
-
-dnl Audio plugins
-echo " * audio driver plugins:"
-if test "x$have_ossaudio" = "xyes"; then
- echo " - oss (Open Sound System)"
-fi
-if test "x$have_alsa" = "xyes"; then
- echo " - alsa"
-fi
-if test "x$have_esound" = "xyes"; then
- echo " - esd (Enlightened Sound Daemon)"
-fi
-if test "x$no_arts" != "xyes"; then
- echo " - arts (aRts - KDE soundserver)"
-fi
-if test "x$no_fusionsound" != "xyes"; then
- echo " - fusionsound (FusionSound driver)"
-fi
-if test "x$have_sunaudio" = "xyes"; then
- echo " - sun ()"
-fi
-if test "x$am_cv_have_irixal" = xyes; then
- echo " - irixal (Irix audio library)"
-fi
-if test "x$have_directx" = "xyes"; then
- echo " - directx (DirectX audio driver)"
-fi
-if test "x$have_coreaudio" = "xyes"; then
- echo " - CoreAudio (Mac OS X audio driver)"
-fi
-if test "x$have_pulseaudio" = "xyes"; then
- echo " - pulseaudio sound server"
-fi
-if test "x$have_jack" = "xyes"; then
- echo " - Jack"
-fi
-if test "x$have_sndio" = "xyes"; then
- echo " - sndio"
-fi
-echo "---"
-
-
-dnl ---------------------------------------------
-dnl some user warnings
-dnl ---------------------------------------------
-
-dnl some levels of variable expansion to get final install paths
-final_libdir="`eval eval eval eval echo $libdir`"
-final_bindir="`eval eval eval eval echo $bindir`"
-
-if test -r /etc/ld.so.conf && ! grep -x "$final_libdir" /etc/ld.so.conf >/dev/null ; then
- if test "$final_libdir" != "/lib" -a "$final_libdir" != "/usr/lib" ; then
- if ! echo "$LD_LIBRARY_PATH" | egrep "(:|^)$final_libdir(/?:|/?$)" >/dev/null ; then
- echo
- echo "****************************************************************"
- echo "xine-lib will be installed to $final_libdir"
- echo
- echo "This path is not mentioned among the linker search paths in your"
- echo "/etc/ld.so.conf. This means it is possible that xine-lib will"
- echo "not be found when you try to compile or run a program using it."
- echo "If this happens, you should add $final_libdir to"
- echo "the environment variable LD_LIBRARY_PATH like that:"
- echo
- echo "export LD_LIBRARY_PATH=$final_libdir:\$LD_LIBRARY_PATH"
- echo
- echo "Alternatively you can add a line \"$final_libdir\""
- echo "to your /etc/ld.so.conf."
- echo "****************************************************************"
- echo
- fi
- fi
-fi
-
-if ! echo "$PATH" | egrep "(:|^)$final_bindir(/?:|/?$)" >/dev/null ; then
- echo
- echo "****************************************************************"
- echo "xine-config will be installed to $final_bindir"
- echo
- echo "This path is not in your search path. This means it is possible"
- echo "that xine-config will not be found when you try to compile a"
- echo "program using xine-lib. This will result in build failures."
- echo "If this happens, you should add $final_bindir to"
- echo "the environment variable PATH like that:"
- echo
- echo "export PATH=$final_bindir:\$PATH"
- echo
- echo "Note that this is only needed for compilation. It is not needed"
- echo "to have xine-config in your search path at runtime. (Although"
- echo "it will not cause any harm either.)"
- echo "****************************************************************"
- echo
-fi
-
-dnl warn if no X11 plugins will be built
-if test "x$no_x" = "xyes"; then
- case $host in
- *mingw*|*-cygwin) ;;
- *-darwin*) ;;
- *)
- echo
- echo "****************************************************************"
- echo "WARNING! No X11 output plugins will be built."
- echo
- echo "For some reason, the requirements for building the X11 video"
- echo "output plugins are not met. That means, that you will NOT be"
- echo "able to use the resulting xine-lib to watch videos in a window"
- echo "on any X11-based display (e.g. your desktop)."
- echo
- echo "If this is not what you want, provide the necessary X11 build"
- echo "dependencies (usually done by installing a package called"
- echo "XFree86-devel or similar) and run configure again."
- echo "****************************************************************"
- echo
- ;;
- esac
-fi
-
-dnl warn if internal ffmpeg is being used
-if test "x$with_external_ffmpeg" = "xno"; then
- AC_MSG_NOTICE([
-*********************************************************************
-xine-lib is configured to use internal ffmpeg.
-
-This copy of ffmpeg is old and has known security problems.
-Don't use it. We don't want you to. We only care that xine-lib is
-compilable with it; beyond that, you're completely on your own.
-
-You are STRONGLY advised to install a newer version (including
-development files) and to reconfigure xine-lib to use it.
-*********************************************************************])
-fi
+XINE_LIB_SUMMARY
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 000000000..d8866a3cf
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1,20 @@
+include $(top_srcdir)/misc/Makefile.quiet
+SUBDIRS = libmpcdec libxdg-basedir libdca nosefart gsm610 libmad a52dec \
+ libfaad
+
+
+if BUILD_DHA_KMOD
+SUBDIRS += libdha
+endif
+
+# vidix depends on portions of dha
+if ENABLE_VIDIX
+if !BUILD_DHA_KMOD
+SUBDIRS += libdha
+endif
+SUBDIRS += vidix
+endif
+
+srcdir = $(shell cd @srcdir@; pwd)
+
+EXTRA_DIST = README.contrib
diff --git a/contrib/README.contrib b/contrib/README.contrib
new file mode 100644
index 000000000..77ea66baa
--- /dev/null
+++ b/contrib/README.contrib
@@ -0,0 +1,22 @@
+The contrib/ subdirectory for xine-lib contains the code for libraries
+that are not developed by the xine project, but are rather imported
+from other projects.
+
+These libraries are imported either because they need to be patched to
+fix bugs not yet fixed in any released version, to make it simpler for
+the users to have the library installed, or because there's no proper
+release done by that project.
+
+This README file should explain how to upgrade the code present in the
+contrib/ directory with new sources from the development project.
+
+libxdg-basedir
+--------------
+
+The libxdg-basedir project is a (really) small library used to provide
+the proper access to XDG directories as described by the XDG Base
+Directory Specification (0.6 version).
+
+The library can be found at
+https://n.ethz.ch/student/nevillm/download/libxdg-basedir/ , and it's
+imported in xine-lib as it's far from commonly found on distributions.
diff --git a/contrib/a52dec/Makefile.am b/contrib/a52dec/Makefile.am
new file mode 100644
index 000000000..d43188b4c
--- /dev/null
+++ b/contrib/a52dec/Makefile.am
@@ -0,0 +1,13 @@
+include $(top_srcdir)/misc/Makefile.quiet
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+if ENABLE_A52DEC
+if !WITH_EXTERNAL_A52DEC
+noinst_LTLIBRARIES = liba52.la
+endif
+endif
+
+liba52_la_SOURCES = bitstream.c bit_allocate.c downmix.c imdct.c parse.c \
+ a52.h a52_internal.h bitstream.h tables.h crc.c
+liba52_la_LIBADD = -lm $(AVUTIL_LIBS)
+liba52_la_CPPFLAGS = $(AM_CPPFLAGS) $(AVUTIL_CFLAGS)
diff --git a/src/liba52/a52.h b/contrib/a52dec/a52.h
index 9db52ccf8..9db52ccf8 100644
--- a/src/liba52/a52.h
+++ b/contrib/a52dec/a52.h
diff --git a/src/liba52/a52_internal.h b/contrib/a52dec/a52_internal.h
index 541d94803..541d94803 100644
--- a/src/liba52/a52_internal.h
+++ b/contrib/a52dec/a52_internal.h
diff --git a/contrib/a52dec/bit_allocate.c b/contrib/a52dec/bit_allocate.c
new file mode 100644
index 000000000..0567b2285
--- /dev/null
+++ b/contrib/a52dec/bit_allocate.c
@@ -0,0 +1,265 @@
+/*
+ * 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/contrib/a52dec/bitstream.c b/contrib/a52dec/bitstream.c
new file mode 100644
index 000000000..04e8ca6d0
--- /dev/null
+++ b/contrib/a52dec/bitstream.c
@@ -0,0 +1,95 @@
+/*
+ * 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/contrib/a52dec/bitstream.h b/contrib/a52dec/bitstream.h
new file mode 100644
index 000000000..f242c37c4
--- /dev/null
+++ b/contrib/a52dec/bitstream.h
@@ -0,0 +1,81 @@
+/*
+ * 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/contrib/a52dec/crc.c b/contrib/a52dec/crc.c
new file mode 100644
index 000000000..38254c9ef
--- /dev/null
+++ b/contrib/a52dec/crc.c
@@ -0,0 +1,73 @@
+/*
+ * 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/contrib/a52dec/diff_against_release.patch
index d7f7ff2f2..d7f7ff2f2 100644
--- a/src/liba52/diff_against_release.patch
+++ b/contrib/a52dec/diff_against_release.patch
diff --git a/src/liba52/downmix.c b/contrib/a52dec/downmix.c
index b9ac1fdea..b9ac1fdea 100644
--- a/src/liba52/downmix.c
+++ b/contrib/a52dec/downmix.c
diff --git a/contrib/a52dec/imdct.c b/contrib/a52dec/imdct.c
new file mode 100644
index 000000000..aa1c85464
--- /dev/null
+++ b/contrib/a52dec/imdct.c
@@ -0,0 +1,431 @@
+/*
+ * 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 <xine/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/contrib/a52dec/parse.c b/contrib/a52dec/parse.c
new file mode 100644
index 000000000..0717621e1
--- /dev/null
+++ b/contrib/a52dec/parse.c
@@ -0,0 +1,897 @@
+/*
+ * 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 <xine/xineutils.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
+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 = calloc(1, sizeof (a52_state_t));
+ if (state == NULL)
+ return NULL;
+
+ state->samples_base = state->samples = av_mallocz (256 * 12 * sizeof (sample_t));
+
+ if (state->samples == NULL) {
+ free (state);
+ return NULL;
+ }
+
+ 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/contrib/a52dec/tables.h
index a35543db7..a35543db7 100644
--- a/src/liba52/tables.h
+++ b/contrib/a52dec/tables.h
diff --git a/contrib/gsm610/Makefile.am b/contrib/gsm610/Makefile.am
new file mode 100644
index 000000000..e879170e8
--- /dev/null
+++ b/contrib/gsm610/Makefile.am
@@ -0,0 +1,27 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+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
+
+
+noinst_HEADERS = \
+ gsm_config.h \
+ gsm.h \
+ private.h \
+ proto.h \
+ unproto.h
diff --git a/src/libxineadec/gsm610/add.c b/contrib/gsm610/add.c
index cd4b5dd3b..cd4b5dd3b 100644
--- a/src/libxineadec/gsm610/add.c
+++ b/contrib/gsm610/add.c
diff --git a/src/libxineadec/gsm610/decode.c b/contrib/gsm610/decode.c
index 66dcab665..66dcab665 100644
--- a/src/libxineadec/gsm610/decode.c
+++ b/contrib/gsm610/decode.c
diff --git a/src/libxineadec/gsm610/gsm.h b/contrib/gsm610/gsm.h
index 34ad8f7a5..34ad8f7a5 100644
--- a/src/libxineadec/gsm610/gsm.h
+++ b/contrib/gsm610/gsm.h
diff --git a/src/libxineadec/gsm610/gsm_config.h b/contrib/gsm610/gsm_config.h
index a40004221..a40004221 100644
--- a/src/libxineadec/gsm610/gsm_config.h
+++ b/contrib/gsm610/gsm_config.h
diff --git a/src/libxineadec/gsm610/gsm_create.c b/contrib/gsm610/gsm_create.c
index df80758f0..df80758f0 100644
--- a/src/libxineadec/gsm610/gsm_create.c
+++ b/contrib/gsm610/gsm_create.c
diff --git a/src/libxineadec/gsm610/gsm_decode.c b/contrib/gsm610/gsm_decode.c
index 849818c14..849818c14 100644
--- a/src/libxineadec/gsm610/gsm_decode.c
+++ b/contrib/gsm610/gsm_decode.c
diff --git a/src/libxineadec/gsm610/gsm_destroy.c b/contrib/gsm610/gsm_destroy.c
index 481a74660..481a74660 100644
--- a/src/libxineadec/gsm610/gsm_destroy.c
+++ b/contrib/gsm610/gsm_destroy.c
diff --git a/contrib/gsm610/long_term.c b/contrib/gsm610/long_term.c
new file mode 100644
index 000000000..578483927
--- /dev/null
+++ b/contrib/gsm610/long_term.c
@@ -0,0 +1,964 @@
+/*
+ * 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 $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <xine/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/contrib/gsm610/lpc.c b/contrib/gsm610/lpc.c
new file mode 100644
index 000000000..04a54d781
--- /dev/null
+++ b/contrib/gsm610/lpc.c
@@ -0,0 +1,354 @@
+/*
+ * 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 $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <xine/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/contrib/gsm610/private.h
index 33a5172b0..33a5172b0 100644
--- a/src/libxineadec/gsm610/private.h
+++ b/contrib/gsm610/private.h
diff --git a/src/libxineadec/gsm610/proto.h b/contrib/gsm610/proto.h
index a80ebf9e4..a80ebf9e4 100644
--- a/src/libxineadec/gsm610/proto.h
+++ b/contrib/gsm610/proto.h
diff --git a/contrib/gsm610/rpe.c b/contrib/gsm610/rpe.c
new file mode 100644
index 000000000..2f8f79bbb
--- /dev/null
+++ b/contrib/gsm610/rpe.c
@@ -0,0 +1,493 @@
+/*
+ * 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 $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <xine/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/contrib/gsm610/short_term.c b/contrib/gsm610/short_term.c
new file mode 100644
index 000000000..e1d8c9afe
--- /dev/null
+++ b/contrib/gsm610/short_term.c
@@ -0,0 +1,432 @@
+/*
+ * 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 $ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <xine/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/contrib/gsm610/table.c
index 797685c07..797685c07 100644
--- a/src/libxineadec/gsm610/table.c
+++ b/contrib/gsm610/table.c
diff --git a/src/libxineadec/gsm610/unproto.h b/contrib/gsm610/unproto.h
index f49530c22..f49530c22 100644
--- a/src/libxineadec/gsm610/unproto.h
+++ b/contrib/gsm610/unproto.h
diff --git a/contrib/libdca/COPYING b/contrib/libdca/COPYING
new file mode 100644
index 000000000..d511905c1
--- /dev/null
+++ b/contrib/libdca/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/contrib/libdca/Makefile.am b/contrib/libdca/Makefile.am
new file mode 100644
index 000000000..33b775086
--- /dev/null
+++ b/contrib/libdca/Makefile.am
@@ -0,0 +1,17 @@
+include $(top_srcdir)/misc/Makefile.quiet
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+EXTRA_DIST = COPYING
+
+if ENABLE_DTS
+if !WITH_EXTERNAL_LIBDTS
+noinst_LTLIBRARIES = libdca.la
+endif
+endif
+
+libdca_la_SOURCES = dca_internal.h tables.h tables_quantization.h \
+ tables_huffman.h tables_fir.h tables_adpcm.h tables_vq.h \
+ bitstream.h bitstream.c parse.c downmix.c \
+ include/dca.h include/dts.h
+libdca_la_LIBADD = -lm
+libdca_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/include
diff --git a/contrib/libdca/bitstream.c b/contrib/libdca/bitstream.c
new file mode 100644
index 000000000..b92714868
--- /dev/null
+++ b/contrib/libdca/bitstream.c
@@ -0,0 +1,112 @@
+/*
+ * 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 libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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 "config.h"
+
+#include <inttypes.h>
+
+#include "dca.h"
+#include "dca_internal.h"
+#include "bitstream.h"
+
+#define BUFFER_SIZE 4096
+
+void dca_bitstream_init (dca_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 *) ((uintptr_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 (dca_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 dca_bitstream_get_bh (dca_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/contrib/libdca/bitstream.h b/contrib/libdca/bitstream.h
new file mode 100644
index 000000000..4bce80aab
--- /dev/null
+++ b/contrib/libdca/bitstream.h
@@ -0,0 +1,68 @@
+/*
+ * 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 libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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 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)\
+((((uint32_t)x) >> 16) | (((uint32_t)x) << 16))
+
+#endif
+
+void dca_bitstream_init (dca_state_t * state, uint8_t * buf, int word_mode,
+ int endian_mode);
+uint32_t dca_bitstream_get_bh (dca_state_t * state, uint32_t num_bits);
+
+static inline uint32_t bitstream_get (dca_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 dca_bitstream_get_bh (state, num_bits);
+}
diff --git a/contrib/libdca/dca_internal.h b/contrib/libdca/dca_internal.h
new file mode 100644
index 000000000..2c43cf049
--- /dev/null
+++ b/contrib/libdca/dca_internal.h
@@ -0,0 +1,204 @@
+/*
+ * dca_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 libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+#define DCA_SUBFRAMES_MAX (16)
+#define DCA_PRIM_CHANNELS_MAX (5)
+#define DCA_SUBBANDS (32)
+#define DCA_ABITS_MAX (32) /* Should be 28 */
+#define DCA_SUBSUBFAMES_MAX (4)
+#define DCA_LFE_MAX (3)
+
+struct dca_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[DCA_PRIM_CHANNELS_MAX];
+ /* high frequency vq start subband */
+ int vq_start_subband[DCA_PRIM_CHANNELS_MAX];
+ /* joint intensity coding index */
+ int joint_intensity[DCA_PRIM_CHANNELS_MAX];
+ /* transient mode code book */
+ int transient_huffman[DCA_PRIM_CHANNELS_MAX];
+ /* scale factor code book */
+ int scalefactor_huffman[DCA_PRIM_CHANNELS_MAX];
+ /* bit allocation quantizer select */
+ int bitalloc_huffman[DCA_PRIM_CHANNELS_MAX];
+ /* quantization index codebook select */
+ int quant_index_huffman[DCA_PRIM_CHANNELS_MAX][DCA_ABITS_MAX];
+ /* scale factor adjustment */
+ float scalefactor_adj[DCA_PRIM_CHANNELS_MAX][DCA_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[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
+ /* prediction VQ coefs */
+ int prediction_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
+ /* bit allocation index */
+ int bitalloc[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
+ /* transition mode (transients) */
+ int transition_mode[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
+ /* scale factors (2 if transient)*/
+ int scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][2];
+ /* joint subband scale factors codebook */
+ int joint_huff[DCA_PRIM_CHANNELS_MAX];
+ /* joint subband scale factors */
+ int joint_scale_factor[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
+ /* stereo downmix coefficients */
+ int downmix_coef[DCA_PRIM_CHANNELS_MAX][2];
+ /* dynamic range coefficient */
+ int dynrange_coef;
+
+ /* VQ encoded high frequency subbands */
+ int high_freq_vq[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS];
+
+ /* Low frequency effect data */
+ double lfe_data[2*DCA_SUBSUBFAMES_MAX*DCA_LFE_MAX * 2 /*history*/];
+ int lfe_scale_factor;
+
+ /* Subband samples history (for ADPCM) */
+ double subband_samples_hist[DCA_PRIM_CHANNELS_MAX][DCA_SUBBANDS][4];
+ double subband_fir_hist[DCA_PRIM_CHANNELS_MAX][512];
+ double subband_fir_noidea[DCA_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 dca_downmix_init (int input, int flags, level_t * level,
+ level_t clev, level_t slev);
+int dca_downmix_coeff (level_t * coeff, int acmod, int output, level_t level,
+ level_t clev, level_t slev);
+void dca_downmix (sample_t * samples, int acmod, int output, sample_t bias,
+ level_t clev, level_t slev);
+void dca_upmix (sample_t * samples, int acmod, int output);
+
+#define ROUND(x) ((int)((x) + ((x) > 0 ? 0.5 : -0.5)))
+
+#ifndef LIBDCA_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 /* LIBDCA_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/contrib/libdca/downmix.c b/contrib/libdca/downmix.c
new file mode 100644
index 000000000..ff02127f4
--- /dev/null
+++ b/contrib/libdca/downmix.c
@@ -0,0 +1,694 @@
+/*
+ * 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 libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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 "config.h"
+
+#include <string.h>
+#include <inttypes.h>
+
+#include "dca.h"
+#include "dca_internal.h"
+
+#define CONVERT(acmod,output) (((output) << DCA_CHANNEL_BITS) + (acmod))
+
+int dca_downmix_init (int input, int flags, level_t * level,
+ level_t clev, level_t slev)
+{
+ static uint8_t table[11][10] = {
+ /* DCA_MONO */
+ {DCA_MONO, DCA_MONO, DCA_MONO, DCA_MONO,
+ DCA_MONO, DCA_MONO, DCA_MONO, DCA_MONO,
+ DCA_MONO, DCA_MONO},
+ /* DCA_CHANNEL */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO},
+ /* DCA_STEREO */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO},
+ /* DCA_STEREO_SUMDIFF */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO},
+ /* DCA_STEREO_TOTAL */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO},
+ /* DCA_3F */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_3F, DCA_3F, DCA_3F,
+ DCA_3F, DCA_3F},
+ /* DCA_2F1R */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_2F1R, DCA_2F1R, DCA_2F1R,
+ DCA_2F1R, DCA_2F1R},
+ /* DCA_3F1R */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_3F, DCA_3F1R, DCA_3F1R,
+ DCA_3F1R, DCA_3F1R},
+ /* DCA_2F2R */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_STEREO, DCA_2F2R, DCA_2F2R,
+ DCA_2F2R, DCA_2F2R},
+ /* DCA_3F2R */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_3F, DCA_3F2R, DCA_3F2R,
+ DCA_3F2R, DCA_3F2R},
+ /* DCA_4F2R */
+ {DCA_MONO, DCA_CHANNEL, DCA_STEREO, DCA_STEREO,
+ DCA_STEREO, DCA_4F2R, DCA_4F2R, DCA_4F2R,
+ DCA_4F2R, DCA_4F2R},
+ };
+ int output;
+
+ output = flags & DCA_CHANNEL_MASK;
+
+ if (output > DCA_CHANNEL_MAX)
+ return -1;
+
+ output = table[output][input];
+
+ if (output == DCA_STEREO &&
+ (input == DCA_DOLBY || (input == DCA_3F && clev == LEVEL (LEVEL_3DB))))
+ output = DCA_DOLBY;
+
+ if (flags & DCA_ADJUST_LEVEL) {
+ level_t adjust;
+
+ switch (CONVERT (input & 7, output)) {
+
+ case CONVERT (DCA_3F, DCA_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + clev);
+ break;
+
+ case CONVERT (DCA_STEREO, DCA_MONO):
+ case CONVERT (DCA_2F2R, DCA_2F1R):
+ case CONVERT (DCA_3F2R, DCA_3F1R):
+ level_3db:
+ adjust = LEVEL (LEVEL_3DB);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_2F1R):
+ if (clev < LEVEL (LEVEL_PLUS3DB - 1))
+ goto level_3db;
+ /* break thru */
+ case CONVERT (DCA_3F, DCA_STEREO):
+ case CONVERT (DCA_3F1R, DCA_2F1R):
+ case CONVERT (DCA_3F1R, DCA_2F2R):
+ case CONVERT (DCA_3F2R, DCA_2F2R):
+ adjust = DIV (1, LEVEL (1) + clev);
+ break;
+
+ case CONVERT (DCA_2F1R, DCA_MONO):
+ adjust = DIV (LEVEL_PLUS3DB, LEVEL (2) + slev);
+ break;
+
+ case CONVERT (DCA_2F1R, DCA_STEREO):
+ case CONVERT (DCA_3F1R, DCA_3F):
+ adjust = DIV (1, LEVEL (1) + MUL_C (slev, LEVEL_3DB));
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + MUL_C (slev, 0.5));
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_STEREO):
+ adjust = DIV (1, LEVEL (1) + clev + MUL_C (slev, LEVEL_3DB));
+ break;
+
+ case CONVERT (DCA_2F2R, DCA_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + slev);
+ break;
+
+ case CONVERT (DCA_2F2R, DCA_STEREO):
+ case CONVERT (DCA_3F2R, DCA_3F):
+ adjust = DIV (1, LEVEL (1) + slev);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_MONO):
+ adjust = DIV (LEVEL_3DB, LEVEL (1) + clev + slev);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_STEREO):
+ adjust = DIV (1, LEVEL (1) + clev + slev);
+ break;
+
+ case CONVERT (DCA_MONO, DCA_DOLBY):
+ adjust = LEVEL (LEVEL_PLUS3DB);
+ break;
+
+ case CONVERT (DCA_3F, DCA_DOLBY):
+ case CONVERT (DCA_2F1R, DCA_DOLBY):
+ adjust = LEVEL (1 / (1 + LEVEL_3DB));
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_DOLBY):
+ case CONVERT (DCA_2F2R, DCA_DOLBY):
+ adjust = LEVEL (1 / (1 + 2 * LEVEL_3DB));
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_DOLBY):
+ adjust = LEVEL (1 / (1 + 3 * LEVEL_3DB));
+ break;
+
+ default:
+ return output;
+ }
+
+ *level = MUL_L (*level, adjust);
+ }
+
+ return output;
+}
+
+int dca_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 & DCA_CHANNEL_MASK)) {
+
+ case CONVERT (DCA_CHANNEL, DCA_CHANNEL):
+ case CONVERT (DCA_MONO, DCA_MONO):
+ case CONVERT (DCA_STEREO, DCA_STEREO):
+ case CONVERT (DCA_3F, DCA_3F):
+ case CONVERT (DCA_2F1R, DCA_2F1R):
+ case CONVERT (DCA_3F1R, DCA_3F1R):
+ case CONVERT (DCA_2F2R, DCA_2F2R):
+ case CONVERT (DCA_3F2R, DCA_3F2R):
+ case CONVERT (DCA_STEREO, DCA_DOLBY):
+ coeff[0] = coeff[1] = coeff[2] = coeff[3] = coeff[4] = level;
+ return 0;
+
+ case CONVERT (DCA_CHANNEL, DCA_MONO):
+ coeff[0] = coeff[1] = MUL_C (level, LEVEL_6DB);
+ return 3;
+
+ case CONVERT (DCA_STEREO, DCA_MONO):
+ coeff[0] = coeff[1] = level_3db;
+ return 3;
+
+ case CONVERT (DCA_3F, DCA_MONO):
+ coeff[0] = coeff[2] = level_3db;
+ coeff[1] = MUL_C (MUL_L (level_3db, clev), LEVEL_PLUS6DB);
+ return 7;
+
+ case CONVERT (DCA_2F1R, DCA_MONO):
+ coeff[0] = coeff[1] = level_3db;
+ coeff[2] = MUL_L (level_3db, slev);
+ return 7;
+
+ case CONVERT (DCA_2F2R, DCA_MONO):
+ coeff[0] = coeff[1] = level_3db;
+ coeff[2] = coeff[3] = MUL_L (level_3db, slev);
+ return 15;
+
+ case CONVERT (DCA_3F1R, DCA_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 (DCA_3F2R, DCA_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 (DCA_MONO, DCA_DOLBY):
+ coeff[0] = level_3db;
+ return 0;
+
+ case CONVERT (DCA_3F, DCA_DOLBY):
+ coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
+ coeff[1] = level_3db;
+ return 7;
+
+ case CONVERT (DCA_3F, DCA_STEREO):
+ case CONVERT (DCA_3F1R, DCA_2F1R):
+ case CONVERT (DCA_3F2R, DCA_2F2R):
+ coeff[0] = coeff[2] = coeff[3] = coeff[4] = level;
+ coeff[1] = MUL_L (level, clev);
+ return 7;
+
+ case CONVERT (DCA_2F1R, DCA_DOLBY):
+ coeff[0] = coeff[1] = level;
+ coeff[2] = level_3db;
+ return 7;
+
+ case CONVERT (DCA_2F1R, DCA_STEREO):
+ coeff[0] = coeff[1] = level;
+ coeff[2] = MUL_L (level_3db, slev);
+ return 7;
+
+ case CONVERT (DCA_3F1R, DCA_DOLBY):
+ coeff[0] = coeff[2] = level;
+ coeff[1] = coeff[3] = level_3db;
+ return 15;
+
+ case CONVERT (DCA_3F1R, DCA_STEREO):
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = MUL_L (level_3db, slev);
+ return 15;
+
+ case CONVERT (DCA_2F2R, DCA_DOLBY):
+ coeff[0] = coeff[1] = level;
+ coeff[2] = coeff[3] = level_3db;
+ return 15;
+
+ case CONVERT (DCA_2F2R, DCA_STEREO):
+ coeff[0] = coeff[1] = level;
+ coeff[2] = coeff[3] = MUL_L (level, slev);
+ return 15;
+
+ case CONVERT (DCA_3F2R, DCA_DOLBY):
+ coeff[0] = coeff[2] = level;
+ coeff[1] = coeff[3] = coeff[4] = level_3db;
+ return 31;
+
+ case CONVERT (DCA_3F2R, DCA_2F1R):
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = coeff[4] = level_3db;
+ return 31;
+
+ case CONVERT (DCA_3F2R, DCA_STEREO):
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = coeff[4] = MUL_L (level, slev);
+ return 31;
+
+ case CONVERT (DCA_3F1R, DCA_3F):
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = MUL_L (level_3db, slev);
+ return 13;
+
+ case CONVERT (DCA_3F2R, DCA_3F):
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = coeff[4] = MUL_L (level, slev);
+ return 29;
+
+ case CONVERT (DCA_2F2R, DCA_2F1R):
+ coeff[0] = coeff[1] = level;
+ coeff[2] = coeff[3] = level_3db;
+ return 12;
+
+ case CONVERT (DCA_3F2R, DCA_3F1R):
+ coeff[0] = coeff[1] = coeff[2] = level;
+ coeff[3] = coeff[4] = level_3db;
+ return 24;
+
+ case CONVERT (DCA_2F1R, DCA_2F2R):
+ coeff[0] = coeff[1] = level;
+ coeff[2] = level_3db;
+ return 0;
+
+ case CONVERT (DCA_3F1R, DCA_2F2R):
+ coeff[0] = coeff[2] = level;
+ coeff[1] = MUL_L (level, clev);
+ coeff[3] = level_3db;
+ return 7;
+
+ case CONVERT (DCA_3F1R, DCA_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 dca_downmix (sample_t * samples, int acmod, int output, sample_t bias,
+ level_t clev, level_t slev)
+{
+ (void)clev;
+
+ switch (CONVERT (acmod, output & DCA_CHANNEL_MASK)) {
+
+ case CONVERT (DCA_CHANNEL, DCA_MONO):
+ case CONVERT (DCA_STEREO, DCA_MONO):
+ mix_2to1:
+ mix2to1 (samples, samples + 256, bias);
+ break;
+
+ case CONVERT (DCA_2F1R, DCA_MONO):
+ if (slev == 0)
+ goto mix_2to1;
+ case CONVERT (DCA_3F, DCA_MONO):
+ mix_3to1:
+ mix3to1 (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_MONO):
+ if (slev == 0)
+ goto mix_3to1;
+ case CONVERT (DCA_2F2R, DCA_MONO):
+ if (slev == 0)
+ goto mix_2to1;
+ mix4to1 (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_MONO):
+ if (slev == 0)
+ goto mix_3to1;
+ mix5to1 (samples, bias);
+ break;
+
+ case CONVERT (DCA_MONO, DCA_DOLBY):
+ memcpy (samples + 256, samples, 256 * sizeof (sample_t));
+ break;
+
+ case CONVERT (DCA_3F, DCA_STEREO):
+ case CONVERT (DCA_3F, DCA_DOLBY):
+ mix_3to2:
+ mix3to2 (samples, bias);
+ break;
+
+ case CONVERT (DCA_2F1R, DCA_STEREO):
+ if (slev == 0)
+ break;
+ mix21to2 (samples, samples + 256, bias);
+ break;
+
+ case CONVERT (DCA_2F1R, DCA_DOLBY):
+ mix21toS (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_STEREO):
+ if (slev == 0)
+ goto mix_3to2;
+ mix31to2 (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_DOLBY):
+ mix31toS (samples, bias);
+ break;
+
+ case CONVERT (DCA_2F2R, DCA_STEREO):
+ if (slev == 0)
+ break;
+ mix2to1 (samples, samples + 512, bias);
+ mix2to1 (samples + 256, samples + 768, bias);
+ break;
+
+ case CONVERT (DCA_2F2R, DCA_DOLBY):
+ mix22toS (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_STEREO):
+ if (slev == 0)
+ goto mix_3to2;
+ mix32to2 (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_DOLBY):
+ mix32toS (samples, bias);
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_3F):
+ if (slev == 0)
+ break;
+ mix21to2 (samples, samples + 512, bias);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_3F):
+ if (slev == 0)
+ break;
+ mix2to1 (samples, samples + 768, bias);
+ mix2to1 (samples + 512, samples + 1024, bias);
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_2F1R):
+ mix3to2 (samples, bias);
+ memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
+ break;
+
+ case CONVERT (DCA_2F2R, DCA_2F1R):
+ mix2to1 (samples + 512, samples + 768, bias);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_2F1R):
+ mix3to2 (samples, bias);
+ move2to1 (samples + 768, samples + 512, bias);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_3F1R):
+ mix2to1 (samples + 768, samples + 1024, bias);
+ break;
+
+ case CONVERT (DCA_2F1R, DCA_2F2R):
+ memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
+ break;
+
+ case CONVERT (DCA_3F1R, DCA_2F2R):
+ mix3to2 (samples, bias);
+ memcpy (samples + 512, samples + 768, 256 * sizeof (sample_t));
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_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 (DCA_3F1R, DCA_3F2R):
+ memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
+ break;
+ }
+}
+
+void dca_upmix (sample_t * samples, int acmod, int output)
+{
+ switch (CONVERT (acmod, output & DCA_CHANNEL_MASK)) {
+
+ case CONVERT (DCA_3F2R, DCA_MONO):
+ zero (samples + 1024);
+ case CONVERT (DCA_3F1R, DCA_MONO):
+ case CONVERT (DCA_2F2R, DCA_MONO):
+ zero (samples + 768);
+ case CONVERT (DCA_3F, DCA_MONO):
+ case CONVERT (DCA_2F1R, DCA_MONO):
+ zero (samples + 512);
+ case CONVERT (DCA_CHANNEL, DCA_MONO):
+ case CONVERT (DCA_STEREO, DCA_MONO):
+ zero (samples + 256);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_STEREO):
+ case CONVERT (DCA_3F2R, DCA_DOLBY):
+ zero (samples + 1024);
+ case CONVERT (DCA_3F1R, DCA_STEREO):
+ case CONVERT (DCA_3F1R, DCA_DOLBY):
+ zero (samples + 768);
+ case CONVERT (DCA_3F, DCA_STEREO):
+ case CONVERT (DCA_3F, DCA_DOLBY):
+ mix_3to2:
+ memcpy (samples + 512, samples + 256, 256 * sizeof (sample_t));
+ zero (samples + 256);
+ break;
+
+ case CONVERT (DCA_2F2R, DCA_STEREO):
+ case CONVERT (DCA_2F2R, DCA_DOLBY):
+ zero (samples + 768);
+ case CONVERT (DCA_2F1R, DCA_STEREO):
+ case CONVERT (DCA_2F1R, DCA_DOLBY):
+ zero (samples + 512);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_3F):
+ zero (samples + 1024);
+ case CONVERT (DCA_3F1R, DCA_3F):
+ case CONVERT (DCA_2F2R, DCA_2F1R):
+ zero (samples + 768);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_3F1R):
+ zero (samples + 1024);
+ break;
+
+ case CONVERT (DCA_3F2R, DCA_2F1R):
+ zero (samples + 1024);
+ case CONVERT (DCA_3F1R, DCA_2F1R):
+ mix_31to21:
+ memcpy (samples + 768, samples + 512, 256 * sizeof (sample_t));
+ goto mix_3to2;
+
+ case CONVERT (DCA_3F2R, DCA_2F2R):
+ memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
+ goto mix_31to21;
+ }
+}
diff --git a/contrib/libdca/include/dca.h b/contrib/libdca/include/dca.h
new file mode 100644
index 000000000..00b837393
--- /dev/null
+++ b/contrib/libdca/include/dca.h
@@ -0,0 +1,86 @@
+/*
+ * dca.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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 LIBDCA_DCA_H
+#define LIBDCA_DCA_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(LIBDCA_FIXED)
+typedef int32_t sample_t;
+typedef int32_t level_t;
+#elif defined(LIBDCA_DOUBLE)
+typedef double sample_t;
+typedef double level_t;
+#else
+typedef float sample_t;
+typedef float level_t;
+#endif
+
+typedef struct dca_state_s dca_state_t;
+
+#define DCA_MONO 0
+#define DCA_CHANNEL 1
+#define DCA_STEREO 2
+#define DCA_STEREO_SUMDIFF 3
+#define DCA_STEREO_TOTAL 4
+#define DCA_3F 5
+#define DCA_2F1R 6
+#define DCA_3F1R 7
+#define DCA_2F2R 8
+#define DCA_3F2R 9
+#define DCA_4F2R 10
+
+#define DCA_DOLBY 101 /* FIXME */
+
+#define DCA_CHANNEL_MAX DCA_3F2R /* We don't handle anything above that */
+#define DCA_CHANNEL_BITS 6
+#define DCA_CHANNEL_MASK 0x3F
+
+#define DCA_LFE 0x80
+#define DCA_ADJUST_LEVEL 0x100
+
+dca_state_t * dca_init (uint32_t mm_accel);
+
+int dca_syncinfo (dca_state_t *state, uint8_t * buf, int * flags,
+ int * sample_rate, int * bit_rate, int *frame_length);
+
+int dca_frame (dca_state_t * state, uint8_t * buf, int * flags,
+ level_t * level, sample_t bias);
+
+void dca_dynrng (dca_state_t * state,
+ level_t (* call) (level_t, void *), void * data);
+
+int dca_blocks_num (dca_state_t * state);
+int dca_block (dca_state_t * state);
+
+sample_t * dca_samples (dca_state_t * state);
+
+void dca_free (dca_state_t * state);
+
+#endif /* LIBDCA_DCA_H */
diff --git a/contrib/libdca/include/dts.h b/contrib/libdca/include/dts.h
new file mode 100644
index 000000000..e6dc8b137
--- /dev/null
+++ b/contrib/libdca/include/dts.h
@@ -0,0 +1,55 @@
+/*
+ * dts.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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 LIBDCA_COMPAT_H
+# define LIBDCA_COMPAT_H 1
+# include <dca.h>
+
+typedef struct dca_state_s dts_state_t;
+# define DTS_MONO DCA_MONO
+# define DTS_CHANNEL DCA_CHANNEL
+# define DTS_STEREO DCA_STEREO
+# define DTS_STEREO_SUMDIFF DCA_STEREO_SUMDIFF
+# define DTS_STEREO_TOTAL DCA_STEREO_TOTAL
+# define DTS_3F DCA_3F
+# define DTS_2F1R DCA_2F1R
+# define DTS_3F1R DCA_3F1R
+# define DTS_2F2R DCA_2F2R
+# define DTS_3F2R DCA_3F2R
+# define DTS_4F2R DCA_4F2R
+# define DTS_DOLBY DCA_DOLBY
+# define DTS_CHANNEL_MAX DCA_CHANNEL_MAX
+# define DTS_CHANNEL_BITS DCA_CHANNEL_BITS
+# define DTS_CHANNEL_MASK DCA_CHANNEL_MASK
+# define DTS_LFE DCA_LFE
+# define DTS_ADJUST_LEVEL DCA_ADJUST_LEVEL
+
+# define dts_init dca_init
+# define dts_syncinfo dca_syncinfo
+# define dts_frame dca_frame
+# define dts_dynrng dca_dynrng
+# define dts_blocks_num dca_blocks_num
+# define dts_block dca_block
+# define dts_samples dca_samples
+# define dts_free dca_free
+#endif
diff --git a/contrib/libdca/parse.c b/contrib/libdca/parse.c
new file mode 100644
index 000000000..5a0c95f17
--- /dev/null
+++ b/contrib/libdca/parse.c
@@ -0,0 +1,1292 @@
+/*
+ * parse.c
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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 "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 "dca.h"
+#include "dca_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 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 (dca_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( dca_state_t * state );
+
+dca_state_t * dca_init (uint32_t mm_accel)
+{
+ dca_state_t * state;
+ int i;
+
+ (void)mm_accel;
+ state = (dca_state_t *) malloc (sizeof (dca_state_t));
+ if (state == NULL)
+ return NULL;
+
+ memset (state, 0, sizeof(dca_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 * dca_samples (dca_state_t * state)
+{
+ return state->samples;
+}
+
+int dca_blocks_num (dca_state_t * state)
+{
+ /* 8 samples per subsubframe and per subband */
+ return state->sample_blocks / 8;
+}
+
+static int syncinfo (dca_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 ((size_t)*sample_rate >= sizeof (dca_sample_rates) / sizeof (int))
+ return 0;
+ *sample_rate = dca_sample_rates[ *sample_rate ];
+ if (!*sample_rate) return 0;
+
+ *bit_rate = bitstream_get (state, 5);
+ if ((size_t)*bit_rate >= sizeof (dca_bit_rates) / sizeof (int))
+ return 0;
+ *bit_rate = dca_bit_rates[ *bit_rate ];
+ if (!*bit_rate) return 0;
+
+ /* LFE */
+ bitstream_get (state, 10);
+ if (bitstream_get (state, 2)) *flags |= DCA_LFE;
+
+ return frame_size;
+}
+
+int dca_syncinfo (dca_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;
+ dca_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;
+ dca_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;
+ dca_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;
+ dca_bitstream_init (state, buf, 1, 1);
+ frame_size = syncinfo (state, flags, sample_rate,
+ bit_rate, frame_length);
+ return frame_size;
+ }
+
+ return 0;
+}
+
+int dca_frame (dca_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 };
+
+ dca_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 = dca_downmix_init (state->amode, *flags, level,
+ state->clev, state->slev);
+ if (state->output < 0)
+ return 1;
+
+ if (state->lfe && (*flags & DCA_LFE))
+ state->output |= DCA_LFE;
+
+ *flags = state->output;
+
+ state->dynrng = state->level = MUL_C (*level, 2);
+ state->bias = bias;
+ state->dynrnge = 1;
+ state->dynrngcall = NULL;
+
+#ifdef 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, dca_channels[state->amode]);
+ fprintf (stderr, "sample rate: %i (%i Hz)\n",
+ state->sample_rate, dca_sample_rates[state->sample_rate]);
+ fprintf (stderr, "bit rate: %i (%i bits/s)\n",
+ state->bit_rate, dca_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,
+ dca_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 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 DEBUG
+ fprintf (stderr, "subband activity: %i\n", state->subband_activity[i]);
+#endif
+ if (state->subband_activity[i] > DCA_SUBBANDS)
+ state->subband_activity[i] = DCA_SUBBANDS;
+ }
+ for (i = 0; i < state->prim_channels; i++)
+ {
+ state->vq_start_subband[i] = bitstream_get (state, 5) + 1;
+#ifdef DEBUG
+ fprintf (stderr, "vq start subband: %i\n", state->vq_start_subband[i]);
+#endif
+ if (state->vq_start_subband[i] > DCA_SUBBANDS)
+ state->vq_start_subband[i] = DCA_SUBBANDS;
+ }
+ for (i = 0; i < state->prim_channels; i++)
+ {
+ state->joint_intensity[i] = bitstream_get (state, 3);
+#ifdef 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 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 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 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 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 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 dca_subframe_header (dca_state_t * state)
+{
+ /* Primary audio coding side information */
+ int j, k;
+
+ /* Subsubframe count */
+ state->subsubframes = bitstream_get (state, 2) + 1;
+#ifdef DEBUG
+ fprintf (stderr, "subsubframes: %i\n", state->subsubframes);
+#endif
+
+ /* Partial subsubframe sample count */
+ state->partial_samples = bitstream_get (state, 3);
+#ifdef 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 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 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 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 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 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 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 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 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 dca_subsubframe (dca_state_t * state)
+{
+ int k, l;
+ int subsubframe = state->current_subsubframe;
+
+ double *quant_step_table;
+
+ /* FIXME */
+ double subband_samples[DCA_PRIM_CHANNELS_MAX][DCA_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 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 < dca_channels[state->output & DCA_CHANNEL_MASK])
+ {
+ dca_upmix (state->samples, state->amode, state->output);
+ } else
+ if (state->prim_channels > dca_channels[state->output & DCA_CHANNEL_MASK])
+ {
+ dca_downmix (state->samples, state->amode, state->output, state->bias,
+ state->clev, state->slev);
+ }
+
+ /* Generate LFE samples for this subsubframe FIXME!!! */
+ if (state->output & DCA_LFE)
+ {
+ int lfe_samples = 2 * state->lfe * state->subsubframes;
+ int i_channels = dca_channels[state->output & DCA_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 dca_subframe_footer (dca_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 DEBUG
+ fprintf( stderr, "\n" );
+#endif
+
+ return 0;
+}
+
+int dca_block (dca_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 DEBUG
+ fprintf (stderr, "DSYNC dca_subframe_header\n");
+#endif
+ /* Read subframe header */
+ if (dca_subframe_header (state)) return -1;
+ }
+
+ /* Read subsubframe */
+#ifdef DEBUG
+ fprintf (stderr, "DSYNC dca_subsubframe\n");
+#endif
+ if (dca_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 DEBUG
+ fprintf(stderr, "DSYNC dca_subframe_footer\n");
+#endif
+ /* Read subframe footer */
+ if (dca_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( dca_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 (dca_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 dca_dynrng (dca_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 dca_free (dca_state_t * state)
+{
+ free (state->samples);
+ free (state);
+}
diff --git a/contrib/libdca/tables.h b/contrib/libdca/tables.h
new file mode 100644
index 000000000..ca336cf29
--- /dev/null
+++ b/contrib/libdca/tables.h
@@ -0,0 +1,48 @@
+/*
+ * tables.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+static const int dca_sample_rates[] =
+{
+ 0, 8000, 16000, 32000, 0, 0, 11025, 22050, 44100, 0, 0,
+ 12000, 24000, 48000, 96000, 192000
+};
+
+static const int dca_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 dca_channels[] =
+{
+ 1, 2, 2, 2, 2, 3, 3, 4, 4, 5, 6, 6, 6, 7, 8, 8
+};
+
+static const uint8_t dca_bits_per_sample[] =
+{
+ 16, 16, 20, 20, 0, 24, 24
+};
diff --git a/contrib/libdca/tables_adpcm.h b/contrib/libdca/tables_adpcm.h
new file mode 100644
index 000000000..c19378dab
--- /dev/null
+++ b/contrib/libdca/tables_adpcm.h
@@ -0,0 +1,4123 @@
+/*
+ * tables_adpcm.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+/* 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/contrib/libdca/tables_fir.h b/contrib/libdca/tables_fir.h
new file mode 100644
index 000000000..a127fee6f
--- /dev/null
+++ b/contrib/libdca/tables_fir.h
@@ -0,0 +1,2086 @@
+/*
+ * fir.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+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/contrib/libdca/tables_huffman.h b/contrib/libdca/tables_huffman.h
new file mode 100644
index 000000000..abe4c138c
--- /dev/null
+++ b/contrib/libdca/tables_huffman.h
@@ -0,0 +1,1072 @@
+/*
+ * huffman_tables.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+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( dca_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/contrib/libdca/tables_quantization.h b/contrib/libdca/tables_quantization.h
new file mode 100644
index 000000000..4dc3cd0fe
--- /dev/null
+++ b/contrib/libdca/tables_quantization.h
@@ -0,0 +1,89 @@
+/*
+ * tables_quantization.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+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/contrib/libdca/tables_vq.h b/contrib/libdca/tables_vq.h
new file mode 100644
index 000000000..2aafd762c
--- /dev/null
+++ b/contrib/libdca/tables_vq.h
@@ -0,0 +1,2076 @@
+/*
+ * tables_vq.h
+ * Copyright (C) 2004 Gildas Bazin <gbazin@videolan.org>
+ *
+ * This file is part of libdca, a free DTS Coherent Acoustics stream decoder.
+ * See http://www.videolan.org/developers/libdca.html for updates.
+ *
+ * libdca is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * libdca is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You 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.
+ */
+
+/* 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/video_out/libdha/.hgignore b/contrib/libdha/.hgignore
index 7b5ba91fb..7b5ba91fb 100644
--- a/src/video_out/libdha/.hgignore
+++ b/contrib/libdha/.hgignore
diff --git a/src/video_out/libdha/AsmMacros.h b/contrib/libdha/AsmMacros.h
index d1b136a7b..d1b136a7b 100644
--- a/src/video_out/libdha/AsmMacros.h
+++ b/contrib/libdha/AsmMacros.h
diff --git a/contrib/libdha/Makefile.am b/contrib/libdha/Makefile.am
new file mode 100644
index 000000000..4f8eaddd8
--- /dev/null
+++ b/contrib/libdha/Makefile.am
@@ -0,0 +1,45 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+SUBDIRS = bin oth sysdep
+
+if BUILD_DHA_KMOD
+SUBDIRS += kernelhelper
+endif
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS)
+
+EXTRA_DIST = README pci_db2c.awk
+
+awk_generated = pci_dev_ids.c pci_ids.h pci_names.c pci_names.h pci_vendors.h
+CLEANFILES = $(awk_generated)
+
+noinst_HEADERS = AsmMacros.h libdha.h pci_ids.h pci_names.h pci_vendors.h
+
+if ENABLE_VIDIX
+noinst_LTLIBRARIES = libdha.la
+endif
+
+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 = libdha.la
+
+## 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 $(srcdir)/pci_db2c.awk \
+ $(srcdir)/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/contrib/libdha/README
index a855880cd..a855880cd 100644
--- a/src/video_out/libdha/README
+++ b/contrib/libdha/README
diff --git a/contrib/libdha/bin/Makefile.am b/contrib/libdha/bin/Makefile.am
new file mode 100644
index 000000000..15369507e
--- /dev/null
+++ b/contrib/libdha/bin/Makefile.am
@@ -0,0 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+EXTRA_DIST = README mapdev.copyright mapdev.vxd
diff --git a/src/video_out/libdha/bin/README b/contrib/libdha/bin/README
index fe4bfa6f3..fe4bfa6f3 100644
--- a/src/video_out/libdha/bin/README
+++ b/contrib/libdha/bin/README
diff --git a/src/video_out/libdha/bin/mapdev.copyright b/contrib/libdha/bin/mapdev.copyright
index b22433d29..b22433d29 100644
--- a/src/video_out/libdha/bin/mapdev.copyright
+++ b/contrib/libdha/bin/mapdev.copyright
diff --git a/src/video_out/libdha/bin/mapdev.vxd b/contrib/libdha/bin/mapdev.vxd
index e09194b84..e09194b84 100644
--- a/src/video_out/libdha/bin/mapdev.vxd
+++ b/contrib/libdha/bin/mapdev.vxd
Binary files differ
diff --git a/src/video_out/libdha/cpu_flush.c b/contrib/libdha/cpu_flush.c
index 9186f89e8..9186f89e8 100644
--- a/src/video_out/libdha/cpu_flush.c
+++ b/contrib/libdha/cpu_flush.c
diff --git a/src/video_out/libdha/irq.c b/contrib/libdha/irq.c
index abccaf74c..abccaf74c 100644
--- a/src/video_out/libdha/irq.c
+++ b/contrib/libdha/irq.c
diff --git a/contrib/libdha/kernelhelper/Makefile.am b/contrib/libdha/kernelhelper/Makefile.am
new file mode 100644
index 000000000..c3343b0cd
--- /dev/null
+++ b/contrib/libdha/kernelhelper/Makefile.am
@@ -0,0 +1,51 @@
+include $(top_srcdir)/misc/Makefile.quiet
+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
+KERNEL_MODULE = dhahelper.o
+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)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(moddir)
+ @list='$(KERNEL_MODULE)'; \
+ for p in $$list; do \
+ if test -f $$p; then \
+ echo "$(INSTALL) -o root -g root -m 644 $$p $(DESTDIR)$(moddir)/$$p"; \
+ $(INSTALL) -o root -g root -m 644 $$p $(DESTDIR)$(moddir)/$$p; \
+ else :; fi; \
+ done; \
+ $(DEPMOD) -a
+ if test ! -c /dev/dhahelper; then \
+ $(MAKE) nodes; \
+ fi
+
+uninstall-local:
+ @$(NORMAL_UNINSTALL)
+ @list='$(KERNEL_MODULE)'; \
+ for p in $$list; do \
+ echo "rm -f $(DESTDIR)$(moddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ rm -f $(DESTDIR)$(moddir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
diff --git a/src/video_out/libdha/kernelhelper/README b/contrib/libdha/kernelhelper/README
index 98a7923b3..98a7923b3 100644
--- a/src/video_out/libdha/kernelhelper/README
+++ b/contrib/libdha/kernelhelper/README
diff --git a/src/video_out/libdha/kernelhelper/dhahelper.c b/contrib/libdha/kernelhelper/dhahelper.c
index 0e755064a..0e755064a 100644
--- a/src/video_out/libdha/kernelhelper/dhahelper.c
+++ b/contrib/libdha/kernelhelper/dhahelper.c
diff --git a/src/video_out/libdha/kernelhelper/dhahelper.h b/contrib/libdha/kernelhelper/dhahelper.h
index 7db56abb5..7db56abb5 100644
--- a/src/video_out/libdha/kernelhelper/dhahelper.h
+++ b/contrib/libdha/kernelhelper/dhahelper.h
diff --git a/src/video_out/libdha/kernelhelper/test.c b/contrib/libdha/kernelhelper/test.c
index d2d807f3f..d2d807f3f 100644
--- a/src/video_out/libdha/kernelhelper/test.c
+++ b/contrib/libdha/kernelhelper/test.c
diff --git a/src/video_out/libdha/libdha.c b/contrib/libdha/libdha.c
index 73a4387a2..73a4387a2 100644
--- a/src/video_out/libdha/libdha.c
+++ b/contrib/libdha/libdha.c
diff --git a/src/video_out/libdha/libdha.h b/contrib/libdha/libdha.h
index 2bd8fe39b..2bd8fe39b 100644
--- a/src/video_out/libdha/libdha.h
+++ b/contrib/libdha/libdha.h
diff --git a/src/video_out/libdha/mmi.c b/contrib/libdha/mmi.c
index 39d21926a..39d21926a 100644
--- a/src/video_out/libdha/mmi.c
+++ b/contrib/libdha/mmi.c
diff --git a/src/video_out/libdha/mtrr.c b/contrib/libdha/mtrr.c
index 48ae5a1fd..48ae5a1fd 100644
--- a/src/video_out/libdha/mtrr.c
+++ b/contrib/libdha/mtrr.c
diff --git a/contrib/libdha/oth/Makefile.am b/contrib/libdha/oth/Makefile.am
new file mode 100644
index 000000000..d686618d9
--- /dev/null
+++ b/contrib/libdha/oth/Makefile.am
@@ -0,0 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+EXTRA_DIST = pci.db
diff --git a/src/video_out/libdha/oth/pci.db b/contrib/libdha/oth/pci.db
index 083b2892f..083b2892f 100644
--- a/src/video_out/libdha/oth/pci.db
+++ b/contrib/libdha/oth/pci.db
diff --git a/src/video_out/libdha/pci.c b/contrib/libdha/pci.c
index db8f4ddd5..db8f4ddd5 100644
--- a/src/video_out/libdha/pci.c
+++ b/contrib/libdha/pci.c
diff --git a/src/video_out/libdha/pci_db2c.awk b/contrib/libdha/pci_db2c.awk
index feaa1c7a1..feaa1c7a1 100644
--- a/src/video_out/libdha/pci_db2c.awk
+++ b/contrib/libdha/pci_db2c.awk
diff --git a/src/video_out/libdha/ports.c b/contrib/libdha/ports.c
index 0424446c9..0424446c9 100644
--- a/src/video_out/libdha/ports.c
+++ b/contrib/libdha/ports.c
diff --git a/src/video_out/libdha/sysdep/AsmMacros_alpha.h b/contrib/libdha/sysdep/AsmMacros_alpha.h
index 59da53891..59da53891 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_alpha.h
+++ b/contrib/libdha/sysdep/AsmMacros_alpha.h
diff --git a/src/video_out/libdha/sysdep/AsmMacros_arm32.h b/contrib/libdha/sysdep/AsmMacros_arm32.h
index e618d32ee..e618d32ee 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_arm32.h
+++ b/contrib/libdha/sysdep/AsmMacros_arm32.h
diff --git a/src/video_out/libdha/sysdep/AsmMacros_generic.h b/contrib/libdha/sysdep/AsmMacros_generic.h
index 183f831e5..183f831e5 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_generic.h
+++ b/contrib/libdha/sysdep/AsmMacros_generic.h
diff --git a/src/video_out/libdha/sysdep/AsmMacros_ia64.h b/contrib/libdha/sysdep/AsmMacros_ia64.h
index 7d6123f33..7d6123f33 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_ia64.h
+++ b/contrib/libdha/sysdep/AsmMacros_ia64.h
diff --git a/src/video_out/libdha/sysdep/AsmMacros_powerpc.h b/contrib/libdha/sysdep/AsmMacros_powerpc.h
index 2169c96b4..2169c96b4 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_powerpc.h
+++ b/contrib/libdha/sysdep/AsmMacros_powerpc.h
diff --git a/src/video_out/libdha/sysdep/AsmMacros_sparc.h b/contrib/libdha/sysdep/AsmMacros_sparc.h
index f6717b4bb..f6717b4bb 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_sparc.h
+++ b/contrib/libdha/sysdep/AsmMacros_sparc.h
diff --git a/src/video_out/libdha/sysdep/AsmMacros_x86.h b/contrib/libdha/sysdep/AsmMacros_x86.h
index 97dcaae16..97dcaae16 100644
--- a/src/video_out/libdha/sysdep/AsmMacros_x86.h
+++ b/contrib/libdha/sysdep/AsmMacros_x86.h
diff --git a/contrib/libdha/sysdep/Makefile.am b/contrib/libdha/sysdep/Makefile.am
new file mode 100644
index 000000000..73857edd6
--- /dev/null
+++ b/contrib/libdha/sysdep/Makefile.am
@@ -0,0 +1,36 @@
+include $(top_srcdir)/misc/Makefile.quiet
+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/contrib/libdha/sysdep/libdha_os2.c
index 041f6be71..041f6be71 100644
--- a/src/video_out/libdha/sysdep/libdha_os2.c
+++ b/contrib/libdha/sysdep/libdha_os2.c
diff --git a/src/video_out/libdha/sysdep/libdha_win32.c b/contrib/libdha/sysdep/libdha_win32.c
index 75c5dfb94..75c5dfb94 100644
--- a/src/video_out/libdha/sysdep/libdha_win32.c
+++ b/contrib/libdha/sysdep/libdha_win32.c
diff --git a/src/video_out/libdha/sysdep/pci_386bsd.c b/contrib/libdha/sysdep/pci_386bsd.c
index d00ecb078..d00ecb078 100644
--- a/src/video_out/libdha/sysdep/pci_386bsd.c
+++ b/contrib/libdha/sysdep/pci_386bsd.c
diff --git a/src/video_out/libdha/sysdep/pci_alpha.c b/contrib/libdha/sysdep/pci_alpha.c
index 74c3eb687..74c3eb687 100644
--- a/src/video_out/libdha/sysdep/pci_alpha.c
+++ b/contrib/libdha/sysdep/pci_alpha.c
diff --git a/src/video_out/libdha/sysdep/pci_arm32.c b/contrib/libdha/sysdep/pci_arm32.c
index 6920b615e..6920b615e 100644
--- a/src/video_out/libdha/sysdep/pci_arm32.c
+++ b/contrib/libdha/sysdep/pci_arm32.c
diff --git a/src/video_out/libdha/sysdep/pci_bsdi.c b/contrib/libdha/sysdep/pci_bsdi.c
index b6b142054..b6b142054 100644
--- a/src/video_out/libdha/sysdep/pci_bsdi.c
+++ b/contrib/libdha/sysdep/pci_bsdi.c
diff --git a/src/video_out/libdha/sysdep/pci_freebsd.c b/contrib/libdha/sysdep/pci_freebsd.c
index 9ad4b15f2..9ad4b15f2 100644
--- a/src/video_out/libdha/sysdep/pci_freebsd.c
+++ b/contrib/libdha/sysdep/pci_freebsd.c
diff --git a/src/video_out/libdha/sysdep/pci_generic_cpu.c b/contrib/libdha/sysdep/pci_generic_cpu.c
index 729d48b5a..729d48b5a 100644
--- a/src/video_out/libdha/sysdep/pci_generic_cpu.c
+++ b/contrib/libdha/sysdep/pci_generic_cpu.c
diff --git a/src/video_out/libdha/sysdep/pci_generic_os.c b/contrib/libdha/sysdep/pci_generic_os.c
index 8855bb4ba..8855bb4ba 100644
--- a/src/video_out/libdha/sysdep/pci_generic_os.c
+++ b/contrib/libdha/sysdep/pci_generic_os.c
diff --git a/src/video_out/libdha/sysdep/pci_ia64.c b/contrib/libdha/sysdep/pci_ia64.c
index ef2074ab2..ef2074ab2 100644
--- a/src/video_out/libdha/sysdep/pci_ia64.c
+++ b/contrib/libdha/sysdep/pci_ia64.c
diff --git a/src/video_out/libdha/sysdep/pci_isc.c b/contrib/libdha/sysdep/pci_isc.c
index 5b5a59182..5b5a59182 100644
--- a/src/video_out/libdha/sysdep/pci_isc.c
+++ b/contrib/libdha/sysdep/pci_isc.c
diff --git a/src/video_out/libdha/sysdep/pci_linux.c b/contrib/libdha/sysdep/pci_linux.c
index 1d2116da6..1d2116da6 100644
--- a/src/video_out/libdha/sysdep/pci_linux.c
+++ b/contrib/libdha/sysdep/pci_linux.c
diff --git a/src/video_out/libdha/sysdep/pci_lynx.c b/contrib/libdha/sysdep/pci_lynx.c
index b698f6308..b698f6308 100644
--- a/src/video_out/libdha/sysdep/pci_lynx.c
+++ b/contrib/libdha/sysdep/pci_lynx.c
diff --git a/src/video_out/libdha/sysdep/pci_mach386.c b/contrib/libdha/sysdep/pci_mach386.c
index 31621862b..31621862b 100644
--- a/src/video_out/libdha/sysdep/pci_mach386.c
+++ b/contrib/libdha/sysdep/pci_mach386.c
diff --git a/src/video_out/libdha/sysdep/pci_netbsd.c b/contrib/libdha/sysdep/pci_netbsd.c
index 793944beb..793944beb 100644
--- a/src/video_out/libdha/sysdep/pci_netbsd.c
+++ b/contrib/libdha/sysdep/pci_netbsd.c
diff --git a/src/video_out/libdha/sysdep/pci_openbsd.c b/contrib/libdha/sysdep/pci_openbsd.c
index 89c85eab6..89c85eab6 100644
--- a/src/video_out/libdha/sysdep/pci_openbsd.c
+++ b/contrib/libdha/sysdep/pci_openbsd.c
diff --git a/src/video_out/libdha/sysdep/pci_os2.c b/contrib/libdha/sysdep/pci_os2.c
index ddfc0c0ea..ddfc0c0ea 100644
--- a/src/video_out/libdha/sysdep/pci_os2.c
+++ b/contrib/libdha/sysdep/pci_os2.c
diff --git a/src/video_out/libdha/sysdep/pci_powerpc.c b/contrib/libdha/sysdep/pci_powerpc.c
index 667b4db37..667b4db37 100644
--- a/src/video_out/libdha/sysdep/pci_powerpc.c
+++ b/contrib/libdha/sysdep/pci_powerpc.c
diff --git a/src/video_out/libdha/sysdep/pci_sco.c b/contrib/libdha/sysdep/pci_sco.c
index 9cb2282ad..9cb2282ad 100644
--- a/src/video_out/libdha/sysdep/pci_sco.c
+++ b/contrib/libdha/sysdep/pci_sco.c
diff --git a/src/video_out/libdha/sysdep/pci_sparc.c b/contrib/libdha/sysdep/pci_sparc.c
index ef2074ab2..ef2074ab2 100644
--- a/src/video_out/libdha/sysdep/pci_sparc.c
+++ b/contrib/libdha/sysdep/pci_sparc.c
diff --git a/src/video_out/libdha/sysdep/pci_svr4.c b/contrib/libdha/sysdep/pci_svr4.c
index bcce5c901..bcce5c901 100644
--- a/src/video_out/libdha/sysdep/pci_svr4.c
+++ b/contrib/libdha/sysdep/pci_svr4.c
diff --git a/src/video_out/libdha/sysdep/pci_win32.c b/contrib/libdha/sysdep/pci_win32.c
index 1c88cb13e..1c88cb13e 100644
--- a/src/video_out/libdha/sysdep/pci_win32.c
+++ b/contrib/libdha/sysdep/pci_win32.c
diff --git a/src/video_out/libdha/sysdep/pci_x86.c b/contrib/libdha/sysdep/pci_x86.c
index ef2074ab2..ef2074ab2 100644
--- a/src/video_out/libdha/sysdep/pci_x86.c
+++ b/contrib/libdha/sysdep/pci_x86.c
diff --git a/src/video_out/libdha/test.c b/contrib/libdha/test.c
index 857e739c6..857e739c6 100644
--- a/src/video_out/libdha/test.c
+++ b/contrib/libdha/test.c
diff --git a/contrib/libfaad/Makefile.am b/contrib/libfaad/Makefile.am
new file mode 100644
index 000000000..7f627db4d
--- /dev/null
+++ b/contrib/libfaad/Makefile.am
@@ -0,0 +1,116 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+if ENABLE_FAAD
+if !WITH_EXTERNAL_FAAD
+noinst_LTLIBRARIES = libfaad.la
+endif
+endif
+
+libfaad_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 \
+ 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 \
+ neaacdec.h \
+ codebook/hcb.h \
+ codebook/hcb_1.h \
+ codebook/hcb_2.h \
+ codebook/hcb_3.h \
+ codebook/hcb_4.h \
+ codebook/hcb_5.h \
+ codebook/hcb_6.h \
+ codebook/hcb_7.h \
+ codebook/hcb_8.h \
+ codebook/hcb_9.h \
+ codebook/hcb_10.h \
+ codebook/hcb_11.h \
+ codebook/hcb_sf.h
+
+libfaad_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
diff --git a/src/libfaad/analysis.h b/contrib/libfaad/analysis.h
index 50e43fa04..50e43fa04 100644
--- a/src/libfaad/analysis.h
+++ b/contrib/libfaad/analysis.h
diff --git a/src/libfaad/bits.c b/contrib/libfaad/bits.c
index dc14d7a03..dc14d7a03 100644
--- a/src/libfaad/bits.c
+++ b/contrib/libfaad/bits.c
diff --git a/src/libfaad/bits.h b/contrib/libfaad/bits.h
index e303e8e72..e303e8e72 100644
--- a/src/libfaad/bits.h
+++ b/contrib/libfaad/bits.h
diff --git a/src/libfaad/cfft.c b/contrib/libfaad/cfft.c
index 5b01d75d3..5b01d75d3 100644
--- a/src/libfaad/cfft.c
+++ b/contrib/libfaad/cfft.c
diff --git a/src/libfaad/cfft.h b/contrib/libfaad/cfft.h
index dc89cdc85..dc89cdc85 100644
--- a/src/libfaad/cfft.h
+++ b/contrib/libfaad/cfft.h
diff --git a/src/libfaad/cfft_tab.h b/contrib/libfaad/cfft_tab.h
index 80b1b75be..80b1b75be 100644
--- a/src/libfaad/cfft_tab.h
+++ b/contrib/libfaad/cfft_tab.h
diff --git a/src/libfaad/codebook/hcb.h b/contrib/libfaad/codebook/hcb.h
index 29bbca4f8..29bbca4f8 100644
--- a/src/libfaad/codebook/hcb.h
+++ b/contrib/libfaad/codebook/hcb.h
diff --git a/src/libfaad/codebook/hcb_1.h b/contrib/libfaad/codebook/hcb_1.h
index f6632c230..f6632c230 100644
--- a/src/libfaad/codebook/hcb_1.h
+++ b/contrib/libfaad/codebook/hcb_1.h
diff --git a/src/libfaad/codebook/hcb_10.h b/contrib/libfaad/codebook/hcb_10.h
index 87e621df5..87e621df5 100644
--- a/src/libfaad/codebook/hcb_10.h
+++ b/contrib/libfaad/codebook/hcb_10.h
diff --git a/src/libfaad/codebook/hcb_11.h b/contrib/libfaad/codebook/hcb_11.h
index 509a1d684..509a1d684 100644
--- a/src/libfaad/codebook/hcb_11.h
+++ b/contrib/libfaad/codebook/hcb_11.h
diff --git a/src/libfaad/codebook/hcb_2.h b/contrib/libfaad/codebook/hcb_2.h
index 8edfe525d..8edfe525d 100644
--- a/src/libfaad/codebook/hcb_2.h
+++ b/contrib/libfaad/codebook/hcb_2.h
diff --git a/src/libfaad/codebook/hcb_3.h b/contrib/libfaad/codebook/hcb_3.h
index e9481e198..e9481e198 100644
--- a/src/libfaad/codebook/hcb_3.h
+++ b/contrib/libfaad/codebook/hcb_3.h
diff --git a/src/libfaad/codebook/hcb_4.h b/contrib/libfaad/codebook/hcb_4.h
index c2b43e005..c2b43e005 100644
--- a/src/libfaad/codebook/hcb_4.h
+++ b/contrib/libfaad/codebook/hcb_4.h
diff --git a/src/libfaad/codebook/hcb_5.h b/contrib/libfaad/codebook/hcb_5.h
index ca7c473bf..ca7c473bf 100644
--- a/src/libfaad/codebook/hcb_5.h
+++ b/contrib/libfaad/codebook/hcb_5.h
diff --git a/src/libfaad/codebook/hcb_6.h b/contrib/libfaad/codebook/hcb_6.h
index 2181d63d5..2181d63d5 100644
--- a/src/libfaad/codebook/hcb_6.h
+++ b/contrib/libfaad/codebook/hcb_6.h
diff --git a/src/libfaad/codebook/hcb_7.h b/contrib/libfaad/codebook/hcb_7.h
index 54c85c11d..54c85c11d 100644
--- a/src/libfaad/codebook/hcb_7.h
+++ b/contrib/libfaad/codebook/hcb_7.h
diff --git a/src/libfaad/codebook/hcb_8.h b/contrib/libfaad/codebook/hcb_8.h
index 6e3f1009e..6e3f1009e 100644
--- a/src/libfaad/codebook/hcb_8.h
+++ b/contrib/libfaad/codebook/hcb_8.h
diff --git a/src/libfaad/codebook/hcb_9.h b/contrib/libfaad/codebook/hcb_9.h
index bdba2c222..bdba2c222 100644
--- a/src/libfaad/codebook/hcb_9.h
+++ b/contrib/libfaad/codebook/hcb_9.h
diff --git a/src/libfaad/codebook/hcb_sf.h b/contrib/libfaad/codebook/hcb_sf.h
index 3c02b3d84..3c02b3d84 100644
--- a/src/libfaad/codebook/hcb_sf.h
+++ b/contrib/libfaad/codebook/hcb_sf.h
diff --git a/src/libfaad/common.c b/contrib/libfaad/common.c
index 595605586..595605586 100644
--- a/src/libfaad/common.c
+++ b/contrib/libfaad/common.c
diff --git a/src/libfaad/common.h b/contrib/libfaad/common.h
index 4419f1eb5..4419f1eb5 100644
--- a/src/libfaad/common.h
+++ b/contrib/libfaad/common.h
diff --git a/src/libfaad/decoder.c b/contrib/libfaad/decoder.c
index 7fb4b1965..7fb4b1965 100644
--- a/src/libfaad/decoder.c
+++ b/contrib/libfaad/decoder.c
diff --git a/src/libfaad/decoder.h b/contrib/libfaad/decoder.h
index a4cb567d2..a4cb567d2 100644
--- a/src/libfaad/decoder.h
+++ b/contrib/libfaad/decoder.h
diff --git a/contrib/libfaad/diff_from_faad2-2.6.1.patch b/contrib/libfaad/diff_from_faad2-2.6.1.patch
new file mode 100644
index 000000000..fbb02ea39
--- /dev/null
+++ b/contrib/libfaad/diff_from_faad2-2.6.1.patch
@@ -0,0 +1,11 @@
+--- faad2/libfaad/common.h 2007-11-01 13:33:30.000000000 +0100
++++ faad2/libfaad/common.h 2007-11-01 18:51:01.480721384 +0100
+@@ -36,7 +36,7 @@
+ #endif
+
+ #ifdef HAVE_CONFIG_H
+-# include "../config.h"
++# include <config.h>
+ #endif
+
+ #if 1
diff --git a/src/libfaad/drc.c b/contrib/libfaad/drc.c
index 3c9ff3ae0..3c9ff3ae0 100644
--- a/src/libfaad/drc.c
+++ b/contrib/libfaad/drc.c
diff --git a/src/libfaad/drc.h b/contrib/libfaad/drc.h
index 49118bcd0..49118bcd0 100644
--- a/src/libfaad/drc.h
+++ b/contrib/libfaad/drc.h
diff --git a/src/libfaad/drm_dec.c b/contrib/libfaad/drm_dec.c
index 61cb8180e..61cb8180e 100644
--- a/src/libfaad/drm_dec.c
+++ b/contrib/libfaad/drm_dec.c
diff --git a/src/libfaad/drm_dec.h b/contrib/libfaad/drm_dec.h
index d0ac995e4..d0ac995e4 100644
--- a/src/libfaad/drm_dec.h
+++ b/contrib/libfaad/drm_dec.h
diff --git a/src/libfaad/error.c b/contrib/libfaad/error.c
index c552e06cd..c552e06cd 100644
--- a/src/libfaad/error.c
+++ b/contrib/libfaad/error.c
diff --git a/src/libfaad/error.h b/contrib/libfaad/error.h
index 7f750217c..7f750217c 100644
--- a/src/libfaad/error.h
+++ b/contrib/libfaad/error.h
diff --git a/src/libfaad/filtbank.c b/contrib/libfaad/filtbank.c
index eaeddcce6..eaeddcce6 100644
--- a/src/libfaad/filtbank.c
+++ b/contrib/libfaad/filtbank.c
diff --git a/src/libfaad/filtbank.h b/contrib/libfaad/filtbank.h
index de0149c97..de0149c97 100644
--- a/src/libfaad/filtbank.h
+++ b/contrib/libfaad/filtbank.h
diff --git a/src/libfaad/fixed.h b/contrib/libfaad/fixed.h
index 531583772..531583772 100644
--- a/src/libfaad/fixed.h
+++ b/contrib/libfaad/fixed.h
diff --git a/src/libfaad/hcr.c b/contrib/libfaad/hcr.c
index c76629641..c76629641 100644
--- a/src/libfaad/hcr.c
+++ b/contrib/libfaad/hcr.c
diff --git a/src/libfaad/huffman.c b/contrib/libfaad/huffman.c
index e2656c089..e2656c089 100644
--- a/src/libfaad/huffman.c
+++ b/contrib/libfaad/huffman.c
diff --git a/src/libfaad/huffman.h b/contrib/libfaad/huffman.h
index f8bcb237e..f8bcb237e 100644
--- a/src/libfaad/huffman.h
+++ b/contrib/libfaad/huffman.h
diff --git a/src/libfaad/ic_predict.c b/contrib/libfaad/ic_predict.c
index 70027ba2f..70027ba2f 100644
--- a/src/libfaad/ic_predict.c
+++ b/contrib/libfaad/ic_predict.c
diff --git a/src/libfaad/ic_predict.h b/contrib/libfaad/ic_predict.h
index e69cd114e..e69cd114e 100644
--- a/src/libfaad/ic_predict.h
+++ b/contrib/libfaad/ic_predict.h
diff --git a/src/libfaad/iq_table.h b/contrib/libfaad/iq_table.h
index 3cc2b8061..3cc2b8061 100644
--- a/src/libfaad/iq_table.h
+++ b/contrib/libfaad/iq_table.h
diff --git a/src/libfaad/is.c b/contrib/libfaad/is.c
index 5236db077..5236db077 100644
--- a/src/libfaad/is.c
+++ b/contrib/libfaad/is.c
diff --git a/src/libfaad/is.h b/contrib/libfaad/is.h
index 3e3b750ab..3e3b750ab 100644
--- a/src/libfaad/is.h
+++ b/contrib/libfaad/is.h
diff --git a/src/libfaad/kbd_win.h b/contrib/libfaad/kbd_win.h
index de404c7ea..de404c7ea 100644
--- a/src/libfaad/kbd_win.h
+++ b/contrib/libfaad/kbd_win.h
diff --git a/src/libfaad/lt_predict.c b/contrib/libfaad/lt_predict.c
index 2be18ae9f..2be18ae9f 100644
--- a/src/libfaad/lt_predict.c
+++ b/contrib/libfaad/lt_predict.c
diff --git a/src/libfaad/lt_predict.h b/contrib/libfaad/lt_predict.h
index 117f83424..117f83424 100644
--- a/src/libfaad/lt_predict.h
+++ b/contrib/libfaad/lt_predict.h
diff --git a/src/libfaad/mdct.c b/contrib/libfaad/mdct.c
index 247691e40..247691e40 100644
--- a/src/libfaad/mdct.c
+++ b/contrib/libfaad/mdct.c
diff --git a/src/libfaad/mdct.h b/contrib/libfaad/mdct.h
index 736180ead..736180ead 100644
--- a/src/libfaad/mdct.h
+++ b/contrib/libfaad/mdct.h
diff --git a/src/libfaad/mdct_tab.h b/contrib/libfaad/mdct_tab.h
index eea285b67..eea285b67 100644
--- a/src/libfaad/mdct_tab.h
+++ b/contrib/libfaad/mdct_tab.h
diff --git a/src/libfaad/mp4.c b/contrib/libfaad/mp4.c
index ef3f8a9c9..ef3f8a9c9 100644
--- a/src/libfaad/mp4.c
+++ b/contrib/libfaad/mp4.c
diff --git a/src/libfaad/mp4.h b/contrib/libfaad/mp4.h
index 532ba3524..532ba3524 100644
--- a/src/libfaad/mp4.h
+++ b/contrib/libfaad/mp4.h
diff --git a/src/libfaad/ms.c b/contrib/libfaad/ms.c
index 97c8fb198..97c8fb198 100644
--- a/src/libfaad/ms.c
+++ b/contrib/libfaad/ms.c
diff --git a/src/libfaad/ms.h b/contrib/libfaad/ms.h
index 30cfadaf6..30cfadaf6 100644
--- a/src/libfaad/ms.h
+++ b/contrib/libfaad/ms.h
diff --git a/contrib/libfaad/neaacdec.h b/contrib/libfaad/neaacdec.h
new file mode 100755
index 000000000..6ffa54f22
--- /dev/null
+++ b/contrib/libfaad/neaacdec.h
@@ -0,0 +1,255 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003-2005 M. Bakker, Nero 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.
+**
+** The "appropriate copyright message" mentioned in section 2c of the GPLv2
+** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
+**
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
+**
+** $Id: neaacdec.h,v 1.11 2007/11/01 12:33:29 menno Exp $
+**/
+
+#ifndef __NEAACDEC_H__
+#define __NEAACDEC_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+#if 1
+/* MACROS FOR BACKWARDS COMPATIBILITY */
+/* structs */
+#define faacDecHandle NeAACDecHandle
+#define faacDecConfiguration NeAACDecConfiguration
+#define faacDecConfigurationPtr NeAACDecConfigurationPtr
+#define faacDecFrameInfo NeAACDecFrameInfo
+/* functions */
+#define faacDecGetErrorMessage NeAACDecGetErrorMessage
+#define faacDecSetConfiguration NeAACDecSetConfiguration
+#define faacDecGetCurrentConfiguration NeAACDecGetCurrentConfiguration
+#define faacDecInit NeAACDecInit
+#define faacDecInit2 NeAACDecInit2
+#define faacDecInitDRM NeAACDecInitDRM
+#define faacDecPostSeekReset NeAACDecPostSeekReset
+#define faacDecOpen NeAACDecOpen
+#define faacDecClose NeAACDecClose
+#define faacDecDecode NeAACDecDecode
+#define AudioSpecificConfig NeAACDecAudioSpecificConfig
+#endif
+
+
+#ifdef _WIN32
+ #pragma pack(push, 8)
+ #ifndef NEAACDECAPI
+ #define NEAACDECAPI __cdecl
+ #endif
+#else
+ #ifndef NEAACDECAPI
+ #define NEAACDECAPI
+ #endif
+#endif
+
+#define FAAD2_VERSION "2.6"
+
+/* 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_FIXED FAAD_FMT_FLOAT
+#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_STEREO 4
+#define DRMCH_SBR_PS_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 *NeAACDecHandle;
+
+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;
+ char downSampledSBR;
+} mp4AudioSpecificConfig;
+
+typedef struct NeAACDecConfiguration
+{
+ unsigned char defObjectType;
+ unsigned long defSampleRate;
+ unsigned char outputFormat;
+ unsigned char downMatrix;
+ unsigned char useOldADTSFormat;
+ unsigned char dontUpSampleImplicitSBR;
+} NeAACDecConfiguration, *NeAACDecConfigurationPtr;
+
+typedef struct NeAACDecFrameInfo
+{
+ 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];
+
+ /* PS: 0: off, 1: on */
+ unsigned char ps;
+} NeAACDecFrameInfo;
+
+char* NEAACDECAPI NeAACDecGetErrorMessage(unsigned char errcode);
+
+unsigned long NEAACDECAPI NeAACDecGetCapabilities(void);
+
+NeAACDecHandle NEAACDECAPI NeAACDecOpen(void);
+
+NeAACDecConfigurationPtr NEAACDECAPI NeAACDecGetCurrentConfiguration(NeAACDecHandle hDecoder);
+
+unsigned char NEAACDECAPI NeAACDecSetConfiguration(NeAACDecHandle hDecoder,
+ NeAACDecConfigurationPtr config);
+
+/* Init the library based on info from the AAC file (ADTS/ADIF) */
+long NEAACDECAPI NeAACDecInit(NeAACDecHandle hDecoder,
+ unsigned char *buffer,
+ unsigned long buffer_size,
+ unsigned long *samplerate,
+ unsigned char *channels);
+
+/* Init the library using a DecoderSpecificInfo */
+char NEAACDECAPI NeAACDecInit2(NeAACDecHandle hDecoder, unsigned char *pBuffer,
+ unsigned long SizeOfDecoderSpecificInfo,
+ unsigned long *samplerate, unsigned char *channels);
+
+/* Init the library for DRM */
+char NEAACDECAPI NeAACDecInitDRM(NeAACDecHandle *hDecoder, unsigned long samplerate,
+ unsigned char channels);
+
+void NEAACDECAPI NeAACDecPostSeekReset(NeAACDecHandle hDecoder, long frame);
+
+void NEAACDECAPI NeAACDecClose(NeAACDecHandle hDecoder);
+
+void* NEAACDECAPI NeAACDecDecode(NeAACDecHandle hDecoder,
+ NeAACDecFrameInfo *hInfo,
+ unsigned char *buffer,
+ unsigned long buffer_size);
+
+void* NEAACDECAPI NeAACDecDecode2(NeAACDecHandle hDecoder,
+ NeAACDecFrameInfo *hInfo,
+ unsigned char *buffer,
+ unsigned long buffer_size,
+ void **sample_buffer,
+ unsigned long sample_buffer_size);
+
+char NEAACDECAPI NeAACDecAudioSpecificConfig(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/output.c b/contrib/libfaad/output.c
index a96ebd983..a96ebd983 100644
--- a/src/libfaad/output.c
+++ b/contrib/libfaad/output.c
diff --git a/src/libfaad/output.h b/contrib/libfaad/output.h
index 0451d8b73..0451d8b73 100644
--- a/src/libfaad/output.h
+++ b/contrib/libfaad/output.h
diff --git a/src/libfaad/pns.c b/contrib/libfaad/pns.c
index 248fd05ef..248fd05ef 100644
--- a/src/libfaad/pns.c
+++ b/contrib/libfaad/pns.c
diff --git a/src/libfaad/pns.h b/contrib/libfaad/pns.h
index 38ced252d..38ced252d 100644
--- a/src/libfaad/pns.h
+++ b/contrib/libfaad/pns.h
diff --git a/src/libfaad/ps_dec.c b/contrib/libfaad/ps_dec.c
index aebfe0a48..aebfe0a48 100644
--- a/src/libfaad/ps_dec.c
+++ b/contrib/libfaad/ps_dec.c
diff --git a/src/libfaad/ps_dec.h b/contrib/libfaad/ps_dec.h
index d96561404..d96561404 100644
--- a/src/libfaad/ps_dec.h
+++ b/contrib/libfaad/ps_dec.h
diff --git a/src/libfaad/ps_syntax.c b/contrib/libfaad/ps_syntax.c
index 50253d459..50253d459 100644
--- a/src/libfaad/ps_syntax.c
+++ b/contrib/libfaad/ps_syntax.c
diff --git a/src/libfaad/ps_tables.h b/contrib/libfaad/ps_tables.h
index f3370be9d..f3370be9d 100644
--- a/src/libfaad/ps_tables.h
+++ b/contrib/libfaad/ps_tables.h
diff --git a/src/libfaad/pulse.c b/contrib/libfaad/pulse.c
index 3dd973abf..3dd973abf 100644
--- a/src/libfaad/pulse.c
+++ b/contrib/libfaad/pulse.c
diff --git a/src/libfaad/pulse.h b/contrib/libfaad/pulse.h
index f7676cd89..f7676cd89 100644
--- a/src/libfaad/pulse.h
+++ b/contrib/libfaad/pulse.h
diff --git a/src/libfaad/rvlc.c b/contrib/libfaad/rvlc.c
index 73619c6d1..73619c6d1 100644
--- a/src/libfaad/rvlc.c
+++ b/contrib/libfaad/rvlc.c
diff --git a/src/libfaad/rvlc.h b/contrib/libfaad/rvlc.h
index 56f630fa4..56f630fa4 100644
--- a/src/libfaad/rvlc.h
+++ b/contrib/libfaad/rvlc.h
diff --git a/src/libfaad/sbr_dct.c b/contrib/libfaad/sbr_dct.c
index 16e7128ea..16e7128ea 100644
--- a/src/libfaad/sbr_dct.c
+++ b/contrib/libfaad/sbr_dct.c
diff --git a/src/libfaad/sbr_dct.h b/contrib/libfaad/sbr_dct.h
index ce44fd7ef..ce44fd7ef 100644
--- a/src/libfaad/sbr_dct.h
+++ b/contrib/libfaad/sbr_dct.h
diff --git a/src/libfaad/sbr_dec.c b/contrib/libfaad/sbr_dec.c
index f87d0106c..f87d0106c 100644
--- a/src/libfaad/sbr_dec.c
+++ b/contrib/libfaad/sbr_dec.c
diff --git a/src/libfaad/sbr_dec.h b/contrib/libfaad/sbr_dec.h
index 40c1d5388..40c1d5388 100644
--- a/src/libfaad/sbr_dec.h
+++ b/contrib/libfaad/sbr_dec.h
diff --git a/src/libfaad/sbr_e_nf.c b/contrib/libfaad/sbr_e_nf.c
index 14ba1e4a5..14ba1e4a5 100644
--- a/src/libfaad/sbr_e_nf.c
+++ b/contrib/libfaad/sbr_e_nf.c
diff --git a/src/libfaad/sbr_e_nf.h b/contrib/libfaad/sbr_e_nf.h
index 59017a906..59017a906 100644
--- a/src/libfaad/sbr_e_nf.h
+++ b/contrib/libfaad/sbr_e_nf.h
diff --git a/src/libfaad/sbr_fbt.c b/contrib/libfaad/sbr_fbt.c
index 5919c7b56..5919c7b56 100644
--- a/src/libfaad/sbr_fbt.c
+++ b/contrib/libfaad/sbr_fbt.c
diff --git a/src/libfaad/sbr_fbt.h b/contrib/libfaad/sbr_fbt.h
index d24a25e27..d24a25e27 100644
--- a/src/libfaad/sbr_fbt.h
+++ b/contrib/libfaad/sbr_fbt.h
diff --git a/src/libfaad/sbr_hfadj.c b/contrib/libfaad/sbr_hfadj.c
index efac06502..efac06502 100644
--- a/src/libfaad/sbr_hfadj.c
+++ b/contrib/libfaad/sbr_hfadj.c
diff --git a/src/libfaad/sbr_hfadj.h b/contrib/libfaad/sbr_hfadj.h
index 03ef71a0c..03ef71a0c 100644
--- a/src/libfaad/sbr_hfadj.h
+++ b/contrib/libfaad/sbr_hfadj.h
diff --git a/src/libfaad/sbr_hfgen.c b/contrib/libfaad/sbr_hfgen.c
index b0f3219c3..b0f3219c3 100644
--- a/src/libfaad/sbr_hfgen.c
+++ b/contrib/libfaad/sbr_hfgen.c
diff --git a/src/libfaad/sbr_hfgen.h b/contrib/libfaad/sbr_hfgen.h
index a7c842494..a7c842494 100644
--- a/src/libfaad/sbr_hfgen.h
+++ b/contrib/libfaad/sbr_hfgen.h
diff --git a/src/libfaad/sbr_huff.c b/contrib/libfaad/sbr_huff.c
index 6ba878640..6ba878640 100644
--- a/src/libfaad/sbr_huff.c
+++ b/contrib/libfaad/sbr_huff.c
diff --git a/src/libfaad/sbr_huff.h b/contrib/libfaad/sbr_huff.h
index f749f2e08..f749f2e08 100644
--- a/src/libfaad/sbr_huff.h
+++ b/contrib/libfaad/sbr_huff.h
diff --git a/src/libfaad/sbr_noise.h b/contrib/libfaad/sbr_noise.h
index 1cf7190de..1cf7190de 100644
--- a/src/libfaad/sbr_noise.h
+++ b/contrib/libfaad/sbr_noise.h
diff --git a/src/libfaad/sbr_qmf.c b/contrib/libfaad/sbr_qmf.c
index 68f408916..68f408916 100644
--- a/src/libfaad/sbr_qmf.c
+++ b/contrib/libfaad/sbr_qmf.c
diff --git a/src/libfaad/sbr_qmf.h b/contrib/libfaad/sbr_qmf.h
index efb167be9..efb167be9 100644
--- a/src/libfaad/sbr_qmf.h
+++ b/contrib/libfaad/sbr_qmf.h
diff --git a/src/libfaad/sbr_qmf_c.h b/contrib/libfaad/sbr_qmf_c.h
index c2fcd2739..c2fcd2739 100644
--- a/src/libfaad/sbr_qmf_c.h
+++ b/contrib/libfaad/sbr_qmf_c.h
diff --git a/src/libfaad/sbr_syntax.c b/contrib/libfaad/sbr_syntax.c
index 216c2e9e1..216c2e9e1 100644
--- a/src/libfaad/sbr_syntax.c
+++ b/contrib/libfaad/sbr_syntax.c
diff --git a/src/libfaad/sbr_syntax.h b/contrib/libfaad/sbr_syntax.h
index a13b2708f..a13b2708f 100644
--- a/src/libfaad/sbr_syntax.h
+++ b/contrib/libfaad/sbr_syntax.h
diff --git a/src/libfaad/sbr_tf_grid.c b/contrib/libfaad/sbr_tf_grid.c
index b3b24fd16..b3b24fd16 100644
--- a/src/libfaad/sbr_tf_grid.c
+++ b/contrib/libfaad/sbr_tf_grid.c
diff --git a/src/libfaad/sbr_tf_grid.h b/contrib/libfaad/sbr_tf_grid.h
index 27a8f908e..27a8f908e 100644
--- a/src/libfaad/sbr_tf_grid.h
+++ b/contrib/libfaad/sbr_tf_grid.h
diff --git a/src/libfaad/sine_win.h b/contrib/libfaad/sine_win.h
index e4198da3a..e4198da3a 100644
--- a/src/libfaad/sine_win.h
+++ b/contrib/libfaad/sine_win.h
diff --git a/src/libfaad/specrec.c b/contrib/libfaad/specrec.c
index ea6ca94b9..ea6ca94b9 100644
--- a/src/libfaad/specrec.c
+++ b/contrib/libfaad/specrec.c
diff --git a/src/libfaad/specrec.h b/contrib/libfaad/specrec.h
index f58094cf4..f58094cf4 100644
--- a/src/libfaad/specrec.h
+++ b/contrib/libfaad/specrec.h
diff --git a/src/libfaad/ssr.c b/contrib/libfaad/ssr.c
index 368112407..368112407 100644
--- a/src/libfaad/ssr.c
+++ b/contrib/libfaad/ssr.c
diff --git a/src/libfaad/ssr.h b/contrib/libfaad/ssr.h
index 7adcf2a11..7adcf2a11 100644
--- a/src/libfaad/ssr.h
+++ b/contrib/libfaad/ssr.h
diff --git a/src/libfaad/ssr_fb.c b/contrib/libfaad/ssr_fb.c
index a977c9411..a977c9411 100644
--- a/src/libfaad/ssr_fb.c
+++ b/contrib/libfaad/ssr_fb.c
diff --git a/src/libfaad/ssr_fb.h b/contrib/libfaad/ssr_fb.h
index 3ae4eb04b..3ae4eb04b 100644
--- a/src/libfaad/ssr_fb.h
+++ b/contrib/libfaad/ssr_fb.h
diff --git a/src/libfaad/ssr_ipqf.c b/contrib/libfaad/ssr_ipqf.c
index 6963427c9..6963427c9 100644
--- a/src/libfaad/ssr_ipqf.c
+++ b/contrib/libfaad/ssr_ipqf.c
diff --git a/src/libfaad/ssr_ipqf.h b/contrib/libfaad/ssr_ipqf.h
index 47299219c..47299219c 100644
--- a/src/libfaad/ssr_ipqf.h
+++ b/contrib/libfaad/ssr_ipqf.h
diff --git a/src/libfaad/ssr_win.h b/contrib/libfaad/ssr_win.h
index 64b0f98bf..64b0f98bf 100644
--- a/src/libfaad/ssr_win.h
+++ b/contrib/libfaad/ssr_win.h
diff --git a/src/libfaad/structs.h b/contrib/libfaad/structs.h
index 5d957c59e..5d957c59e 100644
--- a/src/libfaad/structs.h
+++ b/contrib/libfaad/structs.h
diff --git a/src/libfaad/syntax.c b/contrib/libfaad/syntax.c
index 373582b7f..373582b7f 100644
--- a/src/libfaad/syntax.c
+++ b/contrib/libfaad/syntax.c
diff --git a/src/libfaad/syntax.h b/contrib/libfaad/syntax.h
index 123c4573f..123c4573f 100644
--- a/src/libfaad/syntax.h
+++ b/contrib/libfaad/syntax.h
diff --git a/src/libfaad/tns.c b/contrib/libfaad/tns.c
index 611865204..611865204 100644
--- a/src/libfaad/tns.c
+++ b/contrib/libfaad/tns.c
diff --git a/src/libfaad/tns.h b/contrib/libfaad/tns.h
index 8848c3f2d..8848c3f2d 100644
--- a/src/libfaad/tns.h
+++ b/contrib/libfaad/tns.h
diff --git a/contrib/libmad/COPYING b/contrib/libmad/COPYING
new file mode 100644
index 000000000..d60c31a97
--- /dev/null
+++ b/contrib/libmad/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/contrib/libmad/D.dat b/contrib/libmad/D.dat
new file mode 100644
index 000000000..4a7fa4fa9
--- /dev/null
+++ b/contrib/libmad/D.dat
@@ -0,0 +1,607 @@
+/*
+ * 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.9 2004/01/23 09:41:32 rob 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/contrib/libmad/Makefile.am b/contrib/libmad/Makefile.am
new file mode 100644
index 000000000..f64aba09c
--- /dev/null
+++ b/contrib/libmad/Makefile.am
@@ -0,0 +1,45 @@
+include $(top_srcdir)/misc/Makefile.quiet
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = -DOPT_SPEED
+
+EXTRA_DIST = COPYING
+
+if ENABLE_MAD
+if !WITH_EXTERNAL_MAD
+noinst_LTLIBRARIES = libmad.la
+endif
+endif
+
+##
+## 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: Makefile.am,v 1.23 2004/02/17 02:02:03 rob Exp $
+##
+
+exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \
+ synth.h decoder.h
+
+headers = $(exported_headers) \
+ global.h layer12.h layer3.h huffman.h
+
+data_includes = D.dat imdct_s.dat qc_table.dat rq_table.dat \
+ sf_table.dat
+
+libmad_la_SOURCES = version.c fixed.c bit.c timer.c stream.c frame.c \
+ synth.c decoder.c layer12.c layer3.c huffman.c \
+ $(headers) $(data_includes)
diff --git a/contrib/libmad/bit.c b/contrib/libmad/bit.c
new file mode 100644
index 000000000..c2bfb243c
--- /dev/null
+++ b/contrib/libmad/bit.c
@@ -0,0 +1,237 @@
+/*
+ * 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.12 2004/01/23 09:41:32 rob 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/contrib/libmad/bit.h b/contrib/libmad/bit.h
new file mode 100644
index 000000000..5a51570b2
--- /dev/null
+++ b/contrib/libmad/bit.h
@@ -0,0 +1,47 @@
+/*
+ * 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.12 2004/01/23 09:41:32 rob 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/contrib/libmad/decoder.c b/contrib/libmad/decoder.c
new file mode 100644
index 000000000..6d6df0db5
--- /dev/null
+++ b/contrib/libmad/decoder.c
@@ -0,0 +1,582 @@
+/*
+ * 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: decoder.c,v 1.22 2004/01/23 09:41:32 rob Exp $
+ */
+
+# ifdef HAVE_CONFIG_H
+# include "config.h"
+# endif
+
+# include "global.h"
+
+# ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+# endif
+
+# ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+# endif
+
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+
+# ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+# endif
+
+# include <stdlib.h>
+
+# ifdef HAVE_ERRNO_H
+# include <errno.h>
+# endif
+
+# include "stream.h"
+# include "frame.h"
+# include "synth.h"
+# include "decoder.h"
+
+/*
+ * NAME: decoder->init()
+ * DESCRIPTION: initialize a decoder object with callback routines
+ */
+void mad_decoder_init(struct mad_decoder *decoder, void *data,
+ enum mad_flow (*input_func)(void *,
+ struct mad_stream *),
+ enum mad_flow (*header_func)(void *,
+ struct mad_header const *),
+ enum mad_flow (*filter_func)(void *,
+ struct mad_stream const *,
+ struct mad_frame *),
+ enum mad_flow (*output_func)(void *,
+ struct mad_header const *,
+ struct mad_pcm *),
+ enum mad_flow (*error_func)(void *,
+ struct mad_stream *,
+ struct mad_frame *),
+ enum mad_flow (*message_func)(void *,
+ void *, unsigned int *))
+{
+ decoder->mode = -1;
+
+ decoder->options = 0;
+
+ decoder->async.pid = 0;
+ decoder->async.in = -1;
+ decoder->async.out = -1;
+
+ decoder->sync = 0;
+
+ decoder->cb_data = data;
+
+ decoder->input_func = input_func;
+ decoder->header_func = header_func;
+ decoder->filter_func = filter_func;
+ decoder->output_func = output_func;
+ decoder->error_func = error_func;
+ decoder->message_func = message_func;
+}
+
+int mad_decoder_finish(struct mad_decoder *decoder)
+{
+# if defined(USE_ASYNC)
+ if (decoder->mode == MAD_DECODER_MODE_ASYNC && decoder->async.pid) {
+ pid_t pid;
+ int status;
+
+ close(decoder->async.in);
+
+ do
+ pid = waitpid(decoder->async.pid, &status, 0);
+ while (pid == -1 && errno == EINTR);
+
+ decoder->mode = -1;
+
+ close(decoder->async.out);
+
+ decoder->async.pid = 0;
+ decoder->async.in = -1;
+ decoder->async.out = -1;
+
+ if (pid == -1)
+ return -1;
+
+ return (!WIFEXITED(status) || WEXITSTATUS(status)) ? -1 : 0;
+ }
+# endif
+
+ return 0;
+}
+
+# if defined(USE_ASYNC)
+static
+enum mad_flow send_io(int fd, void const *data, size_t len)
+{
+ char const *ptr = data;
+ ssize_t count;
+
+ while (len) {
+ do
+ count = write(fd, ptr, len);
+ while (count == -1 && errno == EINTR);
+
+ if (count == -1)
+ return MAD_FLOW_BREAK;
+
+ len -= count;
+ ptr += count;
+ }
+
+ return MAD_FLOW_CONTINUE;
+}
+
+static
+enum mad_flow receive_io(int fd, void *buffer, size_t len)
+{
+ char *ptr = buffer;
+ ssize_t count;
+
+ while (len) {
+ do
+ count = read(fd, ptr, len);
+ while (count == -1 && errno == EINTR);
+
+ if (count == -1)
+ return (errno == EAGAIN) ? MAD_FLOW_IGNORE : MAD_FLOW_BREAK;
+ else if (count == 0)
+ return MAD_FLOW_STOP;
+
+ len -= count;
+ ptr += count;
+ }
+
+ return MAD_FLOW_CONTINUE;
+}
+
+static
+enum mad_flow receive_io_blocking(int fd, void *buffer, size_t len)
+{
+ int flags, blocking;
+ enum mad_flow result;
+
+ flags = fcntl(fd, F_GETFL);
+ if (flags == -1)
+ return MAD_FLOW_BREAK;
+
+ blocking = flags & ~O_NONBLOCK;
+
+ if (blocking != flags &&
+ fcntl(fd, F_SETFL, blocking) == -1)
+ return MAD_FLOW_BREAK;
+
+ result = receive_io(fd, buffer, len);
+
+ if (flags != blocking &&
+ fcntl(fd, F_SETFL, flags) == -1)
+ return MAD_FLOW_BREAK;
+
+ return result;
+}
+
+static
+enum mad_flow send(int fd, void const *message, unsigned int size)
+{
+ enum mad_flow result;
+
+ /* send size */
+
+ result = send_io(fd, &size, sizeof(size));
+
+ /* send message */
+
+ if (result == MAD_FLOW_CONTINUE)
+ result = send_io(fd, message, size);
+
+ return result;
+}
+
+static
+enum mad_flow receive(int fd, void **message, unsigned int *size)
+{
+ enum mad_flow result;
+ unsigned int actual;
+
+ if (*message == 0)
+ *size = 0;
+
+ /* receive size */
+
+ result = receive_io(fd, &actual, sizeof(actual));
+
+ /* receive message */
+
+ if (result == MAD_FLOW_CONTINUE) {
+ if (actual > *size)
+ actual -= *size;
+ else {
+ *size = actual;
+ actual = 0;
+ }
+
+ if (*size > 0) {
+ if (*message == 0) {
+ *message = malloc(*size);
+ if (*message == 0)
+ return MAD_FLOW_BREAK;
+ }
+
+ result = receive_io_blocking(fd, *message, *size);
+ }
+
+ /* throw away remainder of message */
+
+ while (actual && result == MAD_FLOW_CONTINUE) {
+ char sink[256];
+ unsigned int len;
+
+ len = actual > sizeof(sink) ? sizeof(sink) : actual;
+
+ result = receive_io_blocking(fd, sink, len);
+
+ actual -= len;
+ }
+ }
+
+ return result;
+}
+
+static
+enum mad_flow check_message(struct mad_decoder *decoder)
+{
+ enum mad_flow result;
+ void *message = 0;
+ unsigned int size;
+
+ result = receive(decoder->async.in, &message, &size);
+
+ if (result == MAD_FLOW_CONTINUE) {
+ if (decoder->message_func == 0)
+ size = 0;
+ else {
+ result = decoder->message_func(decoder->cb_data, message, &size);
+
+ if (result == MAD_FLOW_IGNORE ||
+ result == MAD_FLOW_BREAK)
+ size = 0;
+ }
+
+ if (send(decoder->async.out, message, size) != MAD_FLOW_CONTINUE)
+ result = MAD_FLOW_BREAK;
+ }
+
+ if (message)
+ free(message);
+
+ return result;
+}
+# endif
+
+static
+enum mad_flow error_default(void *data, struct mad_stream *stream,
+ struct mad_frame *frame)
+{
+ int *bad_last_frame = data;
+
+ switch (stream->error) {
+ case MAD_ERROR_BADCRC:
+ if (*bad_last_frame)
+ mad_frame_mute(frame);
+ else
+ *bad_last_frame = 1;
+
+ return MAD_FLOW_IGNORE;
+
+ default:
+ return MAD_FLOW_CONTINUE;
+ }
+}
+
+static
+int run_sync(struct mad_decoder *decoder)
+{
+ enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *);
+ void *error_data;
+ int bad_last_frame = 0;
+ struct mad_stream *stream;
+ struct mad_frame *frame;
+ struct mad_synth *synth;
+ int result = 0;
+
+ if (decoder->input_func == 0)
+ return 0;
+
+ if (decoder->error_func) {
+ error_func = decoder->error_func;
+ error_data = decoder->cb_data;
+ }
+ else {
+ error_func = error_default;
+ error_data = &bad_last_frame;
+ }
+
+ stream = &decoder->sync->stream;
+ frame = &decoder->sync->frame;
+ synth = &decoder->sync->synth;
+
+ mad_stream_init(stream);
+ mad_frame_init(frame);
+ mad_synth_init(synth);
+
+ mad_stream_options(stream, decoder->options);
+
+ do {
+ switch (decoder->input_func(decoder->cb_data, stream)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ continue;
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
+
+ while (1) {
+# if defined(USE_ASYNC)
+ if (decoder->mode == MAD_DECODER_MODE_ASYNC) {
+ switch (check_message(decoder)) {
+ case MAD_FLOW_IGNORE:
+ case MAD_FLOW_CONTINUE:
+ break;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_STOP:
+ goto done;
+ }
+ }
+# endif
+
+ if (decoder->header_func) {
+ if (mad_header_decode(&frame->header, stream) == -1) {
+ if (!MAD_RECOVERABLE(stream->error))
+ break;
+
+ switch (error_func(error_data, stream, frame)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ case MAD_FLOW_CONTINUE:
+ default:
+ continue;
+ }
+ }
+
+ switch (decoder->header_func(decoder->cb_data, &frame->header)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ continue;
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
+ }
+
+ if (mad_frame_decode(frame, stream) == -1) {
+ if (!MAD_RECOVERABLE(stream->error))
+ break;
+
+ switch (error_func(error_data, stream, frame)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ break;
+ case MAD_FLOW_CONTINUE:
+ default:
+ continue;
+ }
+ }
+ else
+ bad_last_frame = 0;
+
+ if (decoder->filter_func) {
+ switch (decoder->filter_func(decoder->cb_data, stream, frame)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ continue;
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
+ }
+
+ mad_synth_frame(synth, frame);
+
+ if (decoder->output_func) {
+ switch (decoder->output_func(decoder->cb_data,
+ &frame->header, &synth->pcm)) {
+ case MAD_FLOW_STOP:
+ goto done;
+ case MAD_FLOW_BREAK:
+ goto fail;
+ case MAD_FLOW_IGNORE:
+ case MAD_FLOW_CONTINUE:
+ break;
+ }
+ }
+ }
+ }
+ while (stream->error == MAD_ERROR_BUFLEN);
+
+ fail:
+ result = -1;
+
+ done:
+ mad_synth_finish(synth);
+ mad_frame_finish(frame);
+ mad_stream_finish(stream);
+
+ return result;
+}
+
+# if defined(USE_ASYNC)
+static
+int run_async(struct mad_decoder *decoder)
+{
+ pid_t pid;
+ int ptoc[2], ctop[2], flags;
+
+ if (pipe(ptoc) == -1)
+ return -1;
+
+ if (pipe(ctop) == -1) {
+ close(ptoc[0]);
+ close(ptoc[1]);
+ return -1;
+ }
+
+ flags = fcntl(ptoc[0], F_GETFL);
+ if (flags == -1 ||
+ fcntl(ptoc[0], F_SETFL, flags | O_NONBLOCK) == -1) {
+ close(ctop[0]);
+ close(ctop[1]);
+ close(ptoc[0]);
+ close(ptoc[1]);
+ return -1;
+ }
+
+ pid = fork();
+ if (pid == -1) {
+ close(ctop[0]);
+ close(ctop[1]);
+ close(ptoc[0]);
+ close(ptoc[1]);
+ return -1;
+ }
+
+ decoder->async.pid = pid;
+
+ if (pid) {
+ /* parent */
+
+ close(ptoc[0]);
+ close(ctop[1]);
+
+ decoder->async.in = ctop[0];
+ decoder->async.out = ptoc[1];
+
+ return 0;
+ }
+
+ /* child */
+
+ close(ptoc[1]);
+ close(ctop[0]);
+
+ decoder->async.in = ptoc[0];
+ decoder->async.out = ctop[1];
+
+ _exit(run_sync(decoder));
+
+ /* not reached */
+ return -1;
+}
+# endif
+
+/*
+ * NAME: decoder->run()
+ * DESCRIPTION: run the decoder thread either synchronously or asynchronously
+ */
+int mad_decoder_run(struct mad_decoder *decoder, enum mad_decoder_mode mode)
+{
+ int result;
+ int (*run)(struct mad_decoder *) = 0;
+
+ switch (decoder->mode = mode) {
+ case MAD_DECODER_MODE_SYNC:
+ run = run_sync;
+ break;
+
+ case MAD_DECODER_MODE_ASYNC:
+# if defined(USE_ASYNC)
+ run = run_async;
+# endif
+ break;
+ }
+
+ if (run == 0)
+ return -1;
+
+ decoder->sync = malloc(sizeof(*decoder->sync));
+ if (decoder->sync == 0)
+ return -1;
+
+ result = run(decoder);
+
+ free(decoder->sync);
+ decoder->sync = 0;
+
+ return result;
+}
+
+/*
+ * NAME: decoder->message()
+ * DESCRIPTION: send a message to and receive a reply from the decoder process
+ */
+int mad_decoder_message(struct mad_decoder *decoder,
+ void *message, unsigned int *len)
+{
+# if defined(USE_ASYNC)
+ if (decoder->mode != MAD_DECODER_MODE_ASYNC ||
+ send(decoder->async.out, message, *len) != MAD_FLOW_CONTINUE ||
+ receive(decoder->async.in, &message, len) != MAD_FLOW_CONTINUE)
+ return -1;
+
+ return 0;
+# else
+ return -1;
+# endif
+}
diff --git a/contrib/libmad/decoder.h b/contrib/libmad/decoder.h
new file mode 100644
index 000000000..f0ad758dd
--- /dev/null
+++ b/contrib/libmad/decoder.h
@@ -0,0 +1,91 @@
+/*
+ * 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: decoder.h,v 1.17 2004/01/23 09:41:32 rob Exp $
+ */
+
+# ifndef LIBMAD_DECODER_H
+# define LIBMAD_DECODER_H
+
+# include "stream.h"
+# include "frame.h"
+# include "synth.h"
+
+enum mad_decoder_mode {
+ MAD_DECODER_MODE_SYNC = 0,
+ MAD_DECODER_MODE_ASYNC
+};
+
+enum mad_flow {
+ MAD_FLOW_CONTINUE = 0x0000, /* continue normally */
+ MAD_FLOW_STOP = 0x0010, /* stop decoding normally */
+ MAD_FLOW_BREAK = 0x0011, /* stop decoding and signal an error */
+ MAD_FLOW_IGNORE = 0x0020 /* ignore the current frame */
+};
+
+struct mad_decoder {
+ enum mad_decoder_mode mode;
+
+ int options;
+
+ struct {
+ long pid;
+ int in;
+ int out;
+ } async;
+
+ struct {
+ struct mad_stream stream;
+ struct mad_frame frame;
+ struct mad_synth synth;
+ } *sync;
+
+ void *cb_data;
+
+ enum mad_flow (*input_func)(void *, struct mad_stream *);
+ enum mad_flow (*header_func)(void *, struct mad_header const *);
+ enum mad_flow (*filter_func)(void *,
+ struct mad_stream const *, struct mad_frame *);
+ enum mad_flow (*output_func)(void *,
+ struct mad_header const *, struct mad_pcm *);
+ enum mad_flow (*error_func)(void *, struct mad_stream *, struct mad_frame *);
+ enum mad_flow (*message_func)(void *, void *, unsigned int *);
+};
+
+void mad_decoder_init(struct mad_decoder *, void *,
+ enum mad_flow (*)(void *, struct mad_stream *),
+ enum mad_flow (*)(void *, struct mad_header const *),
+ enum mad_flow (*)(void *,
+ struct mad_stream const *,
+ struct mad_frame *),
+ enum mad_flow (*)(void *,
+ struct mad_header const *,
+ struct mad_pcm *),
+ enum mad_flow (*)(void *,
+ struct mad_stream *,
+ struct mad_frame *),
+ enum mad_flow (*)(void *, void *, unsigned int *));
+int mad_decoder_finish(struct mad_decoder *);
+
+# define mad_decoder_options(decoder, opts) \
+ ((void) ((decoder)->options = (opts)))
+
+int mad_decoder_run(struct mad_decoder *, enum mad_decoder_mode);
+int mad_decoder_message(struct mad_decoder *, void *, unsigned int *);
+
+# endif
diff --git a/contrib/libmad/fixed.c b/contrib/libmad/fixed.c
new file mode 100644
index 000000000..9785466f6
--- /dev/null
+++ b/contrib/libmad/fixed.c
@@ -0,0 +1,81 @@
+/*
+ * 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.13 2004/01/23 09:41:32 rob 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/contrib/libmad/fixed.h b/contrib/libmad/fixed.h
new file mode 100644
index 000000000..4b58abf56
--- /dev/null
+++ b/contrib/libmad/fixed.h
@@ -0,0 +1,499 @@
+/*
+ * 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.38 2004/02/17 02:02:03 rob 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/contrib/libmad/frame.c b/contrib/libmad/frame.c
new file mode 100644
index 000000000..0cb3d0f33
--- /dev/null
+++ b/contrib/libmad/frame.c
@@ -0,0 +1,503 @@
+/*
+ * 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.29 2004/02/04 22:59:19 rob 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/contrib/libmad/frame.h b/contrib/libmad/frame.h
new file mode 100644
index 000000000..3f5bf37ef
--- /dev/null
+++ b/contrib/libmad/frame.h
@@ -0,0 +1,118 @@
+/*
+ * 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.20 2004/01/23 09:41:32 rob 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/contrib/libmad/global.h b/contrib/libmad/global.h
new file mode 100644
index 000000000..a6debfd8b
--- /dev/null
+++ b/contrib/libmad/global.h
@@ -0,0 +1,58 @@
+/*
+ * 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.11 2004/01/23 09:41:32 rob 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/contrib/libmad/huffman.c b/contrib/libmad/huffman.c
new file mode 100644
index 000000000..a230a9c10
--- /dev/null
+++ b/contrib/libmad/huffman.c
@@ -0,0 +1,3109 @@
+/*
+ * 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.10 2004/01/23 09:41:32 rob 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/contrib/libmad/huffman.h b/contrib/libmad/huffman.h
new file mode 100644
index 000000000..6325db44a
--- /dev/null
+++ b/contrib/libmad/huffman.h
@@ -0,0 +1,66 @@
+/*
+ * 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.11 2004/01/23 09:41:32 rob 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/contrib/libmad/imdct_s.dat b/contrib/libmad/imdct_s.dat
new file mode 100644
index 000000000..476710eaf
--- /dev/null
+++ b/contrib/libmad/imdct_s.dat
@@ -0,0 +1,62 @@
+/*
+ * 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.8 2004/01/23 09:41:32 rob 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/contrib/libmad/layer12.c b/contrib/libmad/layer12.c
new file mode 100644
index 000000000..6981f9ce1
--- /dev/null
+++ b/contrib/libmad/layer12.c
@@ -0,0 +1,534 @@
+/*
+ * 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.17 2004/02/05 09:02:39 rob 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/contrib/libmad/layer12.h b/contrib/libmad/layer12.h
new file mode 100644
index 000000000..e1c499696
--- /dev/null
+++ b/contrib/libmad/layer12.h
@@ -0,0 +1,31 @@
+/*
+ * 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.10 2004/01/23 09:41:32 rob 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/contrib/libmad/layer3.c b/contrib/libmad/layer3.c
new file mode 100644
index 000000000..4e5d3fa02
--- /dev/null
+++ b/contrib/libmad/layer3.c
@@ -0,0 +1,2698 @@
+/*
+ * 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.43 2004/01/23 09:41:32 rob 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;
+ register mad_fixed64lo_t lo;
+
+ 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/contrib/libmad/layer3.h b/contrib/libmad/layer3.h
new file mode 100644
index 000000000..2504d461a
--- /dev/null
+++ b/contrib/libmad/layer3.h
@@ -0,0 +1,30 @@
+/*
+ * 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.10 2004/01/23 09:41:32 rob 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/contrib/libmad/qc_table.dat b/contrib/libmad/qc_table.dat
new file mode 100644
index 000000000..35a22234f
--- /dev/null
+++ b/contrib/libmad/qc_table.dat
@@ -0,0 +1,77 @@
+/*
+ * 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: qc_table.dat,v 1.7 2004/01/23 09:41:32 rob 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/contrib/libmad/rq_table.dat b/contrib/libmad/rq_table.dat
new file mode 100644
index 000000000..059c4f318
--- /dev/null
+++ b/contrib/libmad/rq_table.dat
@@ -0,0 +1,8747 @@
+/*
+ * 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: rq_table.dat,v 1.7 2004/01/23 09:41:32 rob 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/contrib/libmad/sf_table.dat b/contrib/libmad/sf_table.dat
new file mode 100644
index 000000000..db1484a0e
--- /dev/null
+++ b/contrib/libmad/sf_table.dat
@@ -0,0 +1,106 @@
+/*
+ * 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: sf_table.dat,v 1.7 2004/01/23 09:41:33 rob 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.
+ *
+ * Strictly speaking, Table B.1 has only 63 entries (0-62), thus a strict
+ * interpretation of ISO/IEC 11172-3 would suggest that a scalefactor index of
+ * 63 is invalid. However, for better compatibility with current practices, we
+ * add a 64th entry.
+ */
+
+ 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 */
+ MAD_F(0x00000000) /* this compatibility entry is not part of Table B.1 */
diff --git a/contrib/libmad/stream.c b/contrib/libmad/stream.c
new file mode 100644
index 000000000..8bb4d6a49
--- /dev/null
+++ b/contrib/libmad/stream.c
@@ -0,0 +1,161 @@
+/*
+ * 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.12 2004/02/05 09:02:39 rob 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/contrib/libmad/stream.h b/contrib/libmad/stream.h
new file mode 100644
index 000000000..8bff8b49d
--- /dev/null
+++ b/contrib/libmad/stream.h
@@ -0,0 +1,108 @@
+/*
+ * 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.20 2004/02/05 09:02:39 rob 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/contrib/libmad/synth.c b/contrib/libmad/synth.c
new file mode 100644
index 000000000..1d28d438c
--- /dev/null
+++ b/contrib/libmad/synth.c
@@ -0,0 +1,857 @@
+/*
+ * 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.25 2004/01/23 09:41:33 rob 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;
+ register mad_fixed64lo_t lo;
+
+ 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;
+ register mad_fixed64lo_t lo;
+
+ 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/contrib/libmad/synth.h b/contrib/libmad/synth.h
new file mode 100644
index 000000000..8ae4bc95e
--- /dev/null
+++ b/contrib/libmad/synth.h
@@ -0,0 +1,69 @@
+/*
+ * 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.15 2004/01/23 09:41:33 rob 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/contrib/libmad/timer.c b/contrib/libmad/timer.c
new file mode 100644
index 000000000..4b909aba9
--- /dev/null
+++ b/contrib/libmad/timer.c
@@ -0,0 +1,485 @@
+/*
+ * 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.18 2004/01/23 09:41:33 rob 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/contrib/libmad/timer.h b/contrib/libmad/timer.h
new file mode 100644
index 000000000..eb4542bb9
--- /dev/null
+++ b/contrib/libmad/timer.h
@@ -0,0 +1,100 @@
+/*
+ * 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.16 2004/01/23 09:41:33 rob 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/contrib/libmad/version.c b/contrib/libmad/version.c
new file mode 100644
index 000000000..e643fa71e
--- /dev/null
+++ b/contrib/libmad/version.c
@@ -0,0 +1,91 @@
+/*
+ * 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.15 2004/01/23 09:41:33 rob 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/contrib/libmad/version.h b/contrib/libmad/version.h
new file mode 100644
index 000000000..d215d4c10
--- /dev/null
+++ b/contrib/libmad/version.h
@@ -0,0 +1,47 @@
+/*
+ * 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.26 2004/01/23 09:41:33 rob 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/contrib/libmpcdec/COPYING b/contrib/libmpcdec/COPYING
new file mode 100644
index 000000000..10190c014
--- /dev/null
+++ b/contrib/libmpcdec/COPYING
@@ -0,0 +1,31 @@
+Copyright (c) 2005, 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.
diff --git a/contrib/libmpcdec/Makefile.am b/contrib/libmpcdec/Makefile.am
new file mode 100644
index 000000000..74be25730
--- /dev/null
+++ b/contrib/libmpcdec/Makefile.am
@@ -0,0 +1,16 @@
+include $(top_srcdir)/misc/Makefile.quiet
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+EXTRA_DIST = diff_from_libmpcdec_1.2.5.patch COPYING
+
+if ENABLE_MUSEPACK
+if !WITH_EXTERNAL_LIBMPCDEC
+noinst_LTLIBRARIES = libmpcdec.la
+endif
+endif
+
+libmpcdec_la_SOURCES = huffsv46.c huffsv7.c idtag.c mpc_decoder.c mpc_reader.c \
+ requant.c streaminfo.c synth_filter.c \
+ mpcdec/internal.h mpcdec/mpcdec.h mpcdec/streaminfo.h mpcdec/math.h \
+ mpcdec/decoder.h mpcdec/config_types.h mpcdec/requant.h mpcdec/huffman.h \
+ mpcdec/reader.h
diff --git a/contrib/libmpcdec/diff_from_libmpcdec_1.2.5.patch b/contrib/libmpcdec/diff_from_libmpcdec_1.2.5.patch
new file mode 100644
index 000000000..f0e3b0cb6
--- /dev/null
+++ b/contrib/libmpcdec/diff_from_libmpcdec_1.2.5.patch
@@ -0,0 +1,20 @@
+Use xine's os_types.h file.
+Define MPC_LITTLE_ENDIAN when needed.
+
+Index: libmpcdec/mpcdec/config_types.h
+===================================================================
+--- libmpcdec.orig/mpcdec/config_types.h
++++ libmpcdec/mpcdec/config_types.h
+@@ -35,7 +35,11 @@
+ #ifndef __MUSEPACK_CONFIG_TYPES_H__
+ #define __MUSEPACK_CONFIG_TYPES_H__
+
+-#include <inttypes.h>
++#include "os_types.h"
++
++#ifndef WORDS_BIGENDIAN
++# define MPC_LITTLE_ENDIAN
++#endif
+
+ typedef unsigned char mpc_bool_t;
+ #define TRUE 1
diff --git a/contrib/libmpcdec/huffsv46.c b/contrib/libmpcdec/huffsv46.c
new file mode 100644
index 000000000..a6f031160
--- /dev/null
+++ b/contrib/libmpcdec/huffsv46.c
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+#ifdef MPC_SUPPORT_SV456
+
+
+const HuffmanTyp mpc_table_SCFI_Bundle [ 8] =
+{{2147483648u,1,7},{1073741824u,2,3},{939524096u,5,1},{805306368u,5,2},{738197504u,6,0},{671088640u,6,6},{536870912u,5,4},{0u,3,5},};
+const HuffmanTyp mpc_table_DSCF_Entropie [13] =
+{{3758096384u,3,1},{3489660928u,4,3},{3355443200u,5,5},{3221225472u,5,-3},{2952790016u,4,-2},{2684354560u,4,4},{2147483648u,3,-1},{1610612736u,3,2},{1476395008u,5,-5},{1409286144u,6,6},{1342177280u,6,-6},{1073741824u,4,-4},{0u,2,0},};
+const HuffmanTyp mpc_table_Region_A [16] =
+{{2147483648u,1,1},{2013265920u,5,3},{1946157056u,6,4},{1912602624u,7,7},{1895825408u,8,8},{1887436800u,9,9},{1883242496u,10,10},{1881145344u,11,11},{1880096768u,12,12},{1879572480u,13,13},{1879310336u,14,14},{1879048192u,14,15},{1744830464u,5,5},{1610612736u,5,6},{1073741824u,3,0},{0u,2,2},};
+const HuffmanTyp mpc_table_Region_B [ 8] =
+{{2147483648u,1,1},{1073741824u,2,0},{536870912u,3,2},{268435456u,4,3},{134217728u,5,4},{67108864u,6,5},{33554432u,7,6},{0u,7,7},};
+const HuffmanTyp mpc_table_Region_C [ 4] =
+{{2147483648u,1,0},{1073741824u,2,1},{536870912u,3,2},{0u,3,3},};
+
+static const HuffmanTyp mpc_table_Entropie_1 [ 3] =
+{{2147483648u,1,0},{1073741824u,2,-1},{0u,2,1},};
+static const HuffmanTyp mpc_table_Entropie_2 [ 5] =
+{{3221225472u,2,0},{2684354560u,3,2},{2147483648u,3,-2},{1073741824u,2,1},{0u,2,-1},};
+static const HuffmanTyp mpc_table_Entropie_3 [ 7] =
+{{3221225472u,2,0},{2684354560u,3,-2},{2415919104u,4,2},{2281701376u,5,-3},{2147483648u,5,3},{1073741824u,2,-1},{0u,2,1},};
+static const HuffmanTyp mpc_table_Entropie_4 [ 9] =
+{{4026531840u,4,3},{3758096384u,4,-3},{3221225472u,3,1},{2684354560u,3,-1},{2147483648u,3,2},{1610612736u,3,-2},{1342177280u,4,-4},{1073741824u,4,4},{0u,2,0},};
+static const HuffmanTyp mpc_table_Entropie_5 [15] =
+{{4026531840u,4,-2},{3892314112u,5,-5},{3825205248u,6,-7},{3758096384u,6,7},{3489660928u,4,-3},{3221225472u,4,3},{3087007744u,5,-6},{2952790016u,5,6},{2684354560u,4,4},{2147483648u,3,0},{1610612736u,3,1},{1073741824u,3,-1},{805306368u,4,-4},{536870912u,4,5},{0u,3,2},};
+static const HuffmanTyp mpc_table_Entropie_6 [31] =
+{{4160749568u,5,-4},{4026531840u,5,5},{3892314112u,5,-5},{3825205248u,6,10},{3758096384u,6,-10},{3623878656u,5,-6},{3489660928u,5,6},{3355443200u,5,7},{3221225472u,5,-7},{3087007744u,5,-8},{3019898880u,6,-11},{2986344448u,7,14},{2952790016u,7,-14},{2818572288u,5,8},{2751463424u,6,11},{2684354560u,6,-13},{2415919104u,4,0},{2147483648u,4,1},{1879048192u,4,-1},{1610612736u,4,3},{1342177280u,4,2},{1207959552u,5,-9},{1140850688u,6,12},{1073741824u,6,13},{805306368u,4,-3},{536870912u,4,-2},{402653184u,5,9},{335544320u,6,-12},{301989888u,7,15},{268435456u,7,-15},{0u,4,4},};
+static const HuffmanTyp mpc_table_Entropie_7 [63] =
+{{4278190080u,8,28},{4261412864u,8,26},{4227858432u,7,-20},{4160749568u,6,8},{4093640704u,6,-8},{4026531840u,6,-9},{3959422976u,6,9},{3925868544u,7,20},{3892314112u,7,21},{3825205248u,6,-10},{3758096384u,6,-11},{3690987520u,6,10},{3623878656u,6,11},{3590324224u,7,-21},{3573547008u,8,29},{3556769792u,8,-29},{3489660928u,6,13},{3422552064u,6,-13},{3355443200u,6,-12},{3288334336u,6,12},{3254779904u,7,-22},{3221225472u,7,22},{3154116608u,6,14},{3087007744u,6,15},{3019898880u,6,-14},{2986344448u,7,-23},{2952790016u,7,23},{2885681152u,6,-15},{2818572288u,6,-16},{2751463424u,6,16},{2717908992u,7,27},{2684354560u,7,-27},{2617245696u,6,17},{2550136832u,6,-17},{2533359616u,8,-30},{2516582400u,8,30},{2483027968u,7,24},{2415919104u,6,-18},{2281701376u,5,-1},{2147483648u,5,1},{2113929216u,7,-24},{2080374784u,7,25},{2013265920u,6,18},{1879048192u,5,-3},{1744830464u,5,3},{1610612736u,5,5},{1476395008u,5,0},{1342177280u,5,-2},{1275068416u,6,19},{1207959552u,6,-19},{1073741824u,5,-5},{939524096u,5,-4},{805306368u,5,-7},{671088640u,5,2},{536870912u,5,4},{402653184u,5,7},{369098752u,7,-25},{335544320u,7,-26},{301989888u,7,-28},{285212672u,8,-31},{268435456u,8,31},{134217728u,5,6},{0u,5,-6},};
+
+const HuffmanTyp* mpc_table_SampleHuff [18] = {
+ NULL,mpc_table_Entropie_1,mpc_table_Entropie_2,mpc_table_Entropie_3,mpc_table_Entropie_4,mpc_table_Entropie_5,mpc_table_Entropie_6,mpc_table_Entropie_7,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL
+};
+
+#endif //#ifdef MPC_SUPPORT_SV456
diff --git a/contrib/libmpcdec/huffsv7.c b/contrib/libmpcdec/huffsv7.c
new file mode 100644
index 000000000..96f81ce24
--- /dev/null
+++ b/contrib/libmpcdec/huffsv7.c
@@ -0,0 +1,81 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/huffman.h>
+#include <mpcdec/requant.h>
+
+const HuffmanTyp mpc_table_HuffHdr [10] =
+{{2147483648u,1,0},{1610612736u,3,1},{1577058304u,7,-4},{1568669696u,9,3},{1560281088u,9,4},{1543503872u,8,-5},{1476395008u,6,2},{1342177280u,5,-3},{1073741824u,4,-2},{0u,2,-1},};
+const HuffmanTyp mpc_table_HuffSCFI [ 4] =
+{{2147483648u,1,1},{1610612736u,3,2},{1073741824u,3,0},{0u,2,3},};
+const HuffmanTyp mpc_table_HuffDSCF [16] =
+{{4160749568u,5,5},{4026531840u,5,-4},{3758096384u,4,3},{3489660928u,4,-3},{3221225472u,4,8},{2684354560u,3,1},{2415919104u,4,0},{2281701376u,5,-5},{2214592512u,6,7},{2147483648u,6,-7},{1610612736u,3,-1},{1073741824u,3,2},{805306368u,4,4},{671088640u,5,6},{536870912u,5,-6},{0u,3,-2},};
+
+static const HuffmanTyp mpc_table_HuffQ1 [2] [3*3*3] = {
+ {{3758096384u,3,13},{3690987520u,6,26},{3623878656u,6,0},{3556769792u,6,20},{3489660928u,6,6},{3221225472u,4,14},{2952790016u,4,12},{2684354560u,4,4},{2415919104u,4,22},{2348810240u,6,8},{2281701376u,6,18},{2214592512u,6,24},{2147483648u,6,2},{1879048192u,4,16},{1610612736u,4,10},{1476395008u,5,17},{1342177280u,5,9},{1207959552u,5,1},{1073741824u,5,25},{939524096u,5,5},{805306368u,5,21},{671088640u,5,3},{536870912u,5,11},{402653184u,5,15},{268435456u,5,23},{134217728u,5,19},{0u,5,7},},
+ {{2147483648u,1,13},{2113929216u,7,15},{2080374784u,7,1},{2046820352u,7,11},{2013265920u,7,7},{1979711488u,7,17},{1946157056u,7,25},{1912602624u,7,19},{1904214016u,9,8},{1895825408u,9,18},{1887436800u,9,2},{1879048192u,9,24},{1845493760u,7,3},{1811939328u,7,23},{1778384896u,7,21},{1744830464u,7,5},{1728053248u,8,0},{1711276032u,8,26},{1694498816u,8,6},{1677721600u,8,20},{1610612736u,6,9},{1342177280u,4,14},{1073741824u,4,12},{805306368u,4,4},{536870912u,4,22},{268435456u,4,16},{0u,4,10},},
+};
+static const HuffmanTyp mpc_table_HuffQ2 [2] [5*5] = {
+ {{4026531840u,4,13},{3758096384u,4,17},{3489660928u,4,7},{3221225472u,4,11},{3154116608u,6,1},{3087007744u,6,23},{3053453312u,7,4},{3019898880u,7,20},{2986344448u,7,0},{2952790016u,7,24},{2818572288u,5,22},{2684354560u,5,10},{2147483648u,3,12},{2013265920u,5,2},{1879048192u,5,14},{1610612736u,4,6},{1342177280u,4,18},{1073741824u,4,8},{805306368u,4,16},{671088640u,5,9},{536870912u,5,5},{402653184u,5,15},{268435456u,5,21},{134217728u,5,19},{0u,5,3},},
+ {{4160749568u,5,18},{4026531840u,5,6},{3892314112u,5,8},{3875536896u,8,3},{3871342592u,10,24},{3867148288u,10,4},{3862953984u,10,0},{3858759680u,10,20},{3825205248u,7,23},{3791650816u,7,1},{3758096384u,7,19},{3623878656u,5,16},{3590324224u,7,15},{3556769792u,7,21},{3523215360u,7,9},{3489660928u,7,5},{3422552064u,6,2},{3355443200u,6,10},{3288334336u,6,14},{3221225472u,6,22},{2147483648u,2,12},{1610612736u,3,13},{1073741824u,3,17},{536870912u,3,11},{0u,3,7},},
+};
+static const HuffmanTyp mpc_table_HuffQ3 [2] [ 7] = {
+ {{3758096384u,3,1},{3489660928u,4,3},{3221225472u,4,-3},{2684354560u,3,2},{2147483648u,3,-2},{1073741824u,2,0},{0u,2,-1},},
+ {{3221225472u,2,0},{2147483648u,2,-1},{1073741824u,2,1},{805306368u,4,-2},{671088640u,5,3},{536870912u,5,-3},{0u,3,2},},
+};
+static const HuffmanTyp mpc_table_HuffQ4 [2] [ 9] = {
+ {{3758096384u,3,0},{3221225472u,3,-1},{2684354560u,3,1},{2147483648u,3,-2},{1610612736u,3,2},{1342177280u,4,-4},{1073741824u,4,4},{536870912u,3,3},{0u,3,-3},},
+ {{3758096384u,3,1},{3489660928u,4,2},{3221225472u,4,-3},{2147483648u,2,0},{1610612736u,3,-2},{1342177280u,4,3},{1207959552u,5,-4},{1073741824u,5,4},{0u,2,-1},},
+};
+static const HuffmanTyp mpc_table_HuffQ5 [2] [15] = {
+ {{4026531840u,4,2},{3892314112u,5,5},{3825205248u,6,-7},{3758096384u,6,7},{3489660928u,4,-3},{3221225472u,4,3},{3087007744u,5,-6},{2952790016u,5,6},{2684354560u,4,-4},{2415919104u,4,4},{2147483648u,4,-5},{1610612736u,3,0},{1073741824u,3,-1},{536870912u,3,1},{0u,3,-2},},
+ {{4026531840u,4,3},{3892314112u,5,4},{3858759680u,7,6},{3841982464u,8,-7},{3825205248u,8,7},{3758096384u,6,-6},{3221225472u,3,0},{2684354560u,3,-1},{2147483648u,3,1},{1610612736u,3,-2},{1073741824u,3,2},{939524096u,5,-5},{805306368u,5,5},{536870912u,4,-4},{0u,3,-3},},
+};
+static const HuffmanTyp mpc_table_HuffQ6 [2] [31] = {
+ {{4160749568u,5,3},{4026531840u,5,-4},{3959422976u,6,-11},{3892314112u,6,12},{3758096384u,5,4},{3623878656u,5,6},{3489660928u,5,-5},{3355443200u,5,5},{3221225472u,5,7},{3087007744u,5,-7},{3019898880u,6,-12},{2952790016u,6,-13},{2818572288u,5,-6},{2684354560u,5,8},{2550136832u,5,-8},{2415919104u,5,9},{2281701376u,5,-9},{2214592512u,6,13},{2181038080u,7,-15},{2147483648u,7,15},{1879048192u,4,0},{1744830464u,5,-10},{1610612736u,5,10},{1342177280u,4,-1},{1073741824u,4,2},{805306368u,4,1},{536870912u,4,-2},{469762048u,6,14},{402653184u,6,-14},{268435456u,5,11},{0u,4,-3},},
+ {{4160749568u,5,-6},{4026531840u,5,6},{3758096384u,4,1},{3489660928u,4,-1},{3456106496u,7,10},{3422552064u,7,-10},{3405774848u,8,-11},{3397386240u,9,-12},{3395289088u,11,13},{3394764800u,13,15},{3394240512u,13,-14},{3393716224u,13,14},{3393191936u,13,-15},{3388997632u,10,-13},{3372220416u,8,11},{3355443200u,8,12},{3288334336u,6,-9},{3221225472u,6,9},{2952790016u,4,-2},{2684354560u,4,2},{2415919104u,4,3},{2147483648u,4,-3},{2013265920u,5,-7},{1879048192u,5,7},{1610612736u,4,-4},{1342177280u,4,4},{1207959552u,5,-8},{1073741824u,5,8},{805306368u,4,5},{536870912u,4,-5},{0u,3,0},},
+};
+static const HuffmanTyp mpc_table_HuffQ7 [2] [63] = {
+ {{4227858432u,6,7},{4160749568u,6,8},{4093640704u,6,9},{4026531840u,6,-8},{3959422976u,6,11},{3925868544u,7,21},{3909091328u,8,-28},{3892314112u,8,28},{3825205248u,6,-9},{3791650816u,7,-22},{3758096384u,7,-21},{3690987520u,6,-10},{3623878656u,6,-11},{3556769792u,6,10},{3489660928u,6,12},{3422552064u,6,-13},{3388997632u,7,22},{3355443200u,7,23},{3288334336u,6,-12},{3221225472u,6,13},{3154116608u,6,14},{3087007744u,6,-14},{3053453312u,7,-23},{3036676096u,8,-29},{3019898880u,8,29},{2952790016u,6,-15},{2885681152u,6,15},{2818572288u,6,16},{2751463424u,6,-16},{2717908992u,7,-24},{2684354560u,7,24},{2617245696u,6,17},{2583691264u,7,-25},{2566914048u,8,-30},{2550136832u,8,30},{2483027968u,6,-17},{2415919104u,6,18},{2348810240u,6,-18},{2315255808u,7,25},{2281701376u,7,26},{2214592512u,6,19},{2181038080u,7,-26},{2147483648u,7,-27},{2013265920u,5,2},{1946157056u,6,-19},{1879048192u,6,20},{1744830464u,5,-1},{1728053248u,8,-31},{1711276032u,8,31},{1677721600u,7,27},{1610612736u,6,-20},{1476395008u,5,1},{1342177280u,5,-5},{1207959552u,5,-3},{1073741824u,5,3},{939524096u,5,0},{805306368u,5,-2},{671088640u,5,-4},{536870912u,5,4},{402653184u,5,5},{268435456u,5,-6},{134217728u,5,6},{0u,5,-7},},
+ {{4160749568u,5,-1},{4026531840u,5,2},{3892314112u,5,-2},{3758096384u,5,3},{3741319168u,8,-20},{3737124864u,10,24},{3736862720u,14,28},{3736600576u,14,-28},{3736338432u,14,-30},{3736076288u,14,30},{3735027712u,12,-27},{3734765568u,14,29},{3734503424u,14,-29},{3734241280u,14,31},{3733979136u,14,-31},{3732930560u,12,27},{3724541952u,9,-22},{3690987520u,7,-17},{3623878656u,6,-11},{3489660928u,5,-3},{3355443200u,5,4},{3221225472u,5,-4},{3187671040u,7,17},{3170893824u,8,20},{3162505216u,9,22},{3158310912u,10,-25},{3154116608u,10,-26},{3087007744u,6,12},{2952790016u,5,5},{2818572288u,5,-5},{2684354560u,5,6},{2550136832u,5,-6},{2483027968u,6,-12},{2449473536u,7,-18},{2415919104u,7,18},{2348810240u,6,13},{2281701376u,6,-13},{2147483648u,5,-7},{2080374784u,6,14},{2063597568u,8,21},{2046820352u,8,-21},{2013265920u,7,-19},{1879048192u,5,7},{1744830464u,5,8},{1677721600u,6,-14},{1610612736u,6,-15},{1476395008u,5,-8},{1409286144u,6,15},{1375731712u,7,19},{1371537408u,10,25},{1367343104u,10,26},{1358954496u,9,-23},{1350565888u,9,23},{1342177280u,9,-24},{1207959552u,5,-9},{1073741824u,5,9},{1006632960u,6,16},{939524096u,6,-16},{805306368u,5,10},{536870912u,4,0},{402653184u,5,-10},{268435456u,5,11},{0u,4,1},},
+};
+
+const HuffmanTyp* mpc_table_HuffQ [2] [8] = {
+ {0,mpc_table_HuffQ1[0],mpc_table_HuffQ2[0],mpc_table_HuffQ3[0],mpc_table_HuffQ4[0],mpc_table_HuffQ5[0],mpc_table_HuffQ6[0],mpc_table_HuffQ7[0]},
+ {0,mpc_table_HuffQ1[1],mpc_table_HuffQ2[1],mpc_table_HuffQ3[1],mpc_table_HuffQ4[1],mpc_table_HuffQ5[1],mpc_table_HuffQ6[1],mpc_table_HuffQ7[1]},
+};
diff --git a/contrib/libmpcdec/idtag.c b/contrib/libmpcdec/idtag.c
new file mode 100644
index 000000000..7cecdb04e
--- /dev/null
+++ b/contrib/libmpcdec/idtag.c
@@ -0,0 +1,83 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/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/contrib/libmpcdec/mpc_decoder.c b/contrib/libmpcdec/mpc_decoder.c
new file mode 100644
index 000000000..a7b31c970
--- /dev/null
+++ b/contrib/libmpcdec/mpc_decoder.c
@@ -0,0 +1,1271 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/internal.h>
+#include <mpcdec/requant.h>
+#include <mpcdec/huffman.h>
+
+//SV7 tables
+extern const HuffmanTyp* mpc_table_HuffQ [2] [8];
+extern const HuffmanTyp mpc_table_HuffHdr [10];
+extern const HuffmanTyp mpc_table_HuffSCFI [ 4];
+extern const HuffmanTyp mpc_table_HuffDSCF [16];
+
+
+#ifdef MPC_SUPPORT_SV456
+//SV4/5/6 tables
+extern const HuffmanTyp* mpc_table_SampleHuff [18];
+extern const HuffmanTyp mpc_table_SCFI_Bundle [ 8];
+extern const HuffmanTyp mpc_table_DSCF_Entropie [13];
+extern const HuffmanTyp mpc_table_Region_A [16];
+extern const HuffmanTyp mpc_table_Region_B [ 8];
+extern const HuffmanTyp mpc_table_Region_C [ 4];
+
+#endif
+
+#ifndef MPC_LITTLE_ENDIAN
+#define SWAP(X) mpc_swap32(X)
+#else
+#define SWAP(X) (X)
+#endif
+
+//------------------------------------------------------------------------------
+// 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_read_bitstream_sv6(mpc_decoder *d, mpc_bool_t seeking);
+void mpc_decoder_read_bitstream_sv7(mpc_decoder *d, mpc_bool_t seeking);
+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, mpc_int32_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)
+{
+ return f_read(d, ptr, count << 2) >> 2;
+}
+
+static void mpc_decoder_seek(mpc_decoder *d, mpc_uint32_t bitpos)
+{
+ f_seek(d, (bitpos>>5) * 4 + d->MPCHeaderPos);
+ f_read_dword(d, d->Speicher, MEMSIZE);
+ d->dword = SWAP(d->Speicher[d->Zaehler = 0]);
+ d->pos = bitpos & 31;
+ d->WordsRead = bitpos >> 5;
+}
+
+// jump desired number of bits out of the bitstream
+static void mpc_decoder_bitstream_jump(mpc_decoder *d, const mpc_uint32_t bits)
+{
+ d->pos += bits;
+
+ if (d->pos >= 32) {
+ d->Zaehler = (d->Zaehler + (d->pos >> 5)) & MEMMASK;
+ d->dword = SWAP(d->Speicher[d->Zaehler]);
+ d->WordsRead += d->pos >> 5;
+ d->pos &= 31;
+ }
+}
+
+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);
+ }
+}
+
+//------------------------------------------------------------------------------
+// huffman & bitstream functions
+//------------------------------------------------------------------------------
+
+/* 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 (max 31)
+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 = SWAP(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 & ((1 << bits) - 1);
+}
+
+// basic huffman decoding routine
+// works with maximum lengths up to max_length
+static mpc_int32_t
+mpc_decoder_huffman_decode(mpc_decoder *d, const HuffmanTyp *Table,
+ const mpc_uint32_t max_length)
+{
+ // load preview and decode
+ mpc_uint32_t code = d->dword << d->pos;
+ if (32 - d->pos < max_length)
+ code |= SWAP(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 = SWAP(d->Speicher[d->Zaehler = (d->Zaehler + 1) & MEMMASK]);
+ d->WordsRead++;
+ }
+
+ return Table->Value;
+}
+
+// decode SCFI-bundle (sv4,5,6)
+static void
+mpc_decoder_scfi_bundle_read(mpc_decoder *d, const HuffmanTyp* Table,
+ mpc_int32_t* SCFI, mpc_bool_t* DSCF)
+{
+ mpc_uint32_t value = mpc_decoder_huffman_decode(d, Table, 6);
+
+ *SCFI = value >> 1;
+ *DSCF = value & 1;
+}
+
+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->Q , 0, sizeof d->Q );
+ memset(d->MS_Flag , 0, sizeof d->MS_Flag );
+ memset(d->seeking_table , 0, sizeof d->seeking_table );
+}
+
+// Frame decoding. Takes big endian 32 bits words as input
+mpc_uint32_t
+mpc_decoder_decode_frame(mpc_decoder *d, mpc_uint32_t *in_buffer,
+ mpc_uint32_t in_len, MPC_SAMPLE_FORMAT *out_buffer)
+{
+ unsigned int i;
+ mpc_decoder_reset_bitstream_decode(d);
+ if (in_len > sizeof(d->Speicher)) in_len = sizeof(d->Speicher);
+ memcpy(d->Speicher, in_buffer, in_len);
+ for (i = 0; i < (in_len + 3) / 4; i++)
+ d->Speicher[i] = mpc_swap32(d->Speicher[i]);
+ d->dword = SWAP(d->Speicher[0]);
+ switch (d->StreamVersion) {
+#ifdef MPC_SUPPORT_SV456
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ mpc_decoder_read_bitstream_sv6(d, FALSE);
+ break;
+#endif
+ case 0x07:
+ case 0x17:
+ mpc_decoder_read_bitstream_sv7(d, FALSE);
+ break;
+ default:
+ return (mpc_uint32_t)(-1);
+ }
+ mpc_decoder_requantisierung(d, d->Max_Band);
+ mpc_decoder_synthese_filter_float(d, out_buffer);
+ return mpc_decoder_bits_read(d);
+}
+
+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 FwdJumpInfo = 0;
+ mpc_uint32_t FrameBitCnt = 0;
+
+ if (d->DecodedFrames >= d->OverallFrames) {
+ return (mpc_uint32_t)(-1); // end of file -> abort decoding
+ }
+
+ // add seeking info
+ if (d->seeking_table_frames < d->DecodedFrames &&
+ (d->DecodedFrames & ((1 << d->seeking_pwr) - 1)) == 0) {
+ d->seeking_table[d->DecodedFrames >> d->seeking_pwr] = mpc_decoder_bits_read(d);
+ d->seeking_table_frames = d->DecodedFrames;
+ }
+
+ // read jump-info for validity check of frame
+ FwdJumpInfo = mpc_decoder_bitstream_read(d, 20);
+
+ // decode data and check for validity of frame
+ FrameBitCnt = mpc_decoder_bits_read(d);
+ switch (d->StreamVersion) {
+#ifdef MPC_SUPPORT_SV456
+ case 0x04:
+ case 0x05:
+ case 0x06:
+ mpc_decoder_read_bitstream_sv6(d, FALSE);
+ break;
+#endif
+ case 0x07:
+ case 0x17:
+ mpc_decoder_read_bitstream_sv7(d, FALSE);
+ break;
+ default:
+ return (mpc_uint32_t)(-1);
+ }
+ d->FrameWasValid = mpc_decoder_bits_read(d) - FrameBitCnt == FwdJumpInfo;
+
+ // synthesize signal
+ mpc_decoder_requantisierung(d, d->Max_Band);
+ 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) {
+ if (!d->TrueGaplessPresent) {
+ mpc_decoder_reset_y(d);
+ } else {
+ mpc_decoder_bitstream_read(d, 20);
+ mpc_decoder_read_bitstream_sv7(d, FALSE);
+ mpc_decoder_requantisierung(d, d->Max_Band);
+ }
+
+ 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;
+ }
+ }
+ }
+ }
+ }
+}
+
+#ifdef MPC_SUPPORT_SV456
+static const unsigned char Q_res[32][16] = {
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,17},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,3,4,5,6,17,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+{0,1,2,17,0,0,0,0,0,0,0,0,0,0,0,0},
+};
+
+/****************************************** SV 6 ******************************************/
+void
+mpc_decoder_read_bitstream_sv6(mpc_decoder *d, mpc_bool_t seeking)
+{
+ mpc_int32_t n,k;
+ mpc_int32_t Max_used_Band=0;
+ const 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 = mpc_table_Region_A;
+ else if (n>=11 && n<=22) Table = mpc_table_Region_B;
+ else /*if (n>=23)*/ Table = mpc_table_Region_C;
+
+ *ResL = Q_res[n][mpc_decoder_huffman_decode(d, Table, 14)];
+ if (d->MS_used) {
+ d->MS_Flag[n] = mpc_decoder_bitstream_read(d, 1);
+ }
+ *ResR = Q_res[n][mpc_decoder_huffman_decode(d, Table, 14)];
+
+ // 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, mpc_table_SCFI_Bundle, &(d->SCFI_L[n]), &(d->DSCF_Flag_L[n]));
+ if (*ResR) mpc_decoder_scfi_bundle_read(d, mpc_table_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)
+ {
+ switch (d->SCFI_L[n])
+ {
+ case 3:
+ L[0] = L[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ L[1] = L[0];
+ L[2] = L[1];
+ break;
+ case 1:
+ L[0] = L[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ L[1] = L[0] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ L[2] = L[1];
+ break;
+ case 2:
+ L[0] = L[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ L[1] = L[0];
+ L[2] = L[1] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ break;
+ case 0:
+ L[0] = L[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ L[1] = L[0] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ L[2] = L[1] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ break;
+ default:
+ return;
+ }
+ if (L[0] > 1024)
+ L[0] = 0x8080;
+ if (L[1] > 1024)
+ L[1] = 0x8080;
+ if (L[2] > 1024)
+ L[2] = 0x8080;
+ }
+ /************ 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;
+ }
+ }
+ }
+ if (*ResR)
+ {
+ /*********** DSCF ************/
+ if (d->DSCF_Flag_R[n]==1)
+ {
+ switch (d->SCFI_R[n])
+ {
+ case 3:
+ R[0] = R[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ R[1] = R[0];
+ R[2] = R[1];
+ break;
+ case 1:
+ R[0] = R[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ R[1] = R[0] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ R[2] = R[1];
+ break;
+ case 2:
+ R[0] = R[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ R[1] = R[0];
+ R[2] = R[1] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ break;
+ case 0:
+ R[0] = R[2] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ R[1] = R[0] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ R[2] = R[1] + mpc_decoder_huffman_decode(d, mpc_table_DSCF_Entropie, 6);
+ break;
+ default:
+ return;
+ }
+ if (R[0] > 1024)
+ R[0] = 0x8080;
+ if (R[1] > 1024)
+ R[1] = 0x8080;
+ if (R[2] > 1024)
+ R[2] = 0x8080;
+ }
+ /************ 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;
+ }
+ }
+ }
+ }
+
+ if (seeking == TRUE)
+ return;
+
+ /**************************** Samples ****************************/
+ ResL = d->Res_L;
+ ResR = d->Res_R;
+ for (n=0; n <= Max_used_Band; ++n, ++ResL, ++ResR)
+ {
+ // setting pointers
+ x1 = mpc_table_SampleHuff[*ResL];
+ x2 = mpc_table_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(d, x1, 8);
+ if (x2 != NULL) *R++ = mpc_decoder_huffman_decode(d, x2, 8);
+ }
+
+ 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];
+ }
+ }
+}
+#endif //MPC_SUPPORT_SV456
+/****************************************** SV 7 ******************************************/
+void
+mpc_decoder_read_bitstream_sv7(mpc_decoder *d, mpc_bool_t seeking)
+{
+ // these arrays hold decoding results for bundled quantizers (3- and 5-step)
+ static const 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 const 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 const 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 const 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 const 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(d, mpc_table_HuffHdr, 9);
+ *ResL = (idx!=4) ? *(ResL-1) + idx : (int) mpc_decoder_bitstream_read(d, 4);
+
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffHdr, 9);
+ *ResR = (idx!=4) ? *(ResR-1) + idx : (int) 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(d, mpc_table_HuffSCFI, 3);
+ if (*ResR) *R = mpc_decoder_huffman_decode(d, mpc_table_HuffSCFI, 3);
+ }
+
+ /**************************** 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)
+ {
+ switch (d->SCFI_L[n])
+ {
+ case 1:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ L[2] = L[1];
+ break;
+ case 3:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ L[1] = L[0];
+ L[2] = L[1];
+ break;
+ case 2:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ L[1] = L[0];
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ break;
+ case 0:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[0] = (idx!=8) ? L[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[1] = (idx!=8) ? L[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ L[2] = (idx!=8) ? L[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ break;
+ default:
+ return;
+ }
+ if (L[0] > 1024)
+ L[0] = 0x8080;
+ if (L[1] > 1024)
+ L[1] = 0x8080;
+ if (L[2] > 1024)
+ L[2] = 0x8080;
+ }
+ if (*ResR)
+ {
+ switch (d->SCFI_R[n])
+ {
+ case 1:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ R[2] = R[1];
+ break;
+ case 3:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ R[1] = R[0];
+ R[2] = R[1];
+ break;
+ case 2:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ R[1] = R[0];
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ break;
+ case 0:
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[0] = (idx!=8) ? R[2] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[1] = (idx!=8) ? R[0] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ idx = mpc_decoder_huffman_decode(d, mpc_table_HuffDSCF, 6);
+ R[2] = (idx!=8) ? R[1] + idx : (int) mpc_decoder_bitstream_read(d, 6);
+ break;
+ default:
+ return;
+ }
+ if (R[0] > 1024)
+ R[0] = 0x8080;
+ if (R[1] > 1024)
+ R[1] = 0x8080;
+ if (R[2] > 1024)
+ R[2] = 0x8080;
+ }
+ }
+
+ if (seeking == TRUE)
+ return;
+
+ /***************************** 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 = mpc_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 = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+ for (k=0; k<12; ++k)
+ {
+ idx = mpc_decoder_huffman_decode(d, Table, 9);
+ *L++ = idx30[idx];
+ *L++ = idx31[idx];
+ *L++ = idx32[idx];
+ }
+ break;
+ case 2:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+ for (k=0; k<18; ++k)
+ {
+ idx = mpc_decoder_huffman_decode(d, Table, 10);
+ *L++ = idx50[idx];
+ *L++ = idx51[idx];
+ }
+ break;
+ case 3:
+ case 4:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+ for (k=0; k<36; ++k)
+ *L++ = mpc_decoder_huffman_decode(d, Table, 5);
+ break;
+ case 5:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+ for (k=0; k<36; ++k)
+ *L++ = mpc_decoder_huffman_decode(d, Table, 8);
+ break;
+ case 6:
+ case 7:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResL];
+ for (k=0; k<36; ++k)
+ *L++ = mpc_decoder_huffman_decode(d, Table, 14);
+ 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 = mpc_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 = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][1];
+ for (k=0; k<12; ++k)
+ {
+ idx = mpc_decoder_huffman_decode(d, Table, 9);
+ *R++ = idx30[idx];
+ *R++ = idx31[idx];
+ *R++ = idx32[idx];
+ }
+ break;
+ case 2:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][2];
+ for (k=0; k<18; ++k)
+ {
+ idx = mpc_decoder_huffman_decode(d, Table, 10);
+ *R++ = idx50[idx];
+ *R++ = idx51[idx];
+ }
+ break;
+ case 3:
+ case 4:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+ for (k=0; k<36; ++k)
+ *R++ = mpc_decoder_huffman_decode(d, Table, 5);
+ break;
+ case 5:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+ for (k=0; k<36; ++k)
+ *R++ = mpc_decoder_huffman_decode(d, Table, 8);
+ break;
+ case 6:
+ case 7:
+ Table = mpc_table_HuffQ[mpc_decoder_bitstream_read(d, 1)][*ResR];
+ for (k=0; k<36; ++k)
+ *R++ = mpc_decoder_huffman_decode(d, Table, 14);
+ 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->MPCHeaderPos = 0;
+ d->StreamVersion = 0;
+ d->MS_used = 0;
+ d->FrameWasValid = 0;
+ d->OverallFrames = 0;
+ d->DecodedFrames = 0;
+ d->TrueGaplessPresent = 0;
+ d->WordsRead = 0;
+ d->Max_Band = 0;
+ d->SampleRate = 0;
+ d->__r1 = 1;
+ d->__r2 = 1;
+
+ d->Max_Band = 0;
+ d->seeking_window = FAST_SEEKING_WINDOW;
+
+ mpc_decoder_reset_bitstream_decode(d);
+ mpc_decoder_initialisiere_quantisierungstabellen(d, 1.0f);
+#if 0
+ mpc_decoder_init_huffman_sv6(d);
+ mpc_decoder_init_huffman_sv7(d);
+#endif
+}
+
+static mpc_uint32_t get_initial_fpos(mpc_decoder *d)
+{
+ 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;
+}
+
+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->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
+ mpc_decoder_seek(d, get_initial_fpos(d));
+
+ d->seeking_pwr = 0;
+ while( d->OverallFrames > ((mpc_int64_t) SEEKING_TABLE_SIZE << d->seeking_pwr) )
+ d->seeking_pwr++;
+ d->seeking_table_frames = 0;
+ d->seeking_table[0] = get_initial_fpos(d);
+
+ return TRUE;
+}
+
+void mpc_decoder_set_seeking(mpc_decoder *d, mpc_streaminfo *si, mpc_bool_t fast_seeking)
+{
+ d->seeking_window = FAST_SEEKING_WINDOW;
+ if (si->fast_seek == 0 && fast_seeking == 0)
+ d->seeking_window = SLOW_SEEKING_WINDOW;
+}
+
+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);
+
+ // 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;
+
+ if (fwd > d->DecodedFrames + d->seeking_window || fwd < d->DecodedFrames) {
+ memset(d->SCF_Index_L, 1, sizeof d->SCF_Index_L );
+ memset(d->SCF_Index_R, 1, sizeof d->SCF_Index_R );
+ }
+
+ if (d->seeking_table_frames > d->DecodedFrames || fwd < d->DecodedFrames) {
+ d->DecodedFrames = 0;
+ if (fwd > d->seeking_window)
+ d->DecodedFrames = (fwd - d->seeking_window) & (-1 << d->seeking_pwr);
+ if (d->DecodedFrames > d->seeking_table_frames)
+ d->DecodedFrames = d->seeking_table_frames;
+ fpos = d->seeking_table[d->DecodedFrames >> d->seeking_pwr];
+ mpc_decoder_seek(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 RING = d->Zaehler;
+ mpc_uint32_t FwdJumpInfo;
+
+ // add seeking info
+ if (d->seeking_table_frames < d->DecodedFrames &&
+ (d->DecodedFrames & ((1 << d->seeking_pwr) - 1)) == 0) {
+ d->seeking_table[d->DecodedFrames >> d->seeking_pwr] = mpc_decoder_bits_read(d);
+ d->seeking_table_frames = d->DecodedFrames;
+ }
+
+ // read jump-info
+ FwdJumpInfo = mpc_decoder_bitstream_read(d, 20);
+ FwdJumpInfo += mpc_decoder_bits_read(d);
+
+ if (fwd <= d->DecodedFrames + d->seeking_window) {
+ if (d->StreamVersion >= 7) {
+ mpc_decoder_read_bitstream_sv7(d, TRUE);
+ } else {
+#ifdef MPC_SUPPORT_SV456
+ mpc_decoder_read_bitstream_sv6(d, TRUE);
+#else
+ return FALSE;
+#endif
+ }
+ }
+ mpc_decoder_bitstream_jump(d, FwdJumpInfo - mpc_decoder_bits_read(d));
+
+ // update buffer
+ mpc_decoder_update_buffer(d, RING);
+ }
+
+ return TRUE;
+}
diff --git a/contrib/libmpcdec/mpc_reader.c b/contrib/libmpcdec/mpc_reader.c
new file mode 100644
index 000000000..1d0accc01
--- /dev/null
+++ b/contrib/libmpcdec/mpc_reader.c
@@ -0,0 +1,96 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+
+/// mpc_reader callback implementations
+static mpc_int32_t
+read_impl(void *data, void *ptr, mpc_int32_t size)
+{
+ mpc_reader_file *d = (mpc_reader_file *) data;
+
+ return (mpc_int32_t) fread(ptr, 1, size, d->file);
+}
+
+static mpc_bool_t
+seek_impl(void *data, mpc_int32_t offset)
+{
+ mpc_reader_file *d = (mpc_reader_file *) data;
+
+ return d->is_seekable ? fseek(d->file, offset, SEEK_SET) == 0 : FALSE;
+}
+
+static mpc_int32_t
+tell_impl(void *data)
+{
+ mpc_reader_file *d = (mpc_reader_file *) data;
+
+ return ftell(d->file);
+}
+
+static mpc_int32_t
+get_size_impl(void *data)
+{
+ mpc_reader_file *d = (mpc_reader_file *) data;
+
+ return d->file_size;
+}
+
+static mpc_bool_t
+canseek_impl(void *data)
+{
+ mpc_reader_file *d = (mpc_reader_file *) data;
+
+ return d->is_seekable;
+}
+
+void
+mpc_reader_setup_file_reader(mpc_reader_file *p_reader, FILE *input)
+{
+ p_reader->reader.seek = seek_impl;
+ p_reader->reader.read = read_impl;
+ p_reader->reader.tell = tell_impl;
+ p_reader->reader.get_size = get_size_impl;
+ p_reader->reader.canseek = canseek_impl;
+ p_reader->reader.data = p_reader; // point back to ourselves
+
+ p_reader->file = input;
+ p_reader->is_seekable = TRUE;
+ fseek(input, 0, SEEK_END);
+ p_reader->file_size = ftell(input);
+ fseek(input, 0, SEEK_SET);
+}
diff --git a/contrib/libmpcdec/mpcdec/config_types.h b/contrib/libmpcdec/mpcdec/config_types.h
new file mode 100644
index 000000000..98c6cf21b
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/config_types.h
@@ -0,0 +1,50 @@
+/*
+ Copyright (c) 2005, 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.
+*/
+
+#ifndef __MUSEPACK_CONFIG_TYPES_H__
+#define __MUSEPACK_CONFIG_TYPES_H__
+
+#include <xine/os_types.h>
+
+typedef unsigned char mpc_bool_t;
+#define TRUE 1
+#define FALSE 0
+
+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 // __MUSEPACK_CONFIG_TYPES_H__
diff --git a/contrib/libmpcdec/mpcdec/decoder.h b/contrib/libmpcdec/mpcdec/decoder.h
new file mode 100644
index 000000000..9a737453e
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/decoder.h
@@ -0,0 +1,124 @@
+/*
+ Copyright (c) 2005, 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 decoder.h
+
+#ifndef _mpcdec_decoder_h_
+#define _mpcdec_decoder_h_
+
+#include "huffman.h"
+#include "math.h"
+#include "mpcdec.h"
+#include "reader.h"
+#include "streaminfo.h"
+
+#define MPC_SUPPORT_SV456
+
+#define SEEKING_TABLE_SIZE 256u
+// set it to SLOW_SEEKING_WINDOW to not use fast seeking
+#define FAST_SEEKING_WINDOW 32
+// set it to FAST_SEEKING_WINDOW to only use fast seeking
+#define SLOW_SEEKING_WINDOW 0x80000000
+
+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; /// currently 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 DecodedFrames;
+ mpc_uint32_t OverallFrames;
+ mpc_int32_t SampleRate; // Sample frequency
+
+ mpc_uint32_t StreamVersion; // version of bitstream
+ mpc_int32_t Max_Band;
+ mpc_uint32_t MPCHeaderPos; // AB: needed to support ID3v2
+
+ mpc_uint32_t FrameWasValid;
+ mpc_uint32_t MS_used; // MS-coding used ?
+ mpc_uint32_t TrueGaplessPresent;
+
+ mpc_uint32_t WordsRead; // counts amount of decoded dwords
+
+ // randomizer state variables
+ mpc_uint32_t __r1;
+ mpc_uint32_t __r2;
+
+ // seeking
+ mpc_uint32_t seeking_table[SEEKING_TABLE_SIZE];
+ mpc_uint32_t seeking_pwr; // distance between 2 frames in seeking_table = 2^seeking_pwr
+ mpc_uint32_t seeking_table_frames; // last frame in seaking table
+ mpc_uint32_t seeking_window; // number of frames to look for scalefactors
+
+ 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_bool_t DSCF_Flag_L [32];
+ mpc_bool_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_bool_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/contrib/libmpcdec/mpcdec/huffman.h b/contrib/libmpcdec/mpcdec/huffman.h
new file mode 100644
index 000000000..99d02ce71
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/huffman.h
@@ -0,0 +1,58 @@
+/*
+ Copyright (c) 2005, 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 huffman.h
+/// Data structures and functions for huffman coding.
+
+#ifndef _mpcdec_huffman_h_
+#define _mpcdec_huffman_h_
+
+#ifndef WIN32
+#include "mpcdec/config_types.h"
+#else
+#include "mpcdec/config_win32.h"
+#endif
+
+#include "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_uint16_t Length;
+ mpc_int16_t Value;
+} HuffmanTyp;
+
+#endif // _mpcdec_huffman_h_
diff --git a/contrib/libmpcdec/mpcdec/internal.h b/contrib/libmpcdec/mpcdec/internal.h
new file mode 100644
index 000000000..19642a240
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/internal.h
@@ -0,0 +1,65 @@
+/*
+ Copyright (c) 2005, 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 internal.h
+/// Definitions and structures used only internally by the libmpcdec.
+
+#ifndef _mpcdec_internal_h
+#define _mpcdec_internal_h
+
+
+enum {
+ MPC_DECODER_SYNTH_DELAY = 481
+};
+
+/// Big/little endian 32 bit byte swapping routine.
+static __inline
+mpc_uint32_t mpc_swap32(mpc_uint32_t val) {
+ return (((val & 0xff000000) >> 24) | ((val & 0x00ff0000) >> 8) |
+ ((val & 0x0000ff00) << 8) | ((val & 0x000000ff) << 24));
+}
+
+/// 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 mpc_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 // _mpcdec_internal_h
+
diff --git a/contrib/libmpcdec/mpcdec/math.h b/contrib/libmpcdec/mpcdec/math.h
new file mode 100644
index 000000000..31d078896
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/math.h
@@ -0,0 +1,144 @@
+/*
+ Copyright (c) 2005, 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 math.h
+/// Libmpcdec internal math routines.
+
+#ifndef _mpcdec_math_h_
+#define _mpcdec_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 // _mpcdec_math_h_
+
diff --git a/contrib/libmpcdec/mpcdec/mpcdec.h b/contrib/libmpcdec/mpcdec/mpcdec.h
new file mode 100644
index 000000000..77418fbcc
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/mpcdec.h
@@ -0,0 +1,145 @@
+/*
+ Copyright (c) 2005, 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 mpcdec.h
+/// Top level include file for libmpcdec.
+
+#ifndef _mpcdec_h_
+#define _mpcdec_h_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef WIN32
+#include "mpcdec/config_types.h"
+#else
+#include "mpcdec/config_win32.h"
+#endif
+
+#include "decoder.h"
+#include "math.h"
+#include "reader.h"
+#include "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);
+
+/// Call this next after calling mpc_decoder_setup.
+/// \param si streaminfo structure indicating format of source stream
+/// \param fast_seeking boolean 0 = use fast seeking if safe, 1 = force fast seeking
+void mpc_decoder_set_seeking(mpc_decoder *d, mpc_streaminfo *si, mpc_bool_t fast_seeking);
+
+void mpc_decoder_set_streaminfo(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);
+
+mpc_uint32_t mpc_decoder_decode_frame(
+ mpc_decoder *d,
+ mpc_uint32_t *in_buffer,
+ mpc_uint32_t in_len,
+ MPC_SAMPLE_FORMAT *out_buffer);
+
+/// 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 // _mpcdec_h_
diff --git a/contrib/libmpcdec/mpcdec/reader.h b/contrib/libmpcdec/mpcdec/reader.h
new file mode 100644
index 000000000..3d4f57edc
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/reader.h
@@ -0,0 +1,82 @@
+/*
+ Copyright (c) 2005, 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 reader.h
+
+#ifndef _mpcdec_reader_h_
+#define _mpcdec_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);
+
+ /// Field that can be used to identify a particular instance of
+ /// reader or carry along data associated with that reader.
+ void *data;
+
+} mpc_reader;
+
+typedef struct mpc_reader_file_t {
+ mpc_reader reader;
+
+ FILE *file;
+ long file_size;
+ mpc_bool_t is_seekable;
+} mpc_reader_file;
+
+/// 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_file *r, FILE *input);
+
+#endif // _mpcdec_reader_h_
diff --git a/contrib/libmpcdec/mpcdec/requant.h b/contrib/libmpcdec/mpcdec/requant.h
new file mode 100644
index 000000000..a0aab981b
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/requant.h
@@ -0,0 +1,51 @@
+/*
+ Copyright (c) 2005, 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.h
+/// Requantization function definitions.
+
+#ifndef _mpcdec_requant_h
+#define _mpcdec_requant_h_
+
+#include "mpcdec.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 // _mpcdec_requant_h_
diff --git a/contrib/libmpcdec/mpcdec/streaminfo.h b/contrib/libmpcdec/mpcdec/streaminfo.h
new file mode 100644
index 000000000..7cf941c47
--- /dev/null
+++ b/contrib/libmpcdec/mpcdec/streaminfo.h
@@ -0,0 +1,91 @@
+/*
+ Copyright (c) 2005, 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.h
+
+#ifndef _mpcdec_streaminfo_h_
+#define _mpcdec_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
+ //@}
+
+ /// @name fast seeking support
+ //@{
+ mpc_uint32_t fast_seek; ///< support fast seeking ? (0: no, 1: yes)
+ //@}
+} mpc_streaminfo;
+
+#endif // _mpcdec_streaminfo_h_
diff --git a/contrib/libmpcdec/requant.c b/contrib/libmpcdec/requant.c
new file mode 100644
index 000000000..2e4c98b62
--- /dev/null
+++ b/contrib/libmpcdec/requant.c
@@ -0,0 +1,120 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/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;
+ mpc_uint32_t ptr = 0;
+ if (val<0) val = -val;
+ 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,d->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;
+ }
+}
+
+void
+mpc_decoder_initialisiere_quantisierungstabellen(mpc_decoder *d, double scale_factor)
+{
+ mpc_decoder_scale_output(d, scale_factor);
+}
diff --git a/contrib/libmpcdec/streaminfo.c b/contrib/libmpcdec/streaminfo.c
new file mode 100644
index 000000000..060da08d0
--- /dev/null
+++ b/contrib/libmpcdec/streaminfo.c
@@ -0,0 +1,281 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/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));
+}
+
+/// 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->fast_seek = (HeaderData[5] >> 19) & 0x0001; // fast seeking
+ 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
+#ifdef MPC_SUPPORT_SV456
+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;
+}
+#endif
+// 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)) return ERROR_CODE_INVALIDSV;
+#ifndef MPC_LITTLE_ENDIAN
+ {
+ mpc_uint32_t ptr;
+ for (ptr = 0; ptr < 8; ptr++) {
+ HeaderData[ptr] = mpc_swap32(HeaderData[ptr]);
+ }
+ }
+#endif
+
+ si->stream_version = HeaderData[0] >> 24;
+
+ // stream version 8
+ if ((si->stream_version & 15) >= 8) {
+ return ERROR_CODE_INVALIDSV;
+ }
+ // stream version 7
+ else if ((si->stream_version & 15) == 7) {
+ Error = streaminfo_read_header_sv7(si, HeaderData);
+ if (Error != ERROR_CODE_OK) return Error;
+ }
+#ifdef MPC_SUPPORT_SV456
+ else {
+ // stream version 4-6
+ Error = streaminfo_read_header_sv6(si, HeaderData);
+ if (Error != ERROR_CODE_OK) return Error;
+ }
+#endif
+
+ // 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_CODE_OK;
+}
+
+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/contrib/libmpcdec/synth_filter.c b/contrib/libmpcdec/synth_filter.c
new file mode 100644
index 000000000..08308005d
--- /dev/null
+++ b/contrib/libmpcdec/synth_filter.c
@@ -0,0 +1,440 @@
+/*
+ Copyright (c) 2005, 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 <mpcdec/mpcdec.h>
+#include <mpcdec/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
+mpc_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/contrib/libxdg-basedir/Makefile.am b/contrib/libxdg-basedir/Makefile.am
new file mode 100644
index 000000000..4afde11fa
--- /dev/null
+++ b/contrib/libxdg-basedir/Makefile.am
@@ -0,0 +1,8 @@
+include $(top_srcdir)/misc/Makefile.quiet
+if !EXTERNAL_LIBXDG_BASEDIR
+noinst_LTLIBRARIES = libxdg-basedir.la
+endif
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+libxdg_basedir_la_SOURCES = basedir.c basedir.h basedir_fs.h
diff --git a/contrib/libxdg-basedir/basedir.c b/contrib/libxdg-basedir/basedir.c
new file mode 100644
index 000000000..43d41508f
--- /dev/null
+++ b/contrib/libxdg-basedir/basedir.c
@@ -0,0 +1,569 @@
+/* Copyright (c) 2007 Mark Nevill
+ *
+ * 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 AUTHORS OR 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.
+ */
+
+/** @file basedir.c
+ * @brief Implementation of the XDG Base Directory specification. */
+
+#if defined(HAVE_CONFIG_H) || defined(_DOXYGEN)
+#include <config.h>
+#endif
+
+#if STDC_HEADERS || HAVE_STDLIB_H || !defined(HAVE_CONFIG_H)
+# include <stdlib.h>
+#endif
+#if HAVE_MEMORY_H || !defined(HAVE_CONFIG_H)
+# include <memory.h>
+#endif
+#if HAVE_STRING_H || !defined(HAVE_CONFIG_H)
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#include <errno.h>
+
+#ifdef FALSE
+#undef FALSE
+#endif
+#ifdef TRUE
+#undef TRUE
+#endif
+#define FALSE 0
+#define TRUE 1
+
+#if HAVE_MEMSET || !defined(HAVE_CONFIG_H)
+# define xdgZeroMemory(p, n) memset(p, 0, n)
+#elif HAVE_BZERO
+# define xdgZeroMemory(p, n) bzero(p, n)
+#else
+static void xdgZeroMemory(void* p, size_t n)
+{
+ while (n > 0) { ((char*)p)[n] = 0; ++n; }
+}
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+ /* Use Windows separators on all _WIN32 defining
+ environments, except Cygwin. */
+# define DIR_SEPARATOR_CHAR '\\'
+# define DIR_SEPARATOR_STR "\\"
+# define PATH_SEPARATOR_CHAR ';'
+# define PATH_SEPARATOR_STR ";"
+# define NO_ESCAPES_IN_PATHS
+#else
+# define DIR_SEPARATOR_CHAR '/'
+# define DIR_SEPARATOR_STR "/"
+# define PATH_SEPARATOR_CHAR ':'
+# define PATH_SEPARATOR_STR ":"
+# define NO_ESCAPES_IN_PATHS
+#endif
+
+#include <basedir.h>
+#include <basedir_fs.h>
+
+#ifndef MAX
+#define MAX(a, b) ((b) > (a) ? (b) : (a))
+#endif
+
+static const char
+ DefaultRelativeDataHome[] = DIR_SEPARATOR_STR ".local" DIR_SEPARATOR_STR "share",
+ DefaultRelativeConfigHome[] = DIR_SEPARATOR_STR ".config",
+ DefaultDataDirectories1[] = DIR_SEPARATOR_STR "usr" DIR_SEPARATOR_STR "local" DIR_SEPARATOR_STR "share",
+ DefaultDataDirectories2[] = DIR_SEPARATOR_STR "usr" DIR_SEPARATOR_STR "share",
+ DefaultConfigDirectories[] = DIR_SEPARATOR_STR "etc" DIR_SEPARATOR_STR "xdg",
+ DefaultRelativeCacheHome[] = DIR_SEPARATOR_STR ".cache";
+
+static const char
+ *DefaultDataDirectoriesList[] = { DefaultDataDirectories1, DefaultDataDirectories2, NULL },
+ *DefaultConfigDirectoriesList[] = { DefaultConfigDirectories, NULL };
+
+typedef struct _xdgCachedData
+{
+ char * dataHome;
+ char * configHome;
+ char * cacheHome;
+ /* Note: string lists are null-terminated and all items */
+ /* except the first are assumed to be allocated using malloc. */
+ /* The first item is assumed to be allocated by malloc only if */
+ /* it is not equal to the appropriate home directory string above. */
+ char ** searchableDataDirectories;
+ char ** searchableConfigDirectories;
+} xdgCachedData;
+
+/** Get cache object associated with a handle */
+static xdgCachedData* xdgGetCache(xdgHandle *handle)
+{
+ return ((xdgCachedData*)(handle->reserved));
+}
+
+xdgHandle * xdgInitHandle(xdgHandle *handle)
+{
+ if (!handle) return 0;
+ handle->reserved = 0; /* So xdgUpdateData() doesn't free it */
+ if (xdgUpdateData(handle))
+ return handle;
+ return 0;
+}
+
+/** Free all memory used by a NULL-terminated string list */
+static void xdgFreeStringList(char** list)
+{
+ char** ptr = list;
+ if (!list) return;
+ for (; *ptr; ptr++)
+ free(*ptr);
+ free(list);
+}
+
+/** Free all data in the cache and set pointers to null. */
+static void xdgFreeData(xdgCachedData *cache)
+{
+ if (cache->dataHome);
+ {
+ /* the first element of the directory lists is usually the home directory */
+ if (cache->searchableDataDirectories[0] != cache->dataHome)
+ free(cache->dataHome);
+ cache->dataHome = 0;
+ }
+ if (cache->configHome);
+ {
+ if (cache->searchableConfigDirectories[0] != cache->configHome)
+ free(cache->configHome);
+ cache->configHome = 0;
+ }
+ if (cache->cacheHome)
+ {
+ free(cache->cacheHome);
+ cache->cacheHome = 0;
+ }
+ xdgFreeStringList(cache->searchableDataDirectories);
+ cache->searchableDataDirectories = 0;
+ xdgFreeStringList(cache->searchableConfigDirectories);
+ cache->searchableConfigDirectories = 0;
+}
+
+void xdgWipeHandle(xdgHandle *handle)
+{
+ xdgCachedData* cache = xdgGetCache(handle);
+ xdgFreeData(cache);
+ free(cache);
+}
+
+/** Get value for environment variable $name, defaulting to "defaultValue".
+ * @param name Name of environment variable.
+ * @param defaultValue Value to assume for environment variable if it is
+ * unset or empty.
+ */
+static char* xdgGetEnv(const char* name, const char* defaultValue)
+{
+ const char* env;
+ char* value;
+
+ env = getenv(name);
+ if (env && env[0])
+ {
+ if (!(value = (char*)malloc(strlen(env)+1))) return 0;
+ strcpy(value, env);
+ }
+ else
+ {
+ if (!(value = (char*)malloc(strlen(defaultValue)+1))) return 0;
+ strcpy(value, defaultValue);
+ }
+ return value;
+}
+
+/** Split string at ':', return null-terminated list of resulting strings.
+ * @param string String to be split
+ */
+static char** xdgSplitPath(const char* string)
+{
+ unsigned int size, i, j, k;
+ char** itemlist;
+
+ /* Get the number of paths */
+ size=2; /* One item more than seperators + terminating null item */
+ for (i = 0; string[i]; ++i)
+ {
+#ifndef NO_ESCAPES_IN_PATHS
+ if (string[i] == '\\' && string[i+1])
+ {
+ /* skip escaped characters including seperators */
+ ++i;
+ continue;
+ }
+#endif
+ if (string[i] == PATH_SEPARATOR_CHAR) ++size;
+ }
+
+ if (!(itemlist = (char**)malloc(sizeof(char*)*size))) return 0;
+ xdgZeroMemory(itemlist, sizeof(char*)*size);
+
+ for (i = 0; *string; ++i)
+ {
+ /* get length of current string */
+ for (j = 0; string[j] && string[j] != PATH_SEPARATOR_CHAR; ++j)
+#ifndef NO_ESCAPES_IN_PATHS
+ if (string[j] == '\\' && string[j+1]) ++j
+#endif
+ ;
+
+ if (!(itemlist[i] = (char*)malloc(j+1))) { xdgFreeStringList(itemlist); return 0; }
+
+ /* transfer string, unescaping any escaped seperators */
+ for (k = j = 0; string[j] && string[j] != PATH_SEPARATOR_CHAR; ++j, ++k)
+ {
+#ifndef NO_ESCAPES_IN_PATHS
+ if (string[j] == '\\' && string[j+1] == PATH_SEPARATOR_CHAR) ++j; /* replace escaped ':' with just ':' */
+ else if (string[j] == '\\' && string[j+1]) /* skip escaped characters so escaping remains aligned to pairs. */
+ {
+ itemlist[i][k]=string[j];
+ ++j, ++k;
+ }
+#endif
+ itemlist[i][k] = string[j];
+ }
+ itemlist[i][k] = 0; /* Bugfix provided by Diego 'Flameeyes' Pettenò */
+ /* move to next string */
+ string += j;
+ if (*string == PATH_SEPARATOR_CHAR) string++; /* skip seperator */
+ }
+ return itemlist;
+}
+
+/** Get $PATH-style environment variable as list of strings.
+ * If $name is unset or empty, use default strings specified by variable arguments.
+ * @param name Name of environment variable
+ * @param strings NULL-terminated list of strings to be copied and used as defaults
+ */
+static char** xdgGetPathListEnv(const char* name, const char ** strings)
+{
+ const char* env;
+ char* item;
+ char** itemlist;
+ int i, size;
+
+ env = getenv(name);
+ if (env && env[0])
+ {
+ if (!(item = (char*)malloc(strlen(env)+1))) return NULL;
+ strcpy(item, env);
+
+ itemlist = xdgSplitPath(item);
+ free(item);
+ }
+ else
+ {
+ if (!strings) return NULL;
+ for (size = 0; strings[size]; ++size) ; ++size;
+ if (!(itemlist = (char**)malloc(sizeof(char*)*size))) return NULL;
+ xdgZeroMemory(itemlist, sizeof(char*)*(size));
+
+ /* Copy defaults into itemlist. */
+ /* Why all this funky stuff? So the result can be handled uniformly by xdgFreeStringList. */
+ for (i = 0; strings[i]; ++i)
+ {
+ if (!(item = (char*)malloc(strlen(strings[i])+1))) { xdgFreeStringList(itemlist); return NULL; }
+ strcpy(item, strings[i]);
+ itemlist[i] = item;
+ }
+ }
+ return itemlist;
+}
+
+/** Update all *Home variables of cache.
+ * This includes xdgCachedData::dataHome, xdgCachedData::configHome and xdgCachedData::cacheHome.
+ * @param cache Data cache to be updated
+ */
+static int xdgUpdateHomeDirectories(xdgCachedData* cache)
+{
+ const char* env;
+ char* home, *defVal;
+
+ env = getenv("HOME");
+ if (!env || !env[0])
+ return FALSE;
+ if (!(home = (char*)malloc(strlen(env)+1))) return FALSE;
+ strcpy(home, env);
+
+ /* Allocate maximum needed for any of the 3 default values */
+ defVal = (char*)malloc(strlen(home)+
+ MAX(MAX(sizeof(DefaultRelativeDataHome), sizeof(DefaultRelativeConfigHome)), sizeof(DefaultRelativeCacheHome)));
+ if (!defVal) return FALSE;
+
+ strcpy(defVal, home);
+ strcat(defVal, DefaultRelativeDataHome);
+ if (!(cache->dataHome = xdgGetEnv("XDG_DATA_HOME", defVal))) return FALSE;
+
+ defVal[strlen(home)] = 0;
+ strcat(defVal, DefaultRelativeConfigHome);
+ if (!(cache->configHome = xdgGetEnv("XDG_CONFIG_HOME", defVal))) return FALSE;
+
+ defVal[strlen(home)] = 0;
+ strcat(defVal, DefaultRelativeCacheHome);
+ if (!(cache->cacheHome = xdgGetEnv("XDG_CACHE_HOME", defVal))) return FALSE;
+
+ free(defVal);
+ free(home);
+
+ return TRUE;
+}
+
+/** Update all *Directories variables of cache.
+ * This includes xdgCachedData::searchableDataDirectories and xdgCachedData::searchableConfigDirectories.
+ * @param cache Data cache to be updated.
+ */
+static int xdgUpdateDirectoryLists(xdgCachedData* cache)
+{
+ char** itemlist;
+ int size;
+
+ itemlist = xdgGetPathListEnv("XDG_DATA_DIRS", DefaultDataDirectoriesList);
+
+ if (!itemlist) return FALSE;
+ for (size = 0; itemlist[size]; size++) ; /* Get list size */
+ if (!(cache->searchableDataDirectories = (char**)malloc(sizeof(char*)*(size+2))))
+ {
+ xdgFreeStringList(itemlist);
+ return FALSE;
+ }
+ /* "home" directory has highest priority according to spec */
+ cache->searchableDataDirectories[0] = cache->dataHome;
+ memcpy(&(cache->searchableDataDirectories[1]), itemlist, sizeof(char*)*(size+1));
+ free(itemlist);
+
+ itemlist = xdgGetPathListEnv("XDG_CONFIG_DIRS", DefaultConfigDirectoriesList);
+ if (!itemlist) return FALSE;
+ for (size = 0; itemlist[size]; size++) ; /* Get list size */
+ if (!(cache->searchableConfigDirectories = (char**)malloc(sizeof(char*)*(size+2))))
+ {
+ xdgFreeStringList(itemlist);
+ return FALSE;
+ }
+ cache->searchableConfigDirectories[0] = cache->configHome;
+ memcpy(&(cache->searchableConfigDirectories[1]), itemlist, sizeof(char*)*(size+1));
+ free(itemlist);
+
+ return TRUE;
+}
+
+int xdgUpdateData(xdgHandle *handle)
+{
+ xdgCachedData* cache = (xdgCachedData*)malloc(sizeof(xdgCachedData));
+ xdgCachedData* oldCache;
+ if (!cache) return FALSE;
+ xdgZeroMemory(cache, sizeof(xdgCachedData));
+
+ if (xdgUpdateHomeDirectories(cache) &&
+ xdgUpdateDirectoryLists(cache))
+ {
+ /* Update successful, replace pointer to old cache with pointer to new cache */
+ oldCache = xdgGetCache(handle);
+ handle->reserved = cache;
+ if (oldCache)
+ {
+ xdgFreeData(oldCache);
+ free(oldCache);
+ }
+ return TRUE;
+ }
+ else
+ {
+ /* Update failed, discard new cache and leave old cache unmodified */
+ xdgFreeData(cache);
+ free(cache);
+ return FALSE;
+ }
+}
+
+/** Find all existing files corresponding to relativePath relative to each item in dirList.
+ * @param relativePath Relative path to search for.
+ * @param dirList <tt>NULL</tt>-terminated list of directory paths.
+ * @return A sequence of null-terminated strings terminated by a
+ * double-<tt>NULL</tt> (empty string) and allocated using malloc().
+ */
+static char * xdgFindExisting(const char * relativePath, const char * const * dirList)
+{
+ char * fullPath;
+ char * returnString = 0;
+ char * tmpString;
+ int strLen = 0;
+ FILE * testFile;
+ const char * const * item;
+
+ for (item = dirList; *item; item++)
+ {
+ if (!(fullPath = (char*)malloc(strlen(*item)+strlen(relativePath)+2)))
+ {
+ if (returnString) free(returnString);
+ return 0;
+ }
+ strcpy(fullPath, *item);
+ if (fullPath[strlen(fullPath)-1] != DIR_SEPARATOR_CHAR)
+ strcat(fullPath, DIR_SEPARATOR_STR);
+ strcat(fullPath, relativePath);
+ testFile = fopen(fullPath, "r");
+ if (testFile)
+ {
+ if (!(tmpString = (char*)realloc(returnString, strLen+strlen(fullPath)+2)))
+ {
+ free(returnString);
+ free(fullPath);
+ return 0;
+ }
+ returnString = tmpString;
+ strcpy(&returnString[strLen], fullPath);
+ strLen = strLen+strlen(fullPath)+1;
+ fclose(testFile);
+ }
+ free(fullPath);
+ }
+ if (returnString)
+ returnString[strLen] = 0;
+ else
+ {
+ if ((returnString = (char*)malloc(2)))
+ strcpy(returnString, "\0");
+ }
+ return returnString;
+}
+
+/** Open first possible config file corresponding to relativePath.
+ * @param relativePath Path to scan for.
+ * @param mode Mode with which to attempt to open files (see fopen modes).
+ * @param dirList <tt>NULL</tt>-terminated list of paths in which to search for relativePath.
+ * @return File pointer if successful else @c NULL. Client must use @c fclose to close file.
+ */
+static FILE * xdgFileOpen(const char * relativePath, const char * mode, const char * const * dirList)
+{
+ char * fullPath;
+ FILE * testFile;
+ const char * const * item;
+
+ for (item = dirList; *item; item++)
+ {
+ if (!(fullPath = (char*)malloc(strlen(*item)+strlen(relativePath)+2)))
+ return 0;
+ strcpy(fullPath, *item);
+ if (fullPath[strlen(fullPath)-1] != DIR_SEPARATOR_CHAR)
+ strcat(fullPath, DIR_SEPARATOR_STR);
+ strcat(fullPath, relativePath);
+ testFile = fopen(fullPath, mode);
+ free(fullPath);
+ if (testFile)
+ return testFile;
+ }
+ return 0;
+}
+
+int xdgMakePath(const char * path, mode_t mode)
+{
+ int length = strlen(path);
+ char * tmpPath;
+ char * tmpPtr;
+ int ret;
+
+ if (length == 0 || (length == 1 && path[0] == DIR_SEPARATOR_CHAR))
+ return 0;
+
+ if (!(tmpPath = (char*)malloc(length+1)))
+ {
+ errno = ENOMEM;
+ return -1;
+ }
+ strcpy(tmpPath, path);
+ if (tmpPath[length-1] == DIR_SEPARATOR_CHAR)
+ tmpPath[length-1] = '\0';
+
+ /* skip tmpPath[0] since if it's a seperator we have an absolute path */
+ for (tmpPtr = tmpPath+1; *tmpPtr; ++tmpPtr)
+ {
+ if (*tmpPtr == DIR_SEPARATOR_CHAR)
+ {
+ *tmpPtr = '\0';
+ if (mkdir(tmpPath, mode) == -1)
+ {
+ if (errno != EEXIST)
+ {
+ free(tmpPath);
+ return -1;
+ }
+ }
+ *tmpPtr = DIR_SEPARATOR_CHAR;
+ }
+ }
+ ret = mkdir(tmpPath, mode);
+ free(tmpPath);
+ return ret;
+}
+
+const char * xdgDataHome(xdgHandle *handle)
+{
+ return xdgGetCache(handle)->dataHome;
+}
+const char * xdgConfigHome(xdgHandle *handle)
+{
+ return xdgGetCache(handle)->configHome;
+}
+const char * const * xdgDataDirectories(xdgHandle *handle)
+{
+ return (const char * const *)&(xdgGetCache(handle)->searchableDataDirectories[1]);
+}
+const char * const * xdgSearchableDataDirectories(xdgHandle *handle)
+{
+ return (const char * const *)xdgGetCache(handle)->searchableDataDirectories;
+}
+const char * const * xdgConfigDirectories(xdgHandle *handle)
+{
+ return (const char * const *)&(xdgGetCache(handle)->searchableConfigDirectories[1]);
+}
+const char * const * xdgSearchableConfigDirectories(xdgHandle *handle)
+{
+ return (const char * const *)xdgGetCache(handle)->searchableConfigDirectories;
+}
+const char * xdgCacheHome(xdgHandle *handle)
+{
+ return xdgGetCache(handle)->cacheHome;
+}
+char * xdgDataFind(const char * relativePath, xdgHandle *handle)
+{
+ return xdgFindExisting(relativePath, xdgSearchableDataDirectories(handle));
+}
+char * xdgConfigFind(const char * relativePath, xdgHandle *handle)
+{
+ return xdgFindExisting(relativePath, xdgSearchableConfigDirectories(handle));
+}
+FILE * xdgDataOpen(const char * relativePath, const char * mode, xdgHandle *handle)
+{
+ return xdgFileOpen(relativePath, mode, xdgSearchableDataDirectories(handle));
+}
+FILE * xdgConfigOpen(const char * relativePath, const char * mode, xdgHandle *handle)
+{
+ return xdgFileOpen(relativePath, mode, xdgSearchableConfigDirectories(handle));
+}
+
diff --git a/contrib/libxdg-basedir/basedir.h b/contrib/libxdg-basedir/basedir.h
new file mode 100644
index 000000000..ec1cfcb84
--- /dev/null
+++ b/contrib/libxdg-basedir/basedir.h
@@ -0,0 +1,133 @@
+/* Copyright (c) 2007 Mark Nevill
+ *
+ * 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 AUTHORS OR 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.
+ */
+
+/** @mainpage
+ *
+ * <div style="margin: 2em 5em 2em 5em; border: 1px solid #CCC; padding: 1em; background: #E8EEF2;">
+ * Various specifications specify files and file formats. The <a
+ * href="http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html">
+ * XDG Base Directory specification</a> defines where these files should
+ * be looked for by defining one or more base directories relative to
+ * which files should be located.
+ * </div>
+ *
+ * This library implements functions to list the directories according
+ * to the specification and provides a few higher-level functions for
+ * use with the specification.
+ */
+
+/** @file basedir.h
+ * Functions for using the XDG Base Directory specification. */
+
+#ifndef XDG_BASEDIR_H
+#define XDG_BASEDIR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** Version of XDG Base Directory specification implemented in this library. */
+#define XDG_BASEDIR_SPEC 0.6
+
+/** @name XDG data cache management */
+/*@{*/
+
+/** Handle to XDG data cache.
+ * Handles are initialized with xdgInitHandle() and
+ * freed with xdgWipeHandle(). */
+typedef struct /*_xdgHandle*/ {
+ /** Reserved for internal use, do not modify. */
+ void *reserved;
+} xdgHandle;
+
+/** Initialize a handle to an XDG data cache and initialize the cache.
+ * Use xdgWipeHandle() to free the handle.
+ * @return a pointer to the handle if initialization was successful, else 0 */
+xdgHandle * xdgInitHandle(xdgHandle *handle);
+
+/** Wipe handle of XDG data cache.
+ * Wipe handle initialized using xdgInitHandle(). */
+void xdgWipeHandle(xdgHandle *handle);
+
+/** Update the data cache.
+ * This should not be done frequently as it reallocates the cache.
+ * Even if updating the cache fails the handle remains valid and can
+ * be used to access XDG data as it was before xdgUpdateData() was called.
+ * @return 0 if update failed, non-0 if successful.*/
+int xdgUpdateData(xdgHandle *handle);
+
+/*@}*/
+/** @name Basic XDG Base Directory Queries */
+/*@{*/
+
+/** Base directory for user specific data files.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return a path as described by the standards. */
+const char * xdgDataHome(xdgHandle *handle);
+
+/** Base directory for user specific configuration files.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return a path as described by the standards. */
+const char * xdgConfigHome(xdgHandle *handle);
+
+/** Preference-ordered set of base directories to search for data files
+ * in addition to the $XDG_DATA_HOME base directory.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return A null-terminated list of directory strings. */
+const char * const * xdgDataDirectories(xdgHandle *handle);
+
+/** Preference-ordered set of base directories to search for data files
+ * with $XDG_DATA_HOME prepended.
+ * The base directory defined by $XDG_DATA_HOME is considered more
+ * important than any of the base directories defined by $XDG_DATA_DIRS.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return A null-terminated list of directory strings. */
+const char * const * xdgSearchableDataDirectories(xdgHandle *handle);
+
+/** Preference-ordered set of base directories to search for configuration
+ * files in addition to the $XDG_CONFIG_HOME base directory.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return A null-terminated list of directory strings. */
+const char * const * xdgConfigDirectories(xdgHandle *handle);
+
+/** Preference-ordered set of base directories to search for configuration
+ * files with $XDG_CONFIG_HOME prepended.
+ * The base directory defined by $XDG_CONFIG_HOME is considered more
+ * important than any of the base directories defined by $XDG_CONFIG_DIRS.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return A null-terminated list of directory strings. */
+const char * const * xdgSearchableConfigDirectories(xdgHandle *handle);
+
+/** Base directory for user specific non-essential data files.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return a path as described by the standards. */
+const char * xdgCacheHome(xdgHandle *handle);
+
+/*@}*/
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /*XDG_BASEDIR_H*/
diff --git a/contrib/libxdg-basedir/basedir_fs.h b/contrib/libxdg-basedir/basedir_fs.h
new file mode 100644
index 000000000..35d1f5aa2
--- /dev/null
+++ b/contrib/libxdg-basedir/basedir_fs.h
@@ -0,0 +1,100 @@
+/* Copyright (c) 2007 Mark Nevill
+ *
+ * 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 AUTHORS OR 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.
+ */
+
+/** @file basedir_fs.h
+ * Filesystem functions related to the XDG Base Directory specification. */
+
+#ifndef XDG_BASEDIR_FS_H
+#define XDG_BASEDIR_FS_H
+
+#include <basedir.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @name Filesystem-related XDG Base Directory Queries */
+/*@{*/
+
+/** Find all existing data files corresponding to relativePath.
+ * Consider as performing @code fopen(filename, "r") @endcode on every possible @c filename
+ * and returning the successful <tt>filename</tt>s.
+ * @param relativePath Path to scan for.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return A sequence of null-terminated strings terminated by a double-null (empty string)
+ * and allocated using malloc(), e.g.: @code "/etc/share\0/home/jdoe/.local\0" @endcode
+ */
+char * xdgDataFind(const char* relativePath, xdgHandle *handle);
+
+/** Find all existing config files corresponding to relativePath.
+ * Consider as performing @code fopen(filename, "r") @endcode on every possible @c filename
+ * and returning the successful <tt>filename</tt>s.
+ * @param relativePath Path to scan for.
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return A sequence of null-terminated strings terminated by a double-null (empty string)
+ * and allocated using malloc(), e.g.: @code "/etc/xdg\0/home/jdoe/.config\0" @endcode
+ */
+char * xdgConfigFind(const char* relativePath, xdgHandle *handle);
+
+/** Open first possible data file corresponding to relativePath.
+ * Consider as performing @code fopen(filename, mode) @endcode on every possible @c filename
+ * and returning the first successful @c filename or @c NULL.
+ * @param relativePath Path to scan for.
+ * @param mode Mode with which to attempt to open files (see fopen modes).
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return File pointer if successful else @c NULL. Client must use @c fclose to close file.
+ */
+FILE * xdgDataOpen(const char* relativePath, const char* mode, xdgHandle *handle);
+
+/** Open first possible config file corresponding to relativePath.
+ * Consider as performing @code fopen(filename, mode) @endcode on every possible @c filename
+ * and returning the first successful @c filename or @c NULL.
+ * @param relativePath Path to scan for.
+ * @param mode Mode with which to attempt to open files (see fopen modes).
+ * @param handle Handle to data cache, initialized with xdgInitHandle().
+ * @return File pointer if successful else @c NULL. Client must use @c fclose to close file.
+ */
+FILE * xdgConfigOpen(const char* relativePath, const char* mode, xdgHandle *handle);
+
+/** Create path by recursively creating directories.
+ * This utility function is not part of the XDG specification, but
+ * nevertheless useful in context of directory manipulation.
+ * @param path The path to be created.
+ * @param mode The permissions to use for created directories. This parameter
+ * is modified by the process's umask. For details, see mkdir(2)'s mode
+ * parameter.
+ * @return Zero on success, -1 if an error occured (in which case errno will
+ * be set appropriately)
+ */
+int xdgMakePath(const char * path, mode_t mode);
+
+/*@}*/
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /*XDG_BASEDIR_FS_H*/
diff --git a/contrib/nosefart/Makefile.am b/contrib/nosefart/Makefile.am
new file mode 100644
index 000000000..a7b3ef337
--- /dev/null
+++ b/contrib/nosefart/Makefile.am
@@ -0,0 +1,38 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+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 = $(AM_CFLAGS) -fno-strict-aliasing
+libnosefart_la_CPPFLAGS = -DNSF_PLAYER
+
+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/contrib/nosefart/diff_to_nosefart_cvs.patch b/contrib/nosefart/diff_to_nosefart_cvs.patch
new file mode 100644
index 000000000..2b6202fb8
--- /dev/null
+++ b/contrib/nosefart/diff_to_nosefart_cvs.patch
@@ -0,0 +1,117 @@
+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 */
+--- a/src/libxineadec/nosefart/nsf.h Tue Apr 10 13:42:00 2007 +0200
++++ b/src/libxineadec/nosefart/nsf.h Tue Apr 10 13:48:50 2007 +0200
+@@ -29,6 +29,8 @@
+ #include "osd.h"
+ #include "nes6502.h"
+ #include "nes_apu.h"
++
++#include "config.h"
+
+ #define NSF_MAGIC "NESM\x1A"
+
+@@ -96,7 +98,7 @@ typedef struct nsf_s
+
+ /* our main processing routine, calls all external mixing routines */
+ void (*process)(void *buffer, int num_samples);
+-} __PACKED__ nsf_t;
++} XINE_PACKED nsf_t;
+
+ /* Function prototypes */
+ extern void nsf_init(void);
+--- a/src/libxineadec/nosefart/osd.h Tue Apr 10 13:42:00 2007 +0200
++++ b/src/libxineadec/nosefart/osd.h Tue Apr 10 13:19:34 2007 +0200
+@@ -26,19 +26,15 @@
+ #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
+
diff --git a/src/libxineadec/nosefart/dis6502.c b/contrib/nosefart/dis6502.c
index ff552d219..ff552d219 100644
--- a/src/libxineadec/nosefart/dis6502.c
+++ b/contrib/nosefart/dis6502.c
diff --git a/src/libxineadec/nosefart/dis6502.h b/contrib/nosefart/dis6502.h
index a02fd73ae..a02fd73ae 100644
--- a/src/libxineadec/nosefart/dis6502.h
+++ b/contrib/nosefart/dis6502.h
diff --git a/src/libxineadec/nosefart/fds_snd.c b/contrib/nosefart/fds_snd.c
index fe2e4d624..fe2e4d624 100644
--- a/src/libxineadec/nosefart/fds_snd.c
+++ b/contrib/nosefart/fds_snd.c
diff --git a/src/libxineadec/nosefart/fds_snd.h b/contrib/nosefart/fds_snd.h
index 9d20b5b2a..9d20b5b2a 100644
--- a/src/libxineadec/nosefart/fds_snd.h
+++ b/contrib/nosefart/fds_snd.h
diff --git a/src/libxineadec/nosefart/fmopl.c b/contrib/nosefart/fmopl.c
index 29c884096..29c884096 100644
--- a/src/libxineadec/nosefart/fmopl.c
+++ b/contrib/nosefart/fmopl.c
diff --git a/src/libxineadec/nosefart/fmopl.h b/contrib/nosefart/fmopl.h
index 92a2859d7..92a2859d7 100644
--- a/src/libxineadec/nosefart/fmopl.h
+++ b/contrib/nosefart/fmopl.h
diff --git a/src/libxineadec/nosefart/log.c b/contrib/nosefart/log.c
index 8935a596e..8935a596e 100644
--- a/src/libxineadec/nosefart/log.c
+++ b/contrib/nosefart/log.c
diff --git a/contrib/nosefart/log.h b/contrib/nosefart/log.h
new file mode 100644
index 000000000..da2548c80
--- /dev/null
+++ b/contrib/nosefart/log.h
@@ -0,0 +1,53 @@
+/*
+** 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 <xine/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/contrib/nosefart/memguard.c
index 35b3ef6ba..35b3ef6ba 100644
--- a/src/libxineadec/nosefart/memguard.c
+++ b/contrib/nosefart/memguard.c
diff --git a/src/libxineadec/nosefart/memguard.h b/contrib/nosefart/memguard.h
index d80d6fb7c..d80d6fb7c 100644
--- a/src/libxineadec/nosefart/memguard.h
+++ b/contrib/nosefart/memguard.h
diff --git a/src/libxineadec/nosefart/mmc5_snd.c b/contrib/nosefart/mmc5_snd.c
index 7269fa967..7269fa967 100644
--- a/src/libxineadec/nosefart/mmc5_snd.c
+++ b/contrib/nosefart/mmc5_snd.c
diff --git a/src/libxineadec/nosefart/mmc5_snd.h b/contrib/nosefart/mmc5_snd.h
index 256cc2285..256cc2285 100644
--- a/src/libxineadec/nosefart/mmc5_snd.h
+++ b/contrib/nosefart/mmc5_snd.h
diff --git a/src/libxineadec/nosefart/nes6502.c b/contrib/nosefart/nes6502.c
index d84bae912..d84bae912 100644
--- a/src/libxineadec/nosefart/nes6502.c
+++ b/contrib/nosefart/nes6502.c
diff --git a/src/libxineadec/nosefart/nes6502.h b/contrib/nosefart/nes6502.h
index 8713304ec..8713304ec 100644
--- a/src/libxineadec/nosefart/nes6502.h
+++ b/contrib/nosefart/nes6502.h
diff --git a/src/libxineadec/nosefart/nes_apu.c b/contrib/nosefart/nes_apu.c
index 474e2ca1a..474e2ca1a 100644
--- a/src/libxineadec/nosefart/nes_apu.c
+++ b/contrib/nosefart/nes_apu.c
diff --git a/src/libxineadec/nosefart/nes_apu.h b/contrib/nosefart/nes_apu.h
index 9efbb560e..9efbb560e 100644
--- a/src/libxineadec/nosefart/nes_apu.h
+++ b/contrib/nosefart/nes_apu.h
diff --git a/src/libxineadec/nosefart/nsf.c b/contrib/nosefart/nsf.c
index 69f77546b..69f77546b 100644
--- a/src/libxineadec/nosefart/nsf.c
+++ b/contrib/nosefart/nsf.c
diff --git a/contrib/nosefart/nsf.h b/contrib/nosefart/nsf.h
new file mode 100644
index 000000000..79ce55c35
--- /dev/null
+++ b/contrib/nosefart/nsf.h
@@ -0,0 +1,186 @@
+/*
+** 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"
+
+#include "config.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,
+ NSF_FILTER_MAX, /* $$$ ben : add this one for range chacking */
+};
+
+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? */
+
+ /* $$$ ben : Playing time ... */
+ uint32 cur_frame;
+ uint32 cur_frame_end;
+ uint32 * song_frames;
+
+ /* $$$ ben : Last error string */
+ const char * errstr;
+
+ /* 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);
+} XINE_PACKED nsf_t;
+
+/* $$$ ben : Generic loader struct */
+struct nsf_loader_t {
+ /* Init and open. */
+ int (*open)(struct nsf_loader_t * loader);
+
+ /* Close and shutdown. */
+ void (*close) (struct nsf_loader_t * loader);
+
+ /* This function should return <0 on error, else the number of byte NOT read.
+ * that way a simple 0 test tell us if read was complete.
+ */
+ int (*read) (struct nsf_loader_t * loader, void *data, int n);
+
+ /* Get file length. */
+ int (*length) (struct nsf_loader_t * loader);
+
+ /* Skip n bytes. */
+ int (*skip) (struct nsf_loader_t * loader,int n);
+
+ /* Get filename (for debug). */
+ const char * (*fname) (struct nsf_loader_t * loader);
+
+};
+
+/* Function prototypes */
+extern int nsf_init(void);
+
+extern nsf_t * nsf_load_extended(struct nsf_loader_t * loader);
+extern nsf_t *nsf_load(const char *filename, void *source, int length);
+extern void nsf_free(nsf_t **nsf_info);
+
+extern int nsf_playtrack(nsf_t *nsf, int track, int sample_rate,
+ int sample_bits, boolean stereo);
+extern void nsf_frame(nsf_t *nsf);
+extern int nsf_setchan(nsf_t *nsf, int chan, boolean enabled);
+extern int nsf_setfilter(nsf_t *nsf, int filter_type);
+
+#endif /* _NSF_H_ */
+
+/*
+** $Log: nsf.h,v $
+** Revision 1.3 2003/05/01 22:34:20 benjihan
+** New NSF plugin
+**
+** Revision 1.2 2003/04/09 14:50:32 ben
+** Clean NSF api.
+**
+** Revision 1.1 2003/04/08 20:53:00 ben
+** Adding more files...
+**
+** 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/contrib/nosefart/osd.h b/contrib/nosefart/osd.h
new file mode 100644
index 000000000..38b9480c7
--- /dev/null
+++ b/contrib/nosefart/osd.h
@@ -0,0 +1,94 @@
+/*
+** 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 PATH_SEP '/'
+#ifdef __DJGPP__
+#include <dpmi.h>
+#include "dos_ints.h"
+#endif
+#elif defined(WIN32)
+#define PATH_SEP '\\'
+#else /* crapintosh? */
+#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/contrib/nosefart/types.h
index c0293066c..c0293066c 100644
--- a/src/libxineadec/nosefart/types.h
+++ b/contrib/nosefart/types.h
diff --git a/src/libxineadec/nosefart/version.h b/contrib/nosefart/version.h
index 38d69c61c..38d69c61c 100644
--- a/src/libxineadec/nosefart/version.h
+++ b/contrib/nosefart/version.h
diff --git a/src/libxineadec/nosefart/vrc7_snd.c b/contrib/nosefart/vrc7_snd.c
index 42cff0103..42cff0103 100644
--- a/src/libxineadec/nosefart/vrc7_snd.c
+++ b/contrib/nosefart/vrc7_snd.c
diff --git a/src/libxineadec/nosefart/vrc7_snd.h b/contrib/nosefart/vrc7_snd.h
index fd3880b63..fd3880b63 100644
--- a/src/libxineadec/nosefart/vrc7_snd.h
+++ b/contrib/nosefart/vrc7_snd.h
diff --git a/src/libxineadec/nosefart/vrcvisnd.c b/contrib/nosefart/vrcvisnd.c
index b1f26fe52..b1f26fe52 100644
--- a/src/libxineadec/nosefart/vrcvisnd.c
+++ b/contrib/nosefart/vrcvisnd.c
diff --git a/src/libxineadec/nosefart/vrcvisnd.h b/contrib/nosefart/vrcvisnd.h
index 7666fec0c..7666fec0c 100644
--- a/src/libxineadec/nosefart/vrcvisnd.h
+++ b/contrib/nosefart/vrcvisnd.h
diff --git a/contrib/vidix/Makefile.am b/contrib/vidix/Makefile.am
new file mode 100644
index 000000000..111f3a5d1
--- /dev/null
+++ b/contrib/vidix/Makefile.am
@@ -0,0 +1,19 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+SUBDIRS = drivers
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/contrib/vidix -I$(top_builddir)/contrib/libdha
+
+EXTRA_DIST = README vidix.txt
+
+noinst_HEADERS = fourcc.h vidix.h vidixlib.h
+
+noinst_LTLIBRARIES = libvidix.la
+
+$(top_builddir)/contrib/libdha/libdha.la:
+ $(MAKE) -C $(top_builddir)/contrib/libdha libdha.la
+
+libvidix_la_SOURCES = vidixlib.c
+libvidix_la_LIBADD = $(DYNAMIC_LD_LIBS) $(top_builddir)/contrib/libdha/libdha.la
diff --git a/src/video_out/vidix/README b/contrib/vidix/README
index 23bcaca30..23bcaca30 100644
--- a/src/video_out/vidix/README
+++ b/contrib/vidix/README
diff --git a/contrib/vidix/drivers/Makefile.am b/contrib/vidix/drivers/Makefile.am
new file mode 100644
index 000000000..5b1589c0b
--- /dev/null
+++ b/contrib/vidix/drivers/Makefile.am
@@ -0,0 +1,63 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS)
+AM_CPPFLAGS = -I$(top_srcdir)/contrib/vidix \
+ -I$(top_srcdir)/contrib/libdha -I$(top_builddir)/contrib/libdha
+AM_LDFLAGS = -avoid-version -module
+
+EXTRA_DIST = genfb_vid.c
+
+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
+
+BUILT_SOURCES = $(top_builddir)/contrib/libdha/pci_ids.h \
+ $(top_builddir)/contrib/libdha/pci_names.h
+
+$(BUILT_SOURCES):
+ $(MAKE) -C $(dir $@) $(notdir $@)
+
+vidix_LTLIBRARIES = \
+ 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
+
+cyberblade_vid_la_SOURCES = cyberblade_vid.c
+
+mach64_vid_la_SOURCES = mach64_vid.c
+
+mga_crtc2_vid_la_SOURCES = mga_vid.c
+mga_crtc2_vid_la_LIBADD = -lm
+mga_crtc2_vid_la_CPPFLAGS = $(AM_CPPFLAGS) -DCRTC2
+
+mga_vid_la_SOURCES = mga_vid.c
+mga_vid_la_LIBADD = -lm
+
+nvidia_vid_la_SOURCES = nvidia_vid.c
+
+pm2_vid_la_SOURCES = pm2_vid.c
+
+pm3_vid_la_SOURCES = pm3_vid.c
+
+radeon_vid_la_SOURCES = radeon_vid.c
+radeon_vid_la_LIBADD = -lm
+
+rage128_vid_la_SOURCES = radeon_vid.c
+rage128_vid_la_LIBADD = -lm
+rage128_vid_la_CPPFLAGS = $(AM_CPPFLAGS) -DRAGE128
+
+savage_vid_la_SOURCES = savage_vid.c
+savage_vid_la_LIBADD = -lm
+
+sis_vid_la_SOURCES = sis_vid.c sis_bridge.c
+
+unichrome_vid_la_SOURCES = unichrome_vid.c
diff --git a/src/video_out/vidix/drivers/cyberblade_regs.h b/contrib/vidix/drivers/cyberblade_regs.h
index 1bae61d4a..1bae61d4a 100644
--- a/src/video_out/vidix/drivers/cyberblade_regs.h
+++ b/contrib/vidix/drivers/cyberblade_regs.h
diff --git a/src/video_out/vidix/drivers/cyberblade_vid.c b/contrib/vidix/drivers/cyberblade_vid.c
index 7a32ce7bd..7a32ce7bd 100644
--- a/src/video_out/vidix/drivers/cyberblade_vid.c
+++ b/contrib/vidix/drivers/cyberblade_vid.c
diff --git a/src/video_out/vidix/drivers/genfb_vid.c b/contrib/vidix/drivers/genfb_vid.c
index eaf548438..eaf548438 100644
--- a/src/video_out/vidix/drivers/genfb_vid.c
+++ b/contrib/vidix/drivers/genfb_vid.c
diff --git a/src/video_out/vidix/drivers/glint_regs.h b/contrib/vidix/drivers/glint_regs.h
index f33accd3d..f33accd3d 100644
--- a/src/video_out/vidix/drivers/glint_regs.h
+++ b/contrib/vidix/drivers/glint_regs.h
diff --git a/src/video_out/vidix/drivers/mach64.h b/contrib/vidix/drivers/mach64.h
index 807efdb8d..807efdb8d 100644
--- a/src/video_out/vidix/drivers/mach64.h
+++ b/contrib/vidix/drivers/mach64.h
diff --git a/src/video_out/vidix/drivers/mach64_vid.c b/contrib/vidix/drivers/mach64_vid.c
index 02447af19..02447af19 100644
--- a/src/video_out/vidix/drivers/mach64_vid.c
+++ b/contrib/vidix/drivers/mach64_vid.c
diff --git a/src/video_out/vidix/drivers/mga_vid.c b/contrib/vidix/drivers/mga_vid.c
index edebc0c4f..edebc0c4f 100644
--- a/src/video_out/vidix/drivers/mga_vid.c
+++ b/contrib/vidix/drivers/mga_vid.c
diff --git a/src/video_out/vidix/drivers/nvidia_vid.c b/contrib/vidix/drivers/nvidia_vid.c
index b051df326..b051df326 100644
--- a/src/video_out/vidix/drivers/nvidia_vid.c
+++ b/contrib/vidix/drivers/nvidia_vid.c
diff --git a/src/video_out/vidix/drivers/pm2_vid.c b/contrib/vidix/drivers/pm2_vid.c
index 075b178de..075b178de 100644
--- a/src/video_out/vidix/drivers/pm2_vid.c
+++ b/contrib/vidix/drivers/pm2_vid.c
diff --git a/src/video_out/vidix/drivers/pm3_regs.h b/contrib/vidix/drivers/pm3_regs.h
index 44cc92dca..44cc92dca 100644
--- a/src/video_out/vidix/drivers/pm3_regs.h
+++ b/contrib/vidix/drivers/pm3_regs.h
diff --git a/src/video_out/vidix/drivers/pm3_vid.c b/contrib/vidix/drivers/pm3_vid.c
index 72a6523b3..72a6523b3 100644
--- a/src/video_out/vidix/drivers/pm3_vid.c
+++ b/contrib/vidix/drivers/pm3_vid.c
diff --git a/src/video_out/vidix/drivers/radeon.h b/contrib/vidix/drivers/radeon.h
index 090fbf8df..090fbf8df 100644
--- a/src/video_out/vidix/drivers/radeon.h
+++ b/contrib/vidix/drivers/radeon.h
diff --git a/src/video_out/vidix/drivers/radeon_vid.c b/contrib/vidix/drivers/radeon_vid.c
index de4e66194..de4e66194 100644
--- a/src/video_out/vidix/drivers/radeon_vid.c
+++ b/contrib/vidix/drivers/radeon_vid.c
diff --git a/src/video_out/vidix/drivers/savage_regs.h b/contrib/vidix/drivers/savage_regs.h
index a8a44c7c3..a8a44c7c3 100644
--- a/src/video_out/vidix/drivers/savage_regs.h
+++ b/contrib/vidix/drivers/savage_regs.h
diff --git a/src/video_out/vidix/drivers/savage_vid.c b/contrib/vidix/drivers/savage_vid.c
index 17040cc15..17040cc15 100644
--- a/src/video_out/vidix/drivers/savage_vid.c
+++ b/contrib/vidix/drivers/savage_vid.c
diff --git a/src/video_out/vidix/drivers/sis_bridge.c b/contrib/vidix/drivers/sis_bridge.c
index f6916ae87..f6916ae87 100644
--- a/src/video_out/vidix/drivers/sis_bridge.c
+++ b/contrib/vidix/drivers/sis_bridge.c
diff --git a/src/video_out/vidix/drivers/sis_defs.h b/contrib/vidix/drivers/sis_defs.h
index 79a61a19b..79a61a19b 100644
--- a/src/video_out/vidix/drivers/sis_defs.h
+++ b/contrib/vidix/drivers/sis_defs.h
diff --git a/src/video_out/vidix/drivers/sis_regs.h b/contrib/vidix/drivers/sis_regs.h
index 0157e049a..0157e049a 100644
--- a/src/video_out/vidix/drivers/sis_regs.h
+++ b/contrib/vidix/drivers/sis_regs.h
diff --git a/src/video_out/vidix/drivers/sis_vid.c b/contrib/vidix/drivers/sis_vid.c
index c3ef2bdcf..c3ef2bdcf 100644
--- a/src/video_out/vidix/drivers/sis_vid.c
+++ b/contrib/vidix/drivers/sis_vid.c
diff --git a/src/video_out/vidix/drivers/unichrome_regs.h b/contrib/vidix/drivers/unichrome_regs.h
index 15795f126..15795f126 100644
--- a/src/video_out/vidix/drivers/unichrome_regs.h
+++ b/contrib/vidix/drivers/unichrome_regs.h
diff --git a/src/video_out/vidix/drivers/unichrome_vid.c b/contrib/vidix/drivers/unichrome_vid.c
index b5ff314e6..b5ff314e6 100644
--- a/src/video_out/vidix/drivers/unichrome_vid.c
+++ b/contrib/vidix/drivers/unichrome_vid.c
diff --git a/src/video_out/vidix/fourcc.h b/contrib/vidix/fourcc.h
index 891f0b6ff..891f0b6ff 100644
--- a/src/video_out/vidix/fourcc.h
+++ b/contrib/vidix/fourcc.h
diff --git a/src/video_out/vidix/vidix.h b/contrib/vidix/vidix.h
index bcf6b4ae0..bcf6b4ae0 100644
--- a/src/video_out/vidix/vidix.h
+++ b/contrib/vidix/vidix.h
diff --git a/src/video_out/vidix/vidix.txt b/contrib/vidix/vidix.txt
index e642147b4..e642147b4 100644
--- a/src/video_out/vidix/vidix.txt
+++ b/contrib/vidix/vidix.txt
diff --git a/src/video_out/vidix/vidixlib.c b/contrib/vidix/vidixlib.c
index 37af2035b..37af2035b 100644
--- a/src/video_out/vidix/vidixlib.c
+++ b/contrib/vidix/vidixlib.c
diff --git a/src/video_out/vidix/vidixlib.h b/contrib/vidix/vidixlib.h
index ebc3dd309..ebc3dd309 100644
--- a/src/video_out/vidix/vidixlib.h
+++ b/contrib/vidix/vidixlib.h
diff --git a/debian/changelog b/debian/changelog
index 9a22bb6aa..4485f2706 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xine-lib-1.2 (1.2.1~hg-0) experimental; urgency=low
+
+ * Hg snapshot.
+ * Adjust for libxine2.
+ * libxine-dev → libxine2-dev.
+
+ -- Darren Salt <linux@youmustbejoking.demon.co.uk> Wed, 25 Jan 2012 00:53:33 +0000
+
xine-lib (1.1.21~hg-0) unstable; urgency=low
* Hg snapshot (dev build). Changelog is irrelevant :-)
diff --git a/debian/control b/debian/control
index cc449f0cf..60e11e06c 100644
--- a/debian/control
+++ b/debian/control
@@ -1,15 +1,16 @@
-Source: xine-lib
+Source: xine-lib-1.2
Section: libs
Priority: optional
Maintainer: xine Developers <xine-devel@lists.sourceforge.net>
Build-Depends: debhelper (>= 5.0.1), binutils (>= 2.12.90.0.9), pkg-config,
- automake1.11 | automaken, autoconf, libtool, autopoint,
- libavcodec-dev (>= 0.cvs20070307-3) | libavcodeccvs-dev,
- libavutil-dev (>= 0.cvs20070307-3) | libavutilcvs-dev,
- libavformat-dev (>= 0.cvs20070307-3) | libavformatcvs-dev,
- libpostproc-dev (>= 0.cvs20070307-3) | libpostproccvs-dev,
- libxcb-xv0-dev, libxcb-shm0-dev, libxcb-shape0-dev,
+ automake | automaken, autoconf, libtool, autopoint,
+ libavcodec-dev (>= 0.cvs20080206) | libavcodeccvs-dev,
+ libavformat-dev (>= 0.cvs20080206) | libavformatcvs-dev,
+ libpostproc-dev (>= 0.cvs20080206) | libpostproccvs-dev,
+ libavutil-dev (>= 0.cvs20080206) | libavutilcvs-dev,
+ libxcb-xv0-dev, libxcb-shm0-dev, libxcb-shape0-dev,
libxinerama-dev, libxv-dev, libxvmc-dev, libxt-dev,
+ libvdpau-dev | nvidia-libvdpau-dev,
libasound2-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386],
libcam-dev [kfreebsd-i386 kfreebsd-amd64],
libaa1-dev, libcaca-dev, libmodplug-dev,
@@ -22,17 +23,17 @@ Build-Depends: debhelper (>= 5.0.1), binutils (>= 2.12.90.0.9), pkg-config,
libdirectfb-dev, libgtk2.0-dev,
libflac-dev, libsdl1.2-dev, libwavpack-dev,
libsmbclient-dev, libspeex-dev, libmng-dev,
- libmad0-dev, libmpcdec-dev, libcdio-dev,
- libdvdnav-dev, libdvdread-dev,
- zlib1g-dev, w3m, transfig, sgmltools-lite,
- ghostscript | gs-gpl | gs
+ libmad0-dev, libmpcdec-dev, libcdio-dev, libvcdinfo-dev,
+ libdvdnav-dev, libdvdread-dev, libbluray-dev,
+ zlib1g-dev, w3m, xmlto, librsvg2-bin
Standards-Version: 3.7.2
-Package: libxine-dev
+Package: libxine2-dev
Architecture: any
Section: libdevel
-Depends: libxine1 (= ${Source-Version}), pkg-config
-Conflicts: xine-ui (<< 0.9.10), libxine2-dev
+Depends: libxine2 (= ${Source-Version}), pkg-config
+Conflicts: xine-ui (<< 0.9.10), libxine-dev
+Replaces: libxine-dev (>= 1.1.90)
Description: the xine video player library, development packages
This contains development files (headers, documentation and the like)
for the xine library (libxine).
@@ -48,11 +49,12 @@ Description: the xine video player library, development packages
The xine-ui and gxine packages each provide one for your convenience, so
you can just start watching your VCDs ;-)
-Package: libxine1-doc
+Package: libxine2-doc
Architecture: all
Section: libdevel
Provides: libxine-doc
-Conflicts: libxine2-doc
+Conflicts: libxine1-doc
+Replaces: libxine1-doc
Description: the xine video player library, development packages
This contains documentation for the xine library (libxine).
.
@@ -63,14 +65,14 @@ Description: the xine video player library, development packages
extensible to your heart's content via plugins for audio and video output,
input media, demuxers (stream types), audio/video and subtitle codecs.
-Package: libxine1
+Package: libxine2
Architecture: any
Depends: ${shlibs:Depends}
Recommends: ${shlibs:Recommends}
-Suggests: ${shlibs:Suggests}, libxine1-doc | libxine-doc
-Conflicts: libxine1-all-plugins, libxine1-bin, libxine1-console, libxine1-ffmpeg, libxine1-gnome, libxine1-misc-plugins, libxine1-plugins, libxine1-x
-Replaces: libxine1-all-plugins, libxine1-bin, libxine1-console, libxine1-ffmpeg, libxine1-gnome, libxine1-misc-plugins, libxine1-plugins, libxine1-x
-Provides: libxine1-all-plugins, libxine1-bin, libxine1-console, libxine1-ffmpeg, libxine1-gnome, libxine1-misc-plugins, libxine1-plugins, libxine1-x
+Suggests: ${shlibs:Suggests}, libxine2-doc | libxine-doc
+Conflicts: libxine2-all-plugins, libxine2-bin, libxine2-console, libxine2-ffmpeg, libxine2-gnome, libxine2-misc-plugins, libxine2-plugins, libxine2-x
+Replaces: libxine2-all-plugins, libxine2-bin, libxine2-console, libxine2-ffmpeg, libxine2-gnome, libxine2-misc-plugins, libxine2-plugins, libxine2-x
+Provides: libxine2-all-plugins, libxine2-bin, libxine2-console, libxine2-ffmpeg, libxine2-gnome, libxine2-misc-plugins, libxine2-plugins, libxine2-x, libxine2-vdr
Description: the xine video/media player library, binary files
This is the xine media player library (libxine).
.
@@ -85,10 +87,10 @@ Description: the xine video/media player library, binary files
The xine-ui and gxine packages each provide one for your convenience, so
you can just start watching your VCDs ;-)
-Package: libxine1-dbg
+Package: libxine2-dbg
Priority: extra
Architecture: any
-Depends: libxine1 (= ${Source-Version})
+Depends: libxine2 (= ${Source-Version})
Description: the xine video/media player library, debug data
This is the xine media player library (libxine).
.
diff --git a/debian/dh_xine.in b/debian/dh_xine.in
index 7c9f28caf..596e12096 100644
--- a/debian/dh_xine.in
+++ b/debian/dh_xine.in
@@ -27,7 +27,7 @@ By listing package name suffixes, you can generate dependencies and
recommendations (almost) at will. If you don't specify any, then 'x' and
'console' are used, generating xine-x:Depends and xine-console:Depends.
-'-' generates xine:Depends which contains a dependency on libxine1 which is
+'-' generates xine:Depends which contains a dependency on libxine2 which is
suitable for use by out-of-tree plugins.
=head1 EXAMPLES
@@ -67,10 +67,10 @@ foreach my $package (@{$dh{DOPACKAGES}}) {
foreach my $suffix (@suffix) {
if ($suffix eq '-') {
delsubstvar($package, "xine:Depends");
- addsubstvar ($package, "xine:Depends", "libxine1 (>= @VERSION@)");
+ addsubstvar ($package, "xine:Depends", "libxine2 (>= @VERSION@)");
} else {
delsubstvar($package, "xine-$suffix:Depends");
- addsubstvar ($package, "xine-$suffix:Depends", "libxine1-$suffix");
+ addsubstvar ($package, "xine-$suffix:Depends", "libxine2-$suffix");
}
}
}
diff --git a/debian/libxine-dev.install b/debian/libxine-dev.install
deleted file mode 100644
index 10a9d7983..000000000
--- a/debian/libxine-dev.install
+++ /dev/null
@@ -1,12 +0,0 @@
-usr/bin/xine-config
-usr/include
-usr/lib/libxine.la
-usr/lib/libxine*.so
-usr/lib/pkgconfig/libxine.pc
-usr/lib/xine/plugins/*/*.la
-usr/lib/xine/plugins/*/post/*.la
-usr/lib/xine/plugins/*/vidix/*.la
-usr/share/aclocal/xine.m4
-usr/share/man/man1/xine-config.1
-../dh_xine usr/bin
-../xine.pm usr/share/perl5/Debian/Debhelper/Sequence/xine.pm
diff --git a/debian/libxine1-doc.docs b/debian/libxine1-doc.docs
deleted file mode 100644
index c75c374d7..000000000
--- a/debian/libxine1-doc.docs
+++ /dev/null
@@ -1,8 +0,0 @@
-debian/tmp/usr/share/doc/libxine1/faq/*
-debian/tmp/usr/share/doc/libxine1/README_xxmc.html
-debian/tmp/usr/share/doc/libxine1/README
-debian/tmp/usr/share/doc/libxine1/faq.*
-debian/tmp/usr/share/doc/libxine1/README.syncfb*
-debian/tmp/usr/share/doc/libxine1/README.opengl*
-debian/tmp/usr/share/doc/libxine1/README.dxr3*
-debian/tmp/usr/share/doc/libxine1/README.dvb*
diff --git a/debian/libxine1-doc.manpages b/debian/libxine1-doc.manpages
deleted file mode 100644
index 23e59ea93..000000000
--- a/debian/libxine1-doc.manpages
+++ /dev/null
@@ -1 +0,0 @@
-debian/tmp/usr/share/man/man5/xine.5
diff --git a/debian/libxine1.install b/debian/libxine1.install
deleted file mode 100644
index ab8a5901f..000000000
--- a/debian/libxine1.install
+++ /dev/null
@@ -1,10 +0,0 @@
-usr/bin/xine-list*
-usr/lib/libxine*.so.*
-usr/lib/xine/plugins/*/post/*.so
-usr/lib/xine/plugins/*/*.so
-usr/lib/xine/plugins/*/vidix/*.so
-usr/share/locale
-usr/share/xine
-usr/share/doc/libxine1/hackersguide/*
-usr/share/bug/libxine1/presubj
-usr/share/man/man1/xine-list*.1
diff --git a/debian/libxine2-dev.install b/debian/libxine2-dev.install
new file mode 100644
index 000000000..dc28bb2cf
--- /dev/null
+++ b/debian/libxine2-dev.install
@@ -0,0 +1,12 @@
+usr/bin/xine-config
+usr/include
+usr/lib/libxine.la
+usr/lib/libxine*.so
+usr/lib/pkgconfig/libxine.pc
+usr/lib/xine/plugins/*/*.la
+usr/lib/xine/plugins/*/post/*.la
+usr/lib/xine/plugins/*/vidix/*.la
+usr/share/aclocal/xine.m4
+usr/share/man/man1/xine-config.1
+../dh_xine usr/bin
+../xine.pm usr/share/perl5/Debian/Debhelper/Sequence
diff --git a/debian/libxine2-doc.docs b/debian/libxine2-doc.docs
new file mode 100644
index 000000000..799c2c091
--- /dev/null
+++ b/debian/libxine2-doc.docs
@@ -0,0 +1,8 @@
+debian/tmp/usr/share/doc/libxine2/faq/*
+debian/tmp/usr/share/doc/libxine2/README_xxmc.html
+debian/tmp/usr/share/doc/libxine2/README
+debian/tmp/usr/share/doc/libxine2/faq.*
+debian/tmp/usr/share/doc/libxine2/README.opengl*
+debian/tmp/usr/share/doc/libxine2/README.dxr3*
+debian/tmp/usr/share/doc/libxine2/README.dvb*
+NEWS
diff --git a/debian/libxine2-doc.install b/debian/libxine2-doc.install
new file mode 100644
index 000000000..d40f4d237
--- /dev/null
+++ b/debian/libxine2-doc.install
@@ -0,0 +1 @@
+usr/share/man/man5/xine.5
diff --git a/debian/libxine2.install b/debian/libxine2.install
new file mode 100644
index 000000000..3f43fd950
--- /dev/null
+++ b/debian/libxine2.install
@@ -0,0 +1,10 @@
+usr/bin/xine-list*
+usr/lib/libxine*.so.*
+usr/lib/xine/plugins/*/post/*.so
+usr/lib/xine/plugins/*/*.so
+usr/lib/xine/plugins/*/vidix/*.so
+usr/share/locale
+usr/share/xine-lib
+usr/share/doc/libxine2/hackersguide/*
+usr/share/bug/libxine2/presubj
+usr/share/man/man1/xine-list*.1
diff --git a/debian/reportbug.presubj b/debian/reportbug.presubj
index 229cd9d74..847ff0bad 100644
--- a/debian/reportbug.presubj
+++ b/debian/reportbug.presubj
@@ -21,9 +21,9 @@ with xine-ui, then file the bug against gxine)
Report bugs for xine crashes
============================
-If you report a bug that applications linked against libxine1
+If you report a bug that applications linked against libxine2
(xine-ui, gxine, amarok, totem, etc) segfault, please install the
-packages 'xine-ui' and 'libxine1-dbg', and try to reproduce it with
+packages 'xine-ui' and 'libxine2-dbg', and try to reproduce it with
this command:
> ulimit -c unlimited ; /usr/bin/xine --bug-report <mrl>
diff --git a/debian/rules b/debian/rules
index 446f6e9cb..a09eb29b0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -22,16 +22,8 @@ DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_CONFIG_OPTIONS :=
-CFLAGS += -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
- CFLAGS += -O0
- DEB_BUILD_CONFIG_OPTIONS += --disable-optimizations
-endif
-INSTALL_TARGET := install
-BUILD_TARGET := all
-ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
- INSTALL_TARGET := install-debug
- BUILD_TARGET := debug
+ DEB_BUILD_CONFIG_OPTIONS += --disable-optimizations --enable-debug
endif
ifneq (,$(findstring mips,$(DEB_HOST_GNU_TYPE)))
@@ -75,18 +67,11 @@ CONFIGURE_FLAGS := \
--build $(DEB_BUILD_GNU_TYPE) \
--host $(DEB_HOST_GNU_TYPE) \
--prefix=/usr \
- --mandir=\$${prefix}/share/man \
- --with-external-libmad \
- --with-external-a52dec \
- --with-external-libdts \
- --with-external-ffmpeg \
- --with-external-libmpcdec \
- --with-external-dvdnav \
--with-freetype \
--with-wavpack \
--enable-ipv6 \
- $(DEB_BUILD_CONFIG_OPTIONS) \
- CFLAGS="$(CFLAGS)"
+ --with-external-dvdnav \
+ $(DEB_BUILD_CONFIG_OPTIONS)
configure: configure-stamp
configure-stamp:
@@ -154,10 +139,10 @@ binary-arch: build install
dh_installdocs
dh_installchangelogs -k ChangeLog
dh_link
- dh_strip --dbg-package=libxine1
+ dh_strip --dbg-package=libxine2
dh_compress
dh_fixperms
- dh_makeshlibs -V 'libxine1 (>= 1.1.2-5)'
+ dh_makeshlibs -V 'libxine2 (>= 1.1.90)'
dh_installdeb
chmod +x debian/shlibdeps.sh
debian/shlibdeps.sh libxine${major}
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
new file mode 100644
index 000000000..e291e9a73
--- /dev/null
+++ b/doc/Doxyfile.in
@@ -0,0 +1,1039 @@
+# Doxyfile 1.5.1
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+# TAG = value [value, ...]
+# For lists items can also be appended using:
+# TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME = @PACKAGE@
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER = @VERSION@
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY = @abs_top_builddir@/doc/api/
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian,
+# Italian, Japanese, Japanese-en (Japanese with English messages), Korean,
+# Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian,
+# Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian.
+
+OUTPUT_LANGUAGE = English
+
+# This tag can be used to specify the encoding used in the generated output.
+# The encoding is not always determined by the language that is chosen,
+# but also whether or not the output is meant for Windows or non-Windows users.
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES
+# forces the Windows encoding (this is the default for the Windows binary),
+# whereas setting the tag to NO uses a Unix-style encoding (the default for
+# all platforms other than Windows).
+
+USE_WINDOWS_ENCODING = NO
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH = @top_srcdir@
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like the Qt-style comments (thus requiring an
+# explicit @brief command for a brief description.
+
+JAVADOC_AUTOBRIEF = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member
+# documentation.
+
+DETAILS_AT_TOP = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C = YES
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for Java.
+# For instance, namespaces will be presented as packages, qualified scopes
+# will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA = NO
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to
+# include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT = NO
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING = YES
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS = YES
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES = YES
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES = NO
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from the
+# version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT = @abs_top_srcdir@/src @abs_top_builddir@/include
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+
+FILE_PATTERNS =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS = */src/libw32dll/wine/*
+EXCLUDE_PATTERNS += */src/input/libdvdnav/*
+EXCLUDE_PATTERNS += */src/input/vcd/libcdio/*
+EXCLUDE_PATTERNS += */src/input/vcd/libvcd/*
+EXCLUDE_PATTERNS += */src/libxineadec/nosefart/*
+EXCLUDE_PATTERNS += */src/libxineadec/gsm610/*
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis. Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match. The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES (the default)
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES (the default)
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code. Otherwise they will link to the documentstion.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT = .
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET =
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS = YES
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP = NO
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE = 4
+
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
+# probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH = 250
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS = NO
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION = YES
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED = DOXYGEN XINE_COMPILE
+PREDEFINED += XINE_PACKED= ATTR_ALIGN(x)= XINE_PROTECTED=
+PREDEFINED += XINE_MALLOC=
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS = YES
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT = NO
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH = YES
+
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a call dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable call graphs for selected
+# functions only using the \callgraph command.
+
+CALL_GRAPH = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then doxygen will
+# generate a caller dependency graph for every global function or class method.
+# Note that enabling this option will significantly increase the time of a run.
+# So in most cases it will be better to enable caller graphs for selected
+# functions only using the \callergraph command.
+
+CALLER_GRAPH = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS =
+
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_WIDTH = 1024
+
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than
+# this value, doxygen will try to truncate the graph, so that it fits within
+# the specified constraint. Beware that most browsers cannot cope with very
+# large images.
+
+MAX_DOT_GRAPH_HEIGHT = 1024
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that a graph may be further truncated if the graph's
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default),
+# the graph is not depth-constrained.
+
+MAX_DOT_GRAPH_DEPTH = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, which results in a white background.
+# Warning: Depending on the platform used, enabling this option may lead to
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
+# read).
+
+DOT_TRANSPARENT = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine
+#---------------------------------------------------------------------------
+
+# The SEARCHENGINE tag specifies whether or not a search engine should be
+# used. If set to NO the values of all tags below this one will be ignored.
+
+SEARCHENGINE = NO
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 070ef5a1e..86ae75f8e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,11 +1,12 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
SUBDIRS = man hackersguide faq
dist_doc_DATA = README README.dvb README.dxr3 \
README.freebsd README.irix README.network_dvd README.opengl \
- README.solaris README.syncfb README_xxmc.html README.MINGWCROSS \
- README.WIN32
+ README.solaris README_xxmc.html README.MINGWCROSS \
+ README.WIN32 README.macosx
docs clean-docs:
@cd faq && $(MAKE) $@
diff --git a/doc/README b/doc/README
index 56d133a70..2c01dc5ce 100644
--- a/doc/README
+++ b/doc/README
@@ -29,6 +29,9 @@ README.freebsd
README.irix
hints on running xine on IRIX
+README.macosx
+ hints on building xine on Mac OS X
+
README.network_dvd
how to play DVDs / Audio CDs over the network
@@ -37,6 +40,3 @@ README.opengl
README.solaris
hints on running xine on Solaris
-
-README.syncfb
- information about xine's SyncFB video output plugin
diff --git a/doc/README.dvb b/doc/README.dvb
index e32b980dd..21e2a41db 100644
--- a/doc/README.dvb
+++ b/doc/README.dvb
@@ -51,7 +51,7 @@ Install a channel list
xine-lib's dvb input plugin needs a channel/transponder list that fits your
dvb equipment. xine-lib uses the channels.conf format of szap, czap and tzap
as appropriate for DVB-S, DVB-C and DVB-T. It will search the channel list
-file in ~/.xine/channels.conf.
+file in ~/.config/xine/channels.conf.
channel list format for DVB-S: (satellite)
-------------------------------------------
@@ -70,8 +70,8 @@ You scan for all available channels using the scan utility which comes with
the dvb-apps package (also known as dvb-utils). See
http://www.linuxtv.org/wiki/index.php/Scan for more information.
- $ scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-PontopPike >~/.xine/channels.conf
- $ scan Hotbird-13.0 >~/.xine/channels.conf
+ $ scan /usr/share/doc/dvb-utils/examples/scan/dvb-t/uk-PontopPike >~/.config/xine/channels.conf
+ $ scan Hotbird-13.0 >~/.config/xine/channels.conf
This can take a while. In a DiSEqC environment, use the -s N switch to
select different satellites to scan and paste the results in one big
@@ -134,3 +134,4 @@ top left hand corner will notify you of the status of the recording.
Pressing MENU4 again will resume recording.
Have fun.
+
diff --git a/doc/README.macosx b/doc/README.macosx
new file mode 100644
index 000000000..02c98c8d9
--- /dev/null
+++ b/doc/README.macosx
@@ -0,0 +1,141 @@
+Building
+--------
+Mac OS X builds of xine-lib are built using the same autoconf-based build
+scripts that are used on other Unix-based platforms (e.g., Linux, FreeBSD).
+There is no Xcode project, nor is there any intention to create and/or
+maintain one in the future. There's no good reason, and it would only add
+unnecessary complexity and an additional maintenance burden.
+
+Currently, xine-lib is only supported on Mac OS X 10.4 Tiger. There are no
+plans to support older versions of Mac OS X for a variety of reasons.
+
+As of xine-lib 1.2, specific versions of build tools are required. They are
+as follows:
+
+ - GNU M4 1.4.7 (1.4.9 is current, 1.4.2 is installed on Tiger)
+ - autoconf 2.59 (2.61 is current, 2.59 is installed on Tiger)
+ - automake 1.9 (1.10 is current, 1.6.3 is installed on Tiger)
+ - GNU libtool 1.5.20 (1.5.22 is current, 1.5 is installed on Tiger)
+
+When building on Tiger, since some of the system-installed tools are out of
+date, you'll need to update at least some of them. It is recommended that you
+bring all of them up to current releases as listed above.
+
+The order in which you install updated tools to replace the system-installed
+versions is important, and in some cases, specific build options are required
+for them to work properly.
+
+ 1. Install GNU M4 >= 1.4.7
+ - This is optional if you use the system-installed version of autoconf;
+ however, if you install a newer version of autoconf, you MUST install
+ a newer version of GNU M4 first.
+ - Run its configure script with --program-prefix=g
+ 2. Install autoconf >= 2.59
+ - This is optional, but it is recommended that you use autoconf 2.61.
+ - No special configure options are required. Simply configure, make, and
+ make install.
+ 3. Install automake >= 1.9
+ - This is required, and since it is required, it is recommended that you
+ use automake 1.10.
+ - No special configure options are required. Simply configure, make, and
+ make install.
+ 4. Install GNU libtool >= 1.5.20
+ - This is required, and since it is required, it is recommended that you
+ use GNU libtool 1.5.22.
+ - Run its configure script with --program-prefix=g
+
+ ** A special note about GNU libtool:
+ Mac OS X has its own utility called libtool that is NOT the same as GNU
+ libtool, but the Developer tools install GNU libtool as well. The system-
+ installed version of GNU libtool is installed with a g- prefix, and xine's
+ build scripts expect this as well if you install your own version. If you
+ do not install GNU libtool with a g- prefix, xine's build scripts will
+ pick up the system-installed version instead of the newer one you install!
+
+With your tool chain brought up-to-date with xine's requirements, you can go
+ahead and build xine-lib by first running configure, then make, and finally,
+make install, just as you would on, say, Linux. If you are building from a
+source repository snapshot or checkout, you will need to run autogen.sh first.
+
+When running configure, it's best if you do not attempt to forcibly enable most
+options that are disabled by default. For example, DVB support is disabled by
+default on Mac OS X because it doesn't work. Enabling it may allow it to build
+okay, but it will not work at runtime.
+
+The one exception is --enable-macosx-universal. Universal binaries are not
+enabled by default, but they are fully supported. With this optional enabled,
+the default is to build FAT binaries for ppc and i386; however, you may also
+enable support for ppc64 and/or x86_64. For example:
+
+ ./configure --enable-macosx-universal=i386,ppc,x86_64,ppc64
+
+CoreAudio audio output support will be enabled by default. Mac OS X video
+output support will be enabled by default. Xwindows support will be enabled
+by default for video output (using XShm, Xv, and OpenGL). In most cases,
+you'll probably want to disable Xwindows support, and that is safe to do by
+adding --without-x to the configure command-line.
+
+Running
+-------
+Very limited run-time testing has been done so far. The Mac OS X port of
+xine-lib is in its early stages, only recently becoming buildable at all,
+though some quick-and-dirty efforts have been made in the past to build and
+run on Mac OS X.
+
+At this time, native video output only works with Objective-C Cocoa windows
+using the XineOpenGLView class that resides in libxineMacOSXVideo.dylib. This
+works, but it isn't yet stable enough for every day use. Xwindows video output
+support builds, but it is unknown whether it works. If you plan on using the
+Cocoa video output support, you'll need to link with both libxine.dylib and
+libxineMacOSXVideo.dylib as well as libxine.dylib.
+
+Instantiate an audio output port as follows:
+
+ ao_port = xine_open_audio_driver(xine_instance, "coreaudio", NULL);
+
+Instantiate a video output port as follows:
+
+ vo_port = xine_open_video_driver(xine_instance, "macosx",
+ XINE_VISUAL_TYPE_MACOSX, view);
+
+In both cases, xine_instance is the return from xine_new() that has been then
+been initialized with xine_init(). For video output, the view argument to
+xine_open_video_driver() is the XineOpenGLView instance in which to render.
+
+The Future
+----------
+A full, proper port of xine-lib to Mac OS X is in progress. Efforts are under
+way to make as many of the various plug-ins work properly on Mac OS X as makes
+sense, but it is unlikely that full support will be complete by the time that
+xine-lib 1.2 is released.
+
+The following is a list of the things that will definitely be done:
+
+ * CoreVideo support for video output instead of the current NSOpenGLView-
+ based video output plug-in. The existing video output plugin will not be
+ retained as a plug-in, but the code will remain available based on the new
+ CoreVideo video output plugin.
+ * Building xine-lib as an application bundle embeddable framework, as well as
+ a system-wide installable framework, though the utility of the latter is
+ questionable.
+ * Enable VCD input support. Mac OS X specific code is required in xine-lib
+ itself to support this. Currently, only FreeBSD, Linux, and Solaris can
+ build the VCD input plugin.
+ * Investigate enabling Real binary and Win32 binary support for Intel Macs.
+ * Investigate better font support without the need for FreeType2.
+ * SPDIF pass-through for CoreAudio
+
+Known Issues
+------------
+ * Building on Leopard does not work due to build problems with ffmpeg.
+ * VCD support is not yet available, though internal versions of libcdio and
+ libvcd will build. If you enable VCD at configure time, the build WILL
+ fail.
+ * Real binary codec support is not yet available.
+ * On Intel, Win32 binary codec support is not yet available.
+ * Very little run-time testing has been done. Basic file input and ffmpeg
+ based demux/decoding is known to work.
+ * Xwindows support builds, but it has not been tested at all.
+ * Applications using xine-lib must link with both libxine.dylib and
+ libxineMacOSXVideo.dylib if they will be using the Cocoa video output
+ support.
diff --git a/doc/README.syncfb b/doc/README.syncfb
deleted file mode 100644
index be8c2565d..000000000
--- a/doc/README.syncfb
+++ /dev/null
@@ -1,280 +0,0 @@
-
- ===== =====
- XINE video output plugin for MATROX G200/G400/G450 cards *only*
- ===== =====
-
-
-* WHAT IS THIS PLUGIN ABOUT and WHY SHOULD I EVEN CONSIDER TO USE IT? :)
-
- This xine video output plugin uses the so called SyncFB driver (from
- the Teletux project) which provides special hardware features of
- Matrox G200 and newer cards like hardware deinterlacing, scaling and
- synchronization of your video output to the vertical retrace of your
- monitor - just to name a few. The plugin makes all those features
- available to xine and because all this tasks are done by the graphic
- card there is no need for xine to do them in software -- so you save
- precious CPU time which you may gonna need for other things. :-)
-
- Ok ok -- why should you want to have your video output synchronized to
- something called the vertical retrace of your monitor?! Well... :)
-
- In order to have an optimal DVD playback the update of the image needs
- to be syncronized with the vertical refresh of the screen. Otherwise
- you will sometimes see part of frame n and part of frame n+1 during
- playback of a movie. Resulting in tearing artefacts on moving objects.
-
- When using this plugin the update of the screen is done during the
- vertical retrace of your monitor and those tearing artefacts are gone
- forever.
-
- Also the SyncFB kernel module and this plugin totally by-pass XFree86
- for anything else but some data gathering routines needed to place the
- overlay at the right spot. So on some machines you will gain some
- performance too because of the different way the SyncFB kernel module
- handles your video output.
-
- Last but not least, you may ask what's so special about deinterlacing?
- There are already several deinterlacing methods available in xine and
- why should you care about another one? Well (again)... ;-))
-
- All current deinterlacers in xine are done in software and therefore
- will cost you some CPU power. The SyncFB video out plugin will use the
- hardware deinterlacing support of your graphic card, thus saving your
- CPU power because everything is done by your GPU...
-
-
-* WILL IT WORK WITH MY G200/G400/G450/... CARD?
-
- So far the plugin and the kernel module itself are only being tested
- on G400 cards by its developers thus we cannot tell about newer
- or older generation chips.
-
- Nevertheless we have received positive feedback that the SyncFB kernel
- module and this plugin work fine with G450 cards too.
-
- If you have got things working on older/newer chips, please let us
- know about your success and we will place a note here... :-)
-
-
-* AND HOW DOES IT WORK?
-
- The SyncFB driver is a kernel module you will have to load that makes
- a special device (e.g. /dev/syncfb) available which is opened by the
- plugin and controlled with certain ioctl calls. Easy, isn't it? ;-)
-
- That module is based on the mga_vid driver from Aaron Holzmann and was
- advanced (and reworked) by Matthias Oelmann.
-
-
-* OK I HEARD ENOUGH - HOW DO I INSTALL and USE IT? :)
-
- Currently the Teletux project which maintains the kernel module seems
- orphaned and therefore there hasn't been any progress nor release in a
- fair amount of time. :( We will try to resolve this situation so that
- the development continues again. As soon as there are any news on this
- matter, this README will be updated accordingly. For the time being
- you can still use the current Teletux SyncFB kernel module which works
- just fine, so there is no need to worry. :-)
-
- Back to the original subject. In order to install and use the SyncFB
- kernel module, you *will* need a fresh CVS checkout of the sources
- because the last official release is rather outdated.
-
- This sounds more complicated than it actually is. You will only have
- to execute the following two commands to get the sources in a sub-dir
- called teletux. When you are asked for password, just press return.
-
- cvs -d:pserver:anonymous@cvs.teletux.sf.net:/cvsroot/teletux login
- cvs -d:pserver:anonymous@cvs.teletux.sf.net:/cvsroot/teletux co -P teletux
-
- Now enter the directory teletux/syncfb, that's where the actual kernel
- modul sources are located. Before you can compile the module, you will
- have to change two lines in the Makefile itself to make it work.
-
- In the second line, there is a phrase like "-I/usr/include" which you
- have to change to "-I/usr/src/linux/include". In line seven, you need
- to remove syncfbtv and syncfb_test from the OBJ list.
-
- Now execute a "make" and the module will be compiled. Place the
- resulting syncfb.o in your modules dir which is usually...
-
- /lib/modules/KERNEL_VERSION/
-
- ... and issue a "depmod -a" after it. That's it - the kernel module is
- installed. To load the syncfb module, execute "modprobe syncfb" every
- time you (re)start your computer. This will automatically create the
- required /dev/syncfb device if you have devfs support, otherwise you
- need to issue a "mknod /dev/syncfb c 178 0" once to create the
- device yourself permanently.
-
- Once the module is loaded, you can start xine with the "-V SyncFB"
- option to use this plugin. xine automatically remembers the video out
- plugin you last used, so you only have to use this option once too. :)
- But don't forget, the module *always* has to be already loaded before
- you start xine, otherwise xine will fallback to Xv/XShm or some other
- available video out plugin.
-
-
-* THE VIDEO IS JERKING - WHAT'S THE MATTER?!
-
- Playing back video material that is mastered for e.g. NTSC can cause
- this jerking if your monitor is not running at a refresh rate that is
- a multiple of 30 (PAL: 25).
-
- You can try to fix that by switching your monitor to the appropriate
- refresh rates (e.g. 50/75/100 Hz for PAL, 60/90/120 Hz for NTSC). You
- will need to add so called modelines to your XFree86 config to make
- those modes available, if you don't already have them.
-
- Here is is a short listing of some sample modelines. Please add only
- those two lines (for NTSC and PAL) which exactly fit the screensize
- you are running your X Server with. You need to add those lines to the
- monitor section of your XF86Config file as well as include their names
- in the screen section (subsection display of the color depth your are
- using).
-
- USE THE FOLLOWING MODELINES AT YOUR OWN RISK. THEY COULD DAMAGE YOUR
- MONITOR PERMANTELY - PLEASE TAKE CAUTION AND DON'T BLAME US. YOU HAVE
- BEEN WARNED.
-
- So much for the standard disclaimer. :)
-
- Note: If you want to be on the safe side, generate your very own
- modelines with an application like kvideogen for example.
-
- Also the modelines may need some fine tuning for your setup. You
- can use xvidtune (comes with XFree86) to do that.
-
- # 1024x768
-
- Modeline "1024x768pal" 64.94 1024 1040 1216 1328 768 768 775 802
- Modeline "1024x768ntsc" 54.32 1024 1040 1216 1328 768 768 774 802
-
- # 1152x864
-
- Modeline "1152x864pal" 68.82 1152 1168 1384 1496 864 864 871 902
- Modeline "1152x864ntsc" 80.93 1152 1168 1384 1496 864 864 872 902
-
- # 1280x1024
-
- none yet - might be added in the future
-
- So before you run xine just turn to the appropriate refresh rate and
- the jerking *should* be gone. (you may also want to have a look at the
- XF86VidMode support included in xine which makes on-the-fly resolution
- switching possible when fullscreen is toggled)
-
-
-* WHAT SCREENSIZE SHOULD I PREFER?
-
- Well. It is important that the screensize you choose for DVD playback
- is exactly the same screensize you're starting up your X Server with
- if you are not using the XF86VidMode extension which will properly do
- the switching for you and take care that the plugin is updated
- accordingly. So you shouldn't switch down to 1024x768 yourself if you
- are running 1280x1024 because that gives you a virtual screensize
- of 1280x1024 in a resolution of 1024x768 - and the plugin can't handle
- that - and probably never will... ok... never say never. ;)
-
- You may want to have a look at the XF86VidMode support in xine which
- will enable on-the-fly resolution switching when activating fullscreen.
-
- Now back to the question. A screensize of 800x600 should be it for
- non-anamorphic DVDs because their resolution is 720x576 for pal DVDs
- and 720x480 for ntsc ones. If you've an anamorphic DVD, you should use
- a higher resolution - 1024x768 will be best because the image only has
- to be horizontally scaled to get back to the original geometry of 16:9
- which is easier to be done.
-
-
-* WHAT ABOUT DEINTERLACING?!
-
- Pressing 'i' during playback will toggle hardware deinterlacing. A
- decrease in picture quality is a known side effect, yet you won't see
- any artefacts caused by interlacing anymore. :-)
-
- One more note, hardware deinterlacing uses BOB as deinterlacing method
- and is totally independent from the software deinterlacing in xine. So
- specifing a different deinterlacing method in your .xinerc won't have
- any effect on this feature.
-
- Nevertheless we are thinking about making software deinterlacing also
- available as an option. It's on the TODO list... :)
-
-
-* HEY! THE OVERLAY TURNS OFF WHEN THE WINDOW IS PARTLY OFF THE DESKTOP!?
-
- That's done on purpose. It prevents possible yet harmless screen
- corruption. And by the way - why would you want to see a movie just
- partly?! ;-)
-
-
-* MY DESKTOP BACKGROUND IMAGE GETS CORRUPTED WHEN USING THIS PLUGIN!
-
- Even though it doesn't look nice, it's nevertheless harmless. So no
- need to worry about it. XFree86 is using your free video memory as
- cache for certain things. Now when you use this plugin that part of
- your video memory could also be used by the syncfb module. So your
- image data cached there will be corrupted. Unfortunately there is no
- way to avoid it. Yet, like stated earlier, it is truely harmless and
- just a cosmetical side effect.
-
-
-* THE XINE PANEL DOES NOT APPEAR WHEN I WATCH A MOVIE IN FULLSCREEN?!
-
- Actually it does appear - you just don't see it. :) This is a side
- effect of how SyncFB works. The X server can't display anything where
- the actual overlay from SyncFB is being displayed because this area in
- your video memory is constantly over written - so are the changes done
- by your X Server (like a window graphic that is placed there).
-
- This is just cosmetical and harmless, so no need to worry. If you want
- to do something with the xine panel when the video overlay is taking
- all your screen, just switch back to window mode and do what you have
- to do and after that, back to fullscreen it goes. :-)
-
-
-* KNOWN BUGs
-
- + the default_repeat config option is currently hardcoded to 0 because
- any higher value than 1 will trigger a bug with the SyncFB kernel module
- that results in a distorted picture (depending on video resolution)
- [this bug is hard to trace, so don't hold your breath for now]
-
- + SyncFB overlay won't turn off when video window is minimized or
- somehow else hidden.
- [currently there is no way for the SyncFB plugin to know about the
- state of the video window except if the original xine-ui hide function
- is used to hide the video window... this will be fixed soon]
-
- + zooming feature is currently deactivated because it exposes a bug
- with the SyncFB kernel module
- [for now, don't expect this to be fixed soon - sorry]
-
- + the syncfb kernel module needs updating pretty badly
-
-
-* WHAT IS ON THE TODO LIST?
-
- + fix above listed bugs in the SyncFB kernel module
-
- + make software deinterlacing available as an option
-
- + RGB support
- (unlikely at the moment because there is no need for it)
-
- + check if the video source is not too big in terms of dimensions for
- the video memory left (video memory - X reserved video memory)
-
- + bug fixes
- + more sanity checks
- + new features
- + optimizations
-
-
-* CONTACTS and FEEDBACK
-
- Your first starting point should be this README followed by the FAQ. :-)
- If you don't find your answers there or if you found a bug, please leave
- a message on the xine user mailinglist (see the general README).
-
diff --git a/doc/faq/Makefile.am b/doc/faq/Makefile.am
index 6090fd272..4a5c2f6f9 100644
--- a/doc/faq/Makefile.am
+++ b/doc/faq/Makefile.am
@@ -1,22 +1,17 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
doc_DATA = faq.txt
html_DATA = faq.html
-EXTRA_DIST = README faq.sgml $(doc_DATA) $(html_DATA)
+EXTRA_DIST = README faq.docbook faq.xsl $(doc_DATA) $(html_DATA)
-docs: $(doc_DATA) $(html_DATA)
+DISTCLEANFILES = $(doc_DATA) $(html_DATA)
-distclean-local: clean-docs
-
-docs-prepare: $(srcdir)/faq.sgml
- if test "$(srcdir)" != "." -a "$(srcdir)" != "`pwd`"; then \
- test -f ./faq.sgml -a ./faq.sgml -nt $(srcdir)/faq.sgml || cp $^ . ; \
- fi
+docs: $(hackersguide_DATA)
clean-docs:
- rm -f $(doc_DATA) $(html_DATA)
- test "x$(srcdir)" = x. || rm -f faq.sgml
+ rm -f $(hackersguide_DATA)
dist-hook:
@if test x"$(distcheck_lax)" = x ; then \
@@ -25,38 +20,26 @@ dist-hook:
$(MAKE) docs ; \
fi
-if HAVE_SGMLTOOLS
-faq.html: faq.sgml
- @$(MAKE) docs-prepare
- $(SGMLTOOLS) -b onehtml faq.sgml;
-else
-faq.html: faq.sgml
- @$(MAKE) docs-prepare
- if test x"$(fail_if_missing)" = x"yes"; then \
- echo "Please install sgmltools-lite."; \
- exit 1; \
- fi
- if test x"$(fail_if_missing)" != x"yes"; then \
- touch $@; \
- sleep 1; \
- touch $(notdir $^); \
- fi
-endif
+distclean-local: clean-docs
+
+AM_V_FAKE = $(am__v_FAKE_$(V))
+am__v_FAKE_ = $(am__v_FAKE_$(AM_DEFAULT_VERBOSITY))
+am__v_FAKE_0 = @echo " FAKE " $@;
-if HAVE_SGMLTOOLS
-faq.txt: faq.sgml
- @$(MAKE) docs-prepare
- $(SGMLTOOLS) -b txt faq.sgml;
+if HAVE_XMLTO
+faq.html: faq.docbook faq.xsl
+ $(AM_V_GEN)xmlto -m faq.xsl xhtml-nochunks $<
+faq.txt: faq.docbook faq.xsl
+ $(AM_V_GEN)xmlto -m faq.xsl txt $<
else
-faq.txt: faq.sgml
- @$(MAKE) docs-prepare
- if test x"$(fail_if_missing)" = x"yes"; then \
- echo "Please install sgmltools-lite."; \
+faq.html faq.txt: faq.docbook
+ $(AM_V_FAKE)if test x"$(fail_if_missing)" = x"yes"; then \
+ echo "Please install xmlto."; \
exit 1; \
fi
if test x"$(fail_if_missing)" != x"yes"; then \
touch $@; \
sleep 1; \
- touch $(notdir $^); \
+ touch $^; \
fi
endif
diff --git a/doc/faq/faq.docbook b/doc/faq/faq.docbook
new file mode 100644
index 000000000..d26dc343a
--- /dev/null
+++ b/doc/faq/faq.docbook
@@ -0,0 +1,2290 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd" >
+
+<book>
+
+ <bookinfo>
+ <title>The xine engine FAQ list</title>
+ <titleabbrev>xine FAQs</titleabbrev>
+ <copyright>
+ <year>2001-2010</year>
+ <holder>the xine project team</holder>
+ </copyright>
+ </bookinfo>
+
+ <article class="faq">
+
+ <sect1 id="general">
+ <title>General questions about xine and this document</title>
+
+ <sect2 id="about">
+ <title>What is the xine engine?</title>
+ <para>
+ The xine engine is a free media player engine. It comes in the form of
+ a shared libarary and is typically used by media player frontends
+ and other multimedia applications for playback of multimedia streams
+ such as movies, radio/tv network streams, DVDs, VCDs.
+ </para>
+ <para>
+ Since there are several frontends for the xine library available,
+ this document has a problem when it comes to examples.
+ The two most common frontends xine-ui and gxine are mixed in command
+ line examples throughout this FAQ. When you use a different
+ frontend, some of these will not work for you. The filename of
+ the config file also varies amongst frontends. If you get confused,
+ I recommend you try with one of xine-ui or gxine.
+ </para>
+ </sect2>
+
+ <sect2 id="scope">
+ <title>What's the aim and scope of this text?</title>
+ <para>
+ The primary goal of this FAQ is to cover all recurring questions related
+ to the xine engine. Frontend specific questions are usually not covered here.
+ </para>
+ </sect2>
+
+ <sect2 id="wheretogethelp">
+ <title>My question is not yet covered here &ndash; where can I ask for help?</title>
+ <para>
+ First of all be sure that your question is really not covered here and
+ that you haven't just been a bit too lazy to read through all of this
+ text. ;-). Also check out the documentation specific to
+ the frontend (e.g. <command>xine-ui</command> or <command>gxine</command> or
+ <command>totem</command>).
+ </para>
+ <para>
+ That said &ndash; you are welcome to mail to our user mailing list:
+ <email>xine-user@lists.sourceforge.net</email>
+ Please provide some info about your setup so people have a chance to
+ help you, e.g. include information about your audio/video hardware
+ and drivers you use, operating system, cpu type and some console
+ output/any error messages. Also include command line parameters you
+ have specified and information about the type of stream you're
+ trying to play back. Also very important is the version of xine
+ you're using and information about any additional plugins you
+ may have installed on your system.
+ </para>
+ </sect2>
+
+ <sect2 id="pronounce">
+ <title>How do I pronounce "xine"?</title>
+ <para>
+ As long as people know what you are talking about, you are free to
+ pronounce it the way you like, but the official pronounciation is
+ [ksi:n], like the name "Maxine" with the "Ma" removed.
+ </para>
+ </sect2>
+
+ <sect2 id="modules">
+ <title>What are those xine-lib, xine-ui, gxine, &hellip; Mercurial repositories for?</title>
+ <para>
+ Some time ago xine just became too complex to be just one big program.
+ Therefore it was split into two major parts.
+ </para>
+ <para>
+ xine-lib is simply speaking the engine of xine. It contains all basic plugins
+ and is necessary to run anything that relies on xine. (This is the part that
+ is covered in this FAQ.)
+ </para>
+ <para>
+ Then there are frontends &ndash; applications that use xine. The most
+ common frontend is that of a media player. There are currently
+ three frontends being developed in the xine project: xine-ui, a skinned
+ dvd-player style frontend directly based on xlib; gxine, a desktop
+ media-player style frontend using the standard GTK widget set; and
+ xine-plugin, a plugin for browsers such as Firefox.
+ External projects like kaffeine, sinek and totem develop additional frontends.
+ In the future you will likely see more and different types of applications
+ being developed which will use the xine engine for video processing
+ and other multimedia purposes.
+ </para>
+ <para>
+ If you simply want a media/dvd player, you'll need to install xine-lib
+ first and then choose and install a player frontend like xine-ui or gxine.
+ </para>
+ <para>
+ Other repositories include <filename>xine-project-www</filename>,
+ which contains the xine project website sources, and various packaging
+ and development branches.
+ </para>
+ </sect2>
+
+ <sect2 id="hg">
+ <title>Where and how do I get the latest development version?</title>
+ <para>
+ Be advised that end-users should stick to the official xine releases.
+ The Mercurial repositories are only intended for developers and for others who know why they use it.
+ </para>
+ <para>
+ The repositories are listed at <ulink url="http://hg.debian.org/hg/">http://hg.debian.org/hg/</ulink>;
+ however, this is a list of all repositories which are kept there, not just the
+ xine project's (which are the ones which begin with <filename>xine-lib/</filename>). To check one out:
+ <screen>&nbsp;&nbsp;&nbsp;<command>hg clone http://hg.debian.org/hg/<filename>repository</filename> <filename>local_copy</filename></command></screen>
+ e.g.
+ <screen>&nbsp;&nbsp;&nbsp;<command>hg clone http://hg.debian.org/hg/xine-lib/xine-lib xine-lib</command></screen>
+ </para>
+ <para>
+ You can see a full list of repositories by visiting
+ <ulink url="http://hg.debian.org/hg/xine-lib/">http://hg.debian.org/hg/xine-lib/</ulink>.
+ </para>
+ </sect2>
+
+ <sect2 id="cvs">
+ <title>Don't you use CVS?</title>
+ <para>
+ We used to, but there are some significant problems with CVS. Merging
+ is easier with Mercurial (and, for that matter, git); and we can commit
+ changes locally, change them if mistakes have been made, then make them
+ public whenever we're ready.
+ </para>
+ </sect2>
+
+ <sect2 id="patch">
+ <title>How do I submit patches?</title>
+ <para>
+ See the xine Hackers' Guide, chapter 3, "How to contribute".
+ (This is available online at <ulink url="http://www.xine-project.org/hackersguide#contribute">http://www.xine-project.org/hackersguide#contribute</ulink>.)
+ </para>
+ </sect2>
+
+ <sect2 id="binaries">
+ <title>Where can I find pre-compiled binaries, e.g. RPMs?</title>
+ <para>
+ The xine project does not provide pre-compiled binaries for legal
+ reasons (some parts of xine may be covered by patents in some countries).
+ Some OS projects/vendors (e.g. Debian, FreeBSD, &hellip;) offer binaries
+ for their distributions &ndash; please contact them or use their package search
+ tools for further info.
+ You can also find links to third parties providing xine RPMs on
+ the xine homepage at
+ <ulink url="http://www.xine-project.org/releases">http://www.xine-project.org/releases</ulink>.
+ </para>
+ <para>
+ See the next section of this FAQ for instructions on how to build xine
+ from source.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="building">
+ <title>Building and installing xine from source</title>
+
+ <sect2 id="buildrequirements">
+ <title>What do I need to compile everything properly?</title>
+ <para>
+ First of all an official and stable release of gcc. Also be aware
+ that patched gcc versions may break parts of xine and are therefore
+ not supported by the xine project.
+ </para>
+ <para>
+ Furthermore you'll have to use GNU make to compile xine. On most GNU/Linux
+ systems "make" is GNU make &ndash; on other platforms use "gmake" instead.
+ Also, zlib is required (including the appropriate header files, which are
+ often found in a package called zlib-devel or similar.)
+ </para>
+ <para>
+ If you want to compile xine from Mercurial, you'll need to have the autobuild tools
+ installed (automake, autoconf and libtool &ndash; in recent versions).
+ </para>
+ <para>
+ Frontends might need additional libraries, e.g. for gxine you'll need to have
+ GTK2 installed. Make sure you have not only the shared libraries themselves
+ but also the header files (often packaged seperately as so-called -dev packages)
+ on your system.
+ </para>
+ <para>
+ Some plugins that come with the xine engine need additional libraries (otherwise
+ they will not be built). For example, libogg and libvorbis (plus their include files)
+ are needed for ogg/vorbis support. Most notably, if you want to see any video
+ on your X11 desktop (and that's what you're here for, isn't it?), you need the
+ X developer packages as well.
+ </para>
+ <para>
+ Don't worry about this too much right now, xine's <command>configure</command>
+ (see below) will check for all the stuff needed and will tell you what's missing
+ (which means that you should check the output it produces carefully ;) ).
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>How do I compile xine?</title>
+ <sect3 id="simplebuildinstr">
+ <title> Simple build instructions for beginners </title>
+ <para>
+ Download the latest xine-lib and gxine/xine-ui tarballs, then follow
+ these instruction. To unpack a tarball, use:
+ <screen>&nbsp;&nbsp;&nbsp;<command>tar xfvz tarballname.tar.gz</command></screen>
+ </para>
+ <para>
+ The following instructions will install xine in <filename>/usr/local</filename>
+ where it will be visible for all users. You need root privileges to do this on most systems.
+ </para>
+ <para>
+ After unpacking xine-lib, issue:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>./configure</command>
+&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
+ </para>
+ <para>
+ Make sure your <filename>/etc/ld.so.conf</filename> contains
+ <filename>/usr/local/lib</filename> and continue with:
+ <screen>&nbsp;&nbsp;&nbsp;<command>ldconfig</command></screen>
+ </para>
+ <para>
+ Now unpack your frontend (gxine or xine-ui or &hellip;), then:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>./configure</command>
+&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
+ </para>
+ </sect3>
+ <sect3 id="completebuildinstr">
+ <title>Complete build instructions</title>
+ <para>
+ The build process is the same for all of the xine modules.
+ </para>
+ <para>
+ You have to start with xine-lib. If built and installed successfully, you
+ can continue with the frontend(s).
+ </para>
+ <para>
+ If you have installed xine-lib to a non-standard prefix, make sure
+ that you have <filename>$prefix/bin</filename> in your PATH and that your linker finds
+ libs in <filename>$prefix/lib</filename> &ndash; otherwise trying to build modules that
+ rely on xine-lib will fail with configure complaining about not
+ finding certain parts of libxine. Using bash you can do something like:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>export PATH="$prefix/bin:$PATH"</command>
+&nbsp;&nbsp;&nbsp;<command>export LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH"</command></screen>
+ to make sure libxine can be found by the frontend(s).
+ </para>
+ <para>
+ Last but not least. Here the build instructions. As stated earlier,
+ those are the same for every xine module.
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>./autogen.sh</command> [&rarr; <emphasis>only</emphasis> if you're building from hg]
+&nbsp;&nbsp;&nbsp;<command>./configure</command>
+&nbsp;&nbsp;&nbsp;<command>make</command>
+&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="rpmbuild">
+ <title>Making your own RPM packages (xine-lib, xine-ui, gxine)</title>
+ <para>
+ Basically you will only have to issue one command, if you have just
+ downloaded a source tarball from our web site:
+ <screen>&nbsp;&nbsp;&nbsp;<command>rpmbuild -ta &lt;THE_NAME_OF_YOUR_SOURCE_TAR_BALL&gt;</command></screen>
+ (Older versions of RPM use <command>rpm</command> instead of <command>rpmbuild</command>.)
+ </para>
+ <para>
+ This will start the binary and source RPM building. After compiling is
+ finished, a binary rpm is placed in your rpm binary directory which is
+ something like <filename>/usr/src/RPM/RPMS/&lt;YOUR_ARCHITECTURE&gt;</filename>
+ and a source RPM is written to your rpm source dir
+ (e.g. <filename>/usr/src/RPM/SRPMS</filename>).
+ </para>
+ <para>
+ In case that you have an up-to-date hg repository, you will need to do the
+ following first in order to get a tarball release out of it which you
+ can later use with the <command>rpmbuild -ta</command> command above:
+ <screen>&nbsp;&nbsp;&nbsp;<command>./autogen.sh &amp;&amp; make clean &amp;&amp; make dist</command></screen>
+ </para>
+ <para>
+ In any case, please keep in mind that you have to build and install
+ xine-lib first before you can proceed with xine-ui.
+ </para>
+ </sect2>
+
+ <sect2 id="debbuild">
+ <title>Making your own .deb packages (xine-lib, xine-ui, gxine)</title>
+ <para>
+ You'll need an HG snapshot tarball or source checked out from the repository.
+ </para>
+ <para>
+ First, make sure that the "devscripts" and "build-essential" packages are installed. You'll
+ then need the following commands (the first one isn't needed unless you're using a snapshot tarball):
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>tar xzf &lt;PACKAGE-VER.tar.gz&gt;</command>
+&nbsp;&nbsp;&nbsp;<command>cd &lt;PACKAGE-VER&gt;</command>
+&nbsp;&nbsp;&nbsp;<command>./autogen.sh noconfig</command>
+&nbsp;&nbsp;&nbsp;<command>debuild binary</command>
+ </screen>
+ (If <command>debuild</command> complains about unmet dependencies, then
+ install them using <command>aptitude install &lt;PACKAGES&gt;</command> (as root) then re-run
+ <command>debuild binary</command>.
+ </para>
+ <para>
+ Once the build has been successfully completed, you'll have some new .debs.
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>cd ..</command>
+&nbsp;&nbsp;&nbsp;<command>ls *.deb</command>
+&nbsp;&nbsp;&nbsp;<command>su - -c 'cd '"`pwd`"' &amp;&amp; dpkg -i &lt;DEB_PACKAGES&gt;'</command>
+ </screen>
+ Ubuntu users will probably want to use this instead of that <command>su</command>:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>sudo dpkg -i &lt;DEB_PACKAGES&gt;</command>
+ </screen>
+ </para>
+ <para>
+ In any case, please keep in mind that you have to build and install
+ xine-lib first before you can proceed with xine-ui or gxine.
+ </para>
+ </sect2>
+
+ <sect2 id="cflags">
+ <title>Can I provide additional CFLAGS for compilation?</title>
+ <para>
+ Yes, you can do so by setting the CFLAGS variable and then running
+ <command>configure</command> again. You can even pass them to
+ <command>configure</command> directly. Example:
+ <screen>&nbsp;&nbsp;&nbsp;<command>./configure CFLAGS="-march=i686"</command></screen>
+ </para>
+ <para>
+ Other user variables <command>configure</command> respects are:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <command>CC</command> to specify the compiler executable
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <command>CPP</command> to specify the C preprocessor executable
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <command>LD</command> to specify the linker executable
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <command>CPPFLAGS</command> to pass additional include paths or other
+ preprocessor options
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <command>LDFLAGS</command> to pass additional library paths or other
+ linker options
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ An example combining some of these would look like:
+ <screen>&nbsp;&nbsp;&nbsp;<command>./configure CC="/opt/intel/bin/icc" LD="/opt/intel/bin/xild" \
+&nbsp;&nbsp;&nbsp;CPPFLAGS="-I/usr/local/include/dvdnav" LDFLAGS="-L/home/guenter/xine_libs"</command></screen>
+ </para>
+ </sect2>
+
+ <sect2 id="athlonflags">
+ <title>Are there binaries for my AMD K7 (Athlon&trade;) available? Can I build them?</title>
+ <para>
+ If you have a recent gcc you can try to compile "more" k7 support in (esp.
+ better instruction scheduling). If the configure script should fail to
+ detect your processor/gcc correctly, try passing the canonical system name for
+ your machine to configure with the <command>--host</command> option, e.g.
+ <screen>&nbsp;&nbsp;&nbsp;<command>./configure --host=k7-pc-linux-gnu</command></screen>
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Build problems: xine engine (xine-lib)</title>
+ <sect3 id="doesntcompile">
+ <title>The package doesn't compile at all!</title>
+ <para>
+ In order to be able to compile xine-lib, you need (amongst other things)
+ the zlib compression library plus the appropriate headers, which are
+ often found in a package called zlib-devel or similar.
+ </para>
+ <para>
+ Read again carefully the output <command>./configure</command>
+ produced and/or compiler warnings and error reports, they often contain
+ helpful information to find out what's going on. If you're stuck here
+ and decide to post your problem on the xine-user mailing list,
+ make sure you include these outputs.
+ </para>
+ </sect3>
+ <sect3 id="xvpluginfailstobuild">
+ <title>The Xv video-out plugin fails to compile!</title>
+ <para>
+ If you want to have Xv support compiled in, make sure you either have
+ a shared Xv library on your system, e.g.
+ <command>ls /usr/X11R6/lib/libXv*</command>
+ should give you some .so libs, like this:
+ <screen>
+&nbsp;&nbsp;&nbsp;/usr/X11R6/lib/libXv.a
+&nbsp;&nbsp;&nbsp;/usr/X11R6/lib/libXv.so
+&nbsp;&nbsp;&nbsp;/usr/X11R6/lib/libXv.so.1</screen>
+ </para>
+ <para>
+ Alternatively you need to have libtool 1.4 or newer installed, then
+ libXv.a is sufficient. Otherwise you can create the shared versions yourself:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>ld --whole-archive -shared -o libXv.so.1 libXv.a</command>
+&nbsp;&nbsp;&nbsp;<command>ln -s libXv.so.1 libXv.so</command>
+&nbsp;&nbsp;&nbsp;<command>ldconfig</command></screen>
+ </para>
+ <para>
+ Now you should be ready to build the Xv video-out plugin on your system.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2>
+ <title>Build problems in frontends (gxine/xine-ui/&hellip;)</title>
+ <sect3 id="xinelibnotfound">
+ <title>I have installed xine-lib but the frontend complains about not finding it!</title>
+ <para>
+ First of all take a closer look at the compilation instructions above again.
+ You will probably find your answer there right away.
+ </para>
+ <para>
+ As stated there (there again that hint *grin*), make sure that you
+ have <filename>$prefix/bin</filename> in your path and that your
+ linker is able to find libraries installed in <filename>$prefix/lib</filename>
+ By the way, $prefix is where you installed your xine-lib to earlier
+ (yes, installing xine-lib with <command>make install</command> or
+ installing the corresponding distribution-provided -dev or -devel
+ package would be a good idea before trying to compile the frontend ;)
+ ).
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="nonrootbuild">
+ <title>Can I install xine in my home directory (without being root)?</title>
+ <para>
+ Sure. First set up a subdir where you install your private software, eg.
+ <screen>&nbsp;&nbsp;&nbsp;<command>mkdir ~/xine</command></screen>
+ </para>
+ <para>
+ Then you have to set a few environment variables &ndash; it's probably a good
+ idea to add this to your <filename>~/.bashrc</filename> (or somewhere similar):
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>export PATH="$HOME/xine/bin:$PATH"</command>
+&nbsp;&nbsp;&nbsp;<command>export LD_LIBRARY_PATH="$HOME/xine/lib:$LD_LIBRARY_PATH"</command></screen>
+ </para>
+ <para>
+ Now you can unpack tarballs e.g. in <filename>~/xine/src</filename>
+ (<command>mkdir ~/xine/src</command> if necessary) and do a
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>./configure --prefix=$HOME/xine</command>
+&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
+ </para>
+ <para>
+ You also need to tell frontends using xine-lib, where to find it:
+ <screen>&nbsp;&nbsp;&nbsp;<command>./configure --prefix=$HOME/xine --with-xine-prefix=$HOME/xine</command></screen>
+ </para>
+ </sect2>
+
+ <sect2 id="win32build">
+ <title>How to compile xine for Windows?</title>
+ <para>
+ For compiling xine under Windows with MinGW, CygWin or MS Visual C see <ulink url="http://hg.debian.org/hg/xine-lib/xine-lib?cmd=file;file=doc/README.WIN32;filenode=-1;style=raw"><filename>README.WIN32</filename></ulink>.
+ </para>
+ <para>
+ For cross-compiling xine under comfortable unix-like environment with MinGW see <ulink url="http://hg.debian.org/hg/xine-lib/xine-lib?cmd=file;file=doc/README.MINGWCROSS;filenode=-1;style=raw"><filename>README.MINGWCROSS</filename></ulink>.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="playback">
+ <title>Playback of various stream types</title>
+
+ <sect2>
+ <title>DVD Playback with xine</title>
+ <sect3 id="dvdplayback">
+ <title>How do I play back DVDs with xine?</title>
+ <para>
+ Newer xine (1.0.x) releases come with a full-featured
+ DVD plugin that should be able to handle any unencrypted,
+ non-locked DVD with full menu navigation support. No external
+ plugins are required anymore here.
+ </para>
+ <para>
+ To get DVD playback working, first make sure you have
+ a symlink <filename>/dev/dvd</filename> pointing to your
+ DVD device on your system. For example, if your DVD drive
+ is the master ide drive on the second IDE channel,
+ <filename>/dev/dvd</filename> should point to
+ <filename>/dev/hdc</filename>. Please note that if you
+ are using the ide-scsi emulation on your system, it is
+ likely that your DVD drive got mapped to a scsi device
+ node even though it is an ide drive. In that case first
+ check out you boot/kernel logs (or run <command>cdrecord -scanbus</command>)
+ to find out which device it got mapped to and set the
+ symlink accordingly (should be something like <filename>/dev/scd0</filename>,
+ <filename>/dev/scd1</filename>, &hellip; in that case).
+ Also make sure you (as a user) have sufficient (read and write) permissions
+ on your DVD drive. This could mean you either have to change the device
+ permissions or add your user to a special group
+ (e.g. <command>addgroup cdrom username</command>),
+ depending on your setup and/or distribution.
+ </para>
+ <para>
+ It is highly recommended to switch DMA mode on for your DVD drive
+ (without it even very recent machines will have trouble producing
+ smooth video output). Use a command like
+ <command>hdparm -d 1 &lt;device&gt;</command>
+ on your DVD device. Please note that even if you're using ide-scsi
+ you will have to set the dma flag on the ide device node (e.g.
+ <filename>/dev/hdc</filename>), not the mapped <filename>/dev/scd</filename>
+ scsi device.
+ </para>
+ <para>
+ To be able to play back encrypted DVDs you need to have
+ libdvdcss installed on your system (please check if this is legal where
+ you live). If you do not understand what the term "encrypted DVD" means
+ here: As a rule of thumb, every DVD you have to pay money for is most
+ likely encrypted.
+ </para>
+ <para>
+ To make matters worse, apart from encryption, there is another obstacle
+ to take: the region code. The DVD authorities decided to divide the world
+ into eight geographical regions. Have a look at
+ <ulink url="http://www.dvdforum.gr.jp/RegionMap.pdf">http://www.dvdforum.gr.jp/RegionMap.pdf</ulink>
+ if you want to know which number has been assigned to your country. It is
+ now their idea, that you shall only play DVDs, which have been produced
+ for your region. If you take a DVD off the shelf in your local store,
+ you should find a little globe-like icon which shows the region code the
+ disc is for.
+ </para>
+ <para>
+ Newer (post-2000) DVD drives (so-called RPC-2 drives) check the DVD
+ region, which means they'll prevent you from playing back DVDs that have
+ a different region code from what the drive is set up for. Some drives
+ come with a factory setting of region 0 so they can play back
+ any DVD until a region code is set. Others refuse to play any DVD at all
+ until they are told a region. The easiest way to handle this is to use
+ the regionset utility from
+ <ulink url="http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415">
+ http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415
+ </ulink>.
+ </para>
+ <para>
+ Once you have everything set up, try something like
+ <command>gxine dvd:/</command> or <command>xine -p dvd:/</command>
+ to start dvd playback. Some frontend also offer so-called autoplay
+ buttons or menu entries that start dvd playback immediately.
+ </para>
+ <para>
+ Important: do not try to mount the DVD. Just insert it and hit the DVD autoplay
+ button or start xine from the command line.
+ </para>
+ <para>
+ If things do not work as expected, try running the <command>xine-check</command>
+ shellscript that comes with xine to see if this gives you further hints on
+ what could be wrong.
+ </para>
+ </sect3>
+ <sect3 id="dvdlongwait">
+ <title>DVD playback works, but it takes a long time until playback starts</title>
+ <para>
+ This points to a region code problem. Some versions of libdvdcss can play
+ back DVDs from other regions than the RPC-2 DVD drive is set up for,
+ but this usually means a cryptographic attack (which takes time) has
+ to be used to access the DVD.
+ </para>
+ <para>
+ You can download a tool to set the region code of RPC-Drives here:
+ <ulink url="http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415">
+ http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415
+ </ulink>.
+ </para>
+ <para>
+ Warning: Please be aware that the number of region code changes in RPC-2
+ drives is limited (usually about 5 times), after that your drive will
+ stay locked to the region you last set it up for.
+ </para>
+ </sect3>
+ <sect3 id="regionset">
+ <title>I have problems setting up my RPC-2 drive for the right region!</title>
+ <para>
+ You can download a tool to set the region code of RPC-Drives here:
+ <ulink url="http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415">
+ http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415
+ </ulink>.
+ </para>
+ <para>
+ Warning: Please be aware that the number of region code changes in RPC-2
+ drives is limited (usually about 5 times), after that your drive will
+ stay locked to the region you last set it up for.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="vcdsupport">
+ <title>Can I watch Video CDs (VCDs)? SVCDS ? CD-i?</title>
+ <para>
+ xine supports VCD and SVCD playback out-of-the box. Similar to DVDs,
+ make sure you have a <filename>/dev/cdrom</filename> alias pointing
+ to your CDROM drive which you will use to play back the (S)VCD.
+ </para>
+ <para>
+ At the moment, CD-i formats are not supported by xine.
+ </para>
+ <para>
+ Do not try to mount the (S)VCD. Simply insert it into your CDROM drive
+ and hit the VCD autoplay button or start something like
+ <command>gxine vcd:/</command> or <command>xine vcd:/</command>
+ from the command line.
+ </para>
+ <sect3 id="vcdtroubleshooting">
+ <title>VideoCD troubleshooting guide</title>
+ <para>
+ This gives higher-level troubleshooting. More lower-level information is
+ given in <link linkend="vcddebug">the next section</link>.
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ When you open the configuration dialog of your frontend, you should
+ see a <parameter>vcd</parameter> config section. An important setting is
+ <parameter>default_device</parameter>. If this is set to the empty string,
+ the VCD plugin will try to scan your drives for a suitable device if the
+ driver has the capability to scan for drives. However you can set
+ the device to something of your choosing. On GNU/Linux, this may be
+ <filename>/dev/cdrom</filename> and on Solaris it may be
+ <filename>/vol/dev/aliases/cdrom0</filename>.
+ </para>
+ <para>
+ If you set this field, make sure these are correct for your
+ particular setup. For example, I generally play out of the DVD
+ device and this is called <filename>/dev/dvd</filename> rather than <filename>/dev/cdrom</filename>.
+ </para>
+ <para></para>
+ </listitem>
+ <listitem>
+ <para>
+ Your frontend should offer a VCD autoscan button or menu item.
+ If you select this, you should see your CD disk light go on if you have one.
+ And the CD should be read. You should get a playlist of what's on the VideoCD.
+ </para>
+ <para>
+ If not something's wrong, possibly you configured the wrong drive.
+ You might try to read a disk image of a VideoCD and thus elimate any problems
+ with hardware. You can get a test VideoCD disk image to test here:
+ <ulink url="http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip">
+ http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip
+ </ulink>.
+ After unzipping this there should be files <filename>test_svcd_pal.cue</filename> and
+ <filename>test_svcd_pal.bin</filename>. Run xine with the MRL
+<!-- FIXME: This MRL needs to be changed -->
+ <filename>vcd:/test_svcd_pal.cue:E0</filename>.
+ If you see something playing then this is a hardware problem.
+ You might also want to try starting playback-control with
+<!-- FIXME: This MRL needs to be changed -->
+ <filename>vcd:/test_svcd_pal.cue:P1</filename>.
+ </para>
+ <para></para>
+ </listitem>
+ <listitem>
+ <para>
+ There should be at least one "track", and one "entry" listed for
+ the VideoCD and the names of these in the MRL list will end with
+ "T1" and "E0" respectively. Often there are other playlist items,
+ and if you have menus or still frames there will be
+ "segments" as well. The simplest things to check are probably
+ "entries" and "tracks". If there are no entries listed or none of
+ the tracks or entries play, then there may be a problem with
+ that particular medium. So as in the step above, you can try a known good
+ sample and perhaps burn a CD from that. More likely if you get this
+ far, some of the items listed work and some do not. There are a
+ number of debugging switches that you can dynamically turn on and
+ off that may be able to help in isolating more specific problems.
+ See the <link linkend="vcddebug">section below</link>.
+ </para>
+ <para></para>
+ </listitem>
+ <listitem>
+ <para>
+ Something plays now, but you do not get any menus? Well, first is there
+ supposed to be a menu? In the last step you should have seen what is on
+ the VideoCD. Still frames are always "segments" so see if you can find one in the MRL
+ list and select that.
+ </para>
+ <para>
+ If there are no segments listed, there aren't any still-frame
+ menus. It's also possible to have menus in looping MPEG's. Use the
+ <command>vcddump</command> tool to find loops. <command>vcddump</command> is
+ also part of VCDImager. Another program that can help you examine the contents
+ of a VideoCD is <command>vcdxrip</command>.
+ </para>
+ <para>
+ To troubleshoot, start out with the known SVCD example that has a
+ still-frame menu at the beginning:
+ <ulink url="http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip">
+ http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip
+ </ulink>
+ Inside this is a largish file called <filename>test_svcd_pal.bin</filename> and another
+ short text file called <filename>test_svcd_ntsc.cue</filename>. These are CD disk
+ images; that is, something that could be burned to a CD drive such
+ as with <command>cdrdao</command>. However you don't have to create a CD to view these
+ with the xine VCD plugin. You should be able to play the VideoCD by running the MRL
+<!-- FIXME: This MRL needs to be changed -->
+ <filename>vcd:/test_svcd_pal.cue</filename>.
+ If you see a still frame on startup. Great! If instead you see what
+ looks like the beginning of a movie (Blue Streak with Martin Lawrence)
+ then go to the next step.
+ </para>
+ <para></para>
+ </listitem>
+ <listitem>
+ <para>
+ You have a VideoCD with menu and can see it, but there is no menu on startup?
+ If you have the VideoCD from the last step, then run the MRL
+<!-- FIXME: This MRL needs to be changed -->
+ <filename>vcd:/test_svcd_pal.cue:P1</filename>
+ If this shows a still frame, but it just does not show when you
+ hit either the "VCD" autoscan button or give a MRL without the P1 at
+ the end then go to the next step.
+ </para>
+ <para>
+ If you have another VideoCD, from the MRL list, you should also see "playlist"
+ entries. Try selecting the one that ends "P1". If you don't see an entry with P1,
+ then your VideoCD does not have playback control (PBC) and although there may
+ be a still frame on the VideoCD it may have been authored so it is not easily
+ accessed. Again <command>vcddump</command> or <command>vcdxrip</command> can help here.
+ </para>
+ <para></para>
+ </listitem>
+ <listitem>
+ <para>
+ You have a VideoCD with menu at beginning and can see it using an MRL
+ with P1 at the end, but you want to see it by hitting the "VCD" autoscan button
+ as well? Check to see that you have the configuration entry
+ <parameter>media.vcd.autoplay</parameter> set to <parameter>playlist</parameter>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect3>
+ <sect3 id="vcddebug">
+ <title>VideoCD debugging</title>
+ <para>
+ To facilitate tracking down problems we let you see what's going on dynamically.
+ Various debugging settings will cause output to appear on xine's plugin log
+ and/or on standard error output. See the config entry <parameter>media.vcd.debug</parameter>
+ for details.
+ </para>
+ <para>
+ The tool <command>vcd-info</command> from the cdio branch of vcdimager can be used to
+ show the entire contents of a VideoCD or selected portions of that. Until the cdio
+ branch of vcdimager is completely merged with vcdimager, the cd-info branch version
+ has a few more features. (However consult vcdimager for complete version of the program.)
+ </para>
+ <para>
+ <command>vcdxrip</command> can be used to extract portions of a VideoCD and or create an
+ XML description file of the VideoCD. This XML file and the extracted
+ files can be used by <command>vcdxbuild</command> to recreate another VideoCD.
+ </para>
+ <para>
+ And finally see also tools <command>cd-info</command> and <command>cd-read</command> from libcdio.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="quicktime">
+ <title>Can I watch Quicktime (.mov, .mp4) files using xine?</title>
+ <para>
+ Quicktime is just a system layer (container format) which can contain various
+ different audio and video formats. The system layer itself is fully supported
+ in xine. However, some quicktime audio/video codecs are not natively supported yet.
+ Luckily, if you are using a x86 compatible machine (any recent PC hardware should do)
+ you can install and use the original Quicktime DLLs and watch most streams
+ (trailers) that can be downloaded from the net.
+ </para>
+ <para>
+ Possibly the most convenient way to get the Quicktime DLLs is to download
+ them from the MPlayer website
+ <ulink url="http://www.mplayerhq.hu/design7/dload.html">
+ http://www.mplayerhq.hu/design7/dload.html
+ </ulink>.
+ The package is called "essential". Unpack it and move everything you find
+ inside to <filename>/usr/lib/codecs</filename> (actually you can place them
+ anywhere you want, e.g. someplace in your home directory, but then you'll
+ have to set <parameter>decoder.external.win32_codecs_path</parameter> in your
+ xine config file accordingly). Restart xine then and you should be
+ able to watch Quicktime trailers.
+ </para>
+ </sect2>
+
+ <sect2>
+ <title>Real Network files/streams</title>
+ <sect3 id="realfileplayback">
+ <title>Can I watch Real (.rm, .ram) files using xine?</title>
+ <para>
+ The situation with real files and streams is pretty similar to the situation
+ with Quicktime Streams (see above). The newer real audio and video formats
+ are only supported by using binary-only codecs which are not included in
+ xine.
+ </para>
+ <para>
+ Possibly the most convenient way to get the Real codecs is to install
+ RealPlayer 9 or RealPlayer 10 and set the
+ <parameter>decoder.external.real_codecs_path</parameter> in your xine
+ config file to the name of the directory which contains the codecs
+ (look for drvc.so); it's probably something like
+ <filename>/opt/real/RealPlayer/codecs/</filename>. Restart xine then
+ and you should be able to watch Real files/streams.
+ </para>
+ <para>
+ Another way to get the Real codecs is to download them from the MPlayer website
+ <ulink url="http://www.mplayerhq.hu/design7/dload.html">
+ http://www.mplayerhq.hu/design7/dload.html
+ </ulink>.
+ The package is called "essential". Unpack it and move everything you
+ find inside to <filename>/usr/lib/codecs</filename> and set the
+ <parameter>decoder.external.real_codecs_path</parameter> in your xine config file
+ to <filename>/usr/lib/codecs</filename> (actually you can place them
+ anywhere you want, e.g. someplace in your home directory, but then you'll
+ have to set <parameter>decoder.external.real_codecs_path</parameter> accordingly).
+ Restart xine then and you should be able to watch Real files/streams.
+ </para>
+ </sect3>
+ <sect3 id="realnetworkstreams">
+ <title>What about (live) network streams (pnm://, rtsp:// style urls)?</title>
+ <para>
+ xine supports both pnm and rtsp streaming. However, digging out the actual
+ pnm/rtsp url can be tricky as they're often packed into heavy JavaScript and
+ HTML code on most websites. You can either use a combination of your
+ browser's "save source" function and wget or use a xine browser plugin
+ (currently the gxine frontend comes with a simple mozilla plugin,
+ for example). When you decided to dig out the url by hand don't get fooled
+ by the many redirectors that are often placed around the actual url.
+ Use wget to download any http://-style urls and use less to look inside
+ the downloaded .ra/.ram files where you will find the actual pnm/rtsp
+ url which can be opened using xine.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="wmv">
+ <title>Can I watch Windows Media (.asf/.wmv/.wma) files using xine?</title>
+ <para>
+ While the container format (system layer) ASF (wmv is just an alias)
+ is fully supported in xine, for newer windows media 9 based streams
+ you'll need to install windows binary codecs (.DLLs).
+ </para>
+ <para>
+ Possibly the most convenient way to get the Windows DLLs is to download
+ them from the MPlayer website
+ <ulink url="http://www.mplayerhq.hu/design7/dload.html">
+ http://www.mplayerhq.hu/design7/dload.html
+ </ulink>.
+ The package is called "essential". Unpack it and move everything you find
+ inside to <filename>/usr/lib/codecs</filename> (actually you can place them
+ anywhere you want, e.g. someplace in your home directory, but then you'll
+ have to set <parameter>decoder.external.win32_codecs_path</parameter> in your
+ xine config file accordingly). Restart xine then and you should be
+ able to watch windows media streams.
+ </para>
+ </sect2>
+
+ <sect2 id="dvb">
+ <title>Can I watch Digital TV (Digital Video Broadcast) using xine?</title>
+ <para>
+ At the time of this writing DVB support is a very new and experimental
+ feature in xine. The number of supported cards is pretty limited at the moment.
+ See <filename>doc/README.dvb</filename> (in the xine-lib tarball) for details.
+ </para>
+ </sect2>
+
+ <sect2 id="stdin">
+ <title>How do I play streams from STDIN?</title>
+ <para>
+ Use something like:
+ <screen>&nbsp;&nbsp;&nbsp;<command>cat stream.mpg | gxine stdin:/</command></screen>
+ </para>
+ </sect2>
+
+ <sect2 id="avisubtitles">
+ <title>How can I watch files with external AVI subtitles?</title>
+ <para>
+ In xine 0.9.13 this used to be:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine foo.avi%bar.sub</command></screen>
+ </para>
+ <para>
+ Latest xine-lib modules (1-beta3 or newer) support external subtitles
+ for any media file, not only AVI. In order to use it you can pass a
+ special MRL construction like:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine file://path/to/test.mpg#subtitle:/path/to/file.sub</command></screen>
+ The external subtitles support can also be used by any xine frontend.
+ Currently xine-ui and kaffeine implement this feature with a subtitle
+ selection dialog.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="running">
+ <title>Running xine</title>
+
+ <sect2 id="speedup">
+ <title>I have a lot of dropped frames &ndash; what can I do?</title>
+ <para>
+ Your hardware might be too slow for xine. Make sure you turn on all
+ speed optimizing options. A few things you should check (in order of
+ importance):
+ <itemizedlist>
+ <listitem>
+ <para>
+ First of all, run the <command>xine-check</command> script included in xine
+ package (probably already installed in your system).
+ <command>xine-check</command> will report several of the most common problems
+ listed here. Sample output from xine-check:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>xine-check</command>
+&nbsp;&nbsp;&nbsp;Please be patient, this script may take a while to run...
+&nbsp;&nbsp;&nbsp;[ good ] you're using Linux, doing specific tests
+&nbsp;&nbsp;&nbsp;[ good ] looks like you have a /proc filesystem mounted.
+&nbsp;&nbsp;&nbsp;[ good ] You seem to have a reasonable kernel version (2.4.18)
+&nbsp;&nbsp;&nbsp;[ good ] intel compatible processor, checking MTRR support
+&nbsp;&nbsp;&nbsp;[ good ] you have MTRR support and there are some ranges set.
+&nbsp;&nbsp;&nbsp;[ good ] found the player at /usr/local/bin/xine
+&nbsp;&nbsp;&nbsp;[ good ] /usr/local/bin/xine is in your PATH
+&nbsp;&nbsp;&nbsp;[ good ] found /usr/local/bin/xine-config in your PATH
+&nbsp;&nbsp;&nbsp;[ good ] plugin directory /usr/local/lib/xine/plugins exists.
+&nbsp;&nbsp;&nbsp;[ good ] found input plugins
+&nbsp;&nbsp;&nbsp;[ good ] found demux plugins
+&nbsp;&nbsp;&nbsp;[ good ] found decoder plugins
+&nbsp;&nbsp;&nbsp;[ good ] found video_out plugins
+&nbsp;&nbsp;&nbsp;[ good ] found audio_out plugins
+&nbsp;&nbsp;&nbsp;[ good ] skin directory /usr/local/share/xine/skins exists.
+&nbsp;&nbsp;&nbsp;[ good ] found logo in /usr/local/share/xine/skins
+&nbsp;&nbsp;&nbsp;[ good ] I even found some skins.
+&nbsp;&nbsp;&nbsp;[ good ] /dev/cdrom points to /dev/hdc
+&nbsp;&nbsp;&nbsp;[ good ] /dev/dvd points to /dev/hdc
+&nbsp;&nbsp;&nbsp;[ good ] DMA is enabled for your DVD drive
+&nbsp;&nbsp;&nbsp;[ good ] found xvinfo: X-Video Extension version 2.2
+&nbsp;&nbsp;&nbsp;[ good ] your Xv extension supports YUV overlays (improves MPEG performance)
+&nbsp;&nbsp;&nbsp;[ good ] your Xv extension supports packed YUV overlays
+&nbsp;&nbsp;&nbsp;[ good ] Xv ports: YUY2 YV12 I420 UYVY</screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Try to use the Xv driver, it greatly improves performance and quality
+ because your graphics card does image scaling and colourspace conversion. The
+ <link linkend="video">video section</link> contains important information
+ about several Xv drivers.
+ </para>
+ <para>
+ If Xv cannot be used for some reason, make sure your display is set up
+ to 16bpp, not 24 or higher (reduces memory bandwith). Some Xv drivers
+ may also have better performance with 16bpp.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Make sure the hard drive (or cdrom/dvd drive) which supplies the
+ video data is in DMA mode (if supported).
+ </para>
+ <para>
+ On most linux-based systems, you can use hdparm to check this:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>hdparm /dev/hda</command>
+&nbsp;&nbsp;&nbsp;[...]
+&nbsp;&nbsp;&nbsp;using_dma = 1 (on)
+&nbsp;&nbsp;&nbsp;[...]</screen>
+ </para>
+ <para>
+ You can enable DMA mode with the following command:
+ <screen>&nbsp;&nbsp;&nbsp;<command>hdparm -d1 device_of_your_drive_that_supplies_video_data</command></screen>
+ In some cases where this fails it helps to specify the dma mode
+ to use, for example:
+ <screen>&nbsp;&nbsp;&nbsp;<command>hdparm -d1 -X 66 device_of_your_drive_that_supplies_video_data</command></screen>
+ In RedHat 8.0 an additional entry in /etc/modules.conf
+ <screen>&nbsp;&nbsp;&nbsp;options ide-cd dma=1</screen>
+ should help (reboot for this change to take effect).
+ </para>
+ <para>
+ More information about this may be found here:
+ <ulink url="http://oreilly.linux.com/pub/a/linux/2000/06/29/hdparm.html">
+ http://oreilly.linux.com/pub/a/linux/2000/06/29/hdparm.html
+ </ulink>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Use a recent kernel which is optimized for your hardware. Old kernels
+ may lack support for accelerated instructions like SSE, for example.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Close other applications (use a tool like "top" to find out
+ what applications are using up CPU power). Programs that update the
+ system clock like ntp should also be disabled.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Enable MTRR support in your kernel. If you are still using XFree 3.x,
+ you'll have to tell the kernel yourself where the graphics memory is.
+ You'll find details about that in the linux dvd howto.
+ </para>
+ <para>
+ If you're using X.org or XFree 4.x, enabling MTRR support in your kernel should
+ be enough (use a recent kernel!).
+ </para>
+ <para>
+ Try a <command>cat /proc/mtrr</command> &ndash; if the file exists and you find an entry
+ corresponding to the amount of graphics memory you have, everything
+ should be fine.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Have your X-server (usually X.org or XFree86) running with higher priority.
+ Most recent linux distributions (like RedHat 8.0 or Mandrake 9.0) should
+ do that for you, improving not only xine but desktop responsiveness
+ in general.
+ </para>
+ <para>
+ Use the "top" utility and verify under the "NI" column if
+ the X process has a negative value, this indicates a higher priority.
+ See "The X Window User HOWTO &ndash; Performance considerations" for
+ further instructions
+ <ulink url="http://www.tldp.org/HOWTO/XWindow-User-HOWTO/performance.html">
+ http://www.tldp.org/HOWTO/XWindow-User-HOWTO/performance.html
+ </ulink>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Use the latest or a known-good gcc version and build an optimized xine-lib for
+ your architecture.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Besides boosting X-server priority, sometimes it's possible to avoid
+ discarding frames by making xine itself higher priority. This is not
+ a recommended pratice since it will require to run xine as root,
+ but you may give it a try if you want:
+ <screen>&nbsp;&nbsp;&nbsp;<command>nice --5 xine</command></screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ xine needs high speed memory access which depends on your chip set.
+ Make sure you enable all speed-improving options.
+ </para>
+ <para>
+ Especially the via apollo pro chipset is known to be quite weird,
+ (most of all on my gigabyte board). If you can't configure the ram
+ access thoroughly using the bios you might want to try some really
+ nasty tricks, as explained on (for example):
+ <ulink url="http://www.overclockers.com/tips105/index03.asp">
+ http://www.overclockers.com/tips105/index03.asp
+ </ulink>
+ </para>
+ <para>
+ This website centers around a windows-tool to tweak the chipset, you
+ can do the same on FreeBSD with <command>pciconf</command>.
+ On some linux distributions there are similar tools.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ a nice performance tuning tool can be found here:
+ <ulink url="http://powertweak.sourceforge.net">http://powertweak.sourceforge.net</ulink>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Set up and use raw devices for DVD access. Please note that the
+ actual performance gain during playback is very small if any, but
+ since raw devices are bypassing the kernel's buffer cache, Linux
+ will not try to cache the DVDs you play. This would not be useful,
+ because xine does its own caching and you usually play DVDs
+ sequentially, which means you won't reuse anything from the cache.
+ But the problem would be that Linux throws everything out of the
+ cache that might be in there.
+ </para>
+ <para>
+ Raw devices should be available in linux kernel 2.4.x and there are
+ patches for older kernels available from:
+ <ulink url="ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/">
+ ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/
+ </ulink>
+ </para>
+ <para>
+ For recent kernels (2.6.x series) the raw devices are neither
+ needed nor supported anymore, so don't bother.
+ </para>
+ <para>
+ To use raw devices, first connect a free raw device to your dvd
+ device, use something like:
+ <screen>&nbsp;&nbsp;&nbsp;<command>raw /dev/raw1 /dev/dvd</command></screen>
+ </para>
+ <para>
+ Then create a link named "rdvd" pointing to that raw device:
+ <screen>&nbsp;&nbsp;&nbsp;<command>ln -s raw1 /dev/rdvd</command></screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ For slow / high-latency dvd drives it might help to increase
+ the number of video buffers xine allocates. Try setting
+ <parameter>engine.buffers.video_num_buffers:500</parameter>
+ to a higher value (e.g. 1000 or 2500).
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="smoothness">
+ <title>Oki, xine doesn't drop frames now but video output still is not really smooth!</title>
+ <para>
+ Video output can be further improved by tuning your linux kernel:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Set HZ to 1000 in
+ <filename>/usr/src/linux/include/asm-i386/param.h</filename>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Try applying scheduler patches, especially the O(1) and the preemptive
+ patches have proven useful at the time of this writing (spring 2003).
+ </para>
+ </listitem>
+ </itemizedlist>
+ Linux 2.5/2.6 will probably have these improvements out of the box.
+ </para>
+ <para>
+ Miguel Freitas has written a nice
+ <ulink url="http://cambuca.ldhs.cetuc.puc-rio.br/~miguel/multimedia_sim/">
+ article about his kernel multimedia experiments
+ </ulink>.
+ </para>
+ </sect2>
+
+ <sect2 id="ports">
+ <title>I have problems when using xine on FreeBSD, Solaris, &hellip; !</title>
+ <para>
+ Check out the the corresponding README files in the directory <filename>xine-lib/doc</filename>.
+ </para>
+ </sect2>
+
+ <sect2 id="aaxine">
+ <title>What is aalib? How do I use it in xine?</title>
+ <para>
+ aalib is an ascii art library. xine comes with an aalib video output
+ plugin so you can watch movies in your xterm, on the console or on your
+ old vt100 &ndash; very cool ;> &hellip; another nice option is to preview movies
+ on a remote server in your shell over ssh.
+ </para>
+ <para>
+ To use it make sure you have aalib installed correctly before you
+ configure/build xine-lib and xine-ui. In addition to the <command>xine</command> binary a
+ binary named <command>aaxine</command> should get built and installed. You can then use
+ something like:
+ <screen>&nbsp;&nbsp;&nbsp;<command>aaxine foo.mpg</command></screen>
+ to use aalib video output.
+ </para>
+ </sect2>
+
+ <sect2 id="dxr3">
+ <title>Does xine support my dxr3 / hollywood+ card?</title>
+ <para>
+ While xine's focus is clearly on software decoding, the dxr3 is supported.
+ </para>
+ <para>
+ You can find more information about using xine with the dxr3
+ <ulink url="http://www.amalthea.de/xine/">here</ulink>
+ (also covers how to do tv output using the dxr3).
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="audio">
+ <title>Audio related questions</title>
+
+ <sect2 id="audiodrivers">
+ <title>What audio drivers does xine support? OSS? Alsa? Arts? Esd?</title>
+ <para>
+ Currently xine support audio output via OSS (Linux 2.4 and most
+ *BSD audio drivers),
+ ALSA 0.9 and 1.0 (ALSA 0.5.x is no longer supported), aRTs (KDE
+ 3's sound daemon), ESounD (esd, gnome's sound daemon not
+ recommended because it has serious issues with a/v sync), JACK,
+ PulseAudio, plus platform-specific output through Sun devices for
+ Solaris and NetBSD and Irix output.
+ </para>
+ </sect2>
+
+ <sect2 id="compressor">
+ <title>When I'm watching a movie, the sound effects are much higher in volume than the voices!</title>
+ <para>
+ Congratulations, you seem to have an original movie audio track there.
+ </para>
+ <para>
+ Uhm. So you don't like it. Well, there are two things you can do:
+ <itemizedlist>
+ <listitem>
+ <para>
+ You can enable xine's audio compressor. Most frontends have
+ a settings window and in that you'll find a slider for the
+ compressor setting. The values are percent values, so a
+ slider setting of 200 means that xine will double the volume
+ of silent parts of the movie (loud parts stay the same).
+ </para>
+ <para>
+ If your frontend does not have such a compression slider,
+ you can pass the value with the MRL:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine dvd:/#compression:150</command></screen>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you have a dolby digital (AC3) soundtrack, you can try
+ to enable liba52's dynamic range compression setting
+ <parameter>audio.a52.dynamic_range:1</parameter>
+ in your xine config file (or use some gui config dialog).
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="noaudio">
+ <title>When I play this stream, xine shows video but there's no audio!</title>
+ <para>
+ If this happens with any video, first try a different audio driver
+ (<command>gxine -A oss</command>, <command>gxine -A arts</command>,
+ <command>xine -A alsa</command> &hellip;).
+ </para>
+ <para>
+ If this problem only occurs with one specific stream, maybe switching to
+ a different audio channel (using the gui) helps. Some DVD streams have
+ audio on strange channels.
+ </para>
+ <para>
+ If all this doesn't help, maybe you're missing an audio codec or you found
+ a bug. If you decide to post your problem on the xine-user mailing list,
+ make sure to include all console output xine produced and also clearly
+ state what type of stream you tried to play back or, even better, make
+ a test stream available somewhere for developers to download and try.
+ </para>
+ </sect2>
+
+ <sect2 id="surroundsound">
+ <title>Can xine produce 4-/5-channel surround audio output?</title>
+ <para>
+ Yep, it can do that using OSS or ALSA drivers, provided that the driver
+ supports it. However, since xine cannot detect if there are actually speakers
+ connected to the additional channels, you'll have to activate that feature manually.
+ </para>
+ <para>
+ You can do this either in the config dialog while xine is running (press
+ the config button on the xine panel and go to the AUDIO tab) or have it
+ the complicated way by editing the config file yourself which is located
+ in your home directory in <filename>.config/gxine</filename> or
+ <filename>.xine</filename>:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Surround 4.0
+&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Surround 4.1
+&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Surround 5.1</programlisting>
+ </para>
+ </sect2>
+
+ <sect2 id="spdif">
+ <title>What about ac3 output via spdif to an external ac3 decoder?</title>
+ <para>
+ xine can do that too. Pretty much the same story as for 4-/5-channel
+ surround (see above). You can either use the config dialog or edit
+ the config file (<filename>~/.xine/config</filename> or
+ <filename>~/.config/gxine/config</filename>) yourself:
+ <programlisting>&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Pass Through</programlisting>
+ </para>
+ </sect2>
+
+ <sect2 id="sblivespdif">
+ <title>Getting SPDIF output from a SBLive 5.1 using OSS drivers</title>
+ <para>
+ The following explains how to get the above configuration
+ going with xine. Some parts of it may applicable to other
+ configurations (cards that use the EMU10k1 chip) as well.
+ </para>
+ <sect3>
+ <title>Requirements</title>
+ <orderedlist>
+ <listitem>
+ <para>xine-lib >= 1.x.x</para>
+ </listitem>
+ <listitem>
+ <para>OSS driver</para>
+ </listitem>
+ <listitem>
+ <para>an external decoder</para>
+ </listitem>
+ <listitem>
+ <para>a cable to connect the SBLive to the external decoder</para>
+ </listitem>
+ </orderedlist>
+ <para>
+ The configuration described was tested using a Soundblaster live 5.1 (rev 7)
+ with a Yamaha DSP-AX620 external decoder.
+ </para>
+ </sect3>
+ <sect3>
+ <title>Retrieving the driver</title>
+ <para>
+ The OSS driver is maintained by creative and can be downloaded at
+ <ulink url="http://opensource.creative.com/">http://opensource.creative.com/</ulink>.
+ The driver package contains documentation on how to install it.
+ Besides that I'd like to add the following notes.
+ </para>
+ <para>
+ In order to compile and install these drivers, you need a valid kernel
+ configuration file. For RedHat Linux's pre-compiled kernels these
+ configuration files can be found in
+ <filename>/usr/src/linux/configs</filename>.
+ After you've located the correct config file for your kernel,
+ you need to copy it to <filename>/usr/src/linux/.config</filename>
+ For example, when you run the 2.4.18-i686 kernel do :
+ <screen>&nbsp;&nbsp;&nbsp;<command>cp /usr/src/linux/configs/kernel-2.4.18-i686.config /usr/src/linux/.config</command></screen>
+ Make sure that the emu10k1 module that is currently installed is
+ not loaded. To unload the modules:
+ <screen>&nbsp;&nbsp;&nbsp;<command>/sbin/modprobe -rv emu10k1.o ac97_codec.o</command></screen>
+ If this mentions that the device is busy, some program is
+ using the driver. Some example could be a mixer application
+ or sound daemon like artsd. You'll need to close down the
+ applications before continuing.
+ At success it should print something like:
+ <screen>
+&nbsp;&nbsp;&nbsp;# delete emu10k1
+&nbsp;&nbsp;&nbsp;# delete ac97_codec
+&nbsp;&nbsp;&nbsp;# delete soundcore</screen>
+ Run make in the directory where you unpacked the driver and follow the
+ instructions printed at the end of each step.
+ The last step should be:
+ <screen>&nbsp;&nbsp;&nbsp;<command>make install-tools</command></screen>
+ As the README of the driver package mentions the SPDIF AC3
+ output doesn't work by default. In the directory
+ <filename>utils/scripts</filename> an <filename>emu10k1.conf</filename>
+ file can be found which need to be placed in the default
+ installation directory (<filename>/usr/local/etc</filename>).
+ After this the <filename>emu10k1.conf</filename> needs to be modified.
+ The following settings worked fine for me (I don't use the analog
+ outputs of the card):
+ <programlisting>
+&nbsp;&nbsp;&nbsp;CARD_IS_5_1=yes
+&nbsp;&nbsp;&nbsp;USE_DIGITAL_OUTPUT=yes
+&nbsp;&nbsp;&nbsp;ENABLE_TONE_CONTROL=yes
+&nbsp;&nbsp;&nbsp;AC3PASSTHROUGH=yes
+&nbsp;&nbsp;&nbsp;ENABLE_LIVEDRIVE_IR=no
+&nbsp;&nbsp;&nbsp;INVERT_REAR=no
+&nbsp;&nbsp;&nbsp;MULTICHANNEL=yes
+&nbsp;&nbsp;&nbsp;ROUTE_ALL_TO_SUB=no
+&nbsp;&nbsp;&nbsp;ANALOG_FRONT_BOOST=no
+&nbsp;&nbsp;&nbsp;SURROUND=no
+&nbsp;&nbsp;&nbsp;PROLOGIC=no
+&nbsp;&nbsp;&nbsp;ENABLE_CD_Spdif=yes
+&nbsp;&nbsp;&nbsp;ENABLE_OPTICAL_SPDIF=no
+&nbsp;&nbsp;&nbsp;ENABLE_LINE2_MIC2=no
+&nbsp;&nbsp;&nbsp;ENABLE_RCA_SPDIF=no
+&nbsp;&nbsp;&nbsp;ENABLE_RCA_AUX=no</programlisting>
+ After modifying the <filename>emu10k1.conf</filename>,
+ you need to modify your <filename>/etc/modules.conf</filename> and
+ make sure the following lines are in there.
+ <programlisting>
+&nbsp;&nbsp;&nbsp;alias sound-slot-0 emu10k1
+&nbsp;&nbsp;&nbsp;post-install emu10k1 /usr/local/etc/emu-script</programlisting>
+ After saving the changes to <filename>modules.conf</filename>, run
+ <screen>&nbsp;&nbsp;&nbsp;<command>/sbin/depmod -a</command></screen>
+ Now, you're ready to load the new modules and set the correct
+ options for it. To load the modules run:
+ <screen>&nbsp;&nbsp;&nbsp;<command>/sbin/modprobe emu10k1</command></screen>
+ </para>
+ </sect3>
+ <sect3>
+ <title>Setting up xine for SPDIF (AC3 passthrough) output</title>
+ <para>
+ You can either use the config dialog of your frontend or edit
+ the config file (<filename>~/.xine/config</filename>) yourself:
+ <programlisting>&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Pass Through</programlisting>
+ In case the setting is not in the file you can add it.
+ </para>
+ </sect3>
+ <sect3>
+ <title>
+ The cable used for the SBLive can easily be self-made
+ or buy a stereo 3.5mm jack to dual RCA cable.
+ </title>
+ <para>
+ What you need to make the cable yourself:
+ <itemizedlist>
+ <listitem><para>stereo 3.5mm jack plug</para></listitem>
+ <listitem><para>RCA plug</para></listitem>
+ <listitem><para>shielded cable (video coax 75 Ohm will do)</para></listitem>
+ </itemizedlist>
+ Connect them as follows :
+ <programlisting>
+&nbsp;&nbsp;&nbsp;center pin jackplug ------|----- center pin RCA plug
+&nbsp;&nbsp;&nbsp; GND __|__ GND</programlisting>
+ </para>
+ <para>
+ In order to test it use a DVD with AC3 or DTS track
+ start xine and select the right audio track
+ from user interface or start xine as:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine dvd:/1 -a 0</command></screen>
+ The external decoder should display something like
+ "Dolby Digital" in case the selected audio track contains
+ AC3 data or "DTS" in case the selected audio track
+ contains DTS data. Of course stereo audio also goes
+ through the SPDIF output, so the analog outputs of the
+ SBLive 5.1 are not needed anymore.
+ </para>
+ </sect3>
+ </sect2>
+
+ <sect2 id="volumecontrol">
+ <title>Changing the volume with the GUI control has no effect! What's up!?</title>
+ <para>
+ Some xine drivers do not support volume changing although the GUI
+ will show the volume bar. Usually this is not xine's fault: aRts C
+ API, for example, doesn't offer any volume property to applications.
+ Similarly, with ac3 pass through it is not possible to set the volume.
+ </para>
+ <para>
+ Note that recently we added support to "simulate" volume in aRts by
+ changing sample values on-the-fly before delivering them to the driver.
+ Not as good as having access to sound card's mixer but at least users
+ will not complain about lacking of volume bar anymore! :)
+ </para>
+ </sect2>
+
+ <sect2 id="stuttering">
+ <title>Audio is stuttering and i see a lot of "metronom: fixing sound card drift by -2115 pts" on the console output</title>
+ <para>
+ Might be a soundcard problem, if it only comes in longer intervals.
+ Your soundcard does not keep it's sampling frequency accurately
+ enough, which results in audio and video
+ getting out of sync and xine has to compensate. If you see the message
+ only from time to time, you might remedy it by using the resampling sync
+ method. You can do this by setting the configuration entry
+ <parameter>audio.synchronization.av_sync_method</parameter> to <parameter>resample</parameter>.
+ </para>
+ <para>
+ If you receive the metronom message more often,
+ maybe switching to different drivers (alsa to oss or vise-versa)
+ can help here. It has also been reported that setting the configuration
+ entry <parameter>audio.synchronization.force_rate</parameter> to the native sampling
+ rate of your soundcard (try 44100 and 48000) helps sometimes.
+ </para>
+ <para>
+ Another, whole different possibility is that you have some background
+ process running which is messing with the clock (like some ntp client &ndash;
+ chrony, ntpd, &hellip;).
+ </para>
+ <para>
+ Occasional messages of "fixing sound card drift" may happen on start and
+ when playing a long stream (like a movie). This is normal behaviour,
+ nothing to worry about.
+ </para>
+ </sect2>
+
+ <sect2 id="soundloss">
+ <title>xine seems to lose sound arbitrarily during playback, especially with DVDs</title>
+ <para>
+ You are using the OSS audio output plugin, right? In order to keep video and audio
+ in sync, xine regularly queries the audio driver for the amount of delay induced by
+ the current length of the driver's audio buffer. Unfortunately some OSS drivers seem
+ to be broken because the can return strange values here. This confuses the xine audio
+ subsystem and makes it drop audio.
+ </para>
+ <para>
+ You should try the various settings of the
+ configuration entry <parameter>audio.oss_sync_method</parameter>. The options
+ <parameter>getodelay</parameter> and <parameter>getoptr</parameter> ask the driver and
+ might therefore show the problem. But chances are that only one is broken and the other
+ works, so you should try them both first, since they are the most accurate.
+ The option <parameter>probebuffer</parameter> does not ask the driver directly but
+ tries to determine the buffer length from outside. This should work with any driver
+ and is the way to go, of the driver dependent methods fail.
+ <parameter>softsync</parameter> is the least accurate and should be used only in
+ emergency situations.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="video">
+ <title>Video related questions</title>
+
+ <sect2 id="novideo">
+ <title>I can hear the audio &ndash; but I don't see a picture!</title>
+ <para>
+ Probably your hardware is simply too slow &ndash; see above for some
+ hints on how to speed things up.
+ </para>
+ <para>
+ Another possibility is that you using a buggy Xv driver, see the next
+ questions.
+ </para>
+ </sect2>
+
+ <sect2 id="bluescreen">
+ <title>I only see a blue (or green or black) video image most of the time.</title>
+ <para>
+ You are either watching a very boring video (just kidding) or you are
+ suffering from a bug in the Xorg 6.7 implementation of X11.
+ </para>
+ <para>
+ The workaround is to add the line
+ <programlisting>&nbsp;&nbsp;&nbsp;Option "XaaNoOffscreenPixmaps"</programlisting>
+ in the <varname>Device</varname> section of your X server configuration (usually
+ <filename>/etc/X11/xorg.conf</filename> or <filename>/etc/X11/XF86Config</filename>).
+ </para>
+ </sect2>
+
+ <sect2 id="buggyxv">
+ <title>The image looks strange, it is shifted, cropped or shows weird lines!</title>
+ <para>
+ This points to a problem with the Xv extension, which is used by xine
+ to display the video image. To verify this, try running xine with the XShm
+ video output plugin:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -V XShm</command></screen>
+ </para>
+ <para>
+ If that works fine, you just proved, that the Xv extension is buggy. xine will
+ remember the last used video output plugin, so the setting will stay at XShm.
+ You could simply continue using this, but XShm is a lot slower than Xv, so
+ read on and see if you can get it working. Usually you should look for
+ updated versions of the X driver module that belongs to your graphics card.
+ </para>
+ <para>
+ Other possibilites are limitations in either your X driver module or your
+ graphics hardware. If your card could somehow be running out of ressources (graphics
+ RAM perhaps) and displays an incorrect Xv overlay because of that, try reducing
+ the display resolution and/or colour depth.
+ </para>
+ <para>
+ Consult the next question for more details on Xv.
+ </para>
+ </sect2>
+
+ <sect2 id="xvextension">
+ <title>How can I make xine use the Xv extension and what drivers do I need?</title>
+ <para>
+ xine will normally use Xv by default if it is available. In some cases
+ you might need to choose Xv playback manually (when the <filename>~/.xine/config</filename>
+ file for some reason says that you want to use XShm):
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -V Xv</command></screen>
+ </para>
+ <para>
+ If this doesn't work for you, it may be possible that Xv is not present
+ on your system.
+ </para>
+ <para>
+ First you need to install/use X.org or XFree 4.x. Once you got that you have to
+ make sure the X drivers you're using are supporting Xv on your
+ hardware. Here are some hints for individual gfx chips:
+ <itemizedlist>
+ <listitem>
+ <para>
+ 3Dfx: if all you get is a solid black window, upgrade to X.org or XFree 4.1.0 or later.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ ATI: if you only get "half a picture", try lowering your resolution
+ or bit depth, disable DRI (looks like you ran out of video RAM)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Trident card: If you see vertical bands jumbled, upgrade to the latest
+ xfree/experimental trident drivers (for the CyberBlade XP
+ a driver exists here:
+ <ulink url="http://www.xfree86.org/~alanh/">http://www.xfree86.org/~alanh/ </ulink>)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ nVidia: With newer GeForce cards, Xv should work with XFree 4.2.0 or
+ newer, for older RivaTNT cards use the binary drivers from nvidia
+ (of course the binary drivers work as well for GeForce cards)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Mach64/Rage3D (not Rage128/Radeon) cards/chips get no XVideo with
+ standard drivers, try
+ <ulink url="http://gatos.sourceforge.net/">GATOS drivers
+ </ulink> instead
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ intel: i815 has Xv support in XFree 4.x, others unknown
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Permedia 2/3 has Xv support in XFree 4.x
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Savage: at least some older drivers tend to lock up the whole machine,
+ try the drivers available from
+ <ulink url="http://www.probo.com/timr/savage40.html">
+ http://www.probo.com/timr/savage40.html
+ </ulink>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SIS: certain controllers (more info needed!) have Xv support in XFree 4.x
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Chips and Tech 6555x, 68554, 69000, 69030 have Xv support in XFree 4.x
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ NeoMagic: certain controllers (more info needed!) have Xv support in Xfree 4.x
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ SiliconMotion: certain controllers (more info needed!) have Xv support in Xfree 4.x
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Matrox: G200 or newer (but not Parhelia) have Xv support in XFree 4.x.
+ For Parhelia, use the binary only drivers available from matrox' website.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ <sect2 id="colorkey">
+ <title>Some parts of my X Desktop get transparent when xine plays the video!</title>
+ <para>
+ Looks like some colours on your GUI match the colour key which Xv uses. You can
+ change the colour key value to avoid this. There should be a line like:
+ <programlisting>&nbsp;&nbsp;&nbsp;video.device.xv_colorkey:2110</programlisting>
+ in your <filename>~/.xine/config</filename> file where you can change the colour that's used
+ by xine for the video overlay.
+ </para>
+ </sect2>
+
+ <sect2 id="texturedvideo">
+ <title>How do I get Xv working with compiz?</title>
+ <para>
+ Tell xine to prefer textured video. There should be a line like:
+ <programlisting>&nbsp;&nbsp;&nbsp;video.device.xv_preferred_method:Any</programlisting>
+ in your <filename>~/.xine/config</filename> file where you can change the preferred method
+ used by xine for the video overlay.
+ </para>
+ <para>
+ It may be that your graphics card or driver doesn't have the necessary
+ support for textured video, or the video is rendered too slowly.
+ </para>
+ <itemizedlist>
+ <listitem><para>
+ ATI: you are likely to need xf86-video-ati later than 6.8.0; 6.9.0.91
+ or newer is recommended for slower/older hardware (&lt; X1300) because
+ the rendering speed has been improved a lot.
+ </para></listitem>
+ <listitem><para>
+ Intel: 945 and later, at least, should be fine with xf86-video-intel
+ 2.0 or later. Certainly with 2.2 or later.
+ </para></listitem>
+ <listitem><para>
+ nVidia: will probably be fine. (FIXME)
+ </para></listitem>
+ </itemizedlist>
+ <para>
+ If you find that textured video is significantly slower or isn't
+ supported, you should either not use compiz or tell xine to use the
+ xshm video output driver.
+ </para>
+ </sect2>
+
+ <sect2 id="aspectratio">
+ <title>The aspect ratio of the video is wrong!</title>
+ <para>
+ Usually xine discovers the screen aspect ratio by
+ querying the X-server and then adjusts the video automatically
+ to make it look right. However, if that doesn't work try
+ pressing "a" to manually change the aspect ratio.
+ </para>
+ <para>
+ If you have a wide screen monitor, make sure the X-server
+ is correctly configured. The X-server must know the physical
+ size of the screen, which is independent of the resolution
+ being used.
+ </para>
+ <para>
+ For X.org, the screen size should be set in the <parameter>"Monitor"</parameter>
+ section in the file <filename>/etc/X11/xorg.conf</filename>, as in the example below:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;Section "Monitor"
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identifier "Monitor0"
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VendorName "Monitor Vendor"
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ModelName "DDC Probed Monitor - ViewSonic G773-2"
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DisplaySize 320 240
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HorizSync 30.0 - 70.0
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VertRefresh 50.0 - 180.0
+&nbsp;&nbsp;&nbsp;EndSection</programlisting>
+ For XFree86, the filename is normally <filename>/etc/X11/XF86Config</filename>.
+ </para>
+ <para>
+ Where <parameter>DisplaySize</parameter> specifies,
+ in millimeters, the physical size of the monitor's picture area.
+ </para>
+ </sect2>
+
+ <sect2 id="discardedskipped">
+ <title>What is the difference between discarded and skipped frames?</title>
+ <para>
+ Sometimes xine will output a message like that:
+ <programlisting>&nbsp;&nbsp;&nbsp;200 frames delivered, XX frames skipped, YY frames discarded</programlisting>
+ </para>
+ <para>
+ The difference between these counters is a little subtle for the non
+ developer. There are two threads running in order to display video:
+ the decoder thread will deliver frames to the video output thread.
+ The latter is responsible for scheduling the frames to be displayed at
+ the right time.
+ </para>
+ <para>
+ If your system can't keep up with decoding requirements, decoder will
+ deliver overdue frames. Imagine if it finished decoding the frame
+ tagged for displaying at 11:30 but xine clock marks 11:31. When this
+ situation is detected, xine will try to skip decoding a few frames
+ to recover. Not every decoder may support this feature.
+ </para>
+ <para>
+ When the frame is decoded to be shown somewhere in future but the
+ output thread doesn't get scheduled in time by the operating system
+ to complete the operation, the frame is discarded. One cause might
+ be the disk access operation, which may halt the system for a few
+ miliseconds without DMA. See performance section tips above.
+ </para>
+ <para>
+ Note that if a decoder can't skip frames for some reason, you would
+ never see frames skipped (they would be all discarded).
+ </para>
+ </sect2>
+
+ <sect2 id="contrastbrightnesssaturation">
+ <title>My xine is runing in black and white! / I only get a grey video output!</title>
+ <para>
+ This frequently happens with new Xv drivers or when switching to a
+ different video card. Background is that different Xv drivers often
+ use different ranges for the contrast/brightness/saturation settings.
+ </para>
+ <para>
+ To fix this, try opening the xine settings window and try adjusting
+ the sliders for contrast, brightness and saturation.
+ </para>
+ <para>
+ Please note that some frontends save these settings in their config file
+ so when you have found a working combination, make sure you exit
+ xine cleanly so the values are saved.
+ </para>
+ </sect2>
+
+ <sect2 id="videodriver">
+ <title>Which is the best video driver to use?</title>
+ <para>
+ xine supports several video drivers for outputing the image. These will
+ differ on how the frames are copied to the video card memory, whether
+ colourspace conversion and scaling is done in software or hardware, among
+ other things. They may also differ on ease of use and stability.
+ </para>
+ <para>
+ Most of the time, Xv should give the users a good trade-off between
+ quality, compatibility and ease of use. This is why xine tries to use
+ Xv by default.
+ </para>
+ <para>
+ However some users may want to explore better the available hardware
+ capabilities (eg. syncing frame drawing with monitor refresh).
+ Also some Xv drivers contain slow copies and accessing the video card
+ directly may yield performance gains.
+ </para>
+ <para>
+ Drivers that access hardware directly includes VIDIX (warning: requires
+ root priviledges or kernel helper).
+ User may try one of those, but should be warned that with root access
+ they can cause the system to crash hard. The support is also limited to
+ a couple of graphics cards only.
+ </para>
+ <para>
+ Graphic workstations like SGI have usually a good support for OpenGL.
+ In that case, using OpenGL may be a better choice than XShm. However for
+ most desktop systems the performance of OpenGL will be quite bad.
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="overlay">
+ <title>OSD and overlay related questions</title>
+
+ <sect2 id="unscaledosd">
+ <title>What is this "unscaled" OSD about?</title>
+ <para>
+ Since version 1-rc3 of xine-lib supports a new method for rendering OSD
+ (On Screen Display) and subtitles. This method uses a X11 extension
+ called XShape that allows using screen resolution instead of
+ stream resolution. It is called "unscaled" OSD because it does not
+ scales with the video being played.
+ </para>
+ <para>
+ Suppose you are watching a 320x200 video in full screen. Normal OSD
+ would be blended at 320x200 and then scaled to full screen (lets say,
+ 1024x768), resulting in big and ugly fonts. The unscaled overlay is
+ drawn directly to screen, creating a sharper and better looking OSD.
+ </para>
+ <para>
+ There are side effects too. Sometimes the unscaled overlay show some
+ glitch just before disappearing. Some people may be annoyed enough
+ by that and might want to disable the usage of unscaled overlay
+ altogether.
+ </para>
+ <para>
+ Unscaled OSD usage by subtitles and xine-ui is controlled by
+ the following settings (<filename>~/.xine/config</filename> or
+ <filename>~/.config/gxine/config</filename>):
+ <programlisting>&nbsp;&nbsp;&nbsp;gui.osd_use_unscaled:0</programlisting>
+ <programlisting>&nbsp;&nbsp;&nbsp;subtitles.separate.use_unscaled_osd:0</programlisting>
+ </para>
+ </sect2>
+
+ <sect2 id="noosd">
+ <title>I can't see the OSD or it leaves a black box over the image!</title>
+ <para>
+ If you are using xine-lib version 1-rc3 or newer, this is probably
+ due buggy XV drivers that do not support
+ <link linkend="unscaledosd">unscaled OSD</link> (the XShape
+ extension) properly.
+ </para>
+ <para>
+ There have being reports of some ATI drivers that don't allow
+ displaying anything over the video. The VIA Epia binary drivers
+ is reported to leave a black box where the OSD was displayed.
+ </para>
+ <para>
+ The problem may be fixed by either updating the video driver,
+ or disabling xine unscaled OSD support.
+ </para>
+ </sect2>
+
+ <sect2 id="overlaycolorleak">
+ <title>Why colours of overlays/subtitles seem to be "leaking"?</title>
+ <para>
+ xine blends most overlays, specially the ones from DVD discs,
+ directly over the image (scaled OSD). Unfortunately most codecs
+ (like MPEG2) use a subsampled image format (YV12) that makes
+ properly blending an interesting challenge.
+ </para>
+ <para>
+ In short, this is a known xine bug. There have being discussions
+ on improving the blending quality but, so far, nobody implemented
+ a better (scaled) overlay renderer. Contact developers if you want
+ to try doing something about it.
+ </para>
+ </sect2>
+
+ <sect2 id="uglysubtitles">
+ <title>Why external subtitles look so ugly?</title>
+ <para>
+ You are probably using a xine-lib version older than 1-rc3.
+ Try upgrading your copy and read the
+ <link linkend="unscaledosd">section about unscaled osd</link>.
+ </para>
+ </sect2>
+
+ <sect2 id="subtitlesoutsidevideo">
+ <title>Why subtitles can't be displayed outside the video?</title>
+ <para>
+ It is possible, but older xine versions may not support it. There are two
+ alternatives for rendering the subtitles outside the video image:
+ </para>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Use the "expand" post plugin to increase frame height adding
+ black bars to it. This will allow blending the subtitles
+ over the black bars, since they will be part of the video now.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Use <link linkend="unscaledosd">unscaled OSD</link>, as it
+ does not requires any video to render the subtitles on.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Also notice that DVD overlays (including subtitles) are meant to
+ be displayed in a fixed position, this is how the DVD menu
+ highlighting works. xine does not support moving them.
+ </para>
+ </sect2>
+
+ <sect2 id="supportedfonts">
+ <title>What kinds of subtitle fonts does xine use?</title>
+ <para>
+ xine can use two kinds of fonts:
+ <itemizedlist>
+ <listitem>
+ <para>
+ TTF fonts
+ </para>
+ <para>
+ If xine is compiled with freetype library xine recognizes and uses TTF
+ fonts directly.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ xine fonts
+ </para>
+ <para>
+ This is xine's native format. It's better because the font
+ generator utility implements more features than the "on the fly" TTF renderer.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ The font for text subtitles is selected via config option
+ <parameter>subtitles.separate.font</parameter>. You can specify xine font name
+ (<parameter>sans</parameter>, <parameter>serif</parameter>, &hellip;)
+ or file name of the TTF font. The directories
+ <filename>$prefix/share/xine/libxine1/fonts</filename> and
+ <filename>~/.xine/fonts</filename> are searched for the fonts, with
+ <filename>$prefix</filename> being the place xine-lib was installed to.
+ Usually this is <filename>/usr/local</filename> or <filename>/usr</filename>.
+ TTF fonts are also searched for in the current directory.
+ </para>
+ </sect2>
+
+ <sect2 id="generatefonts">
+ <title>How to create own xine subtitle fonts?</title>
+ <para>
+ xine's native subtitle fonts can be generated from TTF fonts with the
+ utility <command>xine-fontconv</command>. It isn't compiled and installed by default but
+ you can make it manually. You'll need freetype and zlib packages together with
+ their versions for development plus a compiler, of course ;)
+ Here's how you build <command>xine-fontconv</command>:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Get the source of xine-fontconv utility from the <filename>misc</filename>
+ directory within the xine-lib sources.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Compile it:
+ <screen>&nbsp;&nbsp;&nbsp;<command>gcc xine-fontconv.c -o xine-fontconv `freetype-config --cflags --libs` -lz</command></screen>
+ </para>
+ </listitem>
+ </itemizedlist>
+ You'll need some TTF font for generating. Characters in this font should
+ cover all codepages you want supported, otherwise you'll have missing characters.
+ </para>
+ <para>
+ Syntax is:
+ <screen>&nbsp;&nbsp;&nbsp;<command>./xine-fontconf font.ttf font_name [encoding1 [encoding2 [&hellip;]]]</command></screen>
+ </para>
+ <para>
+ For example default font <filename>sans</filename> was generated with
+ following command:
+ <screen>
+&nbsp;&nbsp;&nbsp;<command>./xine-fontconv Aril_Bold.ttf sans iso-8859-1 iso-8859-2 iso-8859-5 \
+&nbsp;&nbsp;&nbsp; iso-8859-9 iso-8859-15 cp1250 cp1251</command></screen>
+ </para>
+ <para>
+ There are displayed messages about missing characters on the screen
+ during generating. It's OK if the missing characters are U+007f..U+009F.
+ These characters come from iso-8859-1 and they aren't displayable.
+ </para>
+ </sect2>
+
+ <sect2 id="subencoding">
+ <title>Encoding of external subtitles is bad. What is wrong?</title>
+ <para>
+ The encoding of the external subtitles is expected to be iso-8859-1 by
+ default. You need to set an appropriate encoding in the config option
+ <parameter>subtitles.separate.src_encoding</parameter>. Note that you also need
+ a font which contains all characters from the given encoding.
+ </para>
+ <para>
+ The default font <filename>sans</filename> and fonts
+ <filename>serif</filename> and <filename>mono</filename> cover these
+ encodings:
+ <itemizedlist>
+ <listitem><para>iso-8859-1</para></listitem>
+ <listitem><para>iso-8859-2</para></listitem>
+ <listitem><para>iso-8859-5</para></listitem>
+ <listitem><para>iso-8859-9</para></listitem>
+ <listitem><para>iso-8859-15</para></listitem>
+ <listitem><para>windows-1250</para></listitem>
+ <listitem><para>windows-1251</para></listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ </sect1>
+
+ <sect1 id="errors">
+ <title>Error Messages: What they mean and what you can do</title>
+
+ <sect2 id="xfreecrash">
+ <title>Starting xine crashes X, I am logged out of my desktop!</title>
+ <para>
+ xine itself is unable to crash X, so when your X server just shuts down or
+ restarts with the login screen, there is something wrong with your X setup.
+ Most common are problems with the Xv extension. Try running xine with the XShm
+ video output plugin:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -V XShm</command></screen>
+ </para>
+ <para>
+ If that works fine, you just proved, that the Xv extension is buggy. xine will
+ remember the last used video output plugin, so the setting will stay at XShm.
+ You could simply continue using this, but XShm is a lot slower than Xv, so
+ consult the <link linkend="xvextension">section on Xv</link> and see if you can
+ get it working. Usually you should look for updated versions of the X driver
+ module that belongs to your graphics card.
+ </para>
+ </sect2>
+
+ <sect2 id="audiodrivererr">
+ <title>Starting xine fails with complains about audio drivers/devices!</title>
+ <para>
+ You can select the audio driver using the -A option. So try:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -A null</command></screen>
+ If you have ALSA drivers installed, try:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -A alsa</command></screen>
+ If you run ESD (not recommended), try:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -A esd</command></screen>
+ If you run artsd, try:
+ <screen>&nbsp;&nbsp;&nbsp;<command>xine -A arts</command></screen>
+ </para>
+ </sect2>
+
+ <sect2 id="novideoportfound">
+ <title>"no video port found"</title>
+ <para>
+ You got the Xv extension, but your video card driver doesn't support it.
+ First try to find a driver that does support Xv on your hardware (check
+ your graphics card vendor). If your driver has Xv support but you can't
+ get it working, try at a lower resolution (1024x768 is enough even for
+ anamorphic DVDs).
+ </para>
+ <para>
+ If all that fails, you can still use plain X11/XShm:
+ <screen>&nbsp;&nbsp;&nbsp;<command>gxine -V XShm foo.vob</command></screen>
+ </para>
+ </sect2>
+
+ <sect2 id="unabletoopendvddrive">
+ <title>"Unable to open dvd drive (/dev/dvd)"</title>
+ <para>
+ You probably don't have /dev/dvd (check that). If so, simply create a
+ link /dev/dvd that points to your DVD device. Something like&hellip;
+ <screen>&nbsp;&nbsp;&nbsp;<command>ln -s hdc /dev/dvd</command></screen>
+ &hellip; should do the job. Also make sure you have read and write access on
+ the device the symlink points to.
+ See the <link linkend="dvdplayback">dvd playback section</link>
+ for more information.
+ </para>
+ </sect2>
+
+ <sect2 id="status0x51">
+ <title>My drive doesn't work and the kernel says "status=0x51 { DriveReady SeekComplete Error }"</title>
+ <para>
+ This error can be fixed by recompiling your kernel with the option
+ "Use multi-mode by default" enabled in the IDE settings.
+ </para>
+ </sect2>
+
+ <sect2 id="demuxerror0000">
+ <title>"demux error! 00 00 00 (should be 0x000001)"</title>
+ <para>
+ Probably xine can't access your input source. Most commonly this happens
+ when you're trying to play locked/encrypted DVDs. Remember that xine
+ can't play such DVDs out-of-the box for legal reasons (see above).
+ </para>
+ <para>
+ If it is legal where you live, you can try to install libdvdcss. Once
+ you have done that and re-start xine, it should automatically detect
+ and use it to play back encrypted DVDs.
+ </para>
+ <para>
+ Another reason could be that your (RPC-2) DVD drive isn't set up
+ for the right region (see above).
+ </para>
+ </sect2>
+
+ <sect2 id="ossfailed">
+ <title>"audio driver 'oss' failed, using null driver instead"</title>
+ <para>
+ First of all, make sure that your OSS Audio drivers are working (i.e.
+ you can play music with other software). Maybe you're using alsa?
+ If so, try <command>gxine -A alsa</command> to see if this helps.
+ </para>
+ <para>
+ The most common reason for oss not working is that some other program is accesing
+ your audio device. If you're using linux, the command <command>fuser /dev/dsp</command>
+ should give you the PID of the process.
+ </para>
+ <para>
+ If you are using GNOME, chances are that this is caused by ESD. Now you
+ have two possibilities. Either deactivate ESD (temporarily) by right
+ clicking on the sound monitor applet and selecting "Place Esound in
+ standby" or just kill it. Then xine will use OSS audio output. The other
+ method is to make xine use ESD for audio output with:
+ <screen>&nbsp;&nbsp;&nbsp;<command>gxine -A esd</command></screen>
+ This may result in worse playback &ndash; exact syncronization is not possible
+ with esd, so using oss should be preferred.
+ </para>
+ <para>
+ If you are using KDE, there is the possibility that the aRts sound
+ daemon is currently running and thus blocking your sound device. You
+ can check that by starting the aRts control (in your KDE menu it should
+ be under Multimedia). If it is running, you can either use the aRts
+ audio output plugin:
+ <screen>&nbsp;&nbsp;&nbsp;<command>gxine -A arts</command></screen>
+ Or you suspend the aRts daemon by checking the appropriate option in
+ your aRts control. (recommended)
+ </para>
+ <para>
+ Newer versions of arts have an auto-suspend mode &ndash; this can lead to
+ some nondeterministic behaviour of xine if it is set up to use
+ the audio device directly. Using arts is recommended in that case;
+ however, you will lose the ability to do four/five channel audio output.
+ </para>
+ </sect2>
+
+ <sect2 id="throwingawayimage">
+ <title>"video_out: throwing away image with pts xxx because it's too old"</title>
+ <para>
+ This is a performance related problem.
+ If you have a fast computer and this message is shown from time to
+ time when playing a DVD or CD, it's very likely that DMA is not enabled
+ for your drive.
+ </para>
+ </sect2>
+
+ <sect2 id="novideopluginavailable">
+ <title>"No video plugin available to decode 'xxxxxx'."</title>
+ <para>
+ You have tried to play a stream using a unknown or unhandled codec.
+ Possibly the file uses some obscure proprietary format and no
+ information is available on how to decode it.
+ </para>
+ <para>
+ If you're on an x86 platform (e.g. PC hardware) you might want to
+ try installing binary-only windows medial, real networks and
+ quicktime codecs (see above).
+ </para>
+ </sect2>
+
+ <sect2 id="decoderfailedtostart">
+ <title>"w32codec: decoder failed to start. Is 'xxxxxx' installed?"</title>
+ <para>
+ You probably don't have the win32 dll needed to decode this file.
+ </para>
+ </sect2>
+
+ <sect2 id="xinecrashed">
+ <title>xine just crashed on me &ndash; i didn't get any error message</title>
+ <para>
+ OK, yes, that shouldn't happen and you're upset. We can understand that.
+ But, to help you and of course to fix this, we need some information.
+ So, let's go through the checklist and maybe prepare a nice bug report
+ for the <ulink url="http://bugs.xine-project.org/">xine bug tracker</ulink>:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Did xine really crash (segfault) or did it hang (deadlock)?
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Can you reproduce the bug? (e.g. do you remember what you
+ did and when you do it again it crashes again?)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Is that a specific media file or format which crashes xine? (Have you
+ tried other files types?)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Check the console output (and include it in a bug report), maybe earlier
+ there is some output that points to the problem.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Your X server just froze on you? unfortunately that's a known problem
+ with some chipsets and drivers (most commonly Savage chipsets) when
+ using Xv. You might want to try running <command>gxine -V XShm</command>
+ to see if the problem is related to the Xv driver. This will unfortunately
+ be much slower, as lots of things are now done in software instead of
+ hardware scaling/colour space conversion.
+ </para>
+ <para>
+ Maybe at the time you read this, there's an X upgrade which fixes
+ this for the Savage driver. If that works for you, please notify the xine crew at
+ <email>xine-user@lists.sourceforge.net</email>, so they can update this FAQ!
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Even though we try to make each release as bug free as possible, xine is
+ still under heavy development (nice excuse, isn't it? *grin*).
+ </para>
+ <para>
+ If you write to the <ulink url="http://bugs.xine-project.org/">xine bug tracker</ulink>
+ make sure you include a the above information (when applicable)
+ and also some information about your machine (operating system, cpu type and
+ speed, gfx card, sound card, &hellip;) and please use a meaningfull subject
+ line ("xine bug" is bad, "xine fails to play this quicktime trailer in fullscreen mode"
+ ist much better).
+ </para>
+ <para>
+ Thanks for taking the time to help improve xine.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+
+ </sect1>
+
+ </article>
+
+</book>
diff --git a/doc/faq/faq.sgml b/doc/faq/faq.sgml
deleted file mode 100644
index 27bd6182c..000000000
--- a/doc/faq/faq.sgml
+++ /dev/null
@@ -1,2280 +0,0 @@
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
-
-<book>
-
- <bookinfo>
- <title>The xine engine FAQ list</title>
- <titleabbrev>xine FAQs</titleabbrev>
- <copyright>
- <year>2001-2010</year>
- <holder>the xine project team</holder>
- </copyright>
- </bookinfo>
-
- <article class="faq">
-
- <sect1 id="general">
- <title>General questions about xine and this document</title>
-
- <sect2 id="about">
- <title>What is the xine engine?</title>
- <para>
- The xine engine is a free media player engine. It comes in the form of
- a shared libarary and is typically used by media player frontends
- and other multimedia applications for playback of multimedia streams
- such as movies, radio/tv network streams, DVDs, VCDs.
- </para>
- <para>
- Since there are several frontends for the xine library available,
- this document has a problem when it comes to examples.
- The two most common frontends xine-ui and gxine are mixed in command
- line examples throughout this FAQ. When you use a different
- frontend, some of these will not work for you. The filename of
- the config file also varies amongst frontends. If you get confused,
- I recommend you try with one of xine-ui or gxine.
- </para>
- </sect2>
-
- <sect2 id="scope">
- <title>What's the aim and scope of this text?</title>
- <para>
- The primary goal of this FAQ is to cover all recurring questions related
- to the xine engine. Frontend specific questions are usually not covered here.
- </para>
- </sect2>
-
- <sect2 id="wheretogethelp">
- <title>My question is not yet covered here &ndash; where can I ask for help?</title>
- <para>
- First of all be sure that your question is really not covered here and
- that you haven't just been a bit too lazy to read through all of this
- text. ;-). Also check out the documentation specific to
- the frontend (e.g. <command>xine-ui</command> or <command>gxine</command> or
- <command>totem</command>).
- </para>
- <para>
- That said &ndash; you are welcome to mail to our user mailing list:
- <email>xine-user@lists.sourceforge.net</email>
- Please provide some info about your setup so people have a chance to
- help you, e.g. include information about your audio/video hardware
- and drivers you use, operating system, cpu type and some console
- output/any error messages. Also include command line parameters you
- have specified and information about the type of stream you're
- trying to play back. Also very important is the version of xine
- you're using and information about any additional plugins you
- may have installed on your system.
- </para>
- </sect2>
-
- <sect2 id="pronounce">
- <title>How do I pronounce "xine"?</title>
- <para>
- As long as people know what you are talking about, you are free to
- pronounce it the way you like, but the official pronounciation is
- [ksi:n], like the name "Maxine" with the "Ma" removed.
- </para>
- </sect2>
-
- <sect2 id="modules">
- <title>What are those xine-lib, xine-ui, gxine, &hellip; Mercurial repositories for?</title>
- <para>
- Some time ago xine just became too complex to be just one big program.
- Therefore it was split into two major parts.
- </para>
- <para>
- xine-lib is simply speaking the engine of xine. It contains all basic plugins
- and is necessary to run anything that relies on xine. (This is the part that
- is covered in this FAQ.)
- </para>
- <para>
- Then there are frontends &ndash; applications that use xine. The most
- common frontend is that of a media player. There are currently
- three frontends being developed in the xine project: xine-ui, a skinned
- dvd-player style frontend directly based on xlib; gxine, a desktop
- media-player style frontend using the standard GTK widget set; and
- xine-plugin, a plugin for browsers such as Firefox.
- External projects like kaffeine, sinek and totem develop additional frontends.
- In the future you will likely see more and different types of applications
- being developed which will use the xine engine for video processing
- and other multimedia purposes.
- </para>
- <para>
- If you simply want a media/dvd player, you'll need to install xine-lib
- first and then choose and install a player frontend like xine-ui or gxine.
- </para>
- <para>
- Other repositories include <filename>xine-project-www</filename>,
- which contains the xine project website sources, and various packaging
- and development branches.
- </para>
- </sect2>
-
- <sect2 id="hg">
- <title>Where and how do I get the latest development version?</title>
- <para>
- Be advised that end-users should stick to the official xine releases.
- The Mercurial repositories are only intended for developers and for others who know why they use it.
- </para>
- <para>
- The repositories are listed at <ulink url="http://hg.debian.org/hg/">http://hg.debian.org/hg/</ulink>;
- however, this is a list of all repositories which are kept there, not just the
- xine project's (which are the ones which begin with <filename>xine-lib/</filename>). To check one out:
- <screen>&nbsp;&nbsp;&nbsp;<command>hg clone http://hg.debian.org/hg/<filename>repository</filename> <filename>local_copy</filename></command></screen>
- e.g.
- <screen>&nbsp;&nbsp;&nbsp;<command>hg clone http://hg.debian.org/hg/xine-lib/xine-lib xine-lib</command></screen>
- </para>
- <para>
- You can see a full list of repositories by visiting
- <ulink url="http://hg.debian.org/hg/xine-lib/">http://hg.debian.org/hg/xine-lib/</ulink>.
- </para>
- </sect2>
-
- <sect2 id="cvs">
- <title>Don't you use CVS?</title>
- <para>
- We used to, but there are some significant problems with CVS. Merging
- is easier with Mercurial (and, for that matter, git); and we can commit
- changes locally, change them if mistakes have been made, then make them
- public whenever we're ready.
- </para>
- </sect2>
-
- <sect2 id="patch">
- <title>How do I submit patches?</title>
- <para>
- See the xine Hackers' Guide, chapter 3, "How to contribute".
- (This is available online at <ulink url="http://www.xine-project.org/hackersguide#contribute">http://www.xine-project.org/hackersguide#contribute</ulink>.)
- </para>
- </sect2>
-
- <sect2 id="binaries">
- <title>Where can I find pre-compiled binaries, e.g. RPMs?</title>
- <para>
- The xine project does not provide pre-compiled binaries for legal
- reasons (some parts of xine may be covered by patents in some countries).
- Some OS projects/vendors (e.g. Debian, FreeBSD, &hellip;) offer binaries
- for their distributions &ndash; please contact them or use their package search
- tools for further info.
- You can also find links to third parties providing xine RPMs on
- the xine homepage at
- <ulink url="http://www.xine-project.org/releases">http://www.xine-project.org/releases</ulink>.
- </para>
- <para>
- See the next section of this FAQ for instructions on how to build xine
- from source.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="building">
- <title>Building and installing xine from source</title>
-
- <sect2 id="buildrequirements">
- <title>What do I need to compile everything properly?</title>
- <para>
- First of all an official and stable release of gcc. Also be aware
- that patched gcc versions may break parts of xine and are therefore
- not supported by the xine project.
- </para>
- <para>
- Furthermore you'll have to use GNU make to compile xine. On most GNU/Linux
- systems "make" is GNU make &ndash; on other platforms use "gmake" instead.
- Also, zlib is required (including the appropriate header files, which are
- often found in a package called zlib-devel or similar.)
- </para>
- <para>
- If you want to compile xine from Mercurial, you'll need to have the autobuild tools
- installed (automake, autoconf and libtool &ndash; in recent versions).
- </para>
- <para>
- Frontends might need additional libraries, e.g. for gxine you'll need to have
- GTK2 installed. Make sure you have not only the shared libraries themselves
- but also the header files (often packaged seperately as so-called -dev packages)
- on your system.
- </para>
- <para>
- Some plugins that come with the xine engine need additional libraries (otherwise
- they will not be built). For example, libogg and libvorbis (plus their include files)
- are needed for ogg/vorbis support. Most notably, if you want to see any video
- on your X11 desktop (and that's what you're here for, isn't it?), you need the
- X developer packages as well.
- </para>
- <para>
- Don't worry about this too much right now, xine's <command>configure</command>
- (see below) will check for all the stuff needed and will tell you what's missing
- (which means that you should check the output it produces carefully ;) ).
- </para>
- </sect2>
-
- <sect2>
- <title>How do I compile xine?</title>
- <sect3 id="simplebuildinstr">
- <title> Simple build instructions for beginners </title>
- <para>
- Download the latest xine-lib and gxine/xine-ui tarballs, then follow
- these instruction. To unpack a tarball, use:
- <screen>&nbsp;&nbsp;&nbsp;<command>tar xfvz tarballname.tar.gz</command></screen>
- </para>
- <para>
- The following instructions will install xine in <filename>/usr/local</filename>
- where it will be visible for all users. You need root privileges to do this on most systems.
- </para>
- <para>
- After unpacking xine-lib, issue:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>./configure</command>
-&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
- </para>
- <para>
- Make sure your <filename>/etc/ld.so.conf</filename> contains
- <filename>/usr/local/lib</filename> and continue with:
- <screen>&nbsp;&nbsp;&nbsp;<command>ldconfig</command></screen>
- </para>
- <para>
- Now unpack your frontend (gxine or xine-ui or &hellip;), then:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>./configure</command>
-&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
- </para>
- </sect3>
- <sect3 id="completebuildinstr">
- <title>Complete build instructions</title>
- <para>
- The build process is the same for all of the xine modules.
- </para>
- <para>
- You have to start with xine-lib. If built and installed successfully, you
- can continue with the frontend(s).
- </para>
- <para>
- If you have installed xine-lib to a non-standard prefix, make sure
- that you have <filename>$prefix/bin</filename> in your PATH and that your linker finds
- libs in <filename>$prefix/lib</filename> &ndash; otherwise trying to build modules that
- rely on xine-lib will fail with configure complaining about not
- finding certain parts of libxine. Using bash you can do something like:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>export PATH="$prefix/bin:$PATH"</command>
-&nbsp;&nbsp;&nbsp;<command>export LD_LIBRARY_PATH="$prefix/lib:$LD_LIBRARY_PATH"</command></screen>
- to make sure libxine can be found by the frontend(s).
- </para>
- <para>
- Last but not least. Here the build instructions. As stated earlier,
- those are the same for every xine module.
- <screen>
-&nbsp;&nbsp;&nbsp;<command>./autogen.sh</command> [&rarr; <emphasis>only</emphasis> if you're building from hg]
-&nbsp;&nbsp;&nbsp;<command>./configure</command>
-&nbsp;&nbsp;&nbsp;<command>make</command>
-&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="rpmbuild">
- <title>Making your own RPM packages (xine-lib, xine-ui, gxine)</title>
- <para>
- Basically you will only have to issue one command, if you have just
- downloaded a source tarball from our web site:
- <screen>&nbsp;&nbsp;&nbsp;<command>rpmbuild -ta &lt;THE_NAME_OF_YOUR_SOURCE_TAR_BALL&gt;</command></screen>
- (Older versions of RPM use <command>rpm</command> instead of <command>rpmbuild</command>.)
- </para>
- <para>
- This will start the binary and source RPM building. After compiling is
- finished, a binary rpm is placed in your rpm binary directory which is
- something like <filename>/usr/src/RPM/RPMS/&lt;YOUR_ARCHITECTURE&gt;</filename>
- and a source RPM is written to your rpm source dir
- (e.g. <filename>/usr/src/RPM/SRPMS</filename>).
- </para>
- <para>
- In case that you have an up-to-date hg repository, you will need to do the
- following first in order to get a tarball release out of it which you
- can later use with the <command>rpmbuild -ta</command> command above:
- <screen>&nbsp;&nbsp;&nbsp;<command>./autogen.sh &amp;&amp; make clean &amp;&amp; make dist</command></screen>
- </para>
- <para>
- In any case, please keep in mind that you have to build and install
- xine-lib first before you can proceed with xine-ui.
- </para>
- </sect2>
-
- <sect2 id="debbuild">
- <title>Making your own .deb packages (xine-lib, xine-ui, gxine)</title>
- <para>
- You'll need an HG snapshot tarball or source checked out from the repository.
- </para>
- <para>
- First, make sure that the "devscripts" and "build-essential" packages are installed. You'll
- then need the following commands (the first one isn't needed unless you're using a snapshot tarball):
- <screen>
-&nbsp;&nbsp;&nbsp;<command>tar xzf &lt;PACKAGE-VER.tar.gz&gt;</command>
-&nbsp;&nbsp;&nbsp;<command>cd &lt;PACKAGE-VER&gt;</command>
-&nbsp;&nbsp;&nbsp;<command>./autogen.sh noconfig</command>
-&nbsp;&nbsp;&nbsp;<command>debuild binary</command>
- </screen>
- (If <command>debuild</command> complains about unmet dependencies, then
- install them using <command>aptitude install &lt;PACKAGES&gt;</command> (as root) then re-run
- <command>debuild binary</command>.
- </para>
- <para>
- Once the build has been successfully completed, you'll have some new .debs.
- <screen>
-&nbsp;&nbsp;&nbsp;<command>cd ..</command>
-&nbsp;&nbsp;&nbsp;<command>ls *.deb</command>
-&nbsp;&nbsp;&nbsp;<command>su - -c 'cd '"`pwd`"' &amp;&amp; dpkg -i &lt;DEB_PACKAGES&gt;'</command>
- </screen>
- Ubuntu users will probably want to use this instead of that <command>su</command>:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>sudo dpkg -i &lt;DEB_PACKAGES&gt;</command>
- </screen>
- </para>
- <para>
- In any case, please keep in mind that you have to build and install
- xine-lib first before you can proceed with xine-ui or gxine.
- </para>
- </sect2>
-
- <sect2 id="cflags">
- <title>Can I provide additional CFLAGS for compilation?</title>
- <para>
- Yes, you can do so by setting the CFLAGS variable and then running
- <command>configure</command> again. You can even pass them to
- <command>configure</command> directly. Example:
- <screen>&nbsp;&nbsp;&nbsp;<command>./configure CFLAGS="-march=i686"</command></screen>
- </para>
- <para>
- Other user variables <command>configure</command> respects are:
- <itemizedlist>
- <listitem>
- <para>
- <command>CC</command> to specify the compiler executable
- </para>
- </listitem>
- <listitem>
- <para>
- <command>CPP</command> to specify the C preprocessor executable
- </para>
- </listitem>
- <listitem>
- <para>
- <command>LD</command> to specify the linker executable
- </para>
- </listitem>
- <listitem>
- <para>
- <command>CPPFLAGS</command> to pass additional include paths or other
- preprocessor options
- </para>
- </listitem>
- <listitem>
- <para>
- <command>LDFLAGS</command> to pass additional library paths or other
- linker options
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- An example combining some of these would look like:
- <screen>&nbsp;&nbsp;&nbsp;<command>./configure CC="/opt/intel/bin/icc" LD="/opt/intel/bin/xild" \
-&nbsp;&nbsp;&nbsp;CPPFLAGS="-I/usr/local/include/dvdnav" LDFLAGS="-L/home/guenter/xine_libs"</command></screen>
- </para>
- </sect2>
-
- <sect2 id="athlonflags">
- <title>Are there binaries for my AMD K7 (Athlon&trade;) available? Can I build them?</title>
- <para>
- If you have a recent gcc you can try to compile "more" k7 support in (esp.
- better instruction scheduling). If the configure script should fail to
- detect your processor/gcc correctly, try passing the canonical system name for
- your machine to configure with the <command>--host</command> option, e.g.
- <screen>&nbsp;&nbsp;&nbsp;<command>./configure --host=k7-pc-linux-gnu</command></screen>
- </para>
- </sect2>
-
- <sect2>
- <title>Build problems: xine engine (xine-lib)</title>
- <sect3 id="doesntcompile">
- <title>The package doesn't compile at all!</title>
- <para>
- In order to be able to compile xine-lib, you need (amongst other things)
- the zlib compression library plus the appropriate headers, which are
- often found in a package called zlib-devel or similar.
- </para>
- <para>
- Read again carefully the output <command>./configure</command>
- produced and/or compiler warnings and error reports, they often contain
- helpful information to find out what's going on. If you're stuck here
- and decide to post your problem on the xine-user mailing list,
- make sure you include these outputs.
- </para>
- </sect3>
- <sect3 id="xvpluginfailstobuild">
- <title>The Xv video-out plugin fails to compile!</title>
- <para>
- If you want to have Xv support compiled in, make sure you either have
- a shared Xv library on your system, e.g.
- <command>ls /usr/X11R6/lib/libXv*</command>
- should give you some .so libs, like this:
- <screen>
-&nbsp;&nbsp;&nbsp;/usr/X11R6/lib/libXv.a
-&nbsp;&nbsp;&nbsp;/usr/X11R6/lib/libXv.so
-&nbsp;&nbsp;&nbsp;/usr/X11R6/lib/libXv.so.1</screen>
- </para>
- <para>
- Alternatively you need to have libtool 1.4 or newer installed, then
- libXv.a is sufficient. Otherwise you can create the shared versions yourself:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>ld --whole-archive -shared -o libXv.so.1 libXv.a</command>
-&nbsp;&nbsp;&nbsp;<command>ln -s libXv.so.1 libXv.so</command>
-&nbsp;&nbsp;&nbsp;<command>ldconfig</command></screen>
- </para>
- <para>
- Now you should be ready to build the Xv video-out plugin on your system.
- </para>
- </sect3>
- </sect2>
-
- <sect2>
- <title>Build problems in frontends (gxine/xine-ui/&hellip;)</title>
- <sect3 id="xinelibnotfound">
- <title>I have installed xine-lib but the frontend complains about not finding it!</title>
- <para>
- First of all take a closer look at the compilation instructions above again.
- You will probably find your answer there right away.
- </para>
- <para>
- As stated there (there again that hint *grin*), make sure that you
- have <filename>$prefix/bin</filename> in your path and that your
- linker is able to find libraries installed in <filename>$prefix/lib</filename>
- By the way, $prefix is where you installed your xine-lib to earlier
- (yes, installing xine-lib with <command>make install</command> or
- installing the corresponding distribution-provided -dev or -devel
- package would be a good idea before trying to compile the frontend ;)
- ).
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="nonrootbuild">
- <title>Can I install xine in my home directory (without being root)?</title>
- <para>
- Sure. First set up a subdir where you install your private software, eg.
- <screen>&nbsp;&nbsp;&nbsp;<command>mkdir ~/xine</command></screen>
- </para>
- <para>
- Then you have to set a few environment variables &ndash; it's probably a good
- idea to add this to your <filename>~/.bashrc</filename> (or somewhere similar):
- <screen>
-&nbsp;&nbsp;&nbsp;<command>export PATH="$HOME/xine/bin:$PATH"</command>
-&nbsp;&nbsp;&nbsp;<command>export LD_LIBRARY_PATH="$HOME/xine/lib:$LD_LIBRARY_PATH"</command></screen>
- </para>
- <para>
- Now you can unpack tarballs e.g. in <filename>~/xine/src</filename>
- (<command>mkdir ~/xine/src</command> if necessary) and do a
- <screen>
-&nbsp;&nbsp;&nbsp;<command>./configure --prefix=$HOME/xine</command>
-&nbsp;&nbsp;&nbsp;<command>make install</command></screen>
- </para>
- <para>
- You also need to tell frontends using xine-lib, where to find it:
- <screen>&nbsp;&nbsp;&nbsp;<command>./configure --prefix=$HOME/xine --with-xine-prefix=$HOME/xine</command></screen>
- </para>
- </sect2>
-
- <sect2 id="win32build">
- <title>How to compile xine for Windows?</title>
- <para>
- For compiling xine under Windows with MinGW, CygWin or MS Visual C see <ulink url="http://hg.debian.org/hg/xine-lib/xine-lib?cmd=file;file=doc/README.WIN32;filenode=-1;style=raw"><filename>README.WIN32</filename></ulink>.
- </para>
- <para>
- For cross-compiling xine under comfortable unix-like environment with MinGW see <ulink url="http://hg.debian.org/hg/xine-lib/xine-lib?cmd=file;file=doc/README.MINGWCROSS;filenode=-1;style=raw"><filename>README.MINGWCROSS</filename></ulink>.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="playback">
- <title>Playback of various stream types</title>
-
- <sect2>
- <title>DVD Playback with xine</title>
- <sect3 id="dvdplayback">
- <title>How do I play back DVDs with xine?</title>
- <para>
- Newer xine (1.0.x) releases come with a full-featured
- DVD plugin that should be able to handle any unencrypted,
- non-locked DVD with full menu navigation support. No external
- plugins are required anymore here.
- </para>
- <para>
- To get DVD playback working, first make sure you have
- a symlink <filename>/dev/dvd</filename> pointing to your
- DVD device on your system. For example, if your DVD drive
- is the master ide drive on the second IDE channel,
- <filename>/dev/dvd</filename> should point to
- <filename>/dev/hdc</filename>. Please note that if you
- are using the ide-scsi emulation on your system, it is
- likely that your DVD drive got mapped to a scsi device
- node even though it is an ide drive. In that case first
- check out you boot/kernel logs (or run <command>cdrecord -scanbus</command>)
- to find out which device it got mapped to and set the
- symlink accordingly (should be something like <filename>/dev/scd0</filename>,
- <filename>/dev/scd1</filename>, &hellip; in that case).
- Also make sure you (as a user) have sufficient (read and write) permissions
- on your DVD drive. This could mean you either have to change the device
- permissions or add your user to a special group
- (e.g. <command>addgroup cdrom username</command>),
- depending on your setup and/or distribution.
- </para>
- <para>
- It is highly recommended to switch DMA mode on for your DVD drive
- (without it even very recent machines will have trouble producing
- smooth video output). Use a command like
- <command>hdparm -d 1 &lt;device&gt;</command>
- on your DVD device. Please note that even if you're using ide-scsi
- you will have to set the dma flag on the ide device node (e.g.
- <filename>/dev/hdc</filename>), not the mapped <filename>/dev/scd</filename>
- scsi device.
- </para>
- <para>
- To be able to play back encrypted DVDs you need to have
- libdvdcss installed on your system (please check if this is legal where
- you live). If you do not understand what the term "encrypted DVD" means
- here: As a rule of thumb, every DVD you have to pay money for is most
- likely encrypted.
- </para>
- <para>
- To make matters worse, apart from encryption, there is another obstacle
- to take: the region code. The DVD authorities decided to divide the world
- into eight geographical regions. Have a look at
- <ulink url="http://www.dvdforum.gr.jp/RegionMap.pdf">http://www.dvdforum.gr.jp/RegionMap.pdf</ulink>
- if you want to know which number has been assigned to your country. It is
- now their idea, that you shall only play DVDs, which have been produced
- for your region. If you take a DVD off the shelf in your local store,
- you should find a little globe-like icon which shows the region code the
- disc is for.
- </para>
- <para>
- Newer (post-2000) DVD drives (so-called RPC-2 drives) check the DVD
- region, which means they'll prevent you from playing back DVDs that have
- a different region code from what the drive is set up for. Some drives
- come with a factory setting of region 0 so they can play back
- any DVD until a region code is set. Others refuse to play any DVD at all
- until they are told a region. The easiest way to handle this is to use
- the regionset utility from
- <ulink url="http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415">
- http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415
- </ulink>.
- </para>
- <para>
- Once you have everything set up, try something like
- <command>gxine dvd:/</command> or <command>xine -p dvd:/</command>
- to start dvd playback. Some frontend also offer so-called autoplay
- buttons or menu entries that start dvd playback immediately.
- </para>
- <para>
- Important: do not try to mount the DVD. Just insert it and hit the DVD autoplay
- button or start xine from the command line.
- </para>
- <para>
- If things do not work as expected, try running the <command>xine-check</command>
- shellscript that comes with xine to see if this gives you further hints on
- what could be wrong.
- </para>
- </sect3>
- <sect3 id="dvdlongwait">
- <title>DVD playback works, but it takes a long time until playback starts</title>
- <para>
- This points to a region code problem. Some versions of libdvdcss can play
- back DVDs from other regions than the RPC-2 DVD drive is set up for,
- but this usually means a cryptographic attack (which takes time) has
- to be used to access the DVD.
- </para>
- <para>
- You can download a tool to set the region code of RPC-Drives here:
- <ulink url="http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415">
- http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415
- </ulink>.
- </para>
- <para>
- Warning: Please be aware that the number of region code changes in RPC-2
- drives is limited (usually about 5 times), after that your drive will
- stay locked to the region you last set it up for.
- </para>
- </sect3>
- <sect3 id="regionset">
- <title>I have problems setting up my RPC-2 drive for the right region!</title>
- <para>
- You can download a tool to set the region code of RPC-Drives here:
- <ulink url="http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415">
- http://sourceforge.net/project/showfiles.php?group_id=31346&amp;release_id=168415
- </ulink>.
- </para>
- <para>
- Warning: Please be aware that the number of region code changes in RPC-2
- drives is limited (usually about 5 times), after that your drive will
- stay locked to the region you last set it up for.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="vcdsupport">
- <title>Can I watch Video CDs (VCDs)? SVCDS ? CD-i?</title>
- <para>
- xine supports VCD and SVCD playback out-of-the box. Similar to DVDs,
- make sure you have a <filename>/dev/cdrom</filename> alias pointing
- to your CDROM drive which you will use to play back the (S)VCD.
- </para>
- <para>
- At the moment, CD-i formats are not supported by xine.
- </para>
- <para>
- Do not try to mount the (S)VCD. Simply insert it into your CDROM drive
- and hit the VCD autoplay button or start something like
- <command>gxine vcd:/</command> or <command>xine vcd:/</command>
- from the command line.
- </para>
- <sect3 id="vcdtroubleshooting">
- <title>VideoCD troubleshooting guide</title>
- <para>
- This gives higher-level troubleshooting. More lower-level information is
- given in <link linkend="vcddebug">the next section</link>.
- </para>
- <itemizedlist>
- <listitem>
- <para>
- When you open the configuration dialog of your frontend, you should
- see a <parameter>vcd</parameter> config section. An important setting is
- <parameter>default_device</parameter>. If this is set to the empty string,
- the VCD plugin will try to scan your drives for a suitable device if the
- driver has the capability to scan for drives. However you can set
- the device to something of your choosing. On GNU/Linux, this may be
- <filename>/dev/cdrom</filename> and on Solaris it may be
- <filename>/vol/dev/aliases/cdrom0</filename>.
- </para>
- <para>
- If you set this field, make sure these are correct for your
- particular setup. For example, I generally play out of the DVD
- device and this is called <filename>/dev/dvd</filename> rather than <filename>/dev/cdrom</filename>.
- </para>
- <para></para>
- </listitem>
- <listitem>
- <para>
- Your frontend should offer a VCD autoscan button or menu item.
- If you select this, you should see your CD disk light go on if you have one.
- And the CD should be read. You should get a playlist of what's on the VideoCD.
- </para>
- <para>
- If not something's wrong, possibly you configured the wrong drive.
- You might try to read a disk image of a VideoCD and thus elimate any problems
- with hardware. You can get a test VideoCD disk image to test here:
- <ulink url="http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip">
- http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip
- </ulink>.
- After unzipping this there should be files <filename>test_svcd_pal.cue</filename> and
- <filename>test_svcd_pal.bin</filename>. Run xine with the MRL
-<!-- FIXME: This MRL needs to be changed -->
- <filename>vcd:/test_svcd_pal.cue:E0</filename>.
- If you see something playing then this is a hardware problem.
- You might also want to try starting playback-control with
-<!-- FIXME: This MRL needs to be changed -->
- <filename>vcd:/test_svcd_pal.cue:P1</filename>.
- </para>
- <para></para>
- </listitem>
- <listitem>
- <para>
- There should be at least one "track", and one "entry" listed for
- the VideoCD and the names of these in the MRL list will end with
- "T1" and "E0" respectively. Often there are other playlist items,
- and if you have menus or still frames there will be
- "segments" as well. The simplest things to check are probably
- "entries" and "tracks". If there are no entries listed or none of
- the tracks or entries play, then there may be a problem with
- that particular medium. So as in the step above, you can try a known good
- sample and perhaps burn a CD from that. More likely if you get this
- far, some of the items listed work and some do not. There are a
- number of debugging switches that you can dynamically turn on and
- off that may be able to help in isolating more specific problems.
- See the <link linkend="vcddebug">section below</link>.
- </para>
- <para></para>
- </listitem>
- <listitem>
- <para>
- Something plays now, but you do not get any menus? Well, first is there
- supposed to be a menu? In the last step you should have seen what is on
- the VideoCD. Still frames are always "segments" so see if you can find one in the MRL
- list and select that.
- </para>
- <para>
- If there are no segments listed, there aren't any still-frame
- menus. It's also possible to have menus in looping MPEG's. Use the
- <command>vcddump</command> tool to find loops. <command>vcddump</command> is
- also part of VCDImager. Another program that can help you examine the contents
- of a VideoCD is <command>vcdxrip</command>.
- </para>
- <para>
- To troubleshoot, start out with the known SVCD example that has a
- still-frame menu at the beginning:
- <ulink url="http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip">
- http://www.vcdimager.org/pub/vcdimager/examples/test_svcd/test_svcd_pal.zip
- </ulink>
- Inside this is a largish file called <filename>test_svcd_pal.bin</filename> and another
- short text file called <filename>test_svcd_ntsc.cue</filename>. These are CD disk
- images; that is, something that could be burned to a CD drive such
- as with <command>cdrdao</command>. However you don't have to create a CD to view these
- with the xine VCD plugin. You should be able to play the VideoCD by running the MRL
-<!-- FIXME: This MRL needs to be changed -->
- <filename>vcd:/test_svcd_pal.cue</filename>.
- If you see a still frame on startup. Great! If instead you see what
- looks like the beginning of a movie (Blue Streak with Martin Lawrence)
- then go to the next step.
- </para>
- <para></para>
- </listitem>
- <listitem>
- <para>
- You have a VideoCD with menu and can see it, but there is no menu on startup?
- If you have the VideoCD from the last step, then run the MRL
-<!-- FIXME: This MRL needs to be changed -->
- <filename>vcd:/test_svcd_pal.cue:P1</filename>
- If this shows a still frame, but it just does not show when you
- hit either the "VCD" autoscan button or give a MRL without the P1 at
- the end then go to the next step.
- </para>
- <para>
- If you have another VideoCD, from the MRL list, you should also see "playlist"
- entries. Try selecting the one that ends "P1". If you don't see an entry with P1,
- then your VideoCD does not have playback control (PBC) and although there may
- be a still frame on the VideoCD it may have been authored so it is not easily
- accessed. Again <command>vcddump</command> or <command>vcdxrip</command> can help here.
- </para>
- <para></para>
- </listitem>
- <listitem>
- <para>
- You have a VideoCD with menu at beginning and can see it using an MRL
- with P1 at the end, but you want to see it by hitting the "VCD" autoscan button
- as well? Check to see that you have the configuration entry
- <parameter>media.vcd.autoplay</parameter> set to <parameter>playlist</parameter>.
- </para>
- </listitem>
- </itemizedlist>
- </sect3>
- <sect3 id="vcddebug">
- <title>VideoCD debugging</title>
- <para>
- To facilitate tracking down problems we let you see what's going on dynamically.
- Various debugging settings will cause output to appear on xine's plugin log
- and/or on standard error output. See the config entry <parameter>media.vcd.debug</parameter>
- for details.
- </para>
- <para>
- The tool <command>vcd-info</command> from the cdio branch of vcdimager can be used to
- show the entire contents of a VideoCD or selected portions of that. Until the cdio
- branch of vcdimager is completely merged with vcdimager, the cd-info branch version
- has a few more features. (However consult vcdimager for complete version of the program.)
- </para>
- <para>
- <command>vcdxrip</command> can be used to extract portions of a VideoCD and or create an
- XML description file of the VideoCD. This XML file and the extracted
- files can be used by <command>vcdxbuild</command> to recreate another VideoCD.
- </para>
- <para>
- And finally see also tools <command>cd-info</command> and <command>cd-read</command> from libcdio.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="quicktime">
- <title>Can I watch Quicktime (.mov, .mp4) files using xine?</title>
- <para>
- Quicktime is just a system layer (container format) which can contain various
- different audio and video formats. The system layer itself is fully supported
- in xine. However, some quicktime audio/video codecs are not natively supported yet.
- Luckily, if you are using a x86 compatible machine (any recent PC hardware should do)
- you can install and use the original Quicktime DLLs and watch most streams
- (trailers) that can be downloaded from the net.
- </para>
- <para>
- Possibly the most convenient way to get the Quicktime DLLs is to download
- them from the MPlayer website
- <ulink url="http://www.mplayerhq.hu/design7/dload.html">
- http://www.mplayerhq.hu/design7/dload.html
- </ulink>.
- The package is called "essential". Unpack it and move everything you find
- inside to <filename>/usr/lib/codecs</filename> (actually you can place them
- anywhere you want, e.g. someplace in your home directory, but then you'll
- have to set <parameter>decoder.external.win32_codecs_path</parameter> in your
- xine config file accordingly). Restart xine then and you should be
- able to watch Quicktime trailers.
- </para>
- </sect2>
-
- <sect2>
- <title>Real Network files/streams</title>
- <sect3 id="realfileplayback">
- <title>Can I watch Real (.rm, .ram) files using xine?</title>
- <para>
- The situation with real files and streams is pretty similar to the situation
- with Quicktime Streams (see above). The newer real audio and video formats
- are only supported by using binary-only codecs which are not included in
- xine.
- </para>
- <para>
- Possibly the most convenient way to get the Real codecs is to install
- RealPlayer 9 or RealPlayer 10 and set the
- <parameter>decoder.external.real_codecs_path</parameter> in your xine
- config file to the name of the directory which contains the codecs
- (look for drvc.so); it's probably something like
- <filename>/opt/real/RealPlayer/codecs/</filename>. Restart xine then
- and you should be able to watch Real files/streams.
- </para>
- <para>
- Another way to get the Real codecs is to download them from the MPlayer website
- <ulink url="http://www.mplayerhq.hu/design7/dload.html">
- http://www.mplayerhq.hu/design7/dload.html
- </ulink>.
- The package is called "essential". Unpack it and move everything you
- find inside to <filename>/usr/lib/codecs</filename> and set the
- <parameter>decoder.external.real_codecs_path</parameter> in your xine config file
- to <filename>/usr/lib/codecs</filename> (actually you can place them
- anywhere you want, e.g. someplace in your home directory, but then you'll
- have to set <parameter>decoder.external.real_codecs_path</parameter> accordingly).
- Restart xine then and you should be able to watch Real files/streams.
- </para>
- </sect3>
- <sect3 id="realnetworkstreams">
- <title>What about (live) network streams (pnm://, rtsp:// style urls)?</title>
- <para>
- xine supports both pnm and rtsp streaming. However, digging out the actual
- pnm/rtsp url can be tricky as they're often packed into heavy JavaScript and
- HTML code on most websites. You can either use a combination of your
- browser's "save source" function and wget or use a xine browser plugin
- (currently the gxine frontend comes with a simple mozilla plugin,
- for example). When you decided to dig out the url by hand don't get fooled
- by the many redirectors that are often placed around the actual url.
- Use wget to download any http://-style urls and use less to look inside
- the downloaded .ra/.ram files where you will find the actual pnm/rtsp
- url which can be opened using xine.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="wmv">
- <title>Can I watch Windows Media (.asf/.wmv/.wma) files using xine?</title>
- <para>
- While the container format (system layer) ASF (wmv is just an alias)
- is fully supported in xine, for newer windows media 9 based streams
- you'll need to install windows binary codecs (.DLLs).
- </para>
- <para>
- Possibly the most convenient way to get the Windows DLLs is to download
- them from the MPlayer website
- <ulink url="http://www.mplayerhq.hu/design7/dload.html">
- http://www.mplayerhq.hu/design7/dload.html
- </ulink>.
- The package is called "essential". Unpack it and move everything you find
- inside to <filename>/usr/lib/codecs</filename> (actually you can place them
- anywhere you want, e.g. someplace in your home directory, but then you'll
- have to set <parameter>decoder.external.win32_codecs_path</parameter> in your
- xine config file accordingly). Restart xine then and you should be
- able to watch windows media streams.
- </para>
- </sect2>
-
- <sect2 id="dvb">
- <title>Can I watch Digital TV (Digital Video Broadcast) using xine?</title>
- <para>
- At the time of this writing DVB support is a very new and experimental
- feature in xine. The number of supported cards is pretty limited at the moment.
- See <filename>doc/README.dvb</filename> (in the xine-lib tarball) for details.
- </para>
- </sect2>
-
- <sect2 id="stdin">
- <title>How do I play streams from STDIN?</title>
- <para>
- Use something like:
- <screen>&nbsp;&nbsp;&nbsp;<command>cat stream.mpg | gxine stdin:/</command></screen>
- </para>
- </sect2>
-
- <sect2 id="avisubtitles">
- <title>How can I watch files with external AVI subtitles?</title>
- <para>
- In xine 0.9.13 this used to be:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine foo.avi%bar.sub</command></screen>
- </para>
- <para>
- Latest xine-lib modules (1-beta3 or newer) support external subtitles
- for any media file, not only AVI. In order to use it you can pass a
- special MRL construction like:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine file://path/to/test.mpg#subtitle:/path/to/file.sub</command></screen>
- The external subtitles support can also be used by any xine frontend.
- Currently xine-ui and kaffeine implement this feature with a subtitle
- selection dialog.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="running">
- <title>Running xine</title>
-
- <sect2 id="speedup">
- <title>I have a lot of dropped frames &ndash; what can I do?</title>
- <para>
- Your hardware might be too slow for xine. Make sure you turn on all
- speed optimizing options. A few things you should check (in order of
- importance):
- <itemizedlist>
- <listitem>
- <para>
- First of all, run the <command>xine-check</command> script included in xine
- package (probably already installed in your system).
- <command>xine-check</command> will report several of the most common problems
- listed here. Sample output from xine-check:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>xine-check</command>
-&nbsp;&nbsp;&nbsp;Please be patient, this script may take a while to run...
-&nbsp;&nbsp;&nbsp;[ good ] you're using Linux, doing specific tests
-&nbsp;&nbsp;&nbsp;[ good ] looks like you have a /proc filesystem mounted.
-&nbsp;&nbsp;&nbsp;[ good ] You seem to have a reasonable kernel version (2.4.18)
-&nbsp;&nbsp;&nbsp;[ good ] intel compatible processor, checking MTRR support
-&nbsp;&nbsp;&nbsp;[ good ] you have MTRR support and there are some ranges set.
-&nbsp;&nbsp;&nbsp;[ good ] found the player at /usr/local/bin/xine
-&nbsp;&nbsp;&nbsp;[ good ] /usr/local/bin/xine is in your PATH
-&nbsp;&nbsp;&nbsp;[ good ] found /usr/local/bin/xine-config in your PATH
-&nbsp;&nbsp;&nbsp;[ good ] plugin directory /usr/local/lib/xine/plugins exists.
-&nbsp;&nbsp;&nbsp;[ good ] found input plugins
-&nbsp;&nbsp;&nbsp;[ good ] found demux plugins
-&nbsp;&nbsp;&nbsp;[ good ] found decoder plugins
-&nbsp;&nbsp;&nbsp;[ good ] found video_out plugins
-&nbsp;&nbsp;&nbsp;[ good ] found audio_out plugins
-&nbsp;&nbsp;&nbsp;[ good ] skin directory /usr/local/share/xine/skins exists.
-&nbsp;&nbsp;&nbsp;[ good ] found logo in /usr/local/share/xine/skins
-&nbsp;&nbsp;&nbsp;[ good ] I even found some skins.
-&nbsp;&nbsp;&nbsp;[ good ] /dev/cdrom points to /dev/hdc
-&nbsp;&nbsp;&nbsp;[ good ] /dev/dvd points to /dev/hdc
-&nbsp;&nbsp;&nbsp;[ good ] DMA is enabled for your DVD drive
-&nbsp;&nbsp;&nbsp;[ good ] found xvinfo: X-Video Extension version 2.2
-&nbsp;&nbsp;&nbsp;[ good ] your Xv extension supports YUV overlays (improves MPEG performance)
-&nbsp;&nbsp;&nbsp;[ good ] your Xv extension supports packed YUV overlays
-&nbsp;&nbsp;&nbsp;[ good ] Xv ports: YUY2 YV12 I420 UYVY</screen>
- </para>
- </listitem>
- <listitem>
- <para>
- Try to use the Xv driver, it greatly improves performance and quality
- because your graphics card does image scaling and colourspace conversion. The
- <link linkend="video">video section</link> contains important information
- about several Xv drivers.
- </para>
- <para>
- If Xv cannot be used for some reason, make sure your display is set up
- to 16bpp, not 24 or higher (reduces memory bandwith). Some Xv drivers
- may also have better performance with 16bpp.
- </para>
- </listitem>
- <listitem>
- <para>
- Make sure the hard drive (or cdrom/dvd drive) which supplies the
- video data is in DMA mode (if supported).
- </para>
- <para>
- On most linux-based systems, you can use hdparm to check this:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>hdparm /dev/hda</command>
-&nbsp;&nbsp;&nbsp;[...]
-&nbsp;&nbsp;&nbsp;using_dma = 1 (on)
-&nbsp;&nbsp;&nbsp;[...]</screen>
- </para>
- <para>
- You can enable DMA mode with the following command:
- <screen>&nbsp;&nbsp;&nbsp;<command>hdparm -d1 device_of_your_drive_that_supplies_video_data</command></screen>
- In some cases where this fails it helps to specify the dma mode
- to use, for example:
- <screen>&nbsp;&nbsp;&nbsp;<command>hdparm -d1 -X 66 device_of_your_drive_that_supplies_video_data</command></screen>
- In RedHat 8.0 an additional entry in /etc/modules.conf
- <screen>&nbsp;&nbsp;&nbsp;options ide-cd dma=1</screen>
- should help (reboot for this change to take effect).
- </para>
- <para>
- More information about this may be found here:
- <ulink url="http://oreilly.linux.com/pub/a/linux/2000/06/29/hdparm.html">
- http://oreilly.linux.com/pub/a/linux/2000/06/29/hdparm.html
- </ulink>.
- </para>
- </listitem>
- <listitem>
- <para>
- Use a recent kernel which is optimized for your hardware. Old kernels
- may lack support for accelerated instructions like SSE, for example.
- </para>
- </listitem>
- <listitem>
- <para>
- Close other applications (use a tool like "top" to find out
- what applications are using up CPU power). Programs that update the
- system clock like ntp should also be disabled.
- </para>
- </listitem>
- <listitem>
- <para>
- Enable MTRR support in your kernel. If you are still using XFree 3.x,
- you'll have to tell the kernel yourself where the graphics memory is.
- You'll find details about that in the linux dvd howto.
- </para>
- <para>
- If you're using X.org or XFree 4.x, enabling MTRR support in your kernel should
- be enough (use a recent kernel!).
- </para>
- <para>
- Try a <command>cat /proc/mtrr</command> &ndash; if the file exists and you find an entry
- corresponding to the amount of graphics memory you have, everything
- should be fine.
- </para>
- </listitem>
- <listitem>
- <para>
- Have your X-server (usually X.org or XFree86) running with higher priority.
- Most recent linux distributions (like RedHat 8.0 or Mandrake 9.0) should
- do that for you, improving not only xine but desktop responsiveness
- in general.
- </para>
- <para>
- Use the "top" utility and verify under the "NI" column if
- the X process has a negative value, this indicates a higher priority.
- See "The X Window User HOWTO &ndash; Performance considerations" for
- further instructions
- <ulink url="http://www.tldp.org/HOWTO/XWindow-User-HOWTO/performance.html">
- http://www.tldp.org/HOWTO/XWindow-User-HOWTO/performance.html
- </ulink>.
- </para>
- </listitem>
- <listitem>
- <para>
- Use the latest or a known-good gcc version and build an optimized xine-lib for
- your architecture.
- </para>
- </listitem>
- <listitem>
- <para>
- Besides boosting X-server priority, sometimes it's possible to avoid
- discarding frames by making xine itself higher priority. This is not
- a recommended pratice since it will require to run xine as root,
- but you may give it a try if you want:
- <screen>&nbsp;&nbsp;&nbsp;<command>nice --5 xine</command></screen>
- </para>
- </listitem>
- <listitem>
- <para>
- xine needs high speed memory access which depends on your chip set.
- Make sure you enable all speed-improving options.
- </para>
- <para>
- Especially the via apollo pro chipset is known to be quite weird,
- (most of all on my gigabyte board). If you can't configure the ram
- access thoroughly using the bios you might want to try some really
- nasty tricks, as explained on (for example):
- <ulink url="http://www.overclockers.com/tips105/index03.asp">
- http://www.overclockers.com/tips105/index03.asp
- </ulink>
- </para>
- <para>
- This website centers around a windows-tool to tweak the chipset, you
- can do the same on FreeBSD with <command>pciconf</command>.
- On some linux distributions there are similar tools.
- </para>
- </listitem>
- <listitem>
- <para>
- a nice performance tuning tool can be found here:
- <ulink url="http://powertweak.sourceforge.net">http://powertweak.sourceforge.net</ulink>
- </para>
- </listitem>
- <listitem>
- <para>
- Set up and use raw devices for DVD access. Please note that the
- actual performance gain during playback is very small if any, but
- since raw devices are bypassing the kernel's buffer cache, Linux
- will not try to cache the DVDs you play. This would not be useful,
- because xine does its own caching and you usually play DVDs
- sequentially, which means you won't reuse anything from the cache.
- But the problem would be that Linux throws everything out of the
- cache that might be in there.
- </para>
- <para>
- Raw devices should be available in linux kernel 2.4.x and there are
- patches for older kernels available from:
- <ulink url="ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/">
- ftp://ftp.kernel.org/pub/linux/kernel/people/sct/raw-io/
- </ulink>
- </para>
- <para>
- To use raw devices, first connect a free raw device to your dvd
- device, use something like:
- <screen>&nbsp;&nbsp;&nbsp;<command>raw /dev/raw1 /dev/dvd</command></screen>
- </para>
- <para>
- Then create a link named "rdvd" pointing to that raw device:
- <screen>&nbsp;&nbsp;&nbsp;<command>ln -s raw1 /dev/rdvd</command></screen>
- </para>
- </listitem>
- <listitem>
- <para>
- For slow / high-latency dvd drives it might help to increase
- the number of video buffers xine allocates. Try setting
- <parameter>engine.buffers.video_num_buffers:500</parameter>
- to a higher value (e.g. 1000 or 2500).
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
-
- <sect2 id="smoothness">
- <title>Oki, xine doesn't drop frames now but video output still is not really smooth!</title>
- <para>
- Video output can be further improved by tuning your linux kernel:
- <itemizedlist>
- <listitem>
- <para>
- Set HZ to 1000 in
- <filename>/usr/src/linux/include/asm-i386/param.h</filename>
- </para>
- </listitem>
- <listitem>
- <para>
- Try applying scheduler patches, especially the O(1) and the preemptive
- patches have proven useful at the time of this writing (spring 2003).
- </para>
- </listitem>
- </itemizedlist>
- Linux 2.5/2.6 will probably have these improvements out of the box.
- </para>
- <para>
- Miguel Freitas has written a nice
- <ulink url="http://cambuca.ldhs.cetuc.puc-rio.br/~miguel/multimedia_sim/">
- article about his kernel multimedia experiments
- </ulink>.
- </para>
- </sect2>
-
- <sect2 id="ports">
- <title>I have problems when using xine on FreeBSD, Solaris, &hellip; !</title>
- <para>
- Check out the the corresponding README files in the directory <filename>xine-lib/doc</filename>.
- </para>
- </sect2>
-
- <sect2 id="aaxine">
- <title>What is aalib? How do I use it in xine?</title>
- <para>
- aalib is an ascii art library. xine comes with an aalib video output
- plugin so you can watch movies in your xterm, on the console or on your
- old vt100 &ndash; very cool ;> &hellip; another nice option is to preview movies
- on a remote server in your shell over ssh.
- </para>
- <para>
- To use it make sure you have aalib installed correctly before you
- configure/build xine-lib and xine-ui. In addition to the <command>xine</command> binary a
- binary named <command>aaxine</command> should get built and installed. You can then use
- something like:
- <screen>&nbsp;&nbsp;&nbsp;<command>aaxine foo.mpg</command></screen>
- to use aalib video output.
- </para>
- </sect2>
-
- <sect2 id="dxr3">
- <title>Does xine support my dxr3 / hollywood+ card?</title>
- <para>
- While xine's focus is clearly on software decoding, the dxr3 is supported.
- </para>
- <para>
- You can find more information about using xine with the dxr3
- <ulink url="http://www.amalthea.de/xine/">here</ulink>
- (also covers how to do tv output using the dxr3).
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="audio">
- <title>Audio related questions</title>
-
- <sect2 id="audiodrivers">
- <title>What audio drivers does xine support? OSS? Alsa? Arts? Esd?</title>
- <para>
- Currently xine support audio output via OSS (kernel audio drivers),
- ALSA 0.9.x (ALSA 0.5.x is no longer supported), arts (KDE's sound daemon)
- and esound (esd, gnome's sound daemon &ndash; not recommended because it has
- serious issues with a/v sync).
- </para>
- </sect2>
-
- <sect2 id="compressor">
- <title>When I'm watching a movie, the sound effects are much higher in volume than the voices!</title>
- <para>
- Congratulations, you seem to have an original movie audio track there.
- </para>
- <para>
- Uhm. So you don't like it. Well, there are two things you can do:
- <itemizedlist>
- <listitem>
- <para>
- You can enable xine's audio compressor. Most frontends have
- a settings window and in that you'll find a slider for the
- compressor setting. The values are percent values, so a
- slider setting of 200 means that xine will double the volume
- of silent parts of the movie (loud parts stay the same).
- </para>
- <para>
- If your frontend does not have such a compression slider,
- you can pass the value with the MRL:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine dvd:/#compression:150</command></screen>
- </para>
- </listitem>
- <listitem>
- <para>
- If you have a dolby digital (AC3) soundtrack, you can try
- to enable liba52's dynamic range compression setting
- <parameter>audio.a52.dynamic_range:1</parameter>
- in your xine config file (or use some gui config dialog).
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
-
- <sect2 id="noaudio">
- <title>When I play this stream, xine shows video but there's no audio!</title>
- <para>
- If this happens with any video, first try a different audio driver
- (<command>gxine -A oss</command>, <command>gxine -A arts</command>,
- <command>xine -A alsa</command> &hellip;).
- </para>
- <para>
- If this problem only occurs with one specific stream, maybe switching to
- a different audio channel (using the gui) helps. Some DVD streams have
- audio on strange channels.
- </para>
- <para>
- If all this doesn't help, maybe you're missing an audio codec or you found
- a bug. If you decide to post your problem on the xine-user mailing list,
- make sure to include all console output xine produced and also clearly
- state what type of stream you tried to play back or, even better, make
- a test stream available somewhere for developers to download and try.
- </para>
- </sect2>
-
- <sect2 id="surroundsound">
- <title>Can xine produce 4-/5-channel surround audio output?</title>
- <para>
- Yep, it can do that using OSS or ALSA drivers, provided that the driver
- supports it. However, since xine cannot detect if there are actually speakers
- connected to the additional channels, you'll have to activate that feature manually.
- </para>
- <para>
- You can do this either in the config dialog while xine is running (press
- the config button on the xine panel and go to the AUDIO tab) or have it
- the complicated way by editing the config file yourself which is located
- in your home directory in <filename>.gxine</filename> or <filename>.xine</filename>:
- <programlisting>
-&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Surround 4.0
-&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Surround 4.1
-&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Surround 5.1</programlisting>
- </para>
- </sect2>
-
- <sect2 id="spdif">
- <title>What about ac3 output via spdif to an external ac3 decoder?</title>
- <para>
- xine can do that too. Pretty much the same story as for 4-/5-channel
- surround (see above). You can either use the config dialog or edit
- the config file (<filename>~/.xine/config</filename> or <filename>~/.gxine/config</filename>)
- yourself:
- <programlisting>&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Pass Through</programlisting>
- </para>
- </sect2>
-
- <sect2 id="sblivespdif">
- <title>Getting SPDIF output from a SBLive 5.1 using OSS drivers</title>
- <para>
- The following explains how to get the above configuration
- going with xine. Some parts of it may applicable to other
- configurations (cards that use the EMU10k1 chip) as well.
- </para>
- <sect3>
- <title>Requirements</title>
- <orderedlist>
- <listitem>
- <para>xine-lib >= 1.x.x</para>
- </listitem>
- <listitem>
- <para>OSS driver</para>
- </listitem>
- <listitem>
- <para>an external decoder</para>
- </listitem>
- <listitem>
- <para>a cable to connect the SBLive to the external decoder</para>
- </listitem>
- </orderedlist>
- <para>
- The configuration described was tested using a Soundblaster live 5.1 (rev 7)
- with a Yamaha DSP-AX620 external decoder.
- </para>
- </sect3>
- <sect3>
- <title>Retrieving the driver</title>
- <para>
- The OSS driver is maintained by creative and can be downloaded at
- <ulink url="http://opensource.creative.com/">http://opensource.creative.com/</ulink>.
- The driver package contains documentation on how to install it.
- Besides that I'd like to add the following notes.
- </para>
- <para>
- In order to compile and install these drivers, you need a valid kernel
- configuration file. For RedHat Linux's pre-compiled kernels these
- configuration files can be found in
- <filename>/usr/src/linux/configs</filename>.
- After you've located the correct config file for your kernel,
- you need to copy it to <filename>/usr/src/linux/.config</filename>
- For example, when you run the 2.4.18-i686 kernel do :
- <screen>&nbsp;&nbsp;&nbsp;<command>cp /usr/src/linux/configs/kernel-2.4.18-i686.config /usr/src/linux/.config</command></screen>
- Make sure that the emu10k1 module that is currently installed is
- not loaded. To unload the modules:
- <screen>&nbsp;&nbsp;&nbsp;<command>/sbin/modprobe -rv emu10k1.o ac97_codec.o</command></screen>
- If this mentions that the device is busy, some program is
- using the driver. Some example could be a mixer application
- or sound daemon like artsd. You'll need to close down the
- applications before continuing.
- At success it should print something like:
- <screen>
-&nbsp;&nbsp;&nbsp;# delete emu10k1
-&nbsp;&nbsp;&nbsp;# delete ac97_codec
-&nbsp;&nbsp;&nbsp;# delete soundcore</screen>
- Run make in the directory where you unpacked the driver and follow the
- instructions printed at the end of each step.
- The last step should be:
- <screen>&nbsp;&nbsp;&nbsp;<command>make install-tools</command></screen>
- As the README of the driver package mentions the SPDIF AC3
- output doesn't work by default. In the directory
- <filename>utils/scripts</filename> an <filename>emu10k1.conf</filename>
- file can be found which need to be placed in the default
- installation directory (<filename>/usr/local/etc</filename>).
- After this the <filename>emu10k1.conf</filename> needs to be modified.
- The following settings worked fine for me (I don't use the analog
- outputs of the card):
- <programlisting>
-&nbsp;&nbsp;&nbsp;CARD_IS_5_1=yes
-&nbsp;&nbsp;&nbsp;USE_DIGITAL_OUTPUT=yes
-&nbsp;&nbsp;&nbsp;ENABLE_TONE_CONTROL=yes
-&nbsp;&nbsp;&nbsp;AC3PASSTHROUGH=yes
-&nbsp;&nbsp;&nbsp;ENABLE_LIVEDRIVE_IR=no
-&nbsp;&nbsp;&nbsp;INVERT_REAR=no
-&nbsp;&nbsp;&nbsp;MULTICHANNEL=yes
-&nbsp;&nbsp;&nbsp;ROUTE_ALL_TO_SUB=no
-&nbsp;&nbsp;&nbsp;ANALOG_FRONT_BOOST=no
-&nbsp;&nbsp;&nbsp;SURROUND=no
-&nbsp;&nbsp;&nbsp;PROLOGIC=no
-&nbsp;&nbsp;&nbsp;ENABLE_CD_Spdif=yes
-&nbsp;&nbsp;&nbsp;ENABLE_OPTICAL_SPDIF=no
-&nbsp;&nbsp;&nbsp;ENABLE_LINE2_MIC2=no
-&nbsp;&nbsp;&nbsp;ENABLE_RCA_SPDIF=no
-&nbsp;&nbsp;&nbsp;ENABLE_RCA_AUX=no</programlisting>
- After modifying the <filename>emu10k1.conf</filename>,
- you need to modify your <filename>/etc/modules.conf</filename> and
- make sure the following lines are in there.
- <programlisting>
-&nbsp;&nbsp;&nbsp;alias sound-slot-0 emu10k1
-&nbsp;&nbsp;&nbsp;post-install emu10k1 /usr/local/etc/emu-script</programlisting>
- After saving the changes to <filename>modules.conf</filename>, run
- <screen>&nbsp;&nbsp;&nbsp;<command>/sbin/depmod -a</command></screen>
- Now, you're ready to load the new modules and set the correct
- options for it. To load the modules run:
- <screen>&nbsp;&nbsp;&nbsp;<command>/sbin/modprobe emu10k1</command></screen>
- </para>
- </sect3>
- <sect3>
- <title>Setting up xine for SPDIF (AC3 passthrough) output</title>
- <para>
- You can either use the config dialog of your frontend or edit
- the config file (<filename>~/.xine/config</filename>) yourself:
- <programlisting>&nbsp;&nbsp;&nbsp;audio.output.speaker_arrangement:Pass Through</programlisting>
- In case the setting is not in the file you can add it.
- </para>
- </sect3>
- <sect3>
- <title>
- The cable used for the SBLive can easily be self-made
- or buy a stereo 3.5mm jack to dual RCA cable.
- </title>
- <para>
- What you need to make the cable yourself:
- <itemizedlist>
- <listitem><para>stereo 3.5mm jack plug</para></listitem>
- <listitem><para>RCA plug</para></listitem>
- <listitem><para>shielded cable (video coax 75 Ohm will do)</para></listitem>
- </itemizedlist>
- Connect them as follows :
- <programlisting>
-&nbsp;&nbsp;&nbsp;center pin jackplug ------|----- center pin RCA plug
-&nbsp;&nbsp;&nbsp; GND __|__ GND</programlisting>
- </para>
- <para>
- In order to test it use a DVD with AC3 or DTS track
- start xine and select the right audio track
- from user interface or start xine as:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine dvd:/1 -a 0</command></screen>
- The external decoder should display something like
- "Dolby Digital" in case the selected audio track contains
- AC3 data or "DTS" in case the selected audio track
- contains DTS data. Of course stereo audio also goes
- through the SPDIF output, so the analog outputs of the
- SBLive 5.1 are not needed anymore.
- </para>
- </sect3>
- </sect2>
-
- <sect2 id="volumecontrol">
- <title>Changing the volume with the GUI control has no effect! What's up!?</title>
- <para>
- Some xine drivers do not support volume changing although the GUI
- will show the volume bar. Usually this is not xine's fault: aRts C
- API, for example, doesn't offer any volume property to applications.
- Similarly, with ac3 pass through it is not possible to set the volume.
- </para>
- <para>
- Note that recently we added support to "simulate" volume in aRts by
- changing sample values on-the-fly before delivering them to the driver.
- Not as good as having access to sound card's mixer but at least users
- will not complain about lacking of volume bar anymore! :)
- </para>
- </sect2>
-
- <sect2 id="stuttering">
- <title>Audio is stuttering and i see a lot of "metronom: fixing sound card drift by -2115 pts" on the console output</title>
- <para>
- Might be a soundcard problem, if it only comes in longer intervals.
- Your soundcard does not keep it's sampling frequency accurately
- enough, which results in audio and video
- getting out of sync and xine has to compensate. If you see the message
- only from time to time, you might remedy it by using the resampling sync
- method. You can do this by setting the configuration entry
- <parameter>audio.synchronization.av_sync_method</parameter> to <parameter>resample</parameter>.
- </para>
- <para>
- If you receive the metronom message more often,
- maybe switching to different drivers (alsa to oss or vise-versa)
- can help here. It has also been reported that setting the configuration
- entry <parameter>audio.synchronization.force_rate</parameter> to the native sampling
- rate of your soundcard (try 44100 and 48000) helps sometimes.
- </para>
- <para>
- Another, whole different possibility is that you have some background
- process running which is messing with the clock (like some ntp client &ndash;
- chrony, ntpd, &hellip;).
- </para>
- <para>
- Occasional messages of "fixing sound card drift" may happen on start and
- when playing a long stream (like a movie). This is normal behaviour,
- nothing to worry about.
- </para>
- </sect2>
-
- <sect2 id="soundloss">
- <title>xine seems to lose sound arbitrarily during playback, especially with DVDs</title>
- <para>
- You are using the OSS audio output plugin, right? In order to keep video and audio
- in sync, xine regularly queries the audio driver for the amount of delay induced by
- the current length of the driver's audio buffer. Unfortunately some OSS drivers seem
- to be broken because the can return strange values here. This confuses the xine audio
- subsystem and makes it drop audio.
- </para>
- <para>
- You should try the various settings of the
- configuration entry <parameter>audio.oss_sync_method</parameter>. The options
- <parameter>getodelay</parameter> and <parameter>getoptr</parameter> ask the driver and
- might therefore show the problem. But chances are that only one is broken and the other
- works, so you should try them both first, since they are the most accurate.
- The option <parameter>probebuffer</parameter> does not ask the driver directly but
- tries to determine the buffer length from outside. This should work with any driver
- and is the way to go, of the driver dependent methods fail.
- <parameter>softsync</parameter> is the least accurate and should be used only in
- emergency situations.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="video">
- <title>Video related questions</title>
-
- <sect2 id="novideo">
- <title>I can hear the audio &ndash; but I don't see a picture!</title>
- <para>
- Probably your hardware is simply too slow &ndash; see above for some
- hints on how to speed things up.
- </para>
- <para>
- Another possibility is that you using a buggy Xv driver, see the next
- questions.
- </para>
- </sect2>
-
- <sect2 id="bluescreen">
- <title>I only see a blue (or green or black) video image most of the time.</title>
- <para>
- You are either watching a very boring video (just kidding) or you are
- suffering from a bug in the Xorg 6.7 implementation of X11.
- </para>
- <para>
- The workaround is to add the line
- <programlisting>&nbsp;&nbsp;&nbsp;Option "XaaNoOffscreenPixmaps"</programlisting>
- in the <varname>Device</varname> section of your X server configuration (usually
- <filename>/etc/X11/xorg.conf</filename> or <filename>/etc/X11/XF86Config</filename>).
- </para>
- </sect2>
-
- <sect2 id="buggyxv">
- <title>The image looks strange, it is shifted, cropped or shows weird lines!</title>
- <para>
- This points to a problem with the Xv extension, which is used by xine
- to display the video image. To verify this, try running xine with the XShm
- video output plugin:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -V XShm</command></screen>
- </para>
- <para>
- If that works fine, you just proved, that the Xv extension is buggy. xine will
- remember the last used video output plugin, so the setting will stay at XShm.
- You could simply continue using this, but XShm is a lot slower than Xv, so
- read on and see if you can get it working. Usually you should look for
- updated versions of the X driver module that belongs to your graphics card.
- </para>
- <para>
- Other possibilites are limitations in either your X driver module or your
- graphics hardware. If your card could somehow be running out of ressources (graphics
- RAM perhaps) and displays an incorrect Xv overlay because of that, try reducing
- the display resolution and/or colour depth.
- </para>
- <para>
- Consult the next question for more details on Xv.
- </para>
- </sect2>
-
- <sect2 id="xvextension">
- <title>How can I make xine use the Xv extension and what drivers do I need?</title>
- <para>
- xine will normally use Xv by default if it is available. In some cases
- you might need to choose Xv playback manually (when the <filename>~/.xine/config</filename>
- file for some reason says that you want to use XShm):
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -V Xv</command></screen>
- </para>
- <para>
- If this doesn't work for you, it may be possible that Xv is not present
- on your system.
- </para>
- <para>
- First you need to install/use X.org or XFree 4.x. Once you got that you have to
- make sure the X drivers you're using are supporting Xv on your
- hardware. Here are some hints for individual gfx chips:
- <itemizedlist>
- <listitem>
- <para>
- 3Dfx: if all you get is a solid black window, upgrade to X.org or XFree 4.1.0 or later.
- </para>
- </listitem>
- <listitem>
- <para>
- ATI: if you only get "half a picture", try lowering your resolution
- or bit depth, disable DRI (looks like you ran out of video RAM)
- </para>
- </listitem>
- <listitem>
- <para>
- Trident card: If you see vertical bands jumbled, upgrade to the latest
- xfree/experimental trident drivers (for the CyberBlade XP
- a driver exists here:
- <ulink url="http://www.xfree86.org/~alanh/">http://www.xfree86.org/~alanh/ </ulink>)
- </para>
- </listitem>
- <listitem>
- <para>
- nVidia: With newer GeForce cards, Xv should work with XFree 4.2.0 or
- newer, for older RivaTNT cards use the binary drivers from nvidia
- (of course the binary drivers work as well for GeForce cards)
- </para>
- </listitem>
- <listitem>
- <para>
- Mach64/Rage3D (not Rage128/Radeon) cards/chips get no XVideo with
- standard drivers, try
- <ulink url="http://gatos.sourceforge.net/">GATOS drivers
- </ulink> instead
- </para>
- </listitem>
- <listitem>
- <para>
- intel: i815 has Xv support in XFree 4.x, others unknown
- </para>
- </listitem>
- <listitem>
- <para>
- Permedia 2/3 has Xv support in XFree 4.x
- </para>
- </listitem>
- <listitem>
- <para>
- Savage: at least some older drivers tend to lock up the whole machine,
- try the drivers available from
- <ulink url="http://www.probo.com/timr/savage40.html">
- http://www.probo.com/timr/savage40.html
- </ulink>.
- </para>
- </listitem>
- <listitem>
- <para>
- SIS: certain controllers (more info needed!) have Xv support in XFree 4.x
- </para>
- </listitem>
- <listitem>
- <para>
- Chips and Tech 6555x, 68554, 69000, 69030 have Xv support in XFree 4.x
- </para>
- </listitem>
- <listitem>
- <para>
- NeoMagic: certain controllers (more info needed!) have Xv support in Xfree 4.x
- </para>
- </listitem>
- <listitem>
- <para>
- SiliconMotion: certain controllers (more info needed!) have Xv support in Xfree 4.x
- </para>
- </listitem>
- <listitem>
- <para>
- Matrox: G200 or newer (but not Parhelia) have Xv support in XFree 4.x.
- For Parhelia, use the binary only drivers available from matrox' website.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
-
- <sect2 id="colorkey">
- <title>Some parts of my X Desktop get transparent when xine plays the video!</title>
- <para>
- Looks like some colours on your GUI match the colour key which Xv uses. You can
- change the colour key value to avoid this. There should be a line like:
- <programlisting>&nbsp;&nbsp;&nbsp;video.device.xv_colorkey:2110</programlisting>
- in your <filename>~/.xine/config</filename> file where you can change the colour that's used
- by xine for the video overlay.
- </para>
- </sect2>
-
- <sect2 id="texturedvideo">
- <title>How do I get Xv working with compiz?</title>
- <para>
- Tell xine to prefer textured video. There should be a line like:
- <programlisting>&nbsp;&nbsp;&nbsp;video.device.xv_preferred_method:Any</programlisting>
- in your <filename>~/.xine/config</filename> file where you can change the preferred method
- used by xine for the video overlay.
- </para>
- <para>
- It may be that your graphics card or driver doesn't have the necessary
- support for textured video, or the video is rendered too slowly.
- </para>
- <itemizedlist>
- <listitem><para>
- ATI: you are likely to need xf86-video-ati later than 6.8.0; 6.9.0.91
- or newer is recommended for slower/older hardware (&lt; X1300) because
- the rendering speed has been improved a lot.
- </para></listitem>
- <listitem><para>
- Intel: 945 and later, at least, should be fine with xf86-video-intel
- 2.0 or later. Certainly with 2.2 or later.
- </para></listitem>
- <listitem><para>
- nVidia: will probably be fine. (FIXME)
- </para></listitem>
- </itemizedlist>
- <para>
- If you find that textured video is significantly slower or isn't
- supported, you should either not use compiz or tell xine to use the
- xshm video output driver.
- </para>
- </sect2>
-
- <sect2 id="aspectratio">
- <title>The aspect ratio of the video is wrong!</title>
- <para>
- Usually xine discovers the screen aspect ratio by
- querying the X-server and then adjusts the video automatically
- to make it look right. However, if that doesn't work try
- pressing "a" to manually change the aspect ratio.
- </para>
- <para>
- If you have a wide screen monitor, make sure the X-server
- is correctly configured. The X-server must know the physical
- size of the screen, which is independent of the resolution
- being used.
- </para>
- <para>
- For X.org, the screen size should be set in the <parameter>"Monitor"</parameter>
- section in the file <filename>/etc/X11/xorg.conf</filename>, as in the example below:
- <programlisting>
-&nbsp;&nbsp;&nbsp;Section "Monitor"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Identifier "Monitor0"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VendorName "Monitor Vendor"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ModelName "DDC Probed Monitor - ViewSonic G773-2"
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DisplaySize 320 240
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HorizSync 30.0 - 70.0
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VertRefresh 50.0 - 180.0
-&nbsp;&nbsp;&nbsp;EndSection</programlisting>
- For XFree86, the filename is normally <filename>/etc/X11/XF86Config</filename>.
- </para>
- <para>
- Where <parameter>DisplaySize</parameter> specifies,
- in millimeters, the physical size of the monitor's picture area.
- </para>
- </sect2>
-
- <sect2 id="discardedskipped">
- <title>What is the difference between discarded and skipped frames?</title>
- <para>
- Sometimes xine will output a message like that:
- <programlisting>&nbsp;&nbsp;&nbsp;200 frames delivered, XX frames skipped, YY frames discarded</programlisting>
- </para>
- <para>
- The difference between these counters is a little subtle for the non
- developer. There are two threads running in order to display video:
- the decoder thread will deliver frames to the video output thread.
- The latter is responsible for scheduling the frames to be displayed at
- the right time.
- </para>
- <para>
- If your system can't keep up with decoding requirements, decoder will
- deliver overdue frames. Imagine if it finished decoding the frame
- tagged for displaying at 11:30 but xine clock marks 11:31. When this
- situation is detected, xine will try to skip decoding a few frames
- to recover. Not every decoder may support this feature.
- </para>
- <para>
- When the frame is decoded to be shown somewhere in future but the
- output thread doesn't get scheduled in time by the operating system
- to complete the operation, the frame is discarded. One cause might
- be the disk access operation, which may halt the system for a few
- miliseconds without DMA. See performance section tips above.
- </para>
- <para>
- Note that if a decoder can't skip frames for some reason, you would
- never see frames skipped (they would be all discarded).
- </para>
- </sect2>
-
- <sect2 id="contrastbrightnesssaturation">
- <title>My xine is runing in black and white! / I only get a grey video output!</title>
- <para>
- This frequently happens with new Xv drivers or when switching to a
- different video card. Background is that different Xv drivers often
- use different ranges for the contrast/brightness/saturation settings.
- </para>
- <para>
- To fix this, try opening the xine settings window and try adjusting
- the sliders for contrast, brightness and saturation.
- </para>
- <para>
- Please note that some frontends save these settings in their config file
- so when you have found a working combination, make sure you exit
- xine cleanly so the values are saved.
- </para>
- </sect2>
-
- <sect2 id="videodriver">
- <title>Which is the best video driver to use?</title>
- <para>
- xine supports several video drivers for outputing the image. These will
- differ on how the frames are copied to the video card memory, whether
- colourspace conversion and scaling is done in software or hardware, among
- other things. They may also differ on ease of use and stability.
- </para>
- <para>
- Most of the time, Xv should give the users a good trade-off between
- quality, compatibility and ease of use. This is why xine tries to use
- Xv by default.
- </para>
- <para>
- However some users may want to explore better the available hardware
- capabilities (eg. syncing frame drawing with monitor refresh).
- Also some Xv drivers contain slow copies and accessing the video card
- directly may yield performance gains.
- </para>
- <para>
- Drivers that access hardware directly includes VIDIX (warning: requires
- root priviledges or kernel helper) and SyncFB (requires kernel helper &ndash; Matrox only).
- User may try one of those, but should be warned that with root access
- they can cause the system to crash hard. The support is also limited to
- a couple of graphics cards only.
- </para>
- <para>
- Graphic workstations like SGI have usually a good support for OpenGL.
- In that case, using OpenGL may be a better choice than XShm. However for
- most desktop systems the performance of OpenGL will be quite bad.
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="overlay">
- <title>OSD and overlay related questions</title>
-
- <sect2 id="unscaledosd">
- <title>What is this "unscaled" OSD about?</title>
- <para>
- Since version 1-rc3 of xine-lib supports a new method for rendering OSD
- (On Screen Display) and subtitles. This method uses a X11 extension
- called XShape that allows using screen resolution instead of
- stream resolution. It is called "unscaled" OSD because it does not
- scales with the video being played.
- </para>
- <para>
- Suppose you are watching a 320x200 video in full screen. Normal OSD
- would be blended at 320x200 and then scaled to full screen (lets say,
- 1024x768), resulting in big and ugly fonts. The unscaled overlay is
- drawn directly to screen, creating a sharper and better looking OSD.
- </para>
- <para>
- There are side effects too. Sometimes the unscaled overlay show some
- glitch just before disappearing. Some people may be annoyed enough
- by that and might want to disable the usage of unscaled overlay
- altogether.
- </para>
- <para>
- Unscaled OSD usage by subtitles and xine-ui is controlled by
- the following settings
- (<filename>~/.xine/config</filename> or <filename>~/.gxine/config</filename>):
- <programlisting>&nbsp;&nbsp;&nbsp;gui.osd_use_unscaled:0</programlisting>
- <programlisting>&nbsp;&nbsp;&nbsp;subtitles.separate.use_unscaled_osd:0</programlisting>
- </para>
- </sect2>
-
- <sect2 id="noosd">
- <title>I can't see the OSD or it leaves a black box over the image!</title>
- <para>
- If you are using xine-lib version 1-rc3 or newer, this is probably
- due buggy XV drivers that do not support
- <link linkend="unscaledosd">unscaled OSD</link> (the XShape
- extension) properly.
- </para>
- <para>
- There have being reports of some ATI drivers that don't allow
- displaying anything over the video. The VIA Epia binary drivers
- is reported to leave a black box where the OSD was displayed.
- </para>
- <para>
- The problem may be fixed by either updating the video driver,
- or disabling xine unscaled OSD support.
- </para>
- </sect2>
-
- <sect2 id="overlaycolorleak">
- <title>Why colours of overlays/subtitles seem to be "leaking"?</title>
- <para>
- xine blends most overlays, specially the ones from DVD discs,
- directly over the image (scaled OSD). Unfortunately most codecs
- (like MPEG2) use a subsampled image format (YV12) that makes
- properly blending an interesting challenge.
- </para>
- <para>
- In short, this is a known xine bug. There have being discussions
- on improving the blending quality but, so far, nobody implemented
- a better (scaled) overlay renderer. Contact developers if you want
- to try doing something about it.
- </para>
- </sect2>
-
- <sect2 id="uglysubtitles">
- <title>Why external subtitles look so ugly?</title>
- <para>
- You are probably using a xine-lib version older than 1-rc3.
- Try upgrading your copy and read the
- <link linkend="unscaledosd">section about unscaled osd</link>.
- </para>
- </sect2>
-
- <sect2 id="subtitlesoutsidevideo">
- <title>Why subtitles can't be displayed outside the video?</title>
- <para>
- It is possible, but older xine versions may not support it. There are two
- alternatives for rendering the subtitles outside the video image:
- </para>
- <para>
- <itemizedlist>
- <listitem>
- <para>
- Use the "expand" post plugin to increase frame height adding
- black bars to it. This will allow blending the subtitles
- over the black bars, since they will be part of the video now.
- </para>
- </listitem>
- <listitem>
- <para>
- Use <link linkend="unscaledosd">unscaled OSD</link>, as it
- does not requires any video to render the subtitles on.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Also notice that DVD overlays (including subtitles) are meant to
- be displayed in a fixed position, this is how the DVD menu
- highlighting works. xine does not support moving them.
- </para>
- </sect2>
-
- <sect2 id="supportedfonts">
- <title>What kinds of subtitle fonts does xine use?</title>
- <para>
- xine can use two kinds of fonts:
- <itemizedlist>
- <listitem>
- <para>
- TTF fonts
- </para>
- <para>
- If xine is compiled with freetype library xine recognizes and uses TTF
- fonts directly.
- </para>
- </listitem>
- <listitem>
- <para>
- xine fonts
- </para>
- <para>
- This is xine's native format. It's better because the font
- generator utility implements more features than the "on the fly" TTF renderer.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- The font for text subtitles is selected via config option
- <parameter>subtitles.separate.font</parameter>. You can specify xine font name
- (<parameter>sans</parameter>, <parameter>serif</parameter>, &hellip;)
- or file name of the TTF font. The directories
- <filename>$prefix/share/xine/libxine1/fonts</filename> and
- <filename>~/.xine/fonts</filename> are searched for the fonts, with
- <filename>$prefix</filename> being the place xine-lib was installed to.
- Usually this is <filename>/usr/local</filename> or <filename>/usr</filename>.
- TTF fonts are also searched for in the current directory.
- </para>
- </sect2>
-
- <sect2 id="generatefonts">
- <title>How to create own xine subtitle fonts?</title>
- <para>
- xine's native subtitle fonts can be generated from TTF fonts with the
- utility <command>xine-fontconv</command>. It isn't compiled and installed by default but
- you can make it manually. You'll need freetype and zlib packages together with
- their versions for development plus a compiler, of course ;)
- Here's how you build <command>xine-fontconv</command>:
- <itemizedlist>
- <listitem>
- <para>
- Get the source of xine-fontconv utility from the <filename>misc</filename>
- directory within the xine-lib sources.
- </para>
- </listitem>
- <listitem>
- <para>
- Compile it:
- <screen>&nbsp;&nbsp;&nbsp;<command>gcc xine-fontconv.c -o xine-fontconv `freetype-config --cflags --libs` -lz</command></screen>
- </para>
- </listitem>
- </itemizedlist>
- You'll need some TTF font for generating. Characters in this font should
- cover all codepages you want supported, otherwise you'll have missing characters.
- </para>
- <para>
- Syntax is:
- <screen>&nbsp;&nbsp;&nbsp;<command>./xine-fontconf font.ttf font_name [encoding1 [encoding2 [&hellip;]]]</command></screen>
- </para>
- <para>
- For example default font <filename>sans</filename> was generated with
- following command:
- <screen>
-&nbsp;&nbsp;&nbsp;<command>./xine-fontconv Aril_Bold.ttf sans iso-8859-1 iso-8859-2 iso-8859-5 \
-&nbsp;&nbsp;&nbsp; iso-8859-9 iso-8859-15 cp1250 cp1251</command></screen>
- </para>
- <para>
- There are displayed messages about missing characters on the screen
- during generating. It's OK if the missing characters are U+007f..U+009F.
- These characters come from iso-8859-1 and they aren't displayable.
- </para>
- </sect2>
-
- <sect2 id="subencoding">
- <title>Encoding of external subtitles is bad. What is wrong?</title>
- <para>
- The encoding of the external subtitles is expected to be iso-8859-1 by
- default. You need to set an appropriate encoding in the config option
- <parameter>subtitles.separate.src_encoding</parameter>. Note that you also need
- a font which contains all characters from the given encoding.
- </para>
- <para>
- The default font <filename>sans</filename> and fonts
- <filename>serif</filename> and <filename>mono</filename> cover these
- encodings:
- <itemizedlist>
- <listitem><para>iso-8859-1</para></listitem>
- <listitem><para>iso-8859-2</para></listitem>
- <listitem><para>iso-8859-5</para></listitem>
- <listitem><para>iso-8859-9</para></listitem>
- <listitem><para>iso-8859-15</para></listitem>
- <listitem><para>windows-1250</para></listitem>
- <listitem><para>windows-1251</para></listitem>
- </itemizedlist>
- </para>
- </sect2>
-
- </sect1>
-
- <sect1 id="errors">
- <title>Error Messages: What they mean and what you can do</title>
-
- <sect2 id="xfreecrash">
- <title>Starting xine crashes X, I am logged out of my desktop!</title>
- <para>
- xine itself is unable to crash X, so when your X server just shuts down or
- restarts with the login screen, there is something wrong with your X setup.
- Most common are problems with the Xv extension. Try running xine with the XShm
- video output plugin:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -V XShm</command></screen>
- </para>
- <para>
- If that works fine, you just proved, that the Xv extension is buggy. xine will
- remember the last used video output plugin, so the setting will stay at XShm.
- You could simply continue using this, but XShm is a lot slower than Xv, so
- consult the <link linkend="xvextension">section on Xv</link> and see if you can
- get it working. Usually you should look for updated versions of the X driver
- module that belongs to your graphics card.
- </para>
- </sect2>
-
- <sect2 id="audiodrivererr">
- <title>Starting xine fails with complains about audio drivers/devices!</title>
- <para>
- You can select the audio driver using the -A option. So try:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -A null</command></screen>
- If you have ALSA drivers installed, try:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -A alsa</command></screen>
- If you run ESD (not recommended), try:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -A esd</command></screen>
- If you run artsd, try:
- <screen>&nbsp;&nbsp;&nbsp;<command>xine -A arts</command></screen>
- </para>
- </sect2>
-
- <sect2 id="novideoportfound">
- <title>"no video port found"</title>
- <para>
- You got the Xv extension, but your video card driver doesn't support it.
- First try to find a driver that does support Xv on your hardware (check
- your graphics card vendor). If your driver has Xv support but you can't
- get it working, try at a lower resolution (1024x768 is enough even for
- anamorphic DVDs).
- </para>
- <para>
- If all that fails, you can still use plain X11/XShm:
- <screen>&nbsp;&nbsp;&nbsp;<command>gxine -V XShm foo.vob</command></screen>
- </para>
- </sect2>
-
- <sect2 id="unabletoopendvddrive">
- <title>"Unable to open dvd drive (/dev/dvd)"</title>
- <para>
- You probably don't have /dev/dvd (check that). If so, simply create a
- link /dev/dvd that points to your DVD device. Something like&hellip;
- <screen>&nbsp;&nbsp;&nbsp;<command>ln -s hdc /dev/dvd</command></screen>
- &hellip; should do the job. Also make sure you have read and write access on
- the device the symlink points to.
- See the <link linkend="dvdplayback">dvd playback section</link>
- for more information.
- </para>
- </sect2>
-
- <sect2 id="status0x51">
- <title>My drive doesn't work and the kernel says "status=0x51 { DriveReady SeekComplete Error }"</title>
- <para>
- This error can be fixed by recompiling your kernel with the option
- "Use multi-mode by default" enabled in the IDE settings.
- </para>
- </sect2>
-
- <sect2 id="demuxerror0000">
- <title>"demux error! 00 00 00 (should be 0x000001)"</title>
- <para>
- Probably xine can't access your input source. Most commonly this happens
- when you're trying to play locked/encrypted DVDs. Remember that xine
- can't play such DVDs out-of-the box for legal reasons (see above).
- </para>
- <para>
- If it is legal where you live, you can try to install libdvdcss. Once
- you have done that and re-start xine, it should automatically detect
- and use it to play back encrypted DVDs.
- </para>
- <para>
- Another reason could be that your (RPC-2) DVD drive isn't set up
- for the right region (see above).
- </para>
- </sect2>
-
- <sect2 id="ossfailed">
- <title>"audio driver 'oss' failed, using null driver instead"</title>
- <para>
- First of all, make sure that your OSS Audio drivers are working (i.e.
- you can play music with other software). Maybe you're using alsa?
- If so, try <command>gxine -A alsa</command> to see if this helps.
- </para>
- <para>
- The most common reason for oss not working is that some other program is accesing
- your audio device. If you're using linux, the command <command>fuser /dev/dsp</command>
- should give you the PID of the process.
- </para>
- <para>
- If you are using GNOME, chances are that this is caused by ESD. Now you
- have two possibilities. Either deactivate ESD (temporarily) by right
- clicking on the sound monitor applet and selecting "Place Esound in
- standby" or just kill it. Then xine will use OSS audio output. The other
- method is to make xine use ESD for audio output with:
- <screen>&nbsp;&nbsp;&nbsp;<command>gxine -A esd</command></screen>
- This may result in worse playback &ndash; exact syncronization is not possible
- with esd, so using oss should be preferred.
- </para>
- <para>
- If you are using KDE, there is the possibility that the aRts sound
- daemon is currently running and thus blocking your sound device. You
- can check that by starting the aRts control (in your KDE menu it should
- be under Multimedia). If it is running, you can either use the aRts
- audio output plugin:
- <screen>&nbsp;&nbsp;&nbsp;<command>gxine -A arts</command></screen>
- Or you suspend the aRts daemon by checking the appropriate option in
- your aRts control. (recommended)
- </para>
- <para>
- Newer versions of arts have an auto-suspend mode &ndash; this can lead to
- some nondeterministic behaviour of xine if it is set up to use
- the audio device directly. Using arts is recommended in that case;
- however, you will lose the ability to do four/five channel audio output.
- </para>
- </sect2>
-
- <sect2 id="throwingawayimage">
- <title>"video_out: throwing away image with pts xxx because it's too old"</title>
- <para>
- This is a performance related problem.
- If you have a fast computer and this message is shown from time to
- time when playing a DVD or CD, it's very likely that DMA is not enabled
- for your drive.
- </para>
- </sect2>
-
- <sect2 id="novideopluginavailable">
- <title>"No video plugin available to decode 'xxxxxx'."</title>
- <para>
- You have tried to play a stream using a unknown or unhandled codec.
- Possibly the file uses some obscure proprietary format and no
- information is available on how to decode it.
- </para>
- <para>
- If you're on an x86 platform (e.g. PC hardware) you might want to
- try installing binary-only windows medial, real networks and
- quicktime codecs (see above).
- </para>
- </sect2>
-
- <sect2 id="decoderfailedtostart">
- <title>"w32codec: decoder failed to start. Is 'xxxxxx' installed?"</title>
- <para>
- You probably don't have the win32 dll needed to decode this file.
- </para>
- </sect2>
-
- <sect2 id="xinecrashed">
- <title>xine just crashed on me &ndash; i didn't get any error message</title>
- <para>
- OK, yes, that shouldn't happen and you're upset. We can understand that.
- But, to help you and of course to fix this, we need some information.
- So, let's go through the checklist and maybe prepare a nice bug report
- for the <ulink url="http://bugs.xine-project.org/">xine bug tracker</ulink>:
- <itemizedlist>
- <listitem>
- <para>
- Did xine really crash (segfault) or did it hang (deadlock)?
- </para>
- </listitem>
- <listitem>
- <para>
- Can you reproduce the bug? (e.g. do you remember what you
- did and when you do it again it crashes again?)
- </para>
- </listitem>
- <listitem>
- <para>
- Is that a specific media file or format which crashes xine? (Have you
- tried other files types?)
- </para>
- </listitem>
- <listitem>
- <para>
- Check the console output (and include it in a bug report), maybe earlier
- there is some output that points to the problem.
- </para>
- </listitem>
- <listitem>
- <para>
- Your X server just froze on you? unfortunately that's a known problem
- with some chipsets and drivers (most commonly Savage chipsets) when
- using Xv. You might want to try running <command>gxine -V XShm</command>
- to see if the problem is related to the Xv driver. This will unfortunately
- be much slower, as lots of things are now done in software instead of
- hardware scaling/colour space conversion.
- </para>
- <para>
- Maybe at the time you read this, there's an X upgrade which fixes
- this for the Savage driver. If that works for you, please notify the xine crew at
- <email>xine-user@lists.sourceforge.net</email>, so they can update this FAQ!
- </para>
- </listitem>
- <listitem>
- <para>
- Even though we try to make each release as bug free as possible, xine is
- still under heavy development (nice excuse, isn't it? *grin*).
- </para>
- <para>
- If you write to the <ulink url="http://bugs.xine-project.org/">xine bug tracker</ulink>
- make sure you include a the above information (when applicable)
- and also some information about your machine (operating system, cpu type and
- speed, gfx card, sound card, &hellip;) and please use a meaningfull subject
- line ("xine bug" is bad, "xine fails to play this quicktime trailer in fullscreen mode"
- ist much better).
- </para>
- <para>
- Thanks for taking the time to help improve xine.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
-
- </sect1>
-
- </article>
-
-</book>
diff --git a/doc/faq/faq.xsl b/doc/faq/faq.xsl
new file mode 100644
index 000000000..524600be1
--- /dev/null
+++ b/doc/faq/faq.xsl
@@ -0,0 +1,4 @@
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl" />
+<xsl:param name="generate.toc" select="'article toc'" />
+</xsl:stylesheet>
diff --git a/doc/hackersguide/Makefile.am b/doc/hackersguide/Makefile.am
index 02a433299..f117b9faa 100644
--- a/doc/hackersguide/Makefile.am
+++ b/doc/hackersguide/Makefile.am
@@ -1,39 +1,33 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
-hackersguide_sgml = hackersguide.sgml \
- intro.sgml \
- library.sgml \
- overview.sgml \
- internals.sgml \
- stream.sgml \
- output.sgml
-hackersguide_fig = architecture.fig \
- library.fig \
- overlays.fig \
- post_frame.fig
+hackersguide_docbook = hackersguide.docbook \
+ intro.docbook \
+ library.docbook \
+ overview.docbook \
+ internals.docbook \
+ stream.docbook \
+ output.docbook
+hackersguide_svg = architecture.svg \
+ library.svg \
+ overlays.svg \
+ post_frame.svg
+hackersguidedir = $(htmldir)/hackersguide
hackersguide_DATA = hackersguide.html \
architecture.png library.png overlays.png post_frame.png
-EXTRA_DIST = README $(hackersguide_sgml) $(hackersguide_fig) \
+EXTRA_DIST = README $(hackersguide_docbook) $(hackersguide_svg) \
$(hackersguide_DATA)
-hackersguidedir = $(htmldir)/hackersguide
+DISTCLEANFILES = $(hackersguide_DATA)
-docs: $(hackersguide_DATA)
+SUFFIXES = .png .fig
-distclean-local: clean-docs
-
-docs-prepare: $(addprefix $(srcdir)/, $(hackersguide_sgml))
- if test "$(srcdir)" != "." -a "$(srcdir)" != "`pwd`"; then \
- for file in $(hackersguide_sgml) ; do \
- test -f ./$$file -a ./$$file -nt $(srcdir)/$$file || cp $(srcdir)/$$file .; \
- done ; \
- fi
+docs: $(hackersguide_DATA)
clean-docs:
rm -f $(hackersguide_DATA)
- test "x$(srcdir)" = x. || rm -f $(hackersguide_sgml) *.fig
dist-hook:
@if test x"$(distcheck_lax)" = x ; then \
@@ -42,36 +36,44 @@ dist-hook:
$(MAKE) docs ; \
fi
-if HAVE_SGMLTOOLS
-hackersguide.html: $(hackersguide_sgml)
- @$(MAKE) docs-prepare
- $(SGMLTOOLS) -b onehtml hackersguide.sgml;
+distclean-local: clean-docs
+
+AM_V_FAKE = $(am__v_FAKE_$(V))
+am__v_FAKE_ = $(am__v_FAKE_$(AM_DEFAULT_VERBOSITY))
+am__v_FAKE_0 = @echo " FAKE " $@;
+
+if HAVE_XMLTO
+hackersguide.html: $(hackersguide_docbook)
+ $(AM_V_GEN)xmlto xhtml-nochunks "$(srcdir)/hackersguide.docbook"
else
-hackersguide.html: $(hackersguide_sgml)
- @$(MAKE) docs-prepare
- if test x"$(fail_if_missing)" = x"yes"; then \
- echo "Please install sgmltools-lite."; \
+hackersguide.html: $(hackersguide_docbook)
+ $(AM_V_FAKE)if test x"$(fail_if_missing)" = x"yes"; then \
+ echo "Please install xmlto."; \
exit 1; \
- fi
+ fi; \
if test x"$(fail_if_missing)" != x"yes"; then \
touch $@; \
sleep 1; \
- touch $(notdir $^); \
+ touch $^; \
fi
endif
+ $(AM_V_at)$(SED) -i -e '/<img [^>]*alt=/! s/<img /<img alt="" /g' $@ # we want valid XHTML 1.1
-if HAVE_FIG2DEV
-%.png: %.fig
- $(FIG2DEV) -L png -S 4 $< $@;
+if HAVE_RSVG
+.svg.png:
+ $(AM_V_GEN)rsvg -f png $^ $@
+if HAVE_OPTIPNG
+ $(AM_V_at)optipng -quiet $@
+endif
else
-%.png: %.fig
- if test x"$(fail_if_missing)" = x"yes"; then \
- echo "Please install fig2dev."; \
+.svg.png:
+ $(AM_V_FAKE)if test x"$(fail_if_missing)" = x"yes"; then \
+ echo "Please install rsvg."; \
exit 1; \
- fi
+ fi; \
if test x"$(fail_if_missing)" != x"yes"; then \
touch $@; \
sleep 1; \
- touch $(notdir $^); \
+ touch $^; \
fi
endif
diff --git a/doc/hackersguide/architecture.fig b/doc/hackersguide/architecture.fig
deleted file mode 100644
index 9e420bf42..000000000
--- a/doc/hackersguide/architecture.fig
+++ /dev/null
@@ -1,560 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Metric
-A4
-100.00
-Single
--2
-1200 2
-6 2520 3915 3555 4950
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 2520 3915 3555 3915 3555 4950 2520 4950 2520 3915
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 2520 4140 3555 4140
-4 0 0 50 0 20 11 0.0000 4 150 945 2565 4680 demuxer plugin\001
-4 0 0 50 0 20 11 0.0000 4 150 840 2655 4095 demuxer loop\001
--6
-6 4500 3735 6300 5355
-6 5715 4500 6075 4770
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5715 4500 6075 4500 6075 4770 5715 4770 5715 4500
-4 0 0 50 0 20 11 0.0000 4 120 195 5805 4680 buf\001
--6
-6 4680 4005 5040 4275
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4680 4005 5040 4005 5040 4275 4680 4275 4680 4005
-4 0 0 50 0 20 11 0.0000 4 120 195 4770 4185 buf\001
--6
-6 4860 4320 5220 4590
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4860 4320 5220 4320 5220 4590 4860 4590 4860 4320
-4 0 0 50 0 20 11 0.0000 4 120 195 4950 4500 buf\001
--6
-6 5220 4680 5580 4950
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5220 4680 5580 4680 5580 4950 5220 4950 5220 4680
-4 0 0 50 0 20 11 0.0000 4 120 195 5310 4860 buf\001
--6
-6 5355 4095 5715 4365
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5355 4095 5715 4095 5715 4365 5355 4365 5355 4095
-4 0 0 50 0 20 11 0.0000 4 120 195 5445 4275 buf\001
--6
-6 4635 4635 4995 4905
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4635 4635 4995 4635 4995 4905 4635 4905 4635 4635
-4 0 0 50 0 20 11 0.0000 4 120 195 4725 4815 buf\001
--6
-6 5805 3960 6165 4230
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5805 3960 6165 3960 6165 4230 5805 4230 5805 3960
-4 0 0 50 0 20 11 0.0000 4 120 195 5895 4140 buf\001
--6
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4500 3735 6300 3735 6300 5355 4500 5355 4500 3735
-4 0 0 50 0 20 11 0.0000 4 150 660 5085 5265 buffer pool\001
--6
-6 1260 4230 2160 4770
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 1260 4230 2160 4230 2160 4770 1260 4770 1260 4230
-4 0 0 50 0 20 11 0.0000 4 150 705 1350 4545 input plugin\001
--6
-6 1710 3735 2070 4005
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 1710 3735 2070 3735 2070 4005 1710 4005 1710 3735
-4 0 0 20 0 20 11 0.0000 4 120 195 1800 3915 buf\001
--6
-6 3915 4320 4275 4590
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 3915 4320 4275 4320 4275 4590 3915 4590 3915 4320
-4 0 0 20 0 20 11 0.0000 4 120 195 4005 4500 buf\001
--6
-6 6525 5130 6885 5400
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 6525 5130 6885 5130 6885 5400 6525 5400 6525 5130
-4 0 0 20 0 20 11 0.0000 4 120 195 6615 5310 buf\001
--6
-6 6525 3555 6885 3825
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 6525 3555 6885 3555 6885 3825 6525 3825 6525 3555
-4 0 0 20 0 20 11 0.0000 4 120 195 6615 3735 buf\001
--6
-6 7335 5265 7695 5535
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 7335 5265 7695 5265 7695 5535 7335 5535 7335 5265
-4 0 0 20 0 20 11 0.0000 4 120 255 7425 5445 disc\001
--6
-6 7290 3375 7650 3645
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 7290 3375 7650 3375 7650 3645 7290 3645 7290 3375
-4 0 0 20 0 20 11 0.0000 4 120 255 7380 3555 disc\001
--6
-6 8865 5085 9225 5355
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 8865 5085 9225 5085 9225 5355 8865 5355 8865 5085
-4 0 0 20 0 20 11 0.0000 4 150 195 8955 5265 pts\001
--6
-6 9180 5985 9540 6255
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 9180 5985 9540 5985 9540 6255 9180 6255 9180 5985
-4 0 0 20 0 20 11 0.0000 4 150 270 9270 6165 vpts\001
--6
-6 8910 3645 9270 3915
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 8910 3645 9270 3645 9270 3915 8910 3915 8910 3645
-4 0 0 20 0 20 11 0.0000 4 150 195 9000 3825 pts\001
--6
-6 7380 4050 8865 4950
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 7380 4050 8865 4050 8865 4950 7380 4950 7380 4050
-4 0 0 50 0 20 11 0.0000 4 120 630 7830 4545 metronom\001
--6
-6 8505 3555 8865 3825
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 8505 3555 8865 3555 8865 3825 8505 3825 8505 3555
-4 0 0 20 0 20 11 0.0000 4 150 195 8595 3735 pts\001
--6
-6 8010 3330 8370 3600
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 8010 3330 8370 3330 8370 3600 8010 3600 8010 3330
-4 0 0 20 0 20 11 0.0000 4 150 270 8100 3510 vpts\001
--6
-6 1170 1575 9900 7425
-2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9855 1620 1215 1620 1215 7380 9855 7380 9855 1620
-4 0 0 50 0 20 11 0.0000 4 135 735 1350 1800 xine stream\001
--6
-6 1215 270 9900 540
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 1215 270 9900 270 9900 540 1215 540 1215 270
-4 0 0 50 0 20 11 0.0000 4 150 780 4590 450 stream layer\001
--6
-6 6795 630 9900 900
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 6795 630 9900 630 9900 900 6795 900 6795 630
-4 0 0 50 0 20 11 0.0000 4 150 840 7965 810 decoder layer\001
--6
-6 3915 630 6705 900
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 3915 630 6705 630 6705 900 3915 900 3915 630
-4 0 0 50 0 20 11 0.0000 4 135 750 5040 810 stream fifos\001
--6
-6 2340 630 3825 900
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 2340 630 3825 630 3825 900 2340 900 2340 630
-4 0 0 50 0 20 11 0.0000 4 150 885 2655 810 demuxer layer\001
--6
-6 1215 630 2250 900
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 1215 630 2250 630 2250 900 1215 900 1215 630
-4 0 0 50 0 20 11 0.0000 4 150 645 1395 810 input layer\001
--6
-6 11295 4050 12780 4950
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 11295 4050 12780 4050 12780 4950 11295 4950 11295 4050
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 12780 4500 11700 4500
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 0 0 3
- 11700 4950 11700 4320 12780 4320
-4 0 0 50 0 20 11 0.0000 4 135 1005 11430 4275 metronom clock\001
-4 0 0 50 0 20 11 0.0000 4 150 975 11745 4455 clock sync loop\001
-4 0 0 50 0 20 11 0.0000 4 150 600 11745 4770 scr plugin\001
--6
-6 11295 5220 11655 5490
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 11295 5220 11655 5220 11655 5490 11295 5490 11295 5220
-4 0 0 20 0 20 11 0.0000 4 120 270 11385 5400 time\001
--6
-6 11295 3555 11655 3825
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 11295 3555 11655 3555 11655 3825 11295 3825 11295 3555
-4 0 0 20 0 20 11 0.0000 4 120 270 11385 3735 time\001
--6
-6 9990 270 12870 540
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 270 12870 270 12870 540 9990 540 9990 270
-4 0 0 50 0 20 11 0.0000 4 150 735 11075 450 output layer\001
--6
-6 10035 1620 10845 7290
-6 10260 4275 10710 4680
-4 0 0 40 0 20 11 0.0000 4 150 270 10260 4410 post\001
-4 0 0 40 0 20 11 0.0000 4 150 435 10260 4635 plugins\001
--6
-2 2 0 1 0 7 50 0 20 0.000 0 0 -1 0 0 5
- 10125 1620 10845 1620 10845 7200 10125 7200 10125 1620
-2 2 0 1 0 7 60 0 20 0.000 0 0 -1 0 0 5
- 10080 1665 10800 1665 10800 7245 10080 7245 10080 1665
-2 2 0 1 0 7 70 0 20 0.000 0 0 -1 0 0 5
- 10035 1710 10755 1710 10755 7290 10035 7290 10035 1710
--6
-6 11070 900 12870 1620
-2 2 0 1 0 7 50 0 -1 3.000 0 0 -1 0 0 5
- 11070 1620 12870 1620 12870 900 11070 900 11070 1620
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 11655 900 11655 1620
-4 0 0 50 0 20 11 0.0000 4 150 1035 11790 1305 overlay manager\001
-4 0 0 50 0 20 11 0.0000 4 120 300 11205 1305 OSD\001
--6
-6 11115 1845 11475 2115
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 11115 1845 11475 1845 11475 2115 11115 2115 11115 1845
-4 0 0 20 0 20 11 0.0000 4 120 225 11205 2025 spu\001
--6
-6 9360 4545 9720 4815
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 9360 4545 9720 4545 9720 4815 9360 4815 9360 4545
-4 0 0 20 0 20 11 0.0000 4 150 195 9450 4725 pts\001
--6
-6 8100 5130 8460 5400
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 8100 5130 8460 5130 8460 5400 8100 5400 8100 5130
-4 0 0 20 0 20 11 0.0000 4 150 270 8190 5310 vpts\001
--6
-6 9450 3150 9810 3420
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 9450 3150 9810 3150 9810 3420 9450 3420 9450 3150
-4 0 0 20 0 20 11 0.0000 4 150 270 9540 3330 vpts\001
--6
-6 7920 3645 8280 3915
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 7920 3645 8280 3645 8280 3915 7920 3915 7920 3645
-4 0 0 20 0 20 11 0.0000 4 150 270 8010 3825 vpts\001
--6
-6 9360 4140 9720 4410
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 9360 4140 9720 4140 9720 4410 9360 4410 9360 4140
-4 0 0 20 0 20 11 0.0000 4 150 195 9450 4320 pts\001
--6
-6 1485 8550 3375 8730
-2 1 2 1 0 7 50 0 -1 1.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 1485 8640 2025 8640
-4 0 0 50 0 20 11 0.0000 4 150 1170 2205 8685 extra info datapath\001
--6
-6 1485 8235 3285 8415
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 1485 8325 2025 8325
-4 0 0 50 0 20 11 0.0000 4 150 1065 2205 8370 detailed datapath\001
--6
-6 1485 7920 2745 8100
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 1485 8010 2025 8010
-4 0 0 50 0 20 11 0.0000 4 150 540 2205 8055 datapath\001
--6
-6 4095 7875 5445 8145
-6 4095 7875 4455 8145
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 4095 7875 4455 7875 4455 8145 4095 8145 4095 7875
-4 0 0 20 0 20 11 0.0000 4 120 195 4185 8055 buf\001
--6
-4 0 0 50 0 20 11 0.0000 4 135 660 4770 8055 xine buffer\001
--6
-6 4095 8190 5580 8460
-6 4095 8190 4455 8460
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 4095 8190 4455 8190 4455 8460 4095 8460 4095 8190
-4 0 0 20 0 20 11 0.0000 4 120 255 4185 8370 disc\001
--6
-4 0 0 50 0 20 11 0.0000 4 150 780 4770 8370 discontinuity\001
--6
-6 4095 8505 6255 8775
-6 4095 8505 4455 8775
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 4095 8505 4455 8505 4455 8775 4095 8775 4095 8505
-4 0 0 20 0 20 11 0.0000 4 150 195 4185 8685 pts\001
--6
-4 0 0 50 0 20 11 0.0000 4 150 1470 4770 8685 presentation timestamp\001
--6
-6 6930 7875 9495 8145
-6 6930 7875 7290 8145
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 6930 7875 7290 7875 7290 8145 6930 8145 6930 7875
-4 0 0 20 0 20 11 0.0000 4 150 270 7020 8055 vpts\001
--6
-4 0 0 50 0 20 11 0.0000 4 150 1890 7605 8055 virtual presentation timestamp\001
--6
-6 6930 8190 8550 8460
-6 6930 8190 7290 8460
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 6930 8190 7290 8190 7290 8460 6930 8460 6930 8190
-4 0 0 20 0 20 11 0.0000 4 120 225 7020 8370 spu\001
--6
-4 0 0 50 0 20 11 0.0000 4 150 915 7605 8370 subpicture unit\001
--6
-6 4230 2385 6390 3015
-6 4320 2430 4680 2700
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4320 2430 4680 2430 4680 2700 4320 2700 4320 2430
-4 0 0 50 0 20 11 0.0000 4 120 195 4410 2610 buf\001
--6
-6 5940 2430 6300 2700
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5940 2430 6300 2430 6300 2700 5940 2700 5940 2430
-4 0 0 50 0 20 11 0.0000 4 120 195 6030 2610 buf\001
--6
-6 5220 2430 5580 2700
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5220 2430 5580 2430 5580 2700 5220 2700 5220 2430
-4 0 0 50 0 20 11 0.0000 4 120 195 5310 2610 buf\001
--6
-6 4770 2430 5130 2700
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4770 2430 5130 2430 5130 2700 4770 2700 4770 2430
-4 0 0 50 0 20 11 0.0000 4 120 195 4860 2610 buf\001
--6
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 4365 2475 10 10 4355 2475 4375 2475
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 4815 2475 10 10 4805 2475 4825 2475
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 5265 2475 10 10 5255 2475 5275 2475
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 5985 2475 10 10 5975 2475 5995 2475
-2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
- 4230 2385 6390 2385 6390 3015 4230 3015 4230 2385
-4 0 0 50 0 20 11 0.0000 4 135 570 5040 2925 video fifo\001
-4 0 0 50 0 20 11 0.0000 4 30 135 5715 2610 ...\001
--6
-6 4230 5985 6390 6615
-6 4320 6030 4680 6300
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4320 6030 4680 6030 4680 6300 4320 6300 4320 6030
-4 0 0 50 0 20 11 0.0000 4 120 195 4410 6210 buf\001
--6
-6 5940 6030 6300 6300
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5940 6030 6300 6030 6300 6300 5940 6300 5940 6030
-4 0 0 50 0 20 11 0.0000 4 120 195 6030 6210 buf\001
--6
-6 5220 6030 5580 6300
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 5220 6030 5580 6030 5580 6300 5220 6300 5220 6030
-4 0 0 50 0 20 11 0.0000 4 120 195 5310 6210 buf\001
--6
-6 4770 6030 5130 6300
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4770 6030 5130 6030 5130 6300 4770 6300 4770 6030
-4 0 0 50 0 20 11 0.0000 4 120 195 4860 6210 buf\001
--6
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 4355 6075 10 10 4345 6075 4365 6075
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 4815 6075 10 10 4805 6075 4825 6075
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 5265 6075 10 10 5255 6075 5275 6075
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 5985 6075 10 10 5975 6075 5995 6075
-2 2 0 1 0 7 50 0 -1 4.000 0 0 -1 0 0 5
- 4230 5985 6390 5985 6390 6615 4230 6615 4230 5985
-4 0 0 50 0 20 11 0.0000 4 135 570 5040 6525 audio fifo\001
-4 0 0 50 0 20 11 0.0000 4 30 135 5715 6210 ...\001
--6
-6 3735 5310 4095 5580
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 3770 5355 10 10 3760 5355 3780 5355
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 3735 5310 4095 5310 4095 5580 3735 5580 3735 5310
-4 0 0 20 0 20 11 0.0000 4 120 195 3825 5490 buf\001
--6
-6 3735 3330 4095 3600
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 3780 3375 10 10 3770 3375 3790 3375
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 3735 3330 4095 3330 4095 3600 3735 3600 3735 3330
-4 0 0 20 0 20 11 0.0000 4 120 195 3825 3510 buf\001
--6
-6 6525 2565 6885 2835
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 6570 2600 10 10 6560 2600 6580 2600
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 6525 2565 6885 2565 6885 2835 6525 2835 6525 2565
-4 0 0 20 0 20 11 0.0000 4 120 195 6615 2745 buf\001
--6
-6 6525 6165 6885 6435
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 6570 6210 10 10 6560 6210 6580 6210
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 6525 6165 6885 6165 6885 6435 6525 6435 6525 6165
-4 0 0 20 0 20 11 0.0000 4 120 195 6615 6345 buf\001
--6
-6 7065 5850 8865 6750
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 7145 5895 10 10 7135 5895 7155 5895
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 7065 5850 8865 5850 8865 6750 7065 6750 7065 5850
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 7425 6750 7425 6120 8865 6120
-4 0 0 50 0 20 11 0.0000 4 150 1170 7200 6030 audio decoder loop\001
-4 0 0 50 0 20 11 0.0000 4 150 1275 7515 6480 audio decoder plugin\001
--6
-6 7065 2250 8865 3150
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 7110 2295 10 10 7100 2295 7120 2295
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 7065 2250 8865 2250 8865 3150 7065 3150 7065 2250
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 7425 3150 7425 2880 8865 2880
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
- 8865 2790 7425 2790 7425 2520 8865 2520
-4 0 0 50 0 20 11 0.0000 4 150 1170 7200 2430 video decoder loop\001
-4 0 0 50 0 20 11 0.0000 4 150 1170 7515 3060 spu decoder plugin\001
-4 0 0 50 0 20 11 0.0000 4 150 1275 7515 2700 video decoder plugin\001
--6
-6 9045 2340 9720 2610
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 9090 2385 10 10 9080 2385 9100 2385
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 9045 2340 9720 2340 9720 2610 9045 2610 9045 2340
-4 0 0 20 0 20 11 0.0000 4 120 435 9135 2520 frames\001
--6
-6 9045 6480 9720 6750
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 9080 6525 10 10 9070 6525 9090 6525
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 9045 6480 9720 6480 9720 6750 9045 6750 9045 6480
-4 0 0 20 0 20 11 0.0000 4 150 525 9135 6660 samples\001
--6
-6 11070 5850 12870 6750
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 11070 5850 12870 5850 12870 6750 11070 6750 11070 5850
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 11430 6750 11430 6120 12870 6120
-2 1 0 1 0 7 50 0 -1 1.000 0 0 -1 0 0 2
- 12240 5850 12240 6120
-4 0 0 50 0 20 11 0.0000 4 150 870 11205 6030 audio out loop\001
-4 0 0 50 0 20 11 0.0000 4 150 975 11520 6480 audio out plugin\001
-4 0 0 50 0 20 11 0.0000 4 135 435 12330 6030 out fifo\001
--6
-6 11070 2250 12870 3150
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 11070 2250 12870 2250 12870 3150 11070 3150 11070 2250
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 11430 3150 11430 2520 12870 2520
-2 1 0 1 0 7 50 0 -1 1.000 0 0 -1 0 0 2
- 12240 2250 12240 2520
-4 0 0 50 0 20 11 0.0000 4 150 870 11205 2430 video out loop\001
-4 0 0 50 0 20 11 0.0000 4 150 975 11520 2880 video out plugin\001
-4 0 0 50 0 20 11 0.0000 4 135 435 12330 2430 out fifo\001
--6
-6 11565 1620 12510 2250
-6 11700 1800 12375 2070
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 11700 1800 12375 1800 12375 2070 11700 2070 11700 1800
-4 0 0 20 0 20 11 0.0000 4 120 435 11790 1980 frames\001
--6
-3 2 0 1 0 7 50 0 -1 3.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 12060 2250 11565 1935 12060 1620
- 0.000 -1.000 0.000
-3 2 0 1 0 7 50 0 -1 3.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 12060 1620 12510 1935 12060 2250
- 0.000 -1.000 0.000
--6
-1 4 0 1 0 0 10 0 20 0.000 1 0.0000 7110 8640 10 10 7100 8640 7120 8640
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 7155 5850 6300 4500
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 4500 4500 3555 4500
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 2160 4500 2520 4500
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 57.26 114.51
- 3555 4500 4230 6300
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 6390 2700 7065 2700
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 57.26 114.51
- 3555 4500 4230 2700
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 6390 6300 7065 6300
-2 1 0 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 7155 3150 6300 4500
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 7290 3150 7965 4050
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 7290 5850 7965 4950
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 8550 3150 8550 4050
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 8325 4050 8325 3150
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 1215 1845 2205 1845 2205 1620
-2 1 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 2295 7560 2295 585
-2 1 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 3870 7560 3870 585
-2 1 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 6750 7560 6750 585
-2 1 1 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 9945 7560 9945 270
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 11520 4950 11250 5850
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 11520 4050 11250 3150
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 1 1 2
- 0 0 1.00 60.00 120.00
- 0 0 1.00 60.00 120.00
- 8865 6570 11070 6570
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 1 1 2
- 0 0 1.00 60.00 120.00
- 0 0 1.00 60.00 120.00
- 8865 2565 11070 2565
-2 1 0 1 0 7 50 0 -1 3.000 0 0 -1 1 1 3
- 0 0 1.00 60.00 120.00
- 0 0 1.00 60.00 120.00
- 8865 3060 9720 3060 11655 1620
-3 2 1 1 0 7 50 0 -1 4.000 0 1 0 5
- 0 0 1.00 60.00 120.00
- 4500 4365 3060 4365 2025 3915 1530 4275 2520 4365
- 0.000 -1.000 -1.000 -1.000 0.000
-3 2 0 1 0 7 50 0 -1 0.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 8865 6210 9290 5502 8865 4860
- 0.000 -1.000 0.000
-3 2 0 1 0 7 50 0 -1 0.000 0 0 1 3
- 0 0 1.00 60.00 120.00
- 8865 6390 9450 5490 8865 4725
- 0.000 -1.000 0.000
-3 2 0 1 0 7 50 0 -1 0.000 0 0 1 3
- 0 0 1.00 60.00 120.00
- 8865 4140 9405 3510 8865 2700
- 0.000 -1.000 0.000
-3 2 0 1 0 7 50 0 -1 0.000 0 0 1 3
- 0 0 1.00 60.00 120.00
- 8865 2610 9540 3510 8865 4275
- 0.000 -1.000 0.000
-3 2 1 1 0 7 50 0 -1 4.000 0 1 0 8
- 0 0 1.00 60.00 120.00
- 8865 6480 10485 6300 11160 5850 10890 5130 9720 4635 8730 4725
- 8190 5490 8595 6120
- 0.000 -1.000 -1.000 -1.000 -1.000 -1.000 -1.000 0.000
-3 2 1 1 0 7 50 0 -1 4.000 0 1 0 7
- 0 0 1.00 60.00 120.00
- 8865 2700 10665 2745 11160 3375 10215 4230 8730 4275 7920 3780
- 7740 3150
- 0.000 -1.000 -1.000 -1.000 -1.000 -1.000 0.000
-3 2 2 1 0 7 50 0 -1 1.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 3285 4950 3285 5445 3735 5355
- 0.000 -1.000 0.000
-3 2 2 1 0 7 50 0 -1 1.000 0 1 0 4
- 0 0 1.00 60.00 120.00
- 3555 4185 3735 3825 3330 3510 3780 3375
- 0.000 -1.000 -1.000 0.000
-3 2 2 1 0 7 50 0 -1 1.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 6570 6210 6570 5940 7065 5895
- 0.000 -1.000 0.000
-3 2 2 1 0 7 50 0 -1 1.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 6570 2610 6570 2295 7065 2295
- 0.000 -1.000 0.000
-3 2 2 1 0 7 50 0 -1 1.000 0 1 0 3
- 0 0 1.00 60.00 120.00
- 7155 2250 8190 1845 9090 2385
- 0.000 -1.000 0.000
-3 2 2 1 0 7 50 0 -1 1.000 0 1 0 4
- 0 0 1.00 60.00 120.00
- 7110 5940 6975 6795 8010 7290 9090 6570
- 0.000 -1.000 -1.000 0.000
-4 0 0 50 0 20 11 0.0000 4 135 585 7605 8685 extra info\001
diff --git a/doc/hackersguide/architecture.svg b/doc/hackersguide/architecture.svg
new file mode 100644
index 000000000..ae610a0ea
--- /dev/null
+++ b/doc/hackersguide/architecture.svg
@@ -0,0 +1,2134 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Creator: fig2dev Version 3.2 Patchlevel 5 -->
+<!-- CreationDate: Sat Jun 2 20:46:36 2007 -->
+<!-- Magnification: 1.050 -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="10.2in"
+ height="7.5in"
+ viewBox="1252 270 12271 8954"
+ id="svg3541"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ sodipodi:docname="architecture.svg"
+ sodipodi:docbase="/home/flame/devel/repos/xine/xine-lib-1.2-newdocbook/doc/hackersguide"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata4074">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4072" />
+ <sodipodi:namedview
+ inkscape:window-height="611"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.60296296"
+ inkscape:cx="459"
+ inkscape:cy="337.5"
+ inkscape:window-x="0"
+ inkscape:window-y="330"
+ inkscape:current-layer="svg3541" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1"
+ id="rect4076"
+ width="12503.331"
+ height="9244.4844"
+ x="1185.4929"
+ y="146.92683" />
+ <g
+ style="stroke-width:.025in; stroke:black; fill:none"
+ id="g3543">
+<!-- Line: box --> <rect
+ x="10535"
+ y="1795"
+ width="755"
+ height="5858"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3545" />
+<!-- Line: box --> <rect
+ x="10582"
+ y="1748"
+ width="755"
+ height="5858"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3547" />
+<!-- Line: box --> <rect
+ x="2645"
+ y="4110"
+ width="1086"
+ height="1086"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3549" />
+<!-- Line --> <polyline
+ points="2645,4346 3732,4346 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3551" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2692"
+ y="4913"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3553">demuxer plugin</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="4299"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3555">demuxer loop</text>
+<!-- Line: box --> <rect
+ x="6000"
+ y="4724"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3557" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6094"
+ y="4913"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3559">buf</text>
+<!-- Line: box --> <rect
+ x="4913"
+ y="4204"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3561" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5007"
+ y="4393"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3563">buf</text>
+<!-- Line: box --> <rect
+ x="5102"
+ y="4535"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3565" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5196"
+ y="4724"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3567">buf</text>
+<!-- Line: box --> <rect
+ x="5480"
+ y="4913"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3569" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5574"
+ y="5102"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3571">buf</text>
+<!-- Line: box --> <rect
+ x="5622"
+ y="4299"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3573" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5716"
+ y="4488"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3575">buf</text>
+<!-- Line: box --> <rect
+ x="4866"
+ y="4866"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3577" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4960"
+ y="5055"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3579">buf</text>
+<!-- Line: box --> <rect
+ x="6094"
+ y="4157"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3581" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6188"
+ y="4346"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3583">buf</text>
+<!-- Line: box --> <rect
+ x="4724"
+ y="3921"
+ width="1889"
+ height="1700"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3585" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5338"
+ y="5527"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3587">buffer pool</text>
+<!-- Line: box --> <rect
+ x="1322"
+ y="4440"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3589" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1417"
+ y="4771"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3591">input plugin</text>
+<!-- Line: box --> <rect
+ x="7748"
+ y="4251"
+ width="1559"
+ height="944"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3593" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8220"
+ y="4771"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3595">metronom</text>
+<!-- Line: box --> <rect
+ x="1275"
+ y="1700"
+ width="9070"
+ height="6047"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3597" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1417"
+ y="1889"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3599">xine stream</text>
+<!-- Line: box --> <rect
+ x="1275"
+ y="283"
+ width="9118"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3601" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4818"
+ y="472"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3603">stream layer</text>
+<!-- Line: box --> <rect
+ x="7133"
+ y="661"
+ width="3259"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3605" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8362"
+ y="850"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3607">decoder layer</text>
+<!-- Line: box --> <rect
+ x="4110"
+ y="661"
+ width="2929"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3609" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5291"
+ y="850"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3611">stream fifos</text>
+<!-- Line: box --> <rect
+ x="2456"
+ y="661"
+ width="1559"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3613" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="850"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3615">demuxer layer</text>
+<!-- Line: box --> <rect
+ x="1275"
+ y="661"
+ width="1086"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3617" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1464"
+ y="850"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3619">input layer</text>
+<!-- Line: box --> <rect
+ x="11858"
+ y="4251"
+ width="1559"
+ height="944"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3621" />
+<!-- Line --> <polyline
+ points="13417,4724 12283,4724 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3623" />
+<!-- Line --> <polyline
+ points="12283,5196 12283,4535 13417,4535 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3625" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12000"
+ y="4488"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3627">metronom clock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12330"
+ y="4677"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3629">clock sync loop</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12330"
+ y="5007"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3631">scr plugin</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="283"
+ width="3023"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3633" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11627"
+ y="472"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3635">output layer</text>
+<!-- Line: box --> <rect
+ x="10629"
+ y="1700"
+ width="755"
+ height="5858"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3637" />
+<!-- Line: box --> <rect
+ x="11622"
+ y="944"
+ width="1889"
+ height="755"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3639" />
+<!-- Line --> <polyline
+ points="12236,944 12236,1700 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3641" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12377"
+ y="1370"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3643">overlay manager</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11763"
+ y="1370"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3645">OSD</text>
+<!-- Line --> <polyline
+ points="1559,9070 2108,9070 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3647" />
+<!-- Arrowhead on XXXpoint 1559 9070 - 2141 9070--> <polyline
+ points="1997 9102 2123 9070 1997 9039 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3649" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2314"
+ y="9118"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3651">extra info datapath</text>
+<!-- Line --> <polyline
+ points="1559,8740 2108,8740 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline3653" />
+<!-- Arrowhead on XXXpoint 1559 8740 - 2141 8740--> <polyline
+ points="1997 8771 2123 8740 1997 8708 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3655" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2314"
+ y="8787"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3657">detailed datapath</text>
+<!-- Line --> <polyline
+ points="1559,8409 2108,8409 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3659" />
+<!-- Arrowhead on XXXpoint 1559 8409 - 2141 8409--> <polyline
+ points="1997 8440 2123 8409 1997 8377 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3661" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2314"
+ y="8456"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3663">datapath</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5007"
+ y="8456"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3665">xine buffer</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5007"
+ y="8787"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3667">discontinuity</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5007"
+ y="9118"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3669">presentation timestamp</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="8456"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3671">virtual presentation timestamp</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="8787"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3673">subpicture unit</text>
+<!-- Line: box --> <rect
+ x="4535"
+ y="2551"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3675" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4629"
+ y="2740"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3677">buf</text>
+<!-- Line: box --> <rect
+ x="6236"
+ y="2551"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3679" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6330"
+ y="2740"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3681">buf</text>
+<!-- Line: box --> <rect
+ x="5480"
+ y="2551"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3683" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5574"
+ y="2740"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3685">buf</text>
+<!-- Line: box --> <rect
+ x="5007"
+ y="2551"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3687" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5102"
+ y="2740"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3689">buf</text>
+<!-- Line: box --> <rect
+ x="4440"
+ y="2503"
+ width="2267"
+ height="661"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3691" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5291"
+ y="3070"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3693">video fifo</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6000"
+ y="2740"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3695">...</text>
+<!-- Line: box --> <rect
+ x="4535"
+ y="6330"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3697" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4629"
+ y="6519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3699">buf</text>
+<!-- Line: box --> <rect
+ x="6236"
+ y="6330"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3701" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6330"
+ y="6519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3703">buf</text>
+<!-- Line: box --> <rect
+ x="5480"
+ y="6330"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3705" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5574"
+ y="6519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3707">buf</text>
+<!-- Line: box --> <rect
+ x="5007"
+ y="6330"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3709" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5102"
+ y="6519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3711">buf</text>
+<!-- Line: box --> <rect
+ x="4440"
+ y="6283"
+ width="2267"
+ height="661"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3713" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5291"
+ y="6850"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3715">audio fifo</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6000"
+ y="6519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3717">...</text>
+<!-- Line: box --> <rect
+ x="7417"
+ y="6141"
+ width="1889"
+ height="944"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3719" />
+<!-- Line --> <polyline
+ points="7795,7086 7795,6425 9307,6425 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3721" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7559"
+ y="6330"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3723">audio decoder loop</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7889"
+ y="6803"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3725">audio decoder plugin</text>
+<!-- Line: box --> <rect
+ x="7417"
+ y="2362"
+ width="1889"
+ height="944"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3727" />
+<!-- Line --> <polyline
+ points="7795,3307 7795,3023 9307,3023 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3729" />
+<!-- Line --> <polyline
+ points="9307,2929 7795,2929 7795,2645 9307,2645 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3731" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7559"
+ y="2551"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3733">video decoder loop</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7889"
+ y="3212"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3735">spu decoder plugin</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7889"
+ y="2834"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3737">video decoder plugin</text>
+<!-- Line: box --> <rect
+ x="11622"
+ y="6141"
+ width="1889"
+ height="944"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3739" />
+<!-- Line --> <polyline
+ points="12000,7086 12000,6425 13511,6425 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3741" />
+<!-- Line --> <polyline
+ points="12850,6141 12850,6425 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3743" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11763"
+ y="6330"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3745">audio out loop</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12094"
+ y="6803"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3747">audio out plugin</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12944"
+ y="6330"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3749">out fifo</text>
+<!-- Line: box --> <rect
+ x="11622"
+ y="2362"
+ width="1889"
+ height="944"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect3751" />
+<!-- Line --> <polyline
+ points="12000,3307 12000,2645 13511,2645 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3753" />
+<!-- Line --> <polyline
+ points="12850,2362 12850,2645 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3755" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11763"
+ y="2551"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3757">video out loop</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12094"
+ y="3023"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3759">video out plugin</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12944"
+ y="2551"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3761">out fifo</text>
+<!-- Line --> <polyline
+ points="12661,2362 12659,2361 12654,2360 12645,2356 12633,2352 12615,2346 12593,2339 12565,2329 12536,2319 12503,2306 12469,2293 12433,2279 12398,2264 12363,2248 12329,2232 12297,2214 12266,2196 12238,2176 12212,2156 12188,2134 12170,2110 12155,2085 12144,2058 12141,2031 12144,2004 12155,1977 12170,1952 12188,1928 12212,1906 12238,1886 12266,1866 12297,1848 12329,1830 12363,1814 12398,1798 12433,1783 12469,1769 12503,1756 12536,1743 12565,1733 12593,1723 12615,1716 12633,1710 12644,1704 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; "
+ id="polyline3763" />
+<!-- Arrowhead on XXXpoint 12633 1710 - 12676 1695--> <polyline
+ points="12550 1771 12659 1700 12529 1711 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3765" />
+<!-- Line --> <polyline
+ points="12661,1700 12663,1701 12669,1703 12679,1707 12693,1712 12713,1719 12739,1729 12767,1740 12798,1753 12833,1767 12868,1783 12902,1799 12937,1817 12971,1835 13002,1855 13033,1875 13059,1897 13083,1920 13104,1945 13120,1972 13129,2002 13133,2031 13129,2060 13120,2090 13104,2117 13083,2142 13059,2165 13033,2187 13002,2207 12971,2227 12937,2245 12902,2263 12868,2279 12833,2295 12798,2309 12767,2322 12739,2333 12713,2343 12693,2350 12677,2355 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; "
+ id="polyline3767" />
+<!-- Arrowhead on XXXpoint 12693 2350 - 12645 2367--> <polyline
+ points="12770 2290 12662 2362 12791 2349 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3769" />
+<!-- Line --> <polyline
+ points="7511,6141 6622,4738 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3771" />
+<!-- Arrowhead on XXXpoint 7511 6141 - 6604 4710--> <polyline
+ points="6707 4814 6614 4725 6654 4848 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3773" />
+<!-- Line --> <polyline
+ points="4724,4724 3749,4724 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3775" />
+<!-- Arrowhead on XXXpoint 4724 4724 - 3716 4724--> <polyline
+ points="3860 4692 3734 4724 3860 4755 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3777" />
+<!-- Line --> <polyline
+ points="2267,4724 2627,4724 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3779" />
+<!-- Arrowhead on XXXpoint 2267 4724 - 2661 4724--> <polyline
+ points="2517 4755 2643 4724 2517 4692 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3781" />
+<!-- Line --> <polyline
+ points="3732,4724 4434,6598 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3783" />
+<!-- Arrowhead on XXXpoint 3732 4724 - 4446 6628--> <polyline
+ points="4368 6509 4439 6612 4425 6488 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3785" />
+<!-- Line --> <polyline
+ points="6708,2834 7399,2834 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3787" />
+<!-- Arrowhead on XXXpoint 6708 2834 - 7433 2834--> <polyline
+ points="7289 2866 7415 2834 7289 2803 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3789" />
+<!-- Line --> <polyline
+ points="3732,4724 4434,2849 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3791" />
+<!-- Arrowhead on XXXpoint 3732 4724 - 4446 2818--> <polyline
+ points="4425 2958 4439 2835 4369 2937 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3793" />
+<!-- Line --> <polyline
+ points="6708,6614 7399,6614 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3795" />
+<!-- Arrowhead on XXXpoint 6708 6614 - 7433 6614--> <polyline
+ points="7289 6645 7415 6614 7289 6582 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3797" />
+<!-- Line --> <polyline
+ points="7511,3307 6622,4709 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3799" />
+<!-- Arrowhead on XXXpoint 7511 3307 - 6604 4737--> <polyline
+ points="6654 4598 6614 4722 6707 4632 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3801" />
+<!-- Line --> <polyline
+ points="7653,3307 8351,4238 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3803" />
+<!-- Arrowhead on XXXpoint 7653 3307 - 8371 4264--> <polyline
+ points="8260 4169 8361 4250 8310 4131 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3805" />
+<!-- Line --> <polyline
+ points="7653,6141 8351,5209 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3807" />
+<!-- Arrowhead on XXXpoint 7653 6141 - 8371 5184--> <polyline
+ points="8310 5317 8361 5197 8260 5279 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3809" />
+<!-- Line --> <polyline
+ points="8976,3307 8976,4234 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3811" />
+<!-- Arrowhead on XXXpoint 8976 3307 - 8976 4267--> <polyline
+ points="8944 4123 8976 4249 9007 4123 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3813" />
+<!-- Line --> <polyline
+ points="8740,4251 8740,3323 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3815" />
+<!-- Arrowhead on XXXpoint 8740 4251 - 8740 3291--> <polyline
+ points="8771 3435 8740 3309 8708 3435 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3817" />
+<!-- Line --> <polyline
+ points="1275,1937 2314,1937 2314,1700 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3819" />
+<!-- Line --> <polyline
+ points="2409,7937 2409,614 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:10 31;"
+ id="polyline3821" />
+<!-- Line --> <polyline
+ points="4062,7937 4062,614 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:10 31;"
+ id="polyline3823" />
+<!-- Line --> <polyline
+ points="7086,7937 7086,614 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:10 31;"
+ id="polyline3825" />
+<!-- Line --> <polyline
+ points="10440,7937 10440,283 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:31 31;"
+ id="polyline3827" />
+<!-- Line --> <polyline
+ points="12094,5196 11815,6124 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3829" />
+<!-- Arrowhead on XXXpoint 12094 5196 - 11805 6156--> <polyline
+ points="11816 6009 11811 6139 11877 6027 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3831" />
+<!-- Line --> <polyline
+ points="12094,4251 11815,3322 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3833" />
+<!-- Arrowhead on XXXpoint 12094 4251 - 11805 3291--> <polyline
+ points="11877 3419 11811 3308 11816 3437 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3835" />
+<!-- Line --> <polyline
+ points="9324,6897 11604,6897 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3837" />
+<!-- Arrowhead on XXXpoint 9307 6897 - 11637 6897--> <polyline
+ points="11493 6929 11619 6897 11493 6866 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3839" />
+<!-- Arrowhead on XXXpoint 11622 6897 - 9291 6897--> <polyline
+ points="9435 6866 9309 6897 9435 6929 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3841" />
+<!-- Line --> <polyline
+ points="9324,2692 11604,2692 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3843" />
+<!-- Arrowhead on XXXpoint 9307 2692 - 11637 2692--> <polyline
+ points="11493 2724 11619 2692 11493 2661 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3845" />
+<!-- Arrowhead on XXXpoint 11622 2692 - 9291 2692--> <polyline
+ points="9435 2661 9309 2692 9435 2724 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3847" />
+<!-- Line --> <polyline
+ points="9324,3212 10204,3212 12222,1710 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline3849" />
+<!-- Arrowhead on XXXpoint 10204 3212 - 12248 1691--> <polyline
+ points="12152 1801 12235 1701 12114 1751 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3851" />
+<!-- Arrowhead on XXXpoint 10204 3212 - 9294 3220--> <polyline
+ points="9437 3187 9312 3220 9438 3250 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3853" />
+<!-- Line --> <polyline
+ points="4724,4582 4723,4582 4721,4582 4716,4583 4708,4584 4698,4585 4684,4587 4666,4590 4644,4593 4619,4595 4591,4599 4558,4602 4522,4606 4483,4611 4443,4615 4398,4619 4353,4622 4306,4626 4258,4630 4207,4634 4156,4637 4103,4639 4050,4641 3995,4642 3939,4643 3882,4643 3822,4642 3762,4641 3699,4638 3635,4634 3568,4629 3500,4622 3429,4615 3357,4605 3285,4595 3212,4582 3132,4566 3056,4550 2984,4532 2920,4514 2861,4495 2810,4477 2766,4459 2728,4441 2697,4424 2670,4407 2649,4391 2632,4375 2617,4360 2605,4344 2595,4329 2586,4314 2577,4300 2569,4285 2558,4270 2545,4256 2532,4241 2514,4226 2493,4212 2468,4197 2438,4182 2405,4169 2366,4155 2324,4142 2277,4131 2227,4121 2177,4114 2125,4110 2073,4109 2025,4111 1980,4115 1939,4121 1901,4131 1868,4140 1838,4151 1812,4162 1788,4175 1767,4186 1749,4199 1732,4213 1716,4225 1702,4238 1689,4251 1676,4265 1664,4279 1652,4292 1640,4307 1629,4322 1618,4337 1609,4352 1600,4368 1591,4385 1585,4402 1582,4419 1581,4437 1584,4454 1592,4471 1606,4488 1627,4502 1653,4516 1683,4529 1719,4539 1757,4549 1798,4556 1842,4562 1887,4567 1934,4573 1983,4576 2032,4579 2083,4581 2135,4583 2187,4584 2239,4585 2290,4585 2341,4585 2389,4585 2435,4585 2477,4585 2515,4584 2549,4584 2577,4583 2600,4583 2618,4583 2628,4582 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline3855" />
+<!-- Arrowhead on XXXpoint 2618 4583 - 2660 4581--> <polyline
+ points="2517 4619 2642 4582 2514 4557 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3857" />
+<!-- Line --> <polyline
+ points="9307,6519 9308,6518 9311,6516 9315,6512 9322,6504 9333,6495 9346,6483 9362,6468 9381,6450 9402,6430 9425,6407 9450,6382 9476,6355 9502,6327 9528,6298 9553,6266 9580,6235 9604,6201 9627,6167 9650,6131 9670,6094 9690,6054 9707,6013 9722,5970 9735,5924 9744,5876 9751,5826 9753,5776 9751,5722 9743,5670 9732,5620 9718,5574 9700,5530 9680,5490 9659,5453 9636,5417 9611,5383 9585,5351 9558,5320 9530,5292 9502,5264 9474,5238 9446,5213 9420,5191 9396,5171 9374,5153 9355,5139 9339,5126 9327,5117 9319,5111 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; "
+ id="polyline3859" />
+<!-- Arrowhead on XXXpoint 9327 5117 - 9293 5092--> <polyline
+ points="9426 5150 9307 5103 9390 5202 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3861" />
+<!-- Line --> <polyline
+ points="9320,6699 9322,6696 9332,6687 9345,6676 9361,6661 9380,6644 9403,6624 9427,6602 9455,6577 9483,6550 9513,6521 9544,6491 9575,6458 9607,6426 9638,6391 9669,6355 9699,6319 9728,6281 9756,6242 9782,6202 9807,6160 9830,6117 9851,6072 9871,6025 9887,5976 9902,5925 9911,5872 9919,5818 9921,5763 9918,5706 9910,5650 9899,5596 9883,5546 9865,5499 9843,5454 9820,5413 9794,5373 9766,5336 9737,5300 9707,5267 9675,5235 9643,5205 9609,5175 9575,5148 9542,5121 9509,5097 9477,5074 9447,5051 9419,5033 9394,5016 9372,5001 9352,4988 9337,4979 9324,4972 9316,4966 9311,4962 9308,4961 9307,4960 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; "
+ id="polyline3863" />
+<!-- Arrowhead on XXXpoint 9322 6696 - 9295 6718--> <polyline
+ points="9386 6603 9309 6707 9426 6651 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3865" />
+<!-- Line --> <polyline
+ points="9322,4340 9323,4338 9335,4331 9349,4324 9366,4314 9386,4303 9411,4289 9436,4275 9464,4258 9493,4239 9524,4219 9554,4198 9586,4176 9616,4153 9647,4128 9676,4102 9704,4075 9731,4046 9757,4015 9780,3983 9802,3948 9822,3910 9839,3870 9854,3827 9864,3782 9871,3734 9874,3685 9871,3634 9864,3584 9854,3534 9839,3487 9822,3441 9802,3397 9780,3355 9757,3315 9731,3275 9704,3237 9676,3201 9647,3165 9616,3130 9586,3097 9554,3064 9524,3034 9493,3003 9464,2975 9436,2950 9411,2925 9386,2904 9366,2886 9349,2871 9335,2858 9323,2849 9316,2841 9311,2837 9308,2835 9307,2834 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; "
+ id="polyline3867" />
+<!-- Arrowhead on XXXpoint 9323 4338 - 9293 4352--> <polyline
+ points="9408 4261 9309 4345 9436 4318 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3869" />
+<!-- Line --> <polyline
+ points="9320,2750 9324,2752 9336,2761 9351,2772 9370,2787 9392,2804 9418,2824 9446,2846 9477,2871 9510,2898 9545,2927 9581,2957 9616,2990 9653,3022 9689,3057 9724,3092 9759,3129 9793,3167 9825,3206 9856,3246 9884,3288 9911,3331 9935,3376 9958,3423 9977,3471 9993,3523 10005,3575 10012,3630 10015,3685 10012,3742 10004,3798 9990,3851 9972,3902 9951,3949 9926,3994 9899,4035 9869,4075 9837,4112 9803,4148 9769,4181 9732,4213 9694,4243 9655,4272 9616,4300 9579,4327 9540,4351 9503,4374 9468,4396 9437,4415 9407,4432 9381,4447 9359,4459 9341,4469 9328,4476 9318,4481 9312,4486 9308,4487 9307,4488 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; "
+ id="polyline3871" />
+<!-- Arrowhead on XXXpoint 9324 2752 - 9294 2731--> <polyline
+ points="9429 2786 9309 2741 9394 2837 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3873" />
+<!-- Line --> <polyline
+ points="9307,6803 9308,6803 9310,6803 9314,6803 9321,6803 9332,6802 9344,6802 9361,6802 9382,6801 9407,6800 9435,6800 9467,6797 9503,6796 9542,6795 9583,6793 9628,6792 9674,6790 9722,6787 9773,6785 9825,6782 9878,6779 9931,6775 9986,6771 10041,6768 10097,6763 10154,6759 10212,6752 10268,6747 10327,6740 10386,6733 10446,6725 10507,6717 10567,6707 10629,6697 10692,6685 10756,6672 10819,6660 10883,6645 10946,6629 11007,6614 11085,6592 11158,6569 11222,6546 11279,6527 11330,6508 11372,6492 11407,6477 11437,6466 11460,6456 11479,6448 11495,6441 11506,6436 11514,6432 11522,6428 11527,6425 11532,6422 11537,6416 11543,6411 11549,6405 11556,6396 11566,6386 11576,6372 11590,6355 11606,6335 11623,6312 11641,6285 11661,6254 11681,6219 11700,6181 11716,6141 11729,6100 11737,6059 11742,6019 11745,5983 11746,5949 11748,5919 11748,5891 11746,5868 11745,5847 11744,5829 11742,5814 11741,5801 11740,5788 11738,5778 11736,5767 11733,5757 11729,5745 11724,5734 11718,5720 11710,5704 11699,5687 11686,5666 11669,5641 11649,5614 11625,5583 11596,5548 11563,5510 11524,5470 11481,5428 11433,5385 11386,5349 11339,5313 11292,5279 11246,5249 11202,5220 11161,5195 11122,5172 11086,5152 11055,5135 11025,5120 10999,5106 10976,5095 10955,5085 10935,5077 10916,5068 10898,5061 10881,5055 10864,5048 10846,5042 10827,5035 10805,5028 10782,5020 10755,5012 10726,5002 10692,4992 10655,4981 10613,4969 10566,4955 10515,4940 10459,4924 10400,4910 10337,4894 10271,4879 10204,4866 10130,4853 10058,4843 9991,4834 9930,4827 9876,4822 9828,4817 9787,4814 9753,4812 9724,4809 9700,4808 9681,4806 9665,4805 9652,4804 9640,4803 9629,4803 9619,4803 9608,4804 9596,4805 9582,4807 9565,4810 9544,4814 9519,4820 9490,4829 9456,4839 9417,4852 9373,4867 9324,4886 9273,4907 9219,4932 9165,4960 9116,4990 9069,5020 9026,5050 8987,5081 8952,5110 8920,5138 8893,5163 8869,5186 8848,5208 8829,5227 8813,5244 8800,5260 8788,5275 8777,5289 8768,5301 8760,5315 8751,5328 8743,5341 8734,5356 8726,5372 8718,5390 8707,5409 8697,5432 8686,5457 8675,5484 8662,5516 8649,5550 8637,5588 8624,5629 8614,5672 8604,5717 8598,5763 8596,5815 8597,5865 8603,5912 8613,5956 8625,5997 8641,6036 8659,6072 8678,6106 8700,6137 8722,6167 8746,6196 8771,6223 8797,6248 8824,6272 8850,6296 8876,6317 8901,6337 8924,6355 8946,6371 8965,6385 8982,6397 8996,6407 9006,6413 9008,6415 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline3875" />
+<!-- Arrowhead on XXXpoint 9006 6413 - 9036 6433--> <polyline
+ points="8898 6379 9021 6424 8934 6326 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3877" />
+<!-- Line --> <polyline
+ points="9307,2834 9308,2834 9310,2834 9315,2833 9321,2833 9332,2832 9345,2830 9363,2829 9384,2827 9409,2825 9439,2822 9472,2819 9509,2816 9550,2813 9594,2809 9640,2806 9690,2802 9742,2798 9796,2795 9850,2791 9907,2788 9965,2786 10024,2783 10083,2781 10143,2779 10203,2777 10264,2777 10325,2776 10386,2777 10447,2779 10509,2781 10572,2784 10634,2788 10697,2793 10760,2800 10824,2807 10888,2815 10951,2826 11015,2837 11077,2851 11138,2866 11196,2881 11261,2902 11321,2923 11376,2945 11425,2966 11468,2987 11507,3007 11541,3025 11570,3042 11595,3057 11616,3070 11634,3083 11649,3093 11661,3103 11671,3112 11679,3120 11686,3127 11692,3134 11696,3142 11700,3148 11703,3156 11708,3165 11711,3173 11714,3185 11717,3196 11720,3211 11723,3227 11728,3246 11731,3268 11734,3292 11737,3319 11739,3350 11739,3383 11738,3420 11734,3459 11727,3500 11716,3543 11700,3586 11682,3630 11661,3672 11638,3712 11616,3751 11593,3786 11571,3819 11549,3849 11529,3878 11510,3903 11492,3926 11477,3946 11461,3966 11446,3983 11433,4000 11420,4014 11406,4029 11393,4043 11379,4056 11365,4071 11350,4086 11332,4100 11313,4116 11291,4134 11266,4152 11238,4172 11207,4194 11171,4217 11131,4242 11086,4268 11037,4296 10982,4325 10923,4354 10860,4384 10793,4413 10724,4440 10657,4465 10588,4486 10522,4504 10458,4520 10398,4535 10342,4546 10289,4557 10241,4565 10197,4572 10158,4577 10122,4581 10090,4583 10061,4585 10035,4586 10012,4586 9990,4586 9970,4585 9951,4584 9932,4582 9914,4580 9896,4578 9876,4576 9854,4573 9830,4571 9805,4567 9777,4564 9745,4561 9711,4557 9672,4554 9629,4550 9582,4544 9531,4539 9477,4533 9418,4527 9357,4518 9293,4510 9229,4499 9165,4488 9086,4471 9014,4453 8946,4434 8887,4415 8834,4397 8790,4382 8752,4366 8721,4352 8697,4341 8676,4329 8661,4320 8648,4310 8639,4303 8632,4295 8625,4287 8620,4279 8614,4270 8606,4261 8598,4250 8587,4238 8575,4223 8558,4206 8538,4187 8514,4165 8487,4139 8456,4111 8423,4079 8387,4044 8350,4007 8314,3968 8277,3923 8243,3878 8215,3834 8191,3792 8171,3752 8154,3714 8141,3677 8131,3643 8123,3609 8117,3576 8114,3545 8112,3514 8111,3485 8111,3458 8112,3430 8113,3406 8115,3384 8117,3364 8119,3348 8121,3334 8122,3323 8122,3322 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline3879" />
+<!-- Arrowhead on XXXpoint 8122 3323 - 8128 3291--> <polyline
+ points="8135 3437 8124 3308 8073 3426 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3881" />
+<!-- Line --> <polyline
+ points="3448,5196 3447,5198 3446,5204 3444,5212 3441,5226 3436,5243 3430,5265 3424,5291 3417,5320 3411,5351 3404,5384 3398,5417 3394,5451 3390,5484 3387,5518 3387,5550 3390,5582 3394,5612 3402,5641 3414,5669 3428,5694 3448,5716 3474,5734 3503,5746 3532,5753 3564,5755 3596,5753 3628,5748 3660,5739 3693,5729 3727,5716 3758,5702 3790,5689 3819,5674 3846,5661 3869,5649 3888,5639 3906,5629 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3883" />
+<!-- Arrowhead on XXXpoint 3888 5639 - 3934 5613--> <polyline
+ points="3825 5711 3920 5622 3794 5656 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3885" />
+<!-- Line --> <polyline
+ points="3732,4393 3733,4392 3736,4390 3741,4386 3749,4379 3759,4370 3772,4359 3786,4345 3802,4329 3819,4312 3837,4295 3854,4275 3870,4255 3885,4234 3899,4211 3910,4187 3921,4163 3928,4137 3932,4109 3932,4078 3929,4048 3921,4015 3908,3984 3890,3954 3871,3927 3849,3905 3826,3886 3803,3870 3779,3859 3755,3849 3732,3842 3708,3836 3685,3830 3661,3825 3638,3819 3615,3813 3593,3804 3571,3795 3551,3781 3532,3766 3517,3749 3504,3729 3497,3707 3496,3685 3502,3662 3517,3643 3537,3625 3561,3610 3589,3598 3620,3588 3654,3580 3690,3572 3728,3566 3765,3561 3803,3556 3840,3552 3874,3549 3903,3547 3927,3545 3951,3543 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3887" />
+<!-- Arrowhead on XXXpoint 3927 3545 - 3983 3542--> <polyline
+ points="3840 3581 3965 3543 3837 3518 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3889" />
+<!-- Line --> <polyline
+ points="6897,6519 6896,6518 6894,6515 6891,6509 6886,6501 6880,6490 6873,6477 6865,6461 6856,6445 6849,6426 6841,6408 6835,6388 6832,6369 6830,6350 6831,6330 6835,6311 6844,6291 6856,6272 6874,6254 6897,6236 6922,6222 6951,6209 6981,6200 7012,6193 7043,6187 7076,6183 7108,6180 7141,6178 7173,6178 7206,6178 7238,6178 7270,6179 7299,6180 7327,6182 7352,6183 7373,6185 7390,6186 7400,6187 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3891" />
+<!-- Arrowhead on XXXpoint 7390 6186 - 7432 6190--> <polyline
+ points="7286 6209 7414 6188 7290 6148 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3893" />
+<!-- Line --> <polyline
+ points="6897,2740 6896,2738 6893,2732 6889,2723 6882,2710 6875,2693 6867,2672 6857,2650 6849,2626 6840,2601 6834,2576 6831,2550 6830,2524 6833,2500 6840,2475 6853,2452 6872,2429 6897,2409 6922,2395 6951,2385 6981,2376 7012,2371 7043,2368 7076,2366 7108,2367 7141,2368 7173,2370 7206,2374 7238,2377 7270,2383 7299,2387 7327,2392 7352,2396 7373,2401 7390,2404 7400,2406 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3895" />
+<!-- Arrowhead on XXXpoint 7390 2404 - 7432 2411--> <polyline
+ points="7285 2416 7415 2408 7295 2354 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3897" />
+<!-- Line --> <polyline
+ points="7511,2362 7512,2361 7514,2359 7519,2355 7526,2350 7535,2343 7549,2333 7565,2321 7585,2306 7607,2290 7632,2271 7660,2251 7692,2230 7724,2208 7760,2185 7796,2162 7835,2139 7874,2117 7914,2094 7956,2073 8000,2052 8045,2032 8091,2014 8138,1997 8188,1982 8240,1968 8295,1956 8351,1946 8410,1940 8472,1935 8534,1934 8598,1937 8661,1943 8722,1952 8781,1965 8837,1981 8890,1997 8940,2016 8986,2037 9032,2059 9074,2082 9113,2108 9152,2133 9188,2159 9224,2185 9257,2213 9289,2241 9320,2268 9350,2297 9377,2324 9403,2350 9427,2375 9449,2398 9469,2419 9487,2439 9502,2456 9514,2470 9524,2481 9531,2490 9531,2490 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3899" />
+<!-- Arrowhead on XXXpoint 9531 2490 - 9552 2515--> <polyline
+ points="9436 2425 9541 2501 9484 2384 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3901" />
+<!-- Line --> <polyline
+ points="7464,6236 7463,6237 7461,6240 7458,6244 7453,6253 7446,6263 7437,6278 7425,6295 7413,6316 7398,6340 7382,6367 7365,6396 7348,6428 7331,6460 7314,6496 7297,6532 7281,6569 7268,6606 7255,6645 7245,6684 7236,6725 7230,6766 7227,6808 7228,6852 7232,6896 7239,6942 7253,6990 7271,7037 7294,7085 7322,7133 7352,7174 7384,7213 7418,7250 7453,7285 7486,7316 7518,7344 7548,7371 7577,7395 7604,7416 7628,7435 7651,7453 7671,7468 7691,7483 7709,7497 7725,7508 7742,7520 7759,7531 7776,7542 7794,7552 7813,7562 7834,7572 7857,7582 7882,7592 7910,7602 7942,7611 7977,7622 8017,7630 8061,7639 8110,7647 8163,7653 8220,7657 8281,7659 8344,7658 8409,7653 8471,7645 8532,7633 8591,7617 8648,7601 8703,7581 8755,7559 8807,7534 8855,7509 8901,7483 8946,7456 8990,7426 9030,7397 9071,7366 9110,7335 9148,7303 9185,7271 9220,7238 9255,7206 9288,7173 9320,7142 9351,7110 9379,7081 9405,7053 9429,7025 9453,7001 9471,6979 9489,6959 9504,6942 9516,6929 9525,6918 9532,6910 9531,6910 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:bevel; stroke-linecap:butt; stroke-dasharray:10 10;"
+ id="polyline3903" />
+<!-- Arrowhead on XXXpoint 9532 6910 - 9552 6885--> <polyline
+ points="9488 7016 9542 6898 9438 6977 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline3905" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="9118"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3907">extra info</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10771"
+ y="4629"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3909">post</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10771"
+ y="4866"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3911">plugins</text>
+<!-- Line: box --> <rect
+ x="1795"
+ y="3921"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3913" />
+<!-- Line: box --> <rect
+ x="4110"
+ y="4535"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3915" />
+<!-- Line: box --> <rect
+ x="6850"
+ y="5385"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3917" />
+<!-- Line: box --> <rect
+ x="6850"
+ y="3732"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3919" />
+<!-- Line: box --> <rect
+ x="7700"
+ y="5527"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3921" />
+<!-- Line: box --> <rect
+ x="7653"
+ y="3543"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3923" />
+<!-- Line: box --> <rect
+ x="9307"
+ y="5338"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3925" />
+<!-- Line: box --> <rect
+ x="9637"
+ y="6283"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3927" />
+<!-- Line: box --> <rect
+ x="9354"
+ y="3826"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3929" />
+<!-- Line: box --> <rect
+ x="8929"
+ y="3732"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3931" />
+<!-- Line: box --> <rect
+ x="8409"
+ y="3496"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3933" />
+<!-- Line: box --> <rect
+ x="11858"
+ y="5480"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3935" />
+<!-- Line: box --> <rect
+ x="11858"
+ y="3732"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3937" />
+<!-- Line: box --> <rect
+ x="11669"
+ y="1937"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3939" />
+<!-- Line: box --> <rect
+ x="9826"
+ y="4771"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3941" />
+<!-- Line: box --> <rect
+ x="8503"
+ y="5385"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3943" />
+<!-- Line: box --> <rect
+ x="9921"
+ y="3307"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3945" />
+<!-- Line: box --> <rect
+ x="8314"
+ y="3826"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3947" />
+<!-- Line: box --> <rect
+ x="9826"
+ y="4346"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3949" />
+<!-- Line: box --> <rect
+ x="4299"
+ y="8267"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3951" />
+<!-- Line: box --> <rect
+ x="4299"
+ y="8598"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3953" />
+<!-- Line: box --> <rect
+ x="4299"
+ y="8929"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3955" />
+<!-- Line: box --> <rect
+ x="7275"
+ y="8267"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3957" />
+<!-- Line: box --> <rect
+ x="7275"
+ y="8598"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3959" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="5574"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3961" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="3496"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3963" />
+<!-- Line: box --> <rect
+ x="6850"
+ y="2692"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3965" />
+<!-- Line: box --> <rect
+ x="6850"
+ y="6472"
+ width="377"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3967" />
+<!-- Line: box --> <rect
+ x="9496"
+ y="2456"
+ width="708"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3969" />
+<!-- Line: box --> <rect
+ x="9496"
+ y="6803"
+ width="708"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3971" />
+<!-- Line: box --> <rect
+ x="12283"
+ y="1889"
+ width="708"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect3973" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1889"
+ y="4110"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3975">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4204"
+ y="4724"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3977">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6944"
+ y="5574"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3979">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6944"
+ y="3921"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3981">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7795"
+ y="5716"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3983">disc</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7748"
+ y="3732"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3985">disc</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9401"
+ y="5527"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3987">pts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9732"
+ y="6472"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3989">vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9448"
+ y="4015"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3991">pts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9023"
+ y="3921"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3993">pts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8503"
+ y="3685"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3995">vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11952"
+ y="5669"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3997">time</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11952"
+ y="3921"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text3999">time</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11763"
+ y="2125"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4001">spu</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9921"
+ y="4960"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4003">pts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8598"
+ y="5574"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4005">vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10015"
+ y="3496"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4007">vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8409"
+ y="4015"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4009">vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9921"
+ y="4535"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4011">pts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4393"
+ y="8456"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4013">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4393"
+ y="8787"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4015">disc</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4393"
+ y="9118"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4017">pts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7370"
+ y="8456"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4019">vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7370"
+ y="8787"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4021">spu</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="5763"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4023">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="3685"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4025">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6944"
+ y="2881"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4027">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6944"
+ y="6661"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4029">buf</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9590"
+ y="2645"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4031">frames</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9590"
+ y="6992"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4033">samples</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12377"
+ y="2078"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4035">frames</text>
+<!-- Circle --> <circle
+ cx="4582"
+ cy="2598"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4037" />
+<!-- Circle --> <circle
+ cx="5055"
+ cy="2598"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4039" />
+<!-- Circle --> <circle
+ cx="5527"
+ cy="2598"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4041" />
+<!-- Circle --> <circle
+ cx="6283"
+ cy="2598"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4043" />
+<!-- Circle --> <circle
+ cx="4572"
+ cy="6377"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4045" />
+<!-- Circle --> <circle
+ cx="5055"
+ cy="6377"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4047" />
+<!-- Circle --> <circle
+ cx="5527"
+ cy="6377"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4049" />
+<!-- Circle --> <circle
+ cx="6283"
+ cy="6377"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4051" />
+<!-- Circle --> <circle
+ cx="3958"
+ cy="5622"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4053" />
+<!-- Circle --> <circle
+ cx="3968"
+ cy="3543"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4055" />
+<!-- Circle --> <circle
+ cx="6897"
+ cy="2729"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4057" />
+<!-- Circle --> <circle
+ cx="6897"
+ cy="6519"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4059" />
+<!-- Circle --> <circle
+ cx="7501"
+ cy="6188"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4061" />
+<!-- Circle --> <circle
+ cx="7464"
+ cy="2409"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4063" />
+<!-- Circle --> <circle
+ cx="9543"
+ cy="2503"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4065" />
+<!-- Circle --> <circle
+ cx="9532"
+ cy="6850"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4067" />
+<!-- Circle --> <circle
+ cx="7464"
+ cy="9070"
+ r="10"
+ style="fill:#000000;stroke:#000000;stroke-width:8;"
+ id="circle4069" />
+ </g>
+</svg>
diff --git a/doc/hackersguide/hackersguide.docbook b/doc/hackersguide/hackersguide.docbook
new file mode 100644
index 000000000..779e7b814
--- /dev/null
+++ b/doc/hackersguide/hackersguide.docbook
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
+ "/usr/share/sgml/docbook/xml-dtd-4.4/docbookx.dtd" [
+<!ENTITY intro SYSTEM "intro.docbook" >
+<!ENTITY library SYSTEM "library.docbook" >
+<!ENTITY overview SYSTEM "overview.docbook" >
+<!ENTITY internals SYSTEM "internals.docbook">
+<!ENTITY stream SYSTEM "stream.docbook" >
+<!ENTITY output SYSTEM "output.docbook" >
+]>
+
+<book>
+
+ <bookinfo>
+ <title>The xine hacker's guide</title>
+ <titleabbrev>hackersguide</titleabbrev>
+ <authorgroup>
+ <author><firstname>Günter</firstname><surname>Bartsch</surname></author>
+ <author><firstname>Heiko</firstname><surname>Schäfer</surname></author>
+ <author><firstname>Richard</firstname><surname>Wareham</surname></author>
+ <author><firstname>Miguel</firstname><surname>Freitas</surname></author>
+ <author><firstname>James</firstname><surname>Courtier-Dutton</surname></author>
+ <author><firstname>Siggi</firstname><surname>Langauf</surname></author>
+ <author><firstname>Marco</firstname><surname>Zühlke</surname></author>
+ <author><firstname>Mike</firstname><surname>Melanson</surname></author>
+ <author><firstname>Michael</firstname><surname>Roitzsch</surname></author>
+ <author><firstname>Diego</firstname><surname>Pettenò</surname></author>
+ <author><firstname>Darren</firstname><surname>Salt</surname></author>
+ </authorgroup>
+ <copyright>
+ <year>2001-2010</year>
+ <holder>the xine project team</holder>
+ </copyright>
+ <abstract>
+ <para>
+ This document should help xine hackers to find their way through
+ xine's architecture and source code. It's a pretty free-form document
+ containing a loose collection of articles describing various aspects
+ of xine's internals.
+ </para>
+ </abstract>
+ </bookinfo>
+
+ &intro;
+ &library;
+ &overview;
+ &internals;
+ &stream;
+ &output;
+
+</book>
diff --git a/doc/hackersguide/hackersguide.sgml b/doc/hackersguide/hackersguide.sgml
deleted file mode 100644
index e33304110..000000000
--- a/doc/hackersguide/hackersguide.sgml
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
-<!ENTITY intro SYSTEM "intro.sgml" >
-<!ENTITY library SYSTEM "library.sgml" >
-<!ENTITY overview SYSTEM "overview.sgml" >
-<!ENTITY internals SYSTEM "internals.sgml">
-<!ENTITY stream SYSTEM "stream.sgml" >
-<!ENTITY output SYSTEM "output.sgml" >
-]>
-
-<book>
-
- <bookinfo>
- <title>The xine hacker's guide</title>
- <titleabbrev>hackersguide</titleabbrev>
- <authorgroup>
- <author><firstname>G&uuml;nter</firstname><surname>Bartsch</surname></author>
- <author><firstname>Heiko</firstname><surname>Sch&auml;fer</surname></author>
- <author><firstname>Richard</firstname><surname>Wareham</surname></author>
- <author><firstname>Miguel</firstname><surname>Freitas</surname></author>
- <author><firstname>James</firstname><surname>Courtier-Dutton</surname></author>
- <author><firstname>Siggi</firstname><surname>Langauf</surname></author>
- <author><firstname>Marco</firstname><surname>Z&uuml;hlke</surname></author>
- <author><firstname>Mike</firstname><surname>Melanson</surname></author>
- <author><firstname>Michael</firstname><surname>Roitzsch</surname></author>
- <author><firstname>Darren</firstname><surname>Salt</surname></author>
- </authorgroup>
- <copyright>
- <year>2001-2010</year>
- <holder>the xine project team</holder>
- </copyright>
- <abstract>
- <para>
- This document should help xine hackers to find their way through
- xine's architecture and source code. It's a pretty free-form document
- containing a loose collection of articles describing various aspects
- of xine's internals.
- </para>
- </abstract>
- </bookinfo>
-
- &intro;
- &library;
- &overview;
- &internals;
- &stream;
- &output;
-
-</book>
diff --git a/doc/hackersguide/internals.docbook b/doc/hackersguide/internals.docbook
new file mode 100644
index 000000000..d31a6eff5
--- /dev/null
+++ b/doc/hackersguide/internals.docbook
@@ -0,0 +1,762 @@
+<chapter id="internals">
+ <title>xine internals</title>
+
+ <sect1>
+ <title>Engine architecture and data flow</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="architecture.png" format="PNG" />
+ </imageobject>
+ <imageobject>
+ <imagedata fileref="architecture.eps" format="EPS" />
+ </imageobject>
+ <caption>
+ <para>xine engine architecture</para>
+ </caption>
+ </mediaobject>
+ <para>
+ Media streams usually consist of audio and video data multiplexed
+ into one bitstream in the so-called system-layer (e.g. AVI, Quicktime or MPEG).
+ A demuxer plugin is used to parse the system layer and extract audio and video
+ packages. The demuxer uses an input plugin to read the data and stores it
+ in pre-allocated buffers from the global buffer pool.
+ The buffers are then added to the audio or video stream fifo.
+ </para>
+ <para>
+ From the other end of these fifos the audio and video decoder threads
+ consume the buffers and hand them over to the current audio or video
+ decoder plugin for decompression. These plugins then send the decoded
+ data to the output layer. The buffer holding the encoded
+ data is no longer needed and thus released to the global buffer pool.
+ </para>
+ <para>
+ In the output layer, the video frames and audio samples pass through a
+ post plugin tree, which can apply effects or other operations to the data.
+ When reaching the output loops, frames and samples are enqueued to be
+ displayed, when the presentation time has arrived.
+ </para>
+ <para>
+ A set of extra information travels with the data. Starting at the input and
+ demuxer level, where this information is generated, the data is attached to
+ the buffers as they wait in the fifo. The decoder loops copy the data to
+ a storage of their own. From there, every frame and audio buffer leaving
+ the stream layer is tagged with the data the decoder loop storage currently
+ holds.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Plugin system</title>
+ <para>
+ The plugin system enables some of xine's most valuable features:
+ <itemizedlist>
+ <listitem>
+ <para>
+ drop-in extensiability
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ support parallel installation of multiple (incompatible) libxine versions
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ support for multiple plugin directories
+ (<filename>$prefix/lib/xine/plugins</filename>,
+ <filename>$HOME/.xine/plugins</filename>, &hellip;)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ support for recursive plugin directories
+ (plugins are found even in subdirectories of the plugin directories)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ version management
+ (On start, xine finds all plugins in its plugin (sub)directories and
+ chooses an appropriate version (usually the newest) for each plugin.)
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ simplification
+ (Plugins don't have to follow any special naming convention,
+ and any plugin may contain an arbitrary subset of input, demuxer,
+ decoder or output plugins.)
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Essentally, plugins are just shared objects, ie dynamic libraries. In
+ contrast to normal dynamic libraries, they are stored outside of the
+ system's library PATHs and libxine does its own bookkeeping, which
+ enables most advanced features mentioned above.
+ </para>
+ <sect2>
+ <title>Plugin location and filesystem layout</title>
+ <para>
+ The primary goal for this new plugin mechanism was the need to support
+ simultaneous installation of several (most likely incompatible)
+ libxine versions without them overwriting each other's
+ plugins. Therefore, we have this simple layout:
+ </para>
+ <para>
+ Plugins are installed below XINE_PLUGINDIR
+ (<filename>/usr/local/lib/xine/plugins</filename> by default).
+ Note that plugins are never directly installed into XINE_PLUGINDIR.
+ Instead, a separate subdirectory is created for each "plugin
+ provider". A plugin provider is equivalent with the exact version of
+ one source package. Typical examples include "xine-lib-0.9.11" or
+ "xine-vcdnav-1.0". Every source package is free to install an
+ arbitrary number of plugins in its own, private directory. If a
+ package installs several plugins, they may optionally be organized
+ further into subdirectories.
+ </para>
+ <para>
+ So you will finally end up with something like this:
+ <screen>
+&nbsp;&nbsp;&nbsp;/usr/local/lib/xine/plugins
+&nbsp;&nbsp;&nbsp; xine-lib-0.9.11
+&nbsp;&nbsp;&nbsp; demux_mpeg_block.so
+&nbsp;&nbsp;&nbsp; decode_mpeg.so
+&nbsp;&nbsp;&nbsp; video_out_xv.so
+&nbsp;&nbsp;&nbsp; &hellip;
+&nbsp;&nbsp;&nbsp; xine-vcdnav-0.9.11
+&nbsp;&nbsp;&nbsp; input_vcdnav.so
+&nbsp;&nbsp;&nbsp; xine-lib-1.2
+&nbsp;&nbsp;&nbsp; input
+&nbsp;&nbsp;&nbsp; file.so
+&nbsp;&nbsp;&nbsp; stdin_fifo.so
+&nbsp;&nbsp;&nbsp; vcd.so
+&nbsp;&nbsp;&nbsp; demuxers
+&nbsp;&nbsp;&nbsp; fli.so
+&nbsp;&nbsp;&nbsp; avi.so
+&nbsp;&nbsp;&nbsp; &hellip;
+&nbsp;&nbsp;&nbsp; decoders
+&nbsp;&nbsp;&nbsp; ffmpeg.so
+&nbsp;&nbsp;&nbsp; mpeg.so (may contain mpeg 1/2 audio and video decoders)
+&nbsp;&nbsp;&nbsp; pcm.so
+&nbsp;&nbsp;&nbsp; &hellip;
+&nbsp;&nbsp;&nbsp; output
+&nbsp;&nbsp;&nbsp; video_xv.so
+&nbsp;&nbsp;&nbsp; audio_oss.so
+&nbsp;&nbsp;&nbsp; &hellip;
+&nbsp;&nbsp;&nbsp; xine-lib-3.0
+&nbsp;&nbsp;&nbsp; avi.so (avi demuxer)
+&nbsp;&nbsp;&nbsp; mpeg.so (contains mpeg demuxers and audio/video decoders)
+&nbsp;&nbsp;&nbsp; video_out_xv.so (Xv video out)
+&nbsp;&nbsp;&nbsp; &hellip;</screen>
+ </para>
+ <para>
+ As you can see, every package is free to organize plugins at will
+ below its own plugin provider directory.
+ Additionally, administrators may choose to put plugins directly into
+ XINE_PLUGINDIR, or in a "local" subdirectory.
+ Users may wish to put additional plugins in ~/.xine/plugins/.
+ Again, there may be subdirectories to help organize the plugins.
+ </para>
+ <para>
+ The default value for XINE_PLUGINDIR can be obtained using the
+ <command>pkg-config --variable=plugindir libxine</command> command.
+ </para>
+ </sect2>
+ <sect2>
+ <title>Plugin Content: What's inside the .so?</title>
+ <para>
+ Each plugin library (.so file) contains an arbitrary number of (virtual)
+ plugins. Typically, it will contain exactly one plugin. However, it
+ may be useful to put a set of related plugins in one library, so they
+ can share common code.
+ </para>
+ <para>
+ First of all, what is a virtual plugin?
+ A virtual plugin is essentially a structure that is defined by the
+ xine engine. This structure typically contains lots of function
+ pointers to the actual API functions.
+ For each plugin API, there are several API versions, and each API
+ version may specify a new, incompatible structure. Therefore, it is
+ essential that only those plugins are loaded that support current
+ libxine's API, so the .so file needs a plugin list that
+ provides libxine with the version information, even before it tries to
+ load any of the plugins.
+ </para>
+ <para>
+ This plugin list is held in an array named <varname>xine_plugin_info</varname>":
+ <programlisting>
+&nbsp;&nbsp;&nbsp;plugin_info_t xine_plugin_info[] = {
+&nbsp;&nbsp;&nbsp; /* type, API, "name", version, special_info, init_function */
+&nbsp;&nbsp;&nbsp; { PLUGIN_DEMUX, 20, "flac", XINE_VERSION_CODE, NULL, demux_flac_init_class },
+&nbsp;&nbsp;&nbsp; { PLUGIN_AUDIO_DECODER, 13, "flacdec", XINE_VERSION_CODE, &amp;dec_info_audio, init_plugin },
+&nbsp;&nbsp;&nbsp; { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+&nbsp;&nbsp;&nbsp;};</programlisting>
+ </para>
+ <para>
+ The structure of xine_plugin_info may <emphasis>never</emphasis> be changed.
+ If it ever needs to be changed, it must be renamed to avoid
+ erraneous loading of incompatible plugins.
+ </para>
+ <para>
+ <varname>xine_plugin_info</varname> can contain any number of plugins
+ and must be terminated with a <type>PLUGIN_NONE</type> entry. Available plugin
+ types are:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;#define PLUGIN_NONE 0
+&nbsp;&nbsp;&nbsp;#define PLUGIN_INPUT 1
+&nbsp;&nbsp;&nbsp;#define PLUGIN_DEMUX 2
+&nbsp;&nbsp;&nbsp;#define PLUGIN_AUDIO_DECODER 3
+&nbsp;&nbsp;&nbsp;#define PLUGIN_VIDEO_DECODER 4
+&nbsp;&nbsp;&nbsp;#define PLUGIN_SPU_DECODER 5
+&nbsp;&nbsp;&nbsp;#define PLUGIN_AUDIO_OUT 6
+&nbsp;&nbsp;&nbsp;#define PLUGIN_VIDEO_OUT 7
+&nbsp;&nbsp;&nbsp;#define PLUGIN_POST 8</programlisting>
+ </para>
+ <para>
+ The plugin version number is generated from xine-lib's version number
+ like this: MAJOR * 10000 + MINOR * 100 + SUBMINOR.
+ This is not required, but it's an easy way to ensure that the version
+ increases for every release.
+ </para>
+ <para>
+ Every entry in <varname>xine_plugin_info</varname> has an initialization
+ function for the plugin class context.
+ This function returns a pointer to freshly allocated (typically
+ via <function>malloc()</function>) structure containing mainly function
+ pointers; these are the "methods" of the plugin class.
+ </para>
+ <para>
+ The "plugin class" is not what we call to do the job yet (like decoding
+ a video or something), it must be instantiated. One reason for having the
+ class is to hold any global settings that must be accessed by every
+ instance. Remember that xine library is multistream capable: multible
+ videos can be decoded at the same time, thus several instances of the
+ same plugin are possible.
+ </para>
+ <para>
+ If you think this is pretty much an object-oriented aproach,
+ then you're right.
+ </para>
+ <para>
+ A fictitious file input plugin that supports input plugin API 12 and
+ 13, found in xine-lib 2.13.7 would then define this plugin list:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;#include &lt;xine/plugin.h&gt;
+&nbsp;&nbsp;&nbsp;&hellip;
+&nbsp;&nbsp;&nbsp;plugin_t *init_api12(void) {
+&nbsp;&nbsp;&nbsp; input_plugin_t *this;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp; this = malloc(sizeof(input_plugin_t));
+&nbsp;&nbsp;&nbsp; &hellip;
+&nbsp;&nbsp;&nbsp; return (plugin_t *)this;
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;/* same thing, with different initialization for API 13 */
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;const plugin_info_t xine_plugin_info[] = {
+&nbsp;&nbsp;&nbsp; { PLUGIN_INPUT, 12, "file", 21307, init_api12 },
+&nbsp;&nbsp;&nbsp; { PLUGIN_INPUT, 13, "file", 21307, init_api13 },
+&nbsp;&nbsp;&nbsp; { PLUGIN_NONE, 0, "", 0, NULL }
+&nbsp;&nbsp;&nbsp;}</programlisting>
+ This input plugin supports two APIs, other plugins might provide a
+ mixture of demuxer and decoder plugins that belong together somehow
+ (ie. share common code).
+ </para>
+ <para>
+ You'll find exact definitions of public functions and plugin structs
+ in the appropriate header files for each plugin type:
+ <filename>input/input_plugin.h</filename> for input plugins,
+ <filename>demuxers/demux.h</filename> for demuxer plugins,
+ <filename>xine-engine/video_decoder.h</filename> for video decoder plugins,
+ <filename>xine-engine/audio_decoder.h</filename> for audio decoder plugins,
+ <filename>xine-engine/post.h</filename> for post plugins,
+ <filename>xine-engine/video_out.h</filename> for video out plugins,
+ <filename>xine-engine/audio_out.h</filename> for audio out plugins.
+ Additional information will also be given in the dedicated sections below.
+ </para>
+ <para>
+ Many plugins will need some additional "private" data fields.
+ These should be simply added at the end of the plugin structure.
+ For example a demuxer plugin called "foo" with two private
+ fields "xine" and "count" may have a plugin structure declared in
+ the following way:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;typedef struct {
+&nbsp;&nbsp;&nbsp; /* public fields "inherited" from demux.h */
+&nbsp;&nbsp;&nbsp; demux_plugin_t demux_plugin;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp; xine_t *xine;
+&nbsp;&nbsp;&nbsp; int count;
+&nbsp;&nbsp;&nbsp;} demux_foo_t;</programlisting>
+ </para>
+ <para>
+ The plugin would then access public members via the
+ <varname>demux_plugin</varname> field and private fields directly.
+ </para>
+ <para>
+ Summary: Plugins consist of two C-style classes, each representing a different context.
+ <itemizedlist>
+ <listitem>
+ <para>
+ The first is the so called "plugin class" context. This is a singleton context,
+ which means it will exist either not at all or at most once per xine context.
+ This plugin class context is a C-style class which is subclassing the related
+ class from the xine plugin headers. This contains functions, which are
+ independent of the actual instance of the plugin. Most prominently, it contains
+ a factory method to instantiate the next context.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The second context is the instance context. This is another C-style class, which
+ is constructed and disposed withing the plugin class context. This one does
+ the actual work and subclasses the related plugin struct from the xine plugin
+ headers. It is instantiated for every separate running instance of the plugin
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+ </sect1>
+
+ <sect1>
+ <title>What is this metronom thingy?</title>
+ <para>
+ Metronom serves two purposes:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Generate vpts (virtual presentation time stamps) from pts (presentation time stamps)
+ for a/v output and synchronization.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Provide a master clock (system clock reference, scr), possibly provided
+ by external scr plugins (this can be used if some hardware decoder or network
+ server dictates the time).
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ pts/vpts values are given in 1/90000 sec units. pts values in mpeg streams
+ may wrap (that is, return to zero or any other value without further notice),
+ can be missing on some frames or (for broken streams) may "dance" around
+ the correct values. Metronom therefore has some heuristics built-in to generate
+ clean vpts values which can then be used in the output layers to schedule audio/video
+ output.
+ </para>
+ <para>
+ The heuristics used in metronom have always been a field of research. Current metronom's
+ implementation <emphasis>tries</emphasis> to stick to pts values as reported from demuxers,
+ that is, vpts may be obtained by a simple operation of vpts = pts + <varname>vpts_offset</varname>,
+ where <varname>vpts_offset</varname> takes into account any wraps. Whenever pts is zero,
+ metronom will estimate vpts based on previous values. If a difference is found between the
+ estimated and calculated vpts values by above formula, it will be smoothed by using a
+ "drift correction".
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>How does xine synchronize audio and video?</title>
+ <para>
+ Every image frame or audio buffer leaving decoder is tagged by metronom with
+ a vpts information. This will tell video_out and audio_out threads when that
+ data should be presented. Usually there isn't a significative delay associated
+ with video driver, so we expect it to get on screen at the time it's
+ delivered for drawing. Unfortunately the same isn't true for audio: all sound
+ systems implement some amount of buffering (or fifo), any data being send to it
+ <emphasis>now</emphasis> will only get played some time in future. audio_out thread
+ must take this into account for making perfect A-V sync by asking the sound latency
+ to audio driver.
+ </para>
+ <para>
+ Some audio drivers can't tell the current delay introduced in playback. This is
+ especially true for most sound servers like ESD or aRts and explain why in such
+ cases the sync is far from perfect.
+ </para>
+ <para>
+ Another problem xine must handle is the sound card clock drift. vpts are
+ compared to the system clock (or even to a different clock provided by a scr plugin)
+ for presentation but sound card is sampling audio by its own clocking
+ mechanism, so a small drift may occur. As the playback goes on this
+ error will accumulate possibly resulting in audio gaps or audio drops. To avoid that
+ annoying effect, two countermeasures are available (switchable with xine config
+ option <parameter>audio.synchronization.av_sync_method</parameter>):
+ <itemizedlist>
+ <listitem>
+ <para>
+ The small sound card errors are feedbacked to metronom. The details
+ are given by <filename>audio_out.c</filename> comments:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;/* By adding gap errors (difference between reported and expected
+&nbsp;&nbsp;&nbsp; * sound card clock) into metronom's vpts_offset we can use its
+&nbsp;&nbsp;&nbsp; * smoothing algorithms to correct sound card clock drifts.
+&nbsp;&nbsp;&nbsp; * obs: previously this error was added to xine scr.
+&nbsp;&nbsp;&nbsp; *
+&nbsp;&nbsp;&nbsp; * audio buf ---&gt; metronom --&gt; audio fifo --&gt; (buf-&gt;vpts - hw_vpts)
+&nbsp;&nbsp;&nbsp; * (vpts_offset + error) gap
+&nbsp;&nbsp;&nbsp; * &lt;---------- control --------------|
+&nbsp;&nbsp;&nbsp; *
+&nbsp;&nbsp;&nbsp; * Unfortunately audio fifo adds a large delay to our closed loop.
+&nbsp;&nbsp;&nbsp; *
+&nbsp;&nbsp;&nbsp; * These are designed to avoid updating the metronom too fast.
+&nbsp;&nbsp;&nbsp; * - it will only be updated 1 time per second (so it has a chance of
+&nbsp;&nbsp;&nbsp; * distributing the error for several frames).
+&nbsp;&nbsp;&nbsp; * - it will only be updated 2 times for the whole audio fifo size
+&nbsp;&nbsp;&nbsp; * length (so the control will wait to see the feedback effect)
+&nbsp;&nbsp;&nbsp; * - each update will be of gap/SYNC_GAP_RATE.
+&nbsp;&nbsp;&nbsp; *
+&nbsp;&nbsp;&nbsp; * Sound card clock correction can only provide smooth playback for
+&nbsp;&nbsp;&nbsp; * errors &lt; 1% nominal rate. For bigger errors (bad streams) audio
+&nbsp;&nbsp;&nbsp; * buffers may be dropped or gaps filled with silence.
+&nbsp;&nbsp;&nbsp; */</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ The audio is stretched or squeezed a slight bit by resampling, thus compensating
+ the drift: The next comment in <filename>audio_out.c</filename> explains:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;/* Alternative for metronom feedback: fix sound card clock drift
+&nbsp;&nbsp;&nbsp; * by resampling all audio data, so that the sound card keeps in
+&nbsp;&nbsp;&nbsp; * sync with the system clock. This may help, if one uses a DXR3/H+
+&nbsp;&nbsp;&nbsp; * decoder board. Those have their own clock (which serves as xine's
+&nbsp;&nbsp;&nbsp; * master clock) and can only operate at fixed frame rates (if you
+&nbsp;&nbsp;&nbsp; * want smooth playback). Resampling then avoids A/V sync problems,
+&nbsp;&nbsp;&nbsp; * gaps filled with 0-frames and jerky video playback due to different
+&nbsp;&nbsp;&nbsp; * clock speeds of the sound card and DXR3/H+.
+&nbsp;&nbsp;&nbsp; */</programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect1>
+
+ <sect1 id="osd">
+ <title>Overlays and OSD</title>
+ <para>
+ The roots of xine overlay capabilities are DVD subpictures and subtitles support
+ (also known as 'spu'). The DVD subtitles are encoded in a RLE (Run Length Encoding - the
+ most simple compressing technique) format, with a palette of colors and transparency
+ levels. You probably thought that subtitles were just simple text saved into DVDs, right?
+ Wrong, they are bitmaps.
+ </para>
+ <para>
+ In order to optimize to the most common case, xine's internal format for screen overlays
+ is a similar representation to the 'spu' data. This brings not only performance
+ benefit (since blending functions may skip large image areas due to RLE) but also
+ compatibility: it's possible to re-encode any xine overlay to the original spu format
+ for displaying with mpeg hardware decoders like DXR3.
+ </para>
+ <para>
+ Displaying subtitles requires the ability to sync them to the video stream. This
+ is done using the same kind of pts/vpts stuff of a-v sync code. DVD subtitles,
+ for example, may request: show this spu at pts1 and hide it at pts2. This brings the
+ concept of the 'video overlay manager', that is a event-driven module for managing
+ overlay's showing and hiding.
+ </para>
+ <para>
+ The drawback of using internal RLE format is the difficulty in manipulating it
+ as graphic. To overcome that we created the 'OSD renderer', where OSD stands
+ for On Screen Display just like in TV sets. The osd renderer is a module
+ providing simple graphic primitives (lines, rectagles, draw text etc) over
+ a "virtual" bitmap area. Everytime we want to show that bitmap it will
+ be RLE encoded and sent to the overlay manager for displaying.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="overlays.png" format="PNG" />
+ </imageobject>
+ <imageobject>
+ <imagedata fileref="overlays.eps" format="EPS" />
+ </imageobject>
+ <caption>
+ <para>overlays architecture</para>
+ </caption>
+ </mediaobject>
+ <sect2>
+ <title>Overlay Manager</title>
+ <para>
+ The overlay manager interface is available to any xine plugin. It's a bit unlikely
+ to be used directly, anyway here's a code snippet for enqueueing an overlay for
+ displaying:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;video_overlay_event_t event;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;event.object.handle = this-&gt;video_overlay-&gt;get_handle(this-&gt;video_overlay,0);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;memset(this-&gt;event.object.overlay, 0, sizeof(*this-&gt;event.object.overlay));
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* set position and size for this overlay */
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;x = 0;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;y = 0;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;width = 100;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;height = 100;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* clipping region is mostly used by dvd menus for highlighting buttons */
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_top = 0;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_bottom = image_height;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_left = 0;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_right = image_width;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* the hard part: provide a RLE image */
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;rle = your_rle;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;data_size = your_size;
+&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;num_rle = your_rle_count;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* palette must contain YUV values for each color index */
+&nbsp;&nbsp;&nbsp;memcpy(event.object.overlay-&gt;clip_color, color, sizeof(color));
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* this table contains transparency levels for each color index.
+&nbsp;&nbsp;&nbsp; 0 = completely transparent, 15 - completely opaque */
+&nbsp;&nbsp;&nbsp;memcpy(event.object.overlay-&gt;clip_trans, trans, sizeof(trans));
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* set the event type and time for displaying */
+&nbsp;&nbsp;&nbsp;event.event_type = EVENT_SHOW_SPU;
+&nbsp;&nbsp;&nbsp;event.vpts = 0; /* zero is a special vpts value, it means 'now' */
+&nbsp;&nbsp;&nbsp;video_overlay-&gt;add_event(video_overlay, &amp;event);</programlisting>
+ </para>
+ </sect2>
+ <sect2>
+ <title>OSD Renderer</title>
+ <para>
+ OSD is a general API for rendering stuff over playing video. It's available both
+ to xine plugins and to frontends.
+ </para>
+ <para>
+ The first thing you need is to allocate a OSD object for drawing from the
+ renderer. The code below allocates a 300x200 area. This size can't be changed
+ during the lifetime of a OSD object, but it's possible to place it anywhere
+ over the image.
+ </para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;osd_object_t osd;
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;osd = this-&gt;osd_renderer-&gt;new_object(osd_renderer, 300, 200);</programlisting>
+ <para>
+ Now we may want to set font and color for text rendering. Although we will
+ refer to fonts over this document, in fact the OSD can be any kind of bitmap. Font
+ files are searched and loaded during initialization from
+ <filename>$prefix/share/xine/fonts/</filename> and <filename>~/.xine/fonts</filename>.
+ There's a sample utility to convert truetype fonts at
+ <filename>xine-lib/misc/xine-fontconv.c</filename>. Palette may be manipulated directly,
+ however most of the time it's convenient to use pre-defined text palettes.
+ </para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;/* set sans serif 24 font */
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;set_font(osd, "sans", 24);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* copy pre-defined colors for white, black border, transparent background to
+&nbsp;&nbsp;&nbsp; starting at the index used by the first text palette */
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;set_text_palette(osd, TEXTPALETTE_WHITE_BLACK_TRANSPARENT, OSD_TEXT1);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* copy pre-defined colors for white, no border, translucid background to
+&nbsp;&nbsp;&nbsp; starting at the index used by the second text palette */
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;set_text_palette(osd, TEXTPALETTE_WHITE_NONE_TRANSLUCID, OSD_TEXT2);</programlisting>
+ <para>
+ Now render the text and show it:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;render_text(osd, 0, 0, "white text, black border", OSD_TEXT1);
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;render_text(osd, 0, 30, "white text, no border", OSD_TEXT2);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;show(osd, 0); /* 0 stands for 'now' */</programlisting>
+ </para>
+ <para>
+ There's a 1:1 mapping between OSD objects and overlays, therefore the
+ second time you send an OSD object for displaying it will actually substitute
+ the first image. By using set_position() function we can move overlay
+ over the video.
+ </para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;for( i=0; i &lt; 100; i+=10 ) {
+&nbsp;&nbsp;&nbsp; osd_renderer-&gt;set_position(osd, i, i );
+&nbsp;&nbsp;&nbsp; osd_renderer-&gt;show(osd, 0);
+&nbsp;&nbsp;&nbsp; sleep(1);
+&nbsp;&nbsp;&nbsp;}
+&nbsp;&nbsp;&nbsp;osd_renderer-&gt;hide(osd, 0);</programlisting>
+ <para>
+ For additional functions please check osd.h or the public header.
+ </para>
+ <sect3>
+ <title>OSD palette notes</title>
+ <para>
+ The palette functions demand some additional explanation, skip this if you
+ just want to write text fast without worring with details! :)
+ </para>
+ <para>
+ We have a 256-entry palette, each one defining yuv and transparency levels.
+ Although xine fonts are bitmaps and may use any index they want, we have
+ defined a small convention:
+ </para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;/*
+&nbsp;&nbsp;&nbsp; Palette entries as used by osd fonts:
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp; 0: not used by font, always transparent
+&nbsp;&nbsp;&nbsp; 1: font background, usually transparent, may be used to implement
+&nbsp;&nbsp;&nbsp; translucid boxes where the font will be printed.
+&nbsp;&nbsp;&nbsp; 2-5: transition between background and border (usually only alpha
+&nbsp;&nbsp;&nbsp; value changes).
+&nbsp;&nbsp;&nbsp; 6: font border. if the font is to be displayed without border this
+&nbsp;&nbsp;&nbsp; will probably be adjusted to font background or near.
+&nbsp;&nbsp;&nbsp; 7-9: transition between border and foreground
+&nbsp;&nbsp;&nbsp; 10: font color (foreground)
+&nbsp;&nbsp;&nbsp;*/</programlisting>
+ <para>
+ The so called 'transitions' are used to implement font anti-aliasing. That
+ convention requires that any font file must use only the colors from 1 to 10.
+ When we use the set_text_palette() function we are just copying 11 palette
+ entries to the specified base index.
+ </para>
+ <para>
+ That base index is the same we pass to render_text() function to use the
+ text palette. With this scheme is possible to have several diferent text
+ colors at the same time and also draw fonts over custom background.
+ </para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;/* obtains size the text will occupy */
+&nbsp;&nbsp;&nbsp;renderer-&gt;get_text_size(osd, text, &amp;width, &amp;height);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* draws a box using font background color (translucid) */
+&nbsp;&nbsp;&nbsp;renderer-&gt;filled_rect(osd, x1, y1, x1+width, y1+height, OSD_TEXT2 + 1);
+&nbsp;&nbsp;&nbsp;
+&nbsp;&nbsp;&nbsp;/* render text */
+&nbsp;&nbsp;&nbsp;renderer-&gt;render_text(osd, x1, y1, text, OSD_TEXT2);</programlisting>
+ </sect3>
+ <sect3>
+ <title>OSD text and palette FAQ</title>
+ <para>
+ Q: What is the format of the color palette entries?
+ </para>
+ <para>
+ A: It's the same as used by overlay blending code (YUV).
+ </para>
+ <para>
+ Q: What is the relation between a text palette and a palette
+ I set with xine_osd_set_palette?
+ </para>
+ <para>
+ A: xine_osd_set_palette will set the entire 256 color palette
+ to be used when we blend the osd image.
+ "text palette" is a sequence of 11 colors from palette to be
+ used to render text. that is, by calling osd_render_text()
+ with color_base=100 will render text using colors 100-110.
+ </para>
+ <para>
+ Q: Can I render text with colors in my own palette?
+ </para>
+ <para>
+ A: Sure. Just pass the color_base to osd_render_text()
+ </para>
+ <para>
+ Q: Has a text palette change effects on already drawed text?
+ </para>
+ <para>
+ A: osd_set_text_palette() will overwrite some colors on palette
+ with pre-defined ones. So yes, it will change the color
+ on already drawed text (if you do it before calling osd_show,
+ of course).
+ If you don't want to change the colors of drawed text just
+ use different color_base values.
+ </para>
+ <para>
+ Q: What about the shadows of osd-objects? Can I turn them off
+ or are they hardcoded?
+ </para>
+ <para>
+ A: osd objects have no shadows by itself, but fonts use 11
+ colors to produce an anti-aliased effect.
+ if you set a "text palette" with entries 0-9 being transparent
+ and 10 being foreground you will get rid of any borders or
+ anti-aliasing.
+ </para>
+ </sect3>
+ </sect2>
+ </sect1>
+
+ <sect1>
+ <title>MRLs</title>
+ <para>
+ This section defines a draft for a syntactic specification of MRLs as
+ used by xine-lib. The language of MRLs is designed to be a true subset
+ of the language of URIs as given in RFC2396. A type 2 grammar for the
+ language of MRLs is given in EBNF below.
+ </para>
+ <para>
+ Semantically, MRLs consist of two distinct parts that are evaluated by
+ different components of the xine architecture. The first part,
+ derivable from the symbol &lt;input_source&gt; in the given grammar, is
+ completely handed to the input plugins, with input plugins signaling
+ if they can handle the MRL.
+ </para>
+ <para>
+ The second part, derivable from &lt;stream_setup&gt; and delimited from the
+ first by a crosshatch ('#') contains parameters that modify the
+ initialization and playback behaviour of the stream to which the MRL
+ is passed. The possible parameters are mentioned in the manpage to
+ xine-ui.
+ </para>
+ <para>
+ The following definition should be regarded as a guideline only.
+ Of course any given input plugin only understands a subset of all
+ possible MRLs. On the other hand, invalid MRLs according to this
+ definition might be understood for convenience reasons.
+ Some user awareness is required at this point.
+ </para>
+ <para>
+ EBNF grammar for MRLs:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;&lt;mrl&gt; ::= &lt;input_source&gt;[#&lt;stream_setup&gt;]
+&nbsp;&nbsp;&nbsp;&lt;input_source&gt; ::= (&lt;absolute_mrl&gt;|&lt;relative_mrl&gt;)
+&nbsp;&nbsp;&nbsp;&lt;absolute_mrl&gt; ::= &lt;input&gt;:(&lt;hierarch_part&gt;|&lt;opaque_part&gt;)
+&nbsp;&nbsp;&nbsp;&lt;hierarch_part&gt; ::= (&lt;net_path&gt;|&lt;abs_path&gt;)[?&lt;query&gt;]
+&nbsp;&nbsp;&nbsp;&lt;opaque_part&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|;|?|:|@|&amp;|=|+|$|,){&lt;mrl_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;relative_mrl&gt; ::= (&lt;abs_path&gt;|&lt;rel_path&gt;)
+&nbsp;&nbsp;&nbsp;&lt;net_path&gt; ::= //&lt;authority&gt;[&lt;abs_path&gt;]
+&nbsp;&nbsp;&nbsp;&lt;abs_path&gt; ::= /&lt;path_segments&gt;
+&nbsp;&nbsp;&nbsp;&lt;rel_path&gt; ::= &lt;rel_segment&gt;[&lt;abs_path&gt;]
+&nbsp;&nbsp;&nbsp;&lt;rel_segment&gt; ::= &lt;rel_char&gt;{&lt;rel_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;rel_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|;|@|&amp;|=|+|$|,)
+&nbsp;&nbsp;&nbsp;&lt;input&gt; ::= &lt;alpha&gt;{(&lt;alpha&gt;|&lt;digit&gt;|+|-|.)}
+&nbsp;&nbsp;&nbsp;&lt;authority&gt; ::= (&lt;server&gt;|&lt;reg_name&gt;)
+&nbsp;&nbsp;&nbsp;&lt;server&gt; ::= [[&lt;userinfo&gt;@]&lt;host&gt;[:&lt;port&gt;]]
+&nbsp;&nbsp;&nbsp;&lt;userinfo&gt; ::= {(&lt;unreserved&gt;|&lt;escaped&gt;|;|:|&amp;|=|+|$|,)}
+&nbsp;&nbsp;&nbsp;&lt;host&gt; ::= (&lt;hostname&gt;|&lt;ipv4_address&gt;|&lt;ipv6_reference&gt;)
+&nbsp;&nbsp;&nbsp;&lt;hostname&gt; ::= {&lt;domainlabel&gt;.}&lt;toplabel&gt;[.]
+&nbsp;&nbsp;&nbsp;&lt;domainlabel&gt; ::= (&lt;alphanum&gt;|&lt;alphanum&gt;{(&lt;alphanum&gt;|-)}&lt;alphanum&gt;)
+&nbsp;&nbsp;&nbsp;&lt;toplabel&gt; ::= (&lt;alpha&gt;|&lt;alpha&gt;{(&lt;alphanum&gt;|-)}&lt;alphanum&gt;)
+&nbsp;&nbsp;&nbsp;&lt;ipv4_address&gt; ::= &lt;digit&gt;{&lt;digit&gt;}.&lt;digit&gt;{&lt;digit&gt;}.&lt;digit&gt;{&lt;digit&gt;}.&lt;digit&gt;{&lt;digit&gt;}
+&nbsp;&nbsp;&nbsp;&lt;port&gt; ::= {&lt;digit&gt;}
+&nbsp;&nbsp;&nbsp;&lt;reg_name&gt; ::= &lt;reg_char&gt;{&lt;reg_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;reg_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|;|:|@|&amp;|=|+|$|,)
+&nbsp;&nbsp;&nbsp;&lt;path_segments&gt; ::= &lt;segment&gt;{/&lt;segment&gt;}
+&nbsp;&nbsp;&nbsp;&lt;segment&gt; ::= {&lt;path_char&gt;}{;&lt;param&gt;}
+&nbsp;&nbsp;&nbsp;&lt;param&gt; ::= {&lt;path_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;path_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|:|@|&amp;|=|+|$|,)
+&nbsp;&nbsp;&nbsp;&lt;query&gt; ::= {&lt;mrl_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;stream_setup&gt; ::= &lt;stream_option&gt;;{&lt;stream_option&gt;}
+&nbsp;&nbsp;&nbsp;&lt;stream_option&gt; ::= (&lt;configoption&gt;|&lt;engine_option&gt;|novideo|noaudio|nospu)
+&nbsp;&nbsp;&nbsp;&lt;configoption&gt; ::= &lt;configentry&gt;:&lt;configvalue&gt;
+&nbsp;&nbsp;&nbsp;&lt;configentry&gt; ::= &lt;unreserved&gt;{&lt;unreserved&gt;}
+&nbsp;&nbsp;&nbsp;&lt;configvalue&gt; ::= &lt;stream_char&gt;{&lt;stream_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;engine_option&gt; ::= &lt;unreserved&gt;{&lt;unreserved&gt;}:&lt;stream_char&gt;{&lt;stream_char&gt;}
+&nbsp;&nbsp;&nbsp;&lt;stream_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|:|@|&amp;|=|+|$|,)
+&nbsp;&nbsp;&nbsp;&lt;mrl_char&gt; ::= (&lt;reserved&gt;|&lt;unreserved&gt;|&lt;escaped&gt;)
+&nbsp;&nbsp;&nbsp;&lt;reserved&gt; ::= (;|/|?|:|@|&amp;|=|+|$|,|[|])
+&nbsp;&nbsp;&nbsp;&lt;unreserved&gt; ::= (&lt;alphanum&gt;|&lt;mark&gt;)
+&nbsp;&nbsp;&nbsp;&lt;mark&gt; ::= (-|_|.|!|~|*|'|(|))
+&nbsp;&nbsp;&nbsp;&lt;escaped&gt; ::= %&lt;hex&gt;&lt;hex&gt;
+&nbsp;&nbsp;&nbsp;&lt;hex&gt; ::= (&lt;digit&gt;|A|B|C|D|E|F|a|b|c|d|e|f)
+&nbsp;&nbsp;&nbsp;&lt;alphanum&gt; ::= (&lt;alpha&gt;|&lt;digit&gt;)
+&nbsp;&nbsp;&nbsp;&lt;alpha&gt; ::= (&lt;lowalpha&gt;|&lt;upalpha&gt;)
+&nbsp;&nbsp;&nbsp;&lt;lowalpha&gt; ::= (a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)
+&nbsp;&nbsp;&nbsp;&lt;upalpha&gt; ::= (A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)
+&nbsp;&nbsp;&nbsp;&lt;digit&gt; ::= (0|1|2|3|4|5|6|7|8|9)</programlisting>
+ With &lt;ipv6_reference&gt; being an IPv6 address enclosed in [ and ] as defined in RFC2732.
+ </para>
+ </sect1>
+
+</chapter>
diff --git a/doc/hackersguide/internals.sgml b/doc/hackersguide/internals.sgml
deleted file mode 100644
index 5e0cd9349..000000000
--- a/doc/hackersguide/internals.sgml
+++ /dev/null
@@ -1,762 +0,0 @@
-<chapter id="internals">
- <title>xine internals</title>
-
- <sect1>
- <title>Engine architecture and data flow</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="architecture.png" format="PNG">
- </imageobject>
- <imageobject>
- <imagedata fileref="architecture.eps" format="EPS">
- </imageobject>
- <caption>
- <para>xine engine architecture</para>
- </caption>
- </mediaobject>
- <para>
- Media streams usually consist of audio and video data multiplexed
- into one bitstream in the so-called system-layer (e.g. AVI, Quicktime or MPEG).
- A demuxer plugin is used to parse the system layer and extract audio and video
- packages. The demuxer uses an input plugin to read the data and stores it
- in pre-allocated buffers from the global buffer pool.
- The buffers are then added to the audio or video stream fifo.
- </para>
- <para>
- From the other end of these fifos the audio and video decoder threads
- consume the buffers and hand them over to the current audio or video
- decoder plugin for decompression. These plugins then send the decoded
- data to the output layer. The buffer holding the encoded
- data is no longer needed and thus released to the global buffer pool.
- </para>
- <para>
- In the output layer, the video frames and audio samples pass through a
- post plugin tree, which can apply effects or other operations to the data.
- When reaching the output loops, frames and samples are enqueued to be
- displayed, when the presentation time has arrived.
- </para>
- <para>
- A set of extra information travels with the data. Starting at the input and
- demuxer level, where this information is generated, the data is attached to
- the buffers as they wait in the fifo. The decoder loops copy the data to
- a storage of their own. From there, every frame and audio buffer leaving
- the stream layer is tagged with the data the decoder loop storage currently
- holds.
- </para>
- </sect1>
-
- <sect1>
- <title>Plugin system</title>
- <para>
- The plugin system enables some of xine's most valuable features:
- <itemizedlist>
- <listitem>
- <para>
- drop-in extensiability
- </para>
- </listitem>
- <listitem>
- <para>
- support parallel installation of multiple (incompatible) libxine versions
- </para>
- </listitem>
- <listitem>
- <para>
- support for multiple plugin directories
- (<filename>$prefix/lib/xine/plugins</filename>,
- <filename>$HOME/.xine/plugins</filename>, &hellip;)
- </para>
- </listitem>
- <listitem>
- <para>
- support for recursive plugin directories
- (plugins are found even in subdirectories of the plugin directories)
- </para>
- </listitem>
- <listitem>
- <para>
- version management
- (On start, xine finds all plugins in its plugin (sub)directories and
- chooses an appropriate version (usually the newest) for each plugin.)
- </para>
- </listitem>
- <listitem>
- <para>
- simplification
- (Plugins don't have to follow any special naming convention,
- and any plugin may contain an arbitrary subset of input, demuxer,
- decoder or output plugins.)
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Essentally, plugins are just shared objects, ie dynamic libraries. In
- contrast to normal dynamic libraries, they are stored outside of the
- system's library PATHs and libxine does its own bookkeeping, which
- enables most advanced features mentioned above.
- </para>
- <sect2>
- <title>Plugin location and filesystem layout</title>
- <para>
- The primary goal for this new plugin mechanism was the need to support
- simultaneous installation of several (most likely incompatible)
- libxine versions without them overwriting each other's
- plugins. Therefore, we have this simple layout:
- </para>
- <para>
- Plugins are installed below XINE_PLUGINDIR
- (<filename>/usr/local/lib/xine/plugins</filename> by default).
- Note that plugins are never directly installed into XINE_PLUGINDIR.
- Instead, a separate subdirectory is created for each "plugin
- provider". A plugin provider is equivalent with the exact version of
- one source package. Typical examples include "xine-lib-0.9.11" or
- "xine-vcdnav-1.0". Every source package is free to install an
- arbitrary number of plugins in its own, private directory. If a
- package installs several plugins, they may optionally be organized
- further into subdirectories.
- </para>
- <para>
- So you will finally end up with something like this:
- <screen>
-&nbsp;&nbsp;&nbsp;/usr/local/lib/xine/plugins
-&nbsp;&nbsp;&nbsp; xine-lib-0.9.11
-&nbsp;&nbsp;&nbsp; demux_mpeg_block.so
-&nbsp;&nbsp;&nbsp; decode_mpeg.so
-&nbsp;&nbsp;&nbsp; video_out_xv.so
-&nbsp;&nbsp;&nbsp; &hellip;
-&nbsp;&nbsp;&nbsp; xine-vcdnav-0.9.11
-&nbsp;&nbsp;&nbsp; input_vcdnav.so
-&nbsp;&nbsp;&nbsp; xine-lib-1.2
-&nbsp;&nbsp;&nbsp; input
-&nbsp;&nbsp;&nbsp; file.so
-&nbsp;&nbsp;&nbsp; stdin_fifo.so
-&nbsp;&nbsp;&nbsp; vcd.so
-&nbsp;&nbsp;&nbsp; demuxers
-&nbsp;&nbsp;&nbsp; fli.so
-&nbsp;&nbsp;&nbsp; avi.so
-&nbsp;&nbsp;&nbsp; &hellip;
-&nbsp;&nbsp;&nbsp; decoders
-&nbsp;&nbsp;&nbsp; ffmpeg.so
-&nbsp;&nbsp;&nbsp; mpeg.so (may contain mpeg 1/2 audio and video decoders)
-&nbsp;&nbsp;&nbsp; pcm.so
-&nbsp;&nbsp;&nbsp; &hellip;
-&nbsp;&nbsp;&nbsp; output
-&nbsp;&nbsp;&nbsp; video_xv.so
-&nbsp;&nbsp;&nbsp; audio_oss.so
-&nbsp;&nbsp;&nbsp; &hellip;
-&nbsp;&nbsp;&nbsp; xine-lib-3.0
-&nbsp;&nbsp;&nbsp; avi.so (avi demuxer)
-&nbsp;&nbsp;&nbsp; mpeg.so (contains mpeg demuxers and audio/video decoders)
-&nbsp;&nbsp;&nbsp; video_out_xv.so (Xv video out)
-&nbsp;&nbsp;&nbsp; &hellip;</screen>
- </para>
- <para>
- As you can see, every package is free to organize plugins at will
- below its own plugin provider directory.
- Additionally, administrators may choose to put plugins directly into
- XINE_PLUGINDIR, or in a "local" subdirectory.
- Users may wish to put additional plugins in ~/.xine/plugins/.
- Again, there may be subdirectories to help organize the plugins.
- </para>
- <para>
- The default value for XINE_PLUGINDIR can be obtained using the
- <command>pkg-config --variable=plugindir libxine</command> command.
- </para>
- </sect2>
- <sect2>
- <title>Plugin Content: What's inside the .so?</title>
- <para>
- Each plugin library (.so file) contains an arbitrary number of (virtual)
- plugins. Typically, it will contain exactly one plugin. However, it
- may be useful to put a set of related plugins in one library, so they
- can share common code.
- </para>
- <para>
- First of all, what is a virtual plugin?
- A virtual plugin is essentially a structure that is defined by the
- xine engine. This structure typically contains lots of function
- pointers to the actual API functions.
- For each plugin API, there are several API versions, and each API
- version may specify a new, incompatible structure. Therefore, it is
- essential that only those plugins are loaded that support current
- libxine's API, so the .so file needs a plugin list that
- provides libxine with the version information, even before it tries to
- load any of the plugins.
- </para>
- <para>
- This plugin list is held in an array named <varname>xine_plugin_info</varname>":
- <programlisting>
-&nbsp;&nbsp;&nbsp;plugin_info_t xine_plugin_info[] = {
-&nbsp;&nbsp;&nbsp; /* type, API, "name", version, special_info, init_function */
-&nbsp;&nbsp;&nbsp; { PLUGIN_DEMUX, 20, "flac", XINE_VERSION_CODE, NULL, demux_flac_init_class },
-&nbsp;&nbsp;&nbsp; { PLUGIN_AUDIO_DECODER, 13, "flacdec", XINE_VERSION_CODE, &amp;dec_info_audio, init_plugin },
-&nbsp;&nbsp;&nbsp; { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-&nbsp;&nbsp;&nbsp;};</programlisting>
- </para>
- <para>
- The structure of xine_plugin_info may <emphasis>never</emphasis> be changed.
- If it ever needs to be changed, it must be renamed to avoid
- erraneous loading of incompatible plugins.
- </para>
- <para>
- <varname>xine_plugin_info</varname> can contain any number of plugins
- and must be terminated with a <type>PLUGIN_NONE</type> entry. Available plugin
- types are:
- <programlisting>
-&nbsp;&nbsp;&nbsp;#define PLUGIN_NONE 0
-&nbsp;&nbsp;&nbsp;#define PLUGIN_INPUT 1
-&nbsp;&nbsp;&nbsp;#define PLUGIN_DEMUX 2
-&nbsp;&nbsp;&nbsp;#define PLUGIN_AUDIO_DECODER 3
-&nbsp;&nbsp;&nbsp;#define PLUGIN_VIDEO_DECODER 4
-&nbsp;&nbsp;&nbsp;#define PLUGIN_SPU_DECODER 5
-&nbsp;&nbsp;&nbsp;#define PLUGIN_AUDIO_OUT 6
-&nbsp;&nbsp;&nbsp;#define PLUGIN_VIDEO_OUT 7
-&nbsp;&nbsp;&nbsp;#define PLUGIN_POST 8</programlisting>
- </para>
- <para>
- The plugin version number is generated from xine-lib's version number
- like this: MAJOR * 10000 + MINOR * 100 + SUBMINOR.
- This is not required, but it's an easy way to ensure that the version
- increases for every release.
- </para>
- <para>
- Every entry in <varname>xine_plugin_info</varname> has an initialization
- function for the plugin class context.
- This function returns a pointer to freshly allocated (typically
- via <function>malloc()</function>) structure containing mainly function
- pointers; these are the "methods" of the plugin class.
- </para>
- <para>
- The "plugin class" is not what we call to do the job yet (like decoding
- a video or something), it must be instantiated. One reason for having the
- class is to hold any global settings that must be accessed by every
- instance. Remember that xine library is multistream capable: multible
- videos can be decoded at the same time, thus several instances of the
- same plugin are possible.
- </para>
- <para>
- If you think this is pretty much an object-oriented aproach,
- then you're right.
- </para>
- <para>
- A fictitious file input plugin that supports input plugin API 12 and
- 13, found in xine-lib 2.13.7 would then define this plugin list:
- <programlisting>
-&nbsp;&nbsp;&nbsp;#include &lt;xine/plugin.h&gt;
-&nbsp;&nbsp;&nbsp;&hellip;
-&nbsp;&nbsp;&nbsp;plugin_t *init_api12(void) {
-&nbsp;&nbsp;&nbsp; input_plugin_t *this;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp; this = malloc(sizeof(input_plugin_t));
-&nbsp;&nbsp;&nbsp; &hellip;
-&nbsp;&nbsp;&nbsp; return (plugin_t *)this;
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;/* same thing, with different initialization for API 13 */
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;const plugin_info_t xine_plugin_info[] = {
-&nbsp;&nbsp;&nbsp; { PLUGIN_INPUT, 12, "file", 21307, init_api12 },
-&nbsp;&nbsp;&nbsp; { PLUGIN_INPUT, 13, "file", 21307, init_api13 },
-&nbsp;&nbsp;&nbsp; { PLUGIN_NONE, 0, "", 0, NULL }
-&nbsp;&nbsp;&nbsp;}</programlisting>
- This input plugin supports two APIs, other plugins might provide a
- mixture of demuxer and decoder plugins that belong together somehow
- (ie. share common code).
- </para>
- <para>
- You'll find exact definitions of public functions and plugin structs
- in the appropriate header files for each plugin type:
- <filename>input/input_plugin.h</filename> for input plugins,
- <filename>demuxers/demux.h</filename> for demuxer plugins,
- <filename>xine-engine/video_decoder.h</filename> for video decoder plugins,
- <filename>xine-engine/audio_decoder.h</filename> for audio decoder plugins,
- <filename>xine-engine/post.h</filename> for post plugins,
- <filename>xine-engine/video_out.h</filename> for video out plugins,
- <filename>xine-engine/audio_out.h</filename> for audio out plugins.
- Additional information will also be given in the dedicated sections below.
- </para>
- <para>
- Many plugins will need some additional "private" data fields.
- These should be simply added at the end of the plugin structure.
- For example a demuxer plugin called "foo" with two private
- fields "xine" and "count" may have a plugin structure declared in
- the following way:
- <programlisting>
-&nbsp;&nbsp;&nbsp;typedef struct {
-&nbsp;&nbsp;&nbsp; /* public fields "inherited" from demux.h */
-&nbsp;&nbsp;&nbsp; demux_plugin_t demux_plugin;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp; xine_t *xine;
-&nbsp;&nbsp;&nbsp; int count;
-&nbsp;&nbsp;&nbsp;} demux_foo_t;</programlisting>
- </para>
- <para>
- The plugin would then access public members via the
- <varname>demux_plugin</varname> field and private fields directly.
- </para>
- <para>
- Summary: Plugins consist of two C-style classes, each representing a different context.
- <itemizedlist>
- <listitem>
- <para>
- The first is the so called "plugin class" context. This is a singleton context,
- which means it will exist either not at all or at most once per xine context.
- This plugin class context is a C-style class which is subclassing the related
- class from the xine plugin headers. This contains functions, which are
- independent of the actual instance of the plugin. Most prominently, it contains
- a factory method to instantiate the next context.
- </para>
- </listitem>
- <listitem>
- <para>
- The second context is the instance context. This is another C-style class, which
- is constructed and disposed withing the plugin class context. This one does
- the actual work and subclasses the related plugin struct from the xine plugin
- headers. It is instantiated for every separate running instance of the plugin
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
- </sect1>
-
- <sect1>
- <title>What is this metronom thingy?</title>
- <para>
- Metronom serves two purposes:
- <itemizedlist>
- <listitem>
- <para>
- Generate vpts (virtual presentation time stamps) from pts (presentation time stamps)
- for a/v output and synchronization.
- </para>
- </listitem>
- <listitem>
- <para>
- Provide a master clock (system clock reference, scr), possibly provided
- by external scr plugins (this can be used if some hardware decoder or network
- server dictates the time).
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- pts/vpts values are given in 1/90000 sec units. pts values in mpeg streams
- may wrap (that is, return to zero or any other value without further notice),
- can be missing on some frames or (for broken streams) may "dance" around
- the correct values. Metronom therefore has some heuristics built-in to generate
- clean vpts values which can then be used in the output layers to schedule audio/video
- output.
- </para>
- <para>
- The heuristics used in metronom have always been a field of research. Current metronom's
- implementation <emphasis>tries</emphasis> to stick to pts values as reported from demuxers,
- that is, vpts may be obtained by a simple operation of vpts = pts + <varname>vpts_offset</varname>,
- where <varname>vpts_offset</varname> takes into account any wraps. Whenever pts is zero,
- metronom will estimate vpts based on previous values. If a difference is found between the
- estimated and calculated vpts values by above formula, it will be smoothed by using a
- "drift correction".
- </para>
- </sect1>
-
- <sect1>
- <title>How does xine synchronize audio and video?</title>
- <para>
- Every image frame or audio buffer leaving decoder is tagged by metronom with
- a vpts information. This will tell video_out and audio_out threads when that
- data should be presented. Usually there isn't a significative delay associated
- with video driver, so we expect it to get on screen at the time it's
- delivered for drawing. Unfortunately the same isn't true for audio: all sound
- systems implement some amount of buffering (or fifo), any data being send to it
- <emphasis>now</emphasis> will only get played some time in future. audio_out thread
- must take this into account for making perfect A-V sync by asking the sound latency
- to audio driver.
- </para>
- <para>
- Some audio drivers can't tell the current delay introduced in playback. This is
- especially true for most sound servers like ESD or aRts and explain why in such
- cases the sync is far from perfect.
- </para>
- <para>
- Another problem xine must handle is the sound card clock drift. vpts are
- compared to the system clock (or even to a different clock provided by a scr plugin)
- for presentation but sound card is sampling audio by its own clocking
- mechanism, so a small drift may occur. As the playback goes on this
- error will accumulate possibly resulting in audio gaps or audio drops. To avoid that
- annoying effect, two countermeasures are available (switchable with xine config
- option <parameter>audio.synchronization.av_sync_method</parameter>):
- <itemizedlist>
- <listitem>
- <para>
- The small sound card errors are feedbacked to metronom. The details
- are given by <filename>audio_out.c</filename> comments:
- <programlisting>
-&nbsp;&nbsp;&nbsp;/* By adding gap errors (difference between reported and expected
-&nbsp;&nbsp;&nbsp; * sound card clock) into metronom's vpts_offset we can use its
-&nbsp;&nbsp;&nbsp; * smoothing algorithms to correct sound card clock drifts.
-&nbsp;&nbsp;&nbsp; * obs: previously this error was added to xine scr.
-&nbsp;&nbsp;&nbsp; *
-&nbsp;&nbsp;&nbsp; * audio buf ---&gt; metronom --&gt; audio fifo --&gt; (buf-&gt;vpts - hw_vpts)
-&nbsp;&nbsp;&nbsp; * (vpts_offset + error) gap
-&nbsp;&nbsp;&nbsp; * <---------- control --------------|
-&nbsp;&nbsp;&nbsp; *
-&nbsp;&nbsp;&nbsp; * Unfortunately audio fifo adds a large delay to our closed loop.
-&nbsp;&nbsp;&nbsp; *
-&nbsp;&nbsp;&nbsp; * These are designed to avoid updating the metronom too fast.
-&nbsp;&nbsp;&nbsp; * - it will only be updated 1 time per second (so it has a chance of
-&nbsp;&nbsp;&nbsp; * distributing the error for several frames).
-&nbsp;&nbsp;&nbsp; * - it will only be updated 2 times for the whole audio fifo size
-&nbsp;&nbsp;&nbsp; * length (so the control will wait to see the feedback effect)
-&nbsp;&nbsp;&nbsp; * - each update will be of gap/SYNC_GAP_RATE.
-&nbsp;&nbsp;&nbsp; *
-&nbsp;&nbsp;&nbsp; * Sound card clock correction can only provide smooth playback for
-&nbsp;&nbsp;&nbsp; * errors < 1% nominal rate. For bigger errors (bad streams) audio
-&nbsp;&nbsp;&nbsp; * buffers may be dropped or gaps filled with silence.
-&nbsp;&nbsp;&nbsp; */</programlisting>
- </para>
- </listitem>
- <listitem>
- <para>
- The audio is stretched or squeezed a slight bit by resampling, thus compensating
- the drift: The next comment in <filename>audio_out.c</filename> explains:
- <programlisting>
-&nbsp;&nbsp;&nbsp;/* Alternative for metronom feedback: fix sound card clock drift
-&nbsp;&nbsp;&nbsp; * by resampling all audio data, so that the sound card keeps in
-&nbsp;&nbsp;&nbsp; * sync with the system clock. This may help, if one uses a DXR3/H+
-&nbsp;&nbsp;&nbsp; * decoder board. Those have their own clock (which serves as xine's
-&nbsp;&nbsp;&nbsp; * master clock) and can only operate at fixed frame rates (if you
-&nbsp;&nbsp;&nbsp; * want smooth playback). Resampling then avoids A/V sync problems,
-&nbsp;&nbsp;&nbsp; * gaps filled with 0-frames and jerky video playback due to different
-&nbsp;&nbsp;&nbsp; * clock speeds of the sound card and DXR3/H+.
-&nbsp;&nbsp;&nbsp; */</programlisting>
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect1>
-
- <sect1 id="osd">
- <title>Overlays and OSD</title>
- <para>
- The roots of xine overlay capabilities are DVD subpictures and subtitles support
- (also known as 'spu'). The DVD subtitles are encoded in a RLE (Run Length Encoding - the
- most simple compressing technique) format, with a palette of colors and transparency
- levels. You probably thought that subtitles were just simple text saved into DVDs, right?
- Wrong, they are bitmaps.
- </para>
- <para>
- In order to optimize to the most common case, xine's internal format for screen overlays
- is a similar representation to the 'spu' data. This brings not only performance
- benefit (since blending functions may skip large image areas due to RLE) but also
- compatibility: it's possible to re-encode any xine overlay to the original spu format
- for displaying with mpeg hardware decoders like DXR3.
- </para>
- <para>
- Displaying subtitles requires the ability to sync them to the video stream. This
- is done using the same kind of pts/vpts stuff of a-v sync code. DVD subtitles,
- for example, may request: show this spu at pts1 and hide it at pts2. This brings the
- concept of the 'video overlay manager', that is a event-driven module for managing
- overlay's showing and hiding.
- </para>
- <para>
- The drawback of using internal RLE format is the difficulty in manipulating it
- as graphic. To overcome that we created the 'OSD renderer', where OSD stands
- for On Screen Display just like in TV sets. The osd renderer is a module
- providing simple graphic primitives (lines, rectagles, draw text etc) over
- a "virtual" bitmap area. Everytime we want to show that bitmap it will
- be RLE encoded and sent to the overlay manager for displaying.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="overlays.png" format="PNG">
- </imageobject>
- <imageobject>
- <imagedata fileref="overlays.eps" format="EPS">
- </imageobject>
- <caption>
- <para>overlays architecture</para>
- </caption>
- </mediaobject>
- <sect2>
- <title>Overlay Manager</title>
- <para>
- The overlay manager interface is available to any xine plugin. It's a bit unlikely
- to be used directly, anyway here's a code snippet for enqueueing an overlay for
- displaying:
- <programlisting>
-&nbsp;&nbsp;&nbsp;video_overlay_event_t event;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;event.object.handle = this-&gt;video_overlay-&gt;get_handle(this-&gt;video_overlay,0);
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;memset(this-&gt;event.object.overlay, 0, sizeof(*this-&gt;event.object.overlay));
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* set position and size for this overlay */
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;x = 0;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;y = 0;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;width = 100;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;height = 100;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* clipping region is mostly used by dvd menus for highlighting buttons */
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_top = 0;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_bottom = image_height;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_left = 0;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;clip_right = image_width;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* the hard part: provide a RLE image */
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;rle = your_rle;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;data_size = your_size;
-&nbsp;&nbsp;&nbsp;event.object.overlay-&gt;num_rle = your_rle_count;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* palette must contain YUV values for each color index */
-&nbsp;&nbsp;&nbsp;memcpy(event.object.overlay-&gt;clip_color, color, sizeof(color));
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* this table contains transparency levels for each color index.
-&nbsp;&nbsp;&nbsp; 0 = completely transparent, 15 - completely opaque */
-&nbsp;&nbsp;&nbsp;memcpy(event.object.overlay-&gt;clip_trans, trans, sizeof(trans));
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* set the event type and time for displaying */
-&nbsp;&nbsp;&nbsp;event.event_type = EVENT_SHOW_SPU;
-&nbsp;&nbsp;&nbsp;event.vpts = 0; /* zero is a special vpts value, it means 'now' */
-&nbsp;&nbsp;&nbsp;video_overlay-&gt;add_event(video_overlay, &amp;event);</programlisting>
- </para>
- </sect2>
- <sect2>
- <title>OSD Renderer</title>
- <para>
- OSD is a general API for rendering stuff over playing video. It's available both
- to xine plugins and to frontends.
- </para>
- <para>
- The first thing you need is to allocate a OSD object for drawing from the
- renderer. The code below allocates a 300x200 area. This size can't be changed
- during the lifetime of a OSD object, but it's possible to place it anywhere
- over the image.
- </para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;osd_object_t osd;
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;osd = this-&gt;osd_renderer-&gt;new_object(osd_renderer, 300, 200);</programlisting>
- <para>
- Now we may want to set font and color for text rendering. Although we will
- refer to fonts over this document, in fact the OSD can be any kind of bitmap. Font
- files are searched and loaded during initialization from
- <filename>$prefix/share/xine/fonts/</filename> and <filename>~/.xine/fonts</filename>.
- There's a sample utility to convert truetype fonts at
- <filename>xine-lib/misc/xine-fontconv.c</filename>. Palette may be manipulated directly,
- however most of the time it's convenient to use pre-defined text palettes.
- </para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;/* set sans serif 24 font */
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;set_font(osd, "sans", 24);
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* copy pre-defined colors for white, black border, transparent background to
-&nbsp;&nbsp;&nbsp; starting at the index used by the first text palette */
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;set_text_palette(osd, TEXTPALETTE_WHITE_BLACK_TRANSPARENT, OSD_TEXT1);
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* copy pre-defined colors for white, no border, translucid background to
-&nbsp;&nbsp;&nbsp; starting at the index used by the second text palette */
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;set_text_palette(osd, TEXTPALETTE_WHITE_NONE_TRANSLUCID, OSD_TEXT2);</programlisting>
- <para>
- Now render the text and show it:
- <programlisting>
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;render_text(osd, 0, 0, "white text, black border", OSD_TEXT1);
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;render_text(osd, 0, 30, "white text, no border", OSD_TEXT2);
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;show(osd, 0); /* 0 stands for 'now' */</programlisting>
- </para>
- <para>
- There's a 1:1 mapping between OSD objects and overlays, therefore the
- second time you send an OSD object for displaying it will actually substitute
- the first image. By using set_position() function we can move overlay
- over the video.
- </para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;for( i=0; i &lt; 100; i+=10 ) {
-&nbsp;&nbsp;&nbsp; osd_renderer-&gt;set_position(osd, i, i );
-&nbsp;&nbsp;&nbsp; osd_renderer-&gt;show(osd, 0);
-&nbsp;&nbsp;&nbsp; sleep(1);
-&nbsp;&nbsp;&nbsp;}
-&nbsp;&nbsp;&nbsp;osd_renderer-&gt;hide(osd, 0);</programlisting>
- <para>
- For additional functions please check osd.h or the public header.
- </para>
- <sect3>
- <title>OSD palette notes</title>
- <para>
- The palette functions demand some additional explanation, skip this if you
- just want to write text fast without worring with details! :)
- </para>
- <para>
- We have a 256-entry palette, each one defining yuv and transparency levels.
- Although xine fonts are bitmaps and may use any index they want, we have
- defined a small convention:
- </para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;/*
-&nbsp;&nbsp;&nbsp; Palette entries as used by osd fonts:
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp; 0: not used by font, always transparent
-&nbsp;&nbsp;&nbsp; 1: font background, usually transparent, may be used to implement
-&nbsp;&nbsp;&nbsp; translucid boxes where the font will be printed.
-&nbsp;&nbsp;&nbsp; 2-5: transition between background and border (usually only alpha
-&nbsp;&nbsp;&nbsp; value changes).
-&nbsp;&nbsp;&nbsp; 6: font border. if the font is to be displayed without border this
-&nbsp;&nbsp;&nbsp; will probably be adjusted to font background or near.
-&nbsp;&nbsp;&nbsp; 7-9: transition between border and foreground
-&nbsp;&nbsp;&nbsp; 10: font color (foreground)
-&nbsp;&nbsp;&nbsp;*/</programlisting>
- <para>
- The so called 'transitions' are used to implement font anti-aliasing. That
- convention requires that any font file must use only the colors from 1 to 10.
- When we use the set_text_palette() function we are just copying 11 palette
- entries to the specified base index.
- </para>
- <para>
- That base index is the same we pass to render_text() function to use the
- text palette. With this scheme is possible to have several diferent text
- colors at the same time and also draw fonts over custom background.
- </para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;/* obtains size the text will occupy */
-&nbsp;&nbsp;&nbsp;renderer-&gt;get_text_size(osd, text, &amp;width, &amp;height);
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* draws a box using font background color (translucid) */
-&nbsp;&nbsp;&nbsp;renderer-&gt;filled_rect(osd, x1, y1, x1+width, y1+height, OSD_TEXT2 + 1);
-&nbsp;&nbsp;&nbsp;
-&nbsp;&nbsp;&nbsp;/* render text */
-&nbsp;&nbsp;&nbsp;renderer-&gt;render_text(osd, x1, y1, text, OSD_TEXT2);</programlisting>
- </sect3>
- <sect3>
- <title>OSD text and palette FAQ</title>
- <para>
- Q: What is the format of the color palette entries?
- </para>
- <para>
- A: It's the same as used by overlay blending code (YUV).
- </para>
- <para>
- Q: What is the relation between a text palette and a palette
- I set with xine_osd_set_palette?
- </para>
- <para>
- A: xine_osd_set_palette will set the entire 256 color palette
- to be used when we blend the osd image.
- "text palette" is a sequence of 11 colors from palette to be
- used to render text. that is, by calling osd_render_text()
- with color_base=100 will render text using colors 100-110.
- </para>
- <para>
- Q: Can I render text with colors in my own palette?
- </para>
- <para>
- A: Sure. Just pass the color_base to osd_render_text()
- </para>
- <para>
- Q: Has a text palette change effects on already drawed text?
- </para>
- <para>
- A: osd_set_text_palette() will overwrite some colors on palette
- with pre-defined ones. So yes, it will change the color
- on already drawed text (if you do it before calling osd_show,
- of course).
- If you don't want to change the colors of drawed text just
- use different color_base values.
- </para>
- <para>
- Q: What about the shadows of osd-objects? Can I turn them off
- or are they hardcoded?
- </para>
- <para>
- A: osd objects have no shadows by itself, but fonts use 11
- colors to produce an anti-aliased effect.
- if you set a "text palette" with entries 0-9 being transparent
- and 10 being foreground you will get rid of any borders or
- anti-aliasing.
- </para>
- </sect3>
- </sect2>
- </sect1>
-
- <sect1>
- <title>MRLs</title>
- <para>
- This section defines a draft for a syntactic specification of MRLs as
- used by xine-lib. The language of MRLs is designed to be a true subset
- of the language of URIs as given in RFC2396. A type 2 grammar for the
- language of MRLs is given in EBNF below.
- </para>
- <para>
- Semantically, MRLs consist of two distinct parts that are evaluated by
- different components of the xine architecture. The first part,
- derivable from the symbol &lt;input_source&gt; in the given grammar, is
- completely handed to the input plugins, with input plugins signaling
- if they can handle the MRL.
- </para>
- <para>
- The second part, derivable from &lt;stream_setup&gt; and delimited from the
- first by a crosshatch ('#') contains parameters that modify the
- initialization and playback behaviour of the stream to which the MRL
- is passed. The possible parameters are mentioned in the manpage to
- xine-ui.
- </para>
- <para>
- The following definition should be regarded as a guideline only.
- Of course any given input plugin only understands a subset of all
- possible MRLs. On the other hand, invalid MRLs according to this
- definition might be understood for convenience reasons.
- Some user awareness is required at this point.
- </para>
- <para>
- EBNF grammar for MRLs:
- <programlisting>
-&nbsp;&nbsp;&nbsp;&lt;mrl&gt; ::= &lt;input_source&gt;[#&lt;stream_setup&gt;]
-&nbsp;&nbsp;&nbsp;&lt;input_source&gt; ::= (&lt;absolute_mrl&gt;|&lt;relative_mrl&gt;)
-&nbsp;&nbsp;&nbsp;&lt;absolute_mrl&gt; ::= &lt;input&gt;:(&lt;hierarch_part&gt;|&lt;opaque_part&gt;)
-&nbsp;&nbsp;&nbsp;&lt;hierarch_part&gt; ::= (&lt;net_path&gt;|&lt;abs_path&gt;)[?&lt;query&gt;]
-&nbsp;&nbsp;&nbsp;&lt;opaque_part&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|;|?|:|@|&amp;|=|+|$|,){&lt;mrl_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;relative_mrl&gt; ::= (&lt;abs_path&gt;|&lt;rel_path&gt;)
-&nbsp;&nbsp;&nbsp;&lt;net_path&gt; ::= //&lt;authority&gt;[&lt;abs_path&gt;]
-&nbsp;&nbsp;&nbsp;&lt;abs_path&gt; ::= /&lt;path_segments&gt;
-&nbsp;&nbsp;&nbsp;&lt;rel_path&gt; ::= &lt;rel_segment&gt;[&lt;abs_path&gt;]
-&nbsp;&nbsp;&nbsp;&lt;rel_segment&gt; ::= &lt;rel_char&gt;{&lt;rel_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;rel_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|;|@|&amp;|=|+|$|,)
-&nbsp;&nbsp;&nbsp;&lt;input&gt; ::= &lt;alpha&gt;{(&lt;alpha&gt;|&lt;digit&gt;|+|-|.)}
-&nbsp;&nbsp;&nbsp;&lt;authority&gt; ::= (&lt;server&gt;|&lt;reg_name&gt;)
-&nbsp;&nbsp;&nbsp;&lt;server&gt; ::= [[&lt;userinfo&gt;@]&lt;host&gt;[:&lt;port&gt;]]
-&nbsp;&nbsp;&nbsp;&lt;userinfo&gt; ::= {(&lt;unreserved&gt;|&lt;escaped&gt;|;|:|&amp;|=|+|$|,)}
-&nbsp;&nbsp;&nbsp;&lt;host&gt; ::= (&lt;hostname&gt;|&lt;ipv4_address&gt;|&lt;ipv6_reference&gt;)
-&nbsp;&nbsp;&nbsp;&lt;hostname&gt; ::= {&lt;domainlabel&gt;.}&lt;toplabel&gt;[.]
-&nbsp;&nbsp;&nbsp;&lt;domainlabel&gt; ::= (&lt;alphanum&gt;|&lt;alphanum&gt;{(&lt;alphanum&gt;|-)}&lt;alphanum&gt;)
-&nbsp;&nbsp;&nbsp;&lt;toplabel&gt; ::= (&lt;alpha&gt;|&lt;alpha&gt;{(&lt;alphanum&gt;|-)}&lt;alphanum&gt;)
-&nbsp;&nbsp;&nbsp;&lt;ipv4_address&gt; ::= &lt;digit&gt;{&lt;digit&gt;}.&lt;digit&gt;{&lt;digit&gt;}.&lt;digit&gt;{&lt;digit&gt;}.&lt;digit&gt;{&lt;digit&gt;}
-&nbsp;&nbsp;&nbsp;&lt;port&gt; ::= {&lt;digit&gt;}
-&nbsp;&nbsp;&nbsp;&lt;reg_name&gt; ::= &lt;reg_char&gt;{&lt;reg_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;reg_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|;|:|@|&amp;|=|+|$|,)
-&nbsp;&nbsp;&nbsp;&lt;path_segments&gt; ::= &lt;segment&gt;{/&lt;segment&gt;}
-&nbsp;&nbsp;&nbsp;&lt;segment&gt; ::= {&lt;path_char&gt;}{;&lt;param&gt;}
-&nbsp;&nbsp;&nbsp;&lt;param&gt; ::= {&lt;path_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;path_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|:|@|&amp;|=|+|$|,)
-&nbsp;&nbsp;&nbsp;&lt;query&gt; ::= {&lt;mrl_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;stream_setup&gt; ::= &lt;stream_option&gt;;{&lt;stream_option&gt;}
-&nbsp;&nbsp;&nbsp;&lt;stream_option&gt; ::= (&lt;configoption&gt;|&lt;engine_option&gt;|novideo|noaudio|nospu)
-&nbsp;&nbsp;&nbsp;&lt;configoption&gt; ::= &lt;configentry&gt;:&lt;configvalue&gt;
-&nbsp;&nbsp;&nbsp;&lt;configentry&gt; ::= &lt;unreserved&gt;{&lt;unreserved&gt;}
-&nbsp;&nbsp;&nbsp;&lt;configvalue&gt; ::= &lt;stream_char&gt;{&lt;stream_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;engine_option&gt; ::= &lt;unreserved&gt;{&lt;unreserved&gt;}:&lt;stream_char&gt;{&lt;stream_char&gt;}
-&nbsp;&nbsp;&nbsp;&lt;stream_char&gt; ::= (&lt;unreserved&gt;|&lt;escaped&gt;|:|@|&amp;|=|+|$|,)
-&nbsp;&nbsp;&nbsp;&lt;mrl_char&gt; ::= (&lt;reserved&gt;|&lt;unreserved&gt;|&lt;escaped&gt;)
-&nbsp;&nbsp;&nbsp;&lt;reserved&gt; ::= (;|/|?|:|@|&amp;|=|+|$|,|[|])
-&nbsp;&nbsp;&nbsp;&lt;unreserved&gt; ::= (&lt;alphanum&gt;|&lt;mark&gt;)
-&nbsp;&nbsp;&nbsp;&lt;mark&gt; ::= (-|_|.|!|~|*|'|(|))
-&nbsp;&nbsp;&nbsp;&lt;escaped&gt; ::= %&lt;hex&gt;&lt;hex&gt;
-&nbsp;&nbsp;&nbsp;&lt;hex&gt; ::= (&lt;digit&gt;|A|B|C|D|E|F|a|b|c|d|e|f)
-&nbsp;&nbsp;&nbsp;&lt;alphanum&gt; ::= (&lt;alpha&gt;|&lt;digit&gt;)
-&nbsp;&nbsp;&nbsp;&lt;alpha&gt; ::= (&lt;lowalpha&gt;|&lt;upalpha&gt;)
-&nbsp;&nbsp;&nbsp;&lt;lowalpha&gt; ::= (a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z)
-&nbsp;&nbsp;&nbsp;&lt;upalpha&gt; ::= (A|B|C|D|E|F|G|H|I|J|K|L|M|N|O|P|Q|R|S|T|U|V|W|X|Y|Z)
-&nbsp;&nbsp;&nbsp;&lt;digit&gt; ::= (0|1|2|3|4|5|6|7|8|9)</programlisting>
- With &lt;ipv6_reference&gt; being an IPv6 address enclosed in [ and ] as defined in RFC2732.
- </para>
- </sect1>
-
-</chapter>
diff --git a/doc/hackersguide/intro.sgml b/doc/hackersguide/intro.docbook
index cd163e2ee..cd163e2ee 100644
--- a/doc/hackersguide/intro.sgml
+++ b/doc/hackersguide/intro.docbook
diff --git a/doc/hackersguide/library.docbook b/doc/hackersguide/library.docbook
new file mode 100644
index 000000000..51c82e9f3
--- /dev/null
+++ b/doc/hackersguide/library.docbook
@@ -0,0 +1,410 @@
+<chapter id="xine-library">
+ <title>Using the xine library</title>
+
+ <sect1>
+ <title>xine architecture as visible to libxine clients</title>
+ <para>
+ The following drawing shows the components of xine as outside applications
+ see them. For every component, the functions for creating and destroying it
+ are given. Every other function works in the context it is enclosed in.
+ Functions that facilitate the connection of the individual components are
+ also given.
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="library.png" format="PNG" />
+ </imageobject>
+ <imageobject>
+ <imagedata fileref="library.eps" format="EPS" />
+ </imageobject>
+ <caption>
+ <para>outside view on xine components</para>
+ </caption>
+ </mediaobject>
+ <para>
+ The function are named just to give you an overview of what is actually
+ there. It is all thoroughly documented in the plublic header
+ <filename>xine.h</filename>, which is the main and preferably the only xine
+ header, clients should include. (xine/xineutils.h and the XML parser might
+ make an exception.)
+ </para>
+ <para>
+ Details on the OSD feature can be found in the <link linkend="osd">OSD section</link>.
+ </para>
+ </sect1>
+
+ <sect1>
+ <title>Writing a new frontend to xine</title>
+ <para>
+ The best way to explain this seems to be actual code. Below you
+ will find a very easy and hopefully self-explaining xine frontend
+ to give you a start.
+ </para>
+ <para>
+ One important thing to note is that any X11 based xine-lib frontend
+ must call <function>XInitThreads()</function> before calling the
+ first Xlib function, because xine will access the display from
+ within a different thread than the frontend.
+ </para>
+ <sect2>
+ <title>Source code of a simple X11 frontend</title>
+ <programlisting>
+/*
+** Copyright (C) 2003 Daniel Caujolle-Bert &lt;segfault@club-internet.fr&gt;
+**
+** 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.
+**
+*/
+
+/*
+ * compile-command: "gcc -Wall -O2 `pkg-config --cflags --libs libxine x11` -lm -o xinimin xinimin.c"
+ */
+
+#include &lt;stdio.h&gt;
+#include &lt;string.h&gt;
+#include &lt;math.h&gt;
+
+#include &lt;X11/X.h&gt;
+#include &lt;X11/Xlib.h&gt;
+#include &lt;X11/Xutil.h&gt;
+#include &lt;X11/keysym.h&gt;
+#include &lt;X11/Xatom.h&gt;
+#include &lt;X11/Xutil.h&gt;
+#include &lt;X11/extensions/XShm.h&gt;
+
+#include &lt;xine.h&gt;
+#include &lt;xine/xineutils.h&gt;
+
+
+#define MWM_HINTS_DECORATIONS (1L &lt;&lt; 1)
+#define PROP_MWM_HINTS_ELEMENTS 5
+typedef struct {
+ uint32_t flags;
+ uint32_t functions;
+ uint32_t decorations;
+ int32_t input_mode;
+ uint32_t status;
+} MWMHints;
+
+static xine_t *xine;
+static xine_stream_t *stream;
+static xine_video_port_t *vo_port;
+static xine_audio_port_t *ao_port;
+static xine_event_queue_t *event_queue;
+
+static Display *display;
+static int screen;
+static Window window[2];
+static int xpos, ypos, width, height, fullscreen;
+static double pixel_aspect;
+
+static int running = 1;
+
+#define INPUT_MOTION (ExposureMask | ButtonPressMask | KeyPressMask | \
+ ButtonMotionMask | StructureNotifyMask | \
+ PropertyChangeMask | PointerMotionMask)
+
+/* this will be called by xine, if it wants to know the target size of a frame */
+static void dest_size_cb(void *data, int video_width, int video_height, double video_pixel_aspect,
+ int *dest_width, int *dest_height, double *dest_pixel_aspect) {
+ *dest_width = width;
+ *dest_height = height;
+ *dest_pixel_aspect = pixel_aspect;
+}
+
+/* this will be called by xine when it's about to draw the frame */
+static void frame_output_cb(void *data, int video_width, int video_height,
+ double video_pixel_aspect, int *dest_x, int *dest_y,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect, int *win_x, int *win_y) {
+ *dest_x = 0;
+ *dest_y = 0;
+ *win_x = xpos;
+ *win_y = ypos;
+ *dest_width = width;
+ *dest_height = height;
+ *dest_pixel_aspect = pixel_aspect;
+}
+
+static void event_listener(void *user_data, const xine_event_t *event) {
+ switch(event-&gt;type) {
+ case XINE_EVENT_UI_PLAYBACK_FINISHED:
+ running = 0;
+ break;
+
+ case XINE_EVENT_PROGRESS:
+ {
+ xine_progress_data_t *pevent = (xine_progress_data_t *) event-&gt;data;
+
+ printf("%s [%d%%]\n", pevent-&gt;description, pevent-&gt;percent);
+ }
+ break;
+
+ /* you can handle a lot of other interesting events here */
+ }
+}
+
+int main(int argc, char **argv) {
+ char configfile[2048];
+ x11_visual_t vis;
+ double res_h, res_v;
+ char *vo_driver = "auto";
+ char *ao_driver = "auto";
+ char *mrl = NULL;
+ int i;
+ Atom XA_NO_BORDER;
+ MWMHints mwmhints;
+
+ /* parsing command line */
+ for (i = 1; i &lt; argc; i++) {
+ if (strcmp(argv[i], "-vo") == 0) {
+ vo_driver = argv[++i];
+ }
+ else if (strcmp(argv[i], "-ao") == 0) {
+ ao_driver = argv[++i];
+ }
+ else
+ mrl = argv[i];
+ }
+
+ if (!mrl) {
+ printf("specify an mrl\n");
+ return 1;
+ }
+ printf("mrl: '%s'\n", mrl);
+
+ if (!XInitThreads()) {
+ printf("XInitThreads() failed\n");
+ return 1;
+ }
+
+ /* load xine config file and init xine */
+ xine = xine_new();
+ snprintf(configfile, sizeof(configfile), "%s%s", xine_get_homedir(), "/.xine/config");
+ xine_config_load(xine, configfile);
+ xine_init(xine);
+
+ display = XOpenDisplay(NULL);
+ screen = XDefaultScreen(display);
+ xpos = 0;
+ ypos = 0;
+ width = 320;
+ height = 200;
+
+ /* some initalization for the X11 Window we will be showing video in */
+ XLockDisplay(display);
+ fullscreen = 0;
+ window[0] = XCreateSimpleWindow(display, XDefaultRootWindow(display),
+ xpos, ypos, width, height, 1, 0, 0);
+
+ window[1] = XCreateSimpleWindow(display, XDefaultRootWindow(display),
+ 0, 0, (DisplayWidth(display, screen)),
+ (DisplayHeight(display, screen)), 0, 0, 0);
+
+ XSelectInput(display, window[0], INPUT_MOTION);
+
+ XSelectInput(display, window[1], INPUT_MOTION);
+
+ XA_NO_BORDER = XInternAtom(display, "_MOTIF_WM_HINTS", False);
+ mwmhints.flags = MWM_HINTS_DECORATIONS;
+ mwmhints.decorations = 0;
+ XChangeProperty(display, window[1],
+ XA_NO_BORDER, XA_NO_BORDER, 32, PropModeReplace, (unsigned char *) &amp;mwmhints,
+ PROP_MWM_HINTS_ELEMENTS);
+
+ XMapRaised(display, window[fullscreen]);
+
+ res_h = (DisplayWidth(display, screen) * 1000 / DisplayWidthMM(display, screen));
+ res_v = (DisplayHeight(display, screen) * 1000 / DisplayHeightMM(display, screen));
+ XSync(display, False);
+ XUnlockDisplay(display);
+
+ /* filling in the xine visual struct */
+ vis.display = display;
+ vis.screen = screen;
+ vis.d = window[fullscreen];
+ vis.dest_size_cb = dest_size_cb;
+ vis.frame_output_cb = frame_output_cb;
+ vis.user_data = NULL;
+ pixel_aspect = res_v / res_h;
+
+ /* opening xine output ports */
+ vo_port = xine_open_video_driver(xine, vo_driver, XINE_VISUAL_TYPE_X11, (void *)&amp;vis);
+ ao_port = xine_open_audio_driver(xine , ao_driver, NULL);
+
+ /* open a xine stream connected to these ports */
+ stream = xine_stream_new(xine, ao_port, vo_port);
+ /* hook our event handler into the streams events */
+ event_queue = xine_event_new_queue(stream);
+ xine_event_create_listener_thread(event_queue, event_listener, NULL);
+
+ /* make the video window visible to xine */
+ xine_port_send_gui_data(vo_port, XINE_GUI_SEND_DRAWABLE_CHANGED, (void *) window[fullscreen]);
+ xine_port_send_gui_data(vo_port, XINE_GUI_SEND_VIDEOWIN_VISIBLE, (void *) 1);
+
+ /* start playback */
+ if (!xine_open(stream, mrl) || !xine_play(stream, 0, 0)) {
+ printf("Unable to open mrl '%s'\n", mrl);
+ return 1;
+ }
+
+ while (running) {
+ XEvent xevent;
+ int got_event;
+
+ XLockDisplay(display);
+ got_event = XPending(display);
+ if( got_event )
+ XNextEvent(display, &amp;xevent);
+ XUnlockDisplay(display);
+
+ if( !got_event ) {
+ xine_usec_sleep(20000);
+ continue;
+ }
+
+ switch(xevent.type) {
+
+ case KeyPress:
+ {
+ XKeyEvent kevent;
+ KeySym ksym;
+ char kbuf[256];
+ int len;
+
+ kevent = xevent.xkey;
+
+ XLockDisplay(display);
+ len = XLookupString(&amp;kevent, kbuf, sizeof(kbuf), &amp;ksym, NULL);
+ XUnlockDisplay(display);
+
+ switch (ksym) {
+
+ case XK_q:
+ case XK_Q:
+ /* user pressed q => quit */
+ running = 0;
+ break;
+
+ case XK_f:
+ case XK_F:
+ {
+ /* user pressed f => toggle fullscreen */
+ Window tmp_win;
+
+ XLockDisplay(display);
+ XUnmapWindow(display, window[fullscreen]);
+ fullscreen = !fullscreen;
+ XMapRaised(display, window[fullscreen]);
+ XSync(display, False);
+ XTranslateCoordinates(display, window[fullscreen],
+ DefaultRootWindow(display),
+ 0, 0, &amp;xpos, &amp;ypos, &amp;tmp_win);
+ XUnlockDisplay(display);
+
+ xine_port_send_gui_data(vo_port, XINE_GUI_SEND_DRAWABLE_CHANGED,
+ (void*) window[fullscreen]);
+ }
+ break;
+
+ case XK_Up:
+ /* cursor up => increase volume */
+ xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME,
+ (xine_get_param(stream, XINE_PARAM_AUDIO_VOLUME) + 1));
+ break;
+
+ case XK_Down:
+ /* cursor down => decrease volume */
+ xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME,
+ (xine_get_param(stream, XINE_PARAM_AUDIO_VOLUME) - 1));
+ break;
+
+ case XK_plus:
+ /* plus => next audio channel */
+ xine_set_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL,
+ (xine_get_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL) + 1));
+ break;
+
+ case XK_minus:
+ /* minus => previous audio channel */
+ xine_set_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL,
+ (xine_get_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL) - 1));
+ break;
+
+ case XK_space:
+ /* space => toggle pause mode */
+ if (xine_get_param(stream, XINE_PARAM_SPEED) != XINE_SPEED_PAUSE)
+ xine_set_param(stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE);
+ else
+ xine_set_param(stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL);
+ break;
+
+ }
+ }
+ break;
+
+ case Expose:
+ /* this handles (partial) occlusion of our video window */
+ if (xevent.xexpose.count != 0)
+ break;
+ xine_port_send_gui_data(vo_port, XINE_GUI_SEND_EXPOSE_EVENT, &amp;xevent);
+ break;
+
+ case ConfigureNotify:
+ {
+ XConfigureEvent *cev = (XConfigureEvent *) &amp;xevent;
+ Window tmp_win;
+
+ width = cev-&gt;width;
+ height = cev-&gt;height;
+
+ if ((cev-&gt;x == 0) &amp;&amp; (cev-&gt;y == 0)) {
+ XLockDisplay(display);
+ XTranslateCoordinates(display, cev-&gt;window,
+ DefaultRootWindow(cev-&gt;display),
+ 0, 0, &amp;xpos, &amp;ypos, &amp;tmp_win);
+ XUnlockDisplay(display);
+ } else {
+ xpos = cev-&gt;x;
+ ypos = cev-&gt;y;
+ }
+ }
+ break;
+
+ }
+ }
+
+ /* cleanup */
+ xine_close(stream);
+ xine_event_dispose_queue(event_queue);
+ xine_dispose(stream);
+ xine_close_audio_driver(xine, ao_port);
+ xine_close_video_driver(xine, vo_port);
+ xine_exit(xine);
+
+ XLockDisplay(display);
+ XUnmapWindow(display, window[fullscreen]);
+ XDestroyWindow(display, window[0]);
+ XDestroyWindow(display, window[1]);
+ XUnlockDisplay(display);
+
+ XCloseDisplay (display);
+
+ return 0;
+}</programlisting>
+ </sect2>
+ </sect1>
+
+</chapter>
diff --git a/doc/hackersguide/library.fig b/doc/hackersguide/library.fig
deleted file mode 100644
index ec33d0f32..000000000
--- a/doc/hackersguide/library.fig
+++ /dev/null
@@ -1,313 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Metric
-A4
-100.00
-Single
--2
-1200 2
-6 900 405 1350 855
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 900 450 1080 450 1080 855
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 1170 855 1170 450 1350 450
--6
-6 1890 7470 3330 7965
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 1890 7470 3330 7470 3330 7965 1890 7965 1890 7470
-4 0 0 50 0 20 11 0.0000 4 150 885 2205 7740 xine_stream_t\001
--6
-6 3330 7335 4365 8055
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 3330 7695 3510 7335 4185 7335 4365 7695 4185 8055 3510 8055
- 3330 7695
-4 0 0 50 0 20 11 0.0000 4 165 930 3420 7740 xine_post_wire\001
--6
-6 3915 6210 7335 8235
-6 4770 6705 5220 7155
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 4770 6750 4950 6750 4950 7155
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 5040 7155 5040 6750 5220 6750
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 4635 7425 5445 7425 5445 7155
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4635 7155 7065 7155 7065 8235 4635 8235 4635 7155
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
- 4635 8235 4365 8235 4365 7155 4635 7155
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
- 7065 8235 7335 8235 7335 7155 7065 7155
-4 0 0 50 0 20 11 0.0000 4 165 1785 3915 6570 xine_list_post_plugins_typed\001
-4 0 0 50 0 20 11 0.0000 4 165 1365 3915 6345 xine_list_post_plugins\001
-4 0 0 50 0 20 11 0.0000 4 165 1155 5265 6795 xine_post_dispose\001
-4 0 0 50 0 20 11 0.0000 4 165 720 4680 7335 xine_post_t\001
-4 0 0 50 0 20 11 0.0000 4 165 855 3915 6795 xine_post_init\001
-4 0 0 50 0 20 11 1.5708 4 165 900 4545 8100 xine_post_in_t\001
-4 0 0 50 0 20 11 1.5708 4 165 990 7245 8145 xine_post_out_t\001
-4 0 0 50 0 20 11 0.0000 4 165 1065 6075 7875 xine_post_output\001
-4 0 0 50 0 20 11 0.0000 4 165 1395 4680 7875 xine_post_list_outputs\001
-4 0 0 50 0 20 11 0.0000 4 165 1305 4680 7650 xine_post_list_inputs\001
-4 0 0 50 0 20 11 0.0000 4 165 975 6075 7650 xine_post_input\001
--6
-6 7335 7335 8370 8055
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 7335 7695 7515 7335 8190 7335 8370 7695 8190 8055 7515 8055
- 7335 7695
-4 0 0 50 0 20 11 0.0000 4 165 930 7425 7740 xine_post_wire\001
--6
-6 8370 7425 9630 7920
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 8390 7438 9630 7438 9630 7920 8390 7920 8390 7438
-4 0 0 50 0 20 11 0.0000 4 165 720 8705 7708 xine_post_t\001
--6
-6 9630 7335 11520 8055
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 9630 7695 9810 7335 11340 7335 11520 7695 11340 8055 9810 8055
- 9630 7695
-4 0 0 50 0 20 11 0.0000 4 165 1650 9765 7740 xine_post_wire_video_port\001
--6
-6 11520 7425 12780 7920
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 11540 7438 12780 7438 12780 7920 11540 7920 11540 7438
-4 0 0 50 0 20 11 0.0000 4 165 1095 11655 7708 xine_video_port_t\001
--6
-6 2250 5580 2970 7470
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 2610 7470 2250 7290 2250 5760 2610 5580 2970 5760 2970 7290
- 2610 7470
-4 0 0 50 0 20 11 1.5708 4 150 1680 2655 7335 xine_stream_master_slave\001
--6
-6 10215 2565 13635 4005
-6 11655 2790 12105 3240
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 11655 2835 11835 2835 11835 3240
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 11925 3240 11925 2835 12105 2835
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 11520 3510 12690 3510 12690 3240
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 11520 3240 13590 3240 13590 4005 11520 4005 11520 3240
-4 0 0 50 0 20 11 0.0000 4 165 1890 10215 2700 xine_list_video_output_plugins\001
-4 0 0 50 0 20 11 0.0000 4 150 1485 12150 2880 xine_close_video_driver\001
-4 0 0 50 0 20 11 0.0000 4 165 1455 10215 2880 xine_open_video_driver\001
-4 0 0 50 0 20 11 0.0000 4 165 1095 11565 3420 xine_video_port_t\001
-4 0 0 50 0 20 11 0.0000 4 165 1545 11655 3780 xine_port_send_gui_data\001
--6
-6 9630 4995 11520 5715
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 9630 5355 9810 4995 11340 4995 11520 5355 11340 5715 9810 5715
- 9630 5355
-4 0 0 50 0 20 11 0.0000 4 165 1650 9765 5400 xine_post_wire_audio_port\001
--6
-6 8370 5085 9630 5580
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 8390 5098 9630 5098 9630 5580 8390 5580 8390 5098
-4 0 0 50 0 20 11 0.0000 4 165 720 8705 5368 xine_post_t\001
--6
-6 10215 4185 13635 5625
-6 11655 4410 12105 4860
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 11655 4455 11835 4455 11835 4860
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 11925 4860 11925 4455 12105 4455
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 11520 5130 12690 5130 12690 4860
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 11520 4860 13590 4860 13590 5625 11520 5625 11520 4860
-4 0 0 50 0 20 11 0.0000 4 165 1890 10215 4320 xine_list_audio_output_plugins\001
-4 0 0 50 0 20 11 0.0000 4 150 1485 12150 4500 xine_close_audio_driver\001
-4 0 0 50 0 20 11 0.0000 4 165 1455 10215 4500 xine_open_audio_driver\001
-4 0 0 50 0 20 11 0.0000 4 165 1095 11565 5040 xine_audio_port_t\001
--6
-6 945 3060 7290 5580
-6 2025 3105 2475 3555
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 2025 3150 2205 3150 2205 3555
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 2295 3555 2295 3150 2475 3150
--6
-6 7020 3555 7290 5580
-6 7065 3555 7245 4545
-4 0 0 50 0 20 11 1.5708 4 165 990 7200 4545 xine_post_out_t\001
--6
-6 7065 4545 7245 5535
-4 0 0 50 0 20 11 1.5708 4 165 990 7200 5535 xine_post_out_t\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 7020 4590 7290 4590
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 4
- 7020 5580 7290 5580 7290 3555 7020 3555
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 1890 3825 2835 3825 2835 3555
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 1890 3555 7020 3555 7020 5580 1890 5580 1890 3555
-4 0 0 50 0 20 11 0.0000 4 165 885 3015 4545 xine_get_error\001
-4 0 0 50 0 20 11 0.0000 4 165 990 3015 4770 xine_get_status\001
-4 0 0 50 0 20 11 0.0000 4 165 1275 3015 4995 xine_get_pos_length\001
-4 0 0 50 0 20 11 0.0000 4 165 1260 3015 5220 xine_get_audio_lang\001
-4 0 0 50 0 20 11 0.0000 4 165 1155 3015 5445 xine_get_spu_lang\001
-4 0 0 50 0 20 11 0.0000 4 165 630 2115 4095 xine_open\001
-4 0 0 50 0 20 11 0.0000 4 165 585 2115 4320 xine_play\001
-4 0 0 50 0 20 11 0.0000 4 165 600 2115 4545 xine_stop\001
-4 0 0 50 0 20 11 0.0000 4 150 660 2115 4770 xine_close\001
-4 0 0 50 0 20 11 0.0000 4 165 630 2115 4995 xine_eject\001
-4 0 0 50 0 20 11 0.0000 4 165 990 3015 4095 xine_set_param\001
-4 0 0 50 0 20 11 0.0000 4 165 990 3015 4320 xine_get_param\001
-4 0 0 50 0 20 11 0.0000 4 165 1320 2520 3195 xine_stream_dispose\001
-4 0 0 50 0 20 11 0.0000 4 150 885 1935 3735 xine_stream_t\001
-4 0 0 50 0 20 11 0.0000 4 150 1095 945 3195 xine_stream_new\001
-4 0 0 50 0 20 11 0.0000 4 165 1470 5535 4095 xine_get_current_frame\001
-4 0 0 50 0 20 11 0.0000 4 165 1380 5535 4320 xine_get_current_vpts\001
-4 0 0 50 0 20 11 0.0000 4 150 1020 5535 4545 xine_trick_mode\001
-4 0 0 50 0 20 11 0.0000 4 165 1425 5535 4995 xine_get_audio_source\001
-4 0 0 50 0 20 11 0.0000 4 165 1425 5535 5220 xine_get_video_source\001
-4 0 0 50 0 20 11 0.0000 4 165 1335 4185 4095 xine_get_stream_info\001
-4 0 0 50 0 20 11 0.0000 4 165 1215 4185 4320 xine_get_meta_info\001
--6
-6 945 1260 2430 1890
-4 0 0 50 0 20 11 0.0000 4 150 510 945 1395 xine_init\001
-4 0 0 50 0 20 11 0.0000 4 165 1470 945 1620 xine_engine_set_param\001
-4 0 0 50 0 20 11 0.0000 4 165 1470 945 1845 xine_engine_get_param\001
--6
-6 5850 1260 8055 2790
-4 0 0 50 0 20 11 0.0000 4 165 1395 5850 1395 xine_get_browse_mrls\001
-4 0 0 50 0 20 11 0.0000 4 165 2190 5850 1620 xine_get_autoplay_input_plugin_ids\001
-4 0 0 50 0 20 11 0.0000 4 165 1470 5850 1845 xine_get_autoplay_mrls\001
-4 0 0 50 0 20 11 0.0000 4 165 1530 5850 2070 xine_get_file_extensions\001
-4 0 0 50 0 20 11 0.0000 4 165 1365 5850 2295 xine_get_mime_types\001
-4 0 0 50 0 20 11 0.0000 4 165 2025 5850 2520 xine_get_demux_for_mime_type\001
-4 0 0 50 0 20 11 0.0000 4 165 2085 5850 2745 xine_get_input_plugin_description\001
--6
-6 3960 1260 5670 2340
-4 0 0 50 0 20 11 0.0000 4 165 1380 3960 1395 xine_config_register_*\001
-4 0 0 50 0 20 11 0.0000 4 165 1680 3960 1620 xine_config_get_first_entry\001
-4 0 0 50 0 20 11 0.0000 4 165 1710 3960 1845 xine_config_get_next_entry\001
-4 0 0 50 0 20 11 0.0000 4 165 1575 3960 2070 xine_config_lookup_entry\001
-4 0 0 50 0 20 11 0.0000 4 165 1590 3960 2295 xine_config_update_entry\001
--6
-6 2655 1260 3780 1890
-4 0 0 50 0 20 11 0.0000 4 165 1035 2655 1395 xine_config_load\001
-4 0 0 50 0 20 11 0.0000 4 165 1080 2655 1620 xine_config_save\001
-4 0 0 50 0 20 11 0.0000 4 165 1095 2655 1845 xine_config_reset\001
--6
-6 2655 9630 6345 12150
-6 4005 9675 4455 10125
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 4005 9720 4185 9720 4185 10125
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 4275 10125 4275 9720 4455 9720
--6
-6 3825 10485 6255 11295
-6 4725 10575 5175 11025
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 4725 10620 4905 10620 4905 11025
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 4995 11025 4995 10620 5175 10620
--6
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 4455 11025 5445 11025 5445 11295 4455 11295 4455 11025
-4 0 0 50 0 20 11 0.0000 4 150 795 4590 11205 xine_event_t\001
-4 0 0 50 0 20 11 0.0000 4 150 990 5265 10665 xine_event_free\001
-4 0 0 50 0 20 11 0.0000 4 165 945 3825 10620 xine_event_get\001
-4 0 0 50 0 20 11 0.0000 4 150 1005 3825 10755 xine_event_wait\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 3690 10395 5085 10395 5085 10125
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 3690 10125 6345 10125 6345 11700 3690 11700 3690 10125
-4 0 0 50 0 20 11 0.0000 4 165 1455 2655 9765 xine_event_new_queue\001
-4 0 0 50 0 20 11 0.0000 4 165 1680 4545 9765 xine_event_dispose_queue\001
-4 0 0 50 0 20 11 0.0000 4 165 1245 3780 10305 xine_event_queue_t\001
-4 0 0 50 0 20 11 0.0000 4 150 2130 3825 11565 xine_event_create_listener_thread\001
-4 0 0 50 0 20 11 0.0000 4 150 1050 2655 12105 xine_event_send\001
--6
-6 8415 1260 10710 2340
-4 0 0 50 0 22 11 0.0000 4 165 1605 8415 1395 xine_list_input_plugins\001
-4 0 0 50 0 22 11 0.0000 4 165 1830 8415 1620 xine_list_demuxer_plugins\001
-4 0 0 50 0 22 11 0.0000 4 165 2250 8415 1845 xine_list_video_decoder_plugins\001
-4 0 0 50 0 22 11 0.0000 4 165 2265 8415 2070 xine_list_audio_decoder_plugins\001
-4 0 0 50 0 22 11 0.0000 4 165 1500 8415 2295 xine_list_spu_plugins\001
--6
-6 11115 1260 12870 2340
-4 0 0 50 0 20 11 0.0000 4 165 1725 11115 1395 xine_get_log_section_count\001
-4 0 0 50 0 20 11 0.0000 4 165 1275 11115 1620 xine_get_log_names\001
-4 0 0 50 0 20 11 0.0000 4 165 510 11115 1845 xine_log\001
-4 0 0 50 0 20 11 0.0000 4 165 780 11115 2070 xine_get_log\001
-4 0 0 50 0 20 11 0.0000 4 165 1275 11115 2295 xine_register_log_cb\001
--6
-6 6930 9630 11205 11925
-6 7785 9675 8235 10125
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 7785 9720 7965 9720 7965 10125
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 0 0 1.00 60.00 120.00
- 8055 10125 8055 9720 8235 9720
--6
-6 7605 10485 9225 11790
-4 0 0 50 0 20 11 0.0000 4 150 1065 7605 10620 xine_osd_draw_*\001
-4 0 0 50 0 20 11 0.0000 4 165 1455 7605 11520 xine_osd_set_encoding\001
-4 0 0 50 0 20 11 0.0000 4 150 1140 7605 11295 xine_osd_set_font\001
-4 0 0 50 0 20 11 0.0000 4 165 1470 7605 11070 xine_osd_get_text_size\001
-4 0 0 50 0 20 11 0.0000 4 165 1380 7605 11745 xine_osd_set_position\001
-4 0 0 50 0 20 11 0.0000 4 165 1590 7605 10845 xine_osd_get_capabilities\001
--6
-6 9405 10260 11070 11790
-4 0 0 50 0 20 11 0.0000 4 150 960 9405 10395 xine_osd_show\001
-4 0 0 50 0 20 11 0.0000 4 165 1320 9405 11520 xine_osd_get_palette\001
-4 0 0 50 0 20 11 0.0000 4 165 1635 9405 11295 xine_osd_set_text_palette\001
-4 0 0 50 0 20 11 0.0000 4 150 930 9405 11070 xine_osd_clear\001
-4 0 0 50 0 20 11 0.0000 4 150 885 9405 10845 xine_osd_hide\001
-4 0 0 50 0 20 11 0.0000 4 150 1590 9405 10620 xine_osd_show_unscaled\001
-4 0 0 50 0 20 11 0.0000 4 165 1320 9405 11745 xine_osd_set_palette\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 7470 10395 8325 10395 8325 10125
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 7470 10125 11205 10125 11205 11925 7470 11925 7470 10125
-4 0 0 50 0 20 11 0.0000 4 150 870 8325 9765 xine_osd_free\001
-4 0 0 50 0 20 11 0.0000 4 150 675 7560 10305 xine_osd_t\001
-4 0 0 50 0 20 11 0.0000 4 150 885 6930 9765 xine_osd_new\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 765 1125 1350 1125 1350 855
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 765 855 14085 855 14085 8595 765 8595 765 855
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 7290 3780 7470 3420 11340 3420 11520 3780 11340 4140 7470 4140
- 7290 3780
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 7
- 7290 5355 7470 4995 8190 4995 8370 5355 8190 5715 7470 5715
- 7290 5355
-2 1 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 2520 9000 1890 7470
-2 1 2 1 0 7 50 0 -1 3.000 0 0 -1 0 0 2
- 1890 7965 2520 12510
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 2520 9270 3555 9270 3555 9000
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 2520 9000 11745 9000 11745 12510 2520 12510 2520 9000
-4 0 0 50 0 20 11 0.0000 4 150 375 855 1035 xine_t\001
-4 0 0 50 0 20 11 0.0000 4 150 555 1395 495 xine_exit\001
-4 0 0 50 0 20 11 0.0000 4 150 585 315 495 xine_new\001
-4 0 0 50 0 20 11 0.0000 4 150 1155 2790 495 xine_health_check\001
-4 0 0 50 0 20 11 0.0000 4 150 885 2610 9180 xine_stream_t\001
diff --git a/doc/hackersguide/library.sgml b/doc/hackersguide/library.sgml
deleted file mode 100644
index 8f53d1556..000000000
--- a/doc/hackersguide/library.sgml
+++ /dev/null
@@ -1,410 +0,0 @@
-<chapter id="xine-library">
- <title>Using the xine library</title>
-
- <sect1>
- <title>xine architecture as visible to libxine clients</title>
- <para>
- The following drawing shows the components of xine as outside applications
- see them. For every component, the functions for creating and destroying it
- are given. Every other function works in the context it is enclosed in.
- Functions that facilitate the connection of the individual components are
- also given.
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="library.png" format="PNG">
- </imageobject>
- <imageobject>
- <imagedata fileref="library.eps" format="EPS">
- </imageobject>
- <caption>
- <para>outside view on xine components</para>
- </caption>
- </mediaobject>
- <para>
- The function are named just to give you an overview of what is actually
- there. It is all thoroughly documented in the plublic header
- <filename>xine.h</filename>, which is the main and preferably the only xine
- header, clients should include. (xine/xineutils.h and the XML parser might
- make an exception.)
- </para>
- <para>
- Details on the OSD feature can be found in the <link linkend="osd">OSD section</link>.
- </para>
- </sect1>
-
- <sect1>
- <title>Writing a new frontend to xine</title>
- <para>
- The best way to explain this seems to be actual code. Below you
- will find a very easy and hopefully self-explaining xine frontend
- to give you a start.
- </para>
- <para>
- One important thing to note is that any X11 based xine-lib frontend
- must call <function>XInitThreads()</function> before calling the
- first Xlib function, because xine will access the display from
- within a different thread than the frontend.
- </para>
- <sect2>
- <title>Source code of a simple X11 frontend</title>
- <programlisting>
-/*
-** Copyright (C) 2003 Daniel Caujolle-Bert &lt;segfault@club-internet.fr&gt;
-**
-** 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.
-**
-*/
-
-/*
- * compile-command: "gcc -Wall -O2 `pkg-config --cflags --libs libxine x11` -lm -o xinimin xinimin.c"
- */
-
-#include &lt;stdio.h&gt;
-#include &lt;string.h&gt;
-#include &lt;math.h&gt;
-
-#include &lt;X11/X.h&gt;
-#include &lt;X11/Xlib.h&gt;
-#include &lt;X11/Xutil.h&gt;
-#include &lt;X11/keysym.h&gt;
-#include &lt;X11/Xatom.h&gt;
-#include &lt;X11/Xutil.h&gt;
-#include &lt;X11/extensions/XShm.h&gt;
-
-#include &lt;xine.h&gt;
-#include &lt;xine/xineutils.h&gt;
-
-
-#define MWM_HINTS_DECORATIONS (1L &lt;&lt; 1)
-#define PROP_MWM_HINTS_ELEMENTS 5
-typedef struct {
- uint32_t flags;
- uint32_t functions;
- uint32_t decorations;
- int32_t input_mode;
- uint32_t status;
-} MWMHints;
-
-static xine_t *xine;
-static xine_stream_t *stream;
-static xine_video_port_t *vo_port;
-static xine_audio_port_t *ao_port;
-static xine_event_queue_t *event_queue;
-
-static Display *display;
-static int screen;
-static Window window[2];
-static int xpos, ypos, width, height, fullscreen;
-static double pixel_aspect;
-
-static int running = 1;
-
-#define INPUT_MOTION (ExposureMask | ButtonPressMask | KeyPressMask | \
- ButtonMotionMask | StructureNotifyMask | \
- PropertyChangeMask | PointerMotionMask)
-
-/* this will be called by xine, if it wants to know the target size of a frame */
-static void dest_size_cb(void *data, int video_width, int video_height, double video_pixel_aspect,
- int *dest_width, int *dest_height, double *dest_pixel_aspect) {
- *dest_width = width;
- *dest_height = height;
- *dest_pixel_aspect = pixel_aspect;
-}
-
-/* this will be called by xine when it's about to draw the frame */
-static void frame_output_cb(void *data, int video_width, int video_height,
- double video_pixel_aspect, int *dest_x, int *dest_y,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect, int *win_x, int *win_y) {
- *dest_x = 0;
- *dest_y = 0;
- *win_x = xpos;
- *win_y = ypos;
- *dest_width = width;
- *dest_height = height;
- *dest_pixel_aspect = pixel_aspect;
-}
-
-static void event_listener(void *user_data, const xine_event_t *event) {
- switch(event-&gt;type) {
- case XINE_EVENT_UI_PLAYBACK_FINISHED:
- running = 0;
- break;
-
- case XINE_EVENT_PROGRESS:
- {
- xine_progress_data_t *pevent = (xine_progress_data_t *) event-&gt;data;
-
- printf("%s [%d%%]\n", pevent-&gt;description, pevent-&gt;percent);
- }
- break;
-
- /* you can handle a lot of other interesting events here */
- }
-}
-
-int main(int argc, char **argv) {
- char configfile[2048];
- x11_visual_t vis;
- double res_h, res_v;
- char *vo_driver = "auto";
- char *ao_driver = "auto";
- char *mrl = NULL;
- int i;
- Atom XA_NO_BORDER;
- MWMHints mwmhints;
-
- /* parsing command line */
- for (i = 1; i &lt; argc; i++) {
- if (strcmp(argv[i], "-vo") == 0) {
- vo_driver = argv[++i];
- }
- else if (strcmp(argv[i], "-ao") == 0) {
- ao_driver = argv[++i];
- }
- else
- mrl = argv[i];
- }
-
- if (!mrl) {
- printf("specify an mrl\n");
- return 1;
- }
- printf("mrl: '%s'\n", mrl);
-
- if (!XInitThreads()) {
- printf("XInitThreads() failed\n");
- return 1;
- }
-
- /* load xine config file and init xine */
- xine = xine_new();
- snprintf(configfile, sizeof(configfile), "%s%s", xine_get_homedir(), "/.xine/config");
- xine_config_load(xine, configfile);
- xine_init(xine);
-
- display = XOpenDisplay(NULL);
- screen = XDefaultScreen(display);
- xpos = 0;
- ypos = 0;
- width = 320;
- height = 200;
-
- /* some initalization for the X11 Window we will be showing video in */
- XLockDisplay(display);
- fullscreen = 0;
- window[0] = XCreateSimpleWindow(display, XDefaultRootWindow(display),
- xpos, ypos, width, height, 1, 0, 0);
-
- window[1] = XCreateSimpleWindow(display, XDefaultRootWindow(display),
- 0, 0, (DisplayWidth(display, screen)),
- (DisplayHeight(display, screen)), 0, 0, 0);
-
- XSelectInput(display, window[0], INPUT_MOTION);
-
- XSelectInput(display, window[1], INPUT_MOTION);
-
- XA_NO_BORDER = XInternAtom(display, "_MOTIF_WM_HINTS", False);
- mwmhints.flags = MWM_HINTS_DECORATIONS;
- mwmhints.decorations = 0;
- XChangeProperty(display, window[1],
- XA_NO_BORDER, XA_NO_BORDER, 32, PropModeReplace, (unsigned char *) &amp;mwmhints,
- PROP_MWM_HINTS_ELEMENTS);
-
- XMapRaised(display, window[fullscreen]);
-
- res_h = (DisplayWidth(display, screen) * 1000 / DisplayWidthMM(display, screen));
- res_v = (DisplayHeight(display, screen) * 1000 / DisplayHeightMM(display, screen));
- XSync(display, False);
- XUnlockDisplay(display);
-
- /* filling in the xine visual struct */
- vis.display = display;
- vis.screen = screen;
- vis.d = window[fullscreen];
- vis.dest_size_cb = dest_size_cb;
- vis.frame_output_cb = frame_output_cb;
- vis.user_data = NULL;
- pixel_aspect = res_v / res_h;
-
- /* opening xine output ports */
- vo_port = xine_open_video_driver(xine, vo_driver, XINE_VISUAL_TYPE_X11, (void *)&amp;vis);
- ao_port = xine_open_audio_driver(xine , ao_driver, NULL);
-
- /* open a xine stream connected to these ports */
- stream = xine_stream_new(xine, ao_port, vo_port);
- /* hook our event handler into the streams events */
- event_queue = xine_event_new_queue(stream);
- xine_event_create_listener_thread(event_queue, event_listener, NULL);
-
- /* make the video window visible to xine */
- xine_port_send_gui_data(vo_port, XINE_GUI_SEND_DRAWABLE_CHANGED, (void *) window[fullscreen]);
- xine_port_send_gui_data(vo_port, XINE_GUI_SEND_VIDEOWIN_VISIBLE, (void *) 1);
-
- /* start playback */
- if (!xine_open(stream, mrl) || !xine_play(stream, 0, 0)) {
- printf("Unable to open mrl '%s'\n", mrl);
- return 1;
- }
-
- while (running) {
- XEvent xevent;
- int got_event;
-
- XLockDisplay(display);
- got_event = XPending(display);
- if( got_event )
- XNextEvent(display, &amp;xevent);
- XUnlockDisplay(display);
-
- if( !got_event ) {
- xine_usec_sleep(20000);
- continue;
- }
-
- switch(xevent.type) {
-
- case KeyPress:
- {
- XKeyEvent kevent;
- KeySym ksym;
- char kbuf[256];
- int len;
-
- kevent = xevent.xkey;
-
- XLockDisplay(display);
- len = XLookupString(&amp;kevent, kbuf, sizeof(kbuf), &amp;ksym, NULL);
- XUnlockDisplay(display);
-
- switch (ksym) {
-
- case XK_q:
- case XK_Q:
- /* user pressed q => quit */
- running = 0;
- break;
-
- case XK_f:
- case XK_F:
- {
- /* user pressed f => toggle fullscreen */
- Window tmp_win;
-
- XLockDisplay(display);
- XUnmapWindow(display, window[fullscreen]);
- fullscreen = !fullscreen;
- XMapRaised(display, window[fullscreen]);
- XSync(display, False);
- XTranslateCoordinates(display, window[fullscreen],
- DefaultRootWindow(display),
- 0, 0, &amp;xpos, &amp;ypos, &amp;tmp_win);
- XUnlockDisplay(display);
-
- xine_port_send_gui_data(vo_port, XINE_GUI_SEND_DRAWABLE_CHANGED,
- (void*) window[fullscreen]);
- }
- break;
-
- case XK_Up:
- /* cursor up => increase volume */
- xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME,
- (xine_get_param(stream, XINE_PARAM_AUDIO_VOLUME) + 1));
- break;
-
- case XK_Down:
- /* cursor down => decrease volume */
- xine_set_param(stream, XINE_PARAM_AUDIO_VOLUME,
- (xine_get_param(stream, XINE_PARAM_AUDIO_VOLUME) - 1));
- break;
-
- case XK_plus:
- /* plus => next audio channel */
- xine_set_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL,
- (xine_get_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL) + 1));
- break;
-
- case XK_minus:
- /* minus => previous audio channel */
- xine_set_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL,
- (xine_get_param(stream, XINE_PARAM_AUDIO_CHANNEL_LOGICAL) - 1));
- break;
-
- case XK_space:
- /* space => toggle pause mode */
- if (xine_get_param(stream, XINE_PARAM_SPEED) != XINE_SPEED_PAUSE)
- xine_set_param(stream, XINE_PARAM_SPEED, XINE_SPEED_PAUSE);
- else
- xine_set_param(stream, XINE_PARAM_SPEED, XINE_SPEED_NORMAL);
- break;
-
- }
- }
- break;
-
- case Expose:
- /* this handles (partial) occlusion of our video window */
- if (xevent.xexpose.count != 0)
- break;
- xine_port_send_gui_data(vo_port, XINE_GUI_SEND_EXPOSE_EVENT, &amp;xevent);
- break;
-
- case ConfigureNotify:
- {
- XConfigureEvent *cev = (XConfigureEvent *) &amp;xevent;
- Window tmp_win;
-
- width = cev-&gt;width;
- height = cev-&gt;height;
-
- if ((cev-&gt;x == 0) &amp;&amp; (cev-&gt;y == 0)) {
- XLockDisplay(display);
- XTranslateCoordinates(display, cev-&gt;window,
- DefaultRootWindow(cev-&gt;display),
- 0, 0, &amp;xpos, &amp;ypos, &amp;tmp_win);
- XUnlockDisplay(display);
- } else {
- xpos = cev-&gt;x;
- ypos = cev-&gt;y;
- }
- }
- break;
-
- }
- }
-
- /* cleanup */
- xine_close(stream);
- xine_event_dispose_queue(event_queue);
- xine_dispose(stream);
- xine_close_audio_driver(xine, ao_port);
- xine_close_video_driver(xine, vo_port);
- xine_exit(xine);
-
- XLockDisplay(display);
- XUnmapWindow(display, window[fullscreen]);
- XDestroyWindow(display, window[0]);
- XDestroyWindow(display, window[1]);
- XUnlockDisplay(display);
-
- XCloseDisplay (display);
-
- return 0;
-}</programlisting>
- </sect2>
- </sect1>
-
-</chapter>
diff --git a/doc/hackersguide/library.svg b/doc/hackersguide/library.svg
new file mode 100644
index 000000000..b96101c45
--- /dev/null
+++ b/doc/hackersguide/library.svg
@@ -0,0 +1,1732 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Creator: fig2dev Version 3.2 Patchlevel 5 -->
+<!-- CreationDate: Sat Jun 2 20:32:50 2007 -->
+<!-- Magnification: 1.050 -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="12.1in"
+ height="10.7in"
+ viewBox="314 346 14485 12800"
+ id="svg2178"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ sodipodi:docname="library.svg"
+ sodipodi:docbase="/home/flame/devel/repos/xine/xine-lib-1.2-newdocbook/doc/hackersguide"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata2549">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs2547" />
+ <sodipodi:namedview
+ inkscape:window-height="611"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="1"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.42263759"
+ inkscape:cx="544.5"
+ inkscape:cy="557.3407"
+ inkscape:window-x="552"
+ inkscape:window-y="330"
+ inkscape:current-layer="svg2178" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ id="rect2569"
+ width="14823.248"
+ height="13218.187"
+ x="125.1688"
+ y="152.64401" />
+ <g
+ style="stroke-width:.025in; stroke:black; fill:none"
+ id="g2180">
+<!-- Line --> <polyline
+ points="944,472 1133,472 1133,879 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2182" />
+<!-- Arrowhead on XXXpoint 1133 472 - 1133 913--> <polyline
+ points="1102 769 1133 895 1165 769 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2184" />
+<!-- Line --> <polyline
+ points="1228,897 1228,472 1399,472 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2186" />
+<!-- Arrowhead on XXXpoint 1228 472 - 1433 472--> <polyline
+ points="1289 503 1415 472 1289 440 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2188" />
+<!-- Line: box --> <rect
+ x="1984"
+ y="7842"
+ width="1511"
+ height="519"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2190" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2314"
+ y="8125"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2192">xine_stream_t</text>
+<!-- Line --> <polygon
+ points="3496,8078 3685,7700 4393,7700 4582,8078 4393,8456 3685,8456 3496,8078 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2194" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3590"
+ y="8125"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2196">xine_post_wire</text>
+<!-- Line --> <polyline
+ points="5007,7086 5196,7086 5196,7493 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2198" />
+<!-- Arrowhead on XXXpoint 5196 7086 - 5196 7527--> <polyline
+ points="5165 7383 5196 7509 5228 7383 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2200" />
+<!-- Line --> <polyline
+ points="5291,7511 5291,7086 5462,7086 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2202" />
+<!-- Arrowhead on XXXpoint 5291 7086 - 5496 7086--> <polyline
+ points="5352 7118 5478 7086 5352 7055 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2204" />
+<!-- Line --> <polyline
+ points="4866,7795 5716,7795 5716,7511 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2206" />
+<!-- Line: box --> <rect
+ x="4866"
+ y="7511"
+ width="2551"
+ height="1133"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2208" />
+<!-- Line --> <polyline
+ points="4866,8645 4582,8645 4582,7511 4866,7511 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2210" />
+<!-- Line --> <polyline
+ points="7417,8645 7700,8645 7700,7511 7417,7511 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2212" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4110"
+ y="6897"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2214">xine_list_post_plugins_typed</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4110"
+ y="6661"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2216">xine_list_post_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5527"
+ y="7133"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2218">xine_post_dispose</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4913"
+ y="7700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2220">xine_post_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4110"
+ y="7133"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2222">xine_post_init</text>
+<!-- Text --> <g
+ transform="translate(4771,8503) rotate(-90.00021046)"
+ id="g2224">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2226">xine_post_in_t</text>
+ </g>
+<!-- Text --> <g
+ transform="translate(7606,8551) rotate(-90.00021046)"
+ id="g2228">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2230">xine_post_out_t</text>
+ </g>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6377"
+ y="8267"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2232">xine_post_output</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4913"
+ y="8267"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2234">xine_post_list_outputs</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4913"
+ y="8031"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2236">xine_post_list_inputs</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6377"
+ y="8031"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2238">xine_post_input</text>
+<!-- Line --> <polygon
+ points="7700,8078 7889,7700 8598,7700 8787,8078 8598,8456 7889,8456 7700,8078 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2240" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7795"
+ y="8125"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2242">xine_post_wire</text>
+<!-- Line: box --> <rect
+ x="8808"
+ y="7808"
+ width="1301"
+ height="506"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2244" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9139"
+ y="8092"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2246">xine_post_t</text>
+<!-- Line --> <polygon
+ points="10110,8078 10299,7700 11905,7700 12094,8078 11905,8456 10299,8456 10110,8078 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2248" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10251"
+ y="8125"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2250">xine_post_wire_video_port</text>
+<!-- Line: box --> <rect
+ x="12115"
+ y="7808"
+ width="1301"
+ height="506"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2252" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12236"
+ y="8092"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2254">xine_video_port_t</text>
+<!-- Line --> <polygon
+ points="2740,7842 2362,7653 2362,6047 2740,5858 3118,6047 3118,7653 2740,7842 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2256" />
+<!-- Text --> <g
+ transform="translate(2787,7700) rotate(-90.00021046)"
+ id="g2258">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2260">xine_stream_master_slave</text>
+ </g>
+<!-- Line --> <polyline
+ points="12236,2976 12425,2976 12425,3383 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2262" />
+<!-- Arrowhead on XXXpoint 12425 2976 - 12425 3417--> <polyline
+ points="12393 3273 12425 3399 12456 3273 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2264" />
+<!-- Line --> <polyline
+ points="12519,3401 12519,2976 12690,2976 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2266" />
+<!-- Arrowhead on XXXpoint 12519 2976 - 12724 2976--> <polyline
+ points="12580 3007 12706 2976 12580 2944 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2268" />
+<!-- Line --> <polyline
+ points="12094,3685 13322,3685 13322,3401 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2270" />
+<!-- Line: box --> <rect
+ x="12094"
+ y="3401"
+ width="2173"
+ height="803"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2272" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10724"
+ y="2834"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2274">xine_list_video_output_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12755"
+ y="3023"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2276">xine_close_video_driver</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10724"
+ y="3023"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2278">xine_open_video_driver</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12141"
+ y="3590"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2280">xine_video_port_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12236"
+ y="3968"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2282">xine_port_send_gui_data</text>
+<!-- Line --> <polygon
+ points="10110,5622 10299,5244 11905,5244 12094,5622 11905,6000 10299,6000 10110,5622 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2284" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10251"
+ y="5669"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2286">xine_post_wire_audio_port</text>
+<!-- Line: box --> <rect
+ x="8808"
+ y="5352"
+ width="1301"
+ height="506"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2288" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9139"
+ y="5635"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2290">xine_post_t</text>
+<!-- Line --> <polyline
+ points="12236,4677 12425,4677 12425,5084 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2292" />
+<!-- Arrowhead on XXXpoint 12425 4677 - 12425 5118--> <polyline
+ points="12393 4974 12425 5100 12456 4974 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2294" />
+<!-- Line --> <polyline
+ points="12519,5102 12519,4677 12690,4677 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2296" />
+<!-- Arrowhead on XXXpoint 12519 4677 - 12724 4677--> <polyline
+ points="12580 4708 12706 4677 12580 4645 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2298" />
+<!-- Line --> <polyline
+ points="12094,5385 13322,5385 13322,5102 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2300" />
+<!-- Line: box --> <rect
+ x="12094"
+ y="5102"
+ width="2173"
+ height="803"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2302" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10724"
+ y="4535"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2304">xine_list_audio_output_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12755"
+ y="4724"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2306">xine_close_audio_driver</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10724"
+ y="4724"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2308">xine_open_audio_driver</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="12141"
+ y="5291"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2310">xine_audio_port_t</text>
+<!-- Line --> <polyline
+ points="2125,3307 2314,3307 2314,3714 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2312" />
+<!-- Arrowhead on XXXpoint 2314 3307 - 2314 3748--> <polyline
+ points="2283 3604 2314 3730 2346 3604 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2314" />
+<!-- Line --> <polyline
+ points="2409,3732 2409,3307 2580,3307 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2316" />
+<!-- Arrowhead on XXXpoint 2409 3307 - 2614 3307--> <polyline
+ points="2470 3338 2596 3307 2470 3275 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2318" />
+<!-- Text --> <g
+ transform="translate(7559,4771) rotate(-90.00021046)"
+ id="g2320">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2322">xine_post_out_t</text>
+ </g>
+<!-- Text --> <g
+ transform="translate(7559,5811) rotate(-90.00021046)"
+ id="g2324">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2326">xine_post_out_t</text>
+ </g>
+<!-- Line --> <polyline
+ points="7370,4818 7653,4818 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2328" />
+<!-- Line --> <polyline
+ points="7370,5858 7653,5858 7653,3732 7370,3732 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2330" />
+<!-- Line --> <polyline
+ points="1984,4015 2976,4015 2976,3732 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2332" />
+<!-- Line: box --> <rect
+ x="1984"
+ y="3732"
+ width="5385"
+ height="2125"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2334" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="4771"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2336">xine_get_error</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="5007"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2338">xine_get_status</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="5244"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2340">xine_get_pos_length</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="5480"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2342">xine_get_audio_lang</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="5716"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2344">xine_get_spu_lang</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2220"
+ y="4299"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2346">xine_open</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2220"
+ y="4535"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2348">xine_play</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2220"
+ y="4771"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2350">xine_stop</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2220"
+ y="5007"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2352">xine_close</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2220"
+ y="5244"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2354">xine_eject</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="4299"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2356">xine_set_param</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3165"
+ y="4535"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2358">xine_get_param</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2645"
+ y="3354"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2360">xine_stream_dispose</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2031"
+ y="3921"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2362">xine_stream_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="992"
+ y="3354"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2364">xine_stream_new</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5811"
+ y="4299"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2366">xine_get_current_frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5811"
+ y="4535"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2368">xine_get_current_vpts</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5811"
+ y="4771"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2370">xine_trick_mode</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5811"
+ y="5244"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2372">xine_get_audio_source</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5811"
+ y="5480"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2374">xine_get_video_source</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4393"
+ y="4299"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2376">xine_get_stream_info</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4393"
+ y="4535"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2378">xine_get_meta_info</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="992"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2380">xine_init</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="992"
+ y="1700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2382">xine_engine_set_param</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="992"
+ y="1937"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2384">xine_engine_get_param</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2386">xine_get_browse_mrls</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="1700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2388">xine_get_autoplay_input_plugin_ids</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="1937"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2390">xine_get_autoplay_mrls</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="2173"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2392">xine_get_file_extensions</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="2409"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2394">xine_get_mime_types</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="2645"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2396">xine_get_demux_for_mime_type</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6141"
+ y="2881"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2398">xine_get_input_plugin_description</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4157"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2400">xine_config_register_*</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4157"
+ y="1700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2402">xine_config_get_first_entry</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4157"
+ y="1937"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2404">xine_config_get_next_entry</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4157"
+ y="2173"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2406">xine_config_lookup_entry</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4157"
+ y="2409"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2408">xine_config_update_entry</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2410">xine_config_load</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="1700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2412">xine_config_save</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="1937"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2414">xine_config_reset</text>
+<!-- Line --> <polyline
+ points="4204,10204 4393,10204 4393,10612 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2416" />
+<!-- Arrowhead on XXXpoint 4393 10204 - 4393 10645--> <polyline
+ points="4362 10501 4393 10627 4425 10501 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2418" />
+<!-- Line --> <polyline
+ points="4488,10629 4488,10204 4659,10204 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2420" />
+<!-- Arrowhead on XXXpoint 4488 10204 - 4692 10204--> <polyline
+ points="4549 10236 4675 10204 4549 10173 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2422" />
+<!-- Line --> <polyline
+ points="4960,11149 5149,11149 5149,11556 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2424" />
+<!-- Arrowhead on XXXpoint 5149 11149 - 5149 11590--> <polyline
+ points="5118 11446 5149 11572 5181 11446 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2426" />
+<!-- Line --> <polyline
+ points="5244,11574 5244,11149 5415,11149 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2428" />
+<!-- Arrowhead on XXXpoint 5244 11149 - 5448 11149--> <polyline
+ points="5304 11181 5430 11149 5304 11118 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2430" />
+<!-- Line: box --> <rect
+ x="4677"
+ y="11574"
+ width="1039"
+ height="283"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2432" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4818"
+ y="11763"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2434">xine_event_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5527"
+ y="11196"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2436">xine_event_free</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="11149"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2438">xine_event_get</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="11291"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2440">xine_event_wait</text>
+<!-- Line --> <polyline
+ points="3874,10913 5338,10913 5338,10629 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2442" />
+<!-- Line: box --> <rect
+ x="3874"
+ y="10629"
+ width="2787"
+ height="1653"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2444" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="10251"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2446">xine_event_new_queue</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4771"
+ y="10251"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2448">xine_event_dispose_queue</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3968"
+ y="10818"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2450">xine_event_queue_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="12141"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2452">xine_event_create_listener_thread</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2787"
+ y="12708"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2454">xine_event_send</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8834"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="bold"
+ font-size="139"
+ text-anchor="start"
+ id="text2456">xine_list_input_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8834"
+ y="1700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="bold"
+ font-size="139"
+ text-anchor="start"
+ id="text2458">xine_list_demuxer_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8834"
+ y="1937"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="bold"
+ font-size="139"
+ text-anchor="start"
+ id="text2460">xine_list_video_decoder_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8834"
+ y="2173"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="bold"
+ font-size="139"
+ text-anchor="start"
+ id="text2462">xine_list_audio_decoder_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8834"
+ y="2409"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="bold"
+ font-size="139"
+ text-anchor="start"
+ id="text2464">xine_list_spu_plugins</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11669"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2466">xine_get_log_section_count</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11669"
+ y="1700"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2468">xine_get_log_names</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11669"
+ y="1937"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2470">xine_log</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11669"
+ y="2173"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2472">xine_get_log</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="11669"
+ y="2409"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2474">xine_register_log_cb</text>
+<!-- Line --> <polyline
+ points="8173,10204 8362,10204 8362,10612 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2476" />
+<!-- Arrowhead on XXXpoint 8362 10204 - 8362 10645--> <polyline
+ points="8330 10501 8362 10627 8393 10501 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2478" />
+<!-- Line --> <polyline
+ points="8456,10629 8456,10204 8627,10204 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2480" />
+<!-- Arrowhead on XXXpoint 8456 10204 - 8661 10204--> <polyline
+ points="8517 10236 8643 10204 8517 10173 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline2482" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="11149"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2484">xine_osd_draw_*</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="12094"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2486">xine_osd_set_encoding</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="11858"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2488">xine_osd_set_font</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="11622"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2490">xine_osd_get_text_size</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="12330"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2492">xine_osd_set_position</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7984"
+ y="11385"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2494">xine_osd_get_capabilities</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="10913"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2496">xine_osd_show</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="12094"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2498">xine_osd_get_palette</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="11858"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2500">xine_osd_set_text_palette</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="11622"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2502">xine_osd_clear</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="11385"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2504">xine_osd_hide</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="11149"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2506">xine_osd_show_unscaled</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9874"
+ y="12330"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2508">xine_osd_set_palette</text>
+<!-- Line --> <polyline
+ points="7842,10913 8740,10913 8740,10629 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2510" />
+<!-- Line: box --> <rect
+ x="7842"
+ y="10629"
+ width="3921"
+ height="1889"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2512" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8740"
+ y="10251"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2514">xine_osd_free</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7937"
+ y="10818"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2516">xine_osd_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7275"
+ y="10251"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2518">xine_osd_new</text>
+<!-- Line --> <polyline
+ points="803,1181 1417,1181 1417,897 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2520" />
+<!-- Line: box --> <rect
+ x="803"
+ y="897"
+ width="13984"
+ height="8125"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2522" />
+<!-- Line --> <polygon
+ points="7653,3968 7842,3590 11905,3590 12094,3968 11905,4346 7842,4346 7653,3968 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2524" />
+<!-- Line --> <polygon
+ points="7653,5622 7842,5244 8598,5244 8787,5622 8598,6000 7842,6000 7653,5622 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon2526" />
+<!-- Line --> <polyline
+ points="2645,9448 1984,7842 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:10 31;"
+ id="polyline2528" />
+<!-- Line --> <polyline
+ points="1984,8362 2645,13133 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:10 31;"
+ id="polyline2530" />
+<!-- Line --> <polyline
+ points="2645,9732 3732,9732 3732,9448 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline2532" />
+<!-- Line: box --> <rect
+ x="2645"
+ y="9448"
+ width="9685"
+ height="3685"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect2534" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="897"
+ y="1086"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2536">xine_t</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1464"
+ y="519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2538">xine_exit</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="330"
+ y="519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2540">xine_new</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2929"
+ y="519"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2542">xine_health_check</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2740"
+ y="9637"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text2544">xine_stream_t</text>
+ </g>
+</svg>
diff --git a/doc/hackersguide/output.docbook b/doc/hackersguide/output.docbook
new file mode 100644
index 000000000..dc254641d
--- /dev/null
+++ b/doc/hackersguide/output.docbook
@@ -0,0 +1,668 @@
+<chapter id="output">
+ <title>xine's output layer</title>
+
+ <sect1>
+ <title>Post plugin layer</title>
+ <para>
+ In this section you will learn, how the powerful post plugin architecture
+ works and how to write post plugins.
+ </para>
+ <sect2>
+ <title>General principle of post plugins</title>
+ <para>
+ The name "post plugin" comes from "postprocessing" which already describes
+ what these plugins are supposed to do: they take video frames, audio
+ buffers or subpicture planes as they leave the decoders and apply arbitrary
+ processing to them. Then they pass processed elements on to the output
+ loops. Post plugins can not only be chained to process the predecessor's
+ output and advance the data to their successor, they can form arbitrary trees,
+ since post plugins can have any number of inputs and outputs. Additionally,
+ the interconnection of the plugins currently inserted in such a tree can
+ be changed on the fly during playback. The public function
+ <function>xine_post_wire()</function> is used by frontends to form such
+ connections.
+ </para>
+ <para>
+ Due to the variety of possible applications, the interface post plugins have
+ to implement is just the basic foundation. The complexity comes from hooking
+ your post plugin into the engine data paths for video frames and audio buffers,
+ intercepting the data and performing your operation on them. This is done by
+ taking the interface of a video or audio port, replacing some of the functions
+ with your own ones and passing the interface to the decoder or predecessor
+ post plugin that is going to feed you with data by accessing this interface
+ and by doing that, calling the functions you provide. From there you can do
+ almost anything you want. Constructing video frames from audio buffers to
+ visualize sound is possible as well as just outputting an integer giving the
+ average brightness of an image. It is also possible to invent post plugins
+ with no output (not very useful, unless the plugin has some side-effect) or
+ no input at all; for the latter you have to create your own pthread, otherwise
+ your plugin will not do anything. An audio signal generator could be
+ implemented like this. The various data types, post plugins can
+ accept as input or offer as output are defined in <filename>xine.h</filename>
+ as <varname>XINE_POST_DATA_*</varname> defines.
+ </para>
+ <para>
+ Some terminology used in the following explanations:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <varname>down direction</varname>:
+ The direction from the decoders to the output. This is the way video or audio
+ data (actual content and meta information) usually travels through the engine.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>up direction</varname>:
+ The direction from the output to the decoders. This is the way some video or audio
+ metadata like metronom timestamps travel through the engine.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <varname>interception</varname>:
+ Post plugins are inserted into the engine data paths by the means of the decorator
+ design pattern. This works by taking engine structures with member funtions like
+ video or audio ports, video frames or overlay managers and inserting your own functions
+ into a copy of this structure. This is called interception. This modified structure
+ is then passed up to the plugin that uses it and thus calls your replaced functions.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect2>
+ <sect2>
+ <title>Writing a xine post plugin</title>
+ <para>
+ The post plugin API is declared in <filename>src/xine-engine/post.h</filename>
+ The plugin info of post plugins contains the post plugin type, which is one of the
+ <varname>XINE_POST_TYPE_*</varname> defines and the init_class function of the plugin.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;post_plugin_t *open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target);</programlisting>
+ Returns an instance of the plugin. Some post plugins evaluate <varname>inputs</varname>
+ to open a variable number of inputs. Since almost all post plugins have audio or video
+ outputs, you can hand in a NULL-terminated array of ports to connect to these outputs.
+ In this function you can also intercept these ports so that your plugin is actually used.
+ There is a helper function to initialize a <type>post_plugin_t</type>, which you are
+ encouraged to use: <function>_x_post_init()</function>.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;char *get_identifier(post_class_t *class_gen);</programlisting>
+ This function returns a short identifier describing the plugin.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;char *get_description(post_class_t *class_gen);</programlisting>
+ This function returns a plaintext, one-line string describing the plugin.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void dispose(post_class_t *class_gen);</programlisting>
+ This function frees the memory used by the video out plugin class object.
+ </para>
+ <para>
+ The <type>post_plugin_t</type> structure contains the publicly visible
+ part of the post plugin with the audio and video inputs and the type of
+ the post plugin. Not publicly visible are the lists of all inputs and outputs,
+ the <function>dispose()</function> function and some internal stuff which
+ plugins do not have to worry about.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void dispose(post_plugin_t *this_gen);</programlisting>
+ This function frees the memory used by the plugin instance, but not necessarily
+ immediately. Since post plugins enter their own functions into engine structures,
+ they might still be needed when <function>dispose()</function> is being called.
+ They maintain a usage counter to detect that. To check for such a condition, you
+ should use the <function>_x_post_dispose()</function> helper function like that:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;if (_x_post_dispose(this))
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;really_free(this);</programlisting>
+ <function>_x_post_dispose()</function> frees any ressources allocated by any of the
+ post plugin helper functions and returns boolean true, if the plugin is not needed
+ any more.
+ </para>
+ </sect2>
+ <sect2>
+ <title>Interception</title>
+ <para>
+ Currently, we have four engine structures which can be intercepted by post plugins:
+ video ports, video frames, overlay managers and audio ports. You could do this
+ interception manually, but since this is quite a complex process, there are helper
+ functions to assist you and their usage is encouraged.
+ </para>
+ <sect3>
+ <title>Intercepting a video port</title>
+ <para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post,
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xine_video_port_t *port, post_in_t **input, post_out_t **output);</programlisting>
+ This function will intercept <varname>port</varname> and returns a structure
+ for you to pass up. All functions in the port will be replaced with dummy
+ pass through functions that do nothing but relaying the call down to the original
+ port. If you want (that is, <varname>input</varname> or <varname>output</varname> are
+ not NULL), this function will also create the input and output descriptors complete
+ with rewiring functions and add them to the relevant lists.
+ This is required, if you want this port to be advertised by the plugin to the outside world.
+ </para>
+ <para>
+ <type>post_video_port_t</type> makes a variety of interception schemes very easy.
+ If you want to replace any of the default functions with your own, just enter it
+ into <varname>new_port</varname>. You can use <varname>original_port</varname>
+ from within your function to propagate calls down to the original port.
+ The constraint is that your functions have to ensure that every original
+ port held open scores one usage counter point, so that opened ports are always
+ closed before the plugin is disposed. Therefore, you should use the macro
+ <function>_x_post_inc_usage()</function> before calling
+ <function>original_port-&gt;open()</function> and use the macro
+ <function>_x_post_dec_usage()</function> after calling
+ <function>original_port-&gt;close()</function>. Note that <function>_x_post_dec_usage()</function>
+ might dispose the plugin, when <function>dispose()</function> has been called
+ earlier and usage count drops to zero, so do never touch plugin structures after
+ <function>_x_post_dec_usage()</function>. In addition, you must never call a port
+ function of the original port when the port is not open.
+ </para>
+ <para>
+ Intercepting video frames or the overlay manager of the port is even easier.
+ You do not have to reimplement <function>get_frame()</function> or
+ <function>get_overlay_manager()</function>. Just enter a <varname>intercept_frame</varname>
+ or <varname>intercept_ovl</varname> function which returns boolean true, if
+ you want to intercept. The functions to insert in the intercepted frame or overlay
+ manager are taken from <varname>new_frame</varname> and <varname>new_manager</varname>
+ respectively. Note that the defaults are reversed: If you do not enter such a
+ decision function for either one, all frames and no overlay manager will be intercepted.
+ </para>
+ <para>
+ For convenience <type>post_video_port_t</type> also contains pointers to the
+ current stream and to the current post plugin and a user_data pointer, where you
+ can put in anything you need in addition. If your port is used by more than one
+ thread, you can also enforce locking on the port, frame or overlay manager level
+ by entering a lock into <varname>port_lock</varname>, <varname>frame_lock</varname> or
+ <varname>manager_lock</varname> respectively.
+ </para>
+ </sect3>
+ <sect3>
+ <title>Intercepting an audio port</title>
+ <para>
+ Audio port interception is just a stripped down version of video port interception.
+ Everything related to frames and overlay manager is not needed and audio buffers
+ do not need to be intercepted, since they have no member functions. Everything else
+ of the above still applies.
+ </para>
+ </sect3>
+ <sect3>
+ <title>Intercepting overlay manager</title>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void _x_post_intercept_overlay_manager(video_overlay_manager_t *original, post_video_port_t *port);</programlisting>
+ Interception of the overlay manager is done automatically when your
+ <function>intercept_ovl()</function> decision function returns boolean true.
+ Should you ever decide not to use that, interception can be done with this helper
+ function, which simply creates an intercepted overlay manager with dummy
+ pass through functions in <varname>port-&gt;new_manager</varname> and stores the original
+ manager in <varname>port-&gt;original_manager</varname>.
+ </para>
+ <para>
+ No matter how you intercepted the overlay manager, your own replacement
+ functions will receive <varname>port-&gt;new_manager</varname> as the overlay manager
+ argument. But you most likely want to have access to the <type>post_video_port_t</type>
+ from within your functions. For that, there exists a pointer retrieval function:
+ <programlisting>&nbsp;&nbsp;&nbsp;post_video_port_t *_x_post_ovl_manager_to_port(video_overlay_manager_t *manager);</programlisting>
+ </para>
+ </sect3>
+ <sect3>
+ <title>Intercepting a video frame</title>
+ <para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port);
+&nbsp;&nbsp;&nbsp;vo_frame_t *_x_post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port);</programlisting>
+ Interception of video frames is done automatically when your
+ <function>intercept_frame()</function> decision function returns boolean true or
+ when there is no such function in <type>post_video_port_t</type>.
+ Should you ever decide not to use that, interception can be done with the helper
+ function <function>_x_post_intercept_video_frame()</function>.
+ </para>
+ <para>
+ Since the same video frame can be in use in the decoder and in the output and in
+ any post plugin in between at the same time, simply modifying the frame
+ structure does not work, because every user of the frame needs to see his version
+ and the frame must always travel along the same path through the plugins for its
+ entire lifetime. To ensure that, <function>_x_post_intercept_video_frame()</function>
+ provides a shallow copy of the frame structure with the original frame attached to
+ <varname>copy-&gt;next</varname>. This copy will be filled with your own
+ frame functions from <varname>port-&gt;new_frame</varname> and with dummy pass
+ through functions for those you did not provide. This way, every part of xine
+ using this frame will see its own frame structure with a list of frame
+ contexts from down the data path attached to <varname>frame-&gt;next</varname>.
+ <function>_x_post_restore_video_frame()</function> reverses this and should be
+ used when the frame is freed or disposed.
+ </para>
+ <para>
+ Your own replacement functions will receive the copied frame as as argument.
+ But you most likely want to have access to the <type>post_video_port_t</type>
+ from within your functions. For that, there exists a pointer retrieval function:
+ <programlisting>&nbsp;&nbsp;&nbsp;post_video_port_t *_x_post_video_frame_to_port(vo_frame_t *frame);</programlisting>
+ The constraint is that your functions have to ensure that every intercepted
+ frame scores one usage counter point, so that these frames are always
+ freed or disposed before the plugin is disposed. Therefore, you should use the macro
+ <function>_x_post_inc_usage()</function> before calling
+ <function>_x_post_intercept_video_frame()</function> and use the macro
+ <function>_x_post_dec_usage()</function> after calling
+ <function>_x_post_restore_video_frame()</function>. Note that <function>_x_post_dec_usage()</function>
+ might dispose the plugin, when <function>dispose()</function> has been called
+ earlier and usage count drops to zero, so do never touch plugin structures after
+ <function>_x_post_dec_usage()</function>.
+ </para>
+ <para>
+ From within your own frame functions, you can propagate calls to the original
+ frame by calling a function on <varname>frame-&gt;next</varname>. Since
+ modifications to the frame can travel both upwards and downwards (decoders and
+ output can modify the frame), changes need to be copied between the frame
+ structure contexts. You should use the <function>_x_post_frame_copy_down()</function>
+ and <function>_x_post_frame_copy_up()</function> helper functions like that:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;_x_post_frame_copy_down(frame, frame-&gt;next);
+&nbsp;&nbsp;&nbsp;frame-&gt;next-&gt;draw(frame-&gt;next, stream);
+&nbsp;&nbsp;&nbsp;_x_post_frame_copy_up(frame, frame-&gt;next);</programlisting>
+ </para>
+ <para>
+ If your post plugin modifies the content of the frame, you have to modify
+ a deep copy of the frame, because the decoder might still use the frame as
+ a reference frame for future decoding. The usual procedure is:
+ <programlisting>
+&nbsp;&nbsp;&nbsp;modified_frame = port-&gt;original_port-&gt;get_frame(port-&gt;original_port, &hellip;);
+&nbsp;&nbsp;&nbsp;_x_post_frame_copy_down(frame, modified_frame);
+&nbsp;&nbsp;&nbsp;copy_and_modify(frame, modified_frame);
+&nbsp;&nbsp;&nbsp;skip = modified_frame-&gt;draw(modified_frame, stream);
+&nbsp;&nbsp;&nbsp;_x_post_frame_copy_up(frame, modified_frame);
+&nbsp;&nbsp;&nbsp;modified_frame-&gt;free(modified_frame);</programlisting>
+ </para>
+ <para>
+ When the output receives a frame via <function>draw()</function>,
+ it usually receives the stream where the frame
+ originates as well and modifies the state of this stream by passing
+ the frame through the stream's metronom. Sometimes this is unwanted.
+ For example, when you pass the same frame to the output more than once, it
+ will confuse metronom. To solve this, you can call
+ <function>frame-&gt;next-&gt;draw()</function> with NULL as the stream.
+ You might also want to prevent frames from being passed down to the output
+ completely, because your post plugin creates something else from these frames,
+ but does not need them to be drawn. In both these situations, you have
+ to call the helper function <function>_x_post_frame_u_turn()</function>
+ when the frame is drawn, because this does some housekeeping which the
+ decoder might expect to take place.
+ </para>
+ <para>
+ The following diagram summarizes the situations of a video frame passing
+ through a post plugin:
+ </para>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="post_frame.png" format="PNG" />
+ </imageobject>
+ <imageobject>
+ <imagedata fileref="post_frame.eps" format="EPS" />
+ </imageobject>
+ <caption>
+ <para>video frame passing through a post plugin</para>
+ </caption>
+ </mediaobject>
+ </sect3>
+ <sect3>
+ <title>Summary of constraints</title>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Call <function>_x_post_inc_usage()</function> before port <function>open()</function>
+ before any other port function.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Call <function>_x_post_inc_usage()</function> before issueing an intercepted frame.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Call <function>_x_post_dec_usage()</function> after port <function>close()</function>
+ and do not call any port functions after that.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Call <function>_x_post_dec_usage()</function> after restoring a frame.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ When a frame is drawn by your plugin, it must either be drawn on the original
+ port with the correct stream as argument or U-turned (or passed through a
+ private metronom manually).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If your post plugin keeps locked frames, release them when your input port is being
+ closed.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Do not assume your plugin is alive after <function>_x_post_dec_usage()</function>.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </sect3>
+ </sect2>
+ <sect2>
+ <title>Rewiring and the ticket system</title>
+ <para>
+ Rewiring is the reconnection of one post plugin's outputs and another post plugin's
+ inputs. This can happen on the fly during playback, which makes this a very delicate
+ process. In one such input to output connection, only the output is active by either
+ writing data directly to the connected input or by calling functions there. Therefore
+ we have to notify only the output, when it is rewired. This is done by calling the
+ <function>rewire()</function> member function of the corresponding
+ <type>xine_post_out_t</type> when the frontend issues a rewiring on this output.
+ This is done from the frontend thread for the rewire operation to return synchroneously.
+ But since this can happen on the fly, we have to assure that no other thread is relying
+ on the connection while we modify it. For this, threads working within post plugins
+ have to be accounted and on demand suspended in safe positions. For this, xine offers
+ a synchronization facility called "tickets".
+ </para>
+ <sect3>
+ <title>Ticket system principles and operations</title>
+ <para>
+ The idea of the ticket system is based on an extended read-write lock, where there can
+ be many readers in parallel, but only one exclusive writer. A certain interface might
+ require you to have a ticket before calling its functions. The ticket system now
+ allows multiple threads to operate within the component behind the interface by
+ granting as many tickets as needed. But should an outside operation require exclusive
+ access to the component, all granted tickets can be revoked and have to be given back
+ by the threads who hold them, which suspends the threads. After the exclusive
+ operation, tickets will be reissued so all suspended threads can continue where they
+ stopped. We will now look at the ticket primitives in detail:
+ </para>
+ <variablelist>
+ <varlistentry>
+ <term><function>acquire()</function></term>
+ <listitem>
+ <para>
+ You receive a new ticket. If the ticket is currently revoked, you can be blocked
+ until it is reissued. There is one exception to this: You can acquire a revoked
+ ticket, if you revoked it atomic yourself. You can also acquire a ticket irrevocably.
+ Between acquire and release of an irrevocable ticket, it is guaranteed that
+ you will not be blocked by ticket revocation.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><function>release()</function></term>
+ <listitem>
+ <para>
+ You give a ticket back when you do not need it any longer. If the ticket is
+ currently revoked, you can be blocked until it is reissued. If you acquired the
+ ticket irrevocably, you have to release it irrevocably as well.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><function>renew()</function></term>
+ <listitem>
+ <para>
+ You must only call this function, when the ticket has been revoked, so be
+ sure to check <varname>ticket_revoked</varname> before. You give the ticket
+ back and receive a new one. In between, you can be blocked until the ticket is
+ reissued. You have to renew irrevocably, if you cannot assure that the thread holds
+ no irrevocable tickets. If you can assure this, renew revocably.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><function>revoke()</function></term>
+ <listitem>
+ <para>
+ This function can only be called by the xine engine, plugins do not have access to it.
+ It revokes all tickets and after finite time, all threads will run into a
+ <function>acquire()</function>, <function>release()</function> or <function>renew()</function>
+ and will be suspended there. Then the revocation returns and you can modify structures
+ or call functions with the knowledge that all ticket holders will remain in safe
+ positions. When you additionally need exclusive access where no other revoker
+ can interfere, you have to revoke atomic.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><function>issue()</function></term>
+ <listitem>
+ <para>
+ This function can only be called by the xine engine, plugins do not have access to it.
+ It ends ticket revocation and hands out new tickets to all threads that applied with a
+ <function>acquire()</function> or <function>renew()</function>. If you revoked the
+ tickets atomic, you have to issue them atomic.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ <para>
+ When you use the ticket system in any way, you have to obey to the following rules:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Assure to release irrevocable tickets ater a finite time.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Assure to release or renew revocable tickets ater a finite time.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Assure to reissue tickets you revoked atomic after a finite time.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Pair calls properly.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Never revoke a ticket you hold.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Never acquire a ticket you revoked atomic before.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Never acquire a ticket revocable more than once.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ </sect3>
+ <sect3>
+ <title>Ticket handling in decoder and post plugins</title>
+ <para>
+ The contract of the video and audio port interfaces is that you need to have
+ the port ticket, when you want to call functions of these interfaces. The decoder
+ plugins do not have to worry about this at all, since the decoder loops inside the
+ engine handle the ticketing. Post plugins get the ticket assigned by the engine,
+ but usually, a post plugin does not create a new thread, it is called by the
+ decoder thread and therefore already owns the necessary ticket. All port functions
+ are also ticket-safe as they follow all the rules given above.
+ </para>
+ <para>
+ You only have to remember that tickets need to be renewed as soon as possible,
+ when the are revoked. For this, the helper function
+ <function>_x_post_rewire()</function> should be used in prominent locations
+ where it is safe to be suspended. Candidates for such locations are at the
+ beginning of the port's <function>open()</function> and
+ <function>get_frame()</function>/<function>get_buffer()</function> functions.
+ The default pass through implementations for intercepted ports already do this.
+ </para>
+ <para>
+ The port tickets are revoked, whenever a rewiring takes place or the engine
+ switches into pause mode. The tickets are reissued, when the rewiring is finished
+ or the engine switches from pause mode into playback. Some post plugins might
+ contain critical parts, where they must not be interrupted by a rewire or pause.
+ These sections can be enclosed in <function>_x_post_lock()</function> and
+ <function>_x_post_unlock()</function>, which will simply acquire and release an
+ irrevocable ticket for you. As long as you hold such a ticket, it is guaranteed
+ that you will never be interrupted by a pause or rewire.
+ </para>
+ </sect3>
+ </sect2>
+ </sect1>
+
+ <sect1>
+ <title>Video output</title>
+ <para>
+ In order to allow for device-dependant acceleration features, xine
+ calls upon the video output plugin for more than just displaying
+ images. The tasks performed by the video plugins are:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Allocation of <type>vo_frame_t</type> structures and their
+ subsequent destruction.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Allocation of memory for use by one frame (this is to allow
+ for the ability of some video output plugins to map frames directly
+ into video-card memory hence removing the need for the frame to
+ be copied across the PCI/AGP bus at display time).
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Most important, the ability to render/copy a given
+ frame to the output device.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Optionally the copying of the frame from a file dependant
+ colour-space and depth into the frame structure. This is to allow for
+ on-the fly colour-space conversion and scaling if required (e.g. the XShm
+ ouput plugin uses this mechanism).
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Although these extra responsibilities add great complexity to your
+ plugin it should be noted that they allow plugins to take full advantage
+ of any special hardware-acceleration without sacrificing flexibility.
+ </para>
+ <sect2>
+ <title>Writing a xine video out plugin</title>
+ <para>
+ The video out plugin API is declared in <filename>src/xine-engine/video_out.h</filename>
+ The plugin info of video out plugins contains the visual type, priority,
+ and the init_class function of the plugin.
+ </para>
+ <para>
+ The <varname>visual_type</varname> field is used by xine to
+ determine if the GUI used by the client is supported by the plugin
+ (e.g. X11 output plugins require the GUI to be running under the
+ X Windowing system) and also to determine the type of information passed to the
+ <function>open_plugin()</function> function as its <varname>visual</varname> parameter.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;char *get_description(video_driver_class_t *this_gen);</programlisting>
+ This function returns a plaintext, one-line string describing the plugin.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;char *get_identifier(video_driver_class_t *this_gen);</programlisting>
+ This function returns a shorter identifier describing the plugin.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void dispose(video_driver_class_t *this_gen);</programlisting>
+ This function frees the memory used by the video out plugin class object.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;vo_driver_t *get_instance(video_driver_class_t *class_gen, const void *visual);</programlisting>
+ Returns an instance of the plugin.
+ The <varname>visual</varname> is a pointer to a visual-dependant
+ structure/variable. For example, if you had previously claimed your
+ plugin was of the VISUAL_TYPE_X11 type, this would be a pointer
+ to a <type>x11_visual_t</type>, which amongst other things hold the
+ <type>Display</type> variable associated with the
+ X-server xine should display to. See plugin source-code for other
+ VISUAL_TYPE_* constants and associated structures. Note that this
+ field is provided by the client application and so if you wish to add another visual
+ type you will either need to extend an existing client or write a new
+ one.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;uint32_t get_capabilities(vo_driver_t *this_gen);</programlisting>
+ Returns a bit mask describing the output plugin's capabilities.
+ You may logically OR the <varname>VO_CAP_*</varname> constants together to get
+ a suitable bit-mask (via the '|' operator).
+ </para>
+ <para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;int get_property(vo_driver_t *self, int property);
+&nbsp;&nbsp;&nbsp;int set_property(vo_driver_t *self, int property, int value);
+&nbsp;&nbsp;&nbsp;void get_property_min_max(vo_driver_t *self, int property, int *min, int *max);</programlisting>
+ Handle the getting, setting of properties and define their bounds.
+ Valid property IDs can be found in the <filename>video_out.h</filename>
+ header file.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;int gui_data_exchange(vo_driver_t *self, int data_type, void *data);</programlisting>
+ Accepts various forms of data from the UI (e.g. the mouse has moved or the
+ window has been hidden). Look at existing plugins for examples of data
+ exchanges from various UIs.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;vo_frame_t *alloc_frame(vo_driver_t *self);</programlisting>
+ Returns a pointer to a xine video frame.
+ Typically the video plugin will add private fields to the end of the
+ <type>vo_frame_t</type> structure which are used for internal purposes by the plugin.
+ </para>
+ <para>
+ The function pointers within the frame structure provide a mechanism for the
+ driver to retain full control of how the frames are managed and rendered to. If
+ the VO_CAP_COPIES_IMAGE flag was set in the plugins capabilities then the
+ copy field is required and will be called sequentially for each 16-pixel high
+ strip in the image. The plugin may then decide, based on the frame's format, how
+ this is copied into the frame.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void update_frame_format(vo_driver_t *self, vo_frame_t *img, uint32_t width, uint32_t height, double ratio, int format, int flags);</programlisting>
+ This function will be called each time the colour-depth/space or size of a frame changes.
+ Typically this function would allocate sufficient memory for the frame, assign the pointers
+ to the individual planes of the frame to the <varname>base</varname> field of the
+ frame and perform any driver-specific changes.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void display_frame(vo_driver_t *self, vo_frame_t *vo_img);</programlisting>
+ Renders a given frame to the output device.
+ </para>
+ <para>
+ <programlisting>
+&nbsp;&nbsp;&nbsp;void overlay_begin(vo_driver_t *self, vo_frame_t *vo_img, int changed);
+&nbsp;&nbsp;&nbsp;void overlay_blend(vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay);
+&nbsp;&nbsp;&nbsp;void overlay_end(vo_driver_t *self, vo_frame_t *vo_img);</programlisting>
+ These are used to blend overlays on frames. <function>overlay_begin()</function> is called,
+ when the overlay appears for the first time, <function>overlay_blend()</function> is then
+ called for every subsequent frame and <function>overlay_end()</function> is called, when
+ the overlay should disappear again.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;int redraw_needed(vo_driver_t *self);</programlisting>
+ Queries the driver, if the current frame needs to be drawn again.
+ </para>
+ <para>
+ <programlisting>&nbsp;&nbsp;&nbsp;void dispose(vo_driver_t *self);</programlisting>
+ Releases all resources and frees the plugin.
+ </para>
+ </sect2>
+ </sect1>
+
+</chapter>
diff --git a/doc/hackersguide/output.sgml b/doc/hackersguide/output.sgml
deleted file mode 100644
index 64adbd294..000000000
--- a/doc/hackersguide/output.sgml
+++ /dev/null
@@ -1,668 +0,0 @@
-<chapter id="output">
- <title>xine's output layer</title>
-
- <sect1>
- <title>Post plugin layer</title>
- <para>
- In this section you will learn, how the powerful post plugin architecture
- works and how to write post plugins.
- </para>
- <sect2>
- <title>General principle of post plugins</title>
- <para>
- The name "post plugin" comes from "postprocessing" which already describes
- what these plugins are supposed to do: they take video frames, audio
- buffers or subpicture planes as they leave the decoders and apply arbitrary
- processing to them. Then they pass processed elements on to the output
- loops. Post plugins can not only be chained to process the predecessor's
- output and advance the data to their successor, they can form arbitrary trees,
- since post plugins can have any number of inputs and outputs. Additionally,
- the interconnection of the plugins currently inserted in such a tree can
- be changed on the fly during playback. The public function
- <function>xine_post_wire()</function> is used by frontends to form such
- connections.
- </para>
- <para>
- Due to the variety of possible applications, the interface post plugins have
- to implement is just the basic foundation. The complexity comes from hooking
- your post plugin into the engine data paths for video frames and audio buffers,
- intercepting the data and performing your operation on them. This is done by
- taking the interface of a video or audio port, replacing some of the functions
- with your own ones and passing the interface to the decoder or predecessor
- post plugin that is going to feed you with data by accessing this interface
- and by doing that, calling the functions you provide. From there you can do
- almost anything you want. Constructing video frames from audio buffers to
- visualize sound is possible as well as just outputting an integer giving the
- average brightness of an image. It is also possible to invent post plugins
- with no output (not very useful, unless the plugin has some side-effect) or
- no input at all; for the latter you have to create your own pthread, otherwise
- your plugin will not do anything. An audio signal generator could be
- implemented like this. The various data types, post plugins can
- accept as input or offer as output are defined in <filename>xine.h</filename>
- as <varname>XINE_POST_DATA_*</varname> defines.
- </para>
- <para>
- Some terminology used in the following explanations:
- <itemizedlist>
- <listitem>
- <para>
- <varname>down direction</varname>:
- The direction from the decoders to the output. This is the way video or audio
- data (actual content and meta information) usually travels through the engine.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>up direction</varname>:
- The direction from the output to the decoders. This is the way some video or audio
- metadata like metronom timestamps travel through the engine.
- </para>
- </listitem>
- <listitem>
- <para>
- <varname>interception</varname>:
- Post plugins are inserted into the engine data paths by the means of the decorator
- design pattern. This works by taking engine structures with member funtions like
- video or audio ports, video frames or overlay managers and inserting your own functions
- into a copy of this structure. This is called interception. This modified structure
- is then passed up to the plugin that uses it and thus calls your replaced functions.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
- <sect2>
- <title>Writing a xine post plugin</title>
- <para>
- The post plugin API is declared in <filename>src/xine-engine/post.h</filename>
- The plugin info of post plugins contains the post plugin type, which is one of the
- <varname>XINE_POST_TYPE_*</varname> defines and the init_class function of the plugin.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;post_plugin_t *open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target);</programlisting>
- Returns an instance of the plugin. Some post plugins evaluate <varname>inputs</varname>
- to open a variable number of inputs. Since almost all post plugins have audio or video
- outputs, you can hand in a NULL-terminated array of ports to connect to these outputs.
- In this function you can also intercept these ports so that your plugin is actually used.
- There is a helper function to initialize a <type>post_plugin_t</type>, which you are
- encouraged to use: <function>_x_post_init()</function>.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;char *get_identifier(post_class_t *class_gen);</programlisting>
- This function returns a short identifier describing the plugin.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;char *get_description(post_class_t *class_gen);</programlisting>
- This function returns a plaintext, one-line string describing the plugin.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void dispose(post_class_t *class_gen);</programlisting>
- This function frees the memory used by the video out plugin class object.
- </para>
- <para>
- The <type>post_plugin_t</type> structure contains the publicly visible
- part of the post plugin with the audio and video inputs and the type of
- the post plugin. Not publicly visible are the lists of all inputs and outputs,
- the <function>dispose()</function> function and some internal stuff which
- plugins do not have to worry about.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void dispose(post_plugin_t *this_gen);</programlisting>
- This function frees the memory used by the plugin instance, but not necessarily
- immediately. Since post plugins enter their own functions into engine structures,
- they might still be needed when <function>dispose()</function> is being called.
- They maintain a usage counter to detect that. To check for such a condition, you
- should use the <function>_x_post_dispose()</function> helper function like that:
- <programlisting>
-&nbsp;&nbsp;&nbsp;if (_x_post_dispose(this))
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;really_free(this);</programlisting>
- <function>_x_post_dispose()</function> frees any ressources allocated by any of the
- post plugin helper functions and returns boolean true, if the plugin is not needed
- any more.
- </para>
- </sect2>
- <sect2>
- <title>Interception</title>
- <para>
- Currently, we have four engine structures which can be intercepted by post plugins:
- video ports, video frames, overlay managers and audio ports. You could do this
- interception manually, but since this is quite a complex process, there are helper
- functions to assist you and their usage is encouraged.
- </para>
- <sect3>
- <title>Intercepting a video port</title>
- <para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post,
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;xine_video_port_t *port, post_in_t **input, post_out_t **output);</programlisting>
- This function will intercept <varname>port</varname> and returns a structure
- for you to pass up. All functions in the port will be replaced with dummy
- pass through functions that do nothing but relaying the call down to the original
- port. If you want (that is, <varname>input</varname> or <varname>output</varname> are
- not NULL), this function will also create the input and output descriptors complete
- with rewiring functions and add them to the relevant lists.
- This is required, if you want this port to be advertised by the plugin to the outside world.
- </para>
- <para>
- <type>post_video_port_t</type> makes a variety of interception schemes very easy.
- If you want to replace any of the default functions with your own, just enter it
- into <varname>new_port</varname>. You can use <varname>original_port</varname>
- from within your function to propagate calls down to the original port.
- The constraint is that your functions have to ensure that every original
- port held open scores one usage counter point, so that opened ports are always
- closed before the plugin is disposed. Therefore, you should use the macro
- <function>_x_post_inc_usage()</function> before calling
- <function>original_port-&gt;open()</function> and use the macro
- <function>_x_post_dec_usage()</function> after calling
- <function>original_port-&gt;close()</function>. Note that <function>_x_post_dec_usage()</function>
- might dispose the plugin, when <function>dispose()</function> has been called
- earlier and usage count drops to zero, so do never touch plugin structures after
- <function>_x_post_dec_usage()</function>. In addition, you must never call a port
- function of the original port when the port is not open.
- </para>
- <para>
- Intercepting video frames or the overlay manager of the port is even easier.
- You do not have to reimplement <function>get_frame()</function> or
- <function>get_overlay_manager()</function>. Just enter a <varname>intercept_frame</varname>
- or <varname>intercept_ovl</varname> function which returns boolean true, if
- you want to intercept. The functions to insert in the intercepted frame or overlay
- manager are taken from <varname>new_frame</varname> and <varname>new_manager</varname>
- respectively. Note that the defaults are reversed: If you do not enter such a
- decision function for either one, all frames and no overlay manager will be intercepted.
- </para>
- <para>
- For convenience <type>post_video_port_t</type> also contains pointers to the
- current stream and to the current post plugin and a user_data pointer, where you
- can put in anything you need in addition. If your port is used by more than one
- thread, you can also enforce locking on the port, frame or overlay manager level
- by entering a lock into <varname>port_lock</varname>, <varname>frame_lock</varname> or
- <varname>manager_lock</varname> respectively.
- </para>
- </sect3>
- <sect3>
- <title>Intercepting an audio port</title>
- <para>
- Audio port interception is just a stripped down version of video port interception.
- Everything related to frames and overlay manager is not needed and audio buffers
- do not need to be intercepted, since they have no member functions. Everything else
- of the above still applies.
- </para>
- </sect3>
- <sect3>
- <title>Intercepting overlay manager</title>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void _x_post_intercept_overlay_manager(video_overlay_manager_t *original, post_video_port_t *port);</programlisting>
- Interception of the overlay manager is done automatically when your
- <function>intercept_ovl()</function> decision function returns boolean true.
- Should you ever decide not to use that, interception can be done with this helper
- function, which simply creates an intercepted overlay manager with dummy
- pass through functions in <varname>port-&gt;new_manager</varname> and stores the original
- manager in <varname>port-&gt;original_manager</varname>.
- </para>
- <para>
- No matter how you intercepted the overlay manager, your own replacement
- functions will receive <varname>port-&gt;new_manager</varname> as the overlay manager
- argument. But you most likely want to have access to the <type>post_video_port_t</type>
- from within your functions. For that, there exists a pointer retrieval function:
- <programlisting>&nbsp;&nbsp;&nbsp;post_video_port_t *_x_post_ovl_manager_to_port(video_overlay_manager_t *manager);</programlisting>
- </para>
- </sect3>
- <sect3>
- <title>Intercepting a video frame</title>
- <para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port);
-&nbsp;&nbsp;&nbsp;vo_frame_t *_x_post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port);</programlisting>
- Interception of video frames is done automatically when your
- <function>intercept_frame()</function> decision function returns boolean true or
- when there is no such function in <type>post_video_port_t</type>.
- Should you ever decide not to use that, interception can be done with the helper
- function <function>_x_post_intercept_video_frame()</function>.
- </para>
- <para>
- Since the same video frame can be in use in the decoder and in the output and in
- any post plugin in between at the same time, simply modifying the frame
- structure does not work, because every user of the frame needs to see his version
- and the frame must always travel along the same path through the plugins for its
- entire lifetime. To ensure that, <function>_x_post_intercept_video_frame()</function>
- provides a shallow copy of the frame structure with the original frame attached to
- <varname>copy-&gt;next</varname>. This copy will be filled with your own
- frame functions from <varname>port-&gt;new_frame</varname> and with dummy pass
- through functions for those you did not provide. This way, every part of xine
- using this frame will see its own frame structure with a list of frame
- contexts from down the data path attached to <varname>frame-&gt;next</varname>.
- <function>_x_post_restore_video_frame()</function> reverses this and should be
- used when the frame is freed or disposed.
- </para>
- <para>
- Your own replacement functions will receive the copied frame as as argument.
- But you most likely want to have access to the <type>post_video_port_t</type>
- from within your functions. For that, there exists a pointer retrieval function:
- <programlisting>&nbsp;&nbsp;&nbsp;post_video_port_t *_x_post_video_frame_to_port(vo_frame_t *frame);</programlisting>
- The constraint is that your functions have to ensure that every intercepted
- frame scores one usage counter point, so that these frames are always
- freed or disposed before the plugin is disposed. Therefore, you should use the macro
- <function>_x_post_inc_usage()</function> before calling
- <function>_x_post_intercept_video_frame()</function> and use the macro
- <function>_x_post_dec_usage()</function> after calling
- <function>_x_post_restore_video_frame()</function>. Note that <function>_x_post_dec_usage()</function>
- might dispose the plugin, when <function>dispose()</function> has been called
- earlier and usage count drops to zero, so do never touch plugin structures after
- <function>_x_post_dec_usage()</function>.
- </para>
- <para>
- From within your own frame functions, you can propagate calls to the original
- frame by calling a function on <varname>frame-&gt;next</varname>. Since
- modifications to the frame can travel both upwards and downwards (decoders and
- output can modify the frame), changes need to be copied between the frame
- structure contexts. You should use the <function>_x_post_frame_copy_down()</function>
- and <function>_x_post_frame_copy_up()</function> helper functions like that:
- <programlisting>
-&nbsp;&nbsp;&nbsp;_x_post_frame_copy_down(frame, frame-&gt;next);
-&nbsp;&nbsp;&nbsp;frame-&gt;next-&gt;draw(frame-&gt;next, stream);
-&nbsp;&nbsp;&nbsp;_x_post_frame_copy_up(frame, frame-&gt;next);</programlisting>
- </para>
- <para>
- If your post plugin modifies the content of the frame, you have to modify
- a deep copy of the frame, because the decoder might still use the frame as
- a reference frame for future decoding. The usual procedure is:
- <programlisting>
-&nbsp;&nbsp;&nbsp;modified_frame = port-&gt;original_port-&gt;get_frame(port-&gt;original_port, &hellip;);
-&nbsp;&nbsp;&nbsp;_x_post_frame_copy_down(frame, modified_frame);
-&nbsp;&nbsp;&nbsp;copy_and_modify(frame, modified_frame);
-&nbsp;&nbsp;&nbsp;skip = modified_frame-&gt;draw(modified_frame, stream);
-&nbsp;&nbsp;&nbsp;_x_post_frame_copy_up(frame, modified_frame);
-&nbsp;&nbsp;&nbsp;modified_frame-&gt;free(modified_frame);</programlisting>
- </para>
- <para>
- When the output receives a frame via <function>draw()</function>,
- it usually receives the stream where the frame
- originates as well and modifies the state of this stream by passing
- the frame through the stream's metronom. Sometimes this is unwanted.
- For example, when you pass the same frame to the output more than once, it
- will confuse metronom. To solve this, you can call
- <function>frame-&gt;next-&gt;draw()</function> with NULL as the stream.
- You might also want to prevent frames from being passed down to the output
- completely, because your post plugin creates something else from these frames,
- but does not need them to be drawn. In both these situations, you have
- to call the helper function <function>_x_post_frame_u_turn()</function>
- when the frame is drawn, because this does some housekeeping which the
- decoder might expect to take place.
- </para>
- <para>
- The following diagram summarizes the situations of a video frame passing
- through a post plugin:
- </para>
- <mediaobject>
- <imageobject>
- <imagedata fileref="post_frame.png" format="PNG">
- </imageobject>
- <imageobject>
- <imagedata fileref="post_frame.eps" format="EPS">
- </imageobject>
- <caption>
- <para>video frame passing through a post plugin</para>
- </caption>
- </mediaobject>
- </sect3>
- <sect3>
- <title>Summary of constraints</title>
- <itemizedlist>
- <listitem>
- <para>
- Call <function>_x_post_inc_usage()</function> before port <function>open()</function>
- before any other port function.
- </para>
- </listitem>
- <listitem>
- <para>
- Call <function>_x_post_inc_usage()</function> before issueing an intercepted frame.
- </para>
- </listitem>
- <listitem>
- <para>
- Call <function>_x_post_dec_usage()</function> after port <function>close()</function>
- and do not call any port functions after that.
- </para>
- </listitem>
- <listitem>
- <para>
- Call <function>_x_post_dec_usage()</function> after restoring a frame.
- </para>
- </listitem>
- <listitem>
- <para>
- When a frame is drawn by your plugin, it must either be drawn on the original
- port with the correct stream as argument or U-turned (or passed through a
- private metronom manually).
- </para>
- </listitem>
- <listitem>
- <para>
- If your post plugin keeps locked frames, release them when your input port is being
- closed.
- </para>
- </listitem>
- <listitem>
- <para>
- Do not assume your plugin is alive after <function>_x_post_dec_usage()</function>.
- </para>
- </listitem>
- </itemizedlist>
- </sect3>
- </sect2>
- <sect2>
- <title>Rewiring and the ticket system</title>
- <para>
- Rewiring is the reconnection of one post plugin's outputs and another post plugin's
- inputs. This can happen on the fly during playback, which makes this a very delicate
- process. In one such input to output connection, only the output is active by either
- writing data directly to the connected input or by calling functions there. Therefore
- we have to notify only the output, when it is rewired. This is done by calling the
- <function>rewire()</function> member function of the corresponding
- <type>xine_post_out_t</type> when the frontend issues a rewiring on this output.
- This is done from the frontend thread for the rewire operation to return synchroneously.
- But since this can happen on the fly, we have to assure that no other thread is relying
- on the connection while we modify it. For this, threads working within post plugins
- have to be accounted and on demand suspended in safe positions. For this, xine offers
- a synchronization facility called "tickets".
- </para>
- <sect3>
- <title>Ticket system principles and operations</title>
- <para>
- The idea of the ticket system is based on an extended read-write lock, where there can
- be many readers in parallel, but only one exclusive writer. A certain interface might
- require you to have a ticket before calling its functions. The ticket system now
- allows multiple threads to operate within the component behind the interface by
- granting as many tickets as needed. But should an outside operation require exclusive
- access to the component, all granted tickets can be revoked and have to be given back
- by the threads who hold them, which suspends the threads. After the exclusive
- operation, tickets will be reissued so all suspended threads can continue where they
- stopped. We will now look at the ticket primitives in detail:
- </para>
- <variablelist>
- <varlistentry>
- <term><function>acquire()</function></term>
- <listitem>
- <para>
- You receive a new ticket. If the ticket is currently revoked, you can be blocked
- until it is reissued. There is one exception to this: You can acquire a revoked
- ticket, if you revoked it atomic yourself. You can also acquire a ticket irrevocably.
- Between acquire and release of an irrevocable ticket, it is guaranteed that
- you will not be blocked by ticket revocation.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><function>release()</function></term>
- <listitem>
- <para>
- You give a ticket back when you do not need it any longer. If the ticket is
- currently revoked, you can be blocked until it is reissued. If you acquired the
- ticket irrevocably, you have to release it irrevocably as well.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><function>renew()</function></term>
- <listitem>
- <para>
- You must only call this function, when the ticket has been revoked, so be
- sure to check <varname>ticket_revoked</varname> before. You give the ticket
- back and receive a new one. In between, you can be blocked until the ticket is
- reissued. You have to renew irrevocably, if you cannot assure that the thread holds
- no irrevocable tickets. If you can assure this, renew revocably.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><function>revoke()</function></term>
- <listitem>
- <para>
- This function can only be called by the xine engine, plugins do not have access to it.
- It revokes all tickets and after finite time, all threads will run into a
- <function>acquire()</function>, <function>release()</function> or <function>renew()</function>
- and will be suspended there. Then the revocation returns and you can modify structures
- or call functions with the knowledge that all ticket holders will remain in safe
- positions. When you additionally need exclusive access where no other revoker
- can interfere, you have to revoke atomic.
- </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term><function>issue()</function></term>
- <listitem>
- <para>
- This function can only be called by the xine engine, plugins do not have access to it.
- It ends ticket revocation and hands out new tickets to all threads that applied with a
- <function>acquire()</function> or <function>renew()</function>. If you revoked the
- tickets atomic, you have to issue them atomic.
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
- <para>
- When you use the ticket system in any way, you have to obey to the following rules:
- <itemizedlist>
- <listitem>
- <para>
- Assure to release irrevocable tickets ater a finite time.
- </para>
- </listitem>
- <listitem>
- <para>
- Assure to release or renew revocable tickets ater a finite time.
- </para>
- </listitem>
- <listitem>
- <para>
- Assure to reissue tickets you revoked atomic after a finite time.
- </para>
- </listitem>
- <listitem>
- <para>
- Pair calls properly.
- </para>
- </listitem>
- <listitem>
- <para>
- Never revoke a ticket you hold.
- </para>
- </listitem>
- <listitem>
- <para>
- Never acquire a ticket you revoked atomic before.
- </para>
- </listitem>
- <listitem>
- <para>
- Never acquire a ticket revocable more than once.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </sect3>
- <sect3>
- <title>Ticket handling in decoder and post plugins</title>
- <para>
- The contract of the video and audio port interfaces is that you need to have
- the port ticket, when you want to call functions of these interfaces. The decoder
- plugins do not have to worry about this at all, since the decoder loops inside the
- engine handle the ticketing. Post plugins get the ticket assigned by the engine,
- but usually, a post plugin does not create a new thread, it is called by the
- decoder thread and therefore already owns the necessary ticket. All port functions
- are also ticket-safe as they follow all the rules given above.
- </para>
- <para>
- You only have to remember that tickets need to be renewed as soon as possible,
- when the are revoked. For this, the helper function
- <function>_x_post_rewire()</function> should be used in prominent locations
- where it is safe to be suspended. Candidates for such locations are at the
- beginning of the port's <function>open()</function> and
- <function>get_frame()</function>/<function>get_buffer()</function> functions.
- The default pass through implementations for intercepted ports already do this.
- </para>
- <para>
- The port tickets are revoked, whenever a rewiring takes place or the engine
- switches into pause mode. The tickets are reissued, when the rewiring is finished
- or the engine switches from pause mode into playback. Some post plugins might
- contain critical parts, where they must not be interrupted by a rewire or pause.
- These sections can be enclosed in <function>_x_post_lock()</function> and
- <function>_x_post_unlock()</function>, which will simply acquire and release an
- irrevocable ticket for you. As long as you hold such a ticket, it is guaranteed
- that you will never be interrupted by a pause or rewire.
- </para>
- </sect3>
- </sect2>
- </sect1>
-
- <sect1>
- <title>Video output</title>
- <para>
- In order to allow for device-dependant acceleration features, xine
- calls upon the video output plugin for more than just displaying
- images. The tasks performed by the video plugins are:
- <itemizedlist>
- <listitem>
- <para>
- Allocation of <type>vo_frame_t</type> structures and their
- subsequent destruction.
- </para>
- </listitem>
- <listitem>
- <para>
- Allocation of memory for use by one frame (this is to allow
- for the ability of some video output plugins to map frames directly
- into video-card memory hence removing the need for the frame to
- be copied across the PCI/AGP bus at display time).
- </para>
- </listitem>
- <listitem>
- <para>
- Most important, the ability to render/copy a given
- frame to the output device.
- </para>
- </listitem>
- <listitem>
- <para>
- Optionally the copying of the frame from a file dependant
- colour-space and depth into the frame structure. This is to allow for
- on-the fly colour-space conversion and scaling if required (e.g. the XShm
- ouput plugin uses this mechanism).
- </para>
- </listitem>
- </itemizedlist>
- </para>
- <para>
- Although these extra responsibilities add great complexity to your
- plugin it should be noted that they allow plugins to take full advantage
- of any special hardware-acceleration without sacrificing flexibility.
- </para>
- <sect2>
- <title>Writing a xine video out plugin</title>
- <para>
- The video out plugin API is declared in <filename>src/xine-engine/video_out.h</filename>
- The plugin info of video out plugins contains the visual type, priority,
- and the init_class function of the plugin.
- </para>
- <para>
- The <varname>visual_type</varname> field is used by xine to
- determine if the GUI used by the client is supported by the plugin
- (e.g. X11 output plugins require the GUI to be running under the
- X Windowing system) and also to determine the type of information passed to the
- <function>open_plugin()</function> function as its <varname>visual</varname> parameter.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;char *get_description(video_driver_class_t *this_gen);</programlisting>
- This function returns a plaintext, one-line string describing the plugin.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;char *get_identifier(video_driver_class_t *this_gen);</programlisting>
- This function returns a shorter identifier describing the plugin.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void dispose(video_driver_class_t *this_gen);</programlisting>
- This function frees the memory used by the video out plugin class object.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;vo_driver_t *get_instance(video_driver_class_t *class_gen, const void *visual);</programlisting>
- Returns an instance of the plugin.
- The <varname>visual</varname> is a pointer to a visual-dependant
- structure/variable. For example, if you had previously claimed your
- plugin was of the VISUAL_TYPE_X11 type, this would be a pointer
- to a <type>x11_visual_t</type>, which amongst other things hold the
- <type>Display</type> variable associated with the
- X-server xine should display to. See plugin source-code for other
- VISUAL_TYPE_* constants and associated structures. Note that this
- field is provided by the client application and so if you wish to add another visual
- type you will either need to extend an existing client or write a new
- one.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;uint32_t get_capabilities(vo_driver_t *this_gen);</programlisting>
- Returns a bit mask describing the output plugin's capabilities.
- You may logically OR the <varname>VO_CAP_*</varname> constants together to get
- a suitable bit-mask (via the '|' operator).
- </para>
- <para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;int get_property(vo_driver_t *self, int property);
-&nbsp;&nbsp;&nbsp;int set_property(vo_driver_t *self, int property, int value);
-&nbsp;&nbsp;&nbsp;void get_property_min_max(vo_driver_t *self, int property, int *min, int *max);</programlisting>
- Handle the getting, setting of properties and define their bounds.
- Valid property IDs can be found in the <filename>video_out.h</filename>
- header file.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;int gui_data_exchange(vo_driver_t *self, int data_type, void *data);</programlisting>
- Accepts various forms of data from the UI (e.g. the mouse has moved or the
- window has been hidden). Look at existing plugins for examples of data
- exchanges from various UIs.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;vo_frame_t *alloc_frame(vo_driver_t *self);</programlisting>
- Returns a pointer to a xine video frame.
- Typically the video plugin will add private fields to the end of the
- <type>vo_frame_t</type> structure which are used for internal purposes by the plugin.
- </para>
- <para>
- The function pointers within the frame structure provide a mechanism for the
- driver to retain full control of how the frames are managed and rendered to. If
- the VO_CAP_COPIES_IMAGE flag was set in the plugins capabilities then the
- copy field is required and will be called sequentially for each 16-pixel high
- strip in the image. The plugin may then decide, based on the frame's format, how
- this is copied into the frame.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void update_frame_format(vo_driver_t *self, vo_frame_t *img, uint32_t width, uint32_t height, double ratio, int format, int flags);</programlisting>
- This function will be called each time the colour-depth/space or size of a frame changes.
- Typically this function would allocate sufficient memory for the frame, assign the pointers
- to the individual planes of the frame to the <varname>base</varname> field of the
- frame and perform any driver-specific changes.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void display_frame(vo_driver_t *self, vo_frame_t *vo_img);</programlisting>
- Renders a given frame to the output device.
- </para>
- <para>
- <programlisting>
-&nbsp;&nbsp;&nbsp;void overlay_begin(vo_driver_t *self, vo_frame_t *vo_img, int changed);
-&nbsp;&nbsp;&nbsp;void overlay_blend(vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay);
-&nbsp;&nbsp;&nbsp;void overlay_end(vo_driver_t *self, vo_frame_t *vo_img);</programlisting>
- These are used to blend overlays on frames. <function>overlay_begin()</function> is called,
- when the overlay appears for the first time, <function>overlay_blend()</function> is then
- called for every subsequent frame and <function>overlay_end()</function> is called, when
- the overlay should disappear again.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;int redraw_needed(vo_driver_t *self);</programlisting>
- Queries the driver, if the current frame needs to be drawn again.
- </para>
- <para>
- <programlisting>&nbsp;&nbsp;&nbsp;void dispose(vo_driver_t *self);</programlisting>
- Releases all resources and frees the plugin.
- </para>
- </sect2>
- </sect1>
-
-</chapter>
diff --git a/doc/hackersguide/overlays.fig b/doc/hackersguide/overlays.fig
deleted file mode 100644
index 78ecda61c..000000000
--- a/doc/hackersguide/overlays.fig
+++ /dev/null
@@ -1,64 +0,0 @@
-#FIG 3.2
-Portrait
-Center
-Metric
-A4
-100.00
-Single
--2
-1200 2
-0 32 #ffffff
-6 3600 2340 5670 3555
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 3600 2340 5670 2340 5670 3555 3600 3555 3600 2340
-4 0 0 50 0 20 14 0.0000 4 165 1050 4140 3015 OSD renderer\001
--6
-6 495 3825 2700 4365
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 495 3825 2700 3825 2700 4365 495 4365 495 3825
-4 0 0 50 0 20 14 0.0000 4 195 1320 900 4185 public libxine API\001
--6
-6 495 2880 2700 3420
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 495 2880 2700 2880 2700 3420 495 3420 495 2880
-4 0 0 50 0 20 14 0.0000 4 195 1830 675 3240 libsputext (text subtitles)\001
--6
-6 495 2160 2700 2700
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 495 2160 2700 2160 2700 2700 495 2700 495 2160
-4 0 0 50 0 20 14 0.0000 4 195 1965 585 2520 libspucc (closed captions)\001
--6
-6 6435 1575 8865 2790
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 6435 1575 8865 1575 8865 2790 6435 2790 6435 1575
-4 0 0 50 0 20 14 0.0000 4 210 1260 6975 2250 overlay manager\001
--6
-6 6435 3780 8865 4995
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 6435 3780 8865 3780 8865 4995 6435 4995 6435 3780
-4 0 0 50 0 20 14 0.0000 4 165 675 7290 4455 video out\001
--6
-6 495 1440 2700 1980
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 495 1440 2700 1440 2700 1980 495 1980 495 1440
-4 0 0 50 0 20 14 0.0000 4 195 1920 585 1800 libspudec (DVD subtitles)\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 4
- 0 0 1.00 60.00 120.00
- 2700 4095 3105 4095 3105 3375 3600 3375
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 2700 1710 6435 1710
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 2700 3150 3600 3150
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 1 2
- 0 0 1.00 60.00 120.00
- 0 0 1.00 60.00 120.00
- 7650 2790 7650 3780
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 5670 2565 6435 2565
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 2
- 0 0 1.00 60.00 120.00
- 2700 2430 3600 2430
diff --git a/doc/hackersguide/overlays.svg b/doc/hackersguide/overlays.svg
new file mode 100644
index 000000000..5880b5de1
--- /dev/null
+++ b/doc/hackersguide/overlays.svg
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Creator: fig2dev Version 3.2 Patchlevel 5 -->
+<!-- CreationDate: Sat Jun 2 20:47:40 2007 -->
+<!-- Magnification: 1.050 -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="7.3in"
+ height="3.1in"
+ viewBox="507 1499 8812 3757"
+ id="svg4078"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ sodipodi:docname="overlays.svg"
+ sodipodi:docbase="/home/flame/devel/repos/xine/xine-lib-1.2-newdocbook/doc/hackersguide"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata4139">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4137" />
+ <sodipodi:namedview
+ inkscape:window-height="611"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.96194825"
+ inkscape:cx="328.5"
+ inkscape:cy="139.5"
+ inkscape:window-x="164"
+ inkscape:window-y="25"
+ inkscape:current-layer="svg4078" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1"
+ id="rect4141"
+ width="9029.1113"
+ height="3933.6128"
+ x="419.44238"
+ y="1434.3762" />
+ <g
+ style="stroke-width:.025in; stroke:black; fill:none"
+ id="g4080">
+<!-- Line: box --> <rect
+ x="3779"
+ y="2456"
+ width="2173"
+ height="1275"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4082" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4346"
+ y="3165"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4084">OSD renderer</text>
+<!-- Line: box --> <rect
+ x="519"
+ y="4015"
+ width="2314"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4086" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="944"
+ y="4393"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4088">public libxine API</text>
+<!-- Line: box --> <rect
+ x="519"
+ y="3023"
+ width="2314"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4090" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="708"
+ y="3401"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4092">libsputext (text subtitles)</text>
+<!-- Line: box --> <rect
+ x="519"
+ y="2267"
+ width="2314"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4094" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="614"
+ y="2645"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4096">libspucc (closed captions)</text>
+<!-- Line: box --> <rect
+ x="6755"
+ y="1653"
+ width="2551"
+ height="1275"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4098" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7322"
+ y="2362"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4100">overlay manager</text>
+<!-- Line: box --> <rect
+ x="6755"
+ y="3968"
+ width="2551"
+ height="1275"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4102" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7653"
+ y="4677"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4104">video out</text>
+<!-- Line: box --> <rect
+ x="519"
+ y="1511"
+ width="2314"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4106" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="614"
+ y="1889"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="177"
+ text-anchor="start"
+ id="text4108">libspudec (DVD subtitles)</text>
+<!-- Line --> <polyline
+ points="2834,4299 3259,4299 3259,3543 3761,3543 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4110" />
+<!-- Arrowhead on XXXpoint 3259 3543 - 3795 3543--> <polyline
+ points="3651 3574 3777 3543 3651 3511 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4112" />
+<!-- Line --> <polyline
+ points="2834,1795 6738,1795 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4114" />
+<!-- Arrowhead on XXXpoint 2834 1795 - 6771 1795--> <polyline
+ points="6627 1826 6753 1795 6627 1763 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4116" />
+<!-- Line --> <polyline
+ points="2834,3307 3761,3307 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4118" />
+<!-- Arrowhead on XXXpoint 2834 3307 - 3795 3307--> <polyline
+ points="3651 3338 3777 3307 3651 3275 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4120" />
+<!-- Line --> <polyline
+ points="8031,2946 8031,3950 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4122" />
+<!-- Arrowhead on XXXpoint 8031 2929 - 8031 3984--> <polyline
+ points="8000 3840 8031 3966 8062 3840 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4124" />
+<!-- Arrowhead on XXXpoint 8031 3968 - 8031 2913--> <polyline
+ points="8062 3057 8031 2931 8000 3057 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4126" />
+<!-- Line --> <polyline
+ points="5952,2692 6738,2692 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4128" />
+<!-- Arrowhead on XXXpoint 5952 2692 - 6771 2692--> <polyline
+ points="6627 2724 6753 2692 6627 2661 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4130" />
+<!-- Line --> <polyline
+ points="2834,2551 3761,2551 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4132" />
+<!-- Arrowhead on XXXpoint 2834 2551 - 3795 2551--> <polyline
+ points="3651 2582 3777 2551 3651 2519 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4134" />
+ </g>
+</svg>
diff --git a/doc/hackersguide/overview.sgml b/doc/hackersguide/overview.docbook
index bf036edbc..bf036edbc 100644
--- a/doc/hackersguide/overview.sgml
+++ b/doc/hackersguide/overview.docbook
diff --git a/doc/hackersguide/post_frame.fig b/doc/hackersguide/post_frame.fig
deleted file mode 100644
index efafa31d5..000000000
--- a/doc/hackersguide/post_frame.fig
+++ /dev/null
@@ -1,347 +0,0 @@
-#FIG 3.2
-Landscape
-Center
-Metric
-A4
-100.00
-Single
--2
-1200 2
-6 2970 585 9360 9945
-2 1 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 3
- 3015 900 3915 900 3915 630
-2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 3015 630 9315 630 9315 9900 3015 9900 3015 630
-4 0 0 50 0 20 11 0.0000 4 165 675 3105 810 post plugin\001
--6
-6 5040 1125 7200 1530
-2 2 0 1 0 4 40 0 20 0.000 0 0 -1 0 0 5
- 5040 1125 7200 1125 7200 1530 5040 1530 5040 1125
-4 0 0 30 0 20 11 0.0000 4 165 1545 5220 1395 _x_post_intercept_frame\001
--6
-6 3645 990 4635 1620
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 1080 4635 1080 4635 1620 3735 1620 3735 1080
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 990 4545 990 4545 1530 3645 1530 3645 990
--6
-6 5040 2160 7200 2565
-2 2 0 1 0 7 40 0 20 0.000 0 0 -1 0 0 5
- 5040 2160 7200 2160 7200 2565 5040 2565 5040 2160
-4 0 0 30 0 20 11 0.0000 4 165 1710 5220 2430 _x_post_frame_copy_down\001
--6
-6 5040 3060 7200 3465
-2 2 0 1 0 7 40 0 20 0.000 0 0 -1 0 0 5
- 5040 3060 7200 3060 7200 3465 5040 3465 5040 3060
-4 0 0 30 0 20 11 0.0000 4 165 1530 5220 3330 _x_post_frame_copy_up\001
--6
-6 3645 2025 4635 2655
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 2025 4545 2025 4545 2565 3645 2565 3645 2025
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 2115 4635 2115 4635 2655 3735 2655 3735 2115
-4 0 0 20 0 18 25 0.0000 4 270 225 3825 2430 d\001
--6
-6 7830 2025 8820 2655
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 7920 2115 8820 2115 8820 2655 7920 2655 7920 2115
-2 2 0 1 0 4 30 0 -1 0.000 0 0 -1 0 0 5
- 7830 2025 8730 2025 8730 2565 7830 2565 7830 2025
-4 0 0 20 0 18 25 0.0000 4 270 225 8100 2520 d\001
--6
-6 7830 2925 8820 3555
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 7920 3015 8820 3015 8820 3555 7920 3555 7920 3015
-2 2 0 1 0 4 30 0 -1 0.000 0 0 -1 0 0 5
- 7830 2925 8730 2925 8730 3465 7830 3465 7830 2925
-4 0 0 20 0 18 25 0.0000 4 285 555 8100 3420 d u\001
--6
-6 3645 2925 4635 3555
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 2925 4545 2925 4545 3465 3645 3465 3645 2925
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 3015 4635 3015 4635 3555 3735 3555 3735 3015
-4 0 0 20 0 18 25 0.0000 4 285 555 3825 3330 d u\001
--6
-6 7875 4725 8775 5265
-2 2 0 1 0 3 40 0 15 0.000 0 0 -1 0 0 5
- 7875 4725 8775 4725 8775 5265 7875 5265 7875 4725
-4 0 0 20 0 18 25 0.0000 4 270 225 8055 5130 d\001
--6
-6 3645 4005 4635 4635
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 4005 4545 4005 4545 4545 3645 4545 3645 4005
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 4095 4635 4095 4635 4635 3735 4635 3735 4095
-4 0 0 20 0 18 25 0.0000 4 270 225 3825 4410 d\001
--6
-6 7875 6300 8775 6840
-2 2 0 1 0 3 40 0 15 0.000 0 0 -1 0 0 5
- 7875 6300 8775 6300 8775 6840 7875 6840 7875 6300
-4 0 0 20 0 18 25 0.0000 4 285 555 8055 6705 d u\001
--6
-6 7875 5625 8775 6165
-2 2 0 1 0 3 40 0 15 0.000 0 0 -1 0 0 5
- 7875 5625 8775 5625 8775 6165 7875 6165 7875 5625
-4 0 0 20 0 18 25 0.0000 4 285 555 8055 6030 d u\001
--6
-6 3645 7245 4635 7875
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 7245 4545 7245 4545 7785 3645 7785 3645 7245
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 7335 4635 7335 4635 7875 3735 7875 3735 7335
-4 0 0 20 0 18 25 0.0000 4 270 225 3825 7650 d\001
--6
-6 3645 8145 4635 8775
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 8145 4545 8145 4545 8685 3645 8685 3645 8145
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 8235 4635 8235 4635 8775 3735 8775 3735 8235
-4 0 0 20 0 18 25 0.0000 4 285 555 3825 8550 d u\001
--6
-6 5040 7830 7200 8235
-2 2 0 1 0 7 40 0 20 0.000 0 0 -1 0 0 5
- 5040 7830 7200 7830 7200 8235 5040 8235 5040 7830
-4 0 0 30 0 20 11 0.0000 4 165 1395 5220 8100 _x_post_frame_u_turn\001
--6
-6 990 1125 2340 1530
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 990 1125 2340 1125 2340 1530 990 1530 990 1125
-4 0 0 50 0 20 11 0.0000 4 165 630 1170 1395 get_frame\001
--6
-6 990 2025 2340 3510
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 990 2025 2340 2025 2340 3510 990 3510 990 2025
-4 0 0 50 0 20 11 0.0000 4 120 255 1170 2475 field\001
-4 0 0 50 0 20 11 0.0000 4 120 255 1170 2700 lock\001
-4 0 0 50 0 20 11 0.0000 4 165 705 1170 2925 proc_frame\001
-4 0 0 50 0 20 11 0.0000 4 165 630 1170 3150 proc_slice\001
-4 0 0 50 0 20 11 0.0000 4 165 1065 1170 3375 proc_macroblock\001
-4 0 0 50 0 20 11 0.0000 4 120 300 1170 2250 draw\001
--6
-6 990 4095 2340 6795
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 990 4095 2340 4095 2340 6795 990 6795 990 4095
-4 0 0 50 0 20 11 0.0000 4 120 255 1170 4555 field\001
-4 0 0 50 0 20 11 0.0000 4 120 255 1170 4761 lock\001
-4 0 0 50 0 20 11 0.0000 4 165 705 1170 4969 proc_frame\001
-4 0 0 50 0 20 11 0.0000 4 165 630 1170 5175 proc_slice\001
-4 0 0 50 0 20 11 0.0000 4 165 1065 1170 5383 proc_macroblock\001
-4 0 0 50 0 20 11 0.0000 4 120 300 1170 4347 draw\001
--6
-6 990 7335 2340 8640
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 990 7335 2340 7335 2340 8640 990 8640 990 7335
-4 0 0 50 0 20 11 0.0000 4 120 300 1170 7605 draw\001
--6
-6 9990 1125 11340 1530
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 1125 11340 1125 11340 1530 9990 1530 9990 1125
-4 0 0 50 0 20 11 0.0000 4 165 630 10170 1395 get_frame\001
--6
-6 9990 2025 11340 3510
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 2025 11340 2025 11340 3510 9990 3510 9990 2025
-4 0 0 50 0 20 11 0.0000 4 120 255 10170 2475 field\001
-4 0 0 50 0 20 11 0.0000 4 120 255 10170 2700 lock\001
-4 0 0 50 0 20 11 0.0000 4 165 705 10170 2925 proc_frame\001
-4 0 0 50 0 20 11 0.0000 4 165 630 10170 3150 proc_slice\001
-4 0 0 50 0 20 11 0.0000 4 165 1065 10170 3375 proc_macroblock\001
-4 0 0 50 0 20 11 0.0000 4 120 300 10170 2250 draw\001
--6
-6 9990 4140 11340 4545
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 4140 11340 4140 11340 4545 9990 4545 9990 4140
-4 0 0 50 0 20 11 0.0000 4 165 630 10170 4410 get_frame\001
--6
-6 9990 4725 11340 6210
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 4725 11340 4725 11340 6210 9990 6210 9990 4725
-4 0 0 50 0 20 11 0.0000 4 120 255 10170 5175 field\001
-4 0 0 50 0 20 11 0.0000 4 120 255 10170 5400 lock\001
-4 0 0 50 0 20 11 0.0000 4 165 705 10170 5625 proc_frame\001
-4 0 0 50 0 20 11 0.0000 4 165 630 10170 5850 proc_slice\001
-4 0 0 50 0 20 11 0.0000 4 165 1065 10170 6075 proc_macroblock\001
-4 0 0 50 0 20 11 0.0000 4 120 300 10170 4950 draw\001
--6
-6 9990 6390 11340 6795
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 6390 11340 6390 11340 6795 9990 6795 9990 6390
-4 0 0 50 0 20 11 0.0000 4 120 240 10170 6660 free\001
--6
-6 180 585 765 1755
-2 2 0 2 0 7 20 0 -1 6.000 0 0 -1 0 0 5
- 225 630 720 630 720 1710 225 1710 225 630
-4 0 0 20 0 20 15 1.5708 4 210 960 540 1665 interception\001
--6
-6 180 1890 765 3735
-2 2 0 2 0 7 20 0 -1 6.000 0 0 -1 0 0 5
- 225 1935 720 1935 720 3690 225 3690 225 1935
-4 0 0 20 0 20 15 1.5708 4 225 1065 540 3375 pass through\001
--6
-6 180 3870 765 7020
-2 2 0 2 0 7 20 0 -1 6.000 0 0 -1 0 0 5
- 225 3915 720 3915 720 6975 225 6975 225 3915
-4 0 0 20 0 20 15 1.5708 4 225 1380 540 6165 modifying a copy\001
--6
-6 180 7155 765 8910
-2 2 0 2 0 7 20 0 -1 6.000 0 0 -1 0 0 5
- 225 7200 720 7200 720 8865 225 8865 225 7200
-4 0 0 20 0 20 15 1.5708 4 180 1245 540 8685 dead-end draw\001
--6
-6 180 9045 765 9945
-2 2 0 2 0 7 20 0 -1 6.000 0 0 -1 0 0 5
- 225 9090 720 9090 720 9900 225 9900 225 9090
-4 0 0 20 0 20 15 1.5708 4 225 570 540 9810 freeing\001
--6
-6 5040 4455 7200 4860
-2 2 0 1 0 7 40 0 20 0.000 0 0 -1 0 0 5
- 5040 4455 7200 4455 7200 4860 5040 4860 5040 4455
-4 0 0 30 0 20 11 0.0000 4 165 1710 5220 4725 _x_post_frame_copy_down\001
--6
-6 5040 6030 7200 6435
-2 2 0 1 0 7 40 0 20 0.000 0 0 -1 0 0 5
- 5040 6030 7200 6030 7200 6435 5040 6435 5040 6030
-4 0 0 30 0 20 11 0.0000 4 165 1530 5220 6300 _x_post_frame_copy_up\001
--6
-6 3645 6255 4635 6885
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 6255 4545 6255 4545 6795 3645 6795 3645 6255
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 6345 4635 6345 4635 6885 3735 6885 3735 6345
-4 0 0 20 0 18 25 0.0000 4 285 555 3825 6660 d u\001
--6
-6 5040 9270 7200 9675
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 5040 9270 7200 9270 7200 9675 5040 9675 5040 9270
-4 0 0 30 0 20 11 0.0000 4 165 1845 5220 9540 _x_post_restore_video_frame\001
--6
-6 990 9270 2340 9675
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 990 9270 2340 9270 2340 9675 990 9675 990 9270
-4 0 0 50 0 20 11 0.0000 4 165 855 1170 9540 free / dispose\001
--6
-6 9990 9270 11340 9675
-2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5
- 9990 9270 11340 9270 11340 9675 9990 9675 9990 9270
-4 0 0 50 0 20 11 0.0000 4 165 855 10170 9540 free / dispose\001
--6
-6 6660 4995 7515 5580
-2 3 0 1 0 7 50 0 15 0.000 0 0 -1 0 0 4
- 7065 4995 6840 5220 7290 5220 7065 4995
-4 0 0 50 0 20 11 0.0000 4 150 825 6660 5400 modify frame\001
-4 0 0 50 0 20 11 0.0000 4 120 465 6840 5580 content\001
--6
-6 405 10170 2970 11250
-6 990 10170 1980 10800
-2 2 0 1 0 7 40 0 20 0.000 0 0 -1 0 0 5
- 1080 10260 1980 10260 1980 10800 1080 10800 1080 10260
-2 2 0 1 0 7 30 0 20 0.000 0 0 -1 0 0 5
- 990 10170 1890 10170 1890 10710 990 10710 990 10170
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 1 1 1.00 120.00 180.00
- 630 11025 630 10440 990 10440
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 1 1 1.00 120.00 180.00
- 2340 11025 2340 10530 1980 10530
-4 0 0 20 0 20 15 0.0000 4 165 465 405 11250 frame\001
-4 0 0 20 0 20 15 0.0000 4 165 975 1980 11250 frame->next\001
--6
-6 3375 10080 6300 11250
-2 2 0 1 0 4 40 0 20 0.000 0 0 -1 0 0 5
- 3375 10710 4275 10710 4275 11250 3375 11250 3375 10710
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3375 10080 4275 10080 4275 10620 3375 10620 3375 10080
-4 0 0 50 0 20 15 0.0000 4 225 1890 4410 10440 frame from original port\001
-4 0 0 50 0 20 15 0.0000 4 210 1425 4410 11070 intercepted frame\001
--6
-6 6660 10035 11250 11295
-6 8505 10035 9405 10575
-2 2 0 1 0 3 40 0 -1 0.000 0 0 -1 0 0 5
- 8505 10035 9405 10035 9405 10575 8505 10575 8505 10035
-4 0 0 20 0 18 25 0.0000 4 285 555 8685 10440 d u\001
--6
-6 6660 10170 8055 11295
-4 2 0 50 0 20 15 0.0000 4 165 1005 8055 10350 downstream\001
-4 2 0 50 0 20 15 0.0000 4 165 1380 8055 10650 meta-information\001
-4 2 0 50 0 20 15 0.0000 4 180 1080 8055 10950 from decoder\001
-4 2 0 50 0 20 15 0.0000 4 210 705 8055 11250 to output\001
--6
-6 9855 10170 11250 11295
-4 0 0 50 0 20 15 0.0000 4 210 765 9855 10350 upstream\001
-4 0 0 50 0 20 15 0.0000 4 165 1380 9855 10650 meta-information\001
-4 0 0 50 0 20 15 0.0000 4 210 915 9855 10950 from output\001
-4 0 0 50 0 20 15 0.0000 4 180 870 9855 11250 to decoder\001
--6
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 1 1 1.00 120.00 180.00
- 8100 10800 8775 10800 8775 10485
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 1 0 3
- 1 1 1.00 120.00 180.00
- 9810 10800 9135 10800 9135 10485
--6
-6 3645 9135 4635 9765
-2 2 0 1 0 4 30 0 20 0.000 0 0 -1 0 0 5
- 3645 9135 4545 9135 4545 9675 3645 9675 3645 9135
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 3735 9225 4635 9225 4635 9765 3735 9765 3735 9225
-4 0 0 20 0 18 25 0.0000 4 270 225 3825 9540 d\001
--6
-6 7875 9180 8775 9720
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 7875 9180 8775 9180 8775 9720 7875 9720 7875 9180
-4 0 0 20 0 18 25 0.0000 4 270 225 8055 9585 d\001
--6
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 120.00 180.00
- 9990 1305 7200 1305
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 120.00 180.00
- 5040 1305 2340 1305
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 7875 1035 8775 1035 8775 1575 7875 1575 7875 1035
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 120.00 180.00
- 2340 2340 9990 2340
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 120.00 180.00
- 9990 3240 2340 3240
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 4
- 0 0 1.00 120.00 180.00
- 2340 4320 5625 4320 5625 6570 2340 6570
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 4
- 0 0 1.00 120.00 180.00
- 9990 5895 6570 5895 6570 6570 9990 6570
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 4
- 0 0 1.00 120.00 180.00
- 9990 4320 6570 4320 6570 4995 9990 4995
-2 2 0 1 0 3 40 0 20 0.000 0 0 -1 0 0 5
- 7875 4050 8775 4050 8775 4590 7875 4590 7875 4050
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 4
- 0 0 1.00 120.00 180.00
- 2340 7560 5625 7560 5625 8460 2340 8460
-2 1 1 1 0 7 50 0 -1 10.000 0 0 -1 0 0 2
- 0 1800 11610 1800
-2 1 1 1 0 7 50 0 -1 10.000 0 0 -1 0 0 2
- 0 3780 11610 3780
-2 1 1 1 0 7 50 0 -1 10.000 0 0 -1 0 0 2
- 0 7065 11610 7065
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 120.00 180.00
- 2340 9450 5040 9450
-2 1 1 1 0 7 50 0 -1 4.000 0 0 -1 1 0 2
- 0 0 1.00 120.00 180.00
- 7200 9450 9990 9450
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 6
- 6075 90 6075 540 3195 540 3015 315 3195 90 6075 90
-2 3 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 6
- 6165 90 6165 540 9135 540 9315 315 9135 90 6165 90
-2 1 1 1 0 7 50 0 -1 10.000 0 0 -1 0 0 2
- 0 8955 11610 8955
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 3195 9990 3195 11385
-2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2
- 6480 9990 6480 11385
-4 0 0 20 0 20 20 0.0000 4 210 270 5715 405 up\001
-4 0 0 20 0 20 20 0.0000 4 210 585 6300 405 down\001
diff --git a/doc/hackersguide/post_frame.svg b/doc/hackersguide/post_frame.svg
new file mode 100644
index 000000000..75dcd77a4
--- /dev/null
+++ b/doc/hackersguide/post_frame.svg
@@ -0,0 +1,1564 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Creator: fig2dev Version 3.2 Patchlevel 5 -->
+<!-- CreationDate: Sat Jun 2 20:48:15 2007 -->
+<!-- Magnification: 1.050 -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="10.2in"
+ height="9.9in"
+ viewBox="-12 81 12214 11883"
+ id="svg4143"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ sodipodi:docname="post_frame.svg"
+ sodipodi:docbase="/home/flame/devel/repos/xine/xine-lib-1.2-newdocbook/doc/hackersguide"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata4494">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <defs
+ id="defs4492" />
+ <sodipodi:namedview
+ inkscape:window-height="611"
+ inkscape:window-width="722"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ inkscape:zoom="0.45679015"
+ inkscape:cx="459"
+ inkscape:cy="445.49997"
+ inkscape:window-x="552"
+ inkscape:window-y="25"
+ inkscape:current-layer="svg4143" />
+ <rect
+ style="fill:#ffffff;fill-opacity:1"
+ id="rect4496"
+ width="12700.504"
+ height="12145.769"
+ x="-201.72523"
+ y="-6.5896807" />
+ <g
+ style="stroke-width:.025in; stroke:black; fill:none"
+ id="g4145">
+<!-- Line --> <polyline
+ points="3165,944 4110,944 4110,661 "
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4147" />
+<!-- Line: box --> <rect
+ x="3165"
+ y="661"
+ width="6614"
+ height="9732"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4149" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="3259"
+ y="850"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4151">post plugin</text>
+<!-- Line: box --> <rect
+ x="1039"
+ y="1181"
+ width="1417"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4153" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4155">get_frame</text>
+<!-- Line: box --> <rect
+ x="1039"
+ y="2125"
+ width="1417"
+ height="1559"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4157" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="2598"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4159">field</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="2834"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4161">lock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="3070"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4163">proc_frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="3307"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4165">proc_slice</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="3543"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4167">proc_macroblock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="2362"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4169">draw</text>
+<!-- Line: box --> <rect
+ x="1039"
+ y="4299"
+ width="1417"
+ height="2834"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4171" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="4782"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4173">field</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="4998"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4175">lock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="5216"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4177">proc_frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="5433"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4179">proc_slice</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="5651"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4181">proc_macroblock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="4563"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4183">draw</text>
+<!-- Line: box --> <rect
+ x="1039"
+ y="7700"
+ width="1417"
+ height="1370"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4185" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="7984"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4187">draw</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="1181"
+ width="1417"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4189" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4191">get_frame</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="2125"
+ width="1417"
+ height="1559"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4193" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="2598"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4195">field</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="2834"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4197">lock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="3070"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4199">proc_frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="3307"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4201">proc_slice</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="3543"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4203">proc_macroblock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="2362"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4205">draw</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="4346"
+ width="1417"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4207" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="4629"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4209">get_frame</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="4960"
+ width="1417"
+ height="1559"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4211" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="5433"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4213">field</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="5669"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4215">lock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="5905"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4217">proc_frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="6141"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4219">proc_slice</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="6377"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4221">proc_macroblock</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="5196"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4223">draw</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="6708"
+ width="1417"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4225" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="6992"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4227">free</text>
+<!-- Line: box --> <rect
+ x="1039"
+ y="9732"
+ width="1417"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4229" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="1228"
+ y="10015"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4231">free / dispose</text>
+<!-- Line: box --> <rect
+ x="10488"
+ y="9732"
+ width="1417"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4233" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10677"
+ y="10015"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4235">free / dispose</text>
+<!-- Line --> <polygon
+ points="7417,5244 7181,5480 7653,5480 7417,5244 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#bfbfbf; "
+ id="polygon4237" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6992"
+ y="5669"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4239">modify frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="7181"
+ y="5858"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4241">content</text>
+<!-- Line --> <polyline
+ points="661,11574 661,10960 850,10960 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4243" />
+<!-- Arrowhead on XXXpoint 661 10960 - 1055 10960--> <polygon
+ points="853 11023 1042 10960 853 10897 853 11023 "
+ style="stroke:#000000;stroke-width:8; fill:#000000;"
+ id="polygon4245" />
+<!-- Line --> <polyline
+ points="2456,11574 2456,11055 2266,11055 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4247" />
+<!-- Arrowhead on XXXpoint 2456 11055 - 2062 11055--> <polygon
+ points="2264 10992 2075 11055 2264 11118 2264 10992 "
+ style="stroke:#000000;stroke-width:8; fill:#000000;"
+ id="polygon4249" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4629"
+ y="10960"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4251">frame from original port</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4629"
+ y="11622"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4253">intercepted frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="10866"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="end"
+ id="text4255">downstream</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="11181"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="end"
+ id="text4257">meta-information</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="11496"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="end"
+ id="text4259">from decoder</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="11811"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="end"
+ id="text4261">to output</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10346"
+ y="10866"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4263">upstream</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10346"
+ y="11181"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4265">meta-information</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10346"
+ y="11496"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4267">from output</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="10346"
+ y="11811"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4269">to decoder</text>
+<!-- Line --> <polyline
+ points="8503,11338 9212,11338 9212,11195 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4271" />
+<!-- Arrowhead on XXXpoint 9212 11338 - 9212 10992--> <polygon
+ points="9275 11193 9212 11004 9149 11193 9275 11193 "
+ style="stroke:#000000;stroke-width:8; fill:#000000;"
+ id="polygon4273" />
+<!-- Line --> <polyline
+ points="10299,11338 9590,11338 9590,11195 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4275" />
+<!-- Arrowhead on XXXpoint 9590 11338 - 9590 10992--> <polygon
+ points="9653 11193 9590 11004 9527 11193 9653 11193 "
+ style="stroke:#000000;stroke-width:8; fill:#000000;"
+ id="polygon4277" />
+<!-- Line --> <polyline
+ points="10488,1370 7575,1370 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4279" />
+<!-- Arrowhead on XXXpoint 10488 1370 - 7543 1370--> <polyline
+ points="7745 1307 7556 1370 7745 1433 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4281" />
+<!-- Line --> <polyline
+ points="5291,1370 2473,1370 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4283" />
+<!-- Arrowhead on XXXpoint 5291 1370 - 2440 1370--> <polyline
+ points="2643 1307 2454 1370 2643 1433 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4285" />
+<!-- Line --> <polyline
+ points="2456,2456 10470,2456 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4287" />
+<!-- Arrowhead on XXXpoint 2456 2456 - 10503 2456--> <polyline
+ points="10301 2519 10490 2456 10301 2393 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4289" />
+<!-- Line --> <polyline
+ points="10488,3401 2473,3401 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4291" />
+<!-- Arrowhead on XXXpoint 10488 3401 - 2440 3401--> <polyline
+ points="2643 3338 2454 3401 2643 3464 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4293" />
+<!-- Line --> <polyline
+ points="2456,4535 5905,4535 5905,6897 2473,6897 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4295" />
+<!-- Arrowhead on XXXpoint 5905 6897 - 2440 6897--> <polyline
+ points="2643 6834 2454 6897 2643 6960 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4297" />
+<!-- Line --> <polyline
+ points="10488,6188 6897,6188 6897,6897 10470,6897 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4299" />
+<!-- Arrowhead on XXXpoint 6897 6897 - 10503 6897--> <polyline
+ points="10301 6960 10490 6897 10301 6834 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4301" />
+<!-- Line --> <polyline
+ points="10488,4535 6897,4535 6897,5244 10470,5244 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4303" />
+<!-- Arrowhead on XXXpoint 6897 5244 - 10503 5244--> <polyline
+ points="10301 5307 10490 5244 10301 5181 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4305" />
+<!-- Line --> <polyline
+ points="2456,7937 5905,7937 5905,8881 2473,8881 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4307" />
+<!-- Arrowhead on XXXpoint 5905 8881 - 2440 8881--> <polyline
+ points="2643 8818 2454 8881 2643 8944 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4309" />
+<!-- Line --> <polyline
+ points="0,1889 12188,1889 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:104 104;"
+ id="polyline4311" />
+<!-- Line --> <polyline
+ points="0,3968 12188,3968 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:104 104;"
+ id="polyline4313" />
+<!-- Line --> <polyline
+ points="0,7417 12188,7417 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:104 104;"
+ id="polyline4315" />
+<!-- Line --> <polyline
+ points="2456,9921 5273,9921 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4317" />
+<!-- Arrowhead on XXXpoint 2456 9921 - 5307 9921--> <polyline
+ points="5104 9984 5293 9921 5104 9858 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4319" />
+<!-- Line --> <polyline
+ points="7559,9921 10470,9921 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:41 41;"
+ id="polyline4321" />
+<!-- Arrowhead on XXXpoint 7559 9921 - 10503 9921--> <polyline
+ points="10301 9984 10490 9921 10301 9858 "
+ style="stroke:#000000;stroke-width:8; "
+ id="polyline4323" />
+<!-- Line --> <polygon
+ points="6377,94 6377,566 3354,566 3165,330 3354,94 6377,94 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon4325" />
+<!-- Line --> <polygon
+ points="6472,94 6472,566 9590,566 9779,330 9590,94 6472,94 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polygon4327" />
+<!-- Line --> <polyline
+ points="0,9401 12188,9401 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; stroke-dasharray:104 104;"
+ id="polyline4329" />
+<!-- Line --> <polyline
+ points="3354,10488 3354,11952 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4331" />
+<!-- Line --> <polyline
+ points="6803,10488 6803,11952 "
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="polyline4333" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="1181"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4335" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="1133"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4337" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="2267"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4339" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="3212"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4341" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="2220"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4343" />
+<!-- Line: box --> <rect
+ x="8314"
+ y="2220"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4345" />
+<!-- Line: box --> <rect
+ x="8314"
+ y="3165"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4347" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="3165"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4349" />
+<!-- Line: box --> <rect
+ x="8267"
+ y="4960"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00bf00; "
+ id="rect4351" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="4299"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4353" />
+<!-- Line: box --> <rect
+ x="8267"
+ y="6614"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00bf00; "
+ id="rect4355" />
+<!-- Line: box --> <rect
+ x="8267"
+ y="5905"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00bf00; "
+ id="rect4357" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="7700"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4359" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="8645"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4361" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="8220"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4363" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="4677"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4365" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="6330"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4367" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="6661"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4369" />
+<!-- Line: box --> <rect
+ x="5291"
+ y="9732"
+ width="2267"
+ height="425"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4371" />
+<!-- Line: box --> <rect
+ x="1133"
+ y="10771"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4373" />
+<!-- Line: box --> <rect
+ x="3543"
+ y="11244"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4375" />
+<!-- Line: box --> <rect
+ x="3543"
+ y="10582"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4377" />
+<!-- Line: box --> <rect
+ x="8929"
+ y="10535"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4379" />
+<!-- Line: box --> <rect
+ x="3921"
+ y="9685"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4381" />
+<!-- Line: box --> <rect
+ x="8267"
+ y="9637"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4383" />
+<!-- Line: box --> <rect
+ x="8267"
+ y="1086"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4385" />
+<!-- Line: box --> <rect
+ x="8267"
+ y="4251"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#00ffff; "
+ id="rect4387" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="1464"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4389">_x_post_intercept_frame</text>
+<!-- Line: box --> <rect
+ x="3826"
+ y="1039"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4391" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="2551"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4393">_x_post_frame_copy_down</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="3496"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4395">_x_post_frame_copy_up</text>
+<!-- Line: box --> <rect
+ x="3826"
+ y="2125"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4397" />
+<!-- Line: box --> <rect
+ x="8220"
+ y="2125"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4399" />
+<!-- Line: box --> <rect
+ x="8220"
+ y="3070"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4401" />
+<!-- Line: box --> <rect
+ x="3826"
+ y="3070"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4403" />
+<!-- Line: box --> <rect
+ x="3826"
+ y="4204"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4405" />
+<!-- Line: box --> <rect
+ x="3826"
+ y="7606"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4407" />
+<!-- Line: box --> <rect
+ x="3826"
+ y="8551"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4409" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="8503"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4411">_x_post_frame_u_turn</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="4960"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4413">_x_post_frame_copy_down</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="6614"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4415">_x_post_frame_copy_up</text>
+<!-- Line: box --> <rect
+ x="3826"
+ y="6566"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4417" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="5480"
+ y="10015"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="139"
+ text-anchor="start"
+ id="text4419">_x_post_restore_video_frame</text>
+<!-- Line: box --> <rect
+ x="1039"
+ y="10677"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ffffff; "
+ id="rect4421" />
+<!-- Line: box --> <rect
+ x="3826"
+ y="9590"
+ width="944"
+ height="566"
+ rx="0"
+ style="stroke:#000000;stroke-width:8; stroke-linejoin:miter; stroke-linecap:butt; fill:#ff0000; "
+ id="rect4423" />
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="2551"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4425">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8503"
+ y="2645"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4427">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8503"
+ y="3590"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4429">d u</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="3496"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4431">d u</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="5385"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4433">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="4629"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4435">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="7039"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4437">d u</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="6330"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4439">d u</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="8031"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4441">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="8976"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4443">d u</text>
+<!-- Line: box --> <rect
+ x="236"
+ y="661"
+ width="519"
+ height="1133"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4445" />
+<!-- Text --> <g
+ transform="translate(566,1748) rotate(-90.00021046)"
+ id="g4447">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4449">interception</text>
+ </g>
+<!-- Line: box --> <rect
+ x="236"
+ y="2031"
+ width="519"
+ height="1842"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4451" />
+<!-- Text --> <g
+ transform="translate(566,3543) rotate(-90.00021046)"
+ id="g4453">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4455">pass through</text>
+ </g>
+<!-- Line: box --> <rect
+ x="236"
+ y="4110"
+ width="519"
+ height="3212"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4457" />
+<!-- Text --> <g
+ transform="translate(566,6472) rotate(-90.00021046)"
+ id="g4459">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4461">modifying a copy</text>
+ </g>
+<!-- Line: box --> <rect
+ x="236"
+ y="7559"
+ width="519"
+ height="1748"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4463" />
+<!-- Text --> <g
+ transform="translate(566,9118) rotate(-90.00021046)"
+ id="g4465">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4467">dead-end draw</text>
+ </g>
+<!-- Line: box --> <rect
+ x="236"
+ y="9543"
+ width="519"
+ height="850"
+ rx="0"
+ style="stroke:#000000;stroke-width:16; stroke-linejoin:miter; stroke-linecap:butt; "
+ id="rect4469" />
+<!-- Text --> <g
+ transform="translate(566,10299) rotate(-90.00021046)"
+ id="g4471">
+ <text
+ xml:space="preserve"
+ x="0"
+ y="0"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4473">freeing</text>
+ </g>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="6992"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4475">d u</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="425"
+ y="11811"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4477">frame</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="2078"
+ y="11811"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="189"
+ text-anchor="start"
+ id="text4479">frame-&gt;next</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="9118"
+ y="10960"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4481">d u</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="4015"
+ y="10015"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4483">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="8456"
+ y="10062"
+ stroke="#000000"
+ fill="#000000"
+ font-family="Helvetica"
+ font-style="normal"
+ font-weight="bold"
+ font-size="315"
+ text-anchor="start"
+ id="text4485">d</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6000"
+ y="425"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="252"
+ text-anchor="start"
+ id="text4487">up</text>
+<!-- Text --> <text
+ xml:space="preserve"
+ x="6614"
+ y="425"
+ stroke="#000000"
+ fill="#000000"
+ font-family="DejaVu Sans Condensed"
+ font-style="normal"
+ font-weight="normal"
+ font-size="252"
+ text-anchor="start"
+ id="text4489">down</text>
+ </g>
+</svg>
diff --git a/doc/hackersguide/stream.sgml b/doc/hackersguide/stream.docbook
index b9690d9fe..b9690d9fe 100644
--- a/doc/hackersguide/stream.sgml
+++ b/doc/hackersguide/stream.docbook
diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am
index 2f7d162d2..9f3800ce6 100644
--- a/doc/man/Makefile.am
+++ b/doc/man/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
SUBDIRS = en
diff --git a/doc/man/en/Makefile.am b/doc/man/en/Makefile.am
index c8d616c35..f6e323558 100644
--- a/doc/man/en/Makefile.am
+++ b/doc/man/en/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
STATICMANS = xine-config.1 xine.5
diff --git a/doc/man/en/xine-config.1 b/doc/man/en/xine-config.1
index 3fe828166..af56fd844 100644
--- a/doc/man/en/xine-config.1
+++ b/doc/man/en/xine-config.1
@@ -13,25 +13,28 @@ xine\-config - script to get information about the installed version of libxine
[\-\-plugindir] [\-\-datadir] [\-\-scriptdir] [\-\-localedir]
.SH DESCRIPTION
.PP
+\fIxine\-config is DEPRECATED. Use pkg\-config instead.\fP
+.PP
\fIxine\-config\fP is a tool that is used to determine
the compiler and linker flags that should be used to compile
and link programs that use \fIlibxine\fP. It can also be used to determine
-the directories where \fIlibxine\fP expects plugins and skins.
-Finally, it's also used internally
-by the .m4 macros for GNU autoconf that are included with \fIxine-lib\fP.
-.
+the directories where \fIlibxine\fP expects plugins.
.SH OPTIONS
-\fIxine\-config\fP accepts the following options:
+\fIxine\-config\fP accepts the following options, passing them on (possibly
+modified) to \fIpkg\-config libxine\fP:
.TP 8
.B \-\-version
+\-\-modversion
+.br
Print the currently installed version of \fIlibxine\fP on the standard output.
.TP 8
.B \-\-libs
-Print the linker flags that are necessary to link \fIlibxine\fP to a program.
-.TP 8
+.TQ 8
.B \-\-cflags
.TQ 8
.B \-\-objcflags
+Passed on unmodified.
+.br
Print the compiler flags (for C and Objective C, respectively) that are
necessary to compile a program that uses \fIlibxine\fP.
.TP 8
@@ -44,21 +47,24 @@ necessary to compile a program that uses \fIlibxine\fP.
.B \-\-scriptdir
.TQ 8
.B \-\-localedir
+\-\-variable=...
+.br
Print the directory where, respectively, \fIlibxine\fP binaries, plugins,
data files, scripts and locale data are stored/expected.
.TP 8
.B \-\-prefix=PREFIX
+\-\-define\-variable=prefix=PREFIX
+.br
If specified, use PREFIX instead of the installation prefix that \fIxine-lib\fP
-was built with when computing the output for the \-\-cflags and
-\-\-libs options. This option is also used for the exec prefix
-if \-\-exec\-prefix was not specified. This option must be specified
-before any \-\-libs or \-\-cflags options.
+was built with. This option is also used for the exec prefix if
+\-\-exec\-prefix was not specified.
+
.TP 8
.B \-\-exec\-prefix=PREFIX
+\-\-define\-variable=exec_prefix=PREFIX
+.br
If specified, use PREFIX instead of the installation exec prefix that
-\fIxine-lib\fP was built with when computing the output for the \-\-cflags
-and \-\-libs options. This option must be specified before any
-\-\-libs or \-\-cflags options.
+\fIxine-lib\fP was built with.
.SH SEE ALSO
.BR xine-lib (3),
.BR xine (1)
diff --git a/doc/man/en/xine.5 b/doc/man/en/xine.5
index 3f80ea575..dd3621575 100644
--- a/doc/man/en/xine.5
+++ b/doc/man/en/xine.5
@@ -204,7 +204,8 @@ Play entry 0 of /tmp/ntsc.nrg (Nero file). Works for some simple Nero images.
.br
.SS DVB
.PP
-DVB MRLs require that ~/.xine/channels.conf exists and contains valid data.
+DVB MRLs require that xine-lib/channels.conf exists in $XDG_CONFIG_HOME/ or
+~/.config/ and contains valid data.
This can be obtained by generating a tuning file using the LinuxTV DVB apps
utility "scan" (or "dvbscan" if you're using a version newer than 1.1.0):
.PP
diff --git a/include/Makefile.am b/include/Makefile.am
index b0a7e6a91..e9bd4356a 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,32 +1,56 @@
-EXTRA_DIST = xine.h.in
+include $(top_srcdir)/misc/Makefile.quiet
+EXTRA_DIST = xine/version.h.in
if GENERATED_INTTYPES_H
inttypes_h = inttypes.h
endif
-include_HEADERS = xine.h
+nobase_include_HEADERS = xine.h \
+ xine/alphablend.h \
+ xine/array.h \
+ xine/attributes.h \
+ xine/audio_decoder.h \
+ xine/audio_out.h \
+ xine/broadcaster.h \
+ xine/buffer.h \
+ xine/compat.h \
+ xine/configfile.h \
+ xine/demux.h \
+ xine/info_helper.h \
+ xine/input_plugin.h \
+ xine/io_helper.h \
+ xine/list.h \
+ xine/metronom.h \
+ xine/os_types.h \
+ xine/osd.h \
+ xine/plugin_catalog.h \
+ xine/pool.h \
+ xine/post.h \
+ xine/refcounter.h \
+ xine/resample.h \
+ xine/ring_buffer.h \
+ xine/scratch.h \
+ xine/sorted_array.h \
+ xine/spu.h \
+ xine/spu_decoder.h \
+ xine/vdr.h \
+ xine/version.h \
+ xine/video_decoder.h \
+ xine/video_out.h \
+ xine/video_overlay.h \
+ xine/vo_scale.h \
+ xine/xine_buffer.h \
+ xine/xine_internal.h \
+ xine/xine_plugin.h \
+ xine/xineintl.h \
+ xine/xineutils.h \
+ xine/xmllexer.h \
+ xine/xmlparser.h
noinst_HEADERS = config.h
nodist_noinst_HEADERS = configure.h
-CONFIG_CLEAN_FILES = xine.h $(inttypes_h)
+nodist_include_HEADERS = $(inttypes_h)
-debug:
- @$(MAKE) CFLAGS="$(DEBUG_CFLAGS)"
-
-install-debug: debug
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-
-mostlyclean-generic:
- -rm -f *~ \#* .*~ .\#*
-
-maintainer-clean-generic:
- -@echo "This command is intended for maintainers to use;"
- -@echo "it deletes files that may require special tools to rebuild."
- -rm -f Makefile.in configure.h.in
-
-install-data-local: install-includeHEADERS
- sed -e '/^\/\*_x_/d' xine.h > $(DESTDIR)$(includedir)/xine.h
-if GENERATED_INTTYPES_H
- $(INSTALL) inttypes.h $(DESTDIR)$(includedir)
-endif
+CONFIG_CLEAN_FILES = $(inttypes_h)
+DISTCLEANFILES = xine/version.h
diff --git a/include/xine.h b/include/xine.h
new file mode 100644
index 000000000..19731e820
--- /dev/null
+++ b/include/xine.h
@@ -0,0 +1,2310 @@
+/*
+ * Copyright (C) 2000-2006 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, USA
+ *
+ * public xine-lib (libxine) interface and documentation
+ *
+ *
+ * some programming guidelines about this api:
+ * -------------------------------------------
+ *
+ * (1) libxine has (per stream instance) a fairly static memory
+ * model
+ * (2) as a rule of thumb, never free() or realloc() any pointers
+ * returned by the xine engine (unless stated otherwise)
+ * or, in other words:
+ * do not free() stuff you have not malloc()ed
+ * (3) xine is multi-threaded, make sure your programming environment
+ * can handle this.
+ * for x11-related stuff this means that you either have to properly
+ * use xlockdisplay() or use two seperate connections to the x-server
+ *
+ */
+/*_x_ Lines formatted like this one are xine-lib developer comments. */
+/*_x_ They will be removed from the installed version of this header. */
+
+#ifndef HAVE_XINE_H
+#define HAVE_XINE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+#include <stdarg.h>
+
+#ifdef WIN32
+#include <windows.h>
+#include <windowsx.h>
+#endif
+
+#include <xine/os_types.h>
+#include <xine/attributes.h>
+#include <xine/version.h>
+
+/* This enables some experimental features. These are not part of the
+ * official libxine API, so use them only, if you absolutely need them.
+ * Although we make efforts to keep even this part of the API as stable
+ * as possible, this is not guaranteed. Incompatible changes can occur.
+ */
+/* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */
+
+/* This disables some deprecated features. These are still part of the
+ * official libxine API and you may still use them. During the current
+ * major release series, these will always be available and will stay
+ * compatible. However, removal is likely to occur as soon as possible.
+ */
+/* #define XINE_DISABLE_DEPRECATED_FEATURES */
+
+
+/*********************************************************************
+ * xine opaque data types *
+ *********************************************************************/
+
+typedef struct xine_s xine_t;
+typedef struct xine_stream_s xine_stream_t;
+typedef struct xine_audio_port_s xine_audio_port_t;
+typedef struct xine_video_port_s xine_video_port_t;
+
+/*********************************************************************
+ * global engine handling *
+ *********************************************************************/
+
+/*
+ * version information
+ */
+
+/* dynamic info from actually linked libxine */
+const char *xine_get_version_string (void) XINE_PROTECTED;
+void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED;
+
+/* compare given version to libxine version,
+ return 1 if compatible, 0 otherwise */
+int xine_check_version (int major, int minor, int sub) XINE_PROTECTED;
+
+/*
+ * pre-init the xine engine
+ *
+ * will first malloc and init a xine_t, create an empty config
+ * system, then scan through all installed plugins and add them
+ * to an internal list for later use.
+ *
+ * to fully init the xine engine, you have to load config values
+ * (either using your own storage method and calling
+ * xine_config_register_entry, or by using the xine_load_config
+ * utility function - see below) and then call xine_init
+ *
+ * the only proper way to shut down the xine engine is to
+ * call xine_exit() - do not try to free() the xine pointer
+ * yourself and do not try to access any internal data structures
+ */
+xine_t *xine_new (void) XINE_PROTECTED;
+
+/* allow the setting of some flags before xine_init
+ * FIXME-ABI: this is currently GLOBAL
+ */
+void xine_set_flags (xine_t *, int) XINE_PROTECTED __attribute__((weak));
+#define XINE_FLAG_NO_WRITE_CACHE 1
+
+/*
+ * post_init the xine engine
+ */
+void xine_init (xine_t *self) XINE_PROTECTED;
+
+/*
+ * helper functions to find and init audio/video drivers
+ * from xine's plugin collection
+ *
+ * id : identifier of the driver, may be NULL for auto-detection
+ * data : special data struct for ui/driver communications, depends
+ * on driver
+ * visual: video driver flavor selector, constants see below
+ *
+ * both functions may return NULL if driver failed to load, was not
+ * found ...
+ *
+ * use xine_close_audio/video_driver() to close loaded drivers
+ * and free resources allocated by them
+ */
+xine_audio_port_t *xine_open_audio_driver (xine_t *self, const char *id,
+ void *data) XINE_PROTECTED;
+xine_video_port_t *xine_open_video_driver (xine_t *self, const char *id,
+ int visual, void *data) XINE_PROTECTED;
+
+void xine_close_audio_driver (xine_t *self, xine_audio_port_t *driver) XINE_PROTECTED;
+void xine_close_video_driver (xine_t *self, xine_video_port_t *driver) XINE_PROTECTED;
+
+/* valid visual types */
+#define XINE_VISUAL_TYPE_NONE 0
+#define XINE_VISUAL_TYPE_X11 1
+#define XINE_VISUAL_TYPE_X11_2 10
+#define XINE_VISUAL_TYPE_AA 2
+#define XINE_VISUAL_TYPE_FB 3
+#define XINE_VISUAL_TYPE_GTK 4
+#define XINE_VISUAL_TYPE_DFB 5
+#define XINE_VISUAL_TYPE_PM 6 /* used by the OS/2 port */
+#define XINE_VISUAL_TYPE_DIRECTX 7 /* used by the win32/msvc port */
+#define XINE_VISUAL_TYPE_CACA 8
+#define XINE_VISUAL_TYPE_MACOSX 9
+#define XINE_VISUAL_TYPE_XCB 11
+#define XINE_VISUAL_TYPE_RAW 12
+
+/*
+ * free all resources, close all plugins, close engine.
+ * self pointer is no longer valid after this call.
+ */
+void xine_exit (xine_t *self) XINE_PROTECTED;
+
+
+/*********************************************************************
+ * stream handling *
+ *********************************************************************/
+
+/*
+ * create a new stream for media playback/access
+ *
+ * returns xine_stream_t* if OK,
+ * NULL on error (use xine_get_error for details)
+ *
+ * the only proper way to free the stream pointer returned by this
+ * function is to call xine_dispose() on it. do not try to access any
+ * fields in xine_stream_t, they're all private and subject to change
+ * without further notice.
+ */
+xine_stream_t *xine_stream_new (xine_t *self,
+ xine_audio_port_t *ao, xine_video_port_t *vo) XINE_PROTECTED;
+
+/*
+ * Make one stream the slave of another.
+ * This establishes a binary master slave relation on streams, where
+ * certain operations (specified by parameter "affection") on the master
+ * stream are also applied to the slave stream.
+ * If you want more than one stream to react to one master, you have to
+ * apply the calls in a top down way:
+ * xine_stream_master_slave(stream1, stream2, 3);
+ * xine_stream_master_slave(stream2, stream3, 3);
+ * This will make stream1 affect stream2 and stream2 affect stream3, so
+ * effectively, operations on stream1 propagate to stream2 and 3.
+ *
+ * Please note that subsequent master_slave calls on the same streams
+ * will overwrite their previous master/slave setting.
+ * Be sure to not mess around.
+ *
+ * returns 1 on success, 0 on failure
+ */
+int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,
+ int affection) XINE_PROTECTED;
+
+/* affection is some of the following ORed together: */
+/* playing the master plays the slave */
+#define XINE_MASTER_SLAVE_PLAY (1<<0)
+/* slave stops on master stop */
+#define XINE_MASTER_SLAVE_STOP (1<<1)
+/* slave is synced to master's speed */
+#define XINE_MASTER_SLAVE_SPEED (1<<2)
+
+/*
+ * open a stream
+ *
+ * look for input / demux / decoder plugins, find out about the format
+ * see if it is supported, set up internal buffers and threads
+ *
+ * returns 1 if OK, 0 on error (use xine_get_error for details)
+ */
+int xine_open (xine_stream_t *stream, const char *mrl) XINE_PROTECTED;
+
+/*
+ * play a stream from a given position
+ *
+ * start_pos: 0..65535
+ * start_time: milliseconds
+ * if both start position parameters are != 0 start_pos will be used
+ * for non-seekable streams both values will be ignored
+ *
+ * returns 1 if OK, 0 on error (use xine_get_error for details)
+ */
+int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_PROTECTED;
+
+/*
+ * stop stream playback
+ * xine_stream_t stays valid for new xine_open or xine_play
+ */
+void xine_stop (xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * stop stream playback, free all stream-related resources
+ * xine_stream_t stays valid for new xine_open
+ */
+void xine_close (xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * ask current/recent input plugin to eject media - may or may not work,
+ * depending on input plugin capabilities
+ */
+int xine_eject (xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * stop playback, dispose all stream-related resources
+ * xine_stream_t no longer valid when after this
+ */
+void xine_dispose (xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * set/get engine parameters.
+ */
+void xine_engine_set_param(xine_t *self, int param, int value) XINE_PROTECTED;
+int xine_engine_get_param(xine_t *self, int param) XINE_PROTECTED;
+
+#define XINE_ENGINE_PARAM_VERBOSITY 1
+
+/*
+ * set/get xine stream parameters
+ * e.g. playback speed, constants see below
+ */
+void xine_set_param (xine_stream_t *stream, int param, int value) XINE_PROTECTED;
+int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED;
+
+/*
+ * xine stream parameters
+ */
+#define XINE_PARAM_SPEED 1 /* see below */
+#define XINE_PARAM_AV_OFFSET 2 /* unit: 1/90000 sec */
+#define XINE_PARAM_AUDIO_CHANNEL_LOGICAL 3 /* -1 => auto, -2 => off */
+#define XINE_PARAM_SPU_CHANNEL 4
+#define XINE_PARAM_VIDEO_CHANNEL 5
+#define XINE_PARAM_AUDIO_VOLUME 6 /* 0..100 */
+#define XINE_PARAM_AUDIO_MUTE 7 /* 1=>mute, 0=>unmute */
+#define XINE_PARAM_AUDIO_COMPR_LEVEL 8 /* <100=>off, % compress otherw*/
+#define XINE_PARAM_AUDIO_AMP_LEVEL 9 /* 0..200, 100=>100% (default) */
+#define XINE_PARAM_AUDIO_REPORT_LEVEL 10 /* 1=>send events, 0=> don't */
+#define XINE_PARAM_VERBOSITY 11 /* control console output */
+#define XINE_PARAM_SPU_OFFSET 12 /* unit: 1/90000 sec */
+#define XINE_PARAM_IGNORE_VIDEO 13 /* disable video decoding */
+#define XINE_PARAM_IGNORE_AUDIO 14 /* disable audio decoding */
+#define XINE_PARAM_IGNORE_SPU 15 /* disable spu decoding */
+#define XINE_PARAM_BROADCASTER_PORT 16 /* 0: disable, x: server port */
+#define XINE_PARAM_METRONOM_PREBUFFER 17 /* unit: 1/90000 sec */
+#define XINE_PARAM_EQ_30HZ 18 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_60HZ 19 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_125HZ 20 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_250HZ 21 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_500HZ 22 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_1000HZ 23 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_2000HZ 24 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_4000HZ 25 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_8000HZ 26 /* equalizer gains -100..100 */
+#define XINE_PARAM_EQ_16000HZ 27 /* equalizer gains -100..100 */
+#define XINE_PARAM_AUDIO_CLOSE_DEVICE 28 /* force closing audio device */
+#define XINE_PARAM_AUDIO_AMP_MUTE 29 /* 1=>mute, 0=>unmute */
+#define XINE_PARAM_FINE_SPEED 30 /* 1.000.000 => normal speed */
+#define XINE_PARAM_EARLY_FINISHED_EVENT 31 /* send event when demux finish*/
+#define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/
+#define XINE_PARAM_DELAY_FINISHED_EVENT 33 /* 1/10sec,0=>disable,-1=>forev*/
+
+/*
+ * speed values for XINE_PARAM_SPEED parameter.
+ *
+ * alternatively, one may use XINE_PARAM_FINE_SPEED for greater
+ * control of the speed value, where:
+ * XINE_PARAM_SPEED / 4 <-> XINE_PARAM_FINE_SPEED / 1000000
+ */
+#define XINE_SPEED_PAUSE 0
+#define XINE_SPEED_SLOW_4 1
+#define XINE_SPEED_SLOW_2 2
+#define XINE_SPEED_NORMAL 4
+#define XINE_SPEED_FAST_2 8
+#define XINE_SPEED_FAST_4 16
+
+/* normal speed value for XINE_PARAM_FINE_SPEED parameter */
+#define XINE_FINE_SPEED_NORMAL 1000000
+
+/* video parameters */
+#define XINE_PARAM_VO_DEINTERLACE 0x01000000 /* bool */
+#define XINE_PARAM_VO_ASPECT_RATIO 0x01000001 /* see below */
+#define XINE_PARAM_VO_HUE 0x01000002 /* 0..65535 */
+#define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535 */
+#define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535 */
+#define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535 */
+#define XINE_PARAM_VO_GAMMA 0x0100000c /* 0..65535 */
+#define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent */
+#define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent */
+#define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool */
+#define XINE_PARAM_VO_TVMODE 0x0100000a /* ??? */
+#define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly */
+#define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly */
+#define XINE_PARAM_VO_SHARPNESS 0x01000018 /* 0..65535 */
+#define XINE_PARAM_VO_NOISE_REDUCTION 0x01000019 /* 0..65535 */
+#define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels */
+#define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels */
+#define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels */
+#define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels */
+
+#define XINE_VO_ZOOM_STEP 100
+#define XINE_VO_ZOOM_MAX 400
+#define XINE_VO_ZOOM_MIN -85
+
+/* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */
+#define XINE_VO_ASPECT_AUTO 0
+#define XINE_VO_ASPECT_SQUARE 1 /* 1:1 */
+#define XINE_VO_ASPECT_4_3 2 /* 4:3 */
+#define XINE_VO_ASPECT_ANAMORPHIC 3 /* 16:9 */
+#define XINE_VO_ASPECT_DVB 4 /* 2.11:1 */
+#define XINE_VO_ASPECT_NUM_RATIOS 5
+#ifndef XINE_DISABLE_DEPRECATED_FEATURES
+#define XINE_VO_ASPECT_PAN_SCAN 41
+#define XINE_VO_ASPECT_DONT_TOUCH 42
+#endif
+
+/* stream format detection strategies */
+
+/* recognize stream type first by content then by extension. */
+#define XINE_DEMUX_DEFAULT_STRATEGY 0
+/* recognize stream type first by extension then by content. */
+#define XINE_DEMUX_REVERT_STRATEGY 1
+/* recognize stream type by content only. */
+#define XINE_DEMUX_CONTENT_STRATEGY 2
+/* recognize stream type by extension only. */
+#define XINE_DEMUX_EXTENSION_STRATEGY 3
+
+/* verbosity settings */
+#define XINE_VERBOSITY_NONE 0
+#define XINE_VERBOSITY_LOG 1
+#define XINE_VERBOSITY_DEBUG 2
+
+/*
+ * snapshot function
+ *
+ * image format can be YUV 4:2:0 or 4:2:2
+ * will copy the image data into memory that <img> points to
+ * (interleaved for yuv 4:2:2 or planary for 4:2:0)
+ *
+ * xine_get_current_frame() requires that <img> must be able
+ * to hold the image data. Use a NULL pointer to retrieve the
+ * necessary parameters for calculating the buffer size. Be
+ * aware that the image can change between two successive calls
+ * so you better pause the stream.
+ *
+ * xine_get_current_frame_s() requires to specify the buffer
+ * size and it returns the needed / used size. It won't copy
+ * image data into a too small buffer.
+ *
+ * xine_get_current_frame_alloc() takes care of allocating
+ * a buffer on its own, so image data can be retrieved by
+ * a single call without the need to pause the stream.
+ *
+ * xine_get_current_frame_data() passes the parameters of the
+ * previously mentioned functions plus further information in
+ * a structure and can work like the _s or _alloc function
+ * respectively depending on the passed flags.
+ *
+ * all functions return 1 on success, 0 failure.
+ */
+int xine_get_current_frame (xine_stream_t *stream,
+ int *width, int *height,
+ int *ratio_code, int *format,
+ uint8_t *img) XINE_PROTECTED;
+
+int xine_get_current_frame_s (xine_stream_t *stream,
+ int *width, int *height,
+ int *ratio_code, int *format,
+ uint8_t *img, int *img_size) XINE_PROTECTED;
+
+int xine_get_current_frame_alloc (xine_stream_t *stream,
+ int *width, int *height,
+ int *ratio_code, int *format,
+ uint8_t **img, int *img_size) XINE_PROTECTED;
+
+typedef struct {
+
+ int width;
+ int height;
+ int crop_left;
+ int crop_right;
+ int crop_top;
+ int crop_bottom;
+ int ratio_code;
+ int interlaced;
+ int format;
+ int img_size;
+ uint8_t *img;
+} xine_current_frame_data_t;
+
+#define XINE_FRAME_DATA_ALLOCATE_IMG (1<<0)
+
+int xine_get_current_frame_data (xine_stream_t *stream,
+ xine_current_frame_data_t *data,
+ int flags) XINE_PROTECTED;
+
+/* xine image formats */
+#define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y')
+#define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y')
+#define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X')
+#define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X')
+#define XINE_IMGFMT_VDPAU (('A'<<24)|('P'<<16)|('D'<<8)|'V')
+
+/* get current xine's virtual presentation timestamp (1/90000 sec)
+ * note: this is mostly internal data.
+ * one can use vpts with xine_osd_show() and xine_osd_hide().
+ */
+int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED;
+
+
+/*
+ * Continuous video frame grabbing feature.
+ *
+ * In opposite to the 'xine_get_current_frame' based snapshot function this grabbing
+ * feature allow continuous grabbing of last or next displayed video frame.
+ * Grabbed video frames are returned in simple three byte RGB format.
+ *
+ * Depending on the capabilities of the used video output driver video image data is
+ * taken as close as possible at the end of the video processing chain. Thus a returned
+ * video image could contain the blended OSD data, is deinterlaced, cropped and scaled
+ * and video properties like hue, sat could be applied.
+ * If a video output driver does not have a decent grabbing implementation then there
+ * is a generic fallback feature that grabs the video frame as they are taken from the video
+ * display queue (like the xine_get_current_frame' function).
+ * In this case color correct conversation to a RGB image incorporating source cropping
+ * and scaling to the requested grab size is also supported.
+ *
+ * The caller must first request a new video grab frame using the public 'xine_new_grab_video_frame'
+ * function. Then the caller should populate the frame with the wanted source cropping, grab image
+ * size and control flags. After that grab requests could be done by calling the supplied grab() feature
+ * of the frame. At the end a call to the supplied dispose() feature of the frame releases all needed
+ * resources.
+ * The caller should have acquired a port ticket while calling these features.
+ *
+ */
+#define HAVE_XINE_GRAB_VIDEO_FRAME 1
+
+/*
+ * frame structure used for grabbing video frames of format RGB.
+ */
+typedef struct xine_grab_video_frame_s xine_grab_video_frame_t;
+struct xine_grab_video_frame_s {
+ /*
+ * grab last/next displayed image.
+ * returns 0 if grab is successful, 1 on timeout and -1 on error
+ */
+ int (*grab) (xine_grab_video_frame_t *self);
+
+ /*
+ * free all resources.
+ */
+ void (*dispose) (xine_grab_video_frame_t *self);
+
+ /*
+ * Cropping of source image. Has to be specified by caller.
+ */
+ int crop_left;
+ int crop_right;
+ int crop_top;
+ int crop_bottom;
+
+ /*
+ * Parameters of returned RGB image.
+ * Caller can specify wanted frame size giving width and/or height a value > 0.
+ * In this case the grabbed image is scaled to the requested size.
+ * Otherwise the grab function returns the actual size of the grabbed image
+ * in width/height without scaling the image.
+ */
+ int width, height; /* requested/returned size of image */
+ uint8_t *img; /* returned RGB image data taking three bytes per pixel */
+ int64_t vpts; /* virtual presentation timestamp (1/90000 sec) of returned frame */
+
+ int timeout; /* Max. time to wait for next displayed frame in milliseconds */
+ int flags; /* Controlling flags. See XINE_GRAB_VIDEO_FRAME_FLAGS_* definitions */
+};
+
+#define XINE_GRAB_VIDEO_FRAME_FLAGS_CONTINUOUS 0x01 /* optimize resource allocation for continuous frame grabbing */
+#define XINE_GRAB_VIDEO_FRAME_FLAGS_WAIT_NEXT 0x02 /* wait for next display frame instead of using last displayed frame */
+
+#define XINE_GRAB_VIDEO_FRAME_DEFAULT_TIMEOUT 500
+
+/*
+ * Allocate new grab video frame. Returns NULL on error.
+ */
+xine_grab_video_frame_t* xine_new_grab_video_frame (xine_stream_t *stream) XINE_PROTECTED;
+
+
+/*********************************************************************
+ * media processing *
+ *********************************************************************/
+
+#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES
+
+/*
+ * access to decoded audio and video frames from a stream
+ * these functions are intended to provide the basis for
+ * re-encoding and other video processing applications
+ *
+ * note that the xine playback engine will block when
+ * rendering to a framegrab port: to unblock the stream,
+ * you must fetch the frames manually with the
+ * xine_get_next_* functions. this ensures that a
+ * framegrab port is guaranteed to never miss a frame.
+ *
+ */
+
+xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTECTED;
+
+typedef struct {
+
+ int64_t vpts; /* timestamp 1/90000 sec for a/v sync */
+ int64_t duration;
+ double aspect_ratio;
+ int width, height;
+ int colorspace; /* XINE_IMGFMT_* */
+
+ int pos_stream; /* bytes from stream start */
+ int pos_time; /* milliseconds */
+
+ int frame_number; /* frame number (may be unknown) */
+
+ uint8_t *data;
+ void *xine_frame; /* used internally by xine engine */
+} xine_video_frame_t;
+
+int xine_get_next_video_frame (xine_video_port_t *port,
+ xine_video_frame_t *frame) XINE_PROTECTED;
+
+void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *frame) XINE_PROTECTED;
+
+xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTECTED;
+
+typedef struct {
+
+ int64_t vpts; /* timestamp 1/90000 sec for a/v sync */
+ int num_samples;
+ int sample_rate;
+ int num_channels;
+ int bits_per_sample; /* per channel */
+
+ uint8_t *data;
+ void *xine_frame; /* used internally by xine engine */
+
+ off_t pos_stream; /* bytes from stream start */
+ int pos_time; /* milliseconds */
+} xine_audio_frame_t;
+
+int xine_get_next_audio_frame (xine_audio_port_t *port,
+ xine_audio_frame_t *frame) XINE_PROTECTED;
+
+void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *frame) XINE_PROTECTED;
+
+#endif
+
+
+/*********************************************************************
+ * post plugin handling *
+ *********************************************************************/
+
+/*
+ * post effect plugin functions
+ *
+ * after the data leaves the decoder it can pass an arbitrary tree
+ * of post plugins allowing for effects to be applied to the video
+ * frames/audio buffers before they reach the output stage
+ */
+
+typedef struct xine_post_s xine_post_t;
+
+struct xine_post_s {
+
+ /* a NULL-terminated array of audio input ports this post plugin
+ * provides; you can hand these to other post plugin's outputs or
+ * pass them to the initialization of streams
+ */
+ xine_audio_port_t **audio_input;
+
+ /* a NULL-terminated array of video input ports this post plugin
+ * provides; you can hand these to other post plugin's outputs or
+ * pass them to the initialization of streams
+ */
+ xine_video_port_t **video_input;
+
+ /* the type of the post plugin
+ * one of XINE_POST_TYPE_* can be used here
+ */
+ int type;
+
+};
+
+/*
+ * initialize a post plugin
+ *
+ * returns xine_post_t* on success, NULL on failure
+ *
+ * Initializes the post plugin with the given name and connects its
+ * outputs to the NULL-terminated arrays of audio and video ports.
+ * Some plugins also care about the number of inputs you request
+ * (e.g. mixer plugins), others simply ignore this number.
+ */
+xine_post_t *xine_post_init(xine_t *xine, const char *name,
+ int inputs,
+ xine_audio_port_t **audio_target,
+ xine_video_port_t **video_target) XINE_PROTECTED;
+
+/* get a list of all available post plugins */
+const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED;
+
+/* get a list of all post plugins of one type */
+const char *const *xine_list_post_plugins_typed(xine_t *xine, uint32_t type) XINE_PROTECTED;
+
+/*
+ * post plugin input/output
+ *
+ * These structures encapsulate inputs/outputs for post plugins
+ * to transfer arbitrary data. Frontends can also provide inputs
+ * and outputs and connect them to post plugins to exchange data
+ * with them.
+ */
+
+typedef struct xine_post_in_s xine_post_in_t;
+typedef struct xine_post_out_s xine_post_out_t;
+
+struct xine_post_in_s {
+
+ /* the name identifying this input */
+ const char *name;
+
+ /* the data pointer; input is directed to this memory location,
+ * so you simply access the pointer to access the input data */
+ void *data;
+
+ /* the datatype of this input, use one of XINE_POST_DATA_* here */
+ int type;
+
+};
+
+struct xine_post_out_s {
+
+ /* the name identifying this output */
+ const char *name;
+
+ /* the data pointer; output should be directed to this memory location,
+ * so in the easy case you simply write through the pointer */
+ void *data;
+
+ /* this function is called, when the output should be redirected
+ * to another input, you sould set the data pointer to direct
+ * any output to this new input;
+ * a special situation is, when this function is called with a NULL
+ * argument: in this case you should disconnect the data pointer
+ * from any output and if necessary to avoid writing to some stray
+ * memory you should make it point to some dummy location,
+ * returns 1 on success, 0 on failure;
+ * if you do not implement rewiring, set this to NULL */
+ int (*rewire) (xine_post_out_t *self, void *data);
+
+ /* the datatype of this output, use one of XINE_POST_DATA_* here */
+ int type;
+
+};
+
+/* get a list of all inputs of a post plugin */
+const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED;
+
+/* get a list of all outputs of a post plugin */
+const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED;
+
+/* retrieve one specific input of a post plugin */
+xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_PROTECTED;
+
+/* retrieve one specific output of a post plugin */
+xine_post_out_t *xine_post_output(xine_post_t *self, const char *name) XINE_PROTECTED;
+
+/*
+ * wire an input to an output
+ * returns 1 on success, 0 on failure
+ */
+int xine_post_wire(xine_post_out_t *source, xine_post_in_t *target) XINE_PROTECTED;
+
+/*
+ * wire a video port to a video output
+ * This can be used to rewire different post plugins to the video output
+ * plugin layer. The ports you hand in at xine_post_init() will already
+ * be wired with the post plugin, so you need this function for
+ * _re_connecting only.
+ *
+ * returns 1 on success, 0 on failure
+ */
+int xine_post_wire_video_port(xine_post_out_t *source, xine_video_port_t *vo) XINE_PROTECTED;
+
+/*
+ * wire an audio port to an audio output
+ * This can be used to rewire different post plugins to the audio output
+ * plugin layer. The ports you hand in at xine_post_init() will already
+ * be wired with the post plugin, so you need this function for
+ * _re_connecting only.
+ *
+ * returns 1 on success, 0 on failure
+ */
+int xine_post_wire_audio_port(xine_post_out_t *source, xine_audio_port_t *ao) XINE_PROTECTED;
+
+/*
+ * Extracts an output for a stream. Use this to rewire the outputs of streams.
+ */
+xine_post_out_t * xine_get_video_source(xine_stream_t *stream) XINE_PROTECTED;
+xine_post_out_t * xine_get_audio_source(xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * disposes the post plugin
+ * please make sure that no other post plugin and no stream is
+ * connected to any of this plugin's inputs
+ */
+void xine_post_dispose(xine_t *xine, xine_post_t *self) XINE_PROTECTED;
+
+
+/* post plugin types */
+#define XINE_POST_TYPE_VIDEO_FILTER 0x010000
+#define XINE_POST_TYPE_VIDEO_VISUALIZATION 0x010001
+#define XINE_POST_TYPE_VIDEO_COMPOSE 0x010002
+#define XINE_POST_TYPE_AUDIO_FILTER 0x020000
+#define XINE_POST_TYPE_AUDIO_VISUALIZATION 0x020001
+
+
+/* post plugin data types */
+
+/* video port data
+ * input->data is a xine_video_port_t*
+ * output->data usually is a xine_video_port_t**
+ */
+#define XINE_POST_DATA_VIDEO 0
+
+/* audio port data
+ * input->data is a xine_audio_port_t*
+ * output->data usually is a xine_audio_port_t**
+ */
+#define XINE_POST_DATA_AUDIO 1
+
+/* integer data
+ * input->data is a int*
+ * output->data usually is a int*
+ */
+#define XINE_POST_DATA_INT 3
+
+/* double precision floating point data
+ * input->data is a double*
+ * output->data usually is a double*
+ */
+#define XINE_POST_DATA_DOUBLE 4
+
+/* parameters api (used by frontends)
+ * input->data is xine_post_api_t* (see below)
+ */
+#define XINE_POST_DATA_PARAMETERS 5
+
+/* defines a single parameter entry. */
+typedef struct {
+ int type; /* POST_PARAM_TYPE_xxx */
+ const char *name; /* name of this parameter */
+ int size; /* sizeof(parameter) */
+ int offset; /* offset in bytes from struct ptr */
+ char **enum_values; /* enumeration (first=0) or NULL */
+ double range_min; /* minimum value */
+ double range_max; /* maximum value */
+ int readonly; /* 0 = read/write, 1=read-only */
+ const char *description; /* user-friendly description */
+} xine_post_api_parameter_t;
+
+/* description of parameters struct (params). */
+typedef struct {
+ int struct_size; /* sizeof(params) */
+ xine_post_api_parameter_t *parameter; /* list of parameters */
+} xine_post_api_descr_t;
+
+typedef struct {
+ /*
+ * method to set all the read/write parameters.
+ * params is a struct * defined by xine_post_api_descr_t
+ */
+ int (*set_parameters) (xine_post_t *self, void *params);
+
+ /*
+ * method to get all parameters.
+ */
+ int (*get_parameters) (xine_post_t *self, void *params);
+
+ /*
+ * method to get params struct definition
+ */
+ xine_post_api_descr_t * (*get_param_descr) (void);
+
+ /*
+ * method to get plugin and parameters help (UTF-8)
+ * the help string must be word wrapped by the frontend.
+ * it might contain \n to mark paragraph breaks.
+ */
+ char * (*get_help) (void);
+} xine_post_api_t;
+
+/* post parameter types */
+#define POST_PARAM_TYPE_LAST 0 /* terminator of parameter list */
+#define POST_PARAM_TYPE_INT 1 /* integer (or vector of integers) */
+#define POST_PARAM_TYPE_DOUBLE 2 /* double (or vector of doubles) */
+#define POST_PARAM_TYPE_CHAR 3 /* char (or vector of chars = string) */
+#define POST_PARAM_TYPE_STRING 4 /* (char *), ASCIIZ */
+#define POST_PARAM_TYPE_STRINGLIST 5 /* (char **) list, NULL terminated */
+#define POST_PARAM_TYPE_BOOL 6 /* integer (0 or 1) */
+
+
+/*********************************************************************
+ * information retrieval *
+ *********************************************************************/
+
+/*
+ * xine log functions
+ *
+ * frontends can display xine log output using these functions
+ */
+int xine_get_log_section_count(xine_t *self) XINE_PROTECTED;
+
+/* return a NULL terminated array of log sections names */
+const char *const *xine_get_log_names(xine_t *self) XINE_PROTECTED;
+
+/* print some log information to <buf> section */
+void xine_log (xine_t *self, int buf,
+ const char *format, ...) XINE_FORMAT_PRINTF(3, 4) XINE_PROTECTED;
+void xine_vlog(xine_t *self, int buf,
+ const char *format, va_list args) XINE_FORMAT_PRINTF(3, 0) XINE_PROTECTED;
+
+/* get log messages of specified section */
+char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED;
+
+/* log callback will be called whenever something is logged */
+typedef void (*xine_log_cb_t) (void *user_data, int section);
+void xine_register_log_cb (xine_t *self, xine_log_cb_t cb,
+ void *user_data) XINE_PROTECTED;
+
+/*
+ * error handling / engine status
+ */
+
+/* return last error */
+int xine_get_error (xine_stream_t *stream) XINE_PROTECTED;
+
+/* get current xine engine status (constants see below) */
+int xine_get_status (xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * engine status codes
+ */
+#define XINE_STATUS_IDLE 0 /* no mrl assigned */
+#define XINE_STATUS_STOP 1
+#define XINE_STATUS_PLAY 2
+#define XINE_STATUS_QUIT 3
+
+/*
+ * xine error codes
+ */
+#define XINE_ERROR_NONE 0
+#define XINE_ERROR_NO_INPUT_PLUGIN 1
+#define XINE_ERROR_NO_DEMUX_PLUGIN 2
+#define XINE_ERROR_DEMUX_FAILED 3
+#define XINE_ERROR_MALFORMED_MRL 4
+#define XINE_ERROR_INPUT_FAILED 5
+
+/*
+ * try to find out audio/spu language of given channel
+ * (use -1 for current channel)
+ *
+ * lang must point to a buffer of at least XINE_LANG_MAX bytes
+ *
+ * returns 1 on success, 0 on failure
+ */
+int xine_get_audio_lang (xine_stream_t *stream, int channel,
+ char *lang) XINE_PROTECTED;
+int xine_get_spu_lang (xine_stream_t *stream, int channel,
+ char *lang) XINE_PROTECTED;
+/*_x_ increasing this number means an incompatible ABI breakage! */
+#define XINE_LANG_MAX 32
+
+/*
+ * get position / length information
+ *
+ * depending of the nature and system layer of the stream,
+ * some or all of this information may be unavailable or incorrect
+ * (e.g. live network streams may not have a valid length)
+ *
+ * returns 1 on success, 0 on failure (data was not updated,
+ * probably because it's not known yet... try again later)
+ */
+int xine_get_pos_length (xine_stream_t *stream,
+ int *pos_stream, /* 0..65535 */
+ int *pos_time, /* milliseconds */
+ int *length_time) /* milliseconds */
+ XINE_PROTECTED;
+
+/*
+ * get information about the stream such as
+ * video width/height, codecs, audio format, title, author...
+ * strings are UTF-8 encoded.
+ *
+ * constants see below
+ */
+uint32_t xine_get_stream_info (xine_stream_t *stream, int info) XINE_PROTECTED;
+const char *xine_get_meta_info (xine_stream_t *stream, int info) XINE_PROTECTED;
+
+/* xine_get_stream_info */
+#define XINE_STREAM_INFO_BITRATE 0
+#define XINE_STREAM_INFO_SEEKABLE 1
+#define XINE_STREAM_INFO_VIDEO_WIDTH 2
+#define XINE_STREAM_INFO_VIDEO_HEIGHT 3
+#define XINE_STREAM_INFO_VIDEO_RATIO 4 /* *10000 */
+#define XINE_STREAM_INFO_VIDEO_CHANNELS 5
+#define XINE_STREAM_INFO_VIDEO_STREAMS 6
+#define XINE_STREAM_INFO_VIDEO_BITRATE 7
+#define XINE_STREAM_INFO_VIDEO_FOURCC 8
+#define XINE_STREAM_INFO_VIDEO_HANDLED 9 /* codec available? */
+#define XINE_STREAM_INFO_FRAME_DURATION 10 /* 1/90000 sec */
+#define XINE_STREAM_INFO_AUDIO_CHANNELS 11
+#define XINE_STREAM_INFO_AUDIO_BITS 12
+#define XINE_STREAM_INFO_AUDIO_SAMPLERATE 13
+#define XINE_STREAM_INFO_AUDIO_BITRATE 14
+#define XINE_STREAM_INFO_AUDIO_FOURCC 15
+#define XINE_STREAM_INFO_AUDIO_HANDLED 16 /* codec available? */
+#define XINE_STREAM_INFO_HAS_CHAPTERS 17
+#define XINE_STREAM_INFO_HAS_VIDEO 18
+#define XINE_STREAM_INFO_HAS_AUDIO 19
+#define XINE_STREAM_INFO_IGNORE_VIDEO 20
+#define XINE_STREAM_INFO_IGNORE_AUDIO 21
+#define XINE_STREAM_INFO_IGNORE_SPU 22
+#define XINE_STREAM_INFO_VIDEO_HAS_STILL 23
+#define XINE_STREAM_INFO_MAX_AUDIO_CHANNEL 24
+#define XINE_STREAM_INFO_MAX_SPU_CHANNEL 25
+#define XINE_STREAM_INFO_AUDIO_MODE 26
+#define XINE_STREAM_INFO_SKIPPED_FRAMES 27 /* for 1000 frames delivered */
+#define XINE_STREAM_INFO_DISCARDED_FRAMES 28 /* for 1000 frames delivered */
+#define XINE_STREAM_INFO_VIDEO_AFD 29
+#define XINE_STREAM_INFO_DVD_TITLE_NUMBER 30
+#define XINE_STREAM_INFO_DVD_TITLE_COUNT 31
+#define XINE_STREAM_INFO_DVD_CHAPTER_NUMBER 32
+#define XINE_STREAM_INFO_DVD_CHAPTER_COUNT 33
+#define XINE_STREAM_INFO_DVD_ANGLE_NUMBER 34
+#define XINE_STREAM_INFO_DVD_ANGLE_COUNT 35
+
+/* possible values for XINE_STREAM_INFO_VIDEO_AFD */
+#define XINE_VIDEO_AFD_NOT_PRESENT -1
+#define XINE_VIDEO_AFD_RESERVED_0 0
+#define XINE_VIDEO_AFD_RESERVED_1 1
+#define XINE_VIDEO_AFD_BOX_16_9_TOP 2
+#define XINE_VIDEO_AFD_BOX_14_9_TOP 3
+#define XINE_VIDEO_AFD_BOX_GT_16_9_CENTRE 4
+#define XINE_VIDEO_AFD_RESERVED_5 5
+#define XINE_VIDEO_AFD_RESERVED_6 6
+#define XINE_VIDEO_AFD_RESERVED_7 7
+#define XINE_VIDEO_AFD_SAME_AS_FRAME 8
+#define XINE_VIDEO_AFD_4_3_CENTRE 9
+#define XINE_VIDEO_AFD_16_9_CENTRE 10
+#define XINE_VIDEO_AFD_14_9_CENTRE 11
+#define XINE_VIDEO_AFD_RESERVED_12 12
+#define XINE_VIDEO_AFD_4_3_PROTECT_14_9 13
+#define XINE_VIDEO_AFD_16_9_PROTECT_14_9 14
+#define XINE_VIDEO_AFD_16_9_PROTECT_4_3 15
+
+/* xine_get_meta_info */
+#define XINE_META_INFO_TITLE 0
+#define XINE_META_INFO_COMMENT 1
+#define XINE_META_INFO_ARTIST 2
+#define XINE_META_INFO_GENRE 3
+#define XINE_META_INFO_ALBUM 4
+#define XINE_META_INFO_YEAR 5 /* may be full date */
+#define XINE_META_INFO_VIDEOCODEC 6
+#define XINE_META_INFO_AUDIOCODEC 7
+#define XINE_META_INFO_SYSTEMLAYER 8
+#define XINE_META_INFO_INPUT_PLUGIN 9
+#define XINE_META_INFO_CDINDEX_DISCID 10
+#define XINE_META_INFO_TRACK_NUMBER 11
+#define XINE_META_INFO_COMPOSER 12
+/* post-1.1.17; taken from the list at http://age.hobba.nl/audio/mirroredpages/ogg-tagging.html on 2009-12-11 */
+#define XINE_META_INFO_PUBLISHER 13
+#define XINE_META_INFO_COPYRIGHT 14
+#define XINE_META_INFO_LICENSE 15
+#define XINE_META_INFO_ARRANGER 16
+#define XINE_META_INFO_LYRICIST 17
+#define XINE_META_INFO_AUTHOR 18
+#define XINE_META_INFO_CONDUCTOR 19
+#define XINE_META_INFO_PERFORMER 20
+#define XINE_META_INFO_ENSEMBLE 21
+#define XINE_META_INFO_OPUS 22
+#define XINE_META_INFO_PART 23
+#define XINE_META_INFO_PARTNUMBER 24
+#define XINE_META_INFO_LOCATION 25
+/* post-1.1.18.1 */
+#define XINE_META_INFO_DISCNUMBER 26
+
+
+/*********************************************************************
+ * plugin management / autoplay / mrl browsing *
+ *********************************************************************/
+
+/*
+ * note: the pointers to strings or string arrays returned
+ * by some of these functions are pointers to statically
+ * alloced internal xine memory chunks.
+ * they're only valid between xine function calls
+ * and should never be free()d.
+ */
+
+typedef struct {
+ char *origin; /* file plugin: path */
+ char *mrl; /* <type>://<location> */
+ char *link;
+ off_t size; /* size of this source, may be 0 */
+ uint32_t type; /* see below */
+} xine_mrl_t;
+
+/* mrl types */
+#define XINE_MRL_TYPE_unknown (0 << 0)
+#define XINE_MRL_TYPE_dvd (1 << 0)
+#define XINE_MRL_TYPE_vcd (1 << 1)
+#define XINE_MRL_TYPE_net (1 << 2)
+#define XINE_MRL_TYPE_rtp (1 << 3)
+#define XINE_MRL_TYPE_stdin (1 << 4)
+#define XINE_MRL_TYPE_cda (1 << 5)
+#define XINE_MRL_TYPE_file (1 << 6)
+#define XINE_MRL_TYPE_file_fifo (1 << 7)
+#define XINE_MRL_TYPE_file_chardev (1 << 8)
+#define XINE_MRL_TYPE_file_directory (1 << 9)
+#define XINE_MRL_TYPE_file_blockdev (1 << 10)
+#define XINE_MRL_TYPE_file_normal (1 << 11)
+#define XINE_MRL_TYPE_file_symlink (1 << 12)
+#define XINE_MRL_TYPE_file_sock (1 << 13)
+#define XINE_MRL_TYPE_file_exec (1 << 14)
+#define XINE_MRL_TYPE_file_backup (1 << 15)
+#define XINE_MRL_TYPE_file_hidden (1 << 16)
+
+/* get a list of browsable input plugin ids */
+const char *const *xine_get_browsable_input_plugin_ids (xine_t *self) XINE_PROTECTED;
+
+/*
+ * ask input plugin named <plugin_id> to return
+ * a list of available MRLs in domain/directory <start_mrl>.
+ *
+ * <start_mrl> may be NULL indicating the toplevel domain/dir
+ * returns <start_mrl> if <start_mrl> is a valid MRL, not a directory
+ * returns NULL if <start_mrl> is an invalid MRL, not even a directory.
+ */
+xine_mrl_t **xine_get_browse_mrls (xine_t *self,
+ const char *plugin_id,
+ const char *start_mrl,
+ int *num_mrls) XINE_PROTECTED;
+
+/* get a list of plugins that support the autoplay feature */
+const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_PROTECTED;
+
+/* get autoplay MRL list from input plugin named <plugin_id> */
+const char * const *xine_get_autoplay_mrls (xine_t *self,
+ const char *plugin_id,
+ int *num_mrls) XINE_PROTECTED;
+
+/* get a list of file extensions for file types supported by xine
+ * the list is separated by spaces
+ *
+ * the pointer returned can be free()ed when no longer used */
+char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED;
+
+/* get a list of mime types supported by xine
+ *
+ * the pointer returned can be free()ed when no longer used */
+char *xine_get_mime_types (xine_t *self) XINE_PROTECTED;
+
+/* get the demuxer identifier that handles a given mime type
+ *
+ * the pointer returned can be free()ed when no longer used
+ * returns NULL if no demuxer is available to handle this. */
+char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) XINE_PROTECTED;
+
+/* get a description string for a plugin */
+const char *xine_get_input_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_demux_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_spu_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_audio_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_video_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_audio_driver_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_video_driver_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+const char *xine_get_post_plugin_description (xine_t *self,
+ const char *plugin_id) XINE_PROTECTED;
+
+/* get lists of available audio and video output plugins */
+const char *const *xine_list_audio_output_plugins (xine_t *self) XINE_PROTECTED;
+const char *const *xine_list_video_output_plugins (xine_t *self) XINE_PROTECTED;
+/* typemask is (1ULL << XINE_VISUAL_TYPE_FOO) | ... */
+const char *const *xine_list_video_output_plugins_typed (xine_t *self, uint64_t typemask) XINE_PROTECTED;
+
+/* get list of available demultiplexor plugins */
+const char *const *xine_list_demuxer_plugins(xine_t *self) XINE_PROTECTED;
+
+/* get list of available input plugins */
+const char *const *xine_list_input_plugins(xine_t *self) XINE_PROTECTED;
+
+/* get list of available subpicture plugins */
+const char *const *xine_list_spu_plugins(xine_t *self) XINE_PROTECTED;
+
+/* get list of available audio and video decoder plugins */
+const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTECTED;
+const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTECTED;
+
+/* unload unused plugins */
+void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED;
+
+
+/*********************************************************************
+ * visual specific gui <-> xine engine communication *
+ *********************************************************************/
+
+/* new (preferred) method to talk to video driver. */
+int xine_port_send_gui_data (xine_video_port_t *vo,
+ int type, void *data) XINE_PROTECTED;
+
+typedef struct {
+
+ /* area of that drawable to be used by video */
+ int x,y,w,h;
+
+} x11_rectangle_t;
+
+/*
+ * this is the visual data struct any x11 gui
+ * must supply to the xine_open_video_driver call
+ * ("data" parameter)
+ */
+typedef struct {
+
+ /* some information about the display */
+ void *display; /* Display* */
+ int screen;
+
+ /* drawable to display the video in/on */
+ unsigned long d; /* Drawable */
+
+ void *user_data;
+
+ /*
+ * dest size callback
+ *
+ * this will be called by the video driver to find out
+ * how big the video output area size will be for a
+ * given video size. The ui should _not_ adjust its
+ * video out area, just do some calculations and return
+ * the size. This will be called for every frame, ui
+ * implementation should be fast.
+ * dest_pixel_aspect should be set to the used display pixel aspect.
+ * NOTE: Semantics has changed: video_width and video_height
+ * are no longer pixel aspect corrected. Get the old semantics
+ * in the UI with
+ * *dest_pixel_aspect = display_pixel_aspect;
+ * if (video_pixel_aspect >= display_pixel_aspect)
+ * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
+ * else
+ * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
+ */
+ void (*dest_size_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect);
+
+ /*
+ * frame output callback
+ *
+ * this will be called by the video driver for every frame
+ * it's about to draw. ui can adapt its size if necessary
+ * here.
+ * note: the ui doesn't have to adjust itself to this
+ * size, this is just to be taken as a hint.
+ * ui must return the actual size of the video output
+ * area and the video output driver will do its best
+ * to adjust the video frames to that size (while
+ * preserving aspect ratio and stuff).
+ * dest_x, dest_y: offset inside window
+ * dest_width, dest_height: available drawing space
+ * dest_pixel_aspect: display pixel aspect
+ * win_x, win_y: window absolute screen position
+ * NOTE: Semantics has changed: video_width and video_height
+ * are no longer pixel aspect corrected. Get the old semantics
+ * in the UI with
+ * *dest_pixel_aspect = display_pixel_aspect;
+ * if (video_pixel_aspect >= display_pixel_aspect)
+ * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
+ * else
+ * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
+ */
+ void (*frame_output_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_x, int *dest_y,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect,
+ int *win_x, int *win_y);
+
+ /*
+ * lock display callback
+ *
+ * this callback is called when the video driver
+ * needs access to the x11 display connection
+ *
+ * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2
+ * note: if display_lock is NULL, the fallback is used
+ * note: fallback for this function is XLockDisplay(display)
+ */
+ void (*lock_display) (void *user_data);
+
+ /*
+ * unlock display callback
+ *
+ * this callback is called when the video driver
+ * doesn't need access to the x11 display connection anymore
+ *
+ * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2
+ * note: if display_unlock is NULL, the fallback is used
+ * note: fallback for this function is XUnlockDisplay(display)
+ */
+ void (*unlock_display) (void *user_data);
+
+} x11_visual_t;
+
+/*
+ * this is the visual data struct any xcb gui
+ * must supply to the xine_open_video_driver call
+ * ("data" parameter)
+ */
+typedef struct {
+
+ /* some information about the display */
+ void *connection; /* xcb_connection_t */
+ void *screen; /* xcb_screen_t */
+
+ /* window to display the video in / on */
+ unsigned int window; /* xcb_window_t */
+
+ void *user_data;
+
+ /*
+ * dest size callback
+ *
+ * this will be called by the video driver to find out
+ * how big the video output area size will be for a
+ * given video size. The ui should _not_ adjust its
+ * video out area, just do some calculations and return
+ * the size. This will be called for every frame, ui
+ * implementation should be fast.
+ * dest_pixel_aspect should be set to the used display pixel aspect.
+ * NOTE: Semantics has changed: video_width and video_height
+ * are no longer pixel aspect corrected. Get the old semantics
+ * in the UI with
+ * *dest_pixel_aspect = display_pixel_aspect;
+ * if (video_pixel_aspect >= display_pixel_aspect)
+ * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
+ * else
+ * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
+ */
+ void (*dest_size_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect);
+
+ /*
+ * frame output callback
+ *
+ * this will be called by the video driver for every frame
+ * it's about to draw. ui can adapt its size if necessary
+ * here.
+ * note: the ui doesn't have to adjust itself to this
+ * size, this is just to be taken as a hint.
+ * ui must return the actual size of the video output
+ * area and the video output driver will do its best
+ * to adjust the video frames to that size (while
+ * preserving aspect ratio and stuff).
+ * dest_x, dest_y: offset inside window
+ * dest_width, dest_height: available drawing space
+ * dest_pixel_aspect: display pixel aspect
+ * win_x, win_y: window absolute screen position
+ * NOTE: Semantics has changed: video_width and video_height
+ * are no longer pixel aspect corrected. Get the old semantics
+ * in the UI with
+ * *dest_pixel_aspect = display_pixel_aspect;
+ * if (video_pixel_aspect >= display_pixel_aspect)
+ * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
+ * else
+ * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
+ */
+ void (*frame_output_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_x, int *dest_y,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect,
+ int *win_x, int *win_y);
+
+} xcb_visual_t;
+
+/**************************************************
+ * XINE_VO_RAW struct definitions
+ *************************************************/
+/* frame_format definitions */
+#define XINE_VORAW_YV12 1
+#define XINE_VORAW_YUY2 2
+#define XINE_VORAW_RGB 4
+
+/* maximum number of overlays the raw driver can handle */
+#define XINE_VORAW_MAX_OVL 16
+
+/* raw_overlay_t struct used in raw_overlay_cb callback */
+typedef struct {
+ uint8_t *ovl_rgba;
+ int ovl_w, ovl_h; /* overlay's width and height */
+ int ovl_x, ovl_y; /* overlay's top-left display position */
+} raw_overlay_t;
+
+/* this is the visual data struct any raw gui
+ * must supply to the xine_open_video_driver call
+ * ("data" parameter)
+ */
+typedef struct {
+ void *user_data;
+
+ /* OR'ed frame_format
+ * Unsupported frame formats are converted to rgb.
+ * XINE_VORAW_RGB is always assumed by the driver, even if not set.
+ * So a frontend must at least support rgb.
+ * Be aware that rgb requires more cpu than yuv,
+ * so avoid its usage for video playback.
+ * However, it's useful for single frame capture (e.g. thumbs)
+ */
+ int supported_formats;
+
+ /* raw output callback
+ * this will be called by the video driver for every frame
+ *
+ * If frame_format==XINE_VORAW_YV12, data0 points to frame_width*frame_height Y values
+ * data1 points to (frame_width/2)*(frame_height/2) U values
+ * data2 points to (frame_width/2)*(frame_height/2) V values
+ *
+ * If frame_format==XINE_VORAW_YUY2, data0 points to frame_width*frame_height*2 YU/Y²V values
+ * data1 is NULL
+ * data2 is NULL
+ *
+ * If frame_format==XINE_VORAW_RGB, data0 points to frame_width*frame_height*3 RGB values
+ * data1 is NULL
+ * data2 is NULL
+ */
+ void (*raw_output_cb) (void *user_data, int frame_format,
+ int frame_width, int frame_height,
+ double frame_aspect,
+ void *data0, void *data1, void *data2);
+
+ /* raw overlay callback
+ * this will be called by the video driver for every new overlay state
+ * overlays_array points to an array of num_ovl raw_overlay_t
+ * Note that num_ovl can be 0, meaning "end of overlay display"
+ * num_ovl is at most XINE_VORAW_MAX_OVL */
+ void (*raw_overlay_cb) (void *user_data, int num_ovl,
+ raw_overlay_t *overlays_array);
+} raw_visual_t;
+/**********************************************
+ * end of vo_raw defs
+ *********************************************/
+
+/*
+ * this is the visual data struct any fb gui
+ * may supply to the xine_open_video_driver call
+ * ("data" parameter) to get frame_output_cd calls
+ */
+
+typedef struct {
+
+ void (*frame_output_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_x, int *dest_y,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect,
+ int *win_x, int *win_y);
+
+ void *user_data;
+
+} fb_visual_t;
+
+#ifdef WIN32
+/*
+ * this is the visual data struct any win32 gui should supply
+ * (pass this to init_video_out_plugin or the xine_load_video_output_plugin
+ * utility function)
+ */
+
+typedef struct {
+
+ HWND WndHnd; /* handle of window associated with primary surface */
+ HINSTANCE HInst; /* handle of windows application instance */
+ RECT WndRect; /* rect of window client points translated to screen
+ * cooridnates */
+ int FullScreen; /* is window fullscreen */
+ HBRUSH Brush; /* window brush for background color */
+ COLORREF ColorKey; /* window brush color key */
+
+} win32_visual_t;
+
+/*
+ * constants for gui_data_exchange's data_type parameter
+ */
+
+#define GUI_WIN32_MOVED_OR_RESIZED 0
+
+#endif /* WIN32 */
+
+/*
+ * "type" constants for xine_port_send_gui_data(...)
+ */
+
+#ifndef XINE_DISABLE_DEPRECATED_FEATURES
+/* xevent *data */
+#define XINE_GUI_SEND_COMPLETION_EVENT 1 /* DEPRECATED */
+#endif
+
+/* Drawable data */
+#define XINE_GUI_SEND_DRAWABLE_CHANGED 2
+
+/* xevent *data */
+#define XINE_GUI_SEND_EXPOSE_EVENT 3
+
+/* x11_rectangle_t *data */
+#define XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO 4
+
+/* int data */
+#define XINE_GUI_SEND_VIDEOWIN_VISIBLE 5
+
+/* *data contains chosen visual, select a new one or change it to NULL
+ * to indicate the visual to use or that no visual will work */
+/* XVisualInfo **data */
+#define XINE_GUI_SEND_SELECT_VISUAL 8
+
+/* Gui is about to destroy drawable */
+#define XINE_GUI_SEND_WILL_DESTROY_DRAWABLE 9
+
+
+/*********************************************************************
+ * xine health check stuff *
+ *********************************************************************/
+
+#define XINE_HEALTH_CHECK_OK 0
+#define XINE_HEALTH_CHECK_FAIL 1
+#define XINE_HEALTH_CHECK_UNSUPPORTED 2
+#define XINE_HEALTH_CHECK_NO_SUCH_CHECK 3
+
+#define CHECK_KERNEL 0
+#define CHECK_MTRR 1
+#define CHECK_CDROM 2
+#define CHECK_DVDROM 3
+#define CHECK_DMA 4
+#define CHECK_X 5
+#define CHECK_XV 6
+
+struct xine_health_check_s {
+ const char* cdrom_dev;
+ const char* dvd_dev;
+ const char* msg;
+ const char* title;
+ const char* explanation;
+ int status;
+};
+
+typedef struct xine_health_check_s xine_health_check_t;
+xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num) XINE_PROTECTED;
+
+
+/*********************************************************************
+ * configuration system *
+ *********************************************************************/
+
+/*
+ * config entry data types
+ */
+
+#define XINE_CONFIG_TYPE_UNKNOWN 0
+#define XINE_CONFIG_TYPE_RANGE 1
+#define XINE_CONFIG_TYPE_STRING 2
+#define XINE_CONFIG_TYPE_ENUM 3
+#define XINE_CONFIG_TYPE_NUM 4
+#define XINE_CONFIG_TYPE_BOOL 5
+
+/* For the string type (1.1.4 and later). These are stored in num_value. */
+#define XINE_CONFIG_STRING_IS_STRING 0
+#define XINE_CONFIG_STRING_IS_FILENAME 1
+#define XINE_CONFIG_STRING_IS_DEVICE_NAME 2
+#define XINE_CONFIG_STRING_IS_DIRECTORY_NAME 3
+
+typedef struct xine_cfg_entry_s xine_cfg_entry_t;
+
+typedef void (*xine_config_cb_t) (void *user_data,
+ xine_cfg_entry_t *entry);
+struct xine_cfg_entry_s {
+ const char *key; /* unique id (example: gui.logo_mrl) */
+
+ int type;
+
+ /* user experience level */
+ int exp_level; /* 0 => beginner,
+ 10 => advanced user,
+ 20 => expert */
+
+ /* type unknown */
+ char *unknown_value;
+
+ /* type string */
+ char *str_value;
+ char *str_default;
+
+ /* common to range, enum, num, bool;
+ * num_value is also used by string to indicate what's required:
+ * plain string, file name, device name, directory name
+ */
+ int num_value;
+ int num_default;
+
+ /* type range specific: */
+ int range_min;
+ int range_max;
+
+ /* type enum specific: */
+ char **enum_values;
+
+ /* help info for the user (UTF-8)
+ * the help string must be word wrapped by the frontend.
+ * it might contain \n to mark paragraph breaks.
+ */
+ const char *description;
+ const char *help;
+
+ /* callback function and data for live changeable values */
+ /* some config entries will take effect immediately, although they
+ * do not have a callback registered; such values will have some
+ * non-NULL dummy value in callback_data; so if you want to check,
+ * if a config change will require restarting xine, check for
+ * callback_data == NULL */
+ xine_config_cb_t callback;
+ void *callback_data;
+
+};
+
+const char *xine_config_register_string (xine_t *self,
+ const char *key,
+ const char *def_value,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data) XINE_PROTECTED;
+
+const char *xine_config_register_filename (xine_t *self,
+ const char *key,
+ const char *def_value,
+ int req_type, /* XINE_CONFIG_STRING_IS_* */
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data) XINE_PROTECTED;
+
+int xine_config_register_range (xine_t *self,
+ const char *key,
+ int def_value,
+ int min, int max,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data) XINE_PROTECTED;
+
+int xine_config_register_enum (xine_t *self,
+ const char *key,
+ int def_value,
+ char **values,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data) XINE_PROTECTED;
+
+int xine_config_register_num (xine_t *self,
+ const char *key,
+ int def_value,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data) XINE_PROTECTED;
+
+int xine_config_register_bool (xine_t *self,
+ const char *key,
+ int def_value,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data) XINE_PROTECTED;
+
+/*
+ * the following functions will copy data from the internal xine_config
+ * data database to the xine_cfg_entry_t *entry you provide
+ *
+ * they return 1 on success, 0 on failure
+ */
+
+/* get first config item */
+int xine_config_get_first_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED;
+
+/* get next config item (iterate through the items) */
+int xine_config_get_next_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED;
+
+/* search for a config entry by key */
+int xine_config_lookup_entry (xine_t *self, const char *key,
+ xine_cfg_entry_t *entry) XINE_PROTECTED;
+
+/*
+ * update a config entry (which was returned from lookup_entry() )
+ *
+ * xine will make a deep copy of the data in the entry into its internal
+ * config database.
+ */
+void xine_config_update_entry (xine_t *self,
+ const xine_cfg_entry_t *entry) XINE_PROTECTED;
+
+/*
+ * translation of old configuration entry names
+ */
+typedef struct {
+ const char *old_name, *new_name;
+} xine_config_entry_translation_t;
+
+void xine_config_set_translation_user (const xine_config_entry_translation_t *) XINE_PROTECTED;
+
+/*
+ * load/save config data from/to afile (e.g. $HOME/.xine/config)
+ */
+void xine_config_load (xine_t *self, const char *cfg_filename) XINE_PROTECTED;
+void xine_config_save (xine_t *self, const char *cfg_filename) XINE_PROTECTED;
+void xine_config_reset (xine_t *self) XINE_PROTECTED;
+
+
+/*********************************************************************
+ * asynchroneous xine event mechanism *
+ *********************************************************************/
+
+/*
+ * to receive events you have to register an event queue with
+ * the xine engine (xine_event_new_queue, see below).
+ *
+ * then you can either
+ * 1) check for incoming events regularly (xine_event_get/wait),
+ * process them and free them using xine_event_free
+ * 2) use xine_event_create_listener_thread and specify a callback
+ * which will then be called for each event
+ *
+ * to send events to every module listening you don't need
+ * to register an event queue but simply call xine_event_send.
+ *
+ * front ends should listen for one of MRL_REFERENCE and MRL_REFERENCE_EXT
+ * since both will be sent for compatibility reasons
+ */
+
+/* event types */
+#define XINE_EVENT_UI_PLAYBACK_FINISHED 1 /* frontend can e.g. move on to next playlist entry */
+#define XINE_EVENT_UI_CHANNELS_CHANGED 2 /* inform ui that new channel info is available */
+#define XINE_EVENT_UI_SET_TITLE 3 /* request title display change in ui */
+#define XINE_EVENT_UI_MESSAGE 4 /* message (dialog) for the ui to display */
+#define XINE_EVENT_FRAME_FORMAT_CHANGE 5 /* e.g. aspect ratio change during dvd playback */
+#define XINE_EVENT_AUDIO_LEVEL 6 /* report current audio level (l/r/mute) */
+#define XINE_EVENT_QUIT 7 /* last event sent when stream is disposed */
+#define XINE_EVENT_PROGRESS 8 /* index creation/network connections */
+#define XINE_EVENT_MRL_REFERENCE 9 /* (deprecated) demuxer->frontend: MRL reference(s) for the real stream */
+#define XINE_EVENT_UI_NUM_BUTTONS 10 /* number of buttons for interactive menus */
+#define XINE_EVENT_SPU_BUTTON 11 /* the mouse pointer enter/leave a button */
+#define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */
+#define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */
+#define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */
+#define XINE_EVENT_NBC_STATS 15 /* nbc buffer status */
+
+
+/* input events coming from frontend */
+#define XINE_EVENT_INPUT_MOUSE_BUTTON 101
+#define XINE_EVENT_INPUT_MOUSE_MOVE 102
+#define XINE_EVENT_INPUT_MENU1 103
+#define XINE_EVENT_INPUT_MENU2 104
+#define XINE_EVENT_INPUT_MENU3 105
+#define XINE_EVENT_INPUT_MENU4 106
+#define XINE_EVENT_INPUT_MENU5 107
+#define XINE_EVENT_INPUT_MENU6 108
+#define XINE_EVENT_INPUT_MENU7 109
+#define XINE_EVENT_INPUT_UP 110
+#define XINE_EVENT_INPUT_DOWN 111
+#define XINE_EVENT_INPUT_LEFT 112
+#define XINE_EVENT_INPUT_RIGHT 113
+#define XINE_EVENT_INPUT_SELECT 114
+#define XINE_EVENT_INPUT_NEXT 115
+#define XINE_EVENT_INPUT_PREVIOUS 116
+#define XINE_EVENT_INPUT_ANGLE_NEXT 117
+#define XINE_EVENT_INPUT_ANGLE_PREVIOUS 118
+#define XINE_EVENT_INPUT_BUTTON_FORCE 119
+#define XINE_EVENT_INPUT_NUMBER_0 120
+#define XINE_EVENT_INPUT_NUMBER_1 121
+#define XINE_EVENT_INPUT_NUMBER_2 122
+#define XINE_EVENT_INPUT_NUMBER_3 123
+#define XINE_EVENT_INPUT_NUMBER_4 124
+#define XINE_EVENT_INPUT_NUMBER_5 125
+#define XINE_EVENT_INPUT_NUMBER_6 126
+#define XINE_EVENT_INPUT_NUMBER_7 127
+#define XINE_EVENT_INPUT_NUMBER_8 128
+#define XINE_EVENT_INPUT_NUMBER_9 129
+#define XINE_EVENT_INPUT_NUMBER_10_ADD 130
+
+/* specific event types */
+#define XINE_EVENT_SET_V4L2 200
+#define XINE_EVENT_PVR_SAVE 201
+#define XINE_EVENT_PVR_REPORT_NAME 202
+#define XINE_EVENT_PVR_REALTIME 203
+#define XINE_EVENT_PVR_PAUSE 204
+#define XINE_EVENT_SET_MPEG_DATA 205
+
+/* VDR specific event types */
+#define XINE_EVENT_VDR_RED 300
+#define XINE_EVENT_VDR_GREEN 301
+#define XINE_EVENT_VDR_YELLOW 302
+#define XINE_EVENT_VDR_BLUE 303
+#define XINE_EVENT_VDR_PLAY 304
+#define XINE_EVENT_VDR_PAUSE 305
+#define XINE_EVENT_VDR_STOP 306
+#define XINE_EVENT_VDR_RECORD 307
+#define XINE_EVENT_VDR_FASTFWD 308
+#define XINE_EVENT_VDR_FASTREW 309
+#define XINE_EVENT_VDR_POWER 310
+#define XINE_EVENT_VDR_CHANNELPLUS 311
+#define XINE_EVENT_VDR_CHANNELMINUS 312
+#define XINE_EVENT_VDR_SCHEDULE 313
+#define XINE_EVENT_VDR_CHANNELS 314
+#define XINE_EVENT_VDR_TIMERS 315
+#define XINE_EVENT_VDR_RECORDINGS 316
+#define XINE_EVENT_VDR_SETUP 317
+#define XINE_EVENT_VDR_COMMANDS 318
+#define XINE_EVENT_VDR_BACK 319
+#define XINE_EVENT_VDR_USER1 320
+#define XINE_EVENT_VDR_USER2 321
+#define XINE_EVENT_VDR_USER3 322
+#define XINE_EVENT_VDR_USER4 323
+#define XINE_EVENT_VDR_USER5 324
+#define XINE_EVENT_VDR_USER6 325
+#define XINE_EVENT_VDR_USER7 326
+#define XINE_EVENT_VDR_USER8 327
+#define XINE_EVENT_VDR_USER9 328
+#define XINE_EVENT_VDR_VOLPLUS 329
+#define XINE_EVENT_VDR_VOLMINUS 330
+#define XINE_EVENT_VDR_MUTE 331
+#define XINE_EVENT_VDR_AUDIO 332
+#define XINE_EVENT_VDR_INFO 333
+#define XINE_EVENT_VDR_CHANNELPREVIOUS 334
+#define XINE_EVENT_VDR_SUBTITLES 335
+#define XINE_EVENT_VDR_USER0 336
+/* some space for further keys */
+#define XINE_EVENT_VDR_SETVIDEOWINDOW 350
+#define XINE_EVENT_VDR_FRAMESIZECHANGED 351
+#define XINE_EVENT_VDR_SELECTAUDIO 352
+#define XINE_EVENT_VDR_TRICKSPEEDMODE 353
+#define XINE_EVENT_VDR_PLUGINSTARTED 354
+#define XINE_EVENT_VDR_DISCONTINUITY 355
+
+/* events generated from post plugins */
+#define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400
+
+/*
+ * xine event struct
+ */
+typedef struct {
+ xine_stream_t *stream; /* stream this event belongs to */
+
+ void *data; /* contents depending on type */
+ int data_length;
+
+ int type; /* event type (constants see above) */
+
+ /* you do not have to provide this, it will be filled in by xine_event_send() */
+ struct timeval tv; /* timestamp of event creation */
+} xine_event_t;
+
+/*
+ * input event dynamic data
+ */
+typedef struct {
+ xine_event_t event;
+ uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */
+ uint16_t x,y; /* In Image space */
+} xine_input_data_t;
+
+/*
+ * UI event dynamic data - send information to/from UI.
+ */
+typedef struct {
+ int num_buttons;
+ int str_len;
+ char str[256]; /* might be longer */
+} xine_ui_data_t;
+
+/*
+ * Send messages to UI. used mostly to report errors.
+ */
+typedef struct {
+ /*
+ * old xine-ui versions expect xine_ui_data_t type.
+ * this struct is added for compatibility.
+ */
+ xine_ui_data_t compatibility;
+
+ /* See XINE_MSG_xxx for defined types. */
+ int type;
+
+ /* defined types are provided with a standard explanation.
+ * note: zero means no explanation.
+ */
+ int explanation; /* add to struct address to get a valid (char *) */
+
+ /* parameters are zero terminated strings */
+ int num_parameters;
+ int parameters; /* add to struct address to get a valid (char *) */
+
+ /* where messages are stored, will be longer
+ *
+ * this field begins with the message text itself (\0-terminated),
+ * followed by (optional) \0-terminated parameter strings
+ * the end marker is \0 \0
+ */
+ char messages[1];
+} xine_ui_message_data_t;
+
+
+/*
+ * notify frame format change
+ */
+typedef struct {
+ int width;
+ int height;
+ /* these are aspect codes as defined in MPEG2, because this
+ * is only used for DVD playback, pan_scan is a boolean flag */
+ int aspect;
+ int pan_scan;
+} xine_format_change_data_t;
+
+/*
+ * audio level for left/right channel
+ */
+typedef struct {
+ int left;
+ int right; /* 0..100 % */
+ int mute;
+} xine_audio_level_data_t;
+
+/*
+ * index generation / buffering
+ */
+typedef struct {
+ const char *description; /* e.g. "connecting..." */
+ int percent;
+} xine_progress_data_t;
+
+/*
+ * nbc buffer status
+ */
+typedef struct {
+ int v_percent; /* fill of video buffer */
+ int64_t v_remaining; /* remaining time in ms till underrun */
+ int64_t v_bitrate; /* current bitrate */
+ int v_in_disc; /* in discontinuity */
+ int a_percent; /* like video, but for audio */
+ int64_t a_remaining;
+ int64_t a_bitrate;
+ int a_in_disc;
+ int buffering; /* currently filling buffer */
+ int enabled; /* buffer disabled by engine */
+ int type; /* 0=buffer put, 1=buffer get */
+} xine_nbc_stats_data_t;
+
+/*
+ * mrl reference data is sent by demuxers when a reference stream is found.
+ * this stream just contains pointers (urls) to the real data, which are
+ * passed to frontend using this event type. (examples: .asx, .mov and .ram)
+ *
+ * ideally, frontends should add these mrls to a "hierarchical playlist".
+ * that is, instead of the original file, the ones provided here should be
+ * played instead. on pratice, just using a simple playlist should work.
+ *
+ * mrl references should be played in the same order they are received, just
+ * after the current stream finishes.
+ * alternative entries may be provided and should be used in case of
+ * failure of the primary stream (the one with alternative=0).
+ *
+ * sample playlist:
+ * 1) http://something/something.ram
+ * 1a) rtsp://something/realsomething1.rm (alternative=0)
+ * 1b) pnm://something/realsomething1.rm (alternative=1)
+ * 2) http://another/another.avi
+ *
+ * 1 and 2 are the original items on this playlist. 1a and 1b were received
+ * by events (they are the mrl references enclosed in 1). 1a is played after
+ * receiving the finished event from 1. note: 1b is usually ignored, it should
+ * only be used in case 1a fails to open.
+ *
+ * An event listener which accepts XINE_EVENT_MRL_REFERENCE_EXT events
+ * *must* ignore XINE_EVENT_MRL_REFERENCE events.
+ */
+typedef struct {
+ int alternative; /* alternative playlist number, usually 0 */
+ char mrl[1]; /* might (will) be longer */
+} xine_mrl_reference_data_t XINE_DEPRECATED;
+
+typedef struct {
+ int alternative; /* as above */
+ uint32_t start_time, duration; /* milliseconds */
+ uint32_t spare[20]; /* for future expansion */
+ const char mrl[1]; /* might (will) be longer */
+/*const char title[]; ** immediately follows MRL's terminating NUL */
+} xine_mrl_reference_data_ext_t;
+
+/*
+ * configuration options for video4linux-like input plugins
+ */
+typedef struct {
+ /* input selection */
+ int input; /* select active input from card */
+ int channel; /* channel number */
+ int radio; /* ask for a radio channel */
+ uint32_t frequency; /* frequency divided by 62.5KHz or 62.5 Hz */
+ uint32_t transmission; /* The transmission standard. */
+
+ /* video parameters */
+ uint32_t framerate_numerator; /* framerate as numerator/denominator */
+ uint32_t framerate_denominator;
+ uint32_t framelines; /* Total lines per frame including blanking */
+ uint64_t standard_id; /* One of the V4L2_STD_* values */
+ uint32_t colorstandard; /* One of the V4L2_COLOR_STD_* values */
+ uint32_t colorsubcarrier; /* The color subcarrier frequency */
+ int frame_width; /* scaled frame width */
+ int frame_height; /* scaled frame height */
+
+ /* let some spare space so we can add new fields without breaking
+ * binary api compatibility.
+ */
+ uint32_t spare[20];
+
+ /* used by pvr plugin */
+ int32_t session_id; /* -1 stops pvr recording */
+
+} xine_set_v4l2_data_t;
+
+/*
+ * configuration options for plugins that can do a kind of mpeg encoding
+ * note: highly experimental api :)
+ */
+typedef struct {
+
+ /* mpeg2 parameters */
+ int bitrate_vbr; /* 1 = vbr, 0 = cbr */
+ int bitrate_mean; /* mean (target) bitrate in kbps*/
+ int bitrate_peak; /* peak (max) bitrate in kbps */
+ int gop_size; /* GOP size in frames */
+ int gop_closure; /* open/closed GOP */
+ int b_frames; /* number of B frames to use */
+ int aspect_ratio; /* XINE_VO_ASPECT_xxx */
+
+ /* let some spare space so we can add new fields without breaking
+ * binary api compatibility.
+ */
+ uint32_t spare[20];
+
+} xine_set_mpeg_data_t;
+
+typedef struct {
+ int direction; /* 0 leave, 1 enter */
+ int32_t button; /* button number */
+} xine_spu_button_t;
+
+#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES
+
+/*
+ * ask pvr to save (ie. do not discard) the current session
+ * see comments on input_pvr.c to understand how it works.
+ */
+typedef struct {
+ /* mode values:
+ * -1 = do nothing, just set the name
+ * 0 = truncate current session and save from now on
+ * 1 = save from last sync point
+ * 2 = save everything on current session
+ */
+ int mode;
+ int id;
+ char name[256]; /* name for saving, might be longer */
+} xine_pvr_save_data_t;
+
+typedef struct {
+ /* mode values:
+ * 0 = non realtime
+ * 1 = realtime
+ */
+ int mode;
+} xine_pvr_realtime_t;
+
+typedef struct {
+ /* mode values:
+ * 0 = playing
+ * 1 = paused
+ */
+ int mode;
+} xine_pvr_pause_t;
+
+#endif
+
+/* event XINE_EVENT_DROPPED_FRAMES is generated if libxine detects a
+ * high number of dropped frames (above configured thresholds). it can
+ * be used by the front end to warn about performance problems.
+ */
+typedef struct {
+ /* these values are given for 1000 frames delivered */
+ /* (that is, divide by 10 to get percentages) */
+ int skipped_frames;
+ int skipped_threshold;
+ int discarded_frames;
+ int discarded_threshold;
+} xine_dropped_frames_t;
+
+
+/*
+ * Defined message types for XINE_EVENT_UI_MESSAGE
+ * This is the mechanism to report async errors from engine.
+ *
+ * If frontend knows about the XINE_MSG_xxx type it may safely
+ * ignore the 'explanation' field and provide its own custom
+ * dialogue to the 'parameters'.
+ *
+ * right column specifies the usual parameters.
+ */
+
+#define XINE_MSG_NO_ERROR 0 /* (messages to UI) */
+#define XINE_MSG_GENERAL_WARNING 1 /* (warning message) */
+#define XINE_MSG_UNKNOWN_HOST 2 /* (host name) */
+#define XINE_MSG_UNKNOWN_DEVICE 3 /* (device name) */
+#define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */
+#define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */
+#define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */
+#define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */
+#define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */
+#define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */
+#define XINE_MSG_SECURITY 10 /* (security message) */
+#define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */
+#define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */
+#define XINE_MSG_FILE_EMPTY 13 /* file is empty */
+#define XINE_MSG_AUTHENTICATION_NEEDED 14 /* (mrl, likely http) */
+
+/* opaque xine_event_queue_t */
+typedef struct xine_event_queue_s xine_event_queue_t;
+
+/*
+ * register a new event queue
+ *
+ * you have to receive messages from this queue regularly
+ *
+ * use xine_event_dispose_queue to unregister and free the queue
+ */
+xine_event_queue_t *xine_event_new_queue (xine_stream_t *stream) XINE_PROTECTED;
+void xine_event_dispose_queue (xine_event_queue_t *queue) XINE_PROTECTED;
+
+/*
+ * receive events (poll)
+ *
+ * use xine_event_free on the events received from these calls
+ * when they're no longer needed
+ */
+xine_event_t *xine_event_get (xine_event_queue_t *queue) XINE_PROTECTED;
+xine_event_t *xine_event_wait (xine_event_queue_t *queue) XINE_PROTECTED;
+void xine_event_free (xine_event_t *event) XINE_PROTECTED;
+
+/*
+ * receive events (callback)
+ *
+ * a thread is created which will receive all events from
+ * the specified queue, call your callback on each of them
+ * and will then free the event when your callback returns
+ *
+ */
+typedef void (*xine_event_listener_cb_t) (void *user_data,
+ const xine_event_t *event);
+void xine_event_create_listener_thread (xine_event_queue_t *queue,
+ xine_event_listener_cb_t callback,
+ void *user_data) XINE_PROTECTED;
+
+/*
+ * send an event to all queues
+ *
+ * the event will be copied so you can free or reuse
+ * *event as soon as xine_event_send returns.
+ */
+void xine_event_send (xine_stream_t *stream, const xine_event_t *event) XINE_PROTECTED;
+
+
+/*********************************************************************
+ * OSD (on screen display) *
+ *********************************************************************/
+
+#define XINE_TEXT_PALETTE_SIZE 11
+
+#define XINE_OSD_TEXT1 (0 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT2 (1 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT3 (2 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT4 (3 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT5 (4 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT6 (5 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT7 (6 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT8 (7 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT9 (8 * XINE_TEXT_PALETTE_SIZE)
+#define XINE_OSD_TEXT10 (9 * XINE_TEXT_PALETTE_SIZE)
+
+/* white text, black border, transparent background */
+#define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0
+/* white text, noborder, transparent background */
+#define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1
+/* white text, no border, translucid background */
+#define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2
+/* yellow text, black border, transparent background */
+#define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3
+
+#define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in */
+#define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo drv */
+#define XINE_OSD_CAP_CUSTOM_EXTENT 0x0004 /* hardware scaled to match video output window */
+#define XINE_OSD_CAP_ARGB_LAYER 0x0008 /* supports ARGB true color pixmaps */
+#define XINE_OSD_CAP_VIDEO_WINDOW 0x0010 /* can scale video to an area within osd extent */
+
+typedef struct xine_osd_s xine_osd_t;
+
+xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y,
+ int width, int height) XINE_PROTECTED;
+uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED;
+void xine_osd_draw_point (xine_osd_t *self, int x, int y, int color) XINE_PROTECTED;
+
+void xine_osd_draw_line (xine_osd_t *self, int x1, int y1,
+ int x2, int y2, int color) XINE_PROTECTED;
+void xine_osd_draw_rect (xine_osd_t *self, int x1, int y1,
+ int x2, int y2,
+ int color, int filled ) XINE_PROTECTED;
+/* x1 and y1 specifies the upper left corner of the text to be rendered */
+void xine_osd_draw_text (xine_osd_t *self, int x1, int y1,
+ const char *text, int color_base) XINE_PROTECTED;
+void xine_osd_draw_bitmap (xine_osd_t *self, uint8_t *bitmap,
+ int x1, int y1, int width, int height,
+ uint8_t *palette_map) XINE_PROTECTED;
+/* for freetype2 fonts the height is the maximum height for the whole font and not
+ * only for the specified text */
+void xine_osd_get_text_size (xine_osd_t *self, const char *text,
+ int *width, int *height) XINE_PROTECTED;
+/* with freetype2 support compiled in, you can also specify a font file
+ as 'fontname' here */
+int xine_osd_set_font (xine_osd_t *self, const char *fontname,
+ int size) XINE_PROTECTED;
+/*
+ * specifying encoding of texts
+ * "" ... means current locale encoding (default)
+ * NULL ... means latin1
+ */
+void xine_osd_set_encoding(xine_osd_t *self, const char *encoding) XINE_PROTECTED;
+/* set position were overlay will be blended */
+void xine_osd_set_position (xine_osd_t *self, int x, int y) XINE_PROTECTED;
+void xine_osd_show (xine_osd_t *self, int64_t vpts) XINE_PROTECTED;
+void xine_osd_show_unscaled (xine_osd_t *self, int64_t vpts) XINE_PROTECTED;
+void xine_osd_hide (xine_osd_t *self, int64_t vpts) XINE_PROTECTED;
+/* empty drawing area */
+void xine_osd_clear (xine_osd_t *self) XINE_PROTECTED;
+/*
+ * set on existing text palette
+ * (-1 to set used specified palette)
+ *
+ * color_base specifies the first color index to use for this text
+ * palette. The OSD palette is then modified starting at this
+ * color index, up to the size of the text palette.
+ *
+ * Use OSD_TEXT1, OSD_TEXT2, ... for some preassigned color indices.
+ *
+ * These palettes are not working well with the true type fonts.
+ * First thing is that these fonts cannot have a border. So you get
+ * the best results by loading a linearly blending palette from the
+ * background (at index 0) to the forground color (at index 10).
+ */
+void xine_osd_set_text_palette (xine_osd_t *self,
+ int palette_number,
+ int color_base ) XINE_PROTECTED;
+/* get palette (color and transparency) */
+void xine_osd_get_palette (xine_osd_t *self, uint32_t *color,
+ uint8_t *trans) XINE_PROTECTED;
+void xine_osd_set_palette (xine_osd_t *self,
+ const uint32_t *const color,
+ const uint8_t *const trans ) XINE_PROTECTED;
+
+/*
+ * Set an ARGB buffer to be blended into video.
+ * The buffer must stay valid while the OSD is on screen.
+ * Pass a NULL pointer to safely remove the buffer from
+ * the OSD layer. Only the dirty area will be
+ * updated on screen. For convenience the whole
+ * OSD object will be considered dirty when setting
+ * a different buffer pointer.
+ * see also XINE_OSD_CAP_ARGB_LAYER
+ */
+void xine_osd_set_argb_buffer(xine_osd_t *self, uint32_t *argb_buffer,
+ int dirty_x, int dirty_y, int dirty_width, int dirty_height) XINE_PROTECTED;
+
+/*
+ * define extent of reference coordinate system
+ * for video resolution independent osds.
+ * see also XINE_OSD_CAP_CUSTOM_EXTENT
+ */
+void xine_osd_set_extent(xine_osd_t *self, int extent_width, int extent_height) XINE_PROTECTED;
+
+/*
+ * define area within osd extent to output
+ * video to while osd is on screen
+ * see also XINE_OSD_CAP_VIDEO_WINDOW
+ */
+void xine_osd_set_video_window(xine_osd_t *self, int window_x, int window_y, int window_width, int window_height) XINE_PROTECTED;
+
+/*
+ * close osd rendering engine
+ * loaded fonts are unloaded
+ * osd objects are closed
+ */
+void xine_osd_free (xine_osd_t *self) XINE_PROTECTED;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/xine.h.in b/include/xine.h.in
deleted file mode 100644
index 422029754..000000000
--- a/include/xine.h.in
+++ /dev/null
@@ -1,2300 +0,0 @@
-/*
- * Copyright (C) 2000-2006 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, USA
- *
- * public xine-lib (libxine) interface and documentation
- *
- *
- * some programming guidelines about this api:
- * -------------------------------------------
- *
- * (1) libxine has (per stream instance) a fairly static memory
- * model
- * (2) as a rule of thumb, never free() or realloc() any pointers
- * returned by the xine engine (unless stated otherwise)
- * or, in other words:
- * do not free() stuff you have not malloc()ed
- * (3) xine is multi-threaded, make sure your programming environment
- * can handle this.
- * for x11-related stuff this means that you either have to properly
- * use xlockdisplay() or use two seperate connections to the x-server
- *
- */
-/*_x_ Lines formatted like this one are xine-lib developer comments. */
-/*_x_ They will be removed from the installed version of this header. */
-
-#ifndef HAVE_XINE_H
-#define HAVE_XINE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-#include <stdarg.h>
-
-#ifdef WIN32
-#include <windows.h>
-#include <windowsx.h>
-#endif
-
-#ifdef XINE_COMPILE
-#include <inttypes.h>
-#include "attributes.h"
-#else
-#include <xine/os_types.h>
-#include <xine/attributes.h>
-#endif
-
-/* This enables some experimental features. These are not part of the
- * official libxine API, so use them only, if you absolutely need them.
- * Although we make efforts to keep even this part of the API as stable
- * as possible, this is not guaranteed. Incompatible changes can occur.
- */
-/* #define XINE_ENABLE_EXPERIMENTAL_FEATURES */
-
-/* This disables some deprecated features. These are still part of the
- * official libxine API and you may still use them. During the current
- * major release series, these will always be available and will stay
- * compatible. However, removal is likely to occur as soon as possible.
- */
-/* #define XINE_DISABLE_DEPRECATED_FEATURES */
-
-
-/*********************************************************************
- * xine opaque data types *
- *********************************************************************/
-
-typedef struct xine_s xine_t;
-typedef struct xine_stream_s xine_stream_t;
-typedef struct xine_audio_port_s xine_audio_port_t;
-typedef struct xine_video_port_s xine_video_port_t;
-
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
-/* convenience types: simple player UIs might want to call ports drivers */
-typedef xine_audio_port_t xine_ao_driver_t XINE_DEPRECATED;
-typedef xine_video_port_t xine_vo_driver_t XINE_DEPRECATED;
-#endif
-
-
-/*********************************************************************
- * global engine handling *
- *********************************************************************/
-
-/*
- * version information
- */
-
-/* dynamic info from actually linked libxine */
-const char *xine_get_version_string (void) XINE_PROTECTED;
-void xine_get_version (int *major, int *minor, int *sub) XINE_PROTECTED;
-
-/* compare given version to libxine version,
- return 1 if compatible, 0 otherwise */
-int xine_check_version (int major, int minor, int sub) XINE_PROTECTED;
-
-/* static info - which libxine release this header came from */
-#define XINE_MAJOR_VERSION @XINE_MAJOR@
-#define XINE_MINOR_VERSION @XINE_MINOR@
-#define XINE_SUB_VERSION @XINE_SUB@
-#define XINE_VERSION "@VERSION@"
-
-/*
- * pre-init the xine engine
- *
- * will first malloc and init a xine_t, create an empty config
- * system, then scan through all installed plugins and add them
- * to an internal list for later use.
- *
- * to fully init the xine engine, you have to load config values
- * (either using your own storage method and calling
- * xine_config_register_entry, or by using the xine_load_config
- * utility function - see below) and then call xine_init
- *
- * the only proper way to shut down the xine engine is to
- * call xine_exit() - do not try to free() the xine pointer
- * yourself and do not try to access any internal data structures
- */
-xine_t *xine_new (void) XINE_PROTECTED;
-
-/* allow the setting of some flags before xine_init
- * FIXME-ABI: this is currently GLOBAL
- */
-void xine_set_flags (xine_t *, int) XINE_PROTECTED __attribute__((weak));
-#define XINE_FLAG_NO_WRITE_CACHE 1
-
-/*
- * post_init the xine engine
- */
-void xine_init (xine_t *self) XINE_PROTECTED;
-
-/*
- * helper functions to find and init audio/video drivers
- * from xine's plugin collection
- *
- * id : identifier of the driver, may be NULL for auto-detection
- * data : special data struct for ui/driver communications, depends
- * on driver
- * visual: video driver flavor selector, constants see below
- *
- * both functions may return NULL if driver failed to load, was not
- * found ...
- *
- * use xine_close_audio/video_driver() to close loaded drivers
- * and free resources allocated by them
- */
-xine_audio_port_t *xine_open_audio_driver (xine_t *self, const char *id,
- void *data) XINE_PROTECTED;
-xine_video_port_t *xine_open_video_driver (xine_t *self, const char *id,
- int visual, void *data) XINE_PROTECTED;
-
-void xine_close_audio_driver (xine_t *self, xine_audio_port_t *driver) XINE_PROTECTED;
-void xine_close_video_driver (xine_t *self, xine_video_port_t *driver) XINE_PROTECTED;
-
-/* valid visual types */
-#define XINE_VISUAL_TYPE_NONE 0
-#define XINE_VISUAL_TYPE_X11 1
-#define XINE_VISUAL_TYPE_X11_2 10
-#define XINE_VISUAL_TYPE_AA 2
-#define XINE_VISUAL_TYPE_FB 3
-#define XINE_VISUAL_TYPE_GTK 4
-#define XINE_VISUAL_TYPE_DFB 5
-#define XINE_VISUAL_TYPE_PM 6 /* used by the OS/2 port */
-#define XINE_VISUAL_TYPE_DIRECTX 7 /* used by the win32/msvc port */
-#define XINE_VISUAL_TYPE_CACA 8
-#define XINE_VISUAL_TYPE_MACOSX 9
-#define XINE_VISUAL_TYPE_XCB 11
-#define XINE_VISUAL_TYPE_RAW 12
-
-/*
- * free all resources, close all plugins, close engine.
- * self pointer is no longer valid after this call.
- */
-void xine_exit (xine_t *self) XINE_PROTECTED;
-
-
-/*********************************************************************
- * stream handling *
- *********************************************************************/
-
-/*
- * create a new stream for media playback/access
- *
- * returns xine_stream_t* if OK,
- * NULL on error (use xine_get_error for details)
- *
- * the only proper way to free the stream pointer returned by this
- * function is to call xine_dispose() on it. do not try to access any
- * fields in xine_stream_t, they're all private and subject to change
- * without further notice.
- */
-xine_stream_t *xine_stream_new (xine_t *self,
- xine_audio_port_t *ao, xine_video_port_t *vo) XINE_PROTECTED;
-
-/*
- * Make one stream the slave of another.
- * This establishes a binary master slave relation on streams, where
- * certain operations (specified by parameter "affection") on the master
- * stream are also applied to the slave stream.
- * If you want more than one stream to react to one master, you have to
- * apply the calls in a top down way:
- * xine_stream_master_slave(stream1, stream2, 3);
- * xine_stream_master_slave(stream2, stream3, 3);
- * This will make stream1 affect stream2 and stream2 affect stream3, so
- * effectively, operations on stream1 propagate to stream2 and 3.
- *
- * Please note that subsequent master_slave calls on the same streams
- * will overwrite their previous master/slave setting.
- * Be sure to not mess around.
- *
- * returns 1 on success, 0 on failure
- */
-int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,
- int affection) XINE_PROTECTED;
-
-/* affection is some of the following ORed together: */
-/* playing the master plays the slave */
-#define XINE_MASTER_SLAVE_PLAY (1<<0)
-/* slave stops on master stop */
-#define XINE_MASTER_SLAVE_STOP (1<<1)
-/* slave is synced to master's speed */
-#define XINE_MASTER_SLAVE_SPEED (1<<2)
-
-/*
- * open a stream
- *
- * look for input / demux / decoder plugins, find out about the format
- * see if it is supported, set up internal buffers and threads
- *
- * returns 1 if OK, 0 on error (use xine_get_error for details)
- */
-int xine_open (xine_stream_t *stream, const char *mrl) XINE_PROTECTED;
-
-/*
- * play a stream from a given position
- *
- * start_pos: 0..65535
- * start_time: milliseconds
- * if both start position parameters are != 0 start_pos will be used
- * for non-seekable streams both values will be ignored
- *
- * returns 1 if OK, 0 on error (use xine_get_error for details)
- */
-int xine_play (xine_stream_t *stream, int start_pos, int start_time) XINE_PROTECTED;
-
-/*
- * set xine to a trick mode for fast forward, backwards playback,
- * low latency seeking. Please note that this works only with some
- * input plugins. mode constants see below.
- *
- * returns 1 if OK, 0 on error (use xine_get_error for details)
- */
-int xine_trick_mode (xine_stream_t *stream, int mode, int value) XINE_PROTECTED XINE_DEPRECATED;
-
-/* trick modes */
-#define XINE_TRICK_MODE_OFF 0
-#define XINE_TRICK_MODE_SEEK_TO_POSITION 1
-#define XINE_TRICK_MODE_SEEK_TO_TIME 2
-#define XINE_TRICK_MODE_FAST_FORWARD 3
-#define XINE_TRICK_MODE_FAST_REWIND 4
-
-/*
- * stop stream playback
- * xine_stream_t stays valid for new xine_open or xine_play
- */
-void xine_stop (xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * stop stream playback, free all stream-related resources
- * xine_stream_t stays valid for new xine_open
- */
-void xine_close (xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * ask current/recent input plugin to eject media - may or may not work,
- * depending on input plugin capabilities
- */
-int xine_eject (xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * stop playback, dispose all stream-related resources
- * xine_stream_t no longer valid when after this
- */
-void xine_dispose (xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * set/get engine parameters.
- */
-void xine_engine_set_param(xine_t *self, int param, int value) XINE_PROTECTED;
-int xine_engine_get_param(xine_t *self, int param) XINE_PROTECTED;
-
-#define XINE_ENGINE_PARAM_VERBOSITY 1
-
-/*
- * set/get xine stream parameters
- * e.g. playback speed, constants see below
- */
-void xine_set_param (xine_stream_t *stream, int param, int value) XINE_PROTECTED;
-int xine_get_param (xine_stream_t *stream, int param) XINE_PROTECTED;
-
-/*
- * xine stream parameters
- */
-#define XINE_PARAM_SPEED 1 /* see below */
-#define XINE_PARAM_AV_OFFSET 2 /* unit: 1/90000 sec */
-#define XINE_PARAM_AUDIO_CHANNEL_LOGICAL 3 /* -1 => auto, -2 => off */
-#define XINE_PARAM_SPU_CHANNEL 4
-#define XINE_PARAM_VIDEO_CHANNEL 5
-#define XINE_PARAM_AUDIO_VOLUME 6 /* 0..100 */
-#define XINE_PARAM_AUDIO_MUTE 7 /* 1=>mute, 0=>unmute */
-#define XINE_PARAM_AUDIO_COMPR_LEVEL 8 /* <100=>off, % compress otherw*/
-#define XINE_PARAM_AUDIO_AMP_LEVEL 9 /* 0..200, 100=>100% (default) */
-#define XINE_PARAM_AUDIO_REPORT_LEVEL 10 /* 1=>send events, 0=> don't */
-#define XINE_PARAM_VERBOSITY 11 /* control console output */
-#define XINE_PARAM_SPU_OFFSET 12 /* unit: 1/90000 sec */
-#define XINE_PARAM_IGNORE_VIDEO 13 /* disable video decoding */
-#define XINE_PARAM_IGNORE_AUDIO 14 /* disable audio decoding */
-#define XINE_PARAM_IGNORE_SPU 15 /* disable spu decoding */
-#define XINE_PARAM_BROADCASTER_PORT 16 /* 0: disable, x: server port */
-#define XINE_PARAM_METRONOM_PREBUFFER 17 /* unit: 1/90000 sec */
-#define XINE_PARAM_EQ_30HZ 18 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_60HZ 19 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_125HZ 20 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_250HZ 21 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_500HZ 22 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_1000HZ 23 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_2000HZ 24 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_4000HZ 25 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_8000HZ 26 /* equalizer gains -100..100 */
-#define XINE_PARAM_EQ_16000HZ 27 /* equalizer gains -100..100 */
-#define XINE_PARAM_AUDIO_CLOSE_DEVICE 28 /* force closing audio device */
-#define XINE_PARAM_AUDIO_AMP_MUTE 29 /* 1=>mute, 0=>unmute */
-#define XINE_PARAM_FINE_SPEED 30 /* 1.000.000 => normal speed */
-#define XINE_PARAM_EARLY_FINISHED_EVENT 31 /* send event when demux finish*/
-#define XINE_PARAM_GAPLESS_SWITCH 32 /* next stream only gapless swi*/
-#define XINE_PARAM_DELAY_FINISHED_EVENT 33 /* 1/10sec,0=>disable,-1=>forev*/
-
-/*
- * speed values for XINE_PARAM_SPEED parameter.
- *
- * alternatively, one may use XINE_PARAM_FINE_SPEED for greater
- * control of the speed value, where:
- * XINE_PARAM_SPEED / 4 <-> XINE_PARAM_FINE_SPEED / 1000000
- */
-#define XINE_SPEED_PAUSE 0
-#define XINE_SPEED_SLOW_4 1
-#define XINE_SPEED_SLOW_2 2
-#define XINE_SPEED_NORMAL 4
-#define XINE_SPEED_FAST_2 8
-#define XINE_SPEED_FAST_4 16
-
-/* normal speed value for XINE_PARAM_FINE_SPEED parameter */
-#define XINE_FINE_SPEED_NORMAL 1000000
-
-/* video parameters */
-#define XINE_PARAM_VO_DEINTERLACE 0x01000000 /* bool */
-#define XINE_PARAM_VO_ASPECT_RATIO 0x01000001 /* see below */
-#define XINE_PARAM_VO_HUE 0x01000002 /* 0..65535 */
-#define XINE_PARAM_VO_SATURATION 0x01000003 /* 0..65535 */
-#define XINE_PARAM_VO_CONTRAST 0x01000004 /* 0..65535 */
-#define XINE_PARAM_VO_BRIGHTNESS 0x01000005 /* 0..65535 */
-#define XINE_PARAM_VO_GAMMA 0x0100000c /* 0..65535 */
-#define XINE_PARAM_VO_ZOOM_X 0x01000008 /* percent */
-#define XINE_PARAM_VO_ZOOM_Y 0x0100000d /* percent */
-#define XINE_PARAM_VO_PAN_SCAN 0x01000009 /* bool */
-#define XINE_PARAM_VO_TVMODE 0x0100000a /* ??? */
-#define XINE_PARAM_VO_WINDOW_WIDTH 0x0100000f /* readonly */
-#define XINE_PARAM_VO_WINDOW_HEIGHT 0x01000010 /* readonly */
-#define XINE_PARAM_VO_CROP_LEFT 0x01000020 /* crop frame pixels */
-#define XINE_PARAM_VO_CROP_RIGHT 0x01000021 /* crop frame pixels */
-#define XINE_PARAM_VO_CROP_TOP 0x01000022 /* crop frame pixels */
-#define XINE_PARAM_VO_CROP_BOTTOM 0x01000023 /* crop frame pixels */
-
-
-#define XINE_VO_ZOOM_STEP 100
-#define XINE_VO_ZOOM_MAX 400
-#define XINE_VO_ZOOM_MIN -85
-
-/* possible ratios for XINE_PARAM_VO_ASPECT_RATIO */
-#define XINE_VO_ASPECT_AUTO 0
-#define XINE_VO_ASPECT_SQUARE 1 /* 1:1 */
-#define XINE_VO_ASPECT_4_3 2 /* 4:3 */
-#define XINE_VO_ASPECT_ANAMORPHIC 3 /* 16:9 */
-#define XINE_VO_ASPECT_DVB 4 /* 2.11:1 */
-#define XINE_VO_ASPECT_NUM_RATIOS 5
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
-#define XINE_VO_ASPECT_PAN_SCAN 41
-#define XINE_VO_ASPECT_DONT_TOUCH 42
-#endif
-
-/* stream format detection strategies */
-
-/* recognize stream type first by content then by extension. */
-#define XINE_DEMUX_DEFAULT_STRATEGY 0
-/* recognize stream type first by extension then by content. */
-#define XINE_DEMUX_REVERT_STRATEGY 1
-/* recognize stream type by content only. */
-#define XINE_DEMUX_CONTENT_STRATEGY 2
-/* recognize stream type by extension only. */
-#define XINE_DEMUX_EXTENSION_STRATEGY 3
-
-/* verbosity settings */
-#define XINE_VERBOSITY_NONE 0
-#define XINE_VERBOSITY_LOG 1
-#define XINE_VERBOSITY_DEBUG 2
-
-/*
- * snapshot function
- *
- * image format can be YUV 4:2:0 or 4:2:2
- * will copy the image data into memory that <img> points to
- * (interleaved for yuv 4:2:2 or planary for 4:2:0)
- *
- * xine_get_current_frame() requires that <img> must be able
- * to hold the image data. Use a NULL pointer to retrieve the
- * necessary parameters for calculating the buffer size. Be
- * aware that the image can change between two successive calls
- * so you better pause the stream.
- *
- * xine_get_current_frame_s() requires to specify the buffer
- * size and it returns the needed / used size. It won't copy
- * image data into a too small buffer.
- *
- * xine_get_current_frame_alloc() takes care of allocating
- * a buffer on its own, so image data can be retrieved by
- * a single call without the need to pause the stream.
- *
- * xine_get_current_frame_data() passes the parameters of the
- * previously mentioned functions plus further information in
- * a structure and can work like the _s or _alloc function
- * respectively depending on the passed flags.
- *
- * all functions return 1 on success, 0 failure.
- */
-int xine_get_current_frame (xine_stream_t *stream,
- int *width, int *height,
- int *ratio_code, int *format,
- uint8_t *img) XINE_PROTECTED;
-
-int xine_get_current_frame_s (xine_stream_t *stream,
- int *width, int *height,
- int *ratio_code, int *format,
- uint8_t *img, int *img_size) XINE_PROTECTED;
-
-int xine_get_current_frame_alloc (xine_stream_t *stream,
- int *width, int *height,
- int *ratio_code, int *format,
- uint8_t **img, int *img_size) XINE_PROTECTED;
-
-typedef struct {
-
- int width;
- int height;
- int crop_left;
- int crop_right;
- int crop_top;
- int crop_bottom;
- int ratio_code;
- int interlaced;
- int format;
- int img_size;
- uint8_t *img;
-} xine_current_frame_data_t;
-
-#define XINE_FRAME_DATA_ALLOCATE_IMG (1<<0)
-
-int xine_get_current_frame_data (xine_stream_t *stream,
- xine_current_frame_data_t *data,
- int flags) XINE_PROTECTED;
-
-/* xine image formats */
-#define XINE_IMGFMT_YV12 (('2'<<24)|('1'<<16)|('V'<<8)|'Y')
-#define XINE_IMGFMT_YUY2 (('2'<<24)|('Y'<<16)|('U'<<8)|'Y')
-#define XINE_IMGFMT_XVMC (('C'<<24)|('M'<<16)|('v'<<8)|'X')
-#define XINE_IMGFMT_XXMC (('C'<<24)|('M'<<16)|('x'<<8)|'X')
-
-/* get current xine's virtual presentation timestamp (1/90000 sec)
- * note: this is mostly internal data.
- * one can use vpts with xine_osd_show() and xine_osd_hide().
- */
-int64_t xine_get_current_vpts(xine_stream_t *stream) XINE_PROTECTED;
-
-
-/*********************************************************************
- * media processing *
- *********************************************************************/
-
-#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES
-
-/*
- * access to decoded audio and video frames from a stream
- * these functions are intended to provide the basis for
- * re-encoding and other video processing applications
- *
- * note that the xine playback engine will block when
- * rendering to a framegrab port: to unblock the stream,
- * you must fetch the frames manually with the
- * xine_get_next_* functions. this ensures that a
- * framegrab port is guaranteed to never miss a frame.
- *
- */
-
-xine_video_port_t *xine_new_framegrab_video_port (xine_t *self) XINE_PROTECTED;
-
-typedef struct {
-
- int64_t vpts; /* timestamp 1/90000 sec for a/v sync */
- int64_t duration;
- int width, height;
- int colorspace; /* XINE_IMGFMT_* */
- double aspect_ratio;
-
- int pos_stream; /* bytes from stream start */
- int pos_time; /* milliseconds */
-
- uint8_t *data;
- void *xine_frame; /* used internally by xine engine */
-
- int frame_number; /* frame number (may be unknown) */
-} xine_video_frame_t;
-
-int xine_get_next_video_frame (xine_video_port_t *port,
- xine_video_frame_t *frame) XINE_PROTECTED;
-
-void xine_free_video_frame (xine_video_port_t *port, xine_video_frame_t *frame) XINE_PROTECTED;
-
-xine_audio_port_t *xine_new_framegrab_audio_port (xine_t *self) XINE_PROTECTED;
-
-typedef struct {
-
- int64_t vpts; /* timestamp 1/90000 sec for a/v sync */
- int num_samples;
- int sample_rate;
- int num_channels;
- int bits_per_sample; /* per channel */
-
- off_t pos_stream; /* bytes from stream start */
- int pos_time; /* milliseconds */
-
- uint8_t *data;
- void *xine_frame; /* used internally by xine engine */
-} xine_audio_frame_t;
-
-int xine_get_next_audio_frame (xine_audio_port_t *port,
- xine_audio_frame_t *frame) XINE_PROTECTED;
-
-void xine_free_audio_frame (xine_audio_port_t *port, xine_audio_frame_t *frame) XINE_PROTECTED;
-
- /*
- * maybe future aproach:
- */
-
-int xine_get_video_frame (xine_stream_t *stream,
- int timestamp, /* msec */
- int *width, int *height,
- int *ratio_code,
- int *duration, /* msec */
- int *format,
- uint8_t *img) XINE_PROTECTED XINE_DEPRECATED;
-
-/* TODO: xine_get_audio_frame */
-
-#endif
-
-
-/*********************************************************************
- * post plugin handling *
- *********************************************************************/
-
-/*
- * post effect plugin functions
- *
- * after the data leaves the decoder it can pass an arbitrary tree
- * of post plugins allowing for effects to be applied to the video
- * frames/audio buffers before they reach the output stage
- */
-
-typedef struct xine_post_s xine_post_t;
-
-struct xine_post_s {
-
- /* a NULL-terminated array of audio input ports this post plugin
- * provides; you can hand these to other post plugin's outputs or
- * pass them to the initialization of streams
- */
- xine_audio_port_t **audio_input;
-
- /* a NULL-terminated array of video input ports this post plugin
- * provides; you can hand these to other post plugin's outputs or
- * pass them to the initialization of streams
- */
- xine_video_port_t **video_input;
-
- /* the type of the post plugin
- * one of XINE_POST_TYPE_* can be used here
- */
- int type;
-
-};
-
-/*
- * initialize a post plugin
- *
- * returns xine_post_t* on success, NULL on failure
- *
- * Initializes the post plugin with the given name and connects its
- * outputs to the NULL-terminated arrays of audio and video ports.
- * Some plugins also care about the number of inputs you request
- * (e.g. mixer plugins), others simply ignore this number.
- */
-xine_post_t *xine_post_init(xine_t *xine, const char *name,
- int inputs,
- xine_audio_port_t **audio_target,
- xine_video_port_t **video_target) XINE_PROTECTED;
-
-/* get a list of all available post plugins */
-const char *const *xine_list_post_plugins(xine_t *xine) XINE_PROTECTED;
-
-/* get a list of all post plugins of one type */
-const char *const *xine_list_post_plugins_typed(xine_t *xine, int type) XINE_PROTECTED;
-
-/*
- * post plugin input/output
- *
- * These structures encapsulate inputs/outputs for post plugins
- * to transfer arbitrary data. Frontends can also provide inputs
- * and outputs and connect them to post plugins to exchange data
- * with them.
- */
-
-typedef struct xine_post_in_s xine_post_in_t;
-typedef struct xine_post_out_s xine_post_out_t;
-
-struct xine_post_in_s {
-
- /* the name identifying this input */
- const char *name;
-
- /* the datatype of this input, use one of XINE_POST_DATA_* here */
- int type;
-
- /* the data pointer; input is directed to this memory location,
- * so you simply access the pointer to access the input data */
- void *data;
-
-};
-
-struct xine_post_out_s {
-
- /* the name identifying this output */
- const char *name;
-
- /* the datatype of this output, use one of XINE_POST_DATA_* here */
- int type;
-
- /* the data pointer; output should be directed to this memory location,
- * so in the easy case you simply write through the pointer */
- void *data;
-
- /* this function is called, when the output should be redirected
- * to another input, you sould set the data pointer to direct
- * any output to this new input;
- * a special situation is, when this function is called with a NULL
- * argument: in this case you should disconnect the data pointer
- * from any output and if necessary to avoid writing to some stray
- * memory you should make it point to some dummy location,
- * returns 1 on success, 0 on failure;
- * if you do not implement rewiring, set this to NULL */
- int (*rewire) (xine_post_out_t *self, void *data);
-
-};
-
-/* get a list of all inputs of a post plugin */
-const char *const *xine_post_list_inputs(xine_post_t *self) XINE_PROTECTED;
-
-/* get a list of all outputs of a post plugin */
-const char *const *xine_post_list_outputs(xine_post_t *self) XINE_PROTECTED;
-
-/* retrieve one specific input of a post plugin */
-xine_post_in_t *xine_post_input(xine_post_t *self, const char *name) XINE_PROTECTED;
-
-/* retrieve one specific output of a post plugin */
-xine_post_out_t *xine_post_output(xine_post_t *self, const char *name) XINE_PROTECTED;
-
-/*
- * wire an input to an output
- * returns 1 on success, 0 on failure
- */
-int xine_post_wire(xine_post_out_t *source, xine_post_in_t *target) XINE_PROTECTED;
-
-/*
- * wire a video port to a video output
- * This can be used to rewire different post plugins to the video output
- * plugin layer. The ports you hand in at xine_post_init() will already
- * be wired with the post plugin, so you need this function for
- * _re_connecting only.
- *
- * returns 1 on success, 0 on failure
- */
-int xine_post_wire_video_port(xine_post_out_t *source, xine_video_port_t *vo) XINE_PROTECTED;
-
-/*
- * wire an audio port to an audio output
- * This can be used to rewire different post plugins to the audio output
- * plugin layer. The ports you hand in at xine_post_init() will already
- * be wired with the post plugin, so you need this function for
- * _re_connecting only.
- *
- * returns 1 on success, 0 on failure
- */
-int xine_post_wire_audio_port(xine_post_out_t *source, xine_audio_port_t *ao) XINE_PROTECTED;
-
-/*
- * Extracts an output for a stream. Use this to rewire the outputs of streams.
- */
-xine_post_out_t * xine_get_video_source(xine_stream_t *stream) XINE_PROTECTED;
-xine_post_out_t * xine_get_audio_source(xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * disposes the post plugin
- * please make sure that no other post plugin and no stream is
- * connected to any of this plugin's inputs
- */
-void xine_post_dispose(xine_t *xine, xine_post_t *self) XINE_PROTECTED;
-
-
-/* post plugin types */
-#define XINE_POST_TYPE_VIDEO_FILTER 0x010000
-#define XINE_POST_TYPE_VIDEO_VISUALIZATION 0x010001
-#define XINE_POST_TYPE_VIDEO_COMPOSE 0x010002
-#define XINE_POST_TYPE_AUDIO_FILTER 0x020000
-#define XINE_POST_TYPE_AUDIO_VISUALIZATION 0x020001
-
-
-/* post plugin data types */
-
-/* video port data
- * input->data is a xine_video_port_t*
- * output->data usually is a xine_video_port_t**
- */
-#define XINE_POST_DATA_VIDEO 0
-
-/* audio port data
- * input->data is a xine_audio_port_t*
- * output->data usually is a xine_audio_port_t**
- */
-#define XINE_POST_DATA_AUDIO 1
-
-/* integer data
- * input->data is a int*
- * output->data usually is a int*
- */
-#define XINE_POST_DATA_INT 3
-
-/* double precision floating point data
- * input->data is a double*
- * output->data usually is a double*
- */
-#define XINE_POST_DATA_DOUBLE 4
-
-/* parameters api (used by frontends)
- * input->data is xine_post_api_t* (see below)
- */
-#define XINE_POST_DATA_PARAMETERS 5
-
-/* defines a single parameter entry. */
-typedef struct {
- int type; /* POST_PARAM_TYPE_xxx */
- char *name; /* name of this parameter */
- int size; /* sizeof(parameter) */
- int offset; /* offset in bytes from struct ptr */
- char **enum_values; /* enumeration (first=0) or NULL */
- double range_min; /* minimum value */
- double range_max; /* maximum value */
- int readonly; /* 0 = read/write, 1=read-only */
- char *description; /* user-friendly description */
-} xine_post_api_parameter_t;
-
-/* description of parameters struct (params). */
-typedef struct {
- int struct_size; /* sizeof(params) */
- xine_post_api_parameter_t *parameter; /* list of parameters */
-} xine_post_api_descr_t;
-
-typedef struct {
- /*
- * method to set all the read/write parameters.
- * params is a struct * defined by xine_post_api_descr_t
- */
- int (*set_parameters) (xine_post_t *self, void *params);
-
- /*
- * method to get all parameters.
- */
- int (*get_parameters) (xine_post_t *self, void *params);
-
- /*
- * method to get params struct definition
- */
- xine_post_api_descr_t * (*get_param_descr) (void);
-
- /*
- * method to get plugin and parameters help (UTF-8)
- * the help string must be word wrapped by the frontend.
- * it might contain \n to mark paragraph breaks.
- */
- char * (*get_help) (void);
-} xine_post_api_t;
-
-/* post parameter types */
-#define POST_PARAM_TYPE_LAST 0 /* terminator of parameter list */
-#define POST_PARAM_TYPE_INT 1 /* integer (or vector of integers) */
-#define POST_PARAM_TYPE_DOUBLE 2 /* double (or vector of doubles) */
-#define POST_PARAM_TYPE_CHAR 3 /* char (or vector of chars = string) */
-#define POST_PARAM_TYPE_STRING 4 /* (char *), ASCIIZ */
-#define POST_PARAM_TYPE_STRINGLIST 5 /* (char **) list, NULL terminated */
-#define POST_PARAM_TYPE_BOOL 6 /* integer (0 or 1) */
-
-
-/*********************************************************************
- * information retrieval *
- *********************************************************************/
-
-/*
- * xine log functions
- *
- * frontends can display xine log output using these functions
- */
-int xine_get_log_section_count(xine_t *self) XINE_PROTECTED;
-
-/* return a NULL terminated array of log sections names */
-const char *const *xine_get_log_names(xine_t *self) XINE_PROTECTED;
-
-/* print some log information to <buf> section */
-void xine_log (xine_t *self, int buf,
- const char *format, ...) XINE_FORMAT_PRINTF(3, 4) XINE_PROTECTED;
-void xine_vlog(xine_t *self, int buf,
- const char *format, va_list args) XINE_FORMAT_PRINTF(3, 0) XINE_PROTECTED;
-
-/* get log messages of specified section */
-char *const *xine_get_log (xine_t *self, int buf) XINE_PROTECTED;
-
-/* log callback will be called whenever something is logged */
-typedef void (*xine_log_cb_t) (void *user_data, int section);
-void xine_register_log_cb (xine_t *self, xine_log_cb_t cb,
- void *user_data) XINE_PROTECTED;
-
-/*
- * error handling / engine status
- */
-
-/* return last error */
-int xine_get_error (xine_stream_t *stream) XINE_PROTECTED;
-
-/* get current xine engine status (constants see below) */
-int xine_get_status (xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * engine status codes
- */
-#define XINE_STATUS_IDLE 0 /* no mrl assigned */
-#define XINE_STATUS_STOP 1
-#define XINE_STATUS_PLAY 2
-#define XINE_STATUS_QUIT 3
-
-/*
- * xine error codes
- */
-#define XINE_ERROR_NONE 0
-#define XINE_ERROR_NO_INPUT_PLUGIN 1
-#define XINE_ERROR_NO_DEMUX_PLUGIN 2
-#define XINE_ERROR_DEMUX_FAILED 3
-#define XINE_ERROR_MALFORMED_MRL 4
-#define XINE_ERROR_INPUT_FAILED 5
-
-/*
- * try to find out audio/spu language of given channel
- * (use -1 for current channel)
- *
- * lang must point to a buffer of at least XINE_LANG_MAX bytes
- *
- * returns 1 on success, 0 on failure
- */
-int xine_get_audio_lang (xine_stream_t *stream, int channel,
- char *lang) XINE_PROTECTED;
-int xine_get_spu_lang (xine_stream_t *stream, int channel,
- char *lang) XINE_PROTECTED;
-/*_x_ increasing this number means an incompatible ABI breakage! */
-#define XINE_LANG_MAX 32
-
-/*
- * get position / length information
- *
- * depending of the nature and system layer of the stream,
- * some or all of this information may be unavailable or incorrect
- * (e.g. live network streams may not have a valid length)
- *
- * returns 1 on success, 0 on failure (data was not updated,
- * probably because it's not known yet... try again later)
- */
-int xine_get_pos_length (xine_stream_t *stream,
- int *pos_stream, /* 0..65535 */
- int *pos_time, /* milliseconds */
- int *length_time) /* milliseconds */
- XINE_PROTECTED;
-
-/*
- * get information about the stream such as
- * video width/height, codecs, audio format, title, author...
- * strings are UTF-8 encoded.
- *
- * constants see below
- */
-uint32_t xine_get_stream_info (xine_stream_t *stream, int info) XINE_PROTECTED;
-const char *xine_get_meta_info (xine_stream_t *stream, int info) XINE_PROTECTED;
-
-/* xine_get_stream_info */
-#define XINE_STREAM_INFO_BITRATE 0
-#define XINE_STREAM_INFO_SEEKABLE 1
-#define XINE_STREAM_INFO_VIDEO_WIDTH 2
-#define XINE_STREAM_INFO_VIDEO_HEIGHT 3
-#define XINE_STREAM_INFO_VIDEO_RATIO 4 /* *10000 */
-#define XINE_STREAM_INFO_VIDEO_CHANNELS 5
-#define XINE_STREAM_INFO_VIDEO_STREAMS 6
-#define XINE_STREAM_INFO_VIDEO_BITRATE 7
-#define XINE_STREAM_INFO_VIDEO_FOURCC 8
-#define XINE_STREAM_INFO_VIDEO_HANDLED 9 /* codec available? */
-#define XINE_STREAM_INFO_FRAME_DURATION 10 /* 1/90000 sec */
-#define XINE_STREAM_INFO_AUDIO_CHANNELS 11
-#define XINE_STREAM_INFO_AUDIO_BITS 12
-#define XINE_STREAM_INFO_AUDIO_SAMPLERATE 13
-#define XINE_STREAM_INFO_AUDIO_BITRATE 14
-#define XINE_STREAM_INFO_AUDIO_FOURCC 15
-#define XINE_STREAM_INFO_AUDIO_HANDLED 16 /* codec available? */
-#define XINE_STREAM_INFO_HAS_CHAPTERS 17
-#define XINE_STREAM_INFO_HAS_VIDEO 18
-#define XINE_STREAM_INFO_HAS_AUDIO 19
-#define XINE_STREAM_INFO_IGNORE_VIDEO 20
-#define XINE_STREAM_INFO_IGNORE_AUDIO 21
-#define XINE_STREAM_INFO_IGNORE_SPU 22
-#define XINE_STREAM_INFO_VIDEO_HAS_STILL 23
-#define XINE_STREAM_INFO_MAX_AUDIO_CHANNEL 24
-#define XINE_STREAM_INFO_MAX_SPU_CHANNEL 25
-#define XINE_STREAM_INFO_AUDIO_MODE 26
-#define XINE_STREAM_INFO_SKIPPED_FRAMES 27 /* for 1000 frames delivered */
-#define XINE_STREAM_INFO_DISCARDED_FRAMES 28 /* for 1000 frames delivered */
-#define XINE_STREAM_INFO_VIDEO_AFD 29
-#define XINE_STREAM_INFO_DVD_TITLE_NUMBER 30
-#define XINE_STREAM_INFO_DVD_TITLE_COUNT 31
-#define XINE_STREAM_INFO_DVD_CHAPTER_NUMBER 32
-#define XINE_STREAM_INFO_DVD_CHAPTER_COUNT 33
-#define XINE_STREAM_INFO_DVD_ANGLE_NUMBER 34
-#define XINE_STREAM_INFO_DVD_ANGLE_COUNT 35
-
-/* possible values for XINE_STREAM_INFO_VIDEO_AFD */
-#define XINE_VIDEO_AFD_NOT_PRESENT -1
-#define XINE_VIDEO_AFD_RESERVED_0 0
-#define XINE_VIDEO_AFD_RESERVED_1 1
-#define XINE_VIDEO_AFD_BOX_16_9_TOP 2
-#define XINE_VIDEO_AFD_BOX_14_9_TOP 3
-#define XINE_VIDEO_AFD_BOX_GT_16_9_CENTRE 4
-#define XINE_VIDEO_AFD_RESERVED_5 5
-#define XINE_VIDEO_AFD_RESERVED_6 6
-#define XINE_VIDEO_AFD_RESERVED_7 7
-#define XINE_VIDEO_AFD_SAME_AS_FRAME 8
-#define XINE_VIDEO_AFD_4_3_CENTRE 9
-#define XINE_VIDEO_AFD_16_9_CENTRE 10
-#define XINE_VIDEO_AFD_14_9_CENTRE 11
-#define XINE_VIDEO_AFD_RESERVED_12 12
-#define XINE_VIDEO_AFD_4_3_PROTECT_14_9 13
-#define XINE_VIDEO_AFD_16_9_PROTECT_14_9 14
-#define XINE_VIDEO_AFD_16_9_PROTECT_4_3 15
-
-/* xine_get_meta_info */
-#define XINE_META_INFO_TITLE 0
-#define XINE_META_INFO_COMMENT 1
-#define XINE_META_INFO_ARTIST 2
-#define XINE_META_INFO_GENRE 3
-#define XINE_META_INFO_ALBUM 4
-#define XINE_META_INFO_YEAR 5 /* may be full date */
-#define XINE_META_INFO_VIDEOCODEC 6
-#define XINE_META_INFO_AUDIOCODEC 7
-#define XINE_META_INFO_SYSTEMLAYER 8
-#define XINE_META_INFO_INPUT_PLUGIN 9
-#define XINE_META_INFO_CDINDEX_DISCID 10
-#define XINE_META_INFO_TRACK_NUMBER 11
-#define XINE_META_INFO_COMPOSER 12
-/* post-1.1.17; taken from the list at http://age.hobba.nl/audio/mirroredpages/ogg-tagging.html on 2009-12-11 */
-#define XINE_META_INFO_PUBLISHER 13
-#define XINE_META_INFO_COPYRIGHT 14
-#define XINE_META_INFO_LICENSE 15
-#define XINE_META_INFO_ARRANGER 16
-#define XINE_META_INFO_LYRICIST 17
-#define XINE_META_INFO_AUTHOR 18
-#define XINE_META_INFO_CONDUCTOR 19
-#define XINE_META_INFO_PERFORMER 20
-#define XINE_META_INFO_ENSEMBLE 21
-#define XINE_META_INFO_OPUS 22
-#define XINE_META_INFO_PART 23
-#define XINE_META_INFO_PARTNUMBER 24
-#define XINE_META_INFO_LOCATION 25
-/* post-1.1.18.1 */
-#define XINE_META_INFO_DISCNUMBER 26
-
-
-/*********************************************************************
- * plugin management / autoplay / mrl browsing *
- *********************************************************************/
-
-/*
- * note: the pointers to strings or string arrays returned
- * by some of these functions are pointers to statically
- * alloced internal xine memory chunks.
- * they're only valid between xine function calls
- * and should never be free()d.
- */
-
-typedef struct {
- char *origin; /* file plugin: path */
- char *mrl; /* <type>://<location> */
- char *link;
- uint32_t type; /* see below */
- off_t size; /* size of this source, may be 0 */
-} xine_mrl_t;
-
-/* mrl types */
-#define XINE_MRL_TYPE_unknown (0 << 0)
-#define XINE_MRL_TYPE_dvd (1 << 0)
-#define XINE_MRL_TYPE_vcd (1 << 1)
-#define XINE_MRL_TYPE_net (1 << 2)
-#define XINE_MRL_TYPE_rtp (1 << 3)
-#define XINE_MRL_TYPE_stdin (1 << 4)
-#define XINE_MRL_TYPE_cda (1 << 5)
-#define XINE_MRL_TYPE_file (1 << 6)
-#define XINE_MRL_TYPE_file_fifo (1 << 7)
-#define XINE_MRL_TYPE_file_chardev (1 << 8)
-#define XINE_MRL_TYPE_file_directory (1 << 9)
-#define XINE_MRL_TYPE_file_blockdev (1 << 10)
-#define XINE_MRL_TYPE_file_normal (1 << 11)
-#define XINE_MRL_TYPE_file_symlink (1 << 12)
-#define XINE_MRL_TYPE_file_sock (1 << 13)
-#define XINE_MRL_TYPE_file_exec (1 << 14)
-#define XINE_MRL_TYPE_file_backup (1 << 15)
-#define XINE_MRL_TYPE_file_hidden (1 << 16)
-
-/* get a list of browsable input plugin ids */
-const char *const *xine_get_browsable_input_plugin_ids (xine_t *self) XINE_PROTECTED;
-
-/*
- * ask input plugin named <plugin_id> to return
- * a list of available MRLs in domain/directory <start_mrl>.
- *
- * <start_mrl> may be NULL indicating the toplevel domain/dir
- * returns <start_mrl> if <start_mrl> is a valid MRL, not a directory
- * returns NULL if <start_mrl> is an invalid MRL, not even a directory.
- */
-xine_mrl_t **xine_get_browse_mrls (xine_t *self,
- const char *plugin_id,
- const char *start_mrl,
- int *num_mrls) XINE_PROTECTED;
-
-/* get a list of plugins that support the autoplay feature */
-const char *const *xine_get_autoplay_input_plugin_ids (xine_t *self) XINE_PROTECTED;
-
-/* get autoplay MRL list from input plugin named <plugin_id> */
-char **xine_get_autoplay_mrls (xine_t *self,
- const char *plugin_id,
- int *num_mrls) XINE_PROTECTED;
-
-/* get a list of file extensions for file types supported by xine
- * the list is separated by spaces
- *
- * the pointer returned can be free()ed when no longer used */
-char *xine_get_file_extensions (xine_t *self) XINE_PROTECTED;
-
-/* get a list of mime types supported by xine
- *
- * the pointer returned can be free()ed when no longer used */
-char *xine_get_mime_types (xine_t *self) XINE_PROTECTED;
-
-/* get the demuxer identifier that handles a given mime type
- *
- * the pointer returned can be free()ed when no longer used
- * returns NULL if no demuxer is available to handle this. */
-char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) XINE_PROTECTED;
-
-/* get a description string for a plugin */
-const char *xine_get_input_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_demux_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_spu_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_audio_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_video_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_audio_driver_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_video_driver_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-const char *xine_get_post_plugin_description (xine_t *self,
- const char *plugin_id) XINE_PROTECTED;
-
-/* get lists of available audio and video output plugins */
-const char *const *xine_list_audio_output_plugins (xine_t *self) XINE_PROTECTED;
-const char *const *xine_list_video_output_plugins (xine_t *self) XINE_PROTECTED;
-/* typemask is (1ULL << XINE_VISUAL_TYPE_FOO) | ... */
-const char *const *xine_list_video_output_plugins_typed (xine_t *self, uint64_t typemask) XINE_PROTECTED;
-
-/* get list of available demultiplexor plugins */
-const char *const *xine_list_demuxer_plugins(xine_t *self) XINE_PROTECTED;
-
-/* get list of available input plugins */
-const char *const *xine_list_input_plugins(xine_t *self) XINE_PROTECTED;
-
-/* get list of available subpicture plugins */
-const char *const *xine_list_spu_plugins(xine_t *self) XINE_PROTECTED;
-
-/* get list of available audio and video decoder plugins */
-const char *const *xine_list_audio_decoder_plugins(xine_t *self) XINE_PROTECTED;
-const char *const *xine_list_video_decoder_plugins(xine_t *self) XINE_PROTECTED;
-
-/* unload unused plugins */
-void xine_plugins_garbage_collector(xine_t *self) XINE_PROTECTED;
-
-
-/*********************************************************************
- * visual specific gui <-> xine engine communication *
- *********************************************************************/
-
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
-/* talk to video output driver - old method */
-int xine_gui_send_vo_data (xine_stream_t *self,
- int type, void *data) XINE_PROTECTED XINE_DEPRECATED;
-#endif
-
-/* new (preferred) method to talk to video driver. */
-int xine_port_send_gui_data (xine_video_port_t *vo,
- int type, void *data) XINE_PROTECTED;
-
-typedef struct {
-
- /* area of that drawable to be used by video */
- int x,y,w,h;
-
-} x11_rectangle_t;
-
-/*
- * this is the visual data struct any x11 gui
- * must supply to the xine_open_video_driver call
- * ("data" parameter)
- */
-typedef struct {
-
- /* some information about the display */
- void *display; /* Display* */
- int screen;
-
- /* drawable to display the video in/on */
- unsigned long d; /* Drawable */
-
- void *user_data;
-
- /*
- * dest size callback
- *
- * this will be called by the video driver to find out
- * how big the video output area size will be for a
- * given video size. The ui should _not_ adjust its
- * video out area, just do some calculations and return
- * the size. This will be called for every frame, ui
- * implementation should be fast.
- * dest_pixel_aspect should be set to the used display pixel aspect.
- * NOTE: Semantics has changed: video_width and video_height
- * are no longer pixel aspect corrected. Get the old semantics
- * in the UI with
- * *dest_pixel_aspect = display_pixel_aspect;
- * if (video_pixel_aspect >= display_pixel_aspect)
- * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
- * else
- * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
- */
- void (*dest_size_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect);
-
- /*
- * frame output callback
- *
- * this will be called by the video driver for every frame
- * it's about to draw. ui can adapt its size if necessary
- * here.
- * note: the ui doesn't have to adjust itself to this
- * size, this is just to be taken as a hint.
- * ui must return the actual size of the video output
- * area and the video output driver will do its best
- * to adjust the video frames to that size (while
- * preserving aspect ratio and stuff).
- * dest_x, dest_y: offset inside window
- * dest_width, dest_height: available drawing space
- * dest_pixel_aspect: display pixel aspect
- * win_x, win_y: window absolute screen position
- * NOTE: Semantics has changed: video_width and video_height
- * are no longer pixel aspect corrected. Get the old semantics
- * in the UI with
- * *dest_pixel_aspect = display_pixel_aspect;
- * if (video_pixel_aspect >= display_pixel_aspect)
- * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
- * else
- * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
- */
- void (*frame_output_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_x, int *dest_y,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect,
- int *win_x, int *win_y);
-
- /*
- * lock display callback
- *
- * this callback is called when the video driver
- * needs access to the x11 display connection
- *
- * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2
- * note: if display_lock is NULL, the fallback is used
- * note: fallback for this function is XLockDisplay(display)
- */
- void (*lock_display) (void *user_data);
-
- /*
- * unlock display callback
- *
- * this callback is called when the video driver
- * doesn't need access to the x11 display connection anymore
- *
- * note: to enable this you MUST use XINE_VISUAL_TYPE_X11_2
- * note: if display_unlock is NULL, the fallback is used
- * note: fallback for this function is XUnlockDisplay(display)
- */
- void (*unlock_display) (void *user_data);
-
-} x11_visual_t;
-
-/*
- * this is the visual data struct any xcb gui
- * must supply to the xine_open_video_driver call
- * ("data" parameter)
- */
-typedef struct {
-
- /* some information about the display */
- void *connection; /* xcb_connection_t */
- void *screen; /* xcb_screen_t */
-
- /* window to display the video in / on */
- unsigned int window; /* xcb_window_t */
-
- void *user_data;
-
- /*
- * dest size callback
- *
- * this will be called by the video driver to find out
- * how big the video output area size will be for a
- * given video size. The ui should _not_ adjust its
- * video out area, just do some calculations and return
- * the size. This will be called for every frame, ui
- * implementation should be fast.
- * dest_pixel_aspect should be set to the used display pixel aspect.
- * NOTE: Semantics has changed: video_width and video_height
- * are no longer pixel aspect corrected. Get the old semantics
- * in the UI with
- * *dest_pixel_aspect = display_pixel_aspect;
- * if (video_pixel_aspect >= display_pixel_aspect)
- * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
- * else
- * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
- */
- void (*dest_size_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect);
-
- /*
- * frame output callback
- *
- * this will be called by the video driver for every frame
- * it's about to draw. ui can adapt its size if necessary
- * here.
- * note: the ui doesn't have to adjust itself to this
- * size, this is just to be taken as a hint.
- * ui must return the actual size of the video output
- * area and the video output driver will do its best
- * to adjust the video frames to that size (while
- * preserving aspect ratio and stuff).
- * dest_x, dest_y: offset inside window
- * dest_width, dest_height: available drawing space
- * dest_pixel_aspect: display pixel aspect
- * win_x, win_y: window absolute screen position
- * NOTE: Semantics has changed: video_width and video_height
- * are no longer pixel aspect corrected. Get the old semantics
- * in the UI with
- * *dest_pixel_aspect = display_pixel_aspect;
- * if (video_pixel_aspect >= display_pixel_aspect)
- * video_width = video_width * video_pixel_aspect / display_pixel_aspect + .5;
- * else
- * video_height = video_height * display_pixel_aspect / video_pixel_aspect + .5;
- */
- void (*frame_output_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_x, int *dest_y,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect,
- int *win_x, int *win_y);
-
-} xcb_visual_t;
-
-/**************************************************
- * XINE_VO_RAW struct definitions
- *************************************************/
-/* frame_format definitions */
-#define XINE_VORAW_YV12 1
-#define XINE_VORAW_YUY2 2
-#define XINE_VORAW_RGB 4
-
-/* maximum number of overlays the raw driver can handle */
-#define XINE_VORAW_MAX_OVL 16
-
-/* raw_overlay_t struct used in raw_overlay_cb callback */
-typedef struct {
- uint8_t *ovl_rgba;
- int ovl_w, ovl_h; /* overlay's width and height */
- int ovl_x, ovl_y; /* overlay's top-left display position */
-} raw_overlay_t;
-
-/* this is the visual data struct any raw gui
- * must supply to the xine_open_video_driver call
- * ("data" parameter)
- */
-typedef struct {
- void *user_data;
-
- /* OR'ed frame_format
- * Unsupported frame formats are converted to rgb.
- * XINE_VORAW_RGB is always assumed by the driver, even if not set.
- * So a frontend must at least support rgb.
- * Be aware that rgb requires more cpu than yuv,
- * so avoid its usage for video playback.
- * However, it's useful for single frame capture (e.g. thumbs)
- */
- int supported_formats;
-
- /* raw output callback
- * this will be called by the video driver for every frame
- *
- * If frame_format==XINE_VORAW_YV12, data0 points to frame_width*frame_height Y values
- * data1 points to (frame_width/2)*(frame_height/2) U values
- * data2 points to (frame_width/2)*(frame_height/2) V values
- *
- * If frame_format==XINE_VORAW_YUY2, data0 points to frame_width*frame_height*2 YU/Y²V values
- * data1 is NULL
- * data2 is NULL
- *
- * If frame_format==XINE_VORAW_RGB, data0 points to frame_width*frame_height*3 RGB values
- * data1 is NULL
- * data2 is NULL
- */
- void (*raw_output_cb) (void *user_data, int frame_format,
- int frame_width, int frame_height,
- double frame_aspect,
- void *data0, void *data1, void *data2);
-
- /* raw overlay callback
- * this will be called by the video driver for every new overlay state
- * overlays_array points to an array of num_ovl raw_overlay_t
- * Note that num_ovl can be 0, meaning "end of overlay display"
- * num_ovl is at most XINE_VORAW_MAX_OVL */
- void (*raw_overlay_cb) (void *user_data, int num_ovl,
- raw_overlay_t *overlays_array);
-} raw_visual_t;
-/**********************************************
- * end of vo_raw defs
- *********************************************/
-
-/*
- * this is the visual data struct any fb gui
- * may supply to the xine_open_video_driver call
- * ("data" parameter) to get frame_output_cd calls
- */
-
-typedef struct {
-
- void (*frame_output_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_x, int *dest_y,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect,
- int *win_x, int *win_y);
-
- void *user_data;
-
-} fb_visual_t;
-
-#ifdef WIN32
-/*
- * this is the visual data struct any win32 gui should supply
- * (pass this to init_video_out_plugin or the xine_load_video_output_plugin
- * utility function)
- */
-
-typedef struct {
-
- HWND WndHnd; /* handle of window associated with primary surface */
- HINSTANCE HInst; /* handle of windows application instance */
- RECT WndRect; /* rect of window client points translated to screen
- * cooridnates */
- int FullScreen; /* is window fullscreen */
- HBRUSH Brush; /* window brush for background color */
- COLORREF ColorKey; /* window brush color key */
-
-} win32_visual_t;
-
-/*
- * constants for gui_data_exchange's data_type parameter
- */
-
-#define GUI_WIN32_MOVED_OR_RESIZED 0
-
-#endif /* WIN32 */
-
-/*
- * "type" constants for xine_port_send_gui_data(...)
- */
-
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
-/* xevent *data */
-#define XINE_GUI_SEND_COMPLETION_EVENT 1 /* DEPRECATED */
-#endif
-
-/* Drawable data */
-#define XINE_GUI_SEND_DRAWABLE_CHANGED 2
-
-/* xevent *data */
-#define XINE_GUI_SEND_EXPOSE_EVENT 3
-
-/* x11_rectangle_t *data */
-#define XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO 4
-
-/* int data */
-#define XINE_GUI_SEND_VIDEOWIN_VISIBLE 5
-
-/* *data contains chosen visual, select a new one or change it to NULL
- * to indicate the visual to use or that no visual will work */
-/* XVisualInfo **data */
-#define XINE_GUI_SEND_SELECT_VISUAL 8
-
-/* Gui is about to destroy drawable */
-#define XINE_GUI_SEND_WILL_DESTROY_DRAWABLE 9
-
-
-/*********************************************************************
- * xine health check stuff *
- *********************************************************************/
-
-#define XINE_HEALTH_CHECK_OK 0
-#define XINE_HEALTH_CHECK_FAIL 1
-#define XINE_HEALTH_CHECK_UNSUPPORTED 2
-#define XINE_HEALTH_CHECK_NO_SUCH_CHECK 3
-
-#define CHECK_KERNEL 0
-#define CHECK_MTRR 1
-#define CHECK_CDROM 2
-#define CHECK_DVDROM 3
-#define CHECK_DMA 4
-#define CHECK_X 5
-#define CHECK_XV 6
-
-struct xine_health_check_s {
- int status;
- const char* cdrom_dev;
- const char* dvd_dev;
- char* msg;
- char* title;
- char* explanation;
-};
-
-typedef struct xine_health_check_s xine_health_check_t;
-xine_health_check_t* xine_health_check(xine_health_check_t*, int check_num) XINE_PROTECTED;
-
-
-/*********************************************************************
- * configuration system *
- *********************************************************************/
-
-/*
- * config entry data types
- */
-
-#define XINE_CONFIG_TYPE_UNKNOWN 0
-#define XINE_CONFIG_TYPE_RANGE 1
-#define XINE_CONFIG_TYPE_STRING 2
-#define XINE_CONFIG_TYPE_ENUM 3
-#define XINE_CONFIG_TYPE_NUM 4
-#define XINE_CONFIG_TYPE_BOOL 5
-
-/* For the string type (1.1.4 and later). These are stored in num_value. */
-#define XINE_CONFIG_STRING_IS_STRING 0
-#define XINE_CONFIG_STRING_IS_FILENAME 1
-#define XINE_CONFIG_STRING_IS_DEVICE_NAME 2
-#define XINE_CONFIG_STRING_IS_DIRECTORY_NAME 3
-
-typedef struct xine_cfg_entry_s xine_cfg_entry_t;
-
-typedef void (*xine_config_cb_t) (void *user_data,
- xine_cfg_entry_t *entry);
-struct xine_cfg_entry_s {
- const char *key; /* unique id (example: gui.logo_mrl) */
-
- int type;
-
- /* type unknown */
- char *unknown_value;
-
- /* type string */
- char *str_value;
- char *str_default;
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
- char *str_sticky;
-#else
- void *dummy;
-#endif
-
- /* common to range, enum, num, bool;
- * num_value is also used by string to indicate what's required:
- * plain string, file name, device name, directory name
- */
- int num_value;
- int num_default;
-
- /* type range specific: */
- int range_min;
- int range_max;
-
- /* type enum specific: */
- char **enum_values;
-
- /* help info for the user (UTF-8)
- * the help string must be word wrapped by the frontend.
- * it might contain \n to mark paragraph breaks.
- */
- const char *description;
- const char *help;
-
- /* user experience level */
- int exp_level; /* 0 => beginner,
- 10 => advanced user,
- 20 => expert */
-
- /* callback function and data for live changeable values */
- /* some config entries will take effect immediately, although they
- * do not have a callback registered; such values will have some
- * non-NULL dummy value in callback_data; so if you want to check,
- * if a config change will require restarting xine, check for
- * callback_data == NULL */
- xine_config_cb_t callback;
- void *callback_data;
-
-};
-
-const char *xine_config_register_string (xine_t *self,
- const char *key,
- const char *def_value,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) XINE_PROTECTED;
-
-const char *xine_config_register_filename (xine_t *self,
- const char *key,
- const char *def_value,
- int req_type, /* XINE_CONFIG_STRING_IS_* */
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) XINE_PROTECTED;
-
-int xine_config_register_range (xine_t *self,
- const char *key,
- int def_value,
- int min, int max,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) XINE_PROTECTED;
-
-int xine_config_register_enum (xine_t *self,
- const char *key,
- int def_value,
- char **values,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) XINE_PROTECTED;
-
-int xine_config_register_num (xine_t *self,
- const char *key,
- int def_value,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) XINE_PROTECTED;
-
-int xine_config_register_bool (xine_t *self,
- const char *key,
- int def_value,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data) XINE_PROTECTED;
-
-/*
- * the following functions will copy data from the internal xine_config
- * data database to the xine_cfg_entry_t *entry you provide
- *
- * they return 1 on success, 0 on failure
- */
-
-/* get first config item */
-int xine_config_get_first_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED;
-
-/* get next config item (iterate through the items) */
-int xine_config_get_next_entry (xine_t *self, xine_cfg_entry_t *entry) XINE_PROTECTED;
-
-/* search for a config entry by key */
-int xine_config_lookup_entry (xine_t *self, const char *key,
- xine_cfg_entry_t *entry) XINE_PROTECTED;
-
-/*
- * update a config entry (which was returned from lookup_entry() )
- *
- * xine will make a deep copy of the data in the entry into its internal
- * config database.
- */
-void xine_config_update_entry (xine_t *self,
- const xine_cfg_entry_t *entry) XINE_PROTECTED;
-
-/*
- * translation of old configuration entry names
- */
-typedef struct {
- const char *old_name, *new_name;
-} xine_config_entry_translation_t;
-
-void xine_config_set_translation_user (const xine_config_entry_translation_t *) XINE_PROTECTED;
-
-/*
- * load/save config data from/to afile (e.g. $HOME/.xine/config)
- */
-void xine_config_load (xine_t *self, const char *cfg_filename) XINE_PROTECTED;
-void xine_config_save (xine_t *self, const char *cfg_filename) XINE_PROTECTED;
-void xine_config_reset (xine_t *self) XINE_PROTECTED;
-
-
-/*********************************************************************
- * asynchroneous xine event mechanism *
- *********************************************************************/
-
-/*
- * to receive events you have to register an event queue with
- * the xine engine (xine_event_new_queue, see below).
- *
- * then you can either
- * 1) check for incoming events regularly (xine_event_get/wait),
- * process them and free them using xine_event_free
- * 2) use xine_event_create_listener_thread and specify a callback
- * which will then be called for each event
- *
- * to send events to every module listening you don't need
- * to register an event queue but simply call xine_event_send.
- *
- * front ends should listen for one of MRL_REFERENCE and MRL_REFERENCE_EXT
- * since both will be sent for compatibility reasons
- */
-
-/* event types */
-#define XINE_EVENT_UI_PLAYBACK_FINISHED 1 /* frontend can e.g. move on to next playlist entry */
-#define XINE_EVENT_UI_CHANNELS_CHANGED 2 /* inform ui that new channel info is available */
-#define XINE_EVENT_UI_SET_TITLE 3 /* request title display change in ui */
-#define XINE_EVENT_UI_MESSAGE 4 /* message (dialog) for the ui to display */
-#define XINE_EVENT_FRAME_FORMAT_CHANGE 5 /* e.g. aspect ratio change during dvd playback */
-#define XINE_EVENT_AUDIO_LEVEL 6 /* report current audio level (l/r/mute) */
-#define XINE_EVENT_QUIT 7 /* last event sent when stream is disposed */
-#define XINE_EVENT_PROGRESS 8 /* index creation/network connections */
-#define XINE_EVENT_MRL_REFERENCE 9 /* (deprecated) demuxer->frontend: MRL reference(s) for the real stream */
-#define XINE_EVENT_UI_NUM_BUTTONS 10 /* number of buttons for interactive menus */
-#define XINE_EVENT_SPU_BUTTON 11 /* the mouse pointer enter/leave a button */
-#define XINE_EVENT_DROPPED_FRAMES 12 /* number of dropped frames is too high */
-#define XINE_EVENT_MRL_REFERENCE_EXT 13 /* demuxer->frontend: MRL reference(s) for the real stream */
-#define XINE_EVENT_AUDIO_AMP_LEVEL 14 /* report current audio amp level (l/r/mute) */
-#define XINE_EVENT_NBC_STATS 15 /* nbc buffer status */
-
-
-/* input events coming from frontend */
-#define XINE_EVENT_INPUT_MOUSE_BUTTON 101
-#define XINE_EVENT_INPUT_MOUSE_MOVE 102
-#define XINE_EVENT_INPUT_MENU1 103
-#define XINE_EVENT_INPUT_MENU2 104
-#define XINE_EVENT_INPUT_MENU3 105
-#define XINE_EVENT_INPUT_MENU4 106
-#define XINE_EVENT_INPUT_MENU5 107
-#define XINE_EVENT_INPUT_MENU6 108
-#define XINE_EVENT_INPUT_MENU7 109
-#define XINE_EVENT_INPUT_UP 110
-#define XINE_EVENT_INPUT_DOWN 111
-#define XINE_EVENT_INPUT_LEFT 112
-#define XINE_EVENT_INPUT_RIGHT 113
-#define XINE_EVENT_INPUT_SELECT 114
-#define XINE_EVENT_INPUT_NEXT 115
-#define XINE_EVENT_INPUT_PREVIOUS 116
-#define XINE_EVENT_INPUT_ANGLE_NEXT 117
-#define XINE_EVENT_INPUT_ANGLE_PREVIOUS 118
-#define XINE_EVENT_INPUT_BUTTON_FORCE 119
-#define XINE_EVENT_INPUT_NUMBER_0 120
-#define XINE_EVENT_INPUT_NUMBER_1 121
-#define XINE_EVENT_INPUT_NUMBER_2 122
-#define XINE_EVENT_INPUT_NUMBER_3 123
-#define XINE_EVENT_INPUT_NUMBER_4 124
-#define XINE_EVENT_INPUT_NUMBER_5 125
-#define XINE_EVENT_INPUT_NUMBER_6 126
-#define XINE_EVENT_INPUT_NUMBER_7 127
-#define XINE_EVENT_INPUT_NUMBER_8 128
-#define XINE_EVENT_INPUT_NUMBER_9 129
-#define XINE_EVENT_INPUT_NUMBER_10_ADD 130
-
-/* specific event types */
-#define XINE_EVENT_SET_V4L2 200
-#define XINE_EVENT_PVR_SAVE 201
-#define XINE_EVENT_PVR_REPORT_NAME 202
-#define XINE_EVENT_PVR_REALTIME 203
-#define XINE_EVENT_PVR_PAUSE 204
-#define XINE_EVENT_SET_MPEG_DATA 205
-
-/* VDR specific event types */
-#define XINE_EVENT_VDR_RED 300
-#define XINE_EVENT_VDR_GREEN 301
-#define XINE_EVENT_VDR_YELLOW 302
-#define XINE_EVENT_VDR_BLUE 303
-#define XINE_EVENT_VDR_PLAY 304
-#define XINE_EVENT_VDR_PAUSE 305
-#define XINE_EVENT_VDR_STOP 306
-#define XINE_EVENT_VDR_RECORD 307
-#define XINE_EVENT_VDR_FASTFWD 308
-#define XINE_EVENT_VDR_FASTREW 309
-#define XINE_EVENT_VDR_POWER 310
-#define XINE_EVENT_VDR_CHANNELPLUS 311
-#define XINE_EVENT_VDR_CHANNELMINUS 312
-#define XINE_EVENT_VDR_SCHEDULE 313
-#define XINE_EVENT_VDR_CHANNELS 314
-#define XINE_EVENT_VDR_TIMERS 315
-#define XINE_EVENT_VDR_RECORDINGS 316
-#define XINE_EVENT_VDR_SETUP 317
-#define XINE_EVENT_VDR_COMMANDS 318
-#define XINE_EVENT_VDR_BACK 319
-#define XINE_EVENT_VDR_USER1 320
-#define XINE_EVENT_VDR_USER2 321
-#define XINE_EVENT_VDR_USER3 322
-#define XINE_EVENT_VDR_USER4 323
-#define XINE_EVENT_VDR_USER5 324
-#define XINE_EVENT_VDR_USER6 325
-#define XINE_EVENT_VDR_USER7 326
-#define XINE_EVENT_VDR_USER8 327
-#define XINE_EVENT_VDR_USER9 328
-#define XINE_EVENT_VDR_VOLPLUS 329
-#define XINE_EVENT_VDR_VOLMINUS 330
-#define XINE_EVENT_VDR_MUTE 331
-#define XINE_EVENT_VDR_AUDIO 332
-#define XINE_EVENT_VDR_INFO 333
-#define XINE_EVENT_VDR_CHANNELPREVIOUS 334
-#define XINE_EVENT_VDR_SUBTITLES 335
-#define XINE_EVENT_VDR_USER0 336
-/* some space for further keys */
-#define XINE_EVENT_VDR_SETVIDEOWINDOW 350
-#define XINE_EVENT_VDR_FRAMESIZECHANGED 351
-#define XINE_EVENT_VDR_SELECTAUDIO 352
-#define XINE_EVENT_VDR_TRICKSPEEDMODE 353
-#define XINE_EVENT_VDR_PLUGINSTARTED 354
-#define XINE_EVENT_VDR_DISCONTINUITY 355
-
-/* events generated from post plugins */
-#define XINE_EVENT_POST_TVTIME_FILMMODE_CHANGE 400
-
-/*
- * xine event struct
- */
-typedef struct {
- int type; /* event type (constants see above) */
- xine_stream_t *stream; /* stream this event belongs to */
-
- void *data; /* contents depending on type */
- int data_length;
-
- /* you do not have to provide this, it will be filled in by xine_event_send() */
- struct timeval tv; /* timestamp of event creation */
-} xine_event_t;
-
-/*
- * input event dynamic data
- */
-typedef struct {
- xine_event_t event;
- uint8_t button; /* Generally 1 = left, 2 = mid, 3 = right */
- uint16_t x,y; /* In Image space */
-} xine_input_data_t;
-
-/*
- * UI event dynamic data - send information to/from UI.
- */
-typedef struct {
- int num_buttons;
- int str_len;
- char str[256]; /* might be longer */
-} xine_ui_data_t;
-
-/*
- * Send messages to UI. used mostly to report errors.
- */
-typedef struct {
- /*
- * old xine-ui versions expect xine_ui_data_t type.
- * this struct is added for compatibility.
- */
- xine_ui_data_t compatibility;
-
- /* See XINE_MSG_xxx for defined types. */
- int type;
-
- /* defined types are provided with a standard explanation.
- * note: zero means no explanation.
- */
- int explanation; /* add to struct address to get a valid (char *) */
-
- /* parameters are zero terminated strings */
- int num_parameters;
- int parameters; /* add to struct address to get a valid (char *) */
-
- /* where messages are stored, will be longer
- *
- * this field begins with the message text itself (\0-terminated),
- * followed by (optional) \0-terminated parameter strings
- * the end marker is \0 \0
- */
- char messages[1];
-} xine_ui_message_data_t;
-
-
-/*
- * notify frame format change
- */
-typedef struct {
- int width;
- int height;
- /* these are aspect codes as defined in MPEG2, because this
- * is only used for DVD playback, pan_scan is a boolean flag */
- int aspect;
- int pan_scan;
-} xine_format_change_data_t;
-
-/*
- * audio level for left/right channel
- */
-typedef struct {
- int left;
- int right; /* 0..100 % */
- int mute;
-} xine_audio_level_data_t;
-
-/*
- * index generation / buffering
- */
-typedef struct {
- const char *description; /* e.g. "connecting..." */
- int percent;
-} xine_progress_data_t;
-
-/*
- * nbc buffer status
- */
-typedef struct {
- int v_percent; /* fill of video buffer */
- int64_t v_remaining; /* remaining time in ms till underrun */
- int64_t v_bitrate; /* current bitrate */
- int v_in_disc; /* in discontinuity */
- int a_percent; /* like video, but for audio */
- int64_t a_remaining;
- int64_t a_bitrate;
- int a_in_disc;
- int buffering; /* currently filling buffer */
- int enabled; /* buffer disabled by engine */
- int type; /* 0=buffer put, 1=buffer get */
-} xine_nbc_stats_data_t;
-
-/*
- * mrl reference data is sent by demuxers when a reference stream is found.
- * this stream just contains pointers (urls) to the real data, which are
- * passed to frontend using this event type. (examples: .asx, .mov and .ram)
- *
- * ideally, frontends should add these mrls to a "hierarchical playlist".
- * that is, instead of the original file, the ones provided here should be
- * played instead. on pratice, just using a simple playlist should work.
- *
- * mrl references should be played in the same order they are received, just
- * after the current stream finishes.
- * alternative entries may be provided and should be used in case of
- * failure of the primary stream (the one with alternative=0).
- *
- * sample playlist:
- * 1) http://something/something.ram
- * 1a) rtsp://something/realsomething1.rm (alternative=0)
- * 1b) pnm://something/realsomething1.rm (alternative=1)
- * 2) http://another/another.avi
- *
- * 1 and 2 are the original items on this playlist. 1a and 1b were received
- * by events (they are the mrl references enclosed in 1). 1a is played after
- * receiving the finished event from 1. note: 1b is usually ignored, it should
- * only be used in case 1a fails to open.
- *
- * An event listener which accepts XINE_EVENT_MRL_REFERENCE_EXT events
- * *must* ignore XINE_EVENT_MRL_REFERENCE events.
- */
-typedef struct {
- int alternative; /* alternative playlist number, usually 0 */
- char mrl[1]; /* might (will) be longer */
-} xine_mrl_reference_data_t XINE_DEPRECATED;
-
-typedef struct {
- int alternative; /* as above */
- uint32_t start_time, duration; /* milliseconds */
- uint32_t spare[20]; /* for future expansion */
- const char mrl[1]; /* might (will) be longer */
-/*const char title[]; ** immediately follows MRL's terminating NUL */
-} xine_mrl_reference_data_ext_t;
-
-/*
- * configuration options for video4linux-like input plugins
- */
-typedef struct {
- /* input selection */
- int input; /* select active input from card */
- int channel; /* channel number */
- int radio; /* ask for a radio channel */
- uint32_t frequency; /* frequency divided by 62.5KHz or 62.5 Hz */
- uint32_t transmission; /* The transmission standard. */
-
- /* video parameters */
- uint32_t framerate_numerator; /* framerate as numerator/denominator */
- uint32_t framerate_denominator;
- uint32_t framelines; /* Total lines per frame including blanking */
- uint64_t standard_id; /* One of the V4L2_STD_* values */
- uint32_t colorstandard; /* One of the V4L2_COLOR_STD_* values */
- uint32_t colorsubcarrier; /* The color subcarrier frequency */
- int frame_width; /* scaled frame width */
- int frame_height; /* scaled frame height */
-
- /* let some spare space so we can add new fields without breaking
- * binary api compatibility.
- */
- uint32_t spare[20];
-
- /* used by pvr plugin */
- int32_t session_id; /* -1 stops pvr recording */
-
-} xine_set_v4l2_data_t;
-
-/*
- * configuration options for plugins that can do a kind of mpeg encoding
- * note: highly experimental api :)
- */
-typedef struct {
-
- /* mpeg2 parameters */
- int bitrate_vbr; /* 1 = vbr, 0 = cbr */
- int bitrate_mean; /* mean (target) bitrate in kbps*/
- int bitrate_peak; /* peak (max) bitrate in kbps */
- int gop_size; /* GOP size in frames */
- int gop_closure; /* open/closed GOP */
- int b_frames; /* number of B frames to use */
- int aspect_ratio; /* XINE_VO_ASPECT_xxx */
-
- /* let some spare space so we can add new fields without breaking
- * binary api compatibility.
- */
- uint32_t spare[20];
-
-} xine_set_mpeg_data_t;
-
-typedef struct {
- int direction; /* 0 leave, 1 enter */
- int32_t button; /* button number */
-} xine_spu_button_t;
-
-#ifdef XINE_ENABLE_EXPERIMENTAL_FEATURES
-
-/*
- * ask pvr to save (ie. do not discard) the current session
- * see comments on input_pvr.c to understand how it works.
- */
-typedef struct {
- /* mode values:
- * -1 = do nothing, just set the name
- * 0 = truncate current session and save from now on
- * 1 = save from last sync point
- * 2 = save everything on current session
- */
- int mode;
- int id;
- char name[256]; /* name for saving, might be longer */
-} xine_pvr_save_data_t;
-
-typedef struct {
- /* mode values:
- * 0 = non realtime
- * 1 = realtime
- */
- int mode;
-} xine_pvr_realtime_t;
-
-typedef struct {
- /* mode values:
- * 0 = playing
- * 1 = paused
- */
- int mode;
-} xine_pvr_pause_t;
-
-#endif
-
-/* event XINE_EVENT_DROPPED_FRAMES is generated if libxine detects a
- * high number of dropped frames (above configured thresholds). it can
- * be used by the front end to warn about performance problems.
- */
-typedef struct {
- /* these values are given for 1000 frames delivered */
- /* (that is, divide by 10 to get percentages) */
- int skipped_frames;
- int skipped_threshold;
- int discarded_frames;
- int discarded_threshold;
-} xine_dropped_frames_t;
-
-
-/*
- * Defined message types for XINE_EVENT_UI_MESSAGE
- * This is the mechanism to report async errors from engine.
- *
- * If frontend knows about the XINE_MSG_xxx type it may safely
- * ignore the 'explanation' field and provide its own custom
- * dialogue to the 'parameters'.
- *
- * right column specifies the usual parameters.
- */
-
-#define XINE_MSG_NO_ERROR 0 /* (messages to UI) */
-#define XINE_MSG_GENERAL_WARNING 1 /* (warning message) */
-#define XINE_MSG_UNKNOWN_HOST 2 /* (host name) */
-#define XINE_MSG_UNKNOWN_DEVICE 3 /* (device name) */
-#define XINE_MSG_NETWORK_UNREACHABLE 4 /* none */
-#define XINE_MSG_CONNECTION_REFUSED 5 /* (host name) */
-#define XINE_MSG_FILE_NOT_FOUND 6 /* (file name or mrl) */
-#define XINE_MSG_READ_ERROR 7 /* (device/file/mrl) */
-#define XINE_MSG_LIBRARY_LOAD_ERROR 8 /* (library/decoder) */
-#define XINE_MSG_ENCRYPTED_SOURCE 9 /* none */
-#define XINE_MSG_SECURITY 10 /* (security message) */
-#define XINE_MSG_AUDIO_OUT_UNAVAILABLE 11 /* none */
-#define XINE_MSG_PERMISSION_ERROR 12 /* (file name or mrl) */
-#define XINE_MSG_FILE_EMPTY 13 /* file is empty */
-
-/* opaque xine_event_queue_t */
-typedef struct xine_event_queue_s xine_event_queue_t;
-
-/*
- * register a new event queue
- *
- * you have to receive messages from this queue regularly
- *
- * use xine_event_dispose_queue to unregister and free the queue
- */
-xine_event_queue_t *xine_event_new_queue (xine_stream_t *stream) XINE_PROTECTED;
-void xine_event_dispose_queue (xine_event_queue_t *queue) XINE_PROTECTED;
-
-/*
- * receive events (poll)
- *
- * use xine_event_free on the events received from these calls
- * when they're no longer needed
- */
-xine_event_t *xine_event_get (xine_event_queue_t *queue) XINE_PROTECTED;
-xine_event_t *xine_event_wait (xine_event_queue_t *queue) XINE_PROTECTED;
-void xine_event_free (xine_event_t *event) XINE_PROTECTED;
-
-/*
- * receive events (callback)
- *
- * a thread is created which will receive all events from
- * the specified queue, call your callback on each of them
- * and will then free the event when your callback returns
- *
- */
-typedef void (*xine_event_listener_cb_t) (void *user_data,
- const xine_event_t *event);
-void xine_event_create_listener_thread (xine_event_queue_t *queue,
- xine_event_listener_cb_t callback,
- void *user_data) XINE_PROTECTED;
-
-/*
- * send an event to all queues
- *
- * the event will be copied so you can free or reuse
- * *event as soon as xine_event_send returns.
- */
-void xine_event_send (xine_stream_t *stream, const xine_event_t *event) XINE_PROTECTED;
-
-
-/*********************************************************************
- * OSD (on screen display) *
- *********************************************************************/
-
-#define XINE_TEXT_PALETTE_SIZE 11
-
-#define XINE_OSD_TEXT1 (0 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT2 (1 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT3 (2 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT4 (3 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT5 (4 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT6 (5 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT7 (6 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT8 (7 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT9 (8 * XINE_TEXT_PALETTE_SIZE)
-#define XINE_OSD_TEXT10 (9 * XINE_TEXT_PALETTE_SIZE)
-
-/* white text, black border, transparent background */
-#define XINE_TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0
-/* white text, noborder, transparent background */
-#define XINE_TEXTPALETTE_WHITE_NONE_TRANSPARENT 1
-/* white text, no border, translucid background */
-#define XINE_TEXTPALETTE_WHITE_NONE_TRANSLUCID 2
-/* yellow text, black border, transparent background */
-#define XINE_TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3
-
-#define XINE_OSD_CAP_FREETYPE2 0x0001 /* freetype2 support compiled in */
-#define XINE_OSD_CAP_UNSCALED 0x0002 /* unscaled overlays supp. by vo drv */
-
-typedef struct xine_osd_s xine_osd_t;
-
-xine_osd_t *xine_osd_new (xine_stream_t *self, int x, int y,
- int width, int height) XINE_PROTECTED;
-uint32_t xine_osd_get_capabilities (xine_osd_t *self) XINE_PROTECTED;
-void xine_osd_draw_point (xine_osd_t *self, int x, int y, int color) XINE_PROTECTED;
-
-void xine_osd_draw_line (xine_osd_t *self, int x1, int y1,
- int x2, int y2, int color) XINE_PROTECTED;
-void xine_osd_draw_rect (xine_osd_t *self, int x1, int y1,
- int x2, int y2,
- int color, int filled ) XINE_PROTECTED;
-/* x1 and y1 specifies the upper left corner of the text to be rendered */
-void xine_osd_draw_text (xine_osd_t *self, int x1, int y1,
- const char *text, int color_base) XINE_PROTECTED;
-void xine_osd_draw_bitmap (xine_osd_t *self, uint8_t *bitmap,
- int x1, int y1, int width, int height,
- uint8_t *palette_map) XINE_PROTECTED;
-/* for freetype2 fonts the height is the maximum height for the whole font and not
- * only for the specified text */
-void xine_osd_get_text_size (xine_osd_t *self, const char *text,
- int *width, int *height) XINE_PROTECTED;
-/* with freetype2 support compiled in, you can also specify a font file
- as 'fontname' here */
-int xine_osd_set_font (xine_osd_t *self, const char *fontname,
- int size) XINE_PROTECTED;
-/*
- * specifying encoding of texts
- * "" ... means current locale encoding (default)
- * NULL ... means latin1
- */
-void xine_osd_set_encoding(xine_osd_t *self, const char *encoding) XINE_PROTECTED;
-/* set position were overlay will be blended */
-void xine_osd_set_position (xine_osd_t *self, int x, int y) XINE_PROTECTED;
-void xine_osd_show (xine_osd_t *self, int64_t vpts) XINE_PROTECTED;
-void xine_osd_show_unscaled (xine_osd_t *self, int64_t vpts) XINE_PROTECTED;
-void xine_osd_hide (xine_osd_t *self, int64_t vpts) XINE_PROTECTED;
-/* empty drawing area */
-void xine_osd_clear (xine_osd_t *self) XINE_PROTECTED;
-/*
- * set on existing text palette
- * (-1 to set used specified palette)
- *
- * color_base specifies the first color index to use for this text
- * palette. The OSD palette is then modified starting at this
- * color index, up to the size of the text palette.
- *
- * Use OSD_TEXT1, OSD_TEXT2, ... for some preassigned color indices.
- *
- * These palettes are not working well with the true type fonts.
- * First thing is that these fonts cannot have a border. So you get
- * the best results by loading a linearly blending palette from the
- * background (at index 0) to the forground color (at index 10).
- */
-void xine_osd_set_text_palette (xine_osd_t *self,
- int palette_number,
- int color_base ) XINE_PROTECTED;
-/* get palette (color and transparency) */
-void xine_osd_get_palette (xine_osd_t *self, uint32_t *color,
- uint8_t *trans) XINE_PROTECTED;
-void xine_osd_set_palette (xine_osd_t *self,
- const uint32_t *const color,
- const uint8_t *const trans ) XINE_PROTECTED;
-/*
- * close osd rendering engine
- * loaded fonts are unloaded
- * osd objects are closed
- */
-void xine_osd_free (xine_osd_t *self) XINE_PROTECTED;
-
-
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
-
-/*********************************************************************
- * TV-mode API, to make it possible to use nvtvd to view movies *
- *********************************************************************/
-
-/* These functions are just dummies to maintain API compatibility.
- * You should use libnvtvsimple in your frontend instead. */
-
-typedef enum {
- XINE_TVSYSTEM_PAL = 0,
- XINE_TVSYSTEM_NTSC
-} xine_tvsystem XINE_DEPRECATED;
-
-/* connect to nvtvd server and save current TV and X settings */
-int xine_tvmode_init (xine_t *self) XINE_PROTECTED XINE_DEPRECATED;
-
-/* Turn tvmode on/off (1/0)*/
-int xine_tvmode_use(xine_t *self, int use_tvmode) XINE_PROTECTED XINE_DEPRECATED;
-
-/* Set which tv system to use: XINE_TVSYSTEM_PAL or XINE_TVSYSTEM_NTSC */
-void xine_tvmode_set_tvsystem(xine_t *self, xine_tvsystem system) XINE_PROTECTED XINE_DEPRECATED;
-
-/* try to change TV state if enabled
- * type select 'regular' (0) or 'TV' (1) state
- * width frame width the mode should match best or 0 if unknown
- * height frame height the mode should match best or 0 if unknown
- * fps frame rate the mode should match best or 0 if unknown
- * returns: finally selected state
- */
-int xine_tvmode_switch (xine_t *self, int type, int width, int height, double fps) XINE_PROTECTED XINE_DEPRECATED;
-
-/* adapt (maximum) output size to visible area if necessary and return pixel
- * aspect and real frame rate if available
- */
-void xine_tvmode_size (xine_t *self, int *width, int *height,
- double *pixelratio, double *fps) XINE_PROTECTED XINE_DEPRECATED;
-
-/* restore old TV and X settings and close nvtvd connection */
-void xine_tvmode_exit (xine_t *self) XINE_PROTECTED XINE_DEPRECATED;
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/include/xine/alphablend.h b/include/xine/alphablend.h
new file mode 100644
index 000000000..6df5ad809
--- /dev/null
+++ b/include/xine/alphablend.h
@@ -0,0 +1,112 @@
+/*
+ *
+ * Copyright (C) 2000 Thomas Mirlacher
+ *
+ * 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, USA.
+ *
+ * The author may be reached as <dent@linuxvideo.org>
+ *
+ *------------------------------------------------------------
+ *
+ */
+
+#ifndef __ALPHABLEND_H__
+#define __ALPHABLEND_H__
+
+#include "video_out.h"
+
+typedef struct {
+ void *buffer;
+ int buffer_size;
+
+ int disable_exact_blending;
+
+ int offset_x, offset_y;
+} alphablend_t;
+
+void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED;
+void _x_alphablend_free(alphablend_t *extra_data) XINE_PROTECTED;
+
+typedef struct { /* CLUT == Color LookUp Table */
+ uint8_t cb;
+ uint8_t cr;
+ uint8_t y;
+ uint8_t foo;
+} XINE_PACKED clut_t;
+
+#define XX44_PALETTE_SIZE 32
+
+typedef struct {
+ unsigned size;
+ unsigned max_used;
+ uint32_t cluts[XX44_PALETTE_SIZE];
+ /* cache palette entries for both colors and hili_colors */
+ int lookup_cache[OVL_PALETTE_SIZE*2];
+} xx44_palette_t;
+
+
+void _x_blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl,
+ int img_width, int img_height,
+ int dst_width, int dst_height,
+ alphablend_t *extra_data) XINE_PROTECTED;
+
+void _x_blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl,
+ int img_width, int img_height,
+ int dst_width, int dst_height,
+ alphablend_t *extra_data) XINE_PROTECTED;
+
+void _x_blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
+ int img_width, int img_height,
+ int dst_width, int dst_height,
+ alphablend_t *extra_data) XINE_PROTECTED;
+
+void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl,
+ int dst_width, int dst_height, int dst_pitches[3],
+ alphablend_t *extra_data) XINE_PROTECTED;
+
+void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl,
+ int dst_width, int dst_height, int dst_pitch,
+ alphablend_t *extra_data) XINE_PROTECTED;
+
+/*
+ * This function isn't too smart about blending. We want to avoid creating new
+ * colors in the palette as a result from two non-zero colors needed to be
+ * blended. Instead we choose the color with the highest alpha value to be
+ * visible. Some parts of the code taken from the "VeXP" project.
+ */
+
+void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl,
+ int dst_width, int dst_height, int dst_pitch,
+ alphablend_t *extra_data,
+ xx44_palette_t *palette,int ia44) XINE_PROTECTED;
+
+/*
+ * Functions to handle the xine-specific palette.
+ */
+
+void _x_clear_xx44_palette(xx44_palette_t *p) XINE_PROTECTED;
+void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries) XINE_PROTECTED;
+void _x_dispose_xx44_palette(xx44_palette_t *p) XINE_PROTECTED;
+
+/*
+ * Convert the xine-specific palette to something useful.
+ */
+
+void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette,
+ unsigned first_xx44_entry, unsigned num_xx44_entries,
+ unsigned num_xvmc_components, char *xvmc_components) XINE_PROTECTED;
+
+
+#endif
diff --git a/src/xine-utils/array.h b/include/xine/array.h
index cd0780e04..cd0780e04 100644
--- a/src/xine-utils/array.h
+++ b/include/xine/array.h
diff --git a/src/xine-utils/attributes.h b/include/xine/attributes.h
index 2326dab18..2326dab18 100644
--- a/src/xine-utils/attributes.h
+++ b/include/xine/attributes.h
diff --git a/include/xine/audio_decoder.h b/include/xine/audio_decoder.h
new file mode 100644
index 000000000..a37967ea6
--- /dev/null
+++ b/include/xine/audio_decoder.h
@@ -0,0 +1,113 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine audio decoder plugin interface
+ */
+
+#ifndef HAVE_AUDIO_DECODER_H
+#define HAVE_AUDIO_DECODER_H
+
+#include <xine/os_types.h>
+#include <xine/buffer.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define AUDIO_DECODER_IFACE_VERSION 16
+
+/*
+ * generic xine audio decoder plugin interface
+ */
+
+typedef struct audio_decoder_class_s audio_decoder_class_t;
+typedef struct audio_decoder_s audio_decoder_t;
+
+struct audio_decoder_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ audio_decoder_t* (*open_plugin) (audio_decoder_class_t *this, xine_stream_t *stream);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * free all class-related resources
+ */
+
+ void (*dispose) (audio_decoder_class_t *this);
+};
+
+#define default_audio_decoder_class_dispose (void (*) (audio_decoder_class_t *this))free
+
+struct audio_decoder_s {
+
+ /*
+ * decode data from buf and feed decoded samples to
+ * audio output
+ */
+ void (*decode_data) (audio_decoder_t *this, buf_element_t *buf);
+
+ /*
+ * reset decoder after engine flush (prepare for new
+ * audio data not related to recently decoded data)
+ */
+ void (*reset) (audio_decoder_t *this);
+
+ /*
+ * inform decoder that a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
+ void (*discontinuity) (audio_decoder_t *this);
+
+ /*
+ * close down, free all resources
+ */
+ void (*dispose) (audio_decoder_t *this);
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+};
+
+#endif
diff --git a/include/xine/audio_out.h b/include/xine/audio_out.h
new file mode 100644
index 000000000..dd7d16a0d
--- /dev/null
+++ b/include/xine/audio_out.h
@@ -0,0 +1,360 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+#ifndef HAVE_AUDIO_OUT_H
+#define HAVE_AUDIO_OUT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <xine/os_types.h>
+#include <xine/metronom.h>
+#include <xine/configfile.h>
+#include <xine/xineutils.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define AUDIO_OUT_IFACE_VERSION 9
+
+/*
+ * ao_driver_s contains the driver every audio output
+ * driver plugin has to implement.
+ */
+
+typedef struct ao_driver_s ao_driver_t;
+
+struct ao_driver_s {
+
+ /*
+ *
+ * find out what output modes + capatilities are supported by
+ * this plugin (constants for the bit vector to return see above)
+ *
+ * See AO_CAP_* bellow.
+ */
+ uint32_t (*get_capabilities) (ao_driver_t *);
+
+ /*
+ * open the driver and make it ready to receive audio data
+ * buffers may be flushed(!)
+ *
+ * return value: 0 : failure, >0 : output sample rate
+ */
+ int (*open)(ao_driver_t *, uint32_t bits, uint32_t rate, int mode);
+
+ /* return the number of audio channels
+ */
+ int (*num_channels)(ao_driver_t *self_gen);
+
+ /* return the number of bytes per frame.
+ * A frame is equivalent to one sample being output on every audio channel.
+ */
+ int (*bytes_per_frame)(ao_driver_t *self_gen);
+
+ /* return the delay is frames measured by
+ * looking at pending samples in the audio output device
+ */
+ int (*delay)(ao_driver_t *self_gen);
+
+ /*
+ * return gap tolerance (in pts) needed for this driver
+ */
+ int (*get_gap_tolerance) (ao_driver_t *self_gen);
+
+ /*
+ * write audio data to audio output device
+ * return value:
+ * >0 => audio samples were processed ok
+ * 0 => audio samples were not yet processed,
+ * call write_audio_data with the _same_ samples again
+ */
+ int (*write)(ao_driver_t *,
+ int16_t* audio_data, uint32_t num_samples);
+
+ /*
+ * this is called when the decoder no longer uses the audio
+ * output driver - the driver should get ready to get opened() again
+ */
+ void (*close)(ao_driver_t *);
+
+ /*
+ * shut down this audio output driver plugin and
+ * free all resources allocated
+ */
+ void (*exit) (ao_driver_t *);
+
+ /*
+ * Get, Set a property of audio driver.
+ *
+ * get_property() return 1 in success, 0 on failure.
+ * set_property() return value on success, ~value on failure.
+ *
+ * See AO_PROP_* below for available properties.
+ */
+ int (*get_property) (ao_driver_t *, int property);
+
+ int (*set_property) (ao_driver_t *, int property, int value);
+
+
+ /*
+ * misc control operations on the audio device.
+ *
+ * See AO_CTRL_* below.
+ */
+ int (*control) (ao_driver_t *, int cmd, /* arg */ ...);
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+};
+
+typedef struct ao_format_s ao_format_t;
+
+struct ao_format_s {
+ uint32_t bits;
+ uint32_t rate;
+ int mode;
+};
+
+typedef struct audio_fifo_s audio_fifo_t;
+
+typedef struct audio_buffer_s audio_buffer_t;
+
+struct audio_buffer_s {
+
+ audio_buffer_t *next;
+
+ int16_t *mem;
+ int mem_size;
+ int num_frames;
+
+ int64_t vpts;
+ uint32_t frame_header_count;
+ uint32_t first_access_unit;
+
+ /* extra info coming from input or demuxers */
+ extra_info_t *extra_info;
+
+ xine_stream_t *stream; /* stream that send that buffer */
+
+ ao_format_t format; /* let each buffer carry it's own format info */
+};
+
+/*
+ * xine_audio_port_s contains the port every audio decoder talks to
+ *
+ * Remember that adding new functions to this structure requires
+ * adaption of the post plugin decoration layer. Be sure to look into
+ * src/xine-engine/post.[ch].
+ */
+
+struct xine_audio_port_s {
+ uint32_t (*get_capabilities) (xine_audio_port_t *); /* for constants see below */
+
+ /* * Get/Set audio property
+ *
+ * See AO_PROP_* bellow
+ */
+ int (*get_property) (xine_audio_port_t *, int property);
+ int (*set_property) (xine_audio_port_t *, int property, int value);
+
+ /* open audio driver for audio output
+ * return value: 0:failure, >0:output sample rate
+ */
+ /* when you are not a full-blown stream, but still need to open the port
+ * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
+ int (*open) (xine_audio_port_t *, xine_stream_t *stream,
+ uint32_t bits, uint32_t rate, int mode);
+
+ /*
+ * get a piece of memory for audio data
+ */
+ audio_buffer_t * (*get_buffer) (xine_audio_port_t *);
+
+ /*
+ * append a buffer filled with audio data to the audio fifo
+ * for output
+ */
+ /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */
+ void (*put_buffer) (xine_audio_port_t *, audio_buffer_t *buf, xine_stream_t *stream);
+
+ /* audio driver is no longer used by decoder => close */
+ /* when you are not a full-blown stream, but still need to close the port
+ * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
+ void (*close) (xine_audio_port_t *self, xine_stream_t *stream);
+
+ /* called on xine exit */
+ void (*exit) (xine_audio_port_t *);
+
+ /*
+ * misc control operations on the audio device.
+ *
+ * See AO_CTRL_* below.
+ */
+ int (*control) (xine_audio_port_t *, int cmd, /* arg */ ...);
+
+ /*
+ * Flush audio_out fifo.
+ */
+ void (*flush) (xine_audio_port_t *);
+
+ /*
+ * Check if port is opened for this stream and get parameters.
+ * The stream can be anonymous.
+ */
+ int (*status) (xine_audio_port_t *, xine_stream_t *stream,
+ uint32_t *bits, uint32_t *rate, int *mode);
+
+};
+
+typedef struct audio_driver_class_s audio_driver_class_t;
+
+struct audio_driver_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ ao_driver_t* (*open_plugin) (audio_driver_class_t *, const void *data);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * free all class-related resources
+ */
+
+ void (*dispose) (audio_driver_class_t *);
+};
+
+#define default_audio_driver_class_dispose (void (*) (audio_driver_class_t *this))free
+
+/**
+ * @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_MALLOC;
+
+/*
+ * audio output modes + capabilities
+ */
+
+#define AO_CAP_NOCAP 0x00000000 /* driver has no capabilities */
+#define AO_CAP_MODE_A52 0x00000001 /* driver supports A/52 output */
+#define AO_CAP_MODE_AC5 0x00000002 /* driver supports AC5 output */
+/* 1 sample == 2 bytes (C) */
+#define AO_CAP_MODE_MONO 0x00000004 /* driver supports mono output */
+/* 1 sample == 4 bytes (L,R) */
+#define AO_CAP_MODE_STEREO 0x00000008 /* driver supports stereo output */
+/* 1 sample == 8 bytes (L,R,LR,RR) */
+#define AO_CAP_MODE_4CHANNEL 0x00000010 /* driver supports 4 channels */
+/*
+ * Sound cards generally support, 1,2,4,6 channels, but rarely 5.
+ * So xine will take 4.1, 5 and 6 channel a52 streams and
+ * down or upmix it correctly to fill the 6 output channels.
+ * Are there any requests for 2.1 out there?
+ */
+/* 1 sample == 12 bytes (L,R,LR,RR,Null,LFE) */
+#define AO_CAP_MODE_4_1CHANNEL 0x00000020 /* driver supports 4.1 channels */
+/* 1 sample == 12 bytes (L,R,LR,RR,C, Null) */
+#define AO_CAP_MODE_5CHANNEL 0x00000040 /* driver supports 5 channels */
+/* 1 sample == 12 bytes (L,R,LR,RR,C,LFE) */
+#define AO_CAP_MODE_5_1CHANNEL 0x00000080 /* driver supports 5.1 channels */
+
+/*
+ * converts the audio output mode into the number of channels
+ */
+int _x_ao_mode2channels( int mode ) XINE_PROTECTED;
+/*
+ * converts the number of channels into the audio output mode
+ */
+int _x_ao_channels2mode( int channels ) XINE_PROTECTED;
+
+#define AO_CAP_MIXER_VOL 0x00000100 /* driver supports mixer control */
+#define AO_CAP_PCM_VOL 0x00000200 /* driver supports pcm control */
+#define AO_CAP_MUTE_VOL 0x00000400 /* driver can mute volume */
+#define AO_CAP_8BITS 0x00000800 /* driver support 8-bit samples */
+#define AO_CAP_16BITS 0x00001000 /* driver support 16-bit samples */
+#define AO_CAP_24BITS 0x00002000 /* driver support 24-bit samples */
+#define AO_CAP_FLOAT32 0x00004000 /* driver support 32-bit samples. i.e. Floats */
+
+/* properties supported by get/set_property() */
+#define AO_PROP_MIXER_VOL 0
+#define AO_PROP_PCM_VOL 1
+#define AO_PROP_MUTE_VOL 2
+#define AO_PROP_COMPRESSOR 3
+#define AO_PROP_DISCARD_BUFFERS 4
+#define AO_PROP_BUFS_IN_FIFO 5 /* read-only */
+#define AO_PROP_AMP 6 /* amplifier */
+#define AO_PROP_EQ_30HZ 7 /* equalizer */
+#define AO_PROP_EQ_60HZ 8 /* equalizer */
+#define AO_PROP_EQ_125HZ 9 /* equalizer */
+#define AO_PROP_EQ_250HZ 10 /* equalizer */
+#define AO_PROP_EQ_500HZ 11 /* equalizer */
+#define AO_PROP_EQ_1000HZ 12 /* equalizer */
+#define AO_PROP_EQ_2000HZ 13 /* equalizer */
+#define AO_PROP_EQ_4000HZ 14 /* equalizer */
+#define AO_PROP_EQ_8000HZ 15 /* equalizer */
+#define AO_PROP_EQ_16000HZ 16 /* equalizer */
+#define AO_PROP_CLOSE_DEVICE 17 /* force closing audio device */
+#define AO_PROP_AMP_MUTE 18 /* amplifier mute */
+#define AO_PROP_NUM_STREAMS 19 /* read-only */
+#define AO_PROP_CLOCK_SPEED 20 /* inform audio_out that speed has changed */
+#define AO_PROP_BUFS_TOTAL 21 /* read-only */
+#define AO_PROP_BUFS_FREE 22 /* read-only */
+#define AO_NUM_PROPERTIES 23
+
+/* audio device control ops */
+#define AO_CTRL_PLAY_PAUSE 0
+#define AO_CTRL_PLAY_RESUME 1
+#define AO_CTRL_FLUSH_BUFFERS 2
+
+/* above that value audio frames are discarded */
+#define AO_MAX_GAP 15000
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/xine-engine/broadcaster.h b/include/xine/broadcaster.h
index 0cd416cac..0cd416cac 100644
--- a/src/xine-engine/broadcaster.h
+++ b/include/xine/broadcaster.h
diff --git a/include/xine/buffer.h b/include/xine/buffer.h
new file mode 100644
index 000000000..cab9c8250
--- /dev/null
+++ b/include/xine/buffer.h
@@ -0,0 +1,734 @@
+/*
+ * Copyright (C) 2000-2008 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, USA
+ *
+ *
+ * contents:
+ *
+ * buffer_entry structure - serves as a transport encapsulation
+ * of the mpeg audio/video data through xine
+ *
+ * free buffer pool management routines
+ *
+ * FIFO buffer structures/routines
+ */
+
+#ifndef HAVE_BUFFER_H
+#define HAVE_BUFFER_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <string.h>
+#include <stdio.h>
+#include <pthread.h>
+#include <sys/types.h>
+
+#include <xine/os_types.h>
+#include <xine/attributes.h>
+
+#define BUF_MAX_CALLBACKS 5
+
+/**
+ * @defgroup buffer_types Buffer Types
+ *
+ * a buffer type ID describes the contents of a buffer
+ * it consists of three fields:
+ *
+ * buf_type = 0xMMDDCCCC
+ *
+ * MM : major buffer type (CONTROL, VIDEO, AUDIO, SPU)
+ * 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
+
+/**
+ * @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_NOP 0x01040000
+#define BUF_CONTROL_AUDIO_CHANNEL 0x01050000
+#define BUF_CONTROL_SPU_CHANNEL 0x01060000
+#define BUF_CONTROL_NEWPTS 0x01070000
+#define BUF_CONTROL_RESET_DECODER 0x01080000
+#define BUF_CONTROL_HEADERS_DONE 0x01090000
+#define BUF_CONTROL_FLUSH_DECODER 0x010a0000
+#define BUF_CONTROL_RESET_TRACK_MAP 0x010b0000
+/*@}*/
+
+/**
+ * @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_MPEG 0x02000000
+#define BUF_VIDEO_MPEG4 0x02010000
+#define BUF_VIDEO_CINEPAK 0x02020000
+#define BUF_VIDEO_SORENSON_V1 0x02030000
+#define BUF_VIDEO_MSMPEG4_V2 0x02040000
+#define BUF_VIDEO_MSMPEG4_V3 0x02050000
+#define BUF_VIDEO_MJPEG 0x02060000
+#define BUF_VIDEO_IV50 0x02070000
+#define BUF_VIDEO_IV41 0x02080000
+#define BUF_VIDEO_IV32 0x02090000
+#define BUF_VIDEO_IV31 0x020a0000
+#define BUF_VIDEO_ATIVCR1 0x020b0000
+#define BUF_VIDEO_ATIVCR2 0x020c0000
+#define BUF_VIDEO_I263 0x020d0000
+#define BUF_VIDEO_RV10 0x020e0000
+#define BUF_VIDEO_RGB 0x02100000
+#define BUF_VIDEO_YUY2 0x02110000
+#define BUF_VIDEO_JPEG 0x02120000
+#define BUF_VIDEO_WMV7 0x02130000
+#define BUF_VIDEO_WMV8 0x02140000
+#define BUF_VIDEO_MSVC 0x02150000
+#define BUF_VIDEO_DV 0x02160000
+#define BUF_VIDEO_REAL 0x02170000
+#define BUF_VIDEO_VP31 0x02180000
+#define BUF_VIDEO_H263 0x02190000
+#define BUF_VIDEO_3IVX 0x021A0000
+#define BUF_VIDEO_CYUV 0x021B0000
+#define BUF_VIDEO_DIVX5 0x021C0000
+#define BUF_VIDEO_XVID 0x021D0000
+#define BUF_VIDEO_SMC 0x021E0000
+#define BUF_VIDEO_RPZA 0x021F0000
+#define BUF_VIDEO_QTRLE 0x02200000
+#define BUF_VIDEO_MSRLE 0x02210000
+#define BUF_VIDEO_DUCKTM1 0x02220000
+#define BUF_VIDEO_FLI 0x02230000
+#define BUF_VIDEO_ROQ 0x02240000
+#define BUF_VIDEO_SORENSON_V3 0x02250000
+#define BUF_VIDEO_MSMPEG4_V1 0x02260000
+#define BUF_VIDEO_MSS1 0x02270000
+#define BUF_VIDEO_IDCIN 0x02280000
+#define BUF_VIDEO_PGVV 0x02290000
+#define BUF_VIDEO_ZYGO 0x022A0000
+#define BUF_VIDEO_TSCC 0x022B0000
+#define BUF_VIDEO_YVU9 0x022C0000
+#define BUF_VIDEO_VQA 0x022D0000
+#define BUF_VIDEO_GREY 0x022E0000
+#define BUF_VIDEO_XXAN 0x022F0000
+#define BUF_VIDEO_WC3 0x02300000
+#define BUF_VIDEO_YV12 0x02310000
+#define BUF_VIDEO_SEGA 0x02320000
+#define BUF_VIDEO_RV20 0x02330000
+#define BUF_VIDEO_RV30 0x02340000
+#define BUF_VIDEO_MVI2 0x02350000
+#define BUF_VIDEO_UCOD 0x02360000
+#define BUF_VIDEO_WMV9 0x02370000
+#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_HUFFYUV 0x023C0000
+#define BUF_VIDEO_IMAGE 0x023D0000
+#define BUF_VIDEO_THEORA 0x023E0000
+#define BUF_VIDEO_4XM 0x023F0000
+#define BUF_VIDEO_I420 0x02400000
+#define BUF_VIDEO_VP4 0x02410000
+#define BUF_VIDEO_VP5 0x02420000
+#define BUF_VIDEO_VP6 0x02430000
+#define BUF_VIDEO_VMD 0x02440000
+#define BUF_VIDEO_MSZH 0x02450000
+#define BUF_VIDEO_ZLIB 0x02460000
+#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_FLV1 0x024C0000
+#define BUF_VIDEO_H264 0x024D0000
+#define BUF_VIDEO_MJPEG_B 0x024E0000
+#define BUF_VIDEO_H261 0x024F0000
+#define BUF_VIDEO_AASC 0x02500000
+#define BUF_VIDEO_LOCO 0x02510000
+#define BUF_VIDEO_QDRW 0x02520000
+#define BUF_VIDEO_QPEG 0x02530000
+#define BUF_VIDEO_ULTI 0x02540000
+#define BUF_VIDEO_WNV1 0x02550000
+#define BUF_VIDEO_XL 0x02560000
+#define BUF_VIDEO_RT21 0x02570000
+#define BUF_VIDEO_FPS1 0x02580000
+#define BUF_VIDEO_DUCKTM2 0x02590000
+#define BUF_VIDEO_CSCD 0x025A0000
+#define BUF_VIDEO_ALGMM 0x025B0000
+#define BUF_VIDEO_ZMBV 0x025C0000
+#define BUF_VIDEO_AVS 0x025D0000
+#define BUF_VIDEO_SMACKER 0x025E0000
+#define BUF_VIDEO_NUV 0x025F0000
+#define BUF_VIDEO_KMVC 0x02600000
+#define BUF_VIDEO_FLASHSV 0x02610000
+#define BUF_VIDEO_CAVS 0x02620000
+#define BUF_VIDEO_VP6F 0x02630000
+#define BUF_VIDEO_THEORA_RAW 0x02640000
+#define BUF_VIDEO_VC1 0x02650000
+#define BUF_VIDEO_VMNC 0x02660000
+#define BUF_VIDEO_SNOW 0x02670000
+#define BUF_VIDEO_VP8 0x02680000
+/*@}*/
+
+/**
+ * @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_A52 0x03000000
+#define BUF_AUDIO_MPEG 0x03010000
+#define BUF_AUDIO_LPCM_BE 0x03020000
+#define BUF_AUDIO_LPCM_LE 0x03030000
+#define BUF_AUDIO_WMAV1 0x03040000
+#define BUF_AUDIO_DTS 0x03050000
+#define BUF_AUDIO_MSADPCM 0x03060000
+#define BUF_AUDIO_MSIMAADPCM 0x03070000
+#define BUF_AUDIO_MSGSM 0x03080000
+#define BUF_AUDIO_VORBIS 0x03090000
+#define BUF_AUDIO_IMC 0x030a0000
+#define BUF_AUDIO_LH 0x030b0000
+#define BUF_AUDIO_VOXWARE 0x030c0000
+#define BUF_AUDIO_ACELPNET 0x030d0000
+#define BUF_AUDIO_AAC 0x030e0000
+#define BUF_AUDIO_DNET 0x030f0000
+#define BUF_AUDIO_VIVOG723 0x03100000
+#define BUF_AUDIO_DK3ADPCM 0x03110000
+#define BUF_AUDIO_DK4ADPCM 0x03120000
+#define BUF_AUDIO_ROQ 0x03130000
+#define BUF_AUDIO_QTIMAADPCM 0x03140000
+#define BUF_AUDIO_MAC3 0x03150000
+#define BUF_AUDIO_MAC6 0x03160000
+#define BUF_AUDIO_QDESIGN1 0x03170000
+#define BUF_AUDIO_QDESIGN2 0x03180000
+#define BUF_AUDIO_QCLP 0x03190000
+#define BUF_AUDIO_SMJPEG_IMA 0x031A0000
+#define BUF_AUDIO_VQA_IMA 0x031B0000
+#define BUF_AUDIO_MULAW 0x031C0000
+#define BUF_AUDIO_ALAW 0x031D0000
+#define BUF_AUDIO_GSM610 0x031E0000
+#define BUF_AUDIO_EA_ADPCM 0x031F0000
+#define BUF_AUDIO_WMAV2 0x03200000
+#define BUF_AUDIO_COOK 0x03210000
+#define BUF_AUDIO_ATRK 0x03220000
+#define BUF_AUDIO_14_4 0x03230000
+#define BUF_AUDIO_28_8 0x03240000
+#define BUF_AUDIO_SIPRO 0x03250000
+#define BUF_AUDIO_WMAPRO 0x03260000
+#define BUF_AUDIO_WMAV3 BUF_AUDIO_WMAPRO
+#define BUF_AUDIO_INTERPLAY 0x03270000
+#define BUF_AUDIO_XA_ADPCM 0x03280000
+#define BUF_AUDIO_WESTWOOD 0x03290000
+#define BUF_AUDIO_DIALOGIC_IMA 0x032A0000
+#define BUF_AUDIO_NSF 0x032B0000
+#define BUF_AUDIO_FLAC 0x032C0000
+#define BUF_AUDIO_DV 0x032D0000
+#define BUF_AUDIO_WMAV 0x032E0000
+#define BUF_AUDIO_SPEEX 0x032F0000
+#define BUF_AUDIO_RAWPCM 0x03300000
+#define BUF_AUDIO_4X_ADPCM 0x03310000
+#define BUF_AUDIO_VMD 0x03320000
+#define BUF_AUDIO_XAN_DPCM 0x03330000
+#define BUF_AUDIO_ALAC 0x03340000
+#define BUF_AUDIO_MPC 0x03350000
+#define BUF_AUDIO_SHORTEN 0x03360000
+#define BUF_AUDIO_WESTWOOD_SND1 0x03370000
+#define BUF_AUDIO_WMALL 0x03380000
+#define BUF_AUDIO_TRUESPEECH 0x03390000
+#define BUF_AUDIO_TTA 0x033A0000
+#define BUF_AUDIO_SMACKER 0x033B0000
+#define BUF_AUDIO_FLVADPCM 0x033C0000
+#define BUF_AUDIO_WAVPACK 0x033D0000
+#define BUF_AUDIO_MP3ADU 0x033E0000
+#define BUF_AUDIO_AMR_NB 0x033F0000
+#define BUF_AUDIO_AMR_WB 0x03400000
+#define BUF_AUDIO_EAC3 0x03410000
+#define BUF_AUDIO_AAC_LATM 0x03420000
+/*@}*/
+
+/**
+ * @defgroup buffer_spu SPU buffer types
+ */
+/*@{*/
+#define BUF_SPU_BASE 0x04000000
+#define BUF_SPU_DVD 0x04000000
+#define BUF_SPU_TEXT 0x04010000
+#define BUF_SPU_CC 0x04020000
+#define BUF_SPU_DVB 0x04030000
+#define BUF_SPU_SVCD 0x04040000
+#define BUF_SPU_CVD 0x04050000
+#define BUF_SPU_OGM 0x04060000
+#define BUF_SPU_CMML 0x04070000
+#define BUF_SPU_HDMV 0x04080000
+/*@}*/
+
+/**
+ * @defgroup buffer_demux Demuxer block types
+ */
+/*@{*/
+#define BUF_DEMUX_BLOCK 0x05000000
+/*@}*/
+
+/*@}*/
+
+typedef struct extra_info_s extra_info_t;
+
+/**
+ * @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 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 */
+};
+
+
+#define BUF_NUM_DEC_INFO 5
+
+typedef struct buf_element_s buf_element_t;
+struct buf_element_s {
+ buf_element_t *next;
+
+ unsigned char *mem;
+ 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" */
+ 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 */
+
+ uint32_t decoder_flags; /**< stuff like keyframe, is_header ... see below */
+
+ /** additional decoder flags and other dec-spec. stuff */
+ uint32_t decoder_info[BUF_NUM_DEC_INFO];
+ /** 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 */
+
+ uint32_t type;
+} ;
+
+/** 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 */
+#define BUF_FLAG_FRAME_START 0x0002
+#define BUF_FLAG_FRAME_END 0x0004
+
+/** 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
+ * 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 */
+#define BUF_FLAG_END_USER 0x0020
+
+/** set when stream finished naturaly */
+#define BUF_FLAG_END_STREAM 0x0040
+
+/** decoder_info[0] carries the frame step (1/90000). */
+#define BUF_FLAG_FRAMERATE 0x0080
+
+/** hint to metronom that seeking has occurred */
+#define BUF_FLAG_SEEK 0x0100
+
+/** special information inside, see below. */
+#define BUF_FLAG_SPECIAL 0x0200
+
+/** 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[2] carries denominator for display aspect ratio */
+#define BUF_FLAG_ASPECT 0x0800
+
+/* represent the state of gapless_switch at the time buf was enqueued */
+#define BUF_FLAG_GAPLESS_SW 0x1000
+
+/* Amount of audio padding added by encoder (mp3, aac). These empty
+ * audio frames are causing a gap when switching between mp3 files.
+ * decoder_info[1] carries amount of audio frames padded at the
+ * beginning of the buffer
+ * decoder_info[2] carries amount of audio frames padded at the end of
+ * the buffer */
+#define BUF_FLAG_AUDIO_PADDING 0x2000
+
+/**
+ * \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
+ * offers a way to communicate this or any other custom, format-specific
+ * data to the decoder.
+ *
+ * The interface was designed in a way that did not require an API
+ * version bump. To send a special buffer type, set a buffer's flags field
+ * to BUF_FLAG_SPECIAL. Set the buffer's decoder_info[1] field to a
+ * number according to one of the special buffer subtypes defined below.
+ * The second and third decoder_info[] fields are defined according to
+ * your buffer type's requirements.
+ *
+ * Finally, remember to set the buffer's size to 0. This way, if a special
+ * buffer is sent to a decode that does not know how to handle it, the
+ * buffer will fall through to the case where the buffer's data content
+ * is accumulated and no harm will be done.
+ */
+/*@{*/
+
+/**
+ * In a BUF_SPECIAL_PALETTE buffer:
+ * decoder_info[1] = BUF_SPECIAL_PALETTE
+ * decoder_info[2] = number of entries in palette table
+ * decoder_info_ptr[2] = pointer to palette table
+ * This buffer type is used to provide a file- and decoder-independent
+ * facility to transport RGB color palettes from demuxers to decoders.
+ * A palette table is an array of palette_entry_t structures. A decoder
+ * should not count on this array to exist for the duration of the
+ * program's execution and should copy, manipulate, and store the palette
+ * data privately if it needs the palette information.
+ */
+#define BUF_SPECIAL_PALETTE 1
+
+
+/* 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
+ * decoder_info[3] = stream scale prohibitions
+ * This buffer is used to force mpeg decoders to use a certain aspect.
+ * Currently xine-dvdnav uses this, because it has more accurate information
+ * about the aspect from the dvd ifo-data.
+ * The stream scale prohibitions are also delivered, with bit 0 meaning
+ * "deny letterboxing" and bit 1 meaning "deny pan&scan"
+ */
+#define BUF_SPECIAL_ASPECT 3
+
+/**
+ * In a BUF_SPECIAL_DECODER_CONFIG buffer:
+ * decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG
+ * decoder_info[2] = data size
+ * decoder_info_ptr[2] = pointer to data
+ * This buffer is used to pass config information from .mp4 files
+ * (atom esds) to decoders. both mpeg4 and aac streams use that.
+ */
+#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
+ * four length bytes at the beginning
+ * decoder_info_ptr[2] = pointer to ImageDescription atom, starting with
+ * the codec fourcc
+ * Some Quicktime decoders need information contained within the
+ * ImageDescription atom inside a Quicktime file's stsd atom. This
+ * special buffer carries the ImageDescription atom from the QT demuxer
+ * to an A/V decoder.
+ */
+#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
+ * lpcm data encoded into mpeg2 streams have a format configuration
+ * byte in every frame. this is used to detect the sample rate,
+ * number of bits and channels.
+ */
+#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
+ * decoder_info_ptr[2] = pointer to charset encoding string
+ * This is used mostly with subtitle buffers when encoding is
+ * known at demuxer level (take precedence over xine config
+ * settings such as subtitles.separate.src_encoding)
+ */
+#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
+ * decoder_info[3] =
+ * This buffer is pass SPU subtypes from DVDs
+ */
+#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8
+
+
+#define SPU_DVD_SUBTYPE_CLUT 1
+#define SPU_DVD_SUBTYPE_PACKAGE 2
+#define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3
+#define SPU_DVD_SUBTYPE_NAV 4
+
+/**
+ * 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
+ * decoder_info[3] =
+ *
+ * This buffer is used to tell a DVBSUB decoder when the stream
+ * changes. For more information on how to write a DVBSUB decoder,
+ * see the comment at the top of src/demuxers/demux_ts.c
+ **/
+#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
+ * decoder_info_ptr[2] = pointer to the chunk table
+ *
+ * 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
+{
+ char lang[4];
+ long comp_page_id;
+ long aux_page_id;
+} ;
+
+typedef struct palette_entry_s palette_entry_t;
+struct palette_entry_s
+{
+ unsigned char r, g, b;
+} ;
+
+typedef struct fifo_buffer_s fifo_buffer_t;
+struct fifo_buffer_s
+{
+ buf_element_t *first, *last;
+
+ int fifo_size;
+ uint32_t fifo_data_size;
+ void *fifo_empty_cb_data;
+
+ pthread_mutex_t mutex;
+ pthread_cond_t not_empty;
+
+ /*
+ * functions to access this fifo:
+ */
+
+ void (*put) (fifo_buffer_t *fifo, buf_element_t *buf);
+
+ buf_element_t *(*get) (fifo_buffer_t *fifo);
+
+ void (*clear) (fifo_buffer_t *fifo) ;
+
+ int (*size) (fifo_buffer_t *fifo);
+
+ int (*num_free) (fifo_buffer_t *fifo);
+
+ uint32_t (*data_size) (fifo_buffer_t *fifo);
+
+ void (*dispose) (fifo_buffer_t *fifo);
+
+ /*
+ * alloc buffer for this fifo from global buf pool
+ * you don't have to use this function to allocate a buffer,
+ * an input plugin can decide to implement it's own
+ * buffer allocation functions
+ */
+
+ buf_element_t *(*buffer_pool_alloc) (fifo_buffer_t *self);
+
+
+ /*
+ * special functions, not used by demuxers
+ */
+
+ /* the same as buffer_pool_alloc but may fail if none is available */
+ buf_element_t *(*buffer_pool_try_alloc) (fifo_buffer_t *self);
+
+ /* the same as put but insert at the head of the fifo */
+ void (*insert) (fifo_buffer_t *fifo, buf_element_t *buf);
+
+ /* callbacks */
+ void (*register_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *), void *cb_data);
+ void (*register_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data);
+ void (*register_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data);
+ void (*unregister_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *));
+ void (*unregister_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *));
+ void (*unregister_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *));
+
+ /*
+ * private variables for buffer pool management
+ */
+ buf_element_t *buffer_pool_top; /* a stack actually */
+ pthread_mutex_t buffer_pool_mutex;
+ pthread_cond_t buffer_pool_cond_not_empty;
+ int buffer_pool_num_free;
+ int buffer_pool_capacity;
+ int buffer_pool_buf_size;
+ void *buffer_pool_base; /*used to free mem chunk */
+ void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *data_cb);
+ void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb);
+ void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb);
+ void *alloc_cb_data[BUF_MAX_CALLBACKS];
+ void *put_cb_data[BUF_MAX_CALLBACKS];
+ void *get_cb_data[BUF_MAX_CALLBACKS];
+} ;
+
+/**
+ * @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) XINE_MALLOC;
+
+/**
+ * @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) XINE_MALLOC;
+
+
+/**
+ * @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;
+
+/**
+ * @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;
+
+/**
+ * @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;
+
+/**
+ * @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;
+
+
+/**
+ * @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 XINE_PACKED {
+ int32_t biSize;
+ int32_t biWidth;
+ int32_t biHeight;
+ int16_t biPlanes;
+ int16_t biBitCount;
+ uint32_t biCompression;
+ int32_t biSizeImage;
+ int32_t biXPelsPerMeter;
+ int32_t biYPelsPerMeter;
+ int32_t biClrUsed;
+ int32_t biClrImportant;
+} xine_bmiheader;
+
+/**
+ * @brief xine version of WAVEFORMATEX.
+ * @note The same comments from xine_bmiheader applies.
+ */
+typedef struct XINE_PACKED {
+ int16_t wFormatTag;
+ int16_t nChannels;
+ int32_t nSamplesPerSec;
+ int32_t nAvgBytesPerSec;
+ int16_t nBlockAlign;
+ int16_t wBitsPerSample;
+ int16_t cbSize;
+} xine_waveformatex;
+
+/** Convert xine_bmiheader struct from little endian */
+void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED;
+
+/** Convert xine_waveformatex struct from little endian */
+void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED;
+
+static __inline int _x_is_fourcc(const void *ptr, const void *tag) {
+ return memcmp(ptr, tag, 4) == 0;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/src/xine-utils/compat.h b/include/xine/compat.h
index 0392b45fd..0392b45fd 100644
--- a/src/xine-utils/compat.h
+++ b/include/xine/compat.h
diff --git a/include/xine/configfile.h b/include/xine/configfile.h
new file mode 100644
index 000000000..a0b9ad1fe
--- /dev/null
+++ b/include/xine/configfile.h
@@ -0,0 +1,245 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * config file management
+ */
+
+#ifndef HAVE_CONFIGFILE_H
+#define HAVE_CONFIGFILE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <pthread.h>
+
+#include <xine.h>
+
+#define CONFIG_FILE_VERSION 2
+
+/**
+ * config entries above this experience
+ * level must never be changed from MRL
+ */
+#define XINE_CONFIG_SECURITY 30
+
+
+typedef struct cfg_entry_s cfg_entry_t;
+typedef struct config_values_s config_values_t;
+
+struct cfg_entry_s {
+ cfg_entry_t *next;
+ config_values_t *config;
+
+ char *key;
+ int type;
+
+ /** user experience level */
+ int exp_level;
+
+ /** type unknown */
+ char *unknown_value;
+
+ /** type string */
+ char *str_value;
+ char *str_default;
+
+ /** common to range, enum, num, bool: */
+ int num_value;
+ int num_default;
+
+ /** type range specific: */
+ int range_min;
+ int range_max;
+
+ /** type enum specific: */
+ char **enum_values;
+
+ /** help info for the user */
+ char *description;
+ char *help;
+
+ /** callback function and data for live changeable values */
+ xine_config_cb_t callback;
+ void *callback_data;
+};
+
+struct config_values_s {
+
+ /*
+ * register config values
+ *
+ * these functions return the current value of the
+ * registered item, i.e. the default value if it was
+ * not found in the config file or the current value
+ * from the config file otherwise
+ */
+
+ char* (*register_string) (config_values_t *self,
+ const char *key,
+ const char *def_value,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data);
+
+ char* (*register_filename) (config_values_t *self,
+ const char *key,
+ const char *def_value,
+ int req_type,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data);
+
+ int (*register_range) (config_values_t *self,
+ const char *key,
+ int def_value,
+ int min, int max,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data);
+
+ int (*register_enum) (config_values_t *self,
+ const char *key,
+ int def_value,
+ char **values,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data);
+
+ int (*register_num) (config_values_t *self,
+ const char *key,
+ int def_value,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data);
+
+ int (*register_bool) (config_values_t *self,
+ const char *key,
+ int def_value,
+ const char *description,
+ const char *help,
+ int exp_level,
+ xine_config_cb_t changed_cb,
+ void *cb_data);
+
+ void (*register_entry) (config_values_t *self, cfg_entry_t* entry);
+
+ /** 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 */
+ void (*update_string) (config_values_t *self, const char *key, const char *value);
+
+ /** small utility function for enum handling */
+ int (*parse_enum) (const char *str, const char **values);
+
+ /**
+ * @brief lookup config entries
+ *
+ * remember to call the changed_cb if it exists
+ * and you changed the value of this item
+ */
+
+ cfg_entry_t* (*lookup_entry) (config_values_t *self, const char *key);
+
+ /**
+ * unregister entry 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);
+
+ /**
+ * callback called when a new config entry is registered
+ */
+ void (*set_new_entry_callback) (config_values_t *self, xine_config_cb_t new_entry_cb, void *cb_data);
+
+ /**
+ * unregister the callback
+ */
+ void (*unset_new_entry_callback) (config_values_t *self);
+
+ /**
+ * serialize a config entry.
+ * return a base64 null terminated string.
+ */
+ char* (*get_serialized_entry) (config_values_t *self, const char *key);
+
+ /**
+ * deserialize a config entry.
+ * value is a base 64 encoded string
+ * return the key of the serialized entry
+ */
+ char* (*register_serialized_entry) (config_values_t *self, const char *value);
+
+ /**
+ * config values are stored here:
+ */
+ cfg_entry_t *first, *last, *cur;
+
+ /**
+ * new entry callback
+ */
+ xine_config_cb_t new_entry_cb;
+ void *new_entry_cbdata;
+
+ /**
+ * mutex for modification to the config
+ */
+ pthread_mutex_t config_lock;
+
+ /**
+ * current config file's version number
+ */
+ int current_version;
+};
+
+/**
+ * @brief allocate and init a new xine config object
+ * @internal
+ */
+config_values_t *_x_config_init (void) XINE_MALLOC;
+
+/**
+ * @brief interpret stream_setup part of mrls for config value changes
+ * @internal
+ */
+
+int _x_config_change_opt(config_values_t *config, const char *opt);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/include/xine/demux.h b/include/xine/demux.h
new file mode 100644
index 000000000..2803c30ed
--- /dev/null
+++ b/include/xine/demux.h
@@ -0,0 +1,227 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#ifndef HAVE_DEMUX_H
+#define HAVE_DEMUX_H
+
+#include <xine/input_plugin.h>
+#include <xine/buffer.h>
+#include <xine/xine_internal.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define DEMUXER_PLUGIN_IFACE_VERSION 27
+
+#define DEMUX_OK 0
+#define DEMUX_FINISHED 1
+
+#define DEMUX_CANNOT_HANDLE 0
+#define DEMUX_CAN_HANDLE 1
+
+#define METHOD_BY_CONTENT 1
+#define METHOD_BY_MRL 2
+#define METHOD_EXPLICIT 3
+
+typedef struct demux_class_s demux_class_t ;
+typedef struct demux_plugin_s demux_plugin_t;
+
+struct demux_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ demux_plugin_t* (*open_plugin) (demux_class_t *this, xine_stream_t *stream, input_plugin_t *input);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /**
+ * @brief MIME types supported for this plugin
+ */
+
+ const char* mimetypes;
+
+ /**
+ * @brief space separated list of file extensions this demuxer is
+ * likely to handle
+ *
+ * (will be used to filter media files in file selection dialogs)
+ */
+ const char* extensions;
+
+ /*
+ * close down, free all resources
+ */
+ void (*dispose) (demux_class_t *this);
+};
+
+#define default_demux_class_dispose (void (*) (demux_class_t *this))free
+
+/*
+ * any demux plugin must implement these functions
+ */
+
+struct demux_plugin_s {
+
+ /*
+ * send headers, followed by BUF_CONTROL_HEADERS_DONE down the
+ * fifos, then return. do not start demux thread (yet)
+ */
+
+ void (*send_headers) (demux_plugin_t *this);
+
+ /*
+ * ask demux to seek
+ *
+ * for seekable streams, a start position can be specified
+ *
+ * start_pos : position in input source (0..65535)
+ * this is defined as most convenient to demuxer, can be
+ * either time or offset based.
+ * start_time : position measured in miliseconds from stream start
+ * playing : true if this is a new seek within an already playing stream
+ * false if playback of this stream has not started yet
+ *
+ * if both parameters are !=0 start_pos will be used
+ * for non-seekable streams both values will be ignored
+ *
+ * returns the demux status (like get_status, but immediately after
+ * starting the demuxer)
+ */
+
+ int (*seek) (demux_plugin_t *this,
+ off_t start_pos, int start_time, int playing );
+
+ /*
+ * send a chunk of data down to decoder fifos
+ *
+ * the meaning of "chunk" is specific to every demux, usually
+ * it involves parsing one unit of data from stream.
+ *
+ * this function will be called from demux loop and should return
+ * the demux current status
+ */
+
+ int (*send_chunk) (demux_plugin_t *this);
+
+ /*
+ * free resources
+ */
+
+ void (*dispose) (demux_plugin_t *this) ;
+
+ /*
+ * returns DEMUX_OK or DEMUX_FINISHED
+ */
+
+ int (*get_status) (demux_plugin_t *this) ;
+
+ /*
+ * gets stream length in miliseconds (might be estimated)
+ * may return 0 for non-seekable streams
+ */
+
+ int (*get_stream_length) (demux_plugin_t *this);
+
+ /*
+ * return capabilities of demuxed stream
+ */
+
+ uint32_t (*get_capabilities) (demux_plugin_t *this);
+
+ /*
+ * request optional data from input plugin.
+ */
+ int (*get_optional_data) (demux_plugin_t *this, void *data, int data_type);
+
+ /*
+ * "backwards" link to plugin class
+ */
+
+ demux_class_t *demux_class;
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+} ;
+
+#define default_demux_plugin_dispose (void (*) (demux_plugin_t *this))free
+
+/*
+ * possible capabilites a demux plugin can have:
+ */
+#define DEMUX_CAP_NOCAP 0x00000000
+
+/*
+ * DEMUX_CAP_AUDIOLANG:
+ * DEMUX_CAP_SPULANG:
+ * demux plugin knows something about audio/spu languages,
+ * e.g. knows that audio stream #0 is english,
+ * audio stream #1 is german, ... Same bits as INPUT
+ * capabilities .
+ */
+
+#define DEMUX_CAP_AUDIOLANG 0x00000008
+#define DEMUX_CAP_SPULANG 0x00000010
+
+/*
+ * DEMUX_CAP_CHAPTERS:
+ * The media streams provided by this plugin have an internal
+ * structure dividing it into segments usable for navigation.
+ * For those plugins, the behaviour of the skip button in UIs
+ * should be changed from "next MRL" to "next chapter" by
+ * sending XINE_EVENT_INPUT_NEXT.
+ * Same bits as INPUT capabilities.
+ */
+
+#define DEMUX_CAP_CHAPTERS 0x00000080
+
+
+#define DEMUX_OPTIONAL_UNSUPPORTED 0
+#define DEMUX_OPTIONAL_SUCCESS 1
+
+#define DEMUX_OPTIONAL_DATA_AUDIOLANG 2
+#define DEMUX_OPTIONAL_DATA_SPULANG 3
+
+#endif
diff --git a/src/xine-engine/info_helper.h b/include/xine/info_helper.h
index 666b94f08..666b94f08 100644
--- a/src/xine-engine/info_helper.h
+++ b/include/xine/info_helper.h
diff --git a/include/xine/input_plugin.h b/include/xine/input_plugin.h
new file mode 100644
index 000000000..ca7ec73fa
--- /dev/null
+++ b/include/xine/input_plugin.h
@@ -0,0 +1,407 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#ifndef HAVE_INPUT_PLUGIN_H
+#define HAVE_INPUT_PLUGIN_H
+
+#include <sys/types.h>
+
+#include <xine/os_types.h>
+#include <xine/xineutils.h>
+#include <xine/buffer.h>
+#include <xine/configfile.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define INPUT_PLUGIN_IFACE_VERSION 18
+
+typedef struct input_class_s input_class_t ;
+typedef struct input_plugin_s input_plugin_t;
+
+struct input_class_s {
+
+ /*
+ * create a new instance of this plugin class
+ * return NULL if the plugin does'nt handle the given mrl
+ */
+ input_plugin_t* (*get_instance) (input_class_t *this, xine_stream_t *stream, const char *mrl);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * ls function, optional: may be NULL
+ * return value: NULL => filename is a file, **char=> filename is a dir
+ */
+ xine_mrl_t ** (*get_dir) (input_class_t *this, const char *filename, int *nFiles);
+
+ /*
+ * generate autoplay list, optional: may be NULL
+ * return value: list of MRLs
+ */
+ const char * const * (*get_autoplay_list) (input_class_t *this, int *num_files);
+
+ /*
+ * close down, free all resources
+ */
+ void (*dispose) (input_class_t *this);
+
+ /*
+ * eject/load the media (if possible), optional: may be NULL
+ *
+ * returns 0 for temporary failures
+ */
+ int (*eject_media) (input_class_t *this);
+};
+
+#define default_input_class_dispose (void (*) (input_class_t *this))free
+
+struct input_plugin_s {
+
+ /*
+ * open the stream
+ * return 0 if an error occured
+ */
+ int (*open) (input_plugin_t *this);
+
+ /*
+ * return capabilities of the current playable entity. See
+ * get_current_pos below for a description of a "playable entity"
+ * Capabilities a created by "OR"ing a mask of constants listed
+ * below which start "INPUT_CAP".
+ *
+ * depending on the values set, some of the functions below
+ * will or will not get called or should (not) be able to
+ * do certain tasks.
+ *
+ * for example if INPUT_CAP_SEEKABLE is set,
+ * the seek() function is expected to work fully at any time.
+ * however, if the flag is not set, the seek() function should
+ * make a best-effort attempt to seek, e.g. at least
+ * relative forward seeking should work.
+ */
+ uint32_t (*get_capabilities) (input_plugin_t *this);
+
+ /*
+ * read nlen bytes, return number of bytes read
+ * Should block until some bytes available for read;
+ * a return value of 0 indicates no data available
+ */
+ off_t (*read) (input_plugin_t *this, void *buf, off_t nlen);
+
+
+ /*
+ * read one block, return newly allocated block (or NULL on failure)
+ * for blocked input sources len must be == blocksize
+ * the fifo parameter is only used to get access to the buffer_pool_alloc function
+ */
+ buf_element_t *(*read_block)(input_plugin_t *this, fifo_buffer_t *fifo, off_t len);
+
+
+ /*
+ * seek position, return new position
+ *
+ * if seeking failed, -1 is returned
+ */
+ off_t (*seek) (input_plugin_t *this, off_t offset, int origin);
+
+
+ /*
+ * seek to time position, return new position
+ * time_offset is given in miliseconds
+ *
+ * if seeking failed, -1 is returned
+ *
+ * note: only SEEK_SET (0) is currently supported as origin
+ * note: may be NULL is not supported
+ */
+ off_t (*seek_time) (input_plugin_t *this, int time_offset, int origin);
+
+
+ /*
+ * get current position in stream.
+ *
+ */
+ off_t (*get_current_pos) (input_plugin_t *this);
+
+
+ /*
+ * get current time position in stream in miliseconds.
+ *
+ * note: may be NULL is not supported
+ */
+ int (*get_current_time) (input_plugin_t *this);
+
+
+ /*
+ * return number of bytes in the next playable entity or -1 if the
+ * input is unlimited, as would be the case in a network stream.
+ *
+ * A "playable entity" tends to be the entities listed in a playback
+ * list or the units on which playback control generally works on.
+ * It might be the number of bytes in a VCD "segment" or "track" (if
+ * the track has no "entry" subdivisions), or the number of bytes in
+ * a PS (Program Segment or "Chapter") of a DVD. If there are no
+ * subdivisions of the input medium and it is considered one
+ * indivisible entity, it would be the byte count of that entity;
+ * for example, the length in bytes of an MPEG file.
+
+ * This length information is used, for example when in setting the
+ * absolute or relative play position or possibly calculating the
+ * bit rate.
+ */
+ off_t (*get_length) (input_plugin_t *this);
+
+
+ /*
+ * return block size in bytes of next complete playable entity (if
+ * supported, 0 otherwise). See the description above under
+ * get_length for a description of a "complete playable entity".
+ *
+ * this block size is only used for mpeg streams stored on
+ * a block oriented storage media, e.g. DVDs and VCDs, to speed
+ * up the demuxing process. only set this (and the INPUT_CAP_BLOCK
+ * flag) if this is the case for your input plugin.
+ *
+ * make this function simply return 0 if unsure.
+ */
+
+ uint32_t (*get_blocksize) (input_plugin_t *this);
+
+
+ /*
+ * return current MRL
+ */
+ const char * (*get_mrl) (input_plugin_t *this);
+
+
+ /*
+ * request optional data from input plugin.
+ */
+ int (*get_optional_data) (input_plugin_t *this, void *data, int data_type);
+
+
+ /*
+ * close stream, free instance resources
+ */
+ void (*dispose) (input_plugin_t *this);
+
+ /*
+ * "backward" link to input plugin class struct
+ */
+
+ input_class_t *input_class;
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+
+};
+
+/*
+ * possible capabilites an input plugin can have:
+ */
+#define INPUT_CAP_NOCAP 0x00000000
+
+/*
+ * INPUT_CAP_SEEKABLE:
+ * seek () works reliably.
+ * even for plugins that do not have this flag set
+ * it is a good idea to implement the seek() function
+ * in a "best effort" style anyway, so at least
+ * throw away data for network streams when seeking forward
+ */
+
+#define INPUT_CAP_SEEKABLE 0x00000001
+
+/*
+ * INPUT_CAP_BLOCK:
+ * means more or less that a block device sits behind
+ * this input plugin. get_blocksize must be implemented.
+ * will be used for fast and efficient demuxing of
+ * mpeg streams (demux_mpeg_block).
+ */
+
+#define INPUT_CAP_BLOCK 0x00000002
+
+/*
+ * INPUT_CAP_AUDIOLANG:
+ * INPUT_CAP_SPULANG:
+ * input plugin knows something about audio/spu languages,
+ * e.g. knows that audio stream #0 is english,
+ * audio stream #1 is german, ...
+ * *((int *)data) will provide the requested channel number
+ * and awaits the language back in (char *)data
+ */
+
+#define INPUT_CAP_AUDIOLANG 0x00000008
+#define INPUT_CAP_SPULANG 0x00000010
+
+/*
+ * INPUT_CAP_PREVIEW:
+ * get_optional_data can handle INPUT_OPTIONAL_DATA_PREVIEW
+ * so a non-seekable stream plugin can povide the first
+ * few bytes for demuxers to look at them and decide wheter
+ * they can handle the stream or not. the preview data must
+ * be buffered and delivered again through subsequent
+ * read() calls.
+ * caller must provide a buffer allocated with at least
+ * MAX_PREVIEW_SIZE bytes.
+ */
+
+#define INPUT_CAP_PREVIEW 0x00000040
+
+/*
+ * INPUT_CAP_CHAPTERS:
+ * The media streams provided by this plugin have an internal
+ * structure dividing it into segments usable for navigation.
+ * For those plugins, the behaviour of the skip button in UIs
+ * should be changed from "next MRL" to "next chapter" by
+ * sending XINE_EVENT_INPUT_NEXT.
+ */
+
+#define INPUT_CAP_CHAPTERS 0x00000080
+
+/*
+ * INPUT_CAP_RIP_FORBIDDEN:
+ * means that rip/disk saving must not be used.
+ * (probably at author's request)
+ */
+
+#define INPUT_CAP_RIP_FORBIDDEN 0x00000100
+
+
+#define INPUT_IS_SEEKABLE(input) (((input)->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0)
+
+#define INPUT_OPTIONAL_UNSUPPORTED 0
+#define INPUT_OPTIONAL_SUCCESS 1
+
+#define INPUT_OPTIONAL_DATA_AUDIOLANG 2
+#define INPUT_OPTIONAL_DATA_SPULANG 3
+#define INPUT_OPTIONAL_DATA_PREVIEW 7
+
+/* buffer is a const char **; the string is freed by the input plugin. */
+#define INPUT_OPTIONAL_DATA_MIME_TYPE 8
+/* buffer is unused; true if the demuxer should be determined by the MIME type */
+#define INPUT_OPTIONAL_DATA_DEMUX_MIME_TYPE 9
+/* buffer is a const char **; the string is static or freed by the input plugin. */
+#define INPUT_OPTIONAL_DATA_DEMUXER 10
+
+#define MAX_MRL_ENTRIES 255
+#define MAX_PREVIEW_SIZE 4096
+
+/* Types of mrls returned by get_dir() */
+#define mrl_unknown (0 << 0)
+#define mrl_dvd (1 << 0)
+#define mrl_vcd (1 << 1)
+#define mrl_net (1 << 2)
+#define mrl_rtp (1 << 3)
+#define mrl_stdin (1 << 4)
+#define mrl_cda (1 << 5)
+#define mrl_file (1 << 6)
+#define mrl_file_fifo (1 << 7)
+#define mrl_file_chardev (1 << 8)
+#define mrl_file_directory (1 << 9)
+#define mrl_file_blockdev (1 << 10)
+#define mrl_file_normal (1 << 11)
+#define mrl_file_symlink (1 << 12)
+#define mrl_file_sock (1 << 13)
+#define mrl_file_exec (1 << 14)
+#define mrl_file_backup (1 << 15)
+#define mrl_file_hidden (1 << 16)
+
+/*
+ * Freeing/zeroing all of entries of given mrl.
+ */
+#define MRL_ZERO(m) { \
+ if((m)) { \
+ free((m)->origin); \
+ free((m)->mrl); \
+ free((m)->link); \
+ (m)->origin = NULL; \
+ (m)->mrl = NULL; \
+ (m)->link = NULL; \
+ (m)->type = 0; \
+ (m)->size = (off_t) 0; \
+ } \
+ }
+
+/*
+ * Duplicate two mrls entries (s = source, d = destination).
+ */
+#define MRL_DUPLICATE(s, d) { \
+ _x_assert((s) != NULL); \
+ _x_assert((d) != NULL); \
+ \
+ free((d)->origin); \
+ (d)->origin = (s)->origin ? strdup((s)->origin) : NULL; \
+ \
+ free((d)->mrl); \
+ (d)->mrl = (s)->mrl ? strdup((s)->mrl) : NULL; \
+ \
+ free((d)->link); \
+ (d)->link = (s)->link ? strdup((s)->link) : NULL; \
+ \
+ (d)->type = (s)->type; \
+ (d)->size = (s)->size; \
+ }
+
+/*
+ * Duplicate two arrays of mrls (s = source, d = destination).
+ */
+#define MRLS_DUPLICATE(s, d) { \
+ int i = 0; \
+ \
+ _x_assert((s) != NULL); \
+ _x_assert((d) != NULL); \
+ \
+ while((s) != NULL) { \
+ d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \
+ MRL_DUPLICATE(s[i], d[i]); \
+ i++; \
+ } \
+}
+
+
+#endif
diff --git a/include/xine/io_helper.h b/include/xine/io_helper.h
new file mode 100644
index 000000000..0aac8fcfc
--- /dev/null
+++ b/include/xine/io_helper.h
@@ -0,0 +1,141 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * abortable i/o helper functions
+ */
+
+#ifndef IO_HELPER_H
+#define IO_HELPER_H
+
+#include "xine_internal.h"
+
+
+/* select states */
+#define XIO_READ_READY 1
+#define XIO_WRITE_READY 2
+
+/* xine select return codes */
+#define XIO_READY 0
+#define XIO_ERROR 1
+#define XIO_ABORTED 2
+#define XIO_TIMEOUT 3
+
+
+/*
+ * Waits for a file descriptor/socket to change status.
+ *
+ * network input plugins should use this function in order to
+ * not freeze the engine.
+ *
+ * params :
+ * stream needed for aborting and reporting errors but may be NULL
+ * fd file/socket descriptor
+ * state XIO_READ_READY, XIO_WRITE_READY
+ * timeout_sec timeout in seconds
+ *
+ * An other thread can abort this function if stream != NULL by setting
+ * stream->demux_action_pending.
+ *
+ * return value :
+ * XIO_READY the file descriptor is ready for cmd
+ * XIO_ERROR an i/o error occured
+ * XIO_ABORTED command aborted by an other thread
+ * XIO_TIMEOUT the file descriptor is not ready after timeout_msec milliseconds
+ */
+int _x_io_select (xine_stream_t *stream, int fd, int state, int timeout_msec) XINE_PROTECTED;
+
+
+/*
+ * open a tcp connection
+ *
+ * params :
+ * stream needed for reporting errors but may be NULL
+ * host address of target
+ * port port on target
+ *
+ * returns a socket descriptor or -1 if an error occured
+ */
+int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port) XINE_PROTECTED;
+
+/*
+ * wait for finish connection
+ *
+ * params :
+ * stream needed for aborting and reporting errors but may be NULL
+ * fd socket descriptor
+ * timeout_msec timeout in milliseconds
+ *
+ * return value:
+ * XIO_READY host respond, the socket is ready for cmd
+ * XIO_ERROR an i/o error occured
+ * XIO_ABORTED command aborted by an other thread
+ * XIO_TIMEOUT the file descriptor is not ready after timeout
+ */
+int _x_io_tcp_connect_finish(xine_stream_t *stream, int fd, int timeout_msec) XINE_PROTECTED;
+
+/*
+ * read from tcp socket checking demux_action_pending
+ *
+ * network input plugins should use this function in order to
+ * not freeze the engine.
+ *
+ * aborts with zero if no data is available and *abort is set
+ */
+off_t _x_io_tcp_read (xine_stream_t *stream, int s, void *buf, off_t todo) XINE_PROTECTED;
+
+
+/*
+ * write to a tcp socket checking demux_action_pending
+ *
+ * network input plugins should use this function in order to
+ * not freeze the engine.
+ *
+ * aborts with zero if no data is available and *abort is set
+ */
+off_t _x_io_tcp_write (xine_stream_t *stream, int s, void *buf, off_t todo) XINE_PROTECTED;
+
+/*
+ * read from a file descriptor checking demux_action_pending
+ *
+ * the fifo input plugin should use this function in order to
+ * not freeze the engine.
+ *
+ * aborts with zero if no data is available and *abort is set
+ */
+off_t _x_io_file_read (xine_stream_t *stream, int fd, void *buf, off_t todo) XINE_PROTECTED;
+
+
+/*
+ * write to a file descriptor checking demux_action_pending
+ *
+ * the fifo input plugin should use this function in order to
+ * not freeze the engine.
+ *
+ * aborts with zero if *abort is set
+ */
+off_t _x_io_file_write (xine_stream_t *stream, int fd, void *buf, off_t todo) XINE_PROTECTED;
+
+/*
+ * read a string from socket, return string length (same as strlen)
+ * the string is always '\0' terminated but given buffer size is never exceeded
+ * that is, _x_io_tcp_read_line(,,,X) <= (X-1) ; X > 0
+ */
+int _x_io_tcp_read_line(xine_stream_t *stream, int sock, char *str, int size) XINE_PROTECTED;
+
+#endif
diff --git a/src/xine-utils/list.h b/include/xine/list.h
index 4910f9982..4910f9982 100644
--- a/src/xine-utils/list.h
+++ b/include/xine/list.h
diff --git a/include/xine/metronom.h b/include/xine/metronom.h
new file mode 100644
index 000000000..4f4bb04eb
--- /dev/null
+++ b/include/xine/metronom.h
@@ -0,0 +1,359 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * metronom: general pts => virtual calculation/assoc
+ *
+ * virtual pts: unit 1/90000 sec, always increasing
+ * can be used for synchronization
+ * video/audio frame with same pts also have same vpts
+ * but pts is likely to differ from vpts
+ *
+ * the basic idea is:
+ * video_pts + video_wrap_offset = video_vpts
+ * audio_pts + audio_wrap_offset = audio_vpts
+ *
+ * - video_wrap_offset should be equal to audio_wrap_offset as to have
+ * perfect audio and video sync. They will differ on brief periods due
+ * discontinuity correction.
+ * - metronom should also interpolate vpts values most of the time as
+ * video_pts and audio_vpts are not given for every frame.
+ * - corrections to the frame rate may be needed to cope with bad
+ * encoded streams.
+ */
+
+#ifndef HAVE_METRONOM_H
+#define HAVE_METRONOM_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <pthread.h>
+
+#include <xine/video_out.h>
+#include <xine.h>
+
+typedef struct metronom_s metronom_t ;
+typedef struct metronom_clock_s metronom_clock_t;
+typedef struct scr_plugin_s scr_plugin_t;
+
+/* metronom prebuffer can be adjusted with XINE_PARAM_METRONOM_PREBUFFER.
+ * it sets how much the first video/audio frame should be delayed to
+ * have some prebuffering at the output layers. reducing this value (about
+ * 1/8 sec) may result in faster seeking (good to simulate play backwards,
+ * for example).
+ */
+#define PREBUFFER_PTS_OFFSET 12000
+
+ /* see below */
+#define DISC_STREAMSTART 0
+#define DISC_RELATIVE 1
+#define DISC_ABSOLUTE 2
+#define DISC_STREAMSEEK 3
+
+struct metronom_s {
+
+ /*
+ * called by audio output driver to inform metronom about current audio
+ * samplerate
+ *
+ * parameter pts_per_smpls : 1/90000 sec per 65536 samples
+ */
+ void (*set_audio_rate) (metronom_t *self, int64_t pts_per_smpls);
+
+ /*
+ * called by video output driver for *every* frame
+ *
+ * parameter frame containing pts, scr, ... information
+ *
+ * will set vpts field in frame
+ *
+ * this function will also update video_wrap_offset if a discontinuity
+ * is detected (read the comentaries below about discontinuities).
+ *
+ */
+
+ void (*got_video_frame) (metronom_t *self, vo_frame_t *frame);
+
+ /*
+ * called by audio output driver whenever audio samples are delivered to it
+ *
+ * parameter pts : pts for audio data if known, 0 otherwise
+ * nsamples : number of samples delivered
+ *
+ * return value: virtual pts for audio data
+ *
+ * this function will also update audio_wrap_offset if a discontinuity
+ * is detected (read the comentaries below about discontinuities).
+ *
+ */
+
+ int64_t (*got_audio_samples) (metronom_t *self, int64_t pts,
+ int nsamples);
+
+ /*
+ * called by SPU decoder whenever a packet is delivered to it
+ *
+ * parameter pts : pts for SPU packet if known, 0 otherwise
+ *
+ * return value: virtual pts for SPU packet
+ * (this is the only pts to vpts function that cannot update the wrap_offset
+ * due to the lack of regularity on spu packets)
+ */
+
+ int64_t (*got_spu_packet) (metronom_t *self, int64_t pts);
+
+ /*
+ * tell metronom about discontinuities.
+ *
+ * these functions are called due to a discontinuity detected at
+ * demux stage.
+ *
+ * there are different types of discontinuities:
+ *
+ * DISC_STREAMSTART : new stream starts, expect pts values to start
+ * from zero immediately
+ * DISC_RELATIVE : typically a wrap-around, expect pts with
+ * a specified offset from the former ones soon
+ * DISC_ABSOLUTE : typically a new menu stream (nav packets)
+ * pts will start from given value soon
+ * DISC_STREAMSEEK : used by video and audio decoder loop,
+ * when a buffer with BUF_FLAG_SEEK set is encountered;
+ * applies the necessary vpts offset for the seek in
+ * metronom, but keeps the vpts difference between
+ * audio and video, so that metronom doesn't cough
+ */
+ void (*handle_audio_discontinuity) (metronom_t *self, int type, int64_t disc_off);
+ void (*handle_video_discontinuity) (metronom_t *self, int type, int64_t disc_off);
+
+ /*
+ * set/get options for metronom, constants see below
+ */
+ void (*set_option) (metronom_t *self, int option, int64_t value);
+ int64_t (*get_option) (metronom_t *self, int option);
+
+ /*
+ * set a master metronom
+ * this is currently useful to sync independently generated streams
+ * (e.g. by post plugins) to the discontinuity domain of another
+ * metronom
+ */
+ void (*set_master) (metronom_t *self, metronom_t *master);
+
+ void (*exit) (metronom_t *self);
+
+#ifdef METRONOM_INTERNAL
+ /*
+ * metronom internal stuff
+ */
+ xine_t *xine;
+
+ metronom_t *master;
+
+ int64_t pts_per_smpls;
+
+ int64_t video_vpts;
+ int64_t spu_vpts;
+ int64_t audio_vpts;
+ int64_t audio_vpts_rmndr; /* the remainder for integer division */
+
+ int64_t vpts_offset;
+
+ int64_t video_drift;
+ int64_t video_drift_step;
+
+ int audio_samples;
+ int64_t audio_drift_step;
+
+ int64_t prebuffer;
+ int64_t av_offset;
+ int64_t spu_offset;
+
+ pthread_mutex_t lock;
+
+ int have_video;
+ int have_audio;
+ int video_discontinuity_count;
+ int audio_discontinuity_count;
+ int discontinuity_handled_count;
+ pthread_cond_t video_discontinuity_reached;
+ pthread_cond_t audio_discontinuity_reached;
+
+ int force_video_jump;
+ int force_audio_jump;
+
+ int64_t img_duration;
+ int img_cpt;
+ int64_t last_video_pts;
+ int64_t last_audio_pts;
+
+ int video_mode;
+#endif
+};
+
+/*
+ * metronom options
+ */
+
+#define METRONOM_AV_OFFSET 2
+#define METRONOM_ADJ_VPTS_OFFSET 3
+#define METRONOM_FRAME_DURATION 4
+#define METRONOM_SPU_OFFSET 5
+#define METRONOM_VPTS_OFFSET 6
+#define METRONOM_PREBUFFER 7
+
+metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_MALLOC XINE_PROTECTED;
+
+/* FIXME: reorder this structure on the next cleanup to remove the dummies */
+struct metronom_clock_s {
+
+ /*
+ * set/get options for clock, constants see below
+ */
+ void (*set_option) (metronom_clock_t *self, int option, int64_t value);
+ int64_t (*get_option) (metronom_clock_t *self, int option);
+
+ /*
+ * system clock reference (SCR) functions
+ */
+
+#ifdef METRONOM_CLOCK_INTERNAL
+ /*
+ * start clock (no clock reset)
+ * at given pts
+ */
+ void (*start_clock) (metronom_clock_t *self, int64_t pts);
+
+
+ /*
+ * stop metronom clock
+ */
+ void (*stop_clock) (metronom_clock_t *self);
+
+
+ /*
+ * resume clock from where it was stopped
+ */
+ void (*resume_clock) (metronom_clock_t *self);
+#else
+ void *dummy1;
+ void *dummy2;
+ void *dummy3;
+#endif
+
+
+ /*
+ * get current clock value in vpts
+ */
+ int64_t (*get_current_time) (metronom_clock_t *self);
+
+
+ /*
+ * adjust master clock to external timer (e.g. audio hardware)
+ */
+ void (*adjust_clock) (metronom_clock_t *self, int64_t desired_pts);
+
+#ifdef METRONOM_CLOCK_INTERNAL
+ /*
+ * set clock speed
+ * for constants see xine_internal.h
+ */
+
+ int (*set_fine_speed) (metronom_clock_t *self, int speed);
+#else
+ void *dummy4;
+#endif
+
+ /*
+ * (un)register a System Clock Reference provider at the metronom
+ */
+ int (*register_scr) (metronom_clock_t *self, scr_plugin_t *scr);
+ void (*unregister_scr) (metronom_clock_t *self, scr_plugin_t *scr);
+
+#ifdef METRONOM_CLOCK_INTERNAL
+ void (*exit) (metronom_clock_t *self);
+
+ xine_t *xine;
+
+ scr_plugin_t *scr_master;
+ scr_plugin_t **scr_list;
+ pthread_t sync_thread;
+ int thread_running;
+ int scr_adjustable;
+#else
+ void *dummy5;
+ void *dummy6;
+ void *dummy7;
+ void *dummy8;
+ pthread_t dummy9;
+ int dummy10;
+ int dummy11;
+#endif
+
+ int speed;
+
+#ifdef METRONOM_CLOCK_INTERNAL
+ pthread_mutex_t lock;
+ pthread_cond_t cancel;
+#endif
+};
+
+metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_MALLOC XINE_PROTECTED;
+
+/*
+ * clock options
+ */
+
+#define CLOCK_SCR_ADJUSTABLE 1
+
+/*
+ * SCR (system clock reference) plugins
+ */
+
+struct scr_plugin_s
+{
+ int (*get_priority) (scr_plugin_t *self);
+
+ /*
+ * set/get clock speed
+ *
+ * for speed constants see xine_internal.h
+ * returns actual speed
+ */
+
+ int (*set_fine_speed) (scr_plugin_t *self, int speed);
+
+ void (*adjust) (scr_plugin_t *self, int64_t vpts);
+
+ void (*start) (scr_plugin_t *self, int64_t start_vpts);
+
+ int64_t (*get_current) (scr_plugin_t *self);
+
+ void (*exit) (scr_plugin_t *self);
+
+ metronom_clock_t *clock;
+
+ int interface_version;
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/lib/os_types.h b/include/xine/os_types.h
index aa6eddb00..aa6eddb00 100644
--- a/lib/os_types.h
+++ b/include/xine/os_types.h
diff --git a/include/xine/osd.h b/include/xine/osd.h
new file mode 100644
index 000000000..44471534b
--- /dev/null
+++ b/include/xine/osd.h
@@ -0,0 +1,302 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * OSD stuff (text and graphic primitives)
+ */
+
+#ifndef HAVE_OSD_H
+#define HAVE_OSD_H
+
+#ifdef HAVE_ICONV
+# include <iconv.h>
+#endif
+
+#include <xine/video_overlay.h>
+
+typedef struct osd_object_s osd_object_t;
+typedef struct osd_renderer_s osd_renderer_t;
+typedef struct osd_font_s osd_font_t;
+typedef struct osd_ft2context_s osd_ft2context_t;
+
+struct osd_object_s {
+ osd_object_t *next;
+ osd_renderer_t *renderer;
+
+ int width, height; /* work area dimentions */
+ uint8_t *area; /* work area */
+ int area_touched; /* work area was used for painting */
+ int display_x,display_y; /* where to display it in screen */
+
+ /* video output area within osd extent */
+ int video_window_x, video_window_y;
+ int video_window_width, video_window_height;
+
+ /* extent of reference coordinate system */
+ int extent_width, extent_height;
+
+ /* clipping box inside work area */
+ int x1, y1;
+ int x2, y2;
+
+ uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */
+ uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */
+
+#ifdef HAVE_ICONV
+ iconv_t cd; /* iconv handle of encoding */
+ char *encoding; /* name of encoding */
+#endif
+
+ osd_font_t *font;
+ osd_ft2context_t *ft2;
+
+
+ /* this holds an optional ARGB overlay, which
+ * is only be used by supported video_out modules.
+ * right now this is only vdpau */
+ argb_layer_t *argb_layer;
+
+ int32_t handle;
+};
+
+/* this one is public */
+struct xine_osd_s {
+ osd_object_t osd;
+};
+
+struct osd_renderer_s {
+
+ xine_stream_t *stream;
+
+ /*
+ * open a new osd object. this will allocated an empty (all zero) drawing
+ * area where graphic primitives may be used.
+ * It is ok to specify big width and height values. The render will keep
+ * track of the smallest changed area to not generate too big overlays.
+ * A default palette is initialized (i sugest keeping color 0 as transparent
+ * for the sake of simplicity)
+ */
+ osd_object_t* (*new_object) (osd_renderer_t *this, int width, int height);
+
+ /*
+ * free osd object
+ */
+ void (*free_object) (osd_object_t *osd_to_close);
+
+
+ /*
+ * send the osd to be displayed at given pts (0=now)
+ * the object is not changed. there may be subsequent drawing on it.
+ */
+ int (*show) (osd_object_t *osd, int64_t vpts );
+
+ /*
+ * send event to hide osd at given pts (0=now)
+ * the object is not changed. there may be subsequent drawing on it.
+ */
+ int (*hide) (osd_object_t *osd, int64_t vpts );
+
+ /*
+ * draw point.
+ */
+ void (*point) (osd_object_t *osd, int x, int y, int color);
+
+ /*
+ * Bresenham line implementation on osd object
+ */
+ void (*line) (osd_object_t *osd,
+ int x1, int y1, int x2, int y2, int color );
+
+ /*
+ * filled rectangle
+ */
+ void (*filled_rect) (osd_object_t *osd,
+ int x1, int y1, int x2, int y2, int color );
+
+ /*
+ * set palette (color and transparency)
+ */
+ void (*set_palette) (osd_object_t *osd, const uint32_t *color, const uint8_t *trans );
+
+ /*
+ * set on existing text palette
+ * (-1 to set used specified palette)
+ *
+ * color_base specifies the first color index to use for this text
+ * palette. The OSD palette is then modified starting at this
+ * color index, up to the size of the text palette.
+ *
+ * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices.
+ */
+ void (*set_text_palette) (osd_object_t *osd, int palette_number,
+ int color_base );
+
+ /*
+ * get palette (color and transparency)
+ */
+ void (*get_palette) (osd_object_t *osd, uint32_t *color,
+ uint8_t *trans);
+
+ /*
+ * set position were overlay will be blended
+ */
+ void (*set_position) (osd_object_t *osd, int x, int y);
+
+ /*
+ * set the font of osd object
+ */
+
+ int (*set_font) (osd_object_t *osd, const char *fontname, int size);
+
+ /*
+ * set encoding of text
+ *
+ * NULL ... no conversion (iso-8859-1)
+ * "" ... locale encoding
+ */
+ int (*set_encoding) (osd_object_t *osd, const char *encoding);
+
+ /*
+ * render text in current encoding on x,y position
+ * no \n yet
+ *
+ * The text is assigned the colors starting at the index specified by
+ * color_base up to the size of the text palette.
+ *
+ * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices.
+ */
+ int (*render_text) (osd_object_t *osd, int x1, int y1,
+ const char *text, int color_base);
+
+ /*
+ * get width and height of how text will be renderized
+ */
+ int (*get_text_size) (osd_object_t *osd, const char *text,
+ int *width, int *height);
+
+ /*
+ * close osd rendering engine
+ * loaded fonts are unloaded
+ * osd objects are closed
+ */
+ void (*close) (osd_renderer_t *this);
+
+ /*
+ * clear an osd object (empty drawing area)
+ */
+ void (*clear) (osd_object_t *osd );
+
+ /*
+ * paste a bitmap with optional palette mapping
+ */
+ void (*draw_bitmap) (osd_object_t *osd, uint8_t *bitmap,
+ int x1, int y1, int width, int height,
+ uint8_t *palette_map);
+
+ /*
+ * send the osd to be displayed (unscaled) at given pts (0=now)
+ * the object is not changed. there may be subsequent drawing on it.
+ * overlay is blended at output (screen) resolution.
+ */
+ int (*show_unscaled) (osd_object_t *osd, int64_t vpts );
+
+ /*
+ * see xine.h for defined XINE_OSD_CAP_ values.
+ */
+ uint32_t (*get_capabilities) (osd_object_t *osd);
+
+ /*
+ * define extent of reference coordinate system for video
+ * resolution independent osds. both sizes must be > 0 to
+ * take effect. otherwise, video resolution will be used.
+ */
+ void (*set_extent) (osd_object_t *osd, int extent_width, int extent_height);
+
+ /*
+ * set an argb buffer to be blended into video
+ * the buffer must exactly match the osd dimensions
+ * and stay valid while the osd is on screen. pass
+ * a NULL pointer to safely remove the buffer from
+ * the osd layer. only the dirty area will be
+ * updated on screen. for convinience the whole
+ * osd object will be considered dirty when setting
+ * a different buffer pointer.
+ * see also XINE_OSD_CAP_ARGB_LAYER
+ */
+ void (*set_argb_buffer) (osd_object_t *osd, uint32_t *argb_buffer,
+ int dirty_x, int dirty_y, int dirty_width, int dirty_height);
+
+ /*
+ * osd video window defines an area withing osd extent where the
+ * video shall be scaled to while an osd is displayed on screen.
+ * both width and height must be > 0 to take effect.
+ */
+ void (*set_video_window) (osd_object_t *osd,
+ int window_x, int window_y, int window_width, int window_height);
+
+ /* private stuff */
+
+ pthread_mutex_t osd_mutex;
+ video_overlay_event_t event;
+ osd_object_t *osds; /* instances of osd */
+ osd_font_t *fonts; /* loaded fonts */
+ int textpalette; /* default textpalette */
+
+};
+
+/*
+ * initialize the osd rendering engine
+ */
+osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC;
+
+
+/*
+ * The size of a text palette
+ */
+
+#define TEXT_PALETTE_SIZE 11
+
+/*
+ * Preassigned color indices for rendering text
+ * (more can be added, not exceeding OVL_PALETTE_SIZE)
+ */
+
+#define OSD_TEXT1 (0 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT2 (1 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT3 (2 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT4 (3 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT5 (4 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT6 (5 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT7 (6 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT8 (7 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT9 (8 * TEXT_PALETTE_SIZE)
+#define OSD_TEXT10 (9 * TEXT_PALETTE_SIZE)
+
+/*
+ * Defined palettes for rendering osd text
+ * (more can be added later)
+ */
+
+#define NUMBER_OF_TEXT_PALETTES 4
+#define TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0
+#define TEXTPALETTE_WHITE_NONE_TRANSPARENT 1
+#define TEXTPALETTE_WHITE_NONE_TRANSLUCID 2
+#define TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3
+
+#endif
+
diff --git a/include/xine/plugin_catalog.h b/include/xine/plugin_catalog.h
new file mode 100644
index 000000000..0f4a464b3
--- /dev/null
+++ b/include/xine/plugin_catalog.h
@@ -0,0 +1,75 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine-internal header: Definitions for plugin lists
+ */
+
+#ifndef _PLUGIN_CATALOG_H
+#define _PLUGIN_CATALOG_H
+
+#include <xine/xine_plugin.h>
+#include <xine/xineutils.h>
+
+#define DECODER_MAX 128
+#define PLUGIN_MAX 256
+
+/* the engine takes this many plugins for one stream type */
+#define PLUGINS_PER_TYPE 10
+
+typedef struct {
+ char *filename;
+ off_t filesize;
+ time_t filemtime;
+ void *lib_handle;
+ int ref; /* count number of classes */
+ int no_unload; /* set if the file can't be unloaded */
+} plugin_file_t ;
+
+typedef struct {
+ plugin_file_t *file;
+ plugin_info_t *info;
+ void *plugin_class;
+ xine_list_t *config_entry_list;
+ int ref; /* count intances of plugins */
+ int priority;
+} plugin_node_t ;
+
+struct plugin_catalog_s {
+ xine_sarray_t *plugin_lists[PLUGIN_TYPE_MAX];
+
+ xine_sarray_t *cache_list;
+ xine_list_t *file_list;
+
+ plugin_node_t *audio_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
+ plugin_node_t *video_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
+ plugin_node_t *spu_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
+
+ const char *ids[PLUGIN_MAX];
+
+ /* memory block for the decoder priority config entry descriptions */
+ char *prio_desc[DECODER_MAX];
+
+ pthread_mutex_t lock;
+
+ int plugin_count;
+ int decoder_count;
+};
+typedef struct plugin_catalog_s plugin_catalog_t;
+
+#endif
diff --git a/src/xine-utils/pool.h b/include/xine/pool.h
index 37f60220c..37f60220c 100644
--- a/src/xine-utils/pool.h
+++ b/include/xine/pool.h
diff --git a/include/xine/post.h b/include/xine/post.h
new file mode 100644
index 000000000..f0d0c9316
--- /dev/null
+++ b/include/xine/post.h
@@ -0,0 +1,410 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * post plugin definitions
+ */
+
+#ifndef XINE_POST_H
+#define XINE_POST_H
+
+#include <xine.h>
+#include <xine/video_out.h>
+#include <xine/audio_out.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define POST_PLUGIN_IFACE_VERSION 10
+
+
+typedef struct post_class_s post_class_t;
+typedef struct post_plugin_s post_plugin_t;
+typedef struct post_in_s post_in_t;
+typedef struct post_out_s post_out_t;
+
+struct post_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ post_plugin_t* (*open_plugin) (post_class_t *this, int inputs,
+ xine_audio_port_t **audio_target,
+ xine_video_port_t **video_target);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * free all class-related resources
+ */
+
+ void (*dispose) (post_class_t *this);
+};
+
+#define default_post_class_dispose (void (*) (post_class_t *this))free
+
+struct post_plugin_s {
+
+ /* public part of the plugin */
+ xine_post_t xine_post;
+
+ /*
+ * the connections announced by the plugin
+ * the plugin must fill these with xine_post_{in,out}_t on init
+ */
+ xine_list_t *input;
+ xine_list_t *output;
+
+ /*
+ * close down, free all resources
+ */
+ void (*dispose) (post_plugin_t *this);
+
+ /* plugins don't have to init the stuff below */
+
+ /*
+ * the running ticket
+ *
+ * the plugin must assure to check for ticket revocation in
+ * intervals of finite length; this means that you must release
+ * the ticket before any operation that might block;
+ * note that all port functions are safe in this respect
+ *
+ * the running ticket is assigned to you by the engine
+ */
+ xine_ticket_t *running_ticket;
+
+ /* this is needed by the engine to decrement the reference counter
+ * on disposal of the plugin, but since this is useful, we expose it */
+ xine_t *xine;
+
+ /* used when the user requests a list of all inputs/outputs */
+ const char **input_ids;
+ const char **output_ids;
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+
+ /* has dispose been called */
+ int dispose_pending;
+};
+
+/* helper function to initialize a post_plugin_t */
+void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_inputs) XINE_PROTECTED;
+
+struct post_in_s {
+
+ /* public part of the input */
+ xine_post_in_t xine_in;
+
+ /* backward reference so that you have access to the post plugin */
+ post_plugin_t *post;
+
+ /* you can fill this to your liking */
+ void *user_data;
+};
+
+struct post_out_s {
+
+ /* public part of the output */
+ xine_post_out_t xine_out;
+
+ /* backward reference so that you have access to the post plugin */
+ post_plugin_t *post;
+
+ /* you can fill this to your liking */
+ void *user_data;
+};
+
+
+/* Post plugins work by intercepting calls to video or audio ports
+ * in the sense of the decorator design pattern. They reuse the
+ * functions of a given target port, but add own functionality in
+ * front of that port by creating a new port structure and filling in
+ * the function pointers with pointers to own functions that
+ * would do something and then call the original port function.
+ *
+ * Much the same is done with video frames which have their own
+ * set of functions attached that you might need to decorate.
+ */
+
+
+/* helper structure for intercepting video port calls */
+typedef struct post_video_port_s post_video_port_t;
+struct post_video_port_s {
+
+ /* the new public port with replaced function pointers */
+ xine_video_port_t new_port;
+
+ /* the original port to call its functions from inside yours */
+ xine_video_port_t *original_port;
+
+ /* if you want to decide yourself, whether a given frame should
+ * be intercepted, fill in this function; get_frame() acts as
+ * a template method and asks your function; return a boolean;
+ * the default is to intercept all frames */
+ int (*intercept_frame)(post_video_port_t *self, vo_frame_t *frame);
+
+ /* 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;
+ * the default is _not_ to intercept the overlay manager */
+ int (*intercept_ovl)(post_video_port_t *self);
+
+ /* the new public overlay manager with replaced function pointers */
+ video_overlay_manager_t *new_manager;
+
+ /* the original manager to call its functions from inside yours */
+ video_overlay_manager_t *original_manager;
+
+ /* 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;
+
+ /* point to a mutex here, if you need some synchronization */
+ pthread_mutex_t *port_lock;
+ pthread_mutex_t *frame_lock;
+ pthread_mutex_t *manager_lock;
+
+ /* backward reference so that you have access to the post plugin
+ * when the call only gives you the port */
+ post_plugin_t *post;
+
+ /* you can fill this to your liking */
+ void *user_data;
+
+#ifdef POST_INTERNAL
+ /* some of the above members are to be directly included here, but
+ * adding the structures would mean that post_video_port_t becomes
+ * depended of the sizes of these structs; solution: we add pointers
+ * above and have them point into the memory provided here;
+ * note that the overlay manager needs to be first so that we can
+ * reconstruct the post_video_port_t* from overlay manager calls */
+
+ /* any change here requires a change in _x_post_ovl_manager_to_port()
+ * below! */
+
+ video_overlay_manager_t manager_storage;
+ vo_frame_t frame_storage;
+
+ /* this is used to keep a linked list of free vo_frame_t's */
+ vo_frame_t *free_frame_slots;
+ pthread_mutex_t free_frames_lock;
+#endif
+};
+
+/* use this to create a new decorated video port in which
+ * port functions will be replaced with own implementations;
+ * for convenience, this can also create a related post_in_t and post_out_t */
+post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *port,
+ post_in_t **input, post_out_t **output) XINE_PROTECTED;
+
+/* use this to decorate and to undecorate a frame so that its functions
+ * can be replaced with own implementations, decoration is usually done in
+ * get_frame(), undecoration in frame->free() */
+vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED;
+vo_frame_t *_x_post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED;
+
+/* when you want to pass a frame call on to the original issuer of the frame,
+ * you need to propagate potential changes up and down the pipe, so the usual
+ * procedure for this situation would be:
+ *
+ * _x_post_frame_copy_down(frame, frame->next);
+ * frame->next->function(frame->next);
+ * _x_post_frame_copy_up(frame, frame->next);
+ */
+void _x_post_frame_copy_down(vo_frame_t *from, vo_frame_t *to) XINE_PROTECTED;
+void _x_post_frame_copy_up(vo_frame_t *to, vo_frame_t *from) XINE_PROTECTED;
+
+/* when you shortcut a frames usual draw() travel so that it will never reach
+ * the draw() function of the original issuer, you still have to do some
+ * housekeeping on the frame, before returning control up the pipe */
+void _x_post_frame_u_turn(vo_frame_t *frame, xine_stream_t *stream) XINE_PROTECTED;
+
+/* use this to create a new, trivially decorated overlay manager in which
+ * port functions can be replaced with own implementations */
+void _x_post_intercept_overlay_manager(video_overlay_manager_t *manager, post_video_port_t *port) XINE_PROTECTED;
+
+/* pointer retrieval functions */
+static inline post_video_port_t *_x_post_video_frame_to_port(vo_frame_t *frame) {
+ return (post_video_port_t *)frame->port;
+}
+
+static inline post_video_port_t *_x_post_ovl_manager_to_port(video_overlay_manager_t *manager) {
+#ifdef POST_INTERNAL
+ return (post_video_port_t *)( (uint8_t *)manager -
+ (uint8_t*)&(((post_video_port_t *)NULL)->manager_storage) );
+#else
+ return (post_video_port_t *)( (uint8_t *)manager - sizeof(post_video_port_t) );
+#endif
+}
+
+
+/* helper structure for intercepting audio port calls */
+typedef struct post_audio_port_s post_audio_port_t;
+struct post_audio_port_s {
+
+ /* the new public port with replaced function pointers */
+ xine_audio_port_t new_port;
+
+ /* the original port to call its functions from inside yours */
+ xine_audio_port_t *original_port;
+
+ /* the stream we are being fed by; NULL means no stream is connected;
+ * this may be an anonymous stream */
+ xine_stream_t *stream;
+
+ 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;
+
+ /* point to a mutex here, if you need some synchronization */
+ pthread_mutex_t *port_lock;
+
+ /* backward reference so that you have access to the post plugin
+ * when the call only gives you the port */
+ post_plugin_t *post;
+
+ /* you can fill this to your liking */
+ void *user_data;
+};
+
+/* use this to create a new decorated audio port in which
+ * port functions will be replaced with own implementations */
+post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *port,
+ post_in_t **input, post_out_t **output) XINE_PROTECTED;
+
+
+/* this will allow pending rewire operations, calling this at the beginning
+ * of decoder-called functions like get_buffer() and open() is a good idea
+ * (if you do not intercept get_buffer() or open(), this will be done automatically) */
+static inline void _x_post_rewire(post_plugin_t *post) {
+ if (post->running_ticket->ticket_revoked)
+ post->running_ticket->renew(post->running_ticket, 1);
+}
+
+/* with these functions you can switch interruptions like rewiring or engine pausing
+ * off for a block of code; use this only when really necessary */
+static inline void _x_post_lock(post_plugin_t *post) {
+ post->running_ticket->acquire(post->running_ticket, 1);
+}
+static inline void _x_post_unlock(post_plugin_t *post) {
+ post->running_ticket->release(post->running_ticket, 1);
+ _x_post_rewire(post);
+}
+
+/* the standard disposal operation; returns 1 if the plugin is really
+ * disposed and you should free everything you malloc()ed yourself */
+int _x_post_dispose(post_plugin_t *post) XINE_PROTECTED;
+
+
+/* macros to handle usage counter */
+
+/* WARNING!
+ * note that _x_post_dec_usage() can call dispose, so be sure to
+ * not use any potentially already freed memory after this */
+
+#define _x_post_inc_usage(port) \
+do { \
+ pthread_mutex_lock(&(port)->usage_lock); \
+ (port)->usage_count++; \
+ pthread_mutex_unlock(&(port)->usage_lock); \
+} while(0)
+
+#define _x_post_dec_usage(port) \
+do { \
+ pthread_mutex_lock(&(port)->usage_lock); \
+ (port)->usage_count--; \
+ if ((port)->usage_count == 0) { \
+ if ((port)->post->dispose_pending) { \
+ pthread_mutex_unlock(&(port)->usage_lock); \
+ (port)->post->dispose((port)->post); \
+ } else \
+ pthread_mutex_unlock(&(port)->usage_lock); \
+ } else \
+ pthread_mutex_unlock(&(port)->usage_lock); \
+} while(0)
+
+
+/* macros to create parameter descriptors */
+
+#define START_PARAM_DESCR( param_t ) \
+static param_t temp_s; \
+static xine_post_api_parameter_t temp_p[] = {
+
+#define PARAM_ITEM( param_type, var, enumv, min, max, readonly, descr ) \
+{ param_type, #var, sizeof(temp_s.var), \
+ (char*)&temp_s.var-(char*)&temp_s, enumv, min, max, readonly, descr },
+
+#define END_PARAM_DESCR( name ) \
+ { POST_PARAM_TYPE_LAST, NULL, 0, 0, NULL, 0, 0, 1, NULL } \
+}; \
+static xine_post_api_descr_t name = { \
+ sizeof( temp_s ), \
+ temp_p \
+};
+
+#endif
diff --git a/include/xine/refcounter.h b/include/xine/refcounter.h
new file mode 100644
index 000000000..9e2a58f67
--- /dev/null
+++ b/include/xine/refcounter.h
@@ -0,0 +1,42 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+#ifndef HAVE_REFCOUNTER_H
+#define HAVE_REFCOUNTER_H
+
+#include <pthread.h>
+
+typedef struct {
+ pthread_mutex_t lock;
+ void* object; /* referenced object */
+ void (*destructor)(void *); /* object destructor */
+ int count;
+} refcounter_t;
+
+typedef void (*refcounter_destructor)(void*);
+
+refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_MALLOC XINE_PROTECTED;
+
+int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED;
+
+int _x_refcounter_dec(refcounter_t *refcounter) XINE_PROTECTED;
+
+void _x_refcounter_dispose(refcounter_t *refcounter) XINE_PROTECTED;
+
+#endif /* HAVE_REFCOUNTER_H */
diff --git a/src/xine-engine/resample.h b/include/xine/resample.h
index 842434cf0..842434cf0 100644
--- a/src/xine-engine/resample.h
+++ b/include/xine/resample.h
diff --git a/src/xine-utils/ring_buffer.h b/include/xine/ring_buffer.h
index 7678aa903..7678aa903 100644
--- a/src/xine-utils/ring_buffer.h
+++ b/include/xine/ring_buffer.h
diff --git a/src/xine-engine/scratch.h b/include/xine/scratch.h
index c0c927b97..c0c927b97 100644
--- a/src/xine-engine/scratch.h
+++ b/include/xine/scratch.h
diff --git a/src/xine-utils/sorted_array.h b/include/xine/sorted_array.h
index 0d229199a..0d229199a 100644
--- a/src/xine-utils/sorted_array.h
+++ b/include/xine/sorted_array.h
diff --git a/include/xine/spu.h b/include/xine/spu.h
new file mode 100644
index 000000000..e53462236
--- /dev/null
+++ b/include/xine/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/include/xine/spu_decoder.h b/include/xine/spu_decoder.h
new file mode 100644
index 000000000..9ab926bdf
--- /dev/null
+++ b/include/xine/spu_decoder.h
@@ -0,0 +1,160 @@
+/*
+ * spu_decoder_api.h
+ *
+ * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
+ *
+ * This file is part of xine, a unix 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 GNU Make; see the file COPYING. If not, write to
+ * the Free Software Foundation,
+ *
+ */
+
+#ifndef HAVE_SPU_API_H
+#define HAVE_SPU_API_H
+
+#include <xine/os_types.h>
+#include <xine/buffer.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define SPU_DECODER_IFACE_VERSION 17
+
+/*
+ * generic xine spu decoder plugin interface
+ */
+
+typedef struct spu_decoder_class_s spu_decoder_class_t;
+typedef struct spu_decoder_s spu_decoder_t;
+
+struct spu_decoder_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ spu_decoder_t* (*open_plugin) (spu_decoder_class_t *this, xine_stream_t *stream);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * free all class-related resources
+ */
+ void (*dispose) (spu_decoder_class_t *this);
+};
+
+#define default_spu_decoder_class_dispose (void (*) (spu_decoder_class_t *this))free
+
+struct spu_decoder_s {
+
+ /*
+ * decode data from buf and feed the overlay to overlay manager
+ */
+ void (*decode_data) (spu_decoder_t *this, buf_element_t *buf);
+
+ /*
+ * reset decoder after engine flush (prepare for new
+ * SPU data not related to recently decoded data)
+ */
+ void (*reset) (spu_decoder_t *this);
+
+ /*
+ * inform decoder that a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
+ void (*discontinuity) (spu_decoder_t *this);
+
+ /*
+ * close down, free all resources
+ */
+ void (*dispose) (spu_decoder_t *this);
+
+ /*
+ * When the SPU decoder also handles data used in user interaction,
+ * you can query the related information here. The typical example
+ * for this is DVD NAV packets which are handled by the SPU decoder
+ * and can be received readily parsed from here.
+ * The caller and the decoder must agree on the structure which is
+ * passed here.
+ * This function pointer may be NULL, if the plugin does not have
+ * such functionality.
+ */
+ int (*get_interact_info) (spu_decoder_t *this, void *data);
+
+ /*
+ * When the SPU decoder also handles menu overlays for user inter-
+ * action, you can set a menu button here. The typical example for
+ * this is DVD menus.
+ * This function pointer may be NULL, if the plugin does not have
+ * such functionality.
+ */
+ void (*set_button) (spu_decoder_t *this_gen, int32_t button, int32_t mode);
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+};
+
+
+/* SPU decoders differ from video and audio decoders in one significant
+ * way: unlike audio and video, SPU streams are not continuous;
+ * this results in another difference, programmers have to consider:
+ * while both audio and video decoders are automatically blocked in
+ * their get_buffer()/get_frame() methods when the output cannot take
+ * any more data, this does not work for SPU, because it could take
+ * minutes before the next free slot becomes available and we must not
+ * block the decoder thread for that long;
+ * therefore, we provide a convenience function for SPU decoders which
+ * implements a wait until a timestamp sufficiently close to the VPTS
+ * of the next SPU is reached, but the waiting will end before that,
+ * if some outside condition requires us to release the decoder thread
+ * to other tasks;
+ * if this functions returns with 1, noone needs the decoder thread and
+ * you may continue waiting; if it returns 0, finish whatever you are
+ * doing and return;
+ * the usual pattern for SPU decoders is this:
+ *
+ * do {
+ * spu = prepare_spu();
+ * int thread_vacant = _x_spu_decoder_sleep(this->stream, spu->vpts);
+ * int success = process_spu(spu);
+ * } while (!success && thread_vacant);
+ */
+int _x_spu_decoder_sleep(xine_stream_t *, int64_t next_spu_vpts) XINE_PROTECTED;
+
+#endif /* HAVE_SPUDEC_H */
diff --git a/include/xine/vdr.h b/include/xine/vdr.h
new file mode 100644
index 000000000..4093472d9
--- /dev/null
+++ b/include/xine/vdr.h
@@ -0,0 +1,666 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#ifndef __VDR_H
+#define __VDR_H
+
+
+#define XINE_VDR_VERSION 901
+
+
+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
+ , func_discontinuity
+ , func_query_capabilities
+};
+
+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,
+ key_user0,
+};
+
+
+
+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;
+ uint16_t w_ref;
+ uint16_t h_ref;
+}
+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;
+ uint8_t argb;
+}
+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;
+ uint8_t i;
+}
+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;
+ uint8_t id;
+}
+data_wait_t;
+
+
+
+typedef struct __attribute__((packed)) result_wait_s
+{
+ result_header_t header;
+}
+result_wait_t;
+
+
+
+#define XINE_VDR_VOLUME_IGNORE 0
+#define XINE_VDR_VOLUME_CHANGE_HW 1
+#define XINE_VDR_VOLUME_CHANGE_SW 2
+
+#define XINE_VDR_MUTE_IGNORE 0
+#define XINE_VDR_MUTE_EXECUTE 1
+#define XINE_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;
+ int32_t interlaced;
+ int32_t crop_left;
+ int32_t crop_right;
+ int32_t crop_top;
+ int32_t crop_bottom;
+}
+result_grab_image_t;
+
+
+
+typedef struct __attribute__((packed)) data_get_pts_s
+{
+ data_header_t header;
+ int32_t ms_timeout;
+}
+data_get_pts_t;
+
+
+
+typedef struct __attribute__((packed)) result_get_pts_s
+{
+ result_header_t header;
+
+ int64_t pts;
+ int8_t queued;
+}
+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 struct __attribute__((packed)) event_discontinuity_s
+{
+ event_header_t header;
+
+ int32_t type;
+}
+event_discontinuity_t;
+
+
+
+typedef struct __attribute__((packed)) data_query_capabilities_s
+{
+ data_header_t header;
+}
+data_query_capabilities_t;
+
+
+
+typedef struct __attribute__((packed)) result_query_capabilities_s
+{
+ result_header_t header;
+
+ uint8_t osd_max_num_windows;
+ uint8_t osd_palette_max_depth;
+ uint8_t osd_palette_is_shared;
+ uint8_t osd_supports_argb_layer;
+ uint8_t osd_supports_custom_extent;
+}
+result_query_capabilities_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_query_capabilities_t query_capabilities;
+}
+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_query_capabilities_t query_capabilities;
+}
+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_discontinuity_t discontinuity;
+}
+event_union_t;
+
+
+
+#endif /* __VDR_H */
+
diff --git a/include/xine/version.h.in b/include/xine/version.h.in
new file mode 100644
index 000000000..75072708d
--- /dev/null
+++ b/include/xine/version.h.in
@@ -0,0 +1,25 @@
+/*
+ * 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, USA
+ */
+
+/* static info - which libxine release this header came from */
+#define XINE_MAJOR_VERSION @XINE_MAJOR@
+#define XINE_MINOR_VERSION @XINE_MINOR@
+#define XINE_SUB_VERSION @XINE_SUB@
+#define XINE_VERSION "@VERSION@"
diff --git a/include/xine/video_decoder.h b/include/xine/video_decoder.h
new file mode 100644
index 000000000..faf7eac51
--- /dev/null
+++ b/include/xine/video_decoder.h
@@ -0,0 +1,118 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine video decoder plugin interface
+ */
+
+#ifndef HAVE_VIDEO_DECODER_H
+#define HAVE_VIDEO_DECODER_H
+
+#include <xine/os_types.h>
+#include <xine/buffer.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+#define VIDEO_DECODER_IFACE_VERSION 19
+
+
+/*
+ * generic xine video decoder plugin interface
+ */
+
+typedef struct video_decoder_class_s video_decoder_class_t;
+typedef struct video_decoder_s video_decoder_t;
+
+struct video_decoder_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ video_decoder_t* (*open_plugin) (video_decoder_class_t *this, xine_stream_t *stream);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * free all class-related resources
+ */
+ void (*dispose) (video_decoder_class_t *this);
+};
+
+#define default_video_decoder_class_dispose (void (*) (video_decoder_class_t *this))free
+
+struct video_decoder_s {
+
+ /*
+ * decode data from buf and feed decoded frames to
+ * video output
+ */
+ void (*decode_data) (video_decoder_t *this, buf_element_t *buf);
+
+ /*
+ * reset decoder after engine flush (prepare for new
+ * video data not related to recently decoded data)
+ */
+ void (*reset) (video_decoder_t *this);
+
+ /*
+ * inform decoder that a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
+ void (*discontinuity) (video_decoder_t *this);
+
+ /*
+ * flush out any frames that are still stored in the decoder
+ */
+ void (*flush) (video_decoder_t *this);
+
+ /*
+ * close down, free all resources
+ */
+ void (*dispose) (video_decoder_t *this);
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+};
+
+#endif
diff --git a/include/xine/video_out.h b/include/xine/video_out.h
new file mode 100644
index 000000000..5a0401160
--- /dev/null
+++ b/include/xine/video_out.h
@@ -0,0 +1,538 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ * xine version of video_out.h
+ *
+ * vo_frame : frame containing yuv data and timing info,
+ * transferred between video_decoder and video_output
+ *
+ * vo_driver : lowlevel, platform-specific video output code
+ *
+ * vo_port : generic frame_handling code, uses
+ * a vo_driver for output
+ */
+
+#ifndef HAVE_VIDEO_OUT_H
+#define HAVE_VIDEO_OUT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <pthread.h>
+
+#include <xine.h>
+#include <xine/buffer.h>
+
+#ifdef XINE_COMPILE
+# include <xine/plugin_catalog.h>
+#endif
+
+typedef struct vo_frame_s vo_frame_t;
+typedef struct vo_driver_s vo_driver_t;
+typedef struct video_driver_class_s video_driver_class_t;
+typedef struct vo_overlay_s vo_overlay_t;
+typedef struct video_overlay_manager_s video_overlay_manager_t;
+
+/* public part, video drivers may add private fields
+ *
+ * Remember that adding new functions to this structure requires
+ * adaption of the post plugin decoration layer. Be sure to look into
+ * src/xine-engine/post.[ch].
+ */
+struct vo_frame_s {
+ /*
+ * member functions
+ */
+
+ /* Provide a copy of the frame's image in an image format already known to xine. data's member */
+ /* have already been intialized to frame's content on entry, so it's usually only necessary to */
+ /* change format and img_size. In case img is set, it will point to a memory block of suitable */
+ /* size (size has been determined by a previous call with img == NULL). img content and img_size */
+ /* must adhere to the specification of _x_get_current_frame_data(). */
+ /* Currently this is needed for all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2. */
+ void (*proc_provide_standard_frame_data) (vo_frame_t *vo_img, xine_current_frame_data_t *data);
+
+ /* Duplicate picture data and acceleration specific data of a frame. */
+ /* if the image format isn't already known by Xine. Currently this is needed */
+ /* For all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2 */
+ void (*proc_duplicate_frame_data) (vo_frame_t *vo_img, vo_frame_t *src);
+
+ /* tell video driver to copy/convert the whole of this frame, may be NULL */
+ /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */
+ void (*proc_frame) (vo_frame_t *vo_img);
+
+ /* tell video driver to copy/convert a slice of this frame, may be NULL */
+ /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */
+ void (*proc_slice) (vo_frame_t *vo_img, uint8_t **src);
+
+ /* tell video driver that the decoder starts a new field */
+ void (*field) (vo_frame_t *vo_img, int which_field);
+
+ /* append this frame to the display queue,
+ returns number of frames to skip if decoder is late */
+ /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */
+ int (*draw) (vo_frame_t *vo_img, xine_stream_t *stream);
+
+ /* lock frame as reference, must be paired with free.
+ * most decoders/drivers do not need to call this function since
+ * newly allocated frames are already locked once.
+ */
+ void (*lock) (vo_frame_t *vo_img);
+
+ /* this frame is no longer used by the decoder, video driver, etc */
+ void (*free) (vo_frame_t *vo_img);
+
+ /* free memory/resources for this frame */
+ void (*dispose) (vo_frame_t *vo_img);
+
+ /*
+ * public variables to decoders and vo drivers
+ * changing anything here will require recompiling them both
+ */
+ int64_t pts; /* presentation time stamp (1/90000 sec) */
+ int64_t vpts; /* virtual pts, generated by metronom */
+ int bad_frame; /* e.g. frame skipped or based on skipped frame */
+ int duration; /* frame length in time, in 1/90000 sec */
+
+ /* yv12 (planar) base[0]: y, base[1]: u, base[2]: v */
+ /* yuy2 (interleaved) base[0]: yuyv..., base[1]: --, base[2]: -- */
+ uint8_t *base[3];
+ int pitches[3];
+
+ /* info that can be used for interlaced output (e.g. tv-out) */
+ int top_field_first;
+ int repeat_first_field;
+ /* note: progressive_frame is set wrong on many mpeg2 streams. for
+ * that reason, this flag should be interpreted as a "hint".
+ */
+ int progressive_frame;
+ int picture_coding_type;
+
+ /* 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;
+
+ /* additional information to be able to duplicate frames: */
+ int width, height;
+ double ratio; /* aspect ratio */
+ int format; /* IMGFMT_YV12 or IMGFMT_YUY2 */
+
+ int drawn; /* used by decoder, frame has already been drawn */
+ int flags; /* remember the frame flags */
+ int proc_called; /* track use of proc_*() methods */
+
+ /* Used to carry private data for accelerated plugins.*/
+ void *accel_data;
+
+ /* "backward" references to where this frame originates from */
+ xine_video_port_t *port;
+ vo_driver_t *driver;
+ xine_stream_t *stream;
+
+ /* displacement for overlays */
+ int overlay_offset_x, overlay_offset_y;
+
+ /* pointer to the next frame in display order, used by some vo deint */
+ struct vo_frame_s *future_frame;
+
+ /*
+ * that part is used only by video_out.c for frame management
+ * obs: changing anything here will require recompiling vo drivers
+ */
+ struct vo_frame_s *next;
+
+ int id; /* debugging - track this frame */
+ int is_first;
+};
+
+
+/*
+ * Remember that adding new functions to this structure requires
+ * adaption of the post plugin decoration layer. Be sure to look into
+ * src/xine-engine/post.[ch].
+ */
+struct xine_video_port_s {
+
+ uint32_t (*get_capabilities) (xine_video_port_t *self); /* for constants see below */
+
+ /* open display driver for video output */
+ /* when you are not a full-blown stream, but still need to open the port
+ * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
+ void (*open) (xine_video_port_t *self, xine_stream_t *stream);
+
+ /*
+ * get_frame - allocate an image buffer from display driver
+ *
+ * params : width == width of video to display.
+ * height == height of video to display.
+ * ratio == aspect ration information
+ * format == FOURCC descriptor of image format
+ * flags == field/prediction flags
+ */
+ vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width,
+ uint32_t height, double ratio,
+ int format, int flags);
+
+ /* create a new grab video frame */
+ xine_grab_video_frame_t* (*new_grab_video_frame) (xine_video_port_t *self);
+
+ /* retrieves the last displayed frame (useful for taking snapshots) */
+ vo_frame_t* (*get_last_frame) (xine_video_port_t *self);
+
+ /* overlay stuff */
+ void (*enable_ovl) (xine_video_port_t *self, int ovl_enable);
+
+ /* get overlay manager */
+ video_overlay_manager_t* (*get_overlay_manager) (xine_video_port_t *self);
+
+ /* 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
+ */
+ int (*get_property) (xine_video_port_t *self, int property);
+ int (*set_property) (xine_video_port_t *self, int property, int value);
+
+ /* return true if port is opened for this stream, stream can be anonymous */
+ int (*status) (xine_video_port_t *self, xine_stream_t *stream,
+ int *width, int *height, int64_t *img_duration);
+
+ /* video driver is no longer used by decoder => close */
+ /* when you are not a full-blown stream, but still need to close the port
+ * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
+ void (*close) (xine_video_port_t *self, xine_stream_t *stream);
+
+ /* called on xine exit */
+ void (*exit) (xine_video_port_t *self);
+
+ /* the driver in use */
+ vo_driver_t *driver;
+
+};
+
+/* constants for the get/set property functions */
+#define VO_PROP_INTERLACED 0
+#define VO_PROP_ASPECT_RATIO 1
+#define VO_PROP_HUE 2
+#define VO_PROP_SATURATION 3
+#define VO_PROP_CONTRAST 4
+#define VO_PROP_BRIGHTNESS 5
+#define VO_PROP_COLORKEY 6
+#define VO_PROP_AUTOPAINT_COLORKEY 7
+#define VO_PROP_ZOOM_X 8
+#define VO_PROP_PAN_SCAN 9
+#define VO_PROP_TVMODE 10
+#define VO_PROP_MAX_NUM_FRAMES 11
+#define VO_PROP_GAMMA 12
+#define VO_PROP_ZOOM_Y 13
+#define VO_PROP_DISCARD_FRAMES 14 /* not used by drivers */
+#define VO_PROP_WINDOW_WIDTH 15 /* read-only */
+#define VO_PROP_WINDOW_HEIGHT 16 /* read-only */
+#define VO_PROP_BUFS_IN_FIFO 17 /* read-only */
+#define VO_PROP_NUM_STREAMS 18 /* read-only */
+#define VO_PROP_OUTPUT_WIDTH 19 /* read-only */
+#define VO_PROP_OUTPUT_HEIGHT 20 /* read-only */
+#define VO_PROP_OUTPUT_XOFFSET 21 /* read-only */
+#define VO_PROP_OUTPUT_YOFFSET 22 /* read-only */
+#define VO_PROP_SHARPNESS 24
+#define VO_PROP_NOISE_REDUCTION 25
+#define VO_PROP_BUFS_TOTAL 26 /* read-only */
+#define VO_PROP_BUFS_FREE 27 /* read-only */
+#define VO_NUM_PROPERTIES 28
+
+/* 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. */
+#define OVL_PALETTE_SIZE 256
+
+#define OVL_MAX_OPACITY 0x0f
+
+/* number of recent frames to keep in memory
+ these frames are needed by some deinterlace algorithms
+ FIXME: we need a method to flush the recent frames (new stream)
+*/
+#define VO_NUM_RECENT_FRAMES 2
+
+/* get_frame flags */
+#define VO_TOP_FIELD 1
+#define VO_BOTTOM_FIELD 2
+#define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD)
+#define VO_PAN_SCAN_FLAG 4
+#define VO_INTERLACED_FLAG 8
+#define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (used by XvMC) */
+#define VO_CHROMA_422 32 /* used by VDPAU, default is chroma_420 */
+#define VO_STILL_IMAGE 64
+
+/* video driver capabilities */
+#define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4:2:0 pictures */
+#define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2 pictures */
+#define VO_CAP_XVMC_MOCOMP 0x00000004 /* driver can use XvMC motion compensation */
+#define VO_CAP_XVMC_IDCT 0x00000008 /* driver can use XvMC idct acceleration */
+#define VO_CAP_UNSCALED_OVERLAY 0x00000010 /* driver can blend overlay at output resolution */
+#define VO_CAP_CROP 0x00000020 /* driver can crop */
+#define VO_CAP_XXMC 0x00000040 /* driver can use extended XvMC */
+#define VO_CAP_VDPAU_H264 0x00000080 /* driver can use VDPAU for H264 */
+#define VO_CAP_VDPAU_MPEG12 0x00000100 /* driver can use VDPAU for mpeg1/2 */
+#define VO_CAP_VDPAU_VC1 0x00000200 /* driver can use VDPAU for VC1 */
+#define VO_CAP_VDPAU_MPEG4 0x00000400 /* driver can use VDPAU for mpeg4-part2 */
+#define VO_CAP_HUE 0x00010000
+#define VO_CAP_SATURATION 0x00020000
+#define VO_CAP_CONTRAST 0x00040000
+#define VO_CAP_BRIGHTNESS 0x00080000
+#define VO_CAP_COLORKEY 0x00100000
+#define VO_CAP_AUTOPAINT_COLORKEY 0x00200000
+#define VO_CAP_ZOOM_X 0x00400000
+#define VO_CAP_ZOOM_Y 0x00800000
+#define VO_CAP_CUSTOM_EXTENT_OVERLAY 0x01000000 /* driver can blend custom extent overlay to output extent */
+#define VO_CAP_ARGB_LAYER_OVERLAY 0x02000000 /* driver supports true color overlay */
+#define VO_CAP_VIDEO_WINDOW_OVERLAY 0x04000000 /* driver can scale video to an area within overlay */
+#define VO_CAP_GAMMA 0x08000000
+#define VO_CAP_SHARPNESS 0x10000000
+#define VO_CAP_NOISE_REDUCTION 0x20000000
+
+
+/*
+ * vo_driver_s contains the functions every display driver
+ * has to implement. The vo_new_port function (see below)
+ * should then be used to construct a vo_port using this
+ * driver. Some of the function pointers will be copied
+ * directly into xine_video_port_s, others will be called
+ * from generic vo functions.
+ */
+
+#define VIDEO_OUT_DRIVER_IFACE_VERSION 22
+
+struct vo_driver_s {
+
+ uint32_t (*get_capabilities) (vo_driver_t *self); /* for constants see above */
+
+ /*
+ * allocate an vo_frame_t struct,
+ * the driver must supply the copy, field and dispose functions
+ */
+ vo_frame_t* (*alloc_frame) (vo_driver_t *self);
+
+ /*
+ * check if the given image fullfills the format specified
+ * (re-)allocate memory if necessary
+ */
+ void (*update_frame_format) (vo_driver_t *self, vo_frame_t *img,
+ uint32_t width, uint32_t height,
+ double ratio, int format, int flags);
+
+ /* display a given frame */
+ void (*display_frame) (vo_driver_t *self, vo_frame_t *vo_img);
+
+ /* overlay_begin and overlay_end are used by drivers suporting
+ * persistent overlays. they can be optimized to update only when
+ * overlay image has changed.
+ *
+ * sequence of operation (pseudo-code):
+ * overlay_begin(this,img,true_if_something_changed_since_last_blend );
+ * while(visible_overlays)
+ * overlay_blend(this,img,overlay[i]);
+ * overlay_end(this,img);
+ *
+ * any function pointer from this group may be set to NULL.
+ */
+ void (*overlay_begin) (vo_driver_t *self, vo_frame_t *vo_img, int changed);
+ void (*overlay_blend) (vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay);
+ void (*overlay_end) (vo_driver_t *self, vo_frame_t *vo_img);
+
+ /*
+ * these can be used by the gui directly:
+ */
+ int (*get_property) (vo_driver_t *self, int property);
+ int (*set_property) (vo_driver_t *self,
+ int property, int value);
+ void (*get_property_min_max) (vo_driver_t *self,
+ int property, int *min, int *max);
+
+ /*
+ * general purpose communication channel between gui and driver
+ *
+ * this should be used to propagate events, display data, window sizes
+ * etc. to the driver
+ */
+ int (*gui_data_exchange) (vo_driver_t *self, int data_type,
+ void *data);
+
+ /* check if a redraw is needed (due to resize)
+ * this is only used for still frames, normal video playback
+ * must call that inside display_frame() function.
+ */
+ int (*redraw_needed) (vo_driver_t *self);
+
+ /* Create a new grab video frame */
+ xine_grab_video_frame_t* (*new_grab_video_frame)(vo_driver_t *self);
+
+ /*
+ * free all resources, close driver
+ */
+ void (*dispose) (vo_driver_t *self);
+
+ /**
+ * @brief Pointer to the loaded plugin node.
+ *
+ * Used by the plugins loader. It's an opaque type when using the
+ * structure outside of xine's build.
+ */
+#ifdef XINE_COMPILE
+ plugin_node_t *node;
+#else
+ void *node;
+#endif
+};
+
+struct video_driver_class_s {
+
+ /*
+ * open a new instance of this plugin class
+ */
+ vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visual);
+
+ /**
+ * @brief short human readable identifier for this plugin class
+ */
+ const char *identifier;
+
+ /**
+ * @brief human readable (verbose = 1 line) description for this plugin class
+ *
+ * The description is passed to gettext() to internationalise.
+ */
+ const char *description;
+
+ /**
+ * @brief Optional non-standard catalog to use with dgettext() for description.
+ */
+ const char *text_domain;
+
+ /*
+ * free all class-related resources
+ */
+ void (*dispose) (video_driver_class_t *self);
+};
+
+#define default_video_driver_class_dispose (void (*) (video_driver_class_t *this))free
+
+typedef struct rle_elem_s {
+ uint16_t len;
+ uint16_t color;
+} rle_elem_t;
+
+typedef struct argb_layer_s {
+ pthread_mutex_t mutex;
+ uint32_t *buffer;
+ /* dirty area */
+ int x1, y1;
+ int x2, y2;
+ int ref_count;
+} argb_layer_t;
+
+struct vo_overlay_s {
+
+ rle_elem_t *rle; /* rle code buffer */
+ int data_size; /* useful for deciding realloc */
+ int num_rle; /* number of active rle codes */
+ int x; /* x start of subpicture area */
+ int y; /* y start of subpicture area */
+ int width; /* width of subpicture area */
+ int height; /* height of subpicture area */
+
+ /* area within osd extent to scale video to */
+ int video_window_x;
+ int video_window_y;
+ int video_window_width;
+ int video_window_height;
+
+ /* extent of reference coordinate system */
+ int extent_width;
+ int extent_height;
+
+ uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */
+ uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */
+ int rgb_clut; /* true if clut was converted to rgb */
+
+ /* define a highlight area with different colors */
+ int hili_top;
+ int hili_bottom;
+ int hili_left;
+ int hili_right;
+ uint32_t hili_color[OVL_PALETTE_SIZE];
+ uint8_t hili_trans[OVL_PALETTE_SIZE];
+ int hili_rgb_clut; /* true if clut was converted to rgb */
+
+ int unscaled; /* true if it should be blended unscaled */
+
+ argb_layer_t *argb_layer;
+};
+
+void set_argb_layer_ptr(argb_layer_t **dst, argb_layer_t *src);
+
+/* API to video_overlay manager
+ *
+ * Remember that adding new functions to this structure requires
+ * adaption of the post plugin decoration layer. Be sure to look into
+ * src/xine-engine/post.[ch].
+ */
+struct video_overlay_manager_s {
+ void (*init) (video_overlay_manager_t *this_gen);
+
+ void (*dispose) (video_overlay_manager_t *this_gen);
+
+ int32_t (*get_handle) (video_overlay_manager_t *this_gen, int object_type );
+
+ void (*free_handle) (video_overlay_manager_t *this_gen, int32_t handle);
+
+ int32_t (*add_event) (video_overlay_manager_t *this_gen, void *event);
+
+ void (*flush_events) (video_overlay_manager_t *this_gen );
+
+ int (*redraw_needed) (video_overlay_manager_t *this_gen, int64_t vpts );
+
+ void (*multiple_overlay_blend) (video_overlay_manager_t *this_gen, int64_t vpts,
+ vo_driver_t *output, vo_frame_t *vo_img, int enabled);
+};
+
+/**
+ * @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_MALLOC;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/include/xine/video_overlay.h b/include/xine/video_overlay.h
new file mode 100644
index 000000000..ba710c9c9
--- /dev/null
+++ b/include/xine/video_overlay.h
@@ -0,0 +1,64 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#ifndef HAVE_VIDEO_OVERLAY_H
+#define HAVE_VIDEO_OVERLAY_H
+
+#include <xine/xine_internal.h>
+
+#ifdef __GNUC__
+#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) {y: (_y), cr: (_cr), cb: (_cb)}
+#else
+#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) { (_cb), (_cr), (_y) }
+#endif
+
+#define MAX_OBJECTS 50
+#define MAX_EVENTS 50
+#define MAX_SHOWING (5 + 16)
+
+#define OVERLAY_EVENT_NULL 0
+#define OVERLAY_EVENT_SHOW 1
+#define OVERLAY_EVENT_HIDE 2
+#define OVERLAY_EVENT_MENU_BUTTON 3
+#define OVERLAY_EVENT_FREE_HANDLE 8 /* Frees a handle, previous allocated via get_handle */
+
+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; /* If NULL, no palette contained in this event. */
+ 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 {
+ 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;
+
+video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_MALLOC XINE_PROTECTED;
+
+#endif
diff --git a/include/xine/vo_scale.h b/include/xine/vo_scale.h
new file mode 100644
index 000000000..31976329d
--- /dev/null
+++ b/include/xine/vo_scale.h
@@ -0,0 +1,195 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * vo_scale.h
+ *
+ * keeps video scaling information
+ */
+
+#ifndef HAVE_VO_SCALE_H
+#define HAVE_VO_SCALE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <xine/configfile.h>
+
+typedef struct {
+ int x, y;
+ int w, h;
+} vo_scale_rect_t;
+
+struct vo_scale_s {
+
+ /* true if driver supports frame zooming */
+ int support_zoom;
+
+ /* forces direct mapping between frame pixels and screen pixels */
+ int scaling_disabled;
+
+ /* size / aspect ratio calculations */
+
+ /*
+ * "delivered" size:
+ * frame dimension / aspect as delivered by the decoder
+ * used (among other things) to detect frame size changes
+ * units: frame pixels
+ */
+ int delivered_width;
+ int delivered_height;
+ double delivered_ratio;
+
+ /*
+ * required cropping:
+ * units: frame pixels
+ */
+ int crop_left;
+ int crop_right;
+ int crop_top;
+ int crop_bottom;
+
+ /*
+ * displayed part of delivered images,
+ * taking zoom into account
+ * units: frame pixels
+ */
+ int displayed_xoffset;
+ int displayed_yoffset;
+ int displayed_width;
+ int displayed_height;
+ double zoom_factor_x, zoom_factor_y;
+
+ /*
+ * user's aspect selection
+ */
+ int user_ratio;
+
+ /*
+ * "gui" size / offset:
+ * what gui told us about where to display the video
+ * units: screen pixels
+ */
+ int gui_x, gui_y;
+ 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
+ * This may be corrected by the driver in order to fit the video seamlessly
+ */
+ double gui_pixel_aspect;
+ double video_pixel_aspect;
+
+ /*
+ * "output" size:
+ *
+ * this is finally the ideal size "fitted" into the
+ * gui size while maintaining the aspect ratio
+ * units: screen pixels
+ */
+ int output_width;
+ int output_height;
+ int output_xoffset;
+ int output_yoffset;
+
+
+ /* gui callbacks */
+
+ void *user_data;
+ void (*frame_output_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_x, int *dest_y,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect,
+ int *win_x, int *win_y);
+
+ void (*dest_size_cb) (void *user_data,
+ int video_width, int video_height,
+ double video_pixel_aspect,
+ int *dest_width, int *dest_height,
+ double *dest_pixel_aspect);
+
+ /* borders */
+ vo_scale_rect_t border[4];
+
+ /*
+ * border ratios to determine image position in the
+ * viewport; these are set by user config
+ */
+ double output_horizontal_position;
+ double output_vertical_position;
+
+};
+
+typedef struct vo_scale_s vo_scale_t;
+
+
+/*
+ * convert delivered height/width to ideal width/height
+ * taking into account aspect ratio and zoom factor
+ */
+
+void _x_vo_scale_compute_ideal_size (vo_scale_t *self) XINE_PROTECTED;
+
+
+/*
+ * make ideal width/height "fit" into the gui
+ */
+
+void _x_vo_scale_compute_output_size (vo_scale_t *self) XINE_PROTECTED;
+
+/*
+ * return true if a redraw is needed due resizing, zooming,
+ * aspect ratio changing, etc.
+ */
+
+int _x_vo_scale_redraw_needed (vo_scale_t *self) XINE_PROTECTED;
+
+/*
+ *
+ */
+
+void _x_vo_scale_translate_gui2video(vo_scale_t *self,
+ int x, int y,
+ int *vid_x, int *vid_y) XINE_PROTECTED;
+
+/*
+ * Returns description of a given ratio code
+ */
+
+extern const char _x_vo_scale_aspect_ratio_name_table[][8] XINE_PROTECTED;
+
+/*
+ * initialize rescaling struct
+ */
+
+void _x_vo_scale_init(vo_scale_t *self, int support_zoom,
+ int scaling_disabled, config_values_t *config ) XINE_PROTECTED;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/xine/xine_buffer.h b/include/xine/xine_buffer.h
new file mode 100644
index 000000000..7f6a3921d
--- /dev/null
+++ b/include/xine/xine_buffer.h
@@ -0,0 +1,132 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ *
+ * generic dynamic buffer functions. The goals
+ * of these functions are (in fact many of these points
+ * are todos):
+ * - dynamic allocation and reallocation depending
+ * on the size of data written to it.
+ * - fast and transparent access to the data.
+ * The user sees only the raw data chunk as it is
+ * returned by the well-known malloc function.
+ * This is necessary since not all data-accessing
+ * functions can be wrapped here.
+ * - some additional health checks are made during
+ * development (eg boundary checks after direct
+ * access to a buffer). This can be turned off in
+ * production state for higher performance.
+ * - A lot of convenient string and memory manipulation
+ * functions are implemented here, where the user
+ * do not have to care about memory chunk sizes.
+ * - Some garbage collention could be implemented as well;
+ * i think of a global structure containing infos
+ * about all allocated chunks. This must be implemented
+ * in a thread-save way...
+ *
+ * Here are some drawbacks (aka policies):
+ * - The user must not pass indexed buffers to xine_buffer_*
+ * functions.
+ * - The pointers passed to xine_buffer_* functions may change
+ * (eg during reallocation). The user must respect that.
+ */
+
+#ifndef HAVE_XINE_BUFFER_H
+#define HAVE_XINE_BUFFER_H
+
+#include <xine/os_types.h>
+
+/*
+ * returns an initialized pointer to a buffer.
+ * The buffer will be allocated in blocks of
+ * chunk_size bytes. This will prevent permanent
+ * reallocation on slow growing buffers.
+ */
+void *xine_buffer_init(int chunk_size) XINE_PROTECTED;
+
+/*
+ * frees a buffer, the macro ensures, that a freed
+ * buffer pointer is set to NULL
+ */
+#define xine_buffer_free(buf) buf=_xine_buffer_free(buf)
+void *_xine_buffer_free(void *buf) XINE_PROTECTED;
+
+/*
+ * duplicates a buffer
+ */
+void *xine_buffer_dup(const void *buf) XINE_PROTECTED;
+
+/*
+ * will copy len bytes of data into buf at position index.
+ */
+#define xine_buffer_copyin(buf,i,data,len) \
+ buf=_xine_buffer_copyin(buf,i,data,len)
+void *_xine_buffer_copyin(void *buf, int index, const void *data, int len) XINE_PROTECTED;
+
+/*
+ * will copy len bytes out of buf+index into data.
+ * no checks are made in data. It is treated as an ordinary
+ * user-malloced data chunk.
+ */
+void xine_buffer_copyout(const void *buf, int index, void *data, int len) XINE_PROTECTED;
+
+/*
+ * set len bytes in buf+index to b.
+ */
+#define xine_buffer_set(buf,i,b,len) \
+ buf=_xine_buffer_set(buf,i,b,len)
+void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) XINE_PROTECTED;
+
+/*
+ * concatenates given buf (which should contain a null terminated string)
+ * with another string.
+ */
+#define xine_buffer_strcat(buf,data) \
+ buf=_xine_buffer_strcat(buf,data)
+void *_xine_buffer_strcat(void *buf, const char *data) XINE_PROTECTED;
+
+/*
+ * copies given string to buf+index
+ */
+#define xine_buffer_strcpy(buf,index,data) \
+ buf=_xine_buffer_strcpy(buf,index,data)
+void *_xine_buffer_strcpy(void *buf, int index, const char *data) XINE_PROTECTED;
+
+/*
+ * returns a pointer to the first occurence of ch.
+ * note, that the returned pointer cannot be used
+ * in any other xine_buffer_* functions.
+ */
+char *xine_buffer_strchr(const void *buf, int ch) XINE_PROTECTED;
+
+/*
+ * get allocated memory size
+ */
+int xine_buffer_get_size(const void *buf) XINE_PROTECTED;
+
+/*
+ * ensures a specified buffer size if the user want to
+ * write directly to the buffer. Normally the special
+ * access functions defined here should be used.
+ */
+#define xine_buffer_ensure_size(buf,data) \
+ buf=_xine_buffer_ensure_size(buf,data)
+void *_xine_buffer_ensure_size(void *buf, int size) XINE_PROTECTED;
+
+#endif
diff --git a/include/xine/xine_internal.h b/include/xine/xine_internal.h
new file mode 100644
index 000000000..ea0f0074a
--- /dev/null
+++ b/include/xine/xine_internal.h
@@ -0,0 +1,544 @@
+/*
+ * Copyright (C) 2000-2005 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, USA
+ */
+
+#ifndef HAVE_XINE_INTERNAL_H
+#define HAVE_XINE_INTERNAL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * include public part of xine header
+ */
+
+#include <xine.h>
+#include <xine/refcounter.h>
+#include <xine/input_plugin.h>
+#include <xine/demux.h>
+#include <xine/video_out.h>
+#include <xine/audio_out.h>
+#include <xine/metronom.h>
+#include <xine/osd.h>
+#include <xine/xineintl.h>
+#include <xine/plugin_catalog.h>
+#include <xine/video_decoder.h>
+#include <xine/audio_decoder.h>
+#include <xine/spu_decoder.h>
+#include <xine/scratch.h>
+#include <xine/broadcaster.h>
+#include <xine/io_helper.h>
+#include <xine/info_helper.h>
+#include <xine/alphablend.h>
+
+#define XINE_MAX_EVENT_LISTENERS 50
+#define XINE_MAX_EVENT_TYPES 100
+#define XINE_MAX_TICKET_HOLDER_THREADS 64
+
+/* used by plugin loader */
+#define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINOR_VERSION*100+XINE_SUB_VERSION
+
+
+/*
+ * log constants
+ */
+
+#define XINE_LOG_MSG 0 /* warnings, errors, ... */
+#define XINE_LOG_PLUGIN 1
+#define XINE_LOG_TRACE 2
+#define XINE_LOG_NUM 3 /* # of log buffers defined */
+
+#define XINE_STREAM_INFO_MAX 99
+
+typedef struct xine_ticket_s xine_ticket_t;
+
+/*
+ * the "big" xine struct, holding everything together
+ */
+
+#ifndef XDG_BASEDIR_H
+/* present here for internal convenience only */
+typedef struct { void *reserved; } xdgHandle;
+#endif
+
+struct xine_s {
+
+ config_values_t *config;
+
+ 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];
+
+ xine_list_t *streams;
+ pthread_mutex_t streams_lock;
+
+ metronom_clock_t *clock;
+
+ /** Handle for libxdg-basedir functions. */
+ xdgHandle basedir_handle;
+
+#ifdef XINE_ENGINE_INTERNAL
+ xine_ticket_t *port_ticket;
+ pthread_mutex_t log_lock;
+
+ xine_log_cb_t log_cb;
+ void *log_cb_user_data;
+#endif
+};
+
+/* FIXME-ABI Some global flag bits */
+/* See xine_set_flags() */
+#ifdef XINE_ENGINE_INTERNAL
+extern int _x_flags XINE_PROTECTED;
+#endif
+
+/*
+ * xine thread tickets
+ */
+
+struct xine_ticket_s {
+
+ /* the ticket owner must assure to check for ticket revocation in
+ * intervals of finite length; this means that you must release
+ * the ticket before any operation that might block
+ *
+ * you must never write to this member directly
+ */
+ int ticket_revoked;
+
+ /* apply for a ticket; between acquire and relese of an irrevocable
+ * ticket (be sure to pair them properly!), it is guaranteed that you
+ * will never be blocked by ticket revocation */
+ void (*acquire)(xine_ticket_t *self, int irrevocable);
+
+ /* give a ticket back */
+ void (*release)(xine_ticket_t *self, int irrevocable);
+
+ /* renew a ticket, when it has been revoked, see ticket_revoked above;
+ * irrevocable must be set to one, if your thread might have acquired
+ * irrevocable tickets you don't know of; set it to zero only when
+ * you know that this is impossible */
+ void (*renew)(xine_ticket_t *self, int irrevocable);
+
+#ifdef XINE_ENGINE_INTERNAL
+ /* allow handing out new tickets */
+ void (*issue)(xine_ticket_t *self, int atomic);
+
+ /* revoke all tickets and deny new ones;
+ * a pair of atomic revoke and issue cannot be interrupted by another
+ * revocation or by other threads acquiring tickets */
+ void (*revoke)(xine_ticket_t *self, int atomic);
+
+ /* behaves like acquire() but doesn't block the calling thread; when
+ * the thread would have been blocked, 0 is returned otherwise 1
+ * this function acquires a ticket even if ticket revocation is active */
+ int (*acquire_nonblocking)(xine_ticket_t *self, int irrevocable);
+
+ /* behaves like release() but doesn't block the calling thread; should
+ * 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;
+ pthread_mutex_t revoke_lock;
+ pthread_cond_t issued;
+ pthread_cond_t revoked;
+ int tickets_granted;
+ int irrevocable_tickets;
+ int pending_revocations;
+ int atomic_revoke;
+ pthread_t atomic_revoker_thread;
+ pthread_mutex_t port_rewiring_lock;
+ struct {
+ int count;
+ pthread_t holder;
+ } *holder_threads;
+ unsigned holder_thread_count;
+#endif
+};
+
+/*
+ * xine event queue
+ */
+
+struct xine_event_queue_s {
+ xine_list_t *events;
+ pthread_mutex_t lock;
+ pthread_cond_t new_event;
+ 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;
+};
+
+/*
+ * xine_stream - per-stream parts of the xine engine
+ */
+
+struct xine_stream_s {
+
+ /* reference to xine context */
+ xine_t *xine;
+
+ /* metronom instance used by current stream */
+ metronom_t *metronom;
+
+ /* demuxers use input_plugin to read data */
+ input_plugin_t *input_plugin;
+
+ /* used by video decoders */
+ xine_video_port_t *video_out;
+
+ /* demuxers send data to video decoders using this fifo */
+ fifo_buffer_t *video_fifo;
+
+ /* used by audio decoders */
+ xine_audio_port_t *audio_out;
+
+ /* demuxers send data to audio decoders using this fifo */
+ fifo_buffer_t *audio_fifo;
+
+ /* provide access to osd api */
+ osd_renderer_t *osd_renderer;
+
+ /* master/slave streams */
+ xine_stream_t *master; /* usually a pointer to itself */
+ xine_stream_t *slave;
+
+ /* input_dvd uses this one. is it possible to add helper functions instead? */
+ spu_decoder_t *spu_decoder_plugin;
+
+ /* dxr3 use this one, should be possible to fix to use the port instead */
+ vo_driver_t *video_driver;
+
+ /* these definitely should be made private! */
+ int audio_channel_auto;
+ int spu_decoder_streamtype;
+ int spu_channel_user;
+ int spu_channel_auto;
+ 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 */
+
+ int status;
+
+ /* lock controlling speed change access */
+ pthread_mutex_t speed_change_lock;
+ 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 */
+ uint32_t keep_ao_driver_open:1;
+
+ input_class_t *eject_class;
+ demux_plugin_t *demux_plugin;
+
+/* vo_driver_t *video_driver;*/
+ pthread_t video_thread;
+ video_decoder_t *video_decoder_plugin;
+ 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;
+ audio_decoder_t *audio_decoder_plugin;
+ extra_info_t *audio_decoder_extra_info;
+
+ uint32_t audio_type;
+ /* *_user: -2 => off
+ -1 => auto (use *_auto value)
+ >=0 => respect the user's choice
+ */
+ int audio_channel_user;
+/* int audio_channel_auto; */
+
+/* spu_decoder_t *spu_decoder_plugin; */
+/* int spu_decoder_streamtype; */
+ uint32_t spu_track_map[50];
+ int spu_track_map_entries;
+/* int spu_channel_user; */
+/* int spu_channel_auto; */
+/* int spu_channel_letterbox; */
+ int spu_channel_pan_scan;
+/* int spu_channel; */
+
+ /* lock for public xine player functions */
+ pthread_mutex_t frontend_lock;
+
+ /* stream meta information */
+ /* NEVER access directly, use helpers (see info_helper.c) */
+ pthread_mutex_t info_mutex;
+ int stream_info_public[XINE_STREAM_INFO_MAX];
+ int stream_info[XINE_STREAM_INFO_MAX];
+ pthread_mutex_t meta_mutex;
+ char *meta_info_public[XINE_STREAM_INFO_MAX];
+ char *meta_info[XINE_STREAM_INFO_MAX];
+
+ /* seeking slowdown */
+ pthread_mutex_t first_frame_lock;
+ pthread_cond_t first_frame_reached;
+
+ /* wait for headers sent / stream decoding finished */
+ pthread_mutex_t counter_lock;
+ pthread_cond_t counter_changed;
+ int header_count_audio;
+ int header_count_video;
+ int finished_count_audio;
+ int finished_count_video;
+
+ /* event mechanism */
+ xine_list_t *event_queues;
+ pthread_mutex_t event_queues_lock;
+
+ /* demux thread stuff */
+ pthread_t demux_thread;
+ pthread_mutex_t demux_lock;
+ pthread_mutex_t demux_action_lock;
+ pthread_cond_t demux_resume;
+ 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;
+
+ 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;
+#endif
+};
+
+/* when explicitly noted, some functions accept an anonymous stream,
+ * which is a valid stream that does not want to be addressed. */
+#define XINE_ANON_STREAM ((xine_stream_t *)-1)
+
+typedef struct
+{
+ int total;
+ int ready;
+ int avail;
+}
+xine_query_buffers_data_t;
+
+typedef struct
+{
+ xine_query_buffers_data_t vi;
+ xine_query_buffers_data_t ai;
+ xine_query_buffers_data_t vo;
+ xine_query_buffers_data_t ao;
+}
+xine_query_buffers_t;
+
+/*
+ * private function prototypes:
+ */
+
+int _x_query_buffers(xine_stream_t *stream, xine_query_buffers_t *query) XINE_PROTECTED;
+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;
+
+/* report message to UI. usually these are async errors */
+
+int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PROTECTED;
+
+/* flush the message queues */
+
+void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED;
+
+/* extra_info operations */
+void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED;
+
+void _x_extra_info_merge( extra_info_t *dst, extra_info_t *src ) XINE_PROTECTED;
+
+void _x_get_current_info (xine_stream_t *stream, extra_info_t *extra_info, int size) XINE_PROTECTED;
+
+
+/* demuxer helper functions from demux.c */
+
+/*
+ * Flush audio and video buffers. It is called from demuxers on
+ * seek/stop, and may be useful when user input changes a stream and
+ * xine-lib has cached buffers that have yet to be played.
+ *
+ * warning: after clearing decoders fifos an absolute discontinuity
+ * indication must be sent. relative discontinuities are likely
+ * to cause "jumps" on metronom.
+ */
+void _x_demux_flush_engine (xine_stream_t *stream) XINE_PROTECTED;
+
+void _x_demux_control_nop (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED;
+void _x_demux_control_newpts (xine_stream_t *stream, int64_t pts, uint32_t flags) XINE_PROTECTED;
+void _x_demux_control_headers_done (xine_stream_t *stream) XINE_PROTECTED;
+void _x_demux_control_start (xine_stream_t *stream) XINE_PROTECTED;
+void _x_demux_control_end (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED;
+int _x_demux_start_thread (xine_stream_t *stream) XINE_PROTECTED;
+int _x_demux_stop_thread (xine_stream_t *stream) XINE_PROTECTED;
+int _x_demux_read_header (input_plugin_t *input, void *buffer, off_t size) XINE_PROTECTED;
+int _x_demux_check_extension (const char *mrl, const char *extensions);
+
+off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_PROTECTED;
+
+int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED;
+
+void _x_action_raise (xine_stream_t *stream) XINE_PROTECTED;
+void _x_action_lower (xine_stream_t *stream) XINE_PROTECTED;
+
+void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size,
+ int64_t pts, uint32_t type, uint32_t decoder_flags,
+ int input_normpos, int input_time, int total_time,
+ uint32_t frame_number) XINE_PROTECTED;
+
+int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input,
+ int size, int64_t pts, uint32_t type,
+ uint32_t decoder_flags, off_t input_normpos,
+ int input_time, int total_time,
+ uint32_t frame_number) XINE_PROTECTED;
+
+void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative,
+ const char *mrl, const char *title,
+ int start_time, int duration) XINE_PROTECTED;
+
+/*
+ * MRL escaped-character decoding (overwrites the source string)
+ */
+void _x_mrl_unescape(char *mrl) XINE_PROTECTED;
+
+/*
+ * plugin_loader functions
+ *
+ */
+
+/* on-demand loading of audio/video/spu decoder plugins */
+
+video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED;
+void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *decoder) XINE_PROTECTED;
+audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED;
+void _x_free_audio_decoder (xine_stream_t *stream, audio_decoder_t *decoder) XINE_PROTECTED;
+spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED;
+void _x_free_spu_decoder (xine_stream_t *stream, spu_decoder_t *decoder) XINE_PROTECTED;
+/* check for decoder availability - but don't try to initialize it */
+int _x_decoder_available (xine_t *xine, uint32_t buftype) XINE_PROTECTED;
+
+/*
+ * load_video_output_plugin
+ *
+ * load a specific video output plugin
+ */
+
+vo_driver_t *_x_load_video_output_plugin(xine_t *this,
+ char *id, int visual_type, void *visual) XINE_PROTECTED;
+
+/*
+ * audio output plugin dynamic loading stuff
+ */
+
+/*
+ * load_audio_output_plugin
+ *
+ * load a specific audio output plugin
+ */
+
+ao_driver_t *_x_load_audio_output_plugin (xine_t *self, const char *id) XINE_PROTECTED;
+
+
+void _x_set_speed (xine_stream_t *stream, int speed) XINE_PROTECTED;
+
+int _x_get_speed (xine_stream_t *stream) XINE_PROTECTED;
+
+void _x_set_fine_speed (xine_stream_t *stream, int speed) XINE_PROTECTED;
+
+int _x_get_fine_speed (xine_stream_t *stream) XINE_PROTECTED;
+
+void _x_select_spu_channel (xine_stream_t *stream, int channel) XINE_PROTECTED;
+
+int _x_get_audio_channel (xine_stream_t *stream) XINE_PROTECTED;
+
+int _x_get_spu_channel (xine_stream_t *stream) XINE_PROTECTED;
+
+/*
+ * internal events
+ */
+
+/* sent by dvb frontend to inform ts demuxer of new pids */
+#define XINE_EVENT_PIDS_CHANGE 0x80000000
+/* sent by BluRay input plugin to inform ts demuxer about end of clip */
+#define XINE_EVENT_END_OF_CLIP 0x80000001
+
+/*
+ * pids change event - inform ts demuxer of new pids
+ */
+typedef struct {
+ int vpid; /* video program id */
+ int apid; /* audio program id */
+} xine_pids_data_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/xine/xine_plugin.h b/include/xine/xine_plugin.h
new file mode 100644
index 000000000..31a14b511
--- /dev/null
+++ b/include/xine/xine_plugin.h
@@ -0,0 +1,105 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * generic plugin definitions
+ */
+
+#ifndef XINE_PLUGIN_H
+#define XINE_PLUGIN_H
+
+#define PLUGIN_NONE 0
+#define PLUGIN_INPUT 1
+#define PLUGIN_DEMUX 2
+#define PLUGIN_AUDIO_DECODER 3
+#define PLUGIN_VIDEO_DECODER 4
+#define PLUGIN_SPU_DECODER 5
+#define PLUGIN_AUDIO_OUT 6
+#define PLUGIN_VIDEO_OUT 7
+#define PLUGIN_POST 8
+
+#define PLUGIN_TYPE_MAX PLUGIN_POST
+
+/* this flag may be or'ed with type in order to force preloading the plugin.
+ * very useful to register config items on xine initialization.
+ */
+#define PLUGIN_MUST_PRELOAD (1 << 7)
+
+/* this flag may be or'ed with type to prevent the plugin loader from unloading
+ * the plugin
+ */
+#define PLUGIN_NO_UNLOAD (1 << 6)
+
+#define PLUGIN_TYPE_MASK ((1 << 6) - 1)
+
+typedef struct {
+ uint8_t type; /* one of the PLUGIN_* constants above */
+ uint8_t API; /* API version supported by this plugin */
+ const char *id; /* a name that identifies this plugin */
+ uint32_t version; /* version number, increased every release */
+ const void *special_info; /* plugin-type specific, see structs below */
+ void *(*init)(xine_t *, void *); /* init the plugin class */
+} plugin_info_t;
+
+
+/* special_info for a video output plugin */
+typedef struct {
+ int priority; /* priority of this plugin for auto-probing */
+ int visual_type; /* visual type supported by this plugin */
+} vo_info_t;
+
+/* special info for a audio output plugin */
+typedef struct {
+ int priority;
+} ao_info_t;
+
+/* special_info for a decoder plugin */
+typedef struct {
+ const uint32_t *supported_types; /* streamtypes this decoder can handle */
+ int priority;
+} decoder_info_t;
+
+/* special info for a post plugin */
+typedef struct {
+ uint32_t type; /* type of the post plugin, use one of XINE_POST_TYPE_* */
+} post_info_t;
+
+/* special info for a demuxer plugin */
+typedef struct {
+ int priority;
+} demuxer_info_t;
+
+/* special info for an input plugin */
+typedef struct {
+ int priority;
+} input_info_t;
+
+
+/* register a list of statically linked plugins
+ * info is a list of plugin_info_t terminated by PLUGIN_NONE
+ * example:
+ * plugin_info_t acme_plugin_info[] = {
+ * { PLUGIN_VIDEO_OUT, 21, "acme", XINE_VERSION_CODE, &vo_info_acme,
+ * init_class_acme },
+ * { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+ * };
+ *
+ */
+void xine_register_plugins(xine_t *self, plugin_info_t *info) XINE_PROTECTED;
+
+#endif
diff --git a/src/xine-engine/xineintl.h b/include/xine/xineintl.h
index bb9c006ef..bb9c006ef 100644
--- a/src/xine-engine/xineintl.h
+++ b/include/xine/xineintl.h
diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h
new file mode 100644
index 000000000..e822ccfe8
--- /dev/null
+++ b/include/xine/xineutils.h
@@ -0,0 +1,518 @@
+/*
+ * Copyright (C) 2000-2006 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, USA
+ */
+#ifndef XINEUTILS_H
+#define XINEUTILS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <pthread.h>
+
+#ifdef WIN32
+# include <winsock.h>
+#else
+# include <sys/time.h>
+#endif
+#include <xine/os_types.h>
+#include <xine/attributes.h>
+#include <xine/compat.h>
+#include <xine/xmlparser.h>
+#include <xine/xine_buffer.h>
+#include <xine/configfile.h>
+#include <xine/list.h>
+#include <xine/array.h>
+#include <xine/sorted_array.h>
+
+#include <stdio.h>
+#include <string.h>
+
+/*
+ * Mark exported data symbols for link engine library clients with older
+ * Win32 compilers
+ */
+#if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE)
+# define DL_IMPORT __declspec(dllimport)
+# define extern DL_IMPORT extern
+#endif
+
+ /*
+ * debugable mutexes
+ */
+
+ typedef struct {
+ pthread_mutex_t mutex;
+ char id[80];
+ char *locked_by;
+ } xine_mutex_t;
+
+ int xine_mutex_init (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr,
+ const char *id) XINE_PROTECTED;
+
+ int xine_mutex_lock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED;
+ int xine_mutex_unlock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED;
+ int xine_mutex_destroy (xine_mutex_t *mutex) XINE_PROTECTED;
+
+
+
+ /* CPU Acceleration */
+
+/*
+ * 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)
+ */
+
+/* generic accelerations */
+#define MM_ACCEL_MLIB 0x00000001
+
+/* x86 accelerations */
+#define MM_ACCEL_X86_MMX 0x80000000
+#define MM_ACCEL_X86_3DNOW 0x40000000
+#define MM_ACCEL_X86_MMXEXT 0x20000000
+#define MM_ACCEL_X86_SSE 0x10000000
+#define MM_ACCEL_X86_SSE2 0x08000000
+
+/* powerpc accelerations and features */
+#define MM_ACCEL_PPC_ALTIVEC 0x04000000
+#define MM_ACCEL_PPC_CACHE32 0x02000000
+
+/* SPARC accelerations */
+
+#define MM_ACCEL_SPARC_VIS 0x01000000
+#define MM_ACCEL_SPARC_VIS2 0x00800000
+
+/* x86 compat defines */
+#define MM_MMX MM_ACCEL_X86_MMX
+#define MM_3DNOW MM_ACCEL_X86_3DNOW
+#define MM_MMXEXT MM_ACCEL_X86_MMXEXT
+#define MM_SSE MM_ACCEL_X86_SSE
+#define MM_SSE2 MM_ACCEL_X86_SSE2
+
+uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED;
+
+
+
+ /* Optimized/fast memcpy */
+
+extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED;
+
+/*
+ * Debug stuff
+ */
+/*
+ * profiling (unworkable in non DEBUG isn't defined)
+ */
+void xine_profiler_init (void) XINE_PROTECTED;
+int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED;
+void xine_profiler_start_count (int id) XINE_PROTECTED;
+void xine_profiler_stop_count (int id) XINE_PROTECTED;
+void xine_profiler_print_results (void) XINE_PROTECTED;
+
+/*
+ * Allocate and clean memory size_t 'size', then return the pointer
+ * to the allocated memory.
+ */
+void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED;
+
+void *xine_xcalloc(size_t nmemb, size_t size) XINE_MALLOC XINE_PROTECTED;
+
+/*
+ * Copy blocks of memory.
+ */
+void *xine_memdup (const void *src, size_t length) XINE_MALLOC XINE_PROTECTED;
+void *xine_memdup0 (const void *src, size_t length) XINE_MALLOC XINE_PROTECTED;
+
+/*
+ * Get user home directory.
+ */
+const char *xine_get_homedir(void) XINE_PROTECTED;
+
+#if defined(WIN32) || defined(__CYGWIN__)
+/*
+ * Get other xine directories.
+ */
+const char *xine_get_pluginroot(void) XINE_PROTECTED;
+const char *xine_get_plugindir(void) XINE_PROTECTED;
+const char *xine_get_fontdir(void) XINE_PROTECTED;
+const char *xine_get_localedir(void) XINE_PROTECTED;
+#endif
+
+/*
+ * Clean a string (remove spaces and '=' at the begin,
+ * and '\n', '\r' and spaces at the end.
+ */
+char *xine_chomp (char *str) XINE_PROTECTED;
+
+/*
+ * A thread-safe usecond sleep
+ */
+void xine_usec_sleep(unsigned usec) XINE_PROTECTED;
+
+/* compatibility macros */
+#define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT))
+#define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM))
+#define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX))
+
+/**
+ * append to a string, reallocating
+ * normally, updates & returns *dest
+ * on error, *dest is unchanged & NULL is returned.
+ */
+char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED;
+
+/**
+ * asprintf wrapper
+ * allocate a string large enough to hold the output, and return a pointer to
+ * it. This pointer should be passed to free when it is no longer needed.
+ * return NULL on error.
+ */
+char *_x_asprintf(const char *format, ...) XINE_PROTECTED XINE_MALLOC XINE_FORMAT_PRINTF(1, 2);
+
+/**
+ * opens a file, ensuring that the descriptor will be closed
+ * automatically after a fork/execute.
+ */
+int xine_open_cloexec(const char *name, int flags) XINE_PROTECTED;
+
+/**
+ * creates a file, ensuring that the descriptor will be closed
+ * automatically after a fork/execute.
+ */
+int xine_create_cloexec(const char *name, int flags, mode_t mode) XINE_PROTECTED;
+
+/**
+ * creates a socket, ensuring that the descriptor will be closed
+ * automatically after a fork/execute.
+ */
+int xine_socket_cloexec(int domain, int type, int protocol) XINE_PROTECTED;
+
+/*
+ * Color Conversion Utility Functions
+ * The following data structures and functions facilitate the conversion
+ * of RGB images to packed YUV (YUY2) images. There are also functions to
+ * convert from YUV9 -> YV12. All of the meaty details are written in
+ * color.c.
+ */
+
+typedef struct yuv_planes_s {
+
+ unsigned char *y;
+ unsigned char *u;
+ unsigned char *v;
+ unsigned int row_width; /* frame width */
+ unsigned int row_count; /* frame height */
+
+} yuv_planes_t;
+
+void init_yuv_conversion(void) XINE_PROTECTED;
+void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height) XINE_PROTECTED;
+void free_yuv_planes(yuv_planes_t *yuv_planes) XINE_PROTECTED;
+
+extern void (*yuv444_to_yuy2)
+ (const yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) XINE_PROTECTED;
+extern void (*yuv9_to_yv12)
+ (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch,
+ const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch,
+ const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
+ int width, int height) XINE_PROTECTED;
+extern void (*yuv411_to_yv12)
+ (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch,
+ const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch,
+ const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
+ int width, int height) XINE_PROTECTED;
+extern void (*yv12_to_yuy2)
+ (const unsigned char *y_src, int y_src_pitch,
+ const unsigned char *u_src, int u_src_pitch,
+ const unsigned char *v_src, int v_src_pitch,
+ unsigned char *yuy2_map, int yuy2_pitch,
+ int width, int height, int progressive) XINE_PROTECTED;
+extern void (*yuy2_to_yv12)
+ (const unsigned char *yuy2_map, int yuy2_pitch,
+ unsigned char *y_dst, int y_dst_pitch,
+ unsigned char *u_dst, int u_dst_pitch,
+ unsigned char *v_dst, int v_dst_pitch,
+ int width, int height) XINE_PROTECTED;
+
+#define SCALEFACTOR 65536
+#define CENTERSAMPLE 128
+
+#define COMPUTE_Y(r, g, b) \
+ (unsigned char) \
+ ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR)
+#define COMPUTE_U(r, g, b) \
+ (unsigned char) \
+ ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE)
+#define COMPUTE_V(r, g, b) \
+ (unsigned char) \
+ ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE)
+
+#define UNPACK_BGR15(packed_pixel, r, g, b) \
+ b = (packed_pixel & 0x7C00) >> 7; \
+ g = (packed_pixel & 0x03E0) >> 2; \
+ r = (packed_pixel & 0x001F) << 3;
+
+#define UNPACK_BGR16(packed_pixel, r, g, b) \
+ b = (packed_pixel & 0xF800) >> 8; \
+ g = (packed_pixel & 0x07E0) >> 3; \
+ r = (packed_pixel & 0x001F) << 3;
+
+#define UNPACK_RGB15(packed_pixel, r, g, b) \
+ r = (packed_pixel & 0x7C00) >> 7; \
+ g = (packed_pixel & 0x03E0) >> 2; \
+ b = (packed_pixel & 0x001F) << 3;
+
+#define UNPACK_RGB16(packed_pixel, r, g, b) \
+ r = (packed_pixel & 0xF800) >> 8; \
+ g = (packed_pixel & 0x07E0) >> 3; \
+ b = (packed_pixel & 0x001F) << 3;
+
+extern int y_r_table[256] XINE_PROTECTED;
+extern int y_g_table[256] XINE_PROTECTED;
+extern int y_b_table[256] XINE_PROTECTED;
+
+extern int u_r_table[256] XINE_PROTECTED;
+extern int u_g_table[256] XINE_PROTECTED;
+extern int u_b_table[256] XINE_PROTECTED;
+
+extern int v_r_table[256] XINE_PROTECTED;
+extern int v_g_table[256] XINE_PROTECTED;
+extern int v_b_table[256] XINE_PROTECTED;
+
+/* frame copying functions */
+extern void yv12_to_yv12
+ (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch,
+ const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u_dst_pitch,
+ const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v_dst_pitch,
+ int width, int height) XINE_PROTECTED;
+extern void yuy2_to_yuy2
+ (const unsigned char *src, int src_pitch,
+ unsigned char *dst, int dst_pitch,
+ int width, int height) XINE_PROTECTED;
+
+/* print a hexdump of the given data */
+void xine_hexdump (const void *buf, int length) XINE_PROTECTED;
+
+/*
+ * Optimization macros for conditions
+ * Taken from the FIASCO L4 microkernel sources
+ */
+#if !defined(__GNUC__) || __GNUC__ < 3
+# define EXPECT_TRUE(x) (x)
+# define EXPECT_FALSE(x) (x)
+#else
+# define EXPECT_TRUE(x) __builtin_expect((x),1)
+# define EXPECT_FALSE(x) __builtin_expect((x),0)
+#endif
+
+#ifdef NDEBUG
+#define _x_assert(exp) \
+ do { \
+ if (!(exp)) \
+ fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \
+ __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \
+ } while(0)
+#else
+#define _x_assert(exp) \
+ do { \
+ if (!(exp)) { \
+ fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \
+ __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \
+ abort(); \
+ } \
+ } while(0)
+#endif
+
+#define _x_abort() \
+ do { \
+ fprintf(stderr, "abort: %s:%d: %s: Aborting.\n", \
+ __FILE__, __LINE__, __XINE_FUNCTION__); \
+ abort(); \
+ } while(0)
+
+
+/****** logging with xine **********************************/
+
+#ifndef LOG_MODULE
+ #define LOG_MODULE __FILE__
+#endif /* LOG_MODULE */
+
+#define LOG_MODULE_STRING printf("%s: ", LOG_MODULE );
+
+#ifdef LOG_VERBOSE
+ #define LONG_LOG_MODULE_STRING \
+ printf("%s: (%s:%d) ", LOG_MODULE, __XINE_FUNCTION__, __LINE__ );
+#else
+ #define LONG_LOG_MODULE_STRING LOG_MODULE_STRING
+#endif /* LOG_VERBOSE */
+
+#ifdef LOG
+ #ifdef __GNUC__
+ #define lprintf(fmt, args...) \
+ do { \
+ LONG_LOG_MODULE_STRING \
+ printf(fmt, ##args); \
+ fflush(stdout); \
+ } while(0)
+ #else /* __GNUC__ */
+ #ifdef _MSC_VER
+ #define lprintf(fmtargs) \
+ do { \
+ LONG_LOG_MODULE_STRING \
+ printf("%s", fmtargs); \
+ fflush(stdout); \
+ } while(0)
+ #else /* _MSC_VER */
+ #define lprintf(...) \
+ do { \
+ LONG_LOG_MODULE_STRING \
+ printf(__VA_ARGS__); \
+ fflush(stdout); \
+ } while(0)
+ #endif /* _MSC_VER */
+ #endif /* __GNUC__ */
+#else /* LOG */
+ #ifdef __GNUC__
+ #define lprintf(fmt, args...) do {} while(0)
+ #else
+ #ifdef _MSC_VER
+void __inline lprintf(const char * fmt, ...) {}
+ #else
+ #define lprintf(...) do {} while(0)
+ #endif /* _MSC_VER */
+ #endif /* __GNUC__ */
+#endif /* LOG */
+
+#ifdef __GNUC__
+ #define llprintf(cat, fmt, args...) \
+ do{ \
+ if(cat){ \
+ LONG_LOG_MODULE_STRING \
+ printf( fmt, ##args ); \
+ } \
+ }while(0)
+#else
+#ifdef _MSC_VER
+ #define llprintf(cat, fmtargs) \
+ do{ \
+ if(cat){ \
+ LONG_LOG_MODULE_STRING \
+ printf( "%s", fmtargs ); \
+ } \
+ }while(0)
+#else
+ #define llprintf(cat, ...) \
+ do{ \
+ if(cat){ \
+ LONG_LOG_MODULE_STRING \
+ printf( __VA_ARGS__ ); \
+ } \
+ }while(0)
+#endif /* _MSC_VER */
+#endif /* __GNUC__ */
+
+#ifdef __GNUC__
+ #define xprintf(xine, verbose, fmt, args...) \
+ do { \
+ if((xine) && (xine)->verbosity >= verbose){ \
+ xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \
+ } \
+ } while(0)
+#else
+#ifdef _MSC_VER
+void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...);
+ #define xprintf xine_xprintf
+#else
+ #define xprintf(xine, verbose, ...) \
+ do { \
+ if((xine) && (xine)->verbosity >= verbose){ \
+ xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \
+ } \
+ } while(0)
+#endif /* _MSC_VER */
+#endif /* __GNUC__ */
+
+/* time measuring macros for profiling tasks */
+
+#ifdef DEBUG
+# define XINE_PROFILE(function) \
+ do { \
+ struct timeval current_time; \
+ double dtime; \
+ gettimeofday(&current_time, NULL); \
+ dtime = -(current_time.tv_sec + (current_time.tv_usec / 1000000.0)); \
+ function; \
+ gettimeofday(&current_time, NULL); \
+ dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
+ printf("%s: (%s:%d) took %lf seconds\n", \
+ LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \
+ } while(0)
+# define XINE_PROFILE_ACCUMULATE(function) \
+ do { \
+ struct timeval current_time; \
+ static double dtime = 0; \
+ gettimeofday(&current_time, NULL); \
+ dtime -= current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
+ function; \
+ gettimeofday(&current_time, NULL); \
+ dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
+ printf("%s: (%s:%d) took %lf seconds\n", \
+ LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \
+ } while(0)
+#else
+# define XINE_PROFILE(function) function
+# define XINE_PROFILE_ACCUMULATE(function) function
+#endif /* DEBUG */
+
+/**
+ * get encoding of current locale
+ */
+char *xine_get_system_encoding(void) XINE_MALLOC XINE_PROTECTED;
+
+/*
+ * guess default encoding for the subtitles
+ */
+const char *xine_guess_spu_encoding(void) XINE_PROTECTED;
+
+/*
+ * use the best clock reference (API compatible with gettimeofday)
+ * note: it will be a monotonic clock, if available.
+ */
+int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED;
+
+/**
+ * Unknown FourCC reporting functions
+ */
+void _x_report_video_fourcc (xine_t *, const char *module, uint32_t) XINE_PROTECTED;
+void _x_report_audio_format_tag (xine_t *, const char *module, uint32_t) XINE_PROTECTED;
+
+/* don't harm following code */
+#ifdef extern
+# undef extern
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/xine/xmllexer.h b/include/xine/xmllexer.h
new file mode 100644
index 000000000..70fa86ee0
--- /dev/null
+++ b/include/xine/xmllexer.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2002-2003,2007 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * The xine-lib XML parser is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * The xine-lib XML parser is distributed in the hope that 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.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the Gnome Library; see the file COPYING.LIB. If not,
+ * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110, USA
+ */
+
+/* xml lexer */
+#ifndef XML_LEXER_H
+#define XML_LEXER_H
+
+#ifndef XINE_DEPRECATED
+#define XINE_DEPRECATED
+#endif
+
+#ifndef XINE_PROTECTED
+#define XINE_PROTECTED
+#endif
+
+/* public constants */
+#define T_ERROR -1 /* lexer error */
+#define T_EOF 0 /* end of file */
+#define T_EOL 1 /* end of line */
+#define T_SEPAR 2 /* separator ' ' '/t' '\n' '\r' */
+#define T_M_START_1 3 /* markup start < */
+#define T_M_START_2 4 /* markup start </ */
+#define T_M_STOP_1 5 /* markup stop > */
+#define T_M_STOP_2 6 /* markup stop /> */
+#define T_EQUAL 7 /* = */
+#define T_QUOTE 8 /* \" or \' */
+#define T_STRING 9 /* "string" */
+#define T_IDENT 10 /* identifier */
+#define T_DATA 11 /* data */
+#define T_C_START 12 /* <!-- */
+#define T_C_STOP 13 /* --> */
+#define T_TI_START 14 /* <? */
+#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 structure */
+struct lexer
+{
+ const char * lexbuf;
+ int lexbuf_size;
+ int lexbuf_pos;
+ int lex_mode;
+ int in_comment;
+ char *lex_malloc;
+};
+
+
+/* public functions */
+void lexer_init(const char * buf, int size) XINE_DEPRECATED XINE_PROTECTED;
+struct lexer *lexer_init_r(const char * buf, int size) XINE_PROTECTED;
+void lexer_finalize_r(struct lexer * lexer) XINE_PROTECTED;
+int lexer_get_token_d_r(struct lexer * lexer, char ** tok, int * tok_size, int fixed) XINE_PROTECTED;
+int lexer_get_token_d(char ** tok, int * tok_size, int fixed) XINE_DEPRECATED XINE_PROTECTED;
+int lexer_get_token(char * tok, int tok_size) XINE_DEPRECATED XINE_PROTECTED;
+char *lexer_decode_entities (const char *tok) XINE_PROTECTED;
+
+#endif
diff --git a/include/xine/xmlparser.h b/include/xine/xmlparser.h
new file mode 100644
index 000000000..495e5136b
--- /dev/null
+++ b/include/xine/xmlparser.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2002-2003,2007 the xine project
+ *
+ * This file is part of xine, a free video player.
+ *
+ * The xine-lib XML parser is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * The xine-lib XML parser is distributed in the hope that 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.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with the Gnome Library; see the file COPYING.LIB. If not,
+ * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110, USA
+ */
+
+#ifndef XML_PARSER_H
+#define XML_PARSER_H
+
+#ifndef XINE_DEPRECATED
+#define XINE_DEPRECATED
+#endif
+
+#ifndef XINE_PROTECTED
+#define XINE_PROTECTED
+#endif
+
+/* parser modes */
+#define XML_PARSER_CASE_INSENSITIVE 0
+#define XML_PARSER_CASE_SENSITIVE 1
+
+/* return codes */
+#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 {
+ char *name;
+ char *value;
+ struct xml_property_s *next;
+} 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;
+ struct xml_property_s *props;
+ struct xml_node_s *child;
+ struct xml_node_s *next;
+} xml_node_t;
+
+/* xml parser */
+typedef struct xml_parser_s {
+ struct lexer *lexer;
+ int mode;
+} xml_parser_t;
+
+void xml_parser_init(const char * buf, int size, int mode) XINE_DEPRECATED XINE_PROTECTED;
+xml_parser_t *xml_parser_init_r(const char * buf, int size, int mode) XINE_PROTECTED;
+void xml_parser_finalize_r(xml_parser_t *xml_parser) XINE_PROTECTED;
+
+int xml_parser_build_tree(xml_node_t **root_node) XINE_DEPRECATED XINE_PROTECTED;
+int xml_parser_build_tree_r(xml_parser_t *xml_parser, xml_node_t **root_node) XINE_PROTECTED;
+
+int xml_parser_build_tree_with_options(xml_node_t **root_node, int flags) XINE_DEPRECATED XINE_PROTECTED;
+int xml_parser_build_tree_with_options_r(xml_parser_t *xml_parser, xml_node_t **root_node, int flags) XINE_PROTECTED;
+
+void xml_parser_free_tree(xml_node_t *root_node) XINE_PROTECTED;
+
+const char *xml_parser_get_property (const xml_node_t *node, const char *name) XINE_PROTECTED;
+int xml_parser_get_property_int (const xml_node_t *node, const char *name,
+ int def_value) XINE_PROTECTED;
+int xml_parser_get_property_bool (const xml_node_t *node, const char *name,
+ int def_value) XINE_PROTECTED;
+
+/* for output:
+ * returns an escaped string (free() it when done)
+ * input must be in ASCII or UTF-8
+ */
+
+typedef enum {
+ XML_ESCAPE_NO_QUOTE,
+ XML_ESCAPE_SINGLE_QUOTE,
+ XML_ESCAPE_DOUBLE_QUOTE
+} xml_escape_quote_t;
+char *xml_escape_string (const char *s, xml_escape_quote_t quote_type) XINE_PROTECTED;
+
+/* for debugging purposes: dump read-in xml tree in a nicely
+ * indented fashion
+ */
+
+void xml_parser_dump_tree (const xml_node_t *node) XINE_PROTECTED;
+
+#endif
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 29084e996..03a17bf70 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,10 +1,12 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
+AM_CFLAGS = $(DEFAULT_OCFLAGS)
+
EXTRA_DIST = Makefile.common
noinst_LTLIBRARIES = libxineposix.la
noinst_HEADERS = os_internal.h
-xineinclude_HEADERS = os_types.h
libxineposix_la_SOURCES =
libxineposix_la_LIBADD = @LTLIBOBJS@
diff --git a/lib/os_internal.h b/lib/os_internal.h
index af921940f..b06b51112 100644
--- a/lib/os_internal.h
+++ b/lib/os_internal.h
@@ -1,6 +1,69 @@
#ifndef _XINE_OS_INTERNAL_H
#define _XINE_OS_INTERNAL_H
+/* When using Apple's GCC, __APPLE__ will be defined. This is a whole lot of
+ * messiness, but it's necessary in order to perform universal builds properly.
+ * It's meant to over-ride configure time stuff that would be different at
+ * compile time.
+ */
+#if defined(__APPLE__) && defined(XINE_MACOSX_UNIVERSAL_BINARY)
+
+/* __ppc__, __ppc64__, __i386__, __x86_64__ are interesting arch macros */
+#undef HOST_ARCH
+#if defined(__ppc__) || defined(__ppc64__)
+#define ARCH_PPC
+#if defined(__ppc64__)
+#define HOST_ARCH "darwin/powerpc64"
+#else
+#define HOST_ARCH "darwin/powerpc"
+#endif
+#elif defined(__i386__) || defined(__x86_64__)
+#define ARCH_X86
+#define BITFIELD_LSBF
+#define HAVE_MMX
+#if defined(__x86_64__)
+#define ARCH_X86_64
+#define HOST_ARCH "darwin/x86_64"
+#elif defined(__i386__)
+#define ARCH_X86_32
+#define HOST_ARCH "darwin/x86_32"
+#else
+#error unrecognized/unsupported CPU type building for Apple Darwin
+#endif
+#endif
+
+/* See /Developer/SDKs/MacOSX10.4u.sdk/usr/include/machine/limits.h */
+#if SIZEOF_INT != 4
+#undef SIZEOF_INT
+#define SIZEOF_INT 4
+#endif
+
+#if defined(__LP64__) && SIZEOF_LONG != 8
+#undef SIZEOF_LONG
+#define SIZEOF_LONG 8
+#elif !defined(__LP64__) && SIZEOF_LONG != 4
+#undef SIZEOF_LONG
+#define SIZEOF_LONG 4
+#endif
+
+/* WORDS_BIGENDIAN (replaces AC_C_BIGENDIAN autoconf test at compile time) */
+#include <machine/endian.h>
+#if BYTE_ORDER == BIG_ENDIAN
+#define WORDS_BIGENDIAN 1
+#else
+#undef WORDS_BIGENDIAN
+#endif
+
+#if defined(__LP64__)
+#define FPM_64BIT 1
+#elif defined(__ppc__) || defined(__ppc64__)
+#define FPM_PPC 1
+#elif defined(__i386__) || defined(__x86_64__)
+#define FPM_INTEL 1
+#endif
+
+#endif /* __APPLE__ */
+
#include <stddef.h>
#include <stdarg.h>
@@ -21,7 +84,8 @@
#endif
#include <inttypes.h>
-#include "../src/xine-utils/attributes.h"
+#include <pthread.h>
+#include <xine/attributes.h>
#if defined(WIN32) || defined(__CYGWIN__)
@@ -150,6 +214,13 @@ int xine_private_vasprintf(char **string, const char *format, va_list ap) XINE_F
char *xine_private_strndup(const char *s, size_t n);
#endif
+/* replacement of pthread_mutex_timedlock */
+#ifndef HAVE_PTHREAD_MUTEX_TIMEDLOCK
+#define HAVE_PTHREAD_MUTEX_TIMEDLOCK
+#define pthread_mutex_timedlock(M, T) xine_private_pthread_mutex_timedlock((M), (T))
+int xine_private_pthread_mutex_timedlock(pthread_mutex_t *mutex, const struct timespec *abs_timeout);
+#endif
+
/* handle non-standard function names */
#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF)
# define HAVE_SNPRINTF
diff --git a/lib/timedlock.c b/lib/timedlock.c
new file mode 100644
index 000000000..997ef6235
--- /dev/null
+++ b/lib/timedlock.c
@@ -0,0 +1,33 @@
+#include "config.h"
+
+#include <errno.h>
+
+#define _x_min(a, b) ((a) < (b) ? (a) : (b))
+
+int xine_private_pthread_mutex_timedlock(pthread_mutex_t *mutex,
+ const struct timespec *abs_timeout)
+{
+ int pthread_rc;
+ struct timespec remaining, slept, ts;
+
+ remaining = *abs_timeout;
+ while ((pthread_rc = pthread_mutex_trylock(mutex)) == EBUSY) {
+ ts.tv_sec = 0;
+ ts.tv_nsec = (remaining.tv_sec > 0 ? 10000000
+ : _x_min(remaining.tv_nsec, 10000000));
+ nanosleep(&ts, &slept);
+ ts.tv_nsec -= slept.tv_nsec;
+ if (ts.tv_nsec <= remaining.tv_nsec) {
+ remaining.tv_nsec -= ts.tv_nsec;
+ }
+ else {
+ remaining.tv_sec--;
+ remaining.tv_nsec = (1000000 - (ts.tv_nsec - remaining.tv_nsec));
+ }
+ if (remaining.tv_sec < 0 || (!remaining.tv_sec && remaining.tv_nsec <= 0)) {
+ return ETIMEDOUT;
+ }
+ }
+
+ return pthread_rc;
+}
diff --git a/m4/Makefile.am b/m4/Makefile.am
index 0149ed648..e5edd1836 100644
--- a/m4/Makefile.am
+++ b/m4/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
if INSTALL_M4
diff --git a/m4/_xine.m4 b/m4/_xine.m4
deleted file mode 100644
index 70bbe5d8f..000000000
--- a/m4/_xine.m4
+++ /dev/null
@@ -1,536 +0,0 @@
-dnl AC_C_ALWAYS_INLINE
-dnl Define inline to something appropriate, including the new always_inline
-dnl attribute from gcc 3.1
-dnl Thanks to Michel LESPINASSE <walken@zoy.org>
-dnl __inline__ "check" added by Darren Salt
-AC_DEFUN([AC_C_ALWAYS_INLINE],
- [AC_C_INLINE
- if test x"$GCC" = x"yes" -a x"$ac_cv_c_inline" = x"inline"; then
- AC_MSG_CHECKING([for always_inline])
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -Wall -Werror"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[inline __attribute__ ((__always_inline__)) void f (void);]])],
- [ac_cv_always_inline=yes],[ac_cv_always_inline=no])
- CFLAGS="$SAVE_CFLAGS"
- AC_MSG_RESULT([$ac_cv_always_inline])
- if test x"$ac_cv_always_inline" = x"yes"; then
- AH_TOP([
-#ifdef inline
-/* the strange formatting below is needed to prevent config.status from rewriting it */
-# undef \
- inline
-#endif
- ])
- AC_DEFINE_UNQUOTED([inline],[inline __attribute__ ((__always_inline__))])
- fi
- ac_cv_c___inline__=''
- else
- # FIXME: test the compiler to see if it supports __inline__
- # instead of assuming that if it isn't gcc, it doesn't
- case "$ac_cv_c_inline" in
- yes)
- ac_cv_c___inline__=inline
- ;;
- inline|__inline__)
- ac_cv_c___inline__=''
- ;;
- *)
- ac_cv_c___inline__="$ac_cv_c_inline"
- ;;
- esac
- fi
- if test x"$ac_cv_c___inline__" != x; then
- AC_DEFINE_UNQUOTED([__inline__],[$ac_cv_c___inline__],[Define if the compiler doesn't recognise __inline__])
- fi
-])
-
-dnl
-dnl Check for minimum version of libtool
-dnl AC_PREREQ_LIBTOOL([MINIMUM VERSION],[ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]])
-AC_DEFUN([AC_PREREQ_LIBTOOL],
- [
- lt_min_full=ifelse([$1], ,1.3.5,$1)
- lt_min=`echo $lt_min_full | sed -e 's/\.//g'`
- AC_MSG_CHECKING(for libtool >= $lt_min_full)
- lt_version="`grep '^VERSION' $srcdir/ltmain.sh | sed -e 's/VERSION\=//g;s/[[-.a-zA-Z]]//g'`"
-
- if test $lt_version -lt 100 ; then
- lt_version=`expr $lt_version \* 10`
- fi
-
- if test $lt_version -lt $lt_min ; then
- AC_MSG_RESULT(no)
- ifelse([$3], , :, [$3])
- fi
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- ])
-
-dnl
-AC_DEFUN([AC_CHECK_LIRC],
- [AC_ARG_ENABLE(lirc,
- AS_HELP_STRING([--disable-lirc], [turn off LIRC support]),
- enable_lirc=$enableval, enable_lirc=yes)
-
- if test x"$enable_lirc" = xyes; then
- have_lirc=yes
- AC_REQUIRE_CPP
- AC_CHECK_LIB(lirc_client,lirc_init,
- AC_CHECK_HEADER(lirc/lirc_client.h, true, have_lirc=no), have_lirc=no)
- if test "$have_lirc" = "yes"; then
-
- if test x"$LIRC_PREFIX" != "x"; then
- lirc_libprefix="$LIRC_PREFIX/lib"
- LIRC_INCLUDE="-I$LIRC_PREFIX/include"
- fi
- for llirc in $lirc_libprefix /lib /usr/lib /usr/local/lib; do
- AC_CHECK_FILE("$llirc/liblirc_client.a",
- LIRC_LIBS="$llirc/liblirc_client.a"
- AC_DEFINE(HAVE_LIRC),,)
- done
- else
- AC_MSG_RESULT([*** LIRC client support not available, LIRC support will be disabled ***]);
- fi
- fi
-
- AC_SUBST(LIRC_LIBS)
- AC_SUBST(LIRC_INCLUDE)
-])
-
-
-dnl AC_LINUX_PATH(DEFAULT PATH)
-AC_DEFUN([AC_LINUX_PATH],
- [AC_ARG_WITH(linux-path,
- AS_HELP_STRING([--with-linux-path=PATH], [where the linux sources are located]),
- linux_path="$withval", linux_path="$1")
- LINUX_INCLUDE="-I$linux_path/include"
-])
-
-dnl AC_CHECK_DXR3()
-AC_DEFUN([AC_CHECK_DXR3],
-[
- AC_ARG_ENABLE(dxr3,
- AS_HELP_STRING([--disable-dxr3], [do not build the DXR3/HW+ plugins]),
- enable_dxr3=$enableval, enable_dxr3=yes)
- if test x"$enable_dxr3" = xyes; then
- have_dxr3=yes
- AC_MSG_RESULT([*** checking for a supported mpeg encoder])
- have_encoder=no
- have_libfame=yes
- AC_CHECK_LIB(fame, fame_open,
- [AC_CHECK_HEADER(fame.h, true, have_libfame=no)], have_libfame=no)
- if test "$have_libfame" = "yes"; then
- AC_DEFINE(HAVE_LIBFAME)
- have_encoder=yes
- fi
- have_librte=yes
- AC_CHECK_LIB(rte, rte_init,
- [AC_CHECK_HEADER(rte.h, true, have_librte=no)], have_librte=no)
- if test "$have_librte" = "yes"; then
- AC_DEFINE(HAVE_LIBRTE)
- AC_MSG_WARN([this will probably only work with rte version 0.4!])
- have_encoder=yes
- fi
- if test "$have_encoder" = "yes"; then
- AC_MSG_RESULT([*** found one or more external mpeg encoders]);
- else
- AC_MSG_RESULT([*** no external mpeg encoder found]);
- fi
- else
- AC_MSG_RESULT([DXR3 plugins will not be built.])
- have_dxr3=no
- fi
-])
-
-dnl AC_CHECK_GENERATE_INTTYPES_H (INCLUDE-DIRECTORY)
-dnl generate a default inttypes.h if the header file does not exist already
-AC_DEFUN([AC_CHECK_GENERATE_INTTYPES],
- [AC_CHECK_HEADER([inttypes.h],,
- [if test ! -d $1; then mkdir $1; fi
- AC_CHECK_HEADER([stdint.h],
- [cat >$1/inttypes.h << EOF
-#ifndef _INTTYPES_H
-#define _INTTYPES_H
-/* helper inttypes.h for people who do not have it on their system */
-
-#include <stdint.h>
-EOF
- ],
- [AC_COMPILE_CHECK_SIZEOF([char],[1])
- AC_COMPILE_CHECK_SIZEOF([short],[2])
- AC_COMPILE_CHECK_SIZEOF([int],[4])
- AC_COMPILE_CHECK_SIZEOF([long long],[8])
- cat >$1/inttypes.h << EOF
-#ifndef _INTTYPES_H
-#define _INTTYPES_H
-/* default inttypes.h for people who do not have it on their system */
-#if (!defined __int8_t_defined) && (!defined __BIT_TYPES_DEFINED__)
-#define __int8_t_defined
-typedef signed char int8_t;
-typedef signed short int16_t;
-typedef signed int int32_t;
-#ifdef ARCH_X86
-typedef signed long long int64_t;
-#endif
-#endif
-#if (!defined __uint8_t_defined) && (!defined _LINUX_TYPES_H)
-#define __uint8_t_defined
-typedef unsigned char uint8_t;
-typedef unsigned short uint16_t;
-typedef unsigned int uint32_t;
-#ifdef ARCH_X86
-typedef unsigned long long uint64_t;
-#endif
-#endif
-EOF
- ])
- cat >>$1/inttypes.h << EOF
-
-#ifdef WIN32
-# define PRI64_PREFIX "I64"
-#else
-# define PRI64_PREFIX "l"
-#endif
-
-#ifndef PRId8
-# define PRId8 "d"
-#endif
-#ifndef PRId16
-# define PRId16 "d"
-#endif
-#ifndef PRId32
-# define PRId32 "d"
-#endif
-#ifndef PRId64
-# define PRId64 PRI64_PREFIX "d"
-#endif
-
-#ifndef PRIu8
-# define PRIu8 "u"
-#endif
-#ifndef PRIu16
-# define PRIu16 "u"
-#endif
-#ifndef PRIu32
-# define PRIu32 "u"
-#endif
-#ifndef PRIu64
-# define PRIu64 PRI64_PREFIX "u"
-#endif
-
-#ifndef PRIx8
-# define PRIx8 "x"
-#endif
-#ifndef PRIx16
-# define PRIx16 "x"
-#endif
-#ifndef PRIx32
-# define PRIx32 "x"
-#endif
-#ifndef PRIx64
-# define PRIx64 PRI64_PREFIX "x"
-#endif
-
-#ifndef PRIX8
-# define PRIX8 "X"
-#endif
-#ifndef PRIX16
-# define PRIX16 "X"
-#endif
-#ifndef PRIX32
-# define PRIX32 "X"
-#endif
-#ifndef PRIX64
-# define PRIX64 PRI64_PREFIX "X"
-#endif
-
-#ifndef PRIdFAST8
-# define PRIdFAST8 "d"
-#endif
-#ifndef PRIdFAST16
-# define PRIdFAST16 "d"
-#endif
-#ifndef PRIdFAST32
-# define PRIdFAST32 "d"
-#endif
-#ifndef PRIdFAST64
-# define PRIdFAST64 "d"
-#endif
-
-#ifndef PRIuFAST8
-# define PRIuFAST8 "u"
-#endif
-#ifndef PRIuFAST16
-# define PRIuFAST16 "u"
-#endif
-#ifndef PRIuFAST32
-# define PRIuFAST32 "u"
-#endif
-#ifndef PRIuFAST64
-# define PRIuFAST64 PRI64_PREFIX "u"
-#endif
-
-#ifndef PRIxFAST8
-# define PRIxFAST8 "x"
-#endif
-#ifndef PRIxFAST16
-# define PRIxFAST16 "x"
-#endif
-#ifndef PRIxFAST32
-# define PRIxFAST32 "x"
-#endif
-#ifndef PRIxFAST64
-# define PRIxFAST64 PRI64_PREFIX "x"
-#endif
-
-#ifndef SCNd8
-# define SCNd8 "hhd"
-#endif
-#ifndef SCNd16
-# define SCNd16 "hd"
-#endif
-#ifndef SCNd32
-# define SCNd32 "d"
-#endif
-#ifndef SCNd64
-# define SCNd64 PRI64_PREFIX "d"
-#endif
-
-#ifndef SCNu8
-# define SCNu8 "hhu"
-#endif
-#ifndef SCNu16
-# define SCNu16 "hu"
-#endif
-#ifndef SCNu32
-# define SCNu32 "u"
-#endif
-#ifndef SCNu64
-# define SCNu64 PRI64_PREFIX "u"
-#endif
-
-#ifndef PRIdMAX
-# define PRIdMAX PRId64
-#endif
-#ifndef PRIuMAX
-# define PRIuMAX PRIu64
-#endif
-#ifndef PRIxMAX
-# define PRIxMAX PRIx64
-#endif
-#ifndef SCNdMAX
-# define SCNdMAX SCNd64
-#endif
-
-#endif
-EOF
- ])]
-)
-
-
-dnl AC_COMPILE_CHECK_SIZEOF (TYPE SUPPOSED-SIZE)
-dnl abort if the given type does not have the supposed size
-AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
- [AC_MSG_CHECKING(that size of $1 is $2)
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) case 0: case (sizeof ($1) == $2):;]])],[],
- [AC_MSG_ERROR([can not build a default inttypes.h])])
- AC_MSG_RESULT([yes])])
-
-
-dnl AM_CHECK_CDROM_IOCTLS ([ACTION-IF-YES], [ACTION-IF-NO])
-dnl check for CDROM_DRIVE_STATUS in ioctl.h
-AC_DEFUN([AM_CHECK_CDROM_IOCTLS],
- [AC_CACHE_CHECK([if cdrom ioctls are available],
- [am_cv_have_cdrom_ioctls],
- [AC_EGREP_HEADER([CDROM_DRIVE_STATUS],[sys/ioctl.h],
- am_cv_have_cdrom_ioctls=yes,
- [AC_EGREP_HEADER([CDIOCALLOW],[sys/ioctl.h],
- am_cv_have_cdrom_ioctls=yes,
- [AC_EGREP_CPP(we_have_cdrom_ioctls,[
-#include <sys/ioctl.h>
-#ifdef HAVE_SYS_CDIO_H
-# include <sys/cdio.h>
-#endif
-#ifdef HAVE_LINUX_CDROM_H
-# include <linux/cdrom.h>
-#endif
-#if defined(CDROM_DRIVE_STATUS) || defined(CDIOCALLOW) || defined(CDROMCDXA)
- we_have_cdrom_ioctls
-#endif
-],
- am_cv_have_cdrom_ioctls=yes,
- am_cv_have_cdrom_ioctls=no
- )])])])
- have_cdrom_ioctls=$am_cv_have_cdrom_ioctls
- if test "x$have_cdrom_ioctls" = xyes ; then
- ifelse([$1], , :, [$1])
- else
- ifelse([$2], , :, [$2])
- fi
-])
-
-
-dnl AC_CHECK_IP_MREQN
-dnl check for struct ip_mreqn in netinet/in.h
-AC_DEFUN([AC_CHECK_IP_MREQN],
- [AC_CACHE_CHECK([for ip_mreqn], [ac_cv_have_ip_mreqn],
- [AC_EGREP_HEADER([ip_mreqn],
- [netinet/in.h],
- [ac_cv_have_ip_mreqn=yes],
- [ac_cv_have_ip_mreqn=no])])
- if test $ac_cv_have_ip_mreqn = yes; then
- AC_DEFINE([HAVE_IP_MREQN],1,[Define this if you have ip_mreqn in netinet/in.h])
- fi
-])
-
-
-dnl AC_PROG_GMSGFMT_PLURAL
-dnl ----------------------
-dnl Validate the GMSGFMT program found by gettext.m4; reject old versions
-dnl of GNU msgfmt that do not support the "msgid_plural" extension.
-AC_DEFUN([AC_PROG_GMSGFMT_PLURAL],
- [dnl AC_REQUIRE(AM_GNU_GETTEXT)
-
- if test "$GMSGFMT" != ":"; then
- AC_MSG_CHECKING([for plural forms in GNU msgfmt])
-
- changequote(,)dnl We use [ and ] in in .po test input
-
- dnl If the GNU msgfmt does not accept msgid_plural we define it
- dnl as : so that the Makefiles still can work.
- cat >conftest.po <<_ACEOF
-msgid "channel"
-msgid_plural "channels"
-msgstr[0] "canal"
-msgstr[1] "canal"
-
-_ACEOF
- changequote([,])dnl
-
- if $GMSGFMT -o /dev/null conftest.po >/dev/null 2>&1; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- AC_MSG_RESULT(
- [found GNU msgfmt program is too old, it does not support plural forms; ignore it])
- GMSGFMT=":"
- fi
- rm -f conftest.po
- fi
-])dnl AC_PROG_GMSGFMT_PLURAL
-
-
-# AC_PROG_LIBTOOL_SANITYCHECK
-# ----------------------
-# Default configuration of libtool on solaris produces non-working
-# plugin modules, when gcc is used as compiler, and gcc does not
-# use gnu-ld
-AC_DEFUN([AC_PROG_LIBTOOL_SANITYCHECK],
- [dnl AC_REQUIRE(AC_PROG_CC)
- dnl AC_REQUIRE(AC_PROG_LD)
- dnl AC_REQUIRE(AC_PROG_LIBTOOL)
-
- case $host in
- *-*-solaris*)
- if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
- AC_MSG_CHECKING([if libtool can build working modules])
- cat > conftest1.c <<_ACEOF
-#undef NDEBUG
-#include <assert.h>
-int shlib_func(long long a, long long b) {
- assert(b);
- switch (a&3) {
- case 0: return a/b;
- case 1: return a%b;
- case 2: return (unsigned long long)a/b;
- case 3: return (unsigned long long)a%b;
- }
-}
-_ACEOF
-
- cat > conftest2.c <<_ACEOF
-#include <dlfcn.h>
-int main(){
- void *dl = dlopen(".libs/libconftest.so", RTLD_NOW);
- if (!dl) printf("%s\n", dlerror());
- exit(dl ? 0 : 1);
-}
-_ACEOF
-
- if ./libtool $CC -c conftest1.c >/dev/null 2>&1 && \
- ./libtool $CC -o libconftest.la conftest1.lo \
- -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \
- ./libtool $CC -o conftest2 conftest2.c -ldl >/dev/null 2>&1
- then
- if ./conftest2 >/dev/null 2>&1; then
- AC_MSG_RESULT(yes)
- else
- dnl typical problem: dlopen'ed module not self contained, because
- dnl it wasn't linked with -lgcc
- AC_MSG_RESULT(no)
- if grep '^archive_cmds=.*$LD -G' libtool >/dev/null; then
- AC_MSG_CHECKING([if libtool can be fixed])
-
- dnl first try to update gcc2's spec file to add the
- dnl gcc3 -mimpure-text flag
-
- libtool_specs=""
-
- if $CC -dumpspecs | grep -- '-G -dy -z text' >/dev/null; then
- $CC -dumpspecs | \
- sed 's/-G -dy -z text/-G -dy %{!mimpure-text:-z text}/g' \
- > gcc-libtool-specs
- libtool_specs=" -specs=`pwd`/gcc-libtool-specs"
- fi
-
- sed -e "s,\$LD -G,\$CC${libtool_specs} -shared -mimpure-text,g" \
- -e 's/ -M / -Wl,-M,/' libtool >libtool-fixed
- chmod +x libtool-fixed
- if ./libtool-fixed $CC -o libconftest.la conftest1.lo \
- -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \
- ./conftest2 >/dev/null 2>&1; then
-
- dnl the fixed libtool works
- AC_MSG_RESULT(yes)
- mv -f libtool-fixed libtool
-
- else
- AC_MSG_RESULT(no)
- fi
- fi
- fi
- else
- AC_MSG_RESULT(no)
- fi
- rm -f conftest1.c conftest1.lo conftest1.o conftest2.c \
- libconftest.la conftest libtool-fixed
- rm -rf .libs
- fi ;;
- esac
-])# AC_PROG_LIBTOOL_SANITYCHECK
-
-dnl Check for the type of the third argument of getsockname
-AC_DEFUN([AC_CHECK_SOCKLEN_T], [
- AC_MSG_CHECKING(for socklen_t)
-
- AC_CACHE_VAL(ac_cv_socklen_t, [
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>
- ]], [[socklen_t a=0;
-getsockname(0,(struct sockaddr*)0, &a);
- ]])],[ac_cv_socklen_t=socklen_t],[ac_cv_socklen_t=''])
- if test "x$ac_cv_socklen_t" = x; then
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
-#include <sys/socket.h>]], [[
-int a=0;
-getsockname(0,(struct sockaddr*)0, &a);]])],
- [ac_cv_socklen_t=int],[ac_cv_socklen_t=size_t])
- fi
- ])
-
- AC_MSG_RESULT($ac_cv_socklen_t)
- if test "$ac_cv_socklen_t" != "socklen_t"; then
- AC_DEFINE_UNQUOTED(socklen_t, $ac_cv_socklen_t,
- [Define the real type of socklen_t])
- fi
-])
diff --git a/m4/aa.m4 b/m4/aa.m4
deleted file mode 100644
index f7eefd8d7..000000000
--- a/m4/aa.m4
+++ /dev/null
@@ -1,272 +0,0 @@
-dnl Configure path and dependencies for aalib.
-dnl
-dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr>
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-dnl
-dnl
-dnl As a special exception to the GNU General Public License, if you
-dnl distribute this file as part of a program that contains a configuration
-dnl script generated by Autoconf, you may include it under the same
-dnl distribution terms that you use for the rest of that program.
-dnl
-dnl AM_PATH_AALIB([MINIMUM-VERSION, [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND ]]])
-dnl Test for AALIB, and define AALIB_CFLAGS and AALIB_LIBS, AALIB_STATIC_LIBS.
-dnl
-dnl ***********************
-dnl 26/09/2001
-dnl * fixed --disable-aalibtest.
-dnl 17/09/2001
-dnl * use both aalib-config, and *last chance* aainfo for guessing.
-dnl 19/08/2001
-dnl * use aalib-config instead of aainfo now.
-dnl 17/06/2001
-dnl * First shot
-dnl
-
-dnl Internal bits, used by AM_PATH_AALIB.
-dnl Requires AALIB_CFLAGS and AALIB_FLAGS to be defined
-AC_DEFUN([_AALIB_CHECK_VERSION], [
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$AALIB_CFLAGS $CFLAGS"
- LIBS="$AALIB_LIBS $LIBS"
-
-dnl Now check if the installed AALIB is sufficiently new. (Also sanity
-dnl checks the results of aalib-config to some extent.)
-
- rm -f conf.aalibtest
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <stdlib.h>
-#include <aalib.h>
-
-int main () {
- int major, minor;
- char *tmp_version;
-
- system ("touch conf.aalibtest");
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = (char *) strdup("$min_aalib_version");
- if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2) {
- printf("%s, bad version string\n", "$min_aalib_version");
- exit(1);
- }
-
- if ((AA_LIB_VERSION > major) || ((AA_LIB_VERSION == major) &&
-#ifdef AA_LIB_MINNOR
- (AA_LIB_MINNOR >= minor)
-#else
- (AA_LIB_MINOR >= minor)
-#endif
- )) {
- return 0;
- }
- else {
-#ifdef AA_LIB_MINNOR
- printf("\n*** An old version of AALIB (%d.%d) was found.\n", AA_LIB_VERSION, AA_LIB_MINNOR);
-#else
- printf("\n*** An old version of AALIB (%d.%d) was found.\n", AA_LIB_VERSION, AA_LIB_MINOR);
-#endif
- printf("*** You need a version of AALIB newer than %d.%d. The latest version of\n", major, minor);
- printf("*** AALIB is always available from:\n");
- printf("*** http://www.ta.jcu.cz://aa\n");
- printf("***\n");
- }
- return 1;
-}
-]])],[],[no_aalib=yes],[no_aalib=cc])
- if test "x$no_aalib" = xcc; then
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <aalib.h>
-]], [[ return ((AA_LIB_VERSION) ||
-#ifdef AA_LIB_MINNOR
- (AA_LIB_MINNOR)
-#else
- (AA_LIB_MINOR)
-#endif
- ); ]])],[no_aalib=''],[no_aalib=yes])
- fi
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
-])
-
-
-AC_DEFUN([AM_PATH_AALIB],
-[dnl
-dnl
-AC_ARG_WITH(aalib-prefix,
- AS_HELP_STRING([--with-aalib-prefix=DIR], [prefix where AALIB is installed (optional)]),
- aalib_config_prefix="$withval", aalib_config_prefix="")
-AC_ARG_WITH(aalib-exec-prefix,
- AS_HELP_STRING([--with-aalib-exec-prefix=DIR], [exec prefix where AALIB is installed (optional)]),
- aalib_config_exec_prefix="$withval", aalib_config_exec_prefix="")
-AC_ARG_ENABLE(aalibtest,
- AS_HELP_STRING([--disable-aalibtest], [do not try to compile and run a test AALIB program]),
- enable_aalibtest=$enableval, enable_aalibtest=yes)
-
- AC_LANG_PUSH([C])
-
- if test x$aalib_config_exec_prefix != x ; then
- aalib_config_args="$aalib_config_args --exec-prefix=$aalib_config_exec_prefix"
- if test x${AALIB_CONFIG+set} != xset ; then
- AALIB_CONFIG=$aalib_config_exec_prefix/bin/aalib-config
- fi
- fi
- if test x$aalib_config_prefix != x ; then
- aalib_config_args="$aalib_config_args --prefix=$aalib_config_prefix"
- if test x${AALIB_CONFIG+set} != xset ; then
- AALIB_CONFIG=$aalib_config_prefix/bin/aalib-config
- fi
- fi
-
- min_aalib_version=ifelse([$1], ,1.4,$1)
-
- if test x"$enable_aalibtest" != "xyes"; then
- AC_MSG_CHECKING([for AALIB version >= $min_aalib_version])
- else
- if test ! -x "$AALIB_CONFIG"; then
- AALIB_CONFIG=""
- fi
- AC_PATH_TOOL(AALIB_CONFIG, aalib-config, no)
-
- if test "$AALIB_CONFIG" = "no" ; then
-
-dnl aalib-config is missing, check for old aainfo
-
- AALIB_LIBS="$AALIB_LIBS -laa"
- if test x$aalib_config_exec_prefix != x ; then
- AALIB_CFLAGS="-I$aalib_config_exec_prefix/include"
- AALIB_LIBS="-L$aalib_config_exec_prefix/lib -laa"
- if test x${AAINFO+set} != xset ; then
- AAINFO=$aalib_config_exec_prefix/bin/aainfo
- fi
- fi
-
- if test x$aalib_config_prefix != x ; then
- AALIB_CFLAGS="-I$aalib_config_prefix/include"
- AALIB_LIBS="-L$aalib_config_prefix/lib -laa"
- if test x${AAINFO+set} != xset ; then
- AAINFO=$aalib_config_prefix/bin/aainfo
- fi
- fi
-
- if test x"$aalib_config_prefix" = "x"; then
- AC_PATH_TOOL(AAINFO, aainfo, no)
- else
- AC_MSG_CHECKING(for $AAINFO)
- if test -x $AAINFO; then
- AC_MSG_RESULT(yes)
- else
- AAINFO="no"
- AC_MSG_RESULT(no)
- fi
- fi
-
- AC_MSG_CHECKING([for AALIB version >= $min_aalib_version])
- no_aalib=""
-
- if test x"$AAINFO" = "xno"; then
- no_aalib=yes
- else
- aalib_drivers="`$AAINFO --help | grep drivers | sed -e 's/available//g;s/drivers//g;s/\://g'`"
- for drv in $aalib_drivers; do
- if test $drv = "X11" -a x$x11dep = "x"; then
- AALIB_CFLAGS="$AALIB_CFLAGS `echo $X_CFLAGS|sed -e 's/\-I/\-L/g;s/include/lib/g'`"
- x11dep="yes"
- fi
-dnl if test $drv = "slang" -a x$slangdep = "x"; then
-dnl slangdep="yes"
-dnl fi
-dnl if test $drv = "gpm" -a x$gmpdep = "x"; then
-dnl gpmdep="yes"
-dnl fi
- done
-
- _AALIB_CHECK_VERSION
- fi
-
- else dnl AALIB_CONFIG
- AC_MSG_CHECKING([for AALIB version >= $min_aalib_version])
- no_aalib=""
- AALIB_CFLAGS="`$AALIB_CONFIG $aalib_config_args --cflags`"
- AALIB_LIBS="`$AALIB_CONFIG $aalib_config_args --libs`"
- aalib_config_major_version=`$AALIB_CONFIG $aalib_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- aalib_config_minor_version=`$AALIB_CONFIG $aalib_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- aalib_config_sub_version=`$AALIB_CONFIG $aalib_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-
- _AALIB_CHECK_VERSION
- fi dnl AALIB_CONFIG
- fi dnl enable_aalibtest
-
- if test "x$no_aalib" = x; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$AALIB_CONFIG" = "no"; then
- echo "*** The [aalib-config|aainfo] program installed by AALIB could not be found"
- echo "*** If AALIB was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or use --with-aalib-prefix to set the prefix"
- echo "*** where AALIB is installed."
- else
- if test -f conf.aalibtest ; then
- :
- else
- echo "*** Could not run AALIB test program, checking why..."
- CFLAGS="$CFLAGS $AALIB_CFLAGS"
- LIBS="$LIBS $AALIB_LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <aalib.h>
-]], [[
- return ((AA_LIB_VERSION) ||
-#ifdef AA_LIB_MINNOR
- (AA_LIB_MINNOR)
-#else
- (AA_LIB_MINOR)
-#endif
- ); ]])],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding AALIB or finding the wrong"
- echo "*** version of AALIB. If it is not finding AALIB, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
- echo "***"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means AALIB was incorrectly installed"
- echo "*** or that you have moved AALIB since it was installed." ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- AALIB_CFLAGS=""
- AALIB_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(AALIB_CFLAGS)
- AC_SUBST(AALIB_LIBS)
- AC_LANG_POP([C])
- rm -f conf.aalibtest
-])
diff --git a/m4/arts.m4 b/m4/arts.m4
deleted file mode 100644
index b66199be8..000000000
--- a/m4/arts.m4
+++ /dev/null
@@ -1,168 +0,0 @@
-# Configure paths for ARTS
-# Philip Stadermann 2001-06-21
-# stolen from esd.m4
-
-dnl AM_PATH_ARTS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for ARTS, and define ARTS_CFLAGS and ARTS_LIBS
-dnl
-AC_DEFUN([AM_PATH_ARTS],
-[dnl
-dnl Get the cflags and libraries from the artsc-config script
-dnl
-AC_ARG_WITH(arts-prefix, AS_HELP_STRING([--with-arts-prefix=DIR], [prefix where ARTS is installed (optional)]),
- arts_prefix="$withval", arts_prefix="")
-AC_ARG_ENABLE(artstest, AS_HELP_STRING([--disable-artstest], [do not try to compile and run a test ARTS program]),
- enable_artstest=$enableval, enable_artstest=yes)
-
- if test x$arts_prefix != x ; then
- arts_args="$arts_args --arts-prefix=$arts_prefix"
- if test x${ARTS_CONFIG+set} != xset ; then
- ARTS_CONFIG=$arts_prefix/bin/artsc-config
- fi
- fi
-
- AC_PATH_TOOL(ARTS_CONFIG, artsc-config, no)
-
- min_arts_version=ifelse([$1], ,0.9.5,$1)
- AC_MSG_CHECKING(for ARTS artsc - version >= $min_arts_version)
- no_arts=""
- if test "$ARTS_CONFIG" = "no" ; then
- no_arts=yes
- else
- ARTS_CFLAGS=`$ARTS_CONFIG $artsconf_args --cflags`
- ARTS_LIBS=`$ARTS_CONFIG $artsconf_args --libs`
-
- arts_major_version=`$ARTS_CONFIG $arts_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- arts_minor_version=`$ARTS_CONFIG $arts_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- arts_micro_version=`$ARTS_CONFIG $arts_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_artstest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $ARTS_CFLAGS"
- LIBS="$LIBS $ARTS_LIBS"
-dnl
-dnl Check if the installed ARTS is actually available -- when cross-compiling,
-dnl we have probably detected the build system's version of artsc-config
-dnl
- AC_CHECK_LIB([artsc], [arts_init], [], [no_arts=yes], [$ARTS_LIBS])
-
-dnl
-dnl Now check if the installed ARTS is sufficiently new. (Also sanity
-dnl checks the results of artsc-config to some extent)
-dnl
- rm -f conf.artstest
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <artsc.h>
-
-char*
-my_strdup (char *str)
-{
- char *new_str;
-
- if (str)
- {
- new_str = malloc ((strlen (str) + 1) * sizeof(char));
- strcpy (new_str, str);
- }
- else
- new_str = NULL;
-
- return new_str;
-}
-
-int main ()
-{
- int major, minor, micro;
- char *tmp_version;
-
- system ("touch conf.artstest");
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = my_strdup("$min_arts_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
- printf("%s, bad version string\n", "$min_arts_version");
- exit(1);
- }
-
- if (($arts_major_version > major) ||
- (($arts_major_version == major) && ($arts_minor_version > minor)) ||
- (($arts_major_version == major) && ($arts_minor_version == minor) && ($arts_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** 'artsc-config --version' returned %d.%d.%d, but the minimum version\n", $arts_major_version, $arts_minor_version, $arts_micro_version);
- printf("*** of ARTS required is %d.%d.%d. If artsc-config is correct, then it is\n", major, minor, micro);
- printf("*** best to upgrade to the required version.\n");
- printf("*** If artsc-config was wrong, set the environment variable ARTS_CONFIG\n");
- printf("*** to point to the correct copy of artsc-config, and remove the file\n");
- printf("*** config.cache before re-running configure\n");
- return 1;
- }
-}
-
-]])],[],[no_arts=yes],[no_arts=cc])
-
- if test "x$no_arts" = "xcc"; then
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <artsc.h>
-]], [[ return 0; ]])],[no_arts=''],[no_arts=yes])
- fi
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_arts" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$ARTS_CONFIG" = "no" ; then
- echo "*** The artsc-config script installed by ARTS could not be found"
- echo "*** If ARTS was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or set the ARTS_CONFIG environment variable to the"
- echo "*** full path to artsc-config."
- else
- if test -f conf.artstest ; then
- :
- else
- echo "*** Could not run ARTS test program, checking why..."
- CFLAGS="$CFLAGS $ARTS_CFLAGS"
- LIBS="$LIBS $ARTS_LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <artsc.h>
-]], [[ return 0; ]])],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding ARTS or finding the wrong"
- echo "*** version of ARTS. If it is not finding ARTS, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means ARTS was incorrectly installed"
- echo "*** or that you have moved ARTS since it was installed. In the latter case, you"
- echo "*** may want to edit the artsc-config script: $ARTS_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- ARTS_CFLAGS=""
- ARTS_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(ARTS_CFLAGS)
- AC_SUBST(ARTS_LIBS)
- rm -f conf.artstest
-])
diff --git a/m4/audio_out.m4 b/m4/audio_out.m4
new file mode 100644
index 000000000..5041dfbba
--- /dev/null
+++ b/m4/audio_out.m4
@@ -0,0 +1,225 @@
+dnl -----------------
+dnl Audio out plugins
+dnl -----------------
+AC_DEFUN([XINE_AUDIO_OUT_PLUGINS], [
+ dnl Setup defaults for the target operating system. For example, alsa is
+ dnl only ever available on Linux, so don't bother checking for it unless
+ dnl explicitly requested to do so on other operating systems.
+ dnl Notes:
+ dnl - Alsa is Linux only
+ dnl - CoreAudio is Mac OS X only
+ dnl - EsounD is reported to be available on most platforms
+ dnl - FusionSound is Linux only, but don't enable it by default
+ dnl - Jack is Linux and Mac OS X primarily
+ dnl - OSS is most unix variants
+ dnl - PulseAudio has been tested on Linux, Solaris, FreeBSD, Windows
+ dnl - SunAudio is NetBSD, Solaris (anything else?)
+ dnl - sndio is OpenBSD only
+
+ default_enable_coreaudio=no
+ default_enable_irixal=no
+ default_enable_oss=yes
+ default_enable_sunaudio=no
+ default_enable_sndio=no
+
+ default_with_alsa=no
+ default_with_esound=yes
+ default_with_fusionsound=no
+ default_with_jack=no
+ default_with_pulseaudio=no
+
+ case "$host_os" in
+ cygwin* | mingw*)
+ default_enable_oss=no
+ default_with_pulseaudio=yes
+ ;;
+ darwin*)
+ default_enable_coreaudio=yes
+ default_with_jack=yes
+ default_enable_oss=no
+ ;;
+ freebsd*|kfreebsd*)
+ default_with_pulseaudio=yes
+ default_with_jack=yes
+ ;;
+ gnu*)
+ default_with_pulseaudio=yes
+ default_with_jack=yes
+ ;;
+ irix*)
+ default_enable_irixal=yes
+ default_enable_oss=no
+ ;;
+ linux*)
+ default_with_alsa=yes
+ default_with_jack=yes
+ default_with_pulseaudio=yes
+ ;;
+ netbsd*)
+ default_enable_sunaudio=yes
+ ;;
+ openbsd*)
+ default_enable_oss=no
+ default_enable_sndio=yes
+ ;;
+ solaris*)
+ default_with_pulseaudio=yes
+ default_enable_sunaudio=yes
+ ;;
+ esac
+
+
+ dnl Alsa support
+ XINE_ARG_WITH([alsa], [Build with ALSA audio output support])
+ if test x"$with_alsa" != x"no"; then
+ PKG_CHECK_MODULES([ALSA], [alsa >= 0.9.0], [have_alsa=yes], [have_alsa=no])
+ if test x"$hard_with_alsa" = x"yes" && test x"$have_alsa" != x"yes"; then
+ AC_MSG_ERROR([ALSA support requested but not found.])
+ elif test x"$have_alsa" = x"yes"; then
+ dnl This is needed by src/input/input_v4l.c
+ AC_DEFINE([HAVE_ALSA], 1, [Define this if you have ALSA installed])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_ALSA], [test x"$have_alsa" = x"yes"])
+
+
+ dnl CoreAudio for Mac OS X
+ XINE_ARG_ENABLE([coreaudio], [Enable support for Mac OS X CoreAudio])
+ if test x"$enable_coreaudio" != x"no"; then
+ AC_MSG_CHECKING([for CoreAudio frameworks])
+ ac_save_LIBS="$LIBS" LIBS="$LIBS -framework CoreAudio -framework AudioUnit"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0]])], [have_coreaudio=yes], [have_coreaudio=no])
+ LIBS="$ac_save_LIBS"
+ AC_MSG_RESULT([$have_coreaudio])
+ if test x"hard_$enable_coreaudio" = x"yes" && test x"$have_coreaudio" != x"yes"; then
+ AC_MSG_ERROR([CoreAudio support requested, but CoreAudio not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_COREAUDIO], [test x"$have_coreaudio" = x"yes"])
+
+
+ dnl EsounD support
+ XINE_ARG_WITH([esound], [Build with EsounD audio output support])
+ if test x"$with_esound" != x"no"; then
+ PKG_CHECK_MODULES([ESD], [esound], [have_esound=yes], [have_esound=no])
+ if test x"$hard_with_esound" = x"yes" && test x"$have_esound" != x"yes"; then
+ AC_MSG_ERROR([EsounD support requested, but EsounD not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_ESD], [test x"$have_esound" = x"yes"])
+
+
+ dnl FusionSound support
+ XINE_ARG_WITH([fusionsound], [Build with FunsionSound audio output support])
+ if test x"$with_fusionsound" != x"no"; then
+ PKG_CHECK_MODULES([FUSIONSOUND], [fusionsound >= 0.9.23], [have_fusionsound=yes], [have_fusionsound=no])
+ if test x"$hard_with_fusionsound" = x"yes" && test x"$have_fusionsound" != x"yes"; then
+ AC_MSG_ERROR([FusionSound support requested, but FusionSound not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_FUSIONSOUND], [test x"$have_fusionsound" = x"yes"])
+
+
+ dnl IRIX style audio interface
+ XINE_ARG_ENABLE([irixal], [Enable support for IRIX libaudio])
+ if test x"$enable_irixal" != x"no"; then
+ AC_CACHE_CHECK([for IRIX libaudio support], [am_cv_have_irixal],
+ [AC_CHECK_HEADER([dmedia/audio.h],
+ [am_cv_have_irixal=yes], [am_cv_have_irixal=no])])
+ if test x"$am_cv_have_irixal" = x"yes"; then
+ AC_DEFINE([HAVE_IRIXAL], 1, [Define this if you have a usable IRIX al interface available])
+ IRIXAL_LIBS="-laudio"
+ IRIXAL_STATIC_LIB="/usr/lib/libaudio.a"
+ AC_SUBST(IRIXAL_LIBS)
+ AC_SUBST(IRIXAL_STATIC_LIB)
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_IRIXAL], [test x"$am_cv_have_irixal" = x"yes"])
+
+
+ dnl JACK support
+ XINE_ARG_WITH([jack], [Build with Jack support])
+ if test x"$with_jack" != x"no"; then
+ PKG_CHECK_MODULES([JACK], [jack >= 0.100], [have_jack=yes], [have_jack=no])
+ if test x"$hard_with_jack" = x"yes" && test x"$have_jack" != x"yes"; then
+ AC_MSG_ERROR([Jack support requested, but Jack not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_JACK], [test x"$have_jack" = x"yes"])
+
+
+ dnl OSS (Open Sound System)
+ XINE_ARG_ENABLE([oss], [Enable OSS (Open Sound System) support])
+ if test x"$enable_oss" != x"no"; then
+ AC_CHECK_HEADERS([sys/soundcard.h machine/soundcard.h soundcard.h], [break])
+ AC_CHECK_DECL([SNDCTL_DSP_SETFRAGMENT], [have_oss=yes], [have_oss=no],
+ [#ifdef HAVE_SYS_SOUNDCARD_H
+ # include <sys/soundcard.h>
+ #endif
+ #ifdef HAVE_MACHINE_SOUNDCARD_H
+ # include <sys/soundcard.h>
+ #endif
+ #ifdef HAVE_SOUNDCARD_H
+ # include <soundcard.h>
+ #endif])
+ if test x"$hard_enable_oss" = x"yes" && test x"$have_oss" != x"yes"; then
+ AC_MSG_ERROR([OSS support requested, but OSS not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_OSS], [test x"$have_oss" = x"yes"])
+
+
+ dnl PulseAudio
+ XINE_ARG_WITH([pulseaudio], [Build with PulseAudio support])
+ if test x"$with_pulseaudio" != x"no"; then
+ PKG_CHECK_MODULES([PULSEAUDIO], [libpulse], [have_pulseaudio="yes"], [have_pulseaudio="no"])
+ if test x"$hard_with_pulseaudio" = x"yes" && test x"$have_pulseaudio" != x"yes"; then
+ AC_MSG_ERROR([PulseAudio support requested, but PulseAudio not found])
+ fi
+ if test x"$have_pulseaudio" = xyes; then
+ AC_MSG_CHECKING([for pulseaudio >= 0.9.7])
+ PKG_CHECK_EXISTS([libpulse >= 0.9.7],
+ [have_pulseaudio_0_9_7="yes"],
+ [have_pulseaudio_0_9_7="no"])
+ AC_MSG_RESULT([$have_pulseaudio_0_9_7])
+ if test x"$have_pulseaudio_0_9_7" = xyes; then
+ AC_DEFINE([HAVE_PULSEAUDIO_0_9_7], 1, [define this if you have pulseaudio >= 0.9.7])
+ fi
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_PULSEAUDIO], [test x"$have_pulseaudio" = x"yes"])
+
+
+ dnl SUN style audio interface
+ XINE_ARG_ENABLE([sunaudio], [Enable Sun audio support])
+ if test x"$enable_sunaudio" != x"no"; then
+ AC_MSG_CHECKING([for Sun audio support])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <sys/audioio.h>]],
+ [[audio_info_t audio_info; AUDIO_INITINFO(&audio_info)]])],
+ [have_sunaudio=yes], [have_sunaudio=no])
+ AC_MSG_RESULT([$have_sunaudio])
+ if test x"$hard_enable_sunaudio" = x"yes" && test x"$have_sunaudio" != x"yes"; then
+ AC_MSG_ERROR([Sun audio support requested, but Sun audio not found])
+ elif test x"$have_sunaudio" = x"yes"; then
+ dnl NetBSD doesn't have this, but check for it rather than
+ dnl assuming that it doesn't happen elsewhere.
+ AC_CHECK_MEMBERS([audio_info_t.output_muted])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_SUNAUDIO], [test x"$have_sunaudio" = x"yes"])
+
+
+ dnl sndio support
+ XINE_ARG_ENABLE([sndio], [Enable sndio support])
+ if test x"$enable_sndio" != "xno"; then
+ AC_CHECK_LIB([sndio], [sio_open], [SNDIO_LIBS=-lsndio; have_sndio=yes],
+ [have_sndio=no])
+ if test "x$hard_enable_sndio" = "xyes" && test "x$have_sndio" = "xno"; then
+ AC_MSG_ERROR([sndio support requested, but sndio not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_SNDIO], [test "x$have_sndio" = "xyes"])
+ AC_SUBST([SNDIO_CFLAGS])
+ AC_SUBST([SNDIO_LIBS])
+])dnl XINE_AUDIO_OUT_PLUGINS
diff --git a/m4/decoders.m4 b/m4/decoders.m4
new file mode 100644
index 000000000..09d8dd900
--- /dev/null
+++ b/m4/decoders.m4
@@ -0,0 +1,520 @@
+dnl ---------------------------
+dnl Decoder and Demuxer Plugins
+dnl ---------------------------
+AC_DEFUN([XINE_DECODER_PLUGINS], [
+ dnl a52dec (optional; enabled by default; external version allowed)
+ AC_ARG_ENABLE([a52dec],
+ [AS_HELP_STRING([--enable-a52dec], [Enable support for a52dec decoding library (default: enabled, internal: use internal copy)])])
+ if test x"$enable_a52dec" != x"no"; then
+ if test x"$enable_a52dec" != x"internal"; then
+ AC_CHECK_LIB([a52], [a52_init],
+ [AC_CHECK_HEADERS([a52dec/a52.h], [have_external_a52dec=yes], [have_external_a52dec=no],
+ [#ifdef HAVE_SYS_TYPES_H
+ # include <sys/types.h>
+ #endif
+ #ifdef HAVE_INTTYPES_H
+ # include <inttypes.h>
+ #endif
+ #ifdef HAVE_STDINT_H
+ # include <stdint.h>
+ #endif
+ #include <a52dec/a52.h>])], [have_external_a52dec=no], [-lm])
+ if test x"$have_external_a52dec" = x"no"; then
+ AC_MSG_RESULT([*** no usable version of a52dec found, using internal copy ***])
+ fi
+ else
+ AC_MSG_RESULT([Using included a52dec support])
+ fi
+ if test x"$have_external_a52dec" = x"yes"; then
+ A52DEC_CFLAGS=''
+ A52DEC_LIBS='-la52'
+ A52DEC_DEPS=''
+ else
+ A52DEC_CFLAGS='-I$(top_srcdir)/contrib/a52dec'
+ A52DEC_LIBS='$(top_builddir)/contrib/a52dec/liba52.la'
+ A52DEC_DEPS='$(top_builddir)/contrib/a52dec/liba52.la'
+ fi
+ AC_SUBST(A52DEC_CFLAGS)
+ AC_SUBST(A52DEC_DEPS)
+ AC_SUBST(A52DEC_LIBS)
+ fi
+ AM_CONDITIONAL([ENABLE_A52DEC], [test x"$enable_a52dec" != x"no"])
+ AM_CONDITIONAL([WITH_EXTERNAL_A52DEC], [test x"$have_external_a52dec" = x"yes"])
+
+
+ dnl ASF (optional; enabled by default)
+ AC_ARG_ENABLE([asf],
+ [AS_HELP_STRING([--enable-asf], [Enable support for ASF demuxer (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_asf="yes"])
+ AM_CONDITIONAL([ENABLE_ASF], [test x"$enable_asf" != x"no"])
+
+ dnl Nosefart (optional, enabled by default)
+ AC_ARG_ENABLE([nosefart],
+ [AS_HELP_STRING([--enable-nosefart], [Enable support for nosefart player (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_nosefart="yes"])
+ AM_CONDITIONAL([ENABLE_NOSEFART], [test "x$enable_nosefart" != "xno"])
+
+ dnl FAAD (optional; enabled by default)
+ AC_ARG_ENABLE([faad],
+ [AS_HELP_STRING([--enable-faad], [Enable support for FAAD decoder (default: enabled, internal: use internal copy)])])
+ if test x"$enable_faad" != x"no"; then
+ if test x"$enable_faad" != x"internal"; then
+ AC_CHECK_LIB([faad], [NeAACDecInit],
+ [AC_CHECK_HEADERS([neaacdec.h], [have_external_faad=yes], [have_external_faad=no],
+ [#include <neaacdec.h>])], [have_external_faad=no], [-lm])
+ if test x"$have_external_faad" = x"no"; then
+ AC_MSG_RESULT([*** no usable version of libfaad found, using internal copy ***])
+ fi
+ else
+ AC_MSG_RESULT([Using included libfaad support])
+ fi
+ if test x"$have_external_faad" = x"yes"; then
+ FAAD_CFLAGS=''
+ FAAD_LIBS='-lfaad'
+ FAAD_DEPS=''
+ else
+ FAAD_CFLAGS='-I$(top_srcdir)/contrib/libfaad'
+ FAAD_LIBS='$(top_builddir)/contrib/libfaad/libfaad.la'
+ FAAD_DEPS='$(top_builddir)/contrib/libfaad/libfaad.la'
+ fi
+ AC_SUBST(FAAD_CFLAGS)
+ AC_SUBST(FAAD_DEPS)
+ AC_SUBST(FAAD_LIBS)
+ fi
+ AM_CONDITIONAL([ENABLE_FAAD], [test x"$enable_faad" != x"no"])
+ AM_CONDITIONAL([WITH_EXTERNAL_FAAD], [test x"$have_external_faad" = x"yes"])
+
+ dnl ffmpeg external version required
+ PKG_CHECK_MODULES([FFMPEG], [libavcodec >= 51.68.0])
+ PKG_CHECK_MODULES([AVUTIL], [libavutil >= 49.6.0])
+ PKG_CHECK_MODULES([FFMPEG_POSTPROC], [libpostproc])
+ AC_DEFINE([HAVE_FFMPEG], 1, [Define this if you have ffmpeg library])
+
+ dnl Check presence of ffmpeg/avutil.h to see if it's old or new
+ dnl style for headers. The new style would be preferred actually...
+ AC_CHECK_HEADERS([ffmpeg/avutil.h])
+ AC_CHECK_HEADERS([libavutil/avutil.h])
+ AC_CHECK_HEADERS([libavutil/sha1.h])
+ AC_CHECK_HEADERS([libavutil/sha.h])
+ if test "$ac_cv_header_ffmpeg_avutil_h" = "yes" && test "$ac_cv_header_libavutil_avutil_h" = "yes"; then
+ AC_MSG_ERROR([old & new ffmpeg headers found - you need to clean up!])
+ fi
+
+ dnl gdk-pixbuf (optional; enabled by default)
+ AC_ARG_ENABLE([gdkpixbuf],
+ [AS_HELP_STRING([--enable-gdkpixbuf], [Enable GdkPixbuf support (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_gdkpixbuf="yes"])
+ if test x"$enable_gdkpixbuf" != x"no"; then
+ PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0], [have_gdkpixbuf=yes], [have_gdkpixbuf=no])
+ if test x"$enable_gdkpixbuf" = x"yes" && test x"$have_gdkpixbuf" != x"yes"; then
+ AC_MSG_ERROR([GdkPixbuf support requested, but GdkPixbuf not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_GDK_PIXBUF], [test x"$have_gdkpixbuf" = x"yes"])
+
+
+ dnl ImageMagick (optional; enabled by default)
+ AC_ARG_WITH([imagemagick],
+ [AS_HELP_STRING([--with-imagemagick], [Enable ImageMagick image decoder support (default: enabled)])],
+ [test x"$withval" != x"no" && with_imagemagick="yes"])
+ if test x"$with_imagemagick" != x"no"; then
+ PKG_CHECK_MODULES([WAND], [Wand], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
+ if test "x$have_imagemagick" = 'xno'; then
+ PKG_CHECK_MODULES([MAGICKWAND], [MagickWand], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
+ dnl Avoid $(WAND_FLAGS) $(MAGICKWAND_FLAGS) ...
+ WAND_CFLAGS="$MAGICKWAND_CFLAGS"
+ WAND_LIBS="$MAGICKWAND_LIBS"
+ fi
+ if test "x$have_imagemagick" = 'xno'; then
+ PKG_CHECK_MODULES([GRAPHICSMAGICK], [ImageMagick], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
+ PKG_CHECK_MODULES([GRAPHICSMAGICKWAND], [GraphicsMagickWand], [have_imagemagick=yes], [AC_MSG_RESULT([no]); have_imagemagick=no])
+ dnl The following assignments are safe, since they include
+ dnl the flags for plain GraphicsMagick
+ WAND_CFLAGS="$GRAPHICSMAGICKWAND_CFLAGS"
+ WAND_LIBS="$GRAPHICSMAGICKWAND_LIBS"
+ AC_DEFINE([HAVE_GRAPHICSMAGICK], [1], [Define this if you have GraphicsMagick installed])
+ fi
+ if test x"$with_imagemagick" = x"yes" && test x"$have_imagemagick" = x"no"; then
+ AC_MSG_ERROR([ImageMagick support requested, but neither Wand, MagickWand, nor GraphicsMagick were found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_IMAGEMAGICK], [test x"$have_imagemagick" = x"yes"])
+
+
+ dnl libdts (optional; enabled by default; external version allowed)
+ AC_ARG_ENABLE([dts],
+ [AS_HELP_STRING([--enable-dts], [Enable support for DTS decoding library (default: enabled, internal: use internal copy)])])
+ if test x"$enable_dts" != x"no"; then
+ if test x"$enable_dts" != x"internal"; then
+ PKG_CHECK_MODULES([LIBDTS], [libdts], [have_external_dts=yes], [have_external_dts=no])
+ if test x"$have_external_dts" != x"yes"; then
+ AC_MSG_RESULT([*** no usable version of libdts found, using internal copy ***])
+ fi
+ else
+ AC_MSG_RESULT([Using included libdts support])
+ fi
+ if test x"$have_external_dts" != x"yes"; then
+ LIBDTS_CFLAGS='-I$(top_srcdir)/contrib/libdca/include'
+ LIBDTS_DEPS='$(top_builddir)/contrib/libdca/libdca.la'
+ LIBDTS_LIBS='$(top_builddir)/contrib/libdca/libdca.la'
+ AC_SUBST(LIBDTS_DEPS)
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_DTS], [test x"$enable_dts" != x"no"])
+ AM_CONDITIONAL([WITH_EXTERNAL_LIBDTS], [test x"$have_external_dts" = x"yes"])
+
+
+ dnl libFLAC (optional; enabled by default)
+ AC_ARG_WITH([libflac],
+ [AS_HELP_STRING([--with-libflac], [build libFLAC-based decoder and demuxer (default: enabled)])],
+ [test x"$withval" != x"no" && with_libflac="yes"])
+ AC_ARG_WITH([libFLAC-prefix],
+ [AS_HELP_STRING([--with-libFLAC-prefix=DIR], [prefix where libFLAC is installed (optional)])])
+ AC_ARG_WITH([libFLAC-libraries],
+ [AS_HELP_STRING([--with-libFLAC-libraries=DIR], [directory where libFLAC library is installed (optional)])])
+ AC_ARG_WITH([libFLAC-includes],
+ [AS_HELP_STRING([--with-libFLAC-includes=DIR], [directory where libFLAC header files are installed (optional)])])
+ if test x"$with_libflac" != x"no"; then
+ AC_MSG_CHECKING([libdir name])
+ case "$host_or_hostalias" in
+ *-*-linux*)
+ # Test if the compiler is 64bit
+ echo 'int i;' > conftest.$ac_ext
+ xine_cv_cc_64bit_output=no
+ if AC_TRY_EVAL(ac_compile); then
+ case `"$MAGIC_CMD" conftest.$ac_objext` in
+ *"ELF 64"*) xine_cv_cc_64bit_output=yes ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+ case "$host_cpu:$xine_cv_cc_64bit_output" in
+ powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+ XINE_LIBDIRNAME="lib64" ;;
+ *:*)
+ XINE_LIBDIRNAME="lib" ;;
+ esac
+ AC_MSG_RESULT([$XINE_LIBDIRNAME])
+
+ if test x"$with_libFLAC_includes" != x""; then
+ LIBFLAC_CFLAGS="-I$with_libFLAC_includes"
+ elif test x"$with_libFLAC_prefix" != x""; then
+ LIBFLAC_CFLAGS="-I$with_libFLAC_prefix/include"
+ elif test x"$prefix" != x"NONE"; then
+ LIBFLAC_CFLAGS="-I$prefix/include"
+ fi
+ AC_SUBST(LIBFLAC_CFLAGS)
+
+ if test x"$with_libFLAC_libraries" != x""; then
+ LIBFLAC_LIBS="-L$with_libFLAC_libraries"
+ elif test x"$with_libFLAC_prefix" != x""; then
+ LIBFLAC_LIBS="-L$with_libFLAC_prefix/$XINE_LIBDIRNAME"
+ elif test x"$prefix" != x"NONE"; then
+ LIBFLAC_LIBS="-L$prefix/$XINE_LIBDIRNAME"
+ fi
+ AC_SUBST(LIBFLAC_LIBS)
+
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $LIBFLAC_CFLAGS"
+ AC_CHECK_LIB([FLAC], [FLAC__stream_decoder_new],
+ [AC_CHECK_HEADERS([FLAC/stream_decoder.h],
+ [have_libflac=yes LIBFLAC_LIBS="$LIBFLAC_LIBS -lFLAC -lm"],
+ [have_libflac=no])],
+ [have_libflac=no], [-lm])
+ CPPFLAGS="$ac_save_CPPFLAGS"
+
+ if test x"$with_libflac" = x"yes" && test x"$have_libflac" != x"yes"; then
+ AC_MSG_ERROR([libFLAC-based decoder support requested, but libFLAC not found])
+ elif test x"$have_libflac" != x"yes"; then
+ LIBFLAC_CFLAGS="" LIBFLAC_LIBS=""
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_LIBFLAC], [test x"$have_libflac" = x"yes"])
+
+
+ dnl libmad (optional; enabled by default; external version allowed)
+ AC_ARG_ENABLE([mad],
+ [AS_HELP_STRING([--enable-mad], [Enable support for MAD decoding library (default: enabled, internal: use external copy)])])
+ if test x"$enable_mad" != x"no"; then
+ if test x"$enable_mad" != x"internal"; then
+ PKG_CHECK_MODULES([LIBMAD], [mad],
+ [AC_CHECK_HEADERS([mad.h], [have_external_libmad=yes], [have_external_libmad=no])],
+ [have_external_libmad=no])
+ if test x"$have_external_libmad" != x"yes"; then
+ AC_MSG_RESULT([*** no usable version of libmad found, using internal copy ***])
+ fi
+ else
+ AC_MSG_RESULT([Using included libmad support])
+ fi
+ if test x"$have_external_libmad" != x"yes"; then
+ case "$host_or_hostalias" in
+ i?86-* | k?-* | athlon-* | pentium*-)
+ AC_DEFINE([FPM_INTEL], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ x86_64-*)
+ AC_DEFINE([FPM_64BIT], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ ppc-* | powerpc-*)
+ AC_DEFINE([FPM_PPC], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ sparc*-*)
+ if test "$GCC" = yes; then
+ AC_DEFINE([FPM_SPARC], 1, [Define to select libmad fixed point arithmetic implementation])
+ else
+ AC_DEFINE([FPM_64BIT], 1, [Define to select libmad fixed point arithmetic implementation])
+ fi
+ ;;
+ mips-*)
+ AC_DEFINE([FPM_MIPS], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ alphaev56-* | alpha* | ia64-* | hppa*-linux-*)
+ AC_DEFINE([FPM_64BIT], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ arm*-*)
+ AC_DEFINE([FPM_ARM], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ universal-*)
+ ;;
+ *)
+ AC_DEFINE([FPM_DEFAULT], 1, [Define to select libmad fixed point arithmetic implementation])
+ ;;
+ esac
+ LIBMAD_CFLAGS='-I$(top_srcdir)/contrib/libmad'
+ LIBMAD_LIBS='$(top_builddir)/contrib/libmad/libmad.la'
+ LIBMAD_DEPS='$(top_builddir)/contrib/libmad/libmad.la'
+ fi
+ AC_SUBST(LIBMAD_CFLAGS)
+ AC_SUBST(LIBMAD_DEPS)
+ AC_SUBST(LIBMAD_LIBS)
+ fi
+ AM_CONDITIONAL([ENABLE_MAD], [test x"$enable_mad" != x"no"])
+ AM_CONDITIONAL([WITH_EXTERNAL_MAD], [test x"$have_external_libmad" = x"yes"])
+
+
+ dnl libmodplug (optional; enabled by default)
+ AC_ARG_ENABLE([modplug],
+ [AS_HELP_STRING([--enable-modplug], [Enable MODPlug support (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_modplug="yes"])
+ if test x"$enable_modplug" != x"no"; then
+ PKG_CHECK_MODULES([LIBMODPLUG], [libmodplug >= 0.7], [have_modplug=yes], [have_modplug=no])
+ if test x"$enable_modplug" = x"yes" && test x"$have_modplug" != x"yes"; then
+ AC_MSG_ERROR([MODPlug support requested, but MODPlug not found])
+ fi
+ if test "`"$PKG_CONFIG" --modversion libmodplug`" = 0.8.8; then
+ AC_MSG_ERROR([you have a broken version of libmodplug (0.8.8); cowardly refusing to use it])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_MODPLUG], [test x"$have_modplug" = x"yes"])
+
+
+ dnl libmpeg2new (optional; disabled by default)
+ AC_ARG_ENABLE([libmpeg2new],
+ AS_HELP_STRING([--enable-libmpeg2new], [build the newer MPEG2 decoder (buggy)]))
+ AM_CONDITIONAL([ENABLE_MPEG2NEW], [test "x$enable_libmpeg2new" = "xyes"])
+
+
+ dnl libmpcdec (optional; enabled by default; external version allowed)
+ AC_ARG_ENABLE([musepack],
+ [AS_HELP_STRING([--enable-musepack], [Enable support for Musepack decoding (default: enabled, internal: use external copy)])])
+ if test x"$enable_musepack" != x"no"; then
+ if test x"$enable_musepack" != x"internal"; then
+ AC_CHECK_LIB([mpcdec], [mpc_demux_decode],
+ [AC_CHECK_HEADERS([mpc/mpcdec.h], [have_external_libmpcdec=yes], [have_external_libmpcdec=no])],
+ [AC_CHECK_LIB([mpcdec], [mpc_decoder_decode],
+ [AC_CHECK_HEADERS([mpcdec/mpcdec.h], [have_external_libmpcdec=yes], [have_external_libmpcdec=no])],
+ [have_external_libmpcdec=no])])
+ if test x"$have_external_libmpcdec" != x"yes"; then
+ AC_MSG_RESULT([*** no usable version of libmpcdec found, using internal copy ***])
+ else
+ MPCDEC_CFLAGS=""
+ MPCDEC_DEPS=""
+ MPCDEC_LIBS="-lmpcdec"
+ fi
+ else
+ AC_MSG_RESULT([Using included libmpcdec (Musepack)])
+ fi
+ if test x"$have_external_libmpcdec" != x"yes"; then
+ MPCDEC_CFLAGS='-I$(top_srcdir)/contrib/libmpcdec'
+ MPCDEC_LIBS='$(top_builddir)/contrib/libmpcdec/libmpcdec.la'
+ MPCDEC_DEPS='$(top_builddir)/contrib/libmpcdec/libmpcdec.la'
+ fi
+ AC_SUBST(MPCDEC_CFLAGS)
+ AC_SUBST(MPCDEC_DEPS)
+ AC_SUBST(MPCDEC_LIBS)
+ fi
+ AM_CONDITIONAL([ENABLE_MUSEPACK], [test x"$enable_musepack" != x"no"])
+ AM_CONDITIONAL([WITH_EXTERNAL_LIBMPCDEC], [test x"$have_external_libmpcdec" = x"yes"])
+
+
+ dnl mlib
+ AC_ARG_ENABLE([mlib],
+ [AS_HELP_STRING([--enable-mlib], [build Sun mediaLib support (default: disabled)])],
+ [test x"$enableval" != x"no" && enable_mlib="yes"], [enable_lib="no"])
+ AC_ARG_ENABLE([mlib-lazyload],
+ [AS_HELP_STRING([--enable-mlib-lazyload], [check for Sun mediaLib at runtime])],
+ [test x"$enableval" != x"no" && enable_mlib_lazyload="yes"], [enable_mlib_lazyload="no"])
+ if test x"$enable_mlib" != x"no"; then
+ mlibhome="$MLIBHOME" test x"$mlibhome" = x"" && mlibhome="/opt/SUNWmlib"
+ AC_CHECK_LIB([mlib], [mlib_VideoAddBlock_U8_S16],
+ [saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I$mlibhome/include"
+ AC_CHECK_HEADERS([mlib_video.h],
+ [if test x"$enable_mlib_lazyload" != x"no"; then
+ if test "$GCC" = yes; then
+ MLIB_LIBS="-L$mlibhome/lib -Wl,-z,lazyload,-lmlib,-z,nolazyload"
+ else
+ MLIB_LIBS="-L$mlibhome/lib -z lazyload -lmlib -z nolazyload"
+ fi
+ AC_DEFINE([MLIB_LAZYLOAD], 1, [Define this if you want to load mlib lazily])
+ else
+ MLIB_LIBS="-L$mlibhome/lib -lmlib"
+ fi
+ MLIB_CFLAGS="-I$mlibhome/include"
+ AC_SUBST(MLIB_LIBS)
+ AC_SUBST(MLIB_CFLAGS)
+ dnl TODO: src/video_out/yuv2rgb.c and src/xine-utils/cpu_accel.c should be changed to use LIBMPEG2_MLIB
+ dnl and HAVE_MLIB should go away.
+ AC_DEFINE([HAVE_MLIB], 1, [Define this if you have mlib installed])
+ AC_DEFINE([LIBMPEG2_MLIB], 1, [Define this if you have mlib installed])
+ have_mlib=yes])
+ CPPFLAGS="$saved_CPPFLAGS"], [], ["-L$mlibhome/lib"])
+ fi
+ AM_CONDITIONAL([HAVE_MLIB], [test x"$have_mlib" = x"yes"])
+
+
+ dnl mng (optional; enabled by default)
+ AC_ARG_ENABLE([mng],
+ [AS_HELP_STRING([--enable-mng], [Enable MNG decoder support (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_mng="yes"])
+ if test x"$enable_mng" != x"no"; then
+ AC_CHECK_LIB([mng], [mng_initialize],
+ [AC_CHECK_HEADERS([libmng.h], [have_mng=yes], [have_mng=no])], [have_mng=no])
+ if test x"$enable_mng" = x"yes" && test x"$have_mng" != x"yes"; then
+ AC_MSG_ERROR([MNG support requested, but libmng not found])
+ elif test x"$have_mng" = x"yes"; then
+ MNG_LIBS="-lmng"
+ AC_SUBST(MNG_LIBS)
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_MNG], [test x"$have_mng" = x"yes"])
+
+
+ dnl Ogg/Speex (optional; enabled by default; external)
+ AC_ARG_WITH([speex],
+ [AS_HELP_STRING([--with-speex], [Enable Speex audio decoder support (default: enabled)])],
+ [test x"$withval" != x"no" && with_speex="yes"])
+ if test x"$with_speex" != x"no"; then
+ PKG_CHECK_MODULES([SPEEX], [ogg speex], [have_speex=yes], [have_speex=no])
+ if test x"$with_speex" = x"yes" && test x"$have_speex" != x"yes"; then
+ AC_MSG_ERROR([Speex support requested, but libspeex and/or libogg not found])
+ elif test x"$have_speex" = x"yes"; then
+ AC_DEFINE([HAVE_SPEEX], 1, [Define this if you have speex])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_SPEEX], [test x"$have_speex" = x"yes"])
+
+
+ dnl Ogg/Theora (optional; enabled by default; external)
+ AC_ARG_WITH([theora],
+ [AS_HELP_STRING([--with-theora], [Enable Theora video decoder support (default: enabled)])],
+ [test x"$withval" != x"no" && with_theora="yes"])
+ if test x"$with_theora" != x"no"; then
+ PKG_CHECK_MODULES([THEORA], [ogg theora], [have_theora=yes], [have_theora=no])
+ if test x"$with_theora" = x"yes" && test x"$have_theora" = x"no"; then
+ AC_MSG_ERROR([Theora support requested, but libtheora and/or libogg not found])
+ elif test x"$have_theora" = x"yes"; then
+ AC_DEFINE([HAVE_THEORA], 1, [Define this if you have theora])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_THEORA], [test x"$have_theora" = x"yes"])
+
+
+ dnl Ogg/Vorbis (optional; enabled by default; external)
+ AC_ARG_WITH([vorbis],
+ [AS_HELP_STRING([--with-vorbis], [Enable Vorbis audio decoder support (default: enabled)])],
+ [test x"$withval" != x"no" && with_vorbis="yes"])
+ if test x"$with_vorbis" != x"no"; then
+ PKG_CHECK_MODULES([VORBIS], [ogg vorbis], [have_vorbis=yes], [have_vorbis=no])
+ if test x"$with_vorbis" = x"yes" && test x"$have_vorbis" = "xno"; then
+ AC_MSG_ERROR([Vorbis support requested, but libvorbis and/or libogg not found])
+ elif test x"$have_vorbis" = x"yes"; then
+ AC_DEFINE([HAVE_VORBIS], 1, [Define this if you have vorbis])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_VORBIS], [test x"$have_vorbis" = x"yes"])
+
+
+ dnl real (optional; enabled by default)
+ dnl On some systems, we cannot enable Real codecs support to begin with.
+ dnl This includes Darwin, because it uses Mach-O rather than ELF.
+ AC_ARG_ENABLE([real-codecs],
+ [AS_HELP_STRING([--enable-real-codecs], [Enable Real binary codecs support (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_real_codecs="yes"])
+ AC_ARG_WITH([real-codecs-path],
+ [AS_HELP_STRING([--with-real-codecs-path=PATH], [Specify directory for Real binary codecs])])
+ if test x"$enable_real_codecs" != x"no"; then
+ case "$host_os" in
+ darwin*) have_real_codecs=no ;;
+ *)
+ have_real_codecs=yes
+
+ dnl For those that have a replacement, break at the first one found
+ AC_CHECK_SYMBOLS([__environ _environ environ], [break], [need_weak_aliases=yes])
+ AC_CHECK_SYMBOLS([stderr __stderrp], [break], [need_weak_aliases=yes])
+
+ dnl For these there are no replacements
+ AC_CHECK_SYMBOLS([___brk_addr __ctype_b])
+
+ if test x"$need_weak_aliases" = x"yes"; then
+ CC_ATTRIBUTE_ALIAS([], [have_real_codecs=no])
+ fi
+ ;;
+ esac
+ if test x"$enable_real_codecs" = x"yes" && test x"$have_real_codecs" != x"yes"; then
+ AC_MSG_ERROR([Binary Real codec support requested, but it is not available])
+ elif test x"$have_real_codecs" = x"yes"; then
+ if test "${with_real_codecs_path+set}" = "set"; then
+ AC_DEFINE_UNQUOTED([REAL_CODEC_PATH], ["$with_real_codecs_path"], [Default path in which to find Real binary codecs])
+ fi
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_REAL], [test x"$have_real_codecs" = x"yes"])
+
+
+ dnl w32dll (optional; x86 only; enabled if using GNU as; GNU as required)
+ AC_ARG_ENABLE([w32dll],
+ [AS_HELP_STRING([--enable-w32dll], [Enable Win32 DLL support (default: enabled)])],
+ [test x"$enableval" != x"no" && enable_w32dll="yes"],
+ [test x"$with_gnu_as" != x"yes" && enable_w32dll="no"])
+ AC_ARG_WITH([w32-path],
+ [AS_HELP_STRING([--with-w32-path=PATH], [location of Win32 binary codecs])],
+ [w32_path="$withval"], [w32_path="/usr/lib/codecs"])
+ if test x"$enable_w32dll" != x"no"; then
+ case "$host_or_hostalias" in
+ *-mingw* | *-cygwin) have_w32dll=no ;;
+ i?86-* | k?-* | athlon-* | pentium*-) have_w32dll="$with_gnu_as" ;;
+ *) enable_w32dll=no ;;
+ esac
+ if test x"$enable_w32dll" = x"yes" && test x"$have_w32dll" != x"yes"; then
+ AC_MSG_ERROR([Win32 DLL support requested, but Win32 DLL support is not available])
+ fi
+ fi
+ AC_SUBST(w32_path)
+ AM_CONDITIONAL([ENABLE_W32DLL], [test x"$have_w32dll" = x"yes"])
+
+
+ dnl wavpack (optional; disabled by default)
+ AC_ARG_WITH([wavpack],
+ [AS_HELP_STRING([--with-wavpack], [Enable Wavpack decoder (requires libwavpack)])],
+ [test x"$withval" != x"no" && with_wavpack="yes"], [with_wavpack="no"])
+ if test x"$with_wavpack" != x"no"; then
+ PKG_CHECK_MODULES([WAVPACK], [wavpack], [have_wavpack=yes], [have_wavpack=no])
+ if test x"$with_wavpack" = x"yes" && test x"$have_wavpack" != x"yes"; then
+ AC_MSG_ERROR([Wavpack decoder support requested, but libwavpack not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_WAVPACK], [test x"$have_wavpack" = x"yes"])
+
+
+ dnl Only enable building dmx image if either gdk_pixbuf or ImageMagick are enabled
+ AM_CONDITIONAL([BUILD_DMX_IMAGE], [test x"$have_imagemagick" = x"yes" -o x"$have_gdkpixbuf" = x"yes"])
+])
diff --git a/m4/directx.m4 b/m4/directx.m4
index d64c13fc4..082581c8f 100644
--- a/m4/directx.m4
+++ b/m4/directx.m4
@@ -10,62 +10,40 @@ dnl It looks for DirectX, defines DIRECTX_CPPFLAGS, DIRECTX_AUDIO_LIBS and
dnl DIRECTX_VIDEO_LIBS.
dnl
AC_DEFUN([AM_PATH_DIRECTX], [
-
-AC_ARG_WITH(dxheaders, AS_HELP_STRING([--with-dxheaders], [specify location of DirectX headers]),
- [dxheaders_prefix="$withval"],
- [dxheaders_prefix="no"]
-)
-
-if test x"$dxheaders_prefix" != "xno"; then
- DIRECTX_CPPFLAGS="-I${dxheaders_prefix} ${DIRECTX_CPPFLAGS}"
-fi
-
-AC_MSG_CHECKING(for DirectX)
-DIRECTX_VIDEO_LIBS="$DIRECTX_LIBS -lgdi32 -lddraw"
-DIRECTX_AUDIO_LIBS="$DIRECTX_LIBS -ldsound"
-AC_LANG_PUSH([C])
-ac_save_CPPFLAGS="$CPPFLAGS"
-ac_save_LIBS="$LIBS"
-CPPFLAGS="$CPPFLAGS $DIRECTX_CPPFLAGS"
-LIBS="$LIBS $DIRECTX_VIDEO_LIBS $DIRECTX_AUDIO_LIBS"
-AC_COMPILE_IFELSE([AC_LANG_SOURCE(
- [
-#include <stddef.h>
-
-#include <windows.h>
-#include <ddraw.h>
-#include <dsound.h>
-
-int main() {
- DirectDrawCreate(0, NULL, 0);
- DirectSoundCreate(0, NULL, 0);
-
- return 0;
-}
- ])],
- [have_directx=yes
- AC_DEFINE(HAVE_DIRECTX,1,[Define this if you have DirectX])],,)
-CPPFLAGS=$ac_save_CPPFLAGS
-LIBS=$ac_save_LIBS
-AC_LANG_POP([C])
-
-if test x$have_directx = xyes ; then
- AC_MSG_RESULT(yes)
-else
- AC_MSG_RESULT(no)
- AC_MSG_RESULT(*** All DirectX dependent parts will be disabled ***)
-fi
-
-AC_SUBST(DIRECTX_CPPFLAGS)
-AC_SUBST(DIRECTX_AUDIO_LIBS)
-AC_SUBST(DIRECTX_VIDEO_LIBS)
-AM_CONDITIONAL(HAVE_DIRECTX, test x$have_directx = "xyes")
-
-dnl result
-if test x"$have_directx" = "xyes"; then
- ifelse([$1], , :, [$1])
-else
- ifelse([$2], , :, [$2])
-fi
-
+ AC_ARG_WITH([dxheaders],
+ [AS_HELP_STRING([--with-dxheaders], [specify location of DirectX headers])],
+ [dxheaders_prefix="$withval"], [dxheaders_prefix="no"])
+ if test x"$dxheaders_prefix" != x"no"; then
+ DIRECTX_CPPFLAGS="-I$dxheaders_prefix $DIRECTX_CPPFLAGS"
+ fi
+
+ AC_MSG_CHECKING([for DirectX])
+ DIRECTX_AUDIO_LIBS="$DIRECTX_LIBS -ldsound"
+ DIRECTX_VIDEO_LIBS="$DIRECTX_LIBS -lgdi32 -lddraw"
+
+ AC_LANG_PUSH([C])
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $DIRECTX_CPPFLAGS"
+ ac_save_LIBS="$LIBS" LIBS="$LIBS $DIRECTX_VIDEO_LIBS $DIRECTX_AUDIO_LIBS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
+ #include <windows.h>
+ #include <ddraw.h>
+ #include <dsound.h>]],
+ [[DirectDrawCreate(0, NULL, 0); DirectSoundCreate(0, NULL, 0)]])],
+ [have_directx=yes], [have_directx=no])
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ LIBS="$ac_save_LIBS"
+ AC_LANG_POP([C])
+
+ AC_SUBST(DIRECTX_CPPFLAGS)
+ AC_SUBST(DIRECTX_AUDIO_LIBS)
+ AC_SUBST(DIRECTX_VIDEO_LIBS)
+ AM_CONDITIONAL([ENABLE_DIRECTX], [test x"$have_directx" = x"yes"])
+
+ AC_MSG_RESULT([$have_directx])
+ if test x"$have_directx" = x"yes"; then
+ AC_DEFINE([HAVE_DIRECTX], 1, [Define this if you have DirectX])
+ ifelse([$1], , :, [$1])
+ else
+ ifelse([$2], , :, [$2])
+ fi
])
diff --git a/m4/dl.m4 b/m4/dl.m4
deleted file mode 100644
index 87d16c17f..000000000
--- a/m4/dl.m4
+++ /dev/null
@@ -1,53 +0,0 @@
-dnl
-dnl Check for dlopen symbol and set DYNAMIC_LD_LIBS.
-dnl
-dnl AM_DL()
-dnl
-
-AC_DEFUN([AM_DL], [
- AC_CHECK_LIB(c, dlopen,
- [DYNAMIC_LD_LIBS=""
- have_dl=yes])
-
- if test x$have_dl != "xyes"; then
- AC_CHECK_LIB(dl, dlopen,
- [DYNAMIC_LD_LIBS="-ldl"
- have_dl=yes])
- fi
-
- if test x$have_dl != "xyes"; then
- AC_MSG_CHECKING(for dlopen under win32)
- AC_LANG_PUSH([C])
-
- ac_save_CPPFLAGS="$CPPFLAGS"
- ac_save_LIBS="$LIBS"
- CPPFLAGS="-I${srcdir}/win32/include $CPPFLAGS"
- LIBS="$LIBS -lkernel32"
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-#include <stddef.h>
-#include <dlfcn.h>
-
-int main() {
- dlopen(NULL, 0);
- return 0;
-}
-])],
- [DYNAMIC_LD_LIBS=-lkernel32
- have_dl=yes
- AC_MSG_RESULT(yes)],
- AC_MSG_RESULT(no)
- )
-
- CPPFLAGS=$ac_save_CPPFLAGS
- LIBS=$ac_save_LIBS
-
- AC_LANG_POP([C])
- fi
-
- if test x$have_dl != "xyes"; then
- AC_MSG_ERROR(dynamic linker needed)
- fi
-
- AC_SUBST(DYNAMIC_LD_LIBS)
-
-])
diff --git a/m4/dvdnav.m4 b/m4/dvdnav.m4
deleted file mode 100644
index d82fc02db..000000000
--- a/m4/dvdnav.m4
+++ /dev/null
@@ -1,194 +0,0 @@
-dnl Configure paths for DVDNAV
-dnl
-dnl Copyright (C) 2001 Daniel Caujolle-Bert <segfault@club-internet.fr>
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2 of the License, or
-dnl (at your option) any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-dnl
-dnl
-dnl As a special exception to the GNU General Public License, if you
-dnl distribute this file as part of a program that contains a configuration
-dnl script generated by Autoconf, you may include it under the same
-dnl distribution terms that you use for the rest of that program.
-dnl
-
-dnl AM_PATH_DVDNAV([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
-dnl Test for DVDNAV, and define DVDNAV_CFLAGS and DVDNAV_LIBS
-dnl
-AC_DEFUN([AM_PATH_DVDNAV],
-[dnl
-dnl Get the cflags and libraries from the dvdnav-config script
-dnl
-AC_ARG_WITH(dvdnav-prefix,
- AS_HELP_STRING([--with-dvdnav-prefix=DIR], [prefix where DVDNAV is installed (optional)]),
- dvdnav_config_prefix="$withval", dvdnav_config_prefix="")
-AC_ARG_WITH(dvdnav-exec-prefix,
- AS_HELP_STRING([--with-dvdnav-exec-prefix=DIR], [exec prefix where DVDNAV is installed (optional)]),
- dvdnav_config_exec_prefix="$withval", dvdnav_config_exec_prefix="")
-AC_ARG_ENABLE(dvdnavtest,
- AS_HELP_STRING([--disable-dvdnavtest], [do not try to compile and run a test DVDNAV program]),
- enable_dvdnavtest=$enableval, enable_dvdnavtest=yes)
-
- AC_LANG_PUSH([C])
-
- if test x$dvdnav_config_exec_prefix != x ; then
- dvdnav_config_args="$dvdnav_config_args --exec-prefix=$dvdnav_config_exec_prefix"
- if test x${DVDNAV_CONFIG+set} != xset ; then
- DVDNAV_CONFIG=$dvdnav_config_exec_prefix/bin/dvdnav-config
- fi
- fi
- if test x$dvdnav_config_prefix != x ; then
- dvdnav_config_args="$dvdnav_config_args --prefix=$dvdnav_config_prefix"
- if test x${DVDNAV_CONFIG+set} != xset ; then
- DVDNAV_CONFIG=$dvdnav_config_prefix/bin/dvdnav-config
- fi
- fi
-
- min_dvdnav_version=ifelse([$1], ,0.0.0,$1)
- if test "x$enable_dvdnavtest" != "xyes" ; then
- AC_MSG_CHECKING([for DVDNAV-LIB version >= $min_dvdnav_version])
- else
- AC_PATH_TOOL(DVDNAV_CONFIG, dvdnav-config, no)
- AC_MSG_CHECKING([for DVDNAV-LIB version >= $min_dvdnav_version])
- no_dvdnav=""
- if test "$DVDNAV_CONFIG" = "no" ; then
- no_dvdnav=yes
- else
- DVDNAV_CFLAGS=`$DVDNAV_CONFIG $dvdnav_config_args --cflags`
- DVDNAV_LIBS=`$DVDNAV_CONFIG $dvdnav_config_args --libs`
- dvdnav_config_major_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- dvdnav_config_minor_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- dvdnav_config_sub_version=`$DVDNAV_CONFIG $dvdnav_config_args --version | \
- sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- dnl if test "x$enable_dvdnavtest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $DVDNAV_CFLAGS"
- LIBS="$DVDNAV_LIBS $LIBS"
-dnl
-dnl Now check if the installed DVDNAV is sufficiently new. (Also sanity
-dnl checks the results of dvdnav-config to some extent
-dnl
- rm -f conf.dvdnavtest
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <stdint.h>
-#include <dvdnav/dvdnav.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-int
-main ()
-{
- int major, minor, sub;
- char *tmp_version;
-
- system ("touch conf.dvdnavtest");
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = (char *) strdup("$min_dvdnav_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) {
- printf("%s, bad version string\n", "$min_dvdnav_version");
- exit(1);
- }
-
- if (($dvdnav_config_major_version > major) ||
- (($dvdnav_config_major_version == major) && ($dvdnav_config_minor_version > minor)) ||
- (($dvdnav_config_major_version == major) && ($dvdnav_config_minor_version == minor) && ($dvdnav_config_sub_version >= sub))) {
- return 0;
- } else {
- printf("\n*** An old version of libdvdnav (%d.%d.%d) was found.\n",
- $dvdnav_config_major_version, $dvdnav_config_minor_version, $dvdnav_config_sub_version);
- printf("*** You need a version of libdvdnav newer than %d.%d.%d. The latest version of\n",
- major, minor, sub);
- printf("*** libdvdnav is always available from:\n");
- printf("*** http://dvd.sourceforge.net\n");
- printf("***\n");
- printf("*** If you have already installed a sufficiently new version, this error\n");
- printf("*** probably means that the wrong copy of the dvdnav-config shell script is\n");
- printf("*** being found. The easiest way to fix this is to remove the old version\n");
- printf("*** of libdvdnav, but you can also set the DVDNAV_CONFIG environment to point to the\n");
- printf("*** correct copy of dvdnav-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
- printf("*** so that the correct libraries are found at run-time))\n");
- }
- return 1;
-}
-]])],[],[no_dvdnav=yes],[no_dvdnav=cc])
- if test "x$no_dvdnav" = xcc; then
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdint.h>
-#include <dvdnav/dvdnav.h>
-#include <stdio.h>
-]], [[ return 0; ]])],[no_dvdnav=''],[no_dvdnav=yes])
- fi
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_dvdnav" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- dnl nav_*.h seem to have been moved from dvdnav at some point?
- AC_CHECK_HEADERS([dvdread/nav_types.h],,,
-[#include <stdint.h>
-])
- else
- AC_MSG_RESULT(no)
- if test "$DVDNAV_CONFIG" = "no" ; then
- echo "*** The dvdnav-config script installed by DVDNAV could not be found"
- echo "*** If DVDNAV was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or set the DVDNAV_CONFIG environment variable to the"
- echo "*** full path to dvdnav-config."
- else
- if test -f conf.dvdnavtest ; then
- :
- else
- echo "*** Could not run DVDNAV test program, checking why..."
- CFLAGS="$CFLAGS $DVDNAV_CFLAGS"
- LIBS="$LIBS $DVDNAV_LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <stdint.h>
-#include <dvdnav/dvdnav.h>
-#include <stdio.h>
-]], [[ return 0; ]])],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding DVDNAV or finding the wrong"
- echo "*** version of DVDNAV. If it is not finding DVDNAV, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
- echo "***"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means DVDNAV was incorrectly installed"
- echo "*** or that you have moved DVDNAV since it was installed. In the latter case, you"
- echo "*** may want to edit the dvdnav-config script: $DVDNAV_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- DVDNAV_CFLAGS=""
- DVDNAV_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(DVDNAV_CFLAGS)
- AC_SUBST(DVDNAV_LIBS)
- AC_LANG_POP([C])
- rm -f conf.dvdnavtest
-])
diff --git a/m4/gas.m4 b/m4/gas.m4
index 923c3f90c..a3c600793 100644
--- a/m4/gas.m4
+++ b/m4/gas.m4
@@ -10,111 +10,98 @@ dnl modifications, as long as this notice is preserved.
dnl AC_PROG_AS
dnl ----------
dnl find the pathname to the GNU or non-GNU assembler
-AC_DEFUN([CC_PROG_AS],
-[AC_ARG_WITH([gnu-as],
- [AS_HELP_STRING([--with-gnu-as],
- [assume the C compiler uses GNU as @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_as=yes],
- [with_gnu_as=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-cc_prog=as
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=as gives a path.
- AC_MSG_CHECKING([for as used by $CC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=as) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=as) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]]* | ?:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
- # Canonicalize the pathname of as
- ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
- done
- test -z "$AS" && AS="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=as
- ;;
- *)
- # If it is relative, then search for the first as in PATH.
- with_gnu_as=unknown
- ;;
- esac
-elif test "$with_gnu_as" = yes; then
- AC_MSG_CHECKING([for GNU as])
-else
- AC_MSG_CHECKING([for non-GNU as])
-fi
-AC_CACHE_VAL(cc_cv_path_AS,
-[if test -z "$AS"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_AS="$ac_dir/$ac_prog"
- # Check to see if the program is GNU as. I'd rather use --version,
- # but apparently some variants of GNU as only accept -v.
- # Break only if it was the GNU/non-GNU as that we prefer.
- case `"$cc_cv_path_AS" -v 2>&1 </dev/null` in
- dnl Apple's assembler reports itself as GNU as 1.38;
- dnl but it doesn't provide the functions we need.
- *Apple*)
- test "$with_gnu_as" != yes && break
- ;;
- *GNU* | *'with BFD'*)
- test "$with_gnu_as" != no && break
- ;;
- *)
- test "$with_gnu_as" != yes && break
- ;;
- esac
- fi
- done
- IFS="$lt_save_ifs"
-else
- cc_cv_path_AS="$AS" # Let the user override the test with a path.
-fi])
-AS="$cc_cv_path_AS"
-if test -n "$AS"; then
- AC_MSG_RESULT($AS)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$AS" && AC_MSG_ERROR([no acceptable as found in \$PATH])
-CC_PROG_AS_GNU
-])
+dnl based on AC_PROG_LD from libtool
+AC_DEFUN([CC_PROG_AS], [
+ AC_REQUIRE([LT_AC_PROG_SED])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AM_PROG_AS])dnl
+ AC_REQUIRE([AC_CANONICAL_HOST])dnl
+ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+
+ AC_ARG_WITH([gnu-as],
+ [AS_HELP_STRING([--with-gnu-as], [assume the C compiler uses GNU as @<:@default=no@:>@])],
+ [test "$withval" = no || with_gnu_as=yes], [with_gnu_as=unknown])
+ if test x"$with_gnu_as" = x"unknown"; then
+ dnl If CCAS is not the same as CC, check to see if it's GCC.
+ if test x"$CCAS" = x"$CC"; then
+ ccas_is_gnu="$GCC"
+ else
+ AC_CACHE_CHECK([whether $CCAS is a GNU compiler], [ac_cv_CCAS_compiler_gnu],
+ [saved_CC="$CC" CC="$CCAS"
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[#ifndef __GNUC__
+ choke me
+ #endif]])],
+ [ac_cv_CCAS_compiler_gnu=yes], [ac_cv_CCAS_compiler_gnu=no])
+ CC="$saved_CC"])
+ ccas_is_gnu="$ac_cv_CCAS_compiler_gnu"
+ fi
+ dnl Try to figure out the assembler command. Fallback to as.
+ ac_prog=""
+ if test x"$AS" = x""; then
+ AC_MSG_CHECKING([for as used by $CCAS])
+ if test x"$ccas_is_gnu" = x"yes"; then
+ # Check if gcc -print-prog-name=as gives a path.
+ case "$host_or_hostalias" in
+ *-*-mingw*)
+ # gcc leaves a trailing carriage return which upsets mingw
+ ac_prog=`($CCAS -print-prog-name=as) 2>&5 | tr -d '\015'`
+ ;;
+ *)
+ ac_prog=`($CCAS -print-prog-name=as) 2>&5`
+ ;;
+ esac
+
+ case "$ac_prog" in
+ # Accept absolute paths.
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
+ # Canonicalize the pathname of as
+ ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
+ while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
+ done
+ ;;
+ *) ac_prog="" ;;
+ esac
+ fi
+ fi
+ if test x"$ac_prog" = x""; then
+ # If it fails, then pretend we aren't using GCC.
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
+ test -z "$ac_dir" && ac_dir=.
+ if test -f "$ac_dir/as" || test -f "$ac_dir/as$ac_exeext"; then
+ ac_prog="$ac_dir/as"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+ fi
+ if test x"$ac_prog" = x""; then
+ AC_MSG_RESULT([unknown])
+ else
+ AS="$ac_prog"
+ AC_MSG_RESULT([$AS])
+ fi
+ fi
-dnl AC_PROG_AS_GNU
-dnl --------------
-AC_DEFUN([CC_PROG_AS_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the assembler ($AS) is GNU as], cc_cv_prog_gnu_as,
-[# I'd rather use --version here, but apparently some GNU as's only accept -v.
-case `$AS -v 2>&1 </dev/null` in
-dnl Apple's assembler reports itself as GNU as 1.38;
-dnl but it doesn't provide the functions we need.
-*Apple*)
- cc_cv_prog_gnu_as=no
- ;;
-*GNU* | *'with BFD'*)
- cc_cv_prog_gnu_as=yes
- ;;
-*)
- cc_cv_prog_gnu_as=no
- ;;
-esac])
-with_gnu_as=$cc_cv_prog_gnu_as
+ test -z "$AS" && AC_MSG_ERROR([no acceptable as found in \$PATH])
+ AC_CACHE_CHECK([if the assembler ($AS) is GNU as], [cc_cv_prog_gnu_as], [
+ # I'd rather use --version here, but apparently some GNU as's only accept -v.
+ case `"$AS" -v 2>&1 </dev/null` in
+ *Apple*)
+ # Apple's assembler reports itself as GNU as 1.38;
+ # but it doesn't provide the functions we need.
+ cc_cv_prog_gnu_as=no
+ ;;
+ *GNU* | *'with BFD'*)
+ cc_cv_prog_gnu_as=yes
+ ;;
+ *)
+ cc_cv_prog_gnu_as=no
+ ;;
+ esac])
+ with_gnu_as="$cc_cv_prog_gnu_as"
])
diff --git a/m4/glibc2.m4 b/m4/glibc2.m4
deleted file mode 100644
index e8f5bfe6e..000000000
--- a/m4/glibc2.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# glibc2.m4 serial 1
-dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.0 or newer.
-# From Bruno Haible.
-
-AC_DEFUN([gt_GLIBC2],
- [
- AC_CACHE_CHECK(whether we are using the GNU C Library 2 or newer,
- ac_cv_gnu_library_2,
- [AC_EGREP_CPP([Lucky GNU user],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ >= 2)
- Lucky GNU user
- #endif
-#endif
- ],
- ac_cv_gnu_library_2=yes,
- ac_cv_gnu_library_2=no)
- ]
- )
- AC_SUBST(GLIBC2)
- GLIBC2="$ac_cv_gnu_library_2"
- ]
-)
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
deleted file mode 100644
index d95fd9861..000000000
--- a/m4/glibc21.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# glibc21.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.1 or newer.
-# From Bruno Haible.
-
-AC_DEFUN([gl_GLIBC21],
- [
- AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
- ac_cv_gnu_library_2_1,
- [AC_EGREP_CPP([Lucky GNU user],
- [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
- Lucky GNU user
- #endif
-#endif
- ],
- ac_cv_gnu_library_2_1=yes,
- ac_cv_gnu_library_2_1=no)
- ]
- )
- AC_SUBST(GLIBC21)
- GLIBC21="$ac_cv_gnu_library_2_1"
- ]
-)
diff --git a/m4/input.m4 b/m4/input.m4
new file mode 100644
index 000000000..21d7e216f
--- /dev/null
+++ b/m4/input.m4
@@ -0,0 +1,185 @@
+dnl -------------
+dnl Input Plugins
+dnl -------------
+AC_DEFUN([XINE_INPUT_PLUGINS], [
+ dnl Setup defaults for the target operating system. For example, v4l is
+ dnl only ever available on Linux, so don't bother checking for it unless
+ dnl explicitly requested to do so on other operating systems.
+ dnl Notes:
+ dnl - dvb is Linux only
+ dnl - v4l is Linux only
+
+ default_enable_dvb=no
+ default_enable_gnomevfs=yes
+ default_enable_samba=yes
+ default_enable_v4l=no
+ default_enable_v4l2=no
+ default_enable_libv4l=no
+ default_enable_vcd=yes
+ default_enable_vcdo=no
+ default_enable_vdr=yes
+ default_enable_bluray=yes
+ default_with_external_dvdnav=no
+
+ case "$host_os" in
+ cygwin* | mingw*)
+ default_enable_gnomevfs=no
+ default_enable_samba=no
+ ;;
+ darwin*)
+ default_enable_gnomevfs=no
+ default_enable_samba=no
+ ;;
+ freebsd*|kfreebsd*)
+ default_enable_vcdo=yes
+ ;;
+ netbsd* | openbsd*)
+ default_enable_v4l2=yes
+ ;;
+ linux*)
+ default_enable_dvb=yes
+ default_enable_v4l=yes
+ default_enable_v4l2=yes
+ default_enable_libv4l=yes
+ default_enable_vcdo=yes
+ ;;
+ solaris*)
+ default_enable_vcdo=yes
+ default_enable_v4l2=yes
+ ;;
+ esac
+
+ dnl default_enable_libv4l="$default_enable_v4l2"
+
+ dnl dvb
+ XINE_ARG_ENABLE([dvb], [Enable support for the DVB plugin (Linux only)])
+ if test x"$enable_dvb" != x"no"; then
+ case "$host_os" in
+ linux*) have_dvb=yes ;;
+ *) have_dvb=no ;;
+ esac
+ if test x"$hard_enable_dvb" = x"yes" && test x"$have_dvb" != x"yes"; then
+ AC_MSG_ERROR([DVB support requested, but DVB not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_DVB], [test x"$have_dvb" = x"yes"])
+
+
+ dnl gnome-vfs
+ XINE_ARG_ENABLE([gnomevfs], [Enable support for the Gnome-VFS plugin])
+ if test x"$enable_gnomevfs" != x"no"; then
+ PKG_CHECK_MODULES([GNOME_VFS], [gnome-vfs-2.0], [have_gnomevfs=yes], [have_gnome_vfs=no])
+ if test x"$hard_enable_gnomevfs" = x"yes" && test x"$have_gnomevfs" != x"yes"; then
+ AC_MSG_ERROR([Gnome-VFS support requested, but Gnome-VFS not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_GNOME_VFS], [test x"$have_gnomevfs" = x"yes"])
+
+
+ dnl libsmbclient
+ XINE_ARG_ENABLE([samba], [Enable support for the Samba plugin])
+ if test x"$enable_samba" != x"no"; then
+ AC_CHECK_LIB([smbclient], [smbc_init],
+ [AC_CHECK_HEADERS([libsmbclient.h], [have_samba=yes LIBSMBCLIENT_LIBS="-lsmbclient"])])
+ AC_SUBST(LIBSMBCLIENT_LIBS)
+ if test x"$hard_enable_samba" = x"yes" && test x"$have_samba" != x"yes"; then
+ AC_MSG_ERROR([Samba support requested, but Samba not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_LIBSMBCLIENT], [test x"$have_samba" = x"yes"])
+
+
+ dnl video-for-linux (v4l)
+ XINE_ARG_ENABLE([v4l], [Enable Video4Linux support])
+ if test x"$enable_v4l" != x"no"; then
+ have_v4l=yes
+ AC_CHECK_HEADERS([linux/videodev.h], , [have_v4l=no])
+ AC_CHECK_HEADERS([asm/types.h])
+ if test x"$hard_enable_v4l" = x"yes" && test x"$have_v4l" != x"yes"; then
+ AC_MSG_ERROR([Video4Linux support requested, but prerequisite headers not found.])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_V4L], [test x"$have_v4l" = x"yes"])
+
+ XINE_ARG_ENABLE([v4l2], [Enable Video4Linux 2 support])
+ if test x"$enable_v4l2" != x"no"; then
+ have_v4l2=yes
+ AC_CHECK_HEADERS([linux/videodev2.h sys/videoio.h sys/videodev2.h], [have_v4l2=yes], [])
+ AC_CHECK_HEADERS([asm/types.h])
+ if test x"$hard_enable_v4l2" = x"yes" && test x"$have_v4l2" != x"yes"; then
+ AC_MSG_ERROR([Video4Linux 2 support requested, but prerequisite headers not found.])
+ fi
+ XINE_ARG_ENABLE([libv4l], [Enable libv4l support])
+ if test "x$enable_libv4l" != "xno"; then
+ PKG_CHECK_MODULES([V4L2], [libv4l2],
+ [have_libv4l=yes
+ AC_DEFINE([HAVE_LIBV4L2_H], [1], [Define this if you have libv4l installed])],
+ [have_libv4l=no])
+ if test "x$hard_enable_libv4l" = "xyes" && test "x$have_libv4l" = "xno"; then
+ AC_MSG_ERROR([libv4l requested, but libv4l not found])
+ fi
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_V4L2], [test x"$have_v4l2" = x"yes"])
+
+ dnl dvdnav
+ dnl XXX: This could be cleaned up so that code does not have to ifdef so much
+ XINE_ARG_WITH([external-dvdnav], [Use external dvdnav library (not recommended)])
+ if test x"$with_external_dvdnav" != x"no"; then
+ ACX_PACKAGE_CHECK([DVDNAV], [0.1.9], [dvdnav-config],
+ [AC_DEFINE([HAVE_DVDNAV], 1, [Define this if you have a suitable version of libdvdnav])],
+ [AC_MSG_RESULT([*** no usable version of libdvdnav found, using internal copy ***])])
+ AC_CHECK_LIB([dvdread], [navRead_DSI], [DVDNAV_LIBS="$DVDNAV_LIBS -ldvdread"], [])
+ else
+ AC_MSG_RESULT([Using included DVDNAV support])
+ fi
+ AM_CONDITIONAL([WITH_EXTERNAL_DVDNAV], [test x"$with_external_dvdnav" != x"no"])
+
+
+ dnl Video CD
+ dnl XXX: This could be cleaned up so that code does not have it ifdef so much
+ XINE_ARG_ENABLE([vcd], [Enable VCD (VideoCD) support])
+ if test x"$enable_vcd" != x"no"; then
+ no_vcd=no
+ PKG_CHECK_MODULES([LIBCDIO], [libcdio >= 0.71],
+ [PKG_CHECK_MODULES([LIBVCDINFO], [libvcdinfo >= 0.7.23], [], [no_vcd=yes])],
+ [if test x"$hard_enable_vcd" = 'xyes'; then
+ AC_MSG_ERROR([$LIBCDIO_PKG_ERRORS])
+ fi
+ no_vcd=yes]
+ )
+ if test "$no_vcd" = 'no'; then
+ AC_DEFINE([HAVE_VCDNAV], 1, [Define this if you use external libcdio/libvcdinfo])
+ fi
+ fi
+
+ enable_vcdo=no
+ test $default_enable_vcdo = yes && test x"$enable_vcd" != x"no" && enable_vcdo=yes
+
+ AC_DEFINE([LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration])
+ AC_DEFINE([EXTERNAL_LIBCDIO_CONFIG_H], 1, [Get of rid system libcdio build configuration])
+ AC_SUBST(LIBCDIO_CFLAGS)
+ AC_SUBST(LIBCDIO_LIBS)
+ AC_SUBST(LIBVCD_CFLAGS)
+ AC_SUBST(LIBVCD_LIBS)
+ AM_CONDITIONAL([ENABLE_VCD], [test x"$enable_vcd" != x"no"])
+ AM_CONDITIONAL([ENABLE_VCDO], [test x"$enable_vcdo" != x"no"])
+
+
+ dnl vdr
+ XINE_ARG_ENABLE([vdr], [Enable support for the VDR plugin (default: enabled)])
+ AM_CONDITIONAL([ENABLE_VDR], [test x"$enable_vdr" != x"no"])
+
+ dnl bluray
+ XINE_ARG_ENABLE([bluray], [Enable BluRay support])
+ if test "x$enable_bluray" != "xno"; then
+ PKG_CHECK_MODULES([LIBBLURAY], [libbluray >= 0.2.1], [have_libbluray=yes], [have_libbluray=no])
+ if test x"$hard_enable_bluray" = x"yes" && test x"$have_libbluray" != x"yes"; then
+ AC_MSG_ERROR([BluRay support requested, but libbluray not found])
+ fi
+ AC_SUBST(LIBBLURAY_CFLAGS)
+ AC_SUBST(LIBBLURAY_LIBS)
+ fi
+ AM_CONDITIONAL(ENABLE_BLURAY, test "x$have_libbluray" = "xyes")
+
+])
diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4
deleted file mode 100644
index 8c8a67084..000000000
--- a/m4/intdiv0.m4
+++ /dev/null
@@ -1,84 +0,0 @@
-# intdiv0.m4 serial 2 (gettext-0.17)
-dnl Copyright (C) 2002, 2007 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([gt_INTDIV0],
-[
- AC_REQUIRE([AC_PROG_CC])dnl
- AC_REQUIRE([AC_CANONICAL_HOST])dnl
-
- AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
- gt_cv_int_divbyzero_sigfpe,
- [
- gt_cv_int_divbyzero_sigfpe=
-changequote(,)dnl
- case "$host_os" in
- macos* | darwin[6-9]* | darwin[1-9][0-9]*)
- # On MacOS X 10.2 or newer, just assume the same as when cross-
- # compiling. If we were to perform the real test, 1 Crash Report
- # dialog window would pop up.
- case "$host_cpu" in
- i[34567]86 | x86_64)
- gt_cv_int_divbyzero_sigfpe="guessing yes" ;;
- esac
- ;;
- esac
-changequote([,])dnl
- if test -z "$gt_cv_int_divbyzero_sigfpe"; then
- AC_TRY_RUN([
-#include <stdlib.h>
-#include <signal.h>
-
-static void
-sigfpe_handler (int sig)
-{
- /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
- exit (sig != SIGFPE);
-}
-
-int x = 1;
-int y = 0;
-int z;
-int nan;
-
-int main ()
-{
- signal (SIGFPE, sigfpe_handler);
-/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
-#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
- signal (SIGTRAP, sigfpe_handler);
-#endif
-/* Linux/SPARC yields signal SIGILL. */
-#if defined (__sparc__) && defined (__linux__)
- signal (SIGILL, sigfpe_handler);
-#endif
-
- z = x / y;
- nan = y / y;
- exit (1);
-}
-], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
- [
- # Guess based on the CPU.
-changequote(,)dnl
- case "$host_cpu" in
- alpha* | i[34567]86 | x86_64 | m68k | s390*)
- gt_cv_int_divbyzero_sigfpe="guessing yes";;
- *)
- gt_cv_int_divbyzero_sigfpe="guessing no";;
- esac
-changequote([,])dnl
- ])
- fi
- ])
- case "$gt_cv_int_divbyzero_sigfpe" in
- *yes) value=1;;
- *) value=0;;
- esac
- AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
- [Define if integer division by zero raises signal SIGFPE.])
-])
diff --git a/m4/inttypes.m4 b/m4/inttypes.m4
deleted file mode 100644
index 779bcea05..000000000
--- a/m4/inttypes.m4
+++ /dev/null
@@ -1,25 +0,0 @@
-# inttypes.m4 serial 1 (gettext-0.11.4)
-dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
-# <sys/types.h>.
-
-AC_DEFUN([gt_HEADER_INTTYPES_H],
-[
- AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
- [
- AC_TRY_COMPILE(
- [#include <sys/types.h>
-#include <inttypes.h>],
- [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
- ])
- if test $gt_cv_header_inttypes_h = yes; then
- AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
- [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
- fi
-])
diff --git a/m4/ioctl_request.m4 b/m4/ioctl_request.m4
deleted file mode 100644
index 6eb3f45a6..000000000
--- a/m4/ioctl_request.m4
+++ /dev/null
@@ -1,52 +0,0 @@
-dnl Simple macro to find the type of the ioctl request parameter
-dnl Copyright (c) 2007 xine project
-dnl
-dnl This program is free software; you can redistribute it and/or modify
-dnl it under the terms of the GNU General Public License as published by
-dnl the Free Software Foundation; either version 2, or (at your option)
-dnl any later version.
-dnl
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-dnl GNU General Public License for more details.
-dnl
-dnl You should have received a copy of the GNU General Public License
-dnl along with this program; if not, write to the Free Software
-dnl Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-dnl 02110-1301, USA.
-dnl
-dnl As a special exception, the xine project, as copyright owner of the
-dnl macro gives unlimited permission to copy, distribute and modify the
-dnl configure scripts that are the output of Autoconf when processing the
-dnl Macro. You need not follow the terms of the GNU General Public
-dnl License when using or distributing such scripts, even though portions
-dnl of the text of the Macro appear in them. The GNU General Public
-dnl License (GPL) does govern all other use of the material that
-dnl constitutes the Autoconf Macro.
-dnl
-dnl This special exception to the GPL applies to versions of the
-dnl Autoconf Macro released by the xine project. When you make and
-dnl distribute a modified version of the Autoconf Macro, you may extend
-dnl this special exception to the GPL to apply to your modified version as
-dnl well.
-
-
-dnl Usage AC_IOCTL_REQUEST
-AC_DEFUN([AC_IOCTL_REQUEST], [
- AC_CACHE_CHECK([type of request parameter for ioctl()],
- ac_cv_ioctl_request,
- [for ac_ioctl_request_type in "unsigned long" "int"
- do
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
- #include <sys/ioctl.h>
- int ioctl(int fd, $ac_ioctl_request_type request, ...);
- ]], [[]])],[ac_cv_ioctl_request=$ac_ioctl_request_type],[])
- done])
-
- if test "x$ac_cv_ioctl_request" = "x"; then
- AC_MSG_ERROR([Unable to determine the type for ioctl() request parameter])
- fi
-
- AC_DEFINE_UNQUOTED([IOCTL_REQUEST_TYPE], $ac_cv_ioctl_request, [Type of the request parameter for ioctl()])
-])
diff --git a/m4/irixal.m4 b/m4/irixal.m4
deleted file mode 100644
index 3ff633cf8..000000000
--- a/m4/irixal.m4
+++ /dev/null
@@ -1,19 +0,0 @@
-dnl AM_CHECK_IRIXAL ([ACTION-IF-YES], [ACTION-IF-NO])
-dnl Configure paths/version for IRIX AL
-AC_DEFUN([AM_CHECK_IRIXAL],
- [AC_CACHE_CHECK([for IRIX libaudio support],
- [am_cv_have_irixal],
- [AC_CHECK_HEADER([dmedia/audio.h],
- am_cv_have_irixal=yes, am_cv_have_irixal=no)])
- if test "x$am_cv_have_irixal" = xyes ; then
- IRIXAL_LIBS="-laudio"
- IRIXAL_STATIC_LIB="/usr/lib/libaudio.a"
- ifelse([$1], , :, [$1])
- else
- ifelse([$2], , :, [$2])
- fi
- AC_SUBST(IRIXAL_CFLAGS)
- AC_SUBST(IRIXAL_STATIC_LIB)
- AC_SUBST(IRIXAL_LIBS)
-])
-
diff --git a/m4/isc-posix.m4 b/m4/isc-posix.m4
deleted file mode 100644
index 74dc8f26d..000000000
--- a/m4/isc-posix.m4
+++ /dev/null
@@ -1,24 +0,0 @@
-# isc-posix.m4 serial 2 (gettext-0.11.2)
-dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
-
-# This test replaces the one in autoconf.
-# Currently this macro should have the same name as the autoconf macro
-# because gettext's gettext.m4 (distributed in the automake package)
-# still uses it. Otherwise, the use in gettext.m4 makes autoheader
-# give these diagnostics:
-# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
-# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
-
-undefine([AC_ISC_POSIX])
-
-AC_DEFUN([AC_ISC_POSIX],
- [
- dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
- AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
- ]
-)
diff --git a/m4/lcmessage.m4 b/m4/lcmessage.m4
deleted file mode 100644
index 19aa77e4f..000000000
--- a/m4/lcmessage.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# lcmessage.m4 serial 4 (gettext-0.14.2)
-dnl Copyright (C) 1995-2002, 2004-2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
-
-# Check whether LC_MESSAGES is available in <locale.h>.
-
-AC_DEFUN([gt_LC_MESSAGES],
-[
- AC_CACHE_CHECK([for LC_MESSAGES], gt_cv_val_LC_MESSAGES,
- [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
- gt_cv_val_LC_MESSAGES=yes, gt_cv_val_LC_MESSAGES=no)])
- if test $gt_cv_val_LC_MESSAGES = yes; then
- AC_DEFINE(HAVE_LC_MESSAGES, 1,
- [Define if your <locale.h> file defines LC_MESSAGES.])
- fi
-])
diff --git a/m4/lib-ld.m4 b/m4/lib-ld.m4
deleted file mode 100644
index 96c4e2c33..000000000
--- a/m4/lib-ld.m4
+++ /dev/null
@@ -1,110 +0,0 @@
-# lib-ld.m4 serial 3 (gettext-0.13)
-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl Subroutines of libtool.m4,
-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
-dnl with libtool.m4.
-
-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
-AC_DEFUN([AC_LIB_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
- acl_cv_prog_gnu_ld=yes ;;
-*)
- acl_cv_prog_gnu_ld=no ;;
-esac])
-with_gnu_ld=$acl_cv_prog_gnu_ld
-])
-
-dnl From libtool-1.4. Sets the variable LD.
-AC_DEFUN([AC_LIB_PROG_LD],
-[AC_ARG_WITH(gnu-ld,
-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-ac_prog=ld
-if test "$GCC" = yes; then
- # Check if gcc -print-prog-name=ld gives a path.
- AC_MSG_CHECKING([for ld used by GCC])
- case $host in
- *-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
- *)
- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
- esac
- case $ac_prog in
- # Accept absolute paths.
- [[\\/]* | [A-Za-z]:[\\/]*)]
- [re_direlt='/[^/][^/]*/\.\./']
- # Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
- done
- test -z "$LD" && LD="$ac_prog"
- ;;
- "")
- # If it fails, then pretend we aren't using GCC.
- ac_prog=ld
- ;;
- *)
- # If it is relative, then search for the first ld in PATH.
- with_gnu_ld=unknown
- ;;
- esac
-elif test "$with_gnu_ld" = yes; then
- AC_MSG_CHECKING([for GNU ld])
-else
- AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(acl_cv_path_LD,
-[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- acl_cv_path_LD="$ac_dir/$ac_prog"
- # Check to see if the program is GNU ld. I'd rather use --version,
- # but apparently some GNU ld's only accept -v.
- # Break only if it was the GNU/non-GNU ld that we prefer.
- case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
- *GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break ;;
- *)
- test "$with_gnu_ld" != yes && break ;;
- esac
- fi
- done
- IFS="$ac_save_ifs"
-else
- acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
- AC_MSG_RESULT($LD)
-else
- AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_LIB_PROG_LD_GNU
-])
diff --git a/m4/libFLAC.m4 b/m4/libFLAC.m4
index 7ad896b05..0bca54d97 100644
--- a/m4/libFLAC.m4
+++ b/m4/libFLAC.m4
@@ -13,6 +13,33 @@ AC_ARG_WITH(libFLAC-libraries, AS_HELP_STRING([--with-libFLAC-libraries=DIR], [d
AC_ARG_WITH(libFLAC-includes, AS_HELP_STRING([--with-libFLAC-includes=DIR], [directory where libFLAC header files are installed (optional)]), libFLAC_includes="$withval", libFLAC_includes="")
AC_ARG_ENABLE(libFLACtest, AS_HELP_STRING([--disable-libFLACtest], [do not try to compile and run a test libFLAC program]), enable_libFLACtest=$enableval, enable_libFLACtest=yes)
+ AC_MSG_CHECKING([libdir name])
+ case $host_or_hostalias in
+ *-*-linux*)
+ # Test if the compiler is 64bit
+ echo 'int i;' > conftest.$ac_ext
+ xine_cv_cc_64bit_output=no
+ if AC_TRY_EVAL(ac_compile); then
+ case `"$MAGIC_CMD" conftest.$ac_objext` in
+ *"ELF 64"*)
+ xine_cv_cc_64bit_output=yes
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+ esac
+
+ case $host_cpu:$xine_cv_cc_64bit_output in
+ powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+ XINE_LIBNAME="lib64"
+ ;;
+ *:*)
+ XINE_LIBNAME="lib"
+ ;;
+ esac
+ AC_MSG_RESULT([$XINE_LIBNAME])
+
if test "x$libFLAC_libraries" != "x" ; then
LIBFLAC_LIBS="-L$libFLAC_libraries"
elif test "x$libFLAC_prefix" != "x" ; then
diff --git a/m4/libfame.m4 b/m4/libfame.m4
deleted file mode 100644
index bf54f1e80..000000000
--- a/m4/libfame.m4
+++ /dev/null
@@ -1,183 +0,0 @@
-dnl AM_PATH_LIBFAME([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
-dnl Test for libfame, and define LIBFAME_CFLAGS and LIBFAME_LIBS
-dnl Vivien Chappelier 12/11/00
-dnl stolen from ORBit autoconf
-dnl
-AC_DEFUN([AM_PATH_LIBFAME],
-[dnl
-dnl Get the cflags and libraries from the libfame-config script
-dnl
-AC_ARG_WITH(libfame-prefix, AS_HELP_STRING([--with-libfame-prefix=DIR], [prefix where libfame is installed (optional)]),
- libfame_config_prefix="$withval", libfame_config_prefix="")
-AC_ARG_WITH(libfame-exec-prefix, AS_HELP_STRING([--with-libfame-exec-prefix=DIR], [exec prefix where libfame is installed (optional)]),
- libfame_config_exec_prefix="$withval", libfame_config_exec_prefix="")
-AC_ARG_ENABLE(libfametest, AS_HELP_STRING([--disable-libfametest], [do not try to compile and run a test libfame program]),
- enable_libfametest=$enableval, enable_libfametest=yes)
-
- if test x$libfame_config_exec_prefix != x ; then
- libfame_config_args="$libfame_config_args --exec-prefix=$libfame_config_exec_prefix"
- if test x${LIBFAME_CONFIG+set} != xset ; then
- LIBFAME_CONFIG=$libfame_config_exec_prefix/bin/libfame-config
- fi
- fi
- if test x$libfame_config_prefix != x ; then
- libfame_config_args="$libfame_config_args --prefix=$libfame_config_prefix"
- if test x${LIBFAME_CONFIG+set} != xset ; then
- LIBFAME_CONFIG=$libfame_config_prefix/bin/libfame-config
- fi
- fi
-
- AC_PATH_TOOL(LIBFAME_CONFIG, libfame-config, no)
- min_libfame_version=ifelse([$1], , 0.9.0, $1)
- AC_MSG_CHECKING(for libfame - version >= $min_libfame_version)
- no_libfame=""
- if test "$LIBFAME_CONFIG" = "no" ; then
- no_libfame=yes
- else
- LIBFAME_CFLAGS=`$LIBFAME_CONFIG $libfame_config_args --cflags`
- LIBFAME_LIBS=`$LIBFAME_CONFIG $libfame_config_args --libs`
- libfame_config_major_version=`$LIBFAME_CONFIG $libfame_config_args --version | \
- sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
- libfame_config_minor_version=`$LIBFAME_CONFIG $libfame_config_args --version | \
- sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
- libfame_config_micro_version=`$LIBFAME_CONFIG $libfame_config_args --version | \
- sed -e 's,[[^0-9.]],,g' -e 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
- if test "x$enable_libfametest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $LIBFAME_CFLAGS"
- LIBS="$LIBFAME_LIBS $LIBS"
-dnl
-dnl Now check if the installed LIBFAME is sufficiently new. (Also sanity
-dnl checks the results of libfame-config to some extent
-dnl
- rm -f conf.libfametest
- AC_TRY_RUN([
-#include <fame.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int
-main ()
-{
- int major, minor, micro;
- char *tmp_version;
-
- system ("touch conf.libfametest");
-
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = strdup("$min_libfame_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
- printf("%s, bad version string\n", "$min_libfame_version");
- exit(1);
- }
-
- if ((libfame_major_version != $libfame_config_major_version) ||
- (libfame_minor_version != $libfame_config_minor_version) ||
- (libfame_micro_version != $libfame_config_micro_version))
- {
- printf("\n*** 'libfame-config --version' returned %d.%d.%d, but Libfame (%d.%d.%d)\n",
- $libfame_config_major_version, $libfame_config_minor_version, $libfame_config_micro_version,
- libfame_major_version, libfame_minor_version, libfame_micro_version);
- printf ("*** was found! If libfame-config was correct, then it is best\n");
- printf ("*** to remove the old version of libfame. You may also be able to fix the error\n");
- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
- printf("*** required on your system.\n");
- printf("*** If libfame-config was wrong, set the environment variable LIBFAME_CONFIG\n");
- printf("*** to point to the correct copy of libfame-config, and remove the file config.cache\n");
- printf("*** before re-running configure\n");
- }
-#if defined (LIBFAME_MAJOR_VERSION) && defined (LIBFAME_MINOR_VERSION) && defined (LIBFAME_MICRO_VERSION)
- else if ((libfame_major_version != LIBFAME_MAJOR_VERSION) ||
- (libfame_minor_version != LIBFAME_MINOR_VERSION) ||
- (libfame_micro_version != LIBFAME_MICRO_VERSION))
- {
- printf("*** libfame header files (version %d.%d.%d) do not match\n",
- LIBFAME_MAJOR_VERSION, LIBFAME_MINOR_VERSION, LIBFAME_MICRO_VERSION);
- printf("*** library (version %d.%d.%d)\n",
- libfame_major_version, libfame_minor_version, libfame_micro_version);
- }
-#endif /* defined (LIBFAME_MAJOR_VERSION) ... */
- else
- {
- if ((libfame_major_version > major) ||
- ((libfame_major_version == major) && (libfame_minor_version > minor)) ||
- ((libfame_major_version == major) && (libfame_minor_version == minor) && (libfame_micro_version >= micro)))
- {
- return 0;
- }
- else
- {
- printf("\n*** An old version of libfame (%d.%d.%d) was found.\n",
- libfame_major_version, libfame_minor_version, libfame_micro_version);
- printf("*** You need a version of libfame newer than %d.%d.%d. The latest version of\n",
- major, minor, micro);
- printf("*** libfame is always available from http://www-eleves.enst-bretagne.fr/~chappeli/fame\n");
- printf("***\n");
- printf("*** If you have already installed a sufficiently new version, this error\n");
- printf("*** probably means that the wrong copy of the libfame-config shell script is\n");
- printf("*** being found. The easiest way to fix this is to remove the old version\n");
- printf("*** of libfame, but you can also set the LIBFAME_CONFIG environment to point to the\n");
- printf("*** correct copy of libfame-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
- printf("*** so that the correct libraries are found at run-time))\n");
- }
- }
- return 1;
-}
-],, no_libfame=yes,
- AC_TRY_LINK([
-#include <fame.h>
-#include <stdio.h>
-], [ return 0; ],, no_libfame=yes))
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- if test "x$no_libfame" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
- else
- AC_MSG_RESULT(no)
- if test "$LIBFAME_CONFIG" = "no" ; then
- echo "*** The libfame-config script installed by libfame could not be found"
- echo "*** If libfame was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or set the LIBFAME_CONFIG environment variable to the"
- echo "*** full path to libfame-config."
- else
- if test -f conf.libfametest ; then
- :
- else
- echo "*** Could not run libfame test program, checking why..."
- CFLAGS="$CFLAGS $LIBFAME_CFLAGS"
- LIBS="$LIBS $LIBFAME_LIBS"
- AC_TRY_LINK([
-#include <fame.h>
-#include <stdio.h>
-], [ return ((libfame_major_version) || (libfame_minor_version) || (libfame_micro_version)); ],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding libfame or finding the wrong"
- echo "*** version of LIBFAME. If it is not finding libfame, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
- echo "***" ],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means libfame was incorrectly installed"
- echo "*** or that you have moved libfame since it was installed. In the latter case, you"
- echo "*** may want to edit the libfame-config script: $LIBFAME_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
- fi
- ifelse([$3], , :, [$3])
- fi
-
- AC_SUBST(LIBFAME_CFLAGS)
- AC_SUBST(LIBFAME_LIBS)
- rm -f conf.libfametest
-])
diff --git a/m4/macosx.m4 b/m4/macosx.m4
new file mode 100644
index 000000000..0151b41e9
--- /dev/null
+++ b/m4/macosx.m4
@@ -0,0 +1,43 @@
+AC_DEFUN([MACOSX_UNIVERSAL_BINARIES], [
+ AC_ARG_ENABLE([macosx-universal],
+ AS_HELP_STRING([--enable-macosx-universal], [build universal binaries for Mac OS X)]),
+ [], [enable_macosx_universal="no"])
+ if test x"$enable_macosx_universal" != x"no" ; then
+ case "$host_os" in
+ *darwin*)
+ dnl x64_64 and ppc64 binaries could also be built, but there is no
+ dnl version of Mac OS X currently shipping that can run them, so
+ dnl do not enable them by default for now.
+ if test x"$enable_macosx_universal" = x"yes" ; then
+ UNIVERSAL_ARCHES="i386 ppc"
+ else
+ UNIVERSAL_ARCHES=`echo "$enable_macosx_universal" | sed -e 's/,/ /g'`
+ fi
+ ;;
+ *)
+ AC_MSG_ERROR([Universal binaries can only be built on Darwin])
+ ;;
+ esac
+ AC_SUBST(UNIVERSAL_ARCHES)
+
+ CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
+ LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
+
+ if test x"$UNIVERSAL_ARCHES" != x"" ; then
+ # Forcibly disable dependency tracking for Universal builds, because -M
+ # does not work with multiple -arch arguments on the gcc command-line.
+ ac_tool_warned=yes
+ cross_compiling=yes
+ enable_dependency_tracking=no
+ host="`echo $host | sed -e s/$host_cpu/universal/g`"
+ host_cpu=universal
+
+ AC_DEFINE([XINE_MACOSX_UNIVERSAL_BINARY], 1, [Define this if a universal binary is being built for Mac OS X])
+ for arch in $UNIVERSAL_ARCHES ; do
+ UNIVERSAL_CFLAGS="$UNIVERSAL_CFLAGS -arch $arch"
+ UNIVERSAL_LDFLAGS="$UNIVERSAL_LDFLAGS -arch $arch"
+ done
+ fi
+ fi
+ AM_CONDITIONAL([MACOSX_UNIVERSAL_BINARY], [test x"$enable_macosx_universal" = x"yes"])
+])dnl MACOSX_UNIVERSAL_BINARIES
diff --git a/m4/objc.m4 b/m4/objc.m4
new file mode 100644
index 000000000..73dd8b6a0
--- /dev/null
+++ b/m4/objc.m4
@@ -0,0 +1,253 @@
+# Extracted from autoconf 2.61 to obtain Objective C macros.
+# Only expand if the version of autoconf in use doesn't have the macro itself.
+m4_ifdef([AC_PROG_OBJC], [], [
+
+# This file is part of Autoconf. -*- Autoconf -*-
+# Programming languages support.
+# Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Free Software
+# Foundation, 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, 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.
+#
+# As a special exception, the Free Software Foundation gives unlimited
+# permission to copy, distribute and modify the configure scripts that
+# are the output of Autoconf. You need not follow the terms of the GNU
+# General Public License when using or distributing such scripts, even
+# though portions of the text of Autoconf appear in them. The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the Autoconf program.
+#
+# Certain portions of the Autoconf source text are designed to be copied
+# (in certain cases, depending on the input) into the output of
+# Autoconf. We call these the "data" portions. The rest of the Autoconf
+# source text consists of comments plus executable code that decides which
+# of the data portions to output in any given case. We call these
+# comments and executable code the "non-data" portions. Autoconf never
+# copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of Autoconf
+# released by the Free Software Foundation. When you make and
+# distribute a modified version of Autoconf, you may extend this special
+# exception to the GPL to apply to your modified version as well, *unless*
+# your modified version has the potential to copy into its output some
+# of the text that was the non-data portion of the version that you started
+# with. (In other words, unless your change moves or copies text from
+# the non-data portions to the data portions.) If your modification has
+# such potential, you must delete any notice of this special exception
+# to the GPL from your modified version.
+#
+# Written by David MacKenzie, with help from
+# Akim Demaille, Paul Eggert,
+# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+
+# ------------------------------ #
+# 1d. The Objective C language. #
+# ------------------------------ #
+
+
+# AC_LANG(Objective C)
+# --------------------
+m4_define([AC_LANG(Objective C)],
+[ac_ext=m
+ac_cpp='$OBJCPP $CPPFLAGS'
+ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
+ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD'
+ac_compiler_gnu=$ac_cv_objc_compiler_gnu
+])
+
+
+# AC_LANG_OBJC
+# ------------
+AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)])
+
+
+# _AC_LANG_ABBREV(Objective C)
+# ----------------------------
+m4_define([_AC_LANG_ABBREV(Objective C)], [objc])
+
+
+# _AC_LANG_PREFIX(Objective C)
+# ----------------------------
+m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC])
+
+
+# ------------------------- #
+# 2d. Objective C sources. #
+# ------------------------- #
+
+# AC_LANG_SOURCE(Objective C)(BODY)
+# ---------------------------------
+m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)])
+
+
+# AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY])
+# ------------------------------------------------
+m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)])
+
+
+# AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION)
+# ---------------------------------------------
+m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)])
+
+
+# AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION)
+# --------------------------------------------
+m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)])
+
+
+# AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION)
+# -----------------------------------------------------------
+m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)])
+
+
+# AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION)
+# ---------------------------------------------------
+m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)])
+
+
+# ------------------------------ #
+# 3d. The Objective C compiler. #
+# ------------------------------ #
+
+# AC_LANG_PREPROC(Objective C)
+# ----------------------------
+# Find the Objective C preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able.
+m4_defun([AC_LANG_PREPROC(Objective C)],
+[AC_REQUIRE([AC_PROG_OBJCPP])])
+
+
+# AC_PROG_OBJCPP
+# --------------
+# Find a working Objective C preprocessor.
+AC_DEFUN([AC_PROG_OBJCPP],
+[AC_REQUIRE([AC_PROG_OBJC])dnl
+AC_ARG_VAR([OBJCPP], [Objective C preprocessor])dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+AC_LANG_PUSH(Objective C)dnl
+AC_MSG_CHECKING([how to run the Objective C preprocessor])
+if test -z "$OBJCPP"; then
+ AC_CACHE_VAL(ac_cv_prog_OBJCPP,
+ [dnl
+ # Double quotes because OBJCPP needs to be expanded
+ for OBJCPP in "$OBJC -E" "/lib/cpp"
+ do
+ _AC_PROG_PREPROC_WORKS_IFELSE([break])
+ done
+ ac_cv_prog_OBJCPP=$OBJCPP
+ ])dnl
+ OBJCPP=$ac_cv_prog_OBJCPP
+else
+ ac_cv_prog_OBJCPP=$OBJCPP
+fi
+AC_MSG_RESULT([$OBJCPP])
+_AC_PROG_PREPROC_WORKS_IFELSE([],
+ [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])])
+AC_SUBST(OBJCPP)dnl
+AC_LANG_POP(Objective C)dnl
+])# AC_PROG_OBJCPP
+
+
+# AC_LANG_COMPILER(Objective C)
+# -----------------------------
+# Find the Objective C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able.
+m4_defun([AC_LANG_COMPILER(Objective C)],
+[AC_REQUIRE([AC_PROG_OBJC])])
+
+
+
+# AC_PROG_OBJC([LIST-OF-COMPILERS])
+# ---------------------------------
+# LIST-OF-COMPILERS is a space separated list of Objective C compilers to
+# search for (if not specified, a default list is used). This just gives
+# the user an opportunity to specify an alternative search list for the
+# Objective C compiler.
+# objcc StepStone Objective-C compiler (also "standard" name for OBJC)
+# objc David Stes' POC. If you installed this, you likely want it.
+# cc Native C compiler (for instance, Apple).
+# CC You never know.
+AN_MAKEVAR([OBJC], [AC_PROG_OBJC])
+AN_PROGRAM([objcc], [AC_PROG_OBJC])
+AN_PROGRAM([objc], [AC_PROG_OBJC])
+AC_DEFUN([AC_PROG_OBJC],
+[AC_LANG_PUSH(Objective C)dnl
+AC_ARG_VAR([OBJC], [Objective C compiler command])dnl
+AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+dnl _AC_ARG_VAR_LIBS()dnl
+_AC_ARG_VAR_CPPFLAGS()dnl
+_AC_ARG_VAR_PRECIOUS([OBJC])dnl
+AC_CHECK_TOOLS(OBJC,
+ [m4_default([$1], [gcc objcc objc cc CC])],
+ gcc)
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD
+ac_compiler=`set X $ac_compile; echo $[2]`
+_AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD])
+_AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD])
+
+m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl
+m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl
+_AC_LANG_COMPILER_GNU
+GOBJC=`test $ac_compiler_gnu = yes && echo yes`
+_AC_PROG_OBJC_G
+AC_LANG_POP(Objective C)dnl
+])# AC_PROG_OBJC
+
+
+# _AC_PROG_OBJC_G
+# ---------------
+# Check whether -g works, even if OBJCFLAGS is set, in case the package
+# plays around with OBJCFLAGS (such as to build both debugging and
+# normal versions of a library), tasteless as that idea is.
+# Don't consider -g to work if it generates warnings when plain compiles don't.
+m4_define([_AC_PROG_OBJC_G],
+[ac_test_OBJCFLAGS=${OBJCFLAGS+set}
+ac_save_OBJCFLAGS=$OBJCFLAGS
+AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g,
+ [ac_save_objc_werror_flag=$ac_objc_werror_flag
+ ac_objc_werror_flag=yes
+ ac_cv_prog_objc_g=no
+ OBJCFLAGS="-g"
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [ac_cv_prog_objc_g=yes],
+ [OBJCFLAGS=""
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [],
+ [ac_objc_werror_flag=$ac_save_objc_werror_flag
+ OBJCFLAGS="-g"
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [ac_cv_prog_objc_g=yes])])])
+ ac_objc_werror_flag=$ac_save_objc_werror_flag])
+if test "$ac_test_OBJCFLAGS" = set; then
+ OBJCFLAGS=$ac_save_OBJCFLAGS
+elif test $ac_cv_prog_objc_g = yes; then
+ if test "$GOBJC" = yes; then
+ OBJCFLAGS="-g -O2"
+ else
+ OBJCFLAGS="-g"
+ fi
+else
+ if test "$GOBJC" = yes; then
+ OBJCFLAGS="-O2"
+ else
+ OBJCFLAGS=
+ fi
+fi[]dnl
+])# _AC_PROG_OBJC_G
+])dnl m4_ifdef([AC_PROG_OBJC])
diff --git a/m4/opengl.m4 b/m4/opengl.m4
deleted file mode 100644
index f718fc848..000000000
--- a/m4/opengl.m4
+++ /dev/null
@@ -1,74 +0,0 @@
-dnl
-dnl Check for OpenGL & GLU
-dnl
-dnl AM_PATH_OPENGL([ACTION IF FOUND [, ACTION IF NOT FOUND]])
-dnl
-
-AC_DEFUN([AM_PATH_OPENGL], [
-
- AC_ARG_ENABLE(opengl, AS_HELP_STRING([--disable-opengl], [do not build OpenGL plugin]),
- [enableopengl=$enableval],
- [enableopengl="yes"]
- )
- AC_ARG_ENABLE(glu, AS_HELP_STRING([--disable-glu], [build OpenGL plugin without GLU (no verbose errors)]),
- [enableglu=$enableval],
- [enableglu="yes"]
- )
-
- if test x$enableopengl = "xyes"; then
- AC_CHECK_LIB(GL, glBegin,
- [AC_CHECK_LIB(m, tan,
- [AC_CHECK_HEADER(GL/gl.h,
- [ac_have_opengl="yes"
- OPENGL_LIBS="-lGL -lm"
- AC_DEFINE(HAVE_OPENGL,1,[Define this if you have OpenGL support available])
- dnl
- dnl need to check with some test if this linking with -lGLU actually works...
- dnl check for GLU
- dnl
- if test x$enableglu = "xyes"; then
- AC_CHECK_LIB(GLU, gluPerspective,
- [AC_CHECK_HEADER(GL/glu.h,
- [AC_MSG_CHECKING([if GLU is sane])
- ac_save_LIBS="$LIBS"
- LIBS="$X_LIBS $XPRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h>
-#include <GL/glu.h>]], [[ gluPerspective(45.0f,1.33f,1.0f,1000.0f); glBegin(GL_POINTS); glEnd(); return 0 ]])],
- [ ac_have_glu="yes"
- GLU_LIBS="-lGLU"
- AC_DEFINE(HAVE_GLU,1,[Define this if you have GLU support available])
- AC_MSG_RESULT(yes)],
- [ AC_MSG_RESULT(no)
- echo "*** GLU doesn't link with GL; GLU is disabled ***"])
- LIBS="$ac_save_LIBS"]
- )],
- [],
- [$X_LIBS $X_PRE_LIBS $OPENGL_LIBS -lGLU $X_EXTRA_LIBS]
- )
- fi
- ]
- )],
- [],
- [$X_LIBS $X_PRE_LIBS -lGL -lm $X_EXTRA_LIBS]
- )],
- [],
- [$X_LIBS $X_PRE_LIBS $X_EXTRA_LIBS]
- )
- if test x$ac_have_opengl = "xyes"; then
- ac_use_opengl=yes
- fi
- fi
-
- AC_SUBST(OPENGL_CFLAGS)
- AC_SUBST(OPENGL_LIBS)
- AC_SUBST(GLU_LIBS)
- AM_CONDITIONAL(HAVE_OPENGL, [test x$ac_use_opengl = "xyes"])
-
- dnl result
- if test x$ac_use_opengl = "xyes"; then
- ifelse([$1], , :, [$1])
- else
- ifelse([$2], , :, [$2])
- fi
-
-])
diff --git a/m4/optimizations.m4 b/m4/optimizations.m4
deleted file mode 100644
index f4880093c..000000000
--- a/m4/optimizations.m4
+++ /dev/null
@@ -1,244 +0,0 @@
-dnl
-dnl M4 macro to add support for extra optimizations
-dnl
-dnl It understand --enable/--disable-optimizations .
-dnl when optimizations are disabled, it does not touch cflags
-dnl
-dnl Note: always disable while crosscompiling
-dnl
-
-AC_DEFUN([AC_OPTIMIZATIONS], [
- AC_ARG_ENABLE([optimizations],
- AS_HELP_STRING([--disable-optimizations], [Don't try to guess what optimization to enable]))
-
- if test "x$enable_optimizations" != "xno"; then
- INLINE_FUNCTIONS=-finline-functions
-
- if test "$GCC" = yes; then
- dnl
- dnl check cflags not supported by all gcc versions
- CC_CHECK_CFLAGS([-fschedule-insns2], f_si="-fschedule-insns2", f_si="")
- CC_CHECK_CFLAGS([-mwide-multiply], m_wm="-mwide-multiply", m_wm="")
- dnl
- dnl gcc 3.1 uses the -f version
- dnl
- CC_CHECK_CFLAGS([-falign-functions=4], f_af="-falign-functions=4",
- f_af="-malign-functions=4")
- CC_CHECK_CFLAGS([-falign-loops=4], f_al="-falign-loops=4",
- f_al="-malign-loops=4")
- CC_CHECK_CFLAGS([-falign-jumps=4], f_aj="-falign-jumps=4",
- f_aj="-malign-jumps=4")
- dnl
- dnl Check for some optimization disabling
- dnl needed for win32 code
- dnl
- CC_CHECK_CFLAGS([-fno-omit-frame-pointer], W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-omit-frame-pointer",)
- CC_CHECK_CFLAGS([-fno-inline-functions], W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-inline-functions",)
- CC_CHECK_CFLAGS([-fno-rename-registers], W32_NO_OPTIMIZE="$W32_NO_OPTIMIZE -fno-rename-registers",)
- AC_SUBST(W32_NO_OPTIMIZE)
- dnl
- dnl Multipass compilation
- dnl
- CC_CHECK_CFLAGS([-fprofile-arcs], PASS1_CFLAGS="-fprofile-arcs $PASS1_CFLAGS",)
- CC_CHECK_CFLAGS([-fbranch-probabilities], PASS2_CFLAGS="-fbranch-probabilities $PASS2_CFLAGS",)
- AC_SUBST(PASS1_CFLAGS)
- AC_SUBST(PASS2_CFLAGS)
- dnl some combinations of gcc+glibc produce useless warnings on memset
- dnl when compiling with -Wpointer-arith, so we check for this first
- AC_MSG_CHECKING(for sane -Wpointer-arith)
- SAVE_CFLAGS="$CFLAGS"
- CFLAGS="-O2 -Wpointer-arith -Werror $CFLAGS"
- AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <string.h>]], [[int a; memset(&a, 0, sizeof(int));]])],
- [AC_MSG_RESULT(yes); CFLAGS="-Wpointer-arith $SAVE_CFLAGS"],
- [AC_MSG_RESULT(no); CFLAGS="$SAVE_CFLAGS"]);
-
- dnl gcc 3.3.5 (at least) is known to be buggy wrt optimisation and
- dnl -finline-functions. Use -fno-inline-functions for gcc < 3.4.0.
-
- AC_MSG_CHECKING(for gcc 3.4.0 or later)
- newGCC="`$CC -dumpversion |
- awk -F. '{ if ((@S|@1 * 10000 + @S|@2 * 100 + @S|@3) >= 30400) { print "yes" } }'
- `"
- AC_MSG_RESULT(${newGCC:-no - assuming bugginess in -finline-functions})
- test "$newGCC" = yes || INLINE_FUNCTIONS=-fno-inline-functions
- fi
-
- CFLAGS="$wall ${CFLAGS}"
- DEBUG_CFLAGS="$wall ${DEBUG_CFLAGS}"
-
- case "$host_or_hostalias" in
- i?86-* | k?-* | athlon-* | pentium*)
- if test "$GCC" = yes -o "${CC##*/}x" = "iccx" ; then
-
- if test "$GCC" = yes; then
- dnl Check for gcc cpu optimization support
- CC_CHECK_CFLAGS("-mtune=i386",
- sarchopt="-mtune",
- CC_CHECK_CFLAGS("-mcpu=i386",
- sarchopt="-mcpu",
- CC_CHECK_CFLAGS("-march=i386",
- sarchopt="-march",
- [ AC_MSG_RESULT(** no cpu optimization supports **)
- sarchopt=no
- ]
- )
- )
- )
-
- dnl special check for k7 cpu CC support
- CC_CHECK_CFLAGS([$sarchopt=athlon], k7cpu="athlon", k7cpu="i686")
-
- dnl add x86 specific gcc CFLAGS
- CFLAGS="-O3 -pipe -fomit-frame-pointer $f_af $f_al $f_aj $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS $CFLAGS"
-
- DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
-
- if test x"$sarchopt" != "xno"; then
- archopt_val=
-
- case "$host_or_hostalias" in
- i386-*)
- archopt_val="i386" ;;
- i486-*)
- archopt_val="i486" ;;
- i586-*)
- archopt_val="pentium"
- ;;
- pentium-mmx-*)
- archopt_val="pentium-mmx"
- ;;
- pentiumpro-* | pentium2-* | i686-*)
- archopt_val="pentiumpro"
- if test x"$check_athlon" = "xyes"; then
- if test -f /proc/cpuinfo; then
- modelname=`cat /proc/cpuinfo | grep "model\ name\ :" | sed -e 's/ //g' | cut -d':' -f2`
- case "$modelname" in
- *Athlon* | *Duron* | *K7*)
- archopt_val="$k7cpu"
- ;;
- VIAEzra)
- archopt_val="c3"
- ;;
- esac
- fi
- fi
- ;;
- k6-2-* | k6-3-*)
- archopt_val="k6-2"
- ;;
- k6-*)
- archopt_val="k6"
- ;;
- pentium3-*)
- archopt_val="pentium3"
- ;;
- pentium4-*)
- archopt_val="pentium4"
- ;;
- athlon-4-* | athlon-xp-* | athlon-mp-*)
- archopt_val="athlon-4"
- ;;
- k7-* | athlon-tbird-* | athlon-*)
- archopt_val="athlon"
- ;;
-
- esac
- if test x"$archopt_val" != x; then
- CFLAGS="$sarchopt=$archopt_val $CFLAGS"
- DEBUG_CFLAGS="$sarchopt=$archopt_val $DEBUG_CFLAGS"
- fi
- fi
- else
- dnl we have the Intel compiler
- CFLAGS="-unroll -ipo -ipo_obj -O3 $CFLAGS"
- PASS1_CFLAGS="-prof_genx -prof_dir \$(PWD)/\$(top_builddir)/ $PASS1_CFLAGS"
- PASS2_CFLAGS="-prof_use -prof_dir \$(PWD)/\$(top_builddir)/ $PASS2_CFLAGS"
- AC_SUBST(PASS1_CFLAGS)
- AC_SUBST(PASS2_CFLAGS)
- fi
-
- else
- dnl add x86 specific cc CFLAGS
- CFLAGS="-O $CFLAGS"
- DEBUG_CFLAGS="-O $DEBUG_CFLAGS"
- AC_DEFINE_UNQUOTED(FPM_64BIT,,[Define to select libmad fixed point arithmetic implementation])
- fi
- ;;
- alphaev56-*)
- CFLAGS="-O3 -mcpu=ev56 -mieee $CFLAGS"
- DEBUG_CFLAGS="-O3 -mcpu=ev56 -mieee $DEBUG_CFLAGS"
- ;;
- alpha*)
- CFLAGS="-O3 -mieee $CFLAGS"
- DEBUG_CFLAGS="-O3 -mieee $DEBUG_CFLAGS"
- ;;
- *darwin*)
- CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS -no-cpp-precomp -D_INTL_REDIRECT_MACROS $CFLAGS"
- DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
- ;;
- ppc-*-linux* | powerpc-*)
- CFLAGS="-O3 -pipe -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS $CFLAGS"
- DEBUG_CFLAGS="-O3 $DEBUG_CFLAGS"
- ;;
- sparc*-*-linux*)
- CFLAGS="-O3 $cpu_cflags $INLINE_FUNCTIONS $CFLAGS"
- DEBUG_CFLAGS="-O $cpu_cflags $INLINE_FUNCTIONS $DEBUG_CFLAGS"
-
- case `uname -m` in
- sparc)
- cpu_cflags="-mcpu=supersparc -mtune=supersparc" ;;
- sparc64)
- cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc" ;;
- esac
- ;;
- sparc-*-solaris*)
- if test "$GCC" = yes; then
- case `uname -m` in
- sun4c) cpu_cflags="-mcpu=v7 -mtune=supersparc" ;;
- sun4m) cpu_cflags="-mcpu=v8 -mtune=supersparc" ;;
- sun4u)
- case `$CC --version 2>/dev/null` in
- 1.*|2.*)
- # -mcpu=ultrasparc triggers a GCC 2.95.x compiler bug when
- # compiling video_out.c:
- # gcc: Internal compiler error: program cc1 got fatal signal 11
- # avoid -mcpu=ultrasparc with gcc 2.*
- cpu_cflags="-mcpu=v8 -mtune=ultrasparc"
- ;;
- *)
- # GCC 3 or newer should have no problem with -mcpu=ultrasparc
- cpu_cflags="-mcpu=ultrasparc -mtune=ultrasparc"
- ;;
- esac
- ;;
- esac
- cc_optimize_cflags="-O3 $cpu_cflags $INLINE_FUNCTIONS"
- cc_debug_cflags="-O $cpu_cflags $INLINE_FUNCTIONS"
- else
- case `uname -m` in
- sun4c) cpu_cflags="-xarch=v7" ;;
- sun4m) cpu_cflags="-xarch=v8" ;;
- sun4u) cpu_cflags="-xarch=v8plusa" ;;
- esac
- cc_optimize_cflags="-fast $cpu_cflags -xCC"
- cc_debug_cflags="-O"
- fi
-
- CFLAGS="$cc_optimize_cflags $CFLAGS"
- DEBUG_CFLAGS="$cc_debug_cflags $DEBUG_CFLAGS"
- ;;
- x86_64-*)
- CFLAGS="-O3 -fomit-frame-pointer $m_wm $m_psb -fexpensive-optimizations $f_si -ffast-math $INLINE_FUNCTIONS $CFLAGS"
- DEBUG_CFLAGS="-g $DEBUG_CFLAGS"
- ;;
- armv4l-*-linux*)
- CFLAGS="-O2 -fsigned-char -ffast-math -mcpu=strongarm1100 -fomit-frame-pointer -fthread-jumps -fregmove $CFLAGS"
- dnl CFLAGS="-O1 -fforce-mem -fforce-addr -fthread-jumps -fcse-follow-jumps -fcse-skip-blocks -fexpensive-optimizations -fregmove -fschedule-insns2 $INLINE_FUNCTIONS -fsigned-char -fomit-frame-pointer -march=armv4 -mtune=strongarm $CFLAGS"
- DEBUG_CFLAGS="-O2 $DEBUG_CFLAGS"
- ;;
- esac
- fi
-])
-
-dnl Kate modeline: leave at the end
-dnl kate: indent-width 2; replace-trailing-space-save 1; space-indent 1; backspace-indents 1;
diff --git a/m4/package.m4 b/m4/package.m4
new file mode 100644
index 000000000..0ee28830a
--- /dev/null
+++ b/m4/package.m4
@@ -0,0 +1,72 @@
+dnl _ACX_VERSION_PARSE(version)
+AC_DEFUN([_ACX_VERSION_PARSE], [`echo $1 | perl -e 'my $v = <>; chomp $v;
+my @v = split(" ", $v); $v = $v[[@S|@#v]]; $v =~ s/[[^0-9.]].*$//; @v = split (/\./, $v);
+push @v, 0 while $[#v] < 2; print $v[[0]] * 10000 + $v[[1]] * 100 + $v[[2]], "\n"'`])
+
+dnl ACX_VERSION_CHECK(required, actual)
+AC_DEFUN([ACX_VERSION_CHECK], [
+ required_version=ifelse([$1], , [0.0.0], [$1])
+ required_version_parsed=_ACX_VERSION_PARSE([$required_version])
+ actual_version=ifelse([$2], , [0.0.0], [$2])
+ actual_version_parsed=_ACX_VERSION_PARSE([$actual_version])
+ if test $required_version_parsed -le $actual_version_parsed; then
+ ifelse([$3], , [:], [$3])
+ else
+ ifelse([$4], , [:], [$4])
+ fi
+])
+
+AC_DEFUN([ASX_TR_LOWER], [m4_translit([[$1]], [ABCDEFGHIJKLMNOPQRSTUVWXYZ], [abcdefghijklmnopqrstuvwxyz])])
+
+dnl ACX_PACKAGE_CHECK(VARIABLE-PREFIX, MINIMUM-VERSION, CONFIG-SCRIPT,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+AC_DEFUN([ACX_PACKAGE_CHECK], [
+ AC_ARG_VAR($1_CONFIG, [Full path to $3])
+ AC_ARG_WITH(ASX_TR_LOWER([$1][-prefix]),
+ [AS_HELP_STRING(ASX_TR_LOWER([--with-][$1][-prefix])[=PATH], [prefix where $3 is installed (optional)])],
+ [package_config_prefix="$withval"], [package_config_prefix=""])
+ AC_ARG_WITH(ASX_TR_LOWER([$1][-exec-prefix]),
+ [AS_HELP_STRING(ASX_TR_LOWER([--with-][$1][-exec-prefix])[=PATH], [exec prefix where $3 is installed (optional)])],
+ [package_config_exec_prefix="$withval"], [package_config_exec_prefix=""])
+ package_config_args=""
+ if test x"$package_config_exec_prefix" != x""; then
+ package_config_args="$package_config_args --exec-prefix=$package_config_exec_prefix"
+ test x"${$1_CONFIG+set}" != x"set" && $1_CONFIG="$package_config_exec_prefix/bin/$3"
+ fi
+ if test x"$package_config_prefix" != x""; then
+ package_config_args="$package_config_args --prefix=$package_config_prefix"
+ test x"${$1_CONFIG+set}" != x"set" && $1_CONFIG="$package_config_prefix/bin/$3"
+ fi
+
+ min_package_version=ifelse([$2], , [0.0.0], [$2])
+ AC_PATH_TOOL([$1_CONFIG], [$3], [no])
+ AC_MSG_CHECKING([for $1 version >= $min_package_version])
+ if test x"$$1_CONFIG" = x"no"; then
+ AC_MSG_RESULT([unknown])
+ AC_MSG_NOTICE([The $3 script installed by $1 could not be found.
+*** If $1 was installed in PREFIX, make sure PREFIX/bin is in your path, or
+*** set the $1_CONFIG environment variable to the full path to the program.])
+ else
+ [$1][_CFLAGS]="`$$1_CONFIG $package_config_args --cflags`"
+ [$1][_LIBS]="`$$1_CONFIG $package_config_args --libs`"
+ [$1][_VERSION]="`$$1_CONFIG $package_config_args --version`"
+ ACX_VERSION_CHECK([$min_package_version], [$[$1][_VERSION]],
+ [package_version_ok=yes; AC_MSG_RESULT([yes -- $[$1][_VERSION]])],
+ [[$1][_CFLAGS]="" [$1][_LIBS]=""; AC_MSG_RESULT([no -- $[$1][_VERSION]])
+ AC_MSG_NOTICE([If you have already installed a sufficiently new version,
+*** this error probably means that the wrong copy of the $3
+*** shell script is being found. The easiest way to fix this is to remove the
+*** old version, but you can also set the $1_CONFIG environment
+*** variable to point to the correct copy. In this case, you will have to
+*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf
+*** so that the correct libraries are found at run-time.])])
+ fi
+
+ if test x"$package_version_ok" = x"yes"; then
+ ifelse([$4], , [:], [$4])
+ else
+ ifelse([$5], , [:], [$5])
+ fi
+ AC_SUBST([$1][_CFLAGS])
+ AC_SUBST([$1][_LIBS])
+])
diff --git a/m4/pkg.m4 b/m4/pkg.m4
index 4328e2e3f..9b95e1786 100644
--- a/m4/pkg.m4
+++ b/m4/pkg.m4
@@ -136,7 +136,8 @@ installed software in a non-standard prefix.
_PKG_TEXT
])],
- [$4])
+ [AC_MSG_RESULT([no])
+ $4])
elif test $pkg_failed = untried; then
ifelse([$4], , [AC_MSG_FAILURE(dnl
[The pkg-config script could not be found or is too old. Make sure it
@@ -146,7 +147,8 @@ path to pkg-config.
_PKG_TEXT
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
- [$4])
+ [AC_MSG_RESULT([no])
+ $4])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
diff --git a/m4/printf-posix.m4 b/m4/printf-posix.m4
deleted file mode 100644
index 14ba61283..000000000
--- a/m4/printf-posix.m4
+++ /dev/null
@@ -1,44 +0,0 @@
-# printf-posix.m4 serial 3 (gettext-0.17)
-dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether the printf() function supports POSIX/XSI format strings with
-dnl positions.
-
-AC_DEFUN([gt_PRINTF_POSIX],
-[
- AC_REQUIRE([AC_PROG_CC])
- AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
- gt_cv_func_printf_posix,
- [
- AC_TRY_RUN([
-#include <stdio.h>
-#include <string.h>
-/* The string "%2$d %1$d", with dollar characters protected from the shell's
- dollar expansion (possibly an autoconf bug). */
-static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
-static char buf[100];
-int main ()
-{
- sprintf (buf, format, 33, 55);
- return (strcmp (buf, "55 33") != 0);
-}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
- [
- AC_EGREP_CPP(notposix, [
-#if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
- notposix
-#endif
- ], gt_cv_func_printf_posix="guessing no",
- gt_cv_func_printf_posix="guessing yes")
- ])
- ])
- case $gt_cv_func_printf_posix in
- *yes)
- AC_DEFINE(HAVE_POSIX_PRINTF, 1,
- [Define if your printf() function supports format strings with positions.])
- ;;
- esac
-])
diff --git a/m4/programs.m4 b/m4/programs.m4
new file mode 100644
index 000000000..6703e48df
--- /dev/null
+++ b/m4/programs.m4
@@ -0,0 +1,124 @@
+dnl AC_PROG_GMSGFMT_PLURAL
+dnl ----------------------
+dnl Validate the GMSGFMT program found by gettext.m4; reject old versions
+dnl of GNU msgfmt that do not support the "msgid_plural" extension.
+AC_DEFUN([AC_PROG_GMSGFMT_PLURAL],
+ [dnl AC_REQUIRE(AM_GNU_GETTEXT)
+
+ if test "$GMSGFMT" != ":"; then
+ AC_MSG_CHECKING([for plural forms in GNU msgfmt])
+
+ changequote(,)dnl We use [ and ] in in .po test input
+
+ dnl If the GNU msgfmt does not accept msgid_plural we define it
+ dnl as : so that the Makefiles still can work.
+ cat >conftest.po <<_ACEOF
+msgid "channel"
+msgid_plural "channels"
+msgstr[0] "canal"
+msgstr[1] "canal"
+
+_ACEOF
+ changequote([,])dnl
+
+ if $GMSGFMT -o /dev/null conftest.po >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_RESULT(
+ [found GNU msgfmt program is too old, it does not support plural forms; ignore it])
+ GMSGFMT=":"
+ fi
+ rm -f conftest.po
+ fi
+])dnl AC_PROG_GMSGFMT_PLURAL
+
+
+# AC_PROG_LIBTOOL_SANITYCHECK
+# ----------------------
+# Default configuration of libtool on solaris produces non-working
+# plugin modules, when gcc is used as compiler, and gcc does not
+# use gnu-ld
+AC_DEFUN([AC_PROG_LIBTOOL_SANITYCHECK],
+ [dnl AC_REQUIRE(AC_PROG_CC)
+ dnl AC_REQUIRE(AC_PROG_LD)
+ dnl AC_REQUIRE(AC_PROG_LIBTOOL)
+
+ case $host in
+ *-*-solaris*)
+ if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
+ AC_MSG_CHECKING([if libtool can build working modules])
+ cat > conftest1.c <<_ACEOF
+#undef NDEBUG
+#include <assert.h>
+int shlib_func(long long a, long long b) {
+ assert(b);
+ switch (a&3) {
+ case 0: return a/b;
+ case 1: return a%b;
+ case 2: return (unsigned long long)a/b;
+ case 3: return (unsigned long long)a%b;
+ }
+}
+_ACEOF
+
+ cat > conftest2.c <<_ACEOF
+#include <dlfcn.h>
+int main(){
+ void *dl = dlopen(".libs/libconftest.so", RTLD_NOW);
+ if (!dl) printf("%s\n", dlerror());
+ exit(dl ? 0 : 1);
+}
+_ACEOF
+
+ if ./libtool $CC -c conftest1.c >/dev/null 2>&1 && \
+ ./libtool $CC -o libconftest.la conftest1.lo \
+ -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \
+ ./libtool $CC -o conftest2 conftest2.c -ldl >/dev/null 2>&1
+ then
+ if ./conftest2 >/dev/null 2>&1; then
+ AC_MSG_RESULT(yes)
+ else
+ dnl typical problem: dlopen'ed module not self contained, because
+ dnl it wasn't linked with -lgcc
+ AC_MSG_RESULT(no)
+ if grep '^archive_cmds=.*$LD -G' libtool >/dev/null; then
+ AC_MSG_CHECKING([if libtool can be fixed])
+
+ dnl first try to update gcc2's spec file to add the
+ dnl gcc3 -mimpure-text flag
+
+ libtool_specs=""
+
+ if $CC -dumpspecs | grep -- '-G -dy -z text' >/dev/null; then
+ $CC -dumpspecs | \
+ sed 's/-G -dy -z text/-G -dy %{!mimpure-text:-z text}/g' \
+ > gcc-libtool-specs
+ libtool_specs=" -specs=`pwd`/gcc-libtool-specs"
+ fi
+
+ sed -e "s,\$LD -G,\$CC${libtool_specs} -shared -mimpure-text,g" \
+ -e 's/ -M / -Wl,-M,/' libtool >libtool-fixed
+ chmod +x libtool-fixed
+ if ./libtool-fixed $CC -o libconftest.la conftest1.lo \
+ -module -avoid-version -rpath /tmp >/dev/null 2>&1 && \
+ ./conftest2 >/dev/null 2>&1; then
+
+ dnl the fixed libtool works
+ AC_MSG_RESULT(yes)
+ mv -f libtool-fixed libtool
+
+ else
+ AC_MSG_RESULT(no)
+ fi
+ fi
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ rm -f conftest1.c conftest1.lo conftest1.o conftest2.c \
+ libconftest.la conftest libtool-fixed
+ rm -rf .libs
+ fi ;;
+ esac
+])# AC_PROG_LIBTOOL_SANITYCHECK
diff --git a/m4/progtest.m4 b/m4/progtest.m4
deleted file mode 100644
index a56365cd3..000000000
--- a/m4/progtest.m4
+++ /dev/null
@@ -1,92 +0,0 @@
-# progtest.m4 serial 4 (gettext-0.14.2)
-dnl Copyright (C) 1996-2003, 2005 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl This file can can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
-
-AC_PREREQ(2.50)
-
-# Search path for a program which passes the given test.
-
-dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
-dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
-AC_DEFUN([AM_PATH_PROG_WITH_TEST],
-[
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
-
-# Find out how to test for executable files. Don't use a zero-byte file,
-# as systems may use methods other than mode bits to determine executability.
-cat >conf$$.file <<_ASEOF
-#! /bin/sh
-exit 0
-_ASEOF
-chmod +x conf$$.file
-if test -x conf$$.file >/dev/null 2>&1; then
- ac_executable_p="test -x"
-else
- ac_executable_p="test -f"
-fi
-rm -f conf$$.file
-
-# Extract the first word of "$2", so it can be a program name with args.
-set dummy $2; ac_word=[$]2
-AC_MSG_CHECKING([for $ac_word])
-AC_CACHE_VAL(ac_cv_path_$1,
-[case "[$]$1" in
- [[\\/]]* | ?:[[\\/]]*)
- ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
- ;;
- *)
- ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
- for ac_dir in ifelse([$5], , $PATH, [$5]); do
- IFS="$ac_save_IFS"
- test -z "$ac_dir" && ac_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
- echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
- if [$3]; then
- ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
- break 2
- fi
- fi
- done
- done
- IFS="$ac_save_IFS"
-dnl If no 4th arg is given, leave the cache variable unset,
-dnl so AC_PATH_PROGS will keep looking.
-ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
-])dnl
- ;;
-esac])dnl
-$1="$ac_cv_path_$1"
-if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
- AC_MSG_RESULT([$]$1)
-else
- AC_MSG_RESULT(no)
-fi
-AC_SUBST($1)dnl
-])
diff --git a/m4/signed.m4 b/m4/signed.m4
deleted file mode 100644
index 048f59369..000000000
--- a/m4/signed.m4
+++ /dev/null
@@ -1,17 +0,0 @@
-# signed.m4 serial 1 (gettext-0.10.40)
-dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_DEFUN([bh_C_SIGNED],
-[
- AC_CACHE_CHECK([for signed], bh_cv_c_signed,
- [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
- if test $bh_cv_c_signed = no; then
- AC_DEFINE(signed, ,
- [Define to empty if the C compiler doesn't support this keyword.])
- fi
-])
diff --git a/m4/summary.m4 b/m4/summary.m4
new file mode 100644
index 000000000..8c89285cb
--- /dev/null
+++ b/m4/summary.m4
@@ -0,0 +1,361 @@
+AC_DEFUN([XINE_LIB_SUMMARY], [
+ dnl ---------------------------------------------
+ dnl Some infos:
+ dnl ---------------------------------------------
+
+ echo "xine-lib summary:"
+ echo "----------------"
+
+ dnl Input
+ echo " * input plugins:"
+ echo " - file - net"
+ echo " - stdin_fifo - rtp"
+ echo " - http - mms"
+ echo " - pnm - rtsp"
+ if test x"$enable_vcd" != x"no"; then
+ if test x"$enable_vcdo" != x"no"; then
+ echo " - vcdo - vcd"
+ else
+ echo " - vcd"
+ fi
+ fi
+ if test x"$with_external_dvdnav" != x"no"; then
+ echo " - dvd (external libs)"
+ else
+ echo " - dvd (*INTERNAL* libs)"
+ fi
+ test x"$enable_vdr" != x"no" && echo " - vdr"
+ test x"$have_dvb" = x"yes" && echo " - dvb"
+ test x"$have_gnomevfs" = x"yes" && echo " - gnome-vfs"
+ test x"$have_samba" = x"yes" && echo " - smb"
+ test x"$have_v4l" = x"yes" && echo " - v4l"
+ test x"$have_v4l2" = x"yes" && echo " - v4l2"
+ echo " - cdda"
+ test x"$have_libbluray" = x"yes" && echo " - bluray"
+ echo ""
+
+ dnl Demuxers
+ echo " * demultiplexer plugins:"
+ echo " - avi - mpeg"
+ echo " - mpeg_block - mpeg_audio"
+ echo " - mpeg_elem - mpeg_pes"
+ echo " - mpeg_ts - qt/mpeg-4"
+ echo " - film - roq"
+ echo " - fli - smjpeg"
+ echo " - idcin - wav"
+ echo " - wc3 mve - voc"
+ echo " - vqa - aiff"
+ echo " - cdda - snd/au"
+ echo " - yuv4mpeg2 - real/realaudio"
+ echo " - ea wve - raw dv"
+ echo " - interplay mve - psx str"
+ echo " - ws aud - pva"
+ echo " - vox - nsf"
+ echo " - nsv - 4xm"
+ echo " - FLAC - aac"
+ echo " - iff - matroska"
+ echo " - vmd - flv"
+ if test x"$enable_a52dec" != x"no"; then
+ if test x"$have_external_a52dec" = x"yes"; then
+ echo " - ac3 (external library)"
+ else
+ echo " - ac3 (*INTERNAL* library)"
+ fi
+ fi
+ echo " - E-AC-3"
+ echo " - AAC LATM"
+ test x"$enable_asf" != x"no" && echo " - asf"
+ test x"$enable_nosefart" != xno && echo " - Nosefart (NSF)"
+ test x"$enable_mng" != x"no" && echo " - mng"
+ test x"$have_modplug" = x"yes" && echo " - mod"
+ test x"$have_libflac" = x"yes" && echo " - FLAC (with libFLAC)"
+ test x"$have_vorbis" = x"yes" && echo " - ogg"
+ test x"$have_wavpack" = x"yes" && echo " - WavPack"
+ echo ""
+
+ dnl video decoders
+ echo " * video decoder plugins:"
+ echo " - MPEG 1,2 - Amiga Bitplane"
+ echo " - Raw RGB - Raw YUV"
+ test x"$have_dxr3" = x"yes" && echo " - dxr3_video"
+ test x"$have_gdkpixbuf" = x"yes" && echo " - gdk-pixbuf"
+ test x"$have_imagemagick" = x"yes" && echo " - image"
+ test x"$have_theora" = x"yes" && echo " - theora"
+ test x"$have_w32dll" = x"yes" && echo " - w32dll"
+ test x"$have_vdpau" = x"yes" && echo " - vdpau"
+ if test x"$with_external_ffmpeg" != x"no"; then
+ echo " - ffmpeg (external library)"
+ else
+ echo " - ffmpeg (*INTERNAL* library):"
+ echo " - MPEG-4 (ISO, Microsoft, DivX*, XviD)"
+ echo " - Creative YUV - Motion JPEG"
+ echo " - Cinepak - MS Video-1"
+ echo " - FLI/FLC - MS RLE"
+ echo " - Id RoQ - Id Cin"
+ echo " - Apple Graphics - Apple Video"
+ echo " - Apple Animation - Interplay Video"
+ echo " - Westwood VQA - Origin Xan"
+ echo " - H.263 - Intel Indeo 3"
+ echo " - SVQ1 - SVQ3"
+ echo " - Real Video 1.0 - Real Video 2.0"
+ echo " - 4X Video - Sierra Video"
+ echo " - Asus v1/v2 - HuffYUV"
+ echo " - On2 VP3 - DV"
+ echo " - 8BPS - Duck TrueMotion v1"
+ echo " - ATI VCR1 - Flash Video"
+ echo " - ZLIB - MSZH"
+ fi
+ echo ""
+
+ dnl audio decoders
+ echo " * audio decoder plugins:"
+ echo " - GSM 06.10 - linear PCM"
+ test x"$enable_faad" != x"no" && echo " - faad"
+ test x"$enable_nosefart" != xno && echo " - Nosefart (NSF)"
+ test x"$have_libflac" = x"yes" && echo " - FLAC (with libFLAC)"
+ test x"$have_speex" = x"yes" && echo " - speex"
+ test x"$have_vorbis" = x"yes" && echo " - vorbis"
+ test x"$have_w32dll" = x"yes" && echo " - w32dll"
+ test x"$have_wavpack" = x"yes" && echo " - WavPack"
+ if test x"$enable_mad" != x"no"; then
+ if test x"$have_external_libmad" = x"yes"; then
+ echo " - MAD (MPG 1/2/3) (external library)"
+ else
+ echo " - MAD (MPG 1/2/3) (*INTERNAL* library)"
+ fi
+ fi
+ if test x"$enable_libdts" != x"no"; then
+ if test x"$have_external_dts" = x"yes"; then
+ echo " - DTS (external library)"
+ else
+ echo " - DTS (*INTERNAL* library)"
+ fi
+ fi
+ if test x"$enable_a52dec" != x"no"; then
+ if test x"$have_external_a52dec" = x"yes"; then
+ echo " - A52/ra-dnet (external library)"
+ else
+ echo " - A52/ra-dnet (*INTERNAL* library)"
+ fi
+ fi
+ if test x"$enable_musepack" != x"no"; then
+ if test x"$have_external_libmpcdec" = x"yes"; then
+ echo " - Musepack (external library)"
+ else
+ echo " - Musepack (*INTERNAL* library)"
+ fi
+ fi
+ if test x"$with_external_ffmpeg" = x"yes"; then
+ echo " - ffmpeg (external library)"
+ else
+ echo " - ffmpeg (*INTERNAL* library):"
+ echo " - Windows Media Audio v1/v2/Pro"
+ echo " - DV - logarithmic PCM"
+ echo " - 14k4 - 28k8"
+ echo " - MS ADPCM - IMA ADPCM"
+ echo " - XA ADPCM - Game DPCM/ADPCM"
+ echo " - Mace 3:13 - Mace 6:1"
+ echo " - FLAC"
+ fi
+ echo ""
+
+ dnl spu decoders
+ echo " * subtitle decoder plugins:"
+ echo " - spu - spucc"
+ echo " - spucmml - sputext"
+ echo " - spudvb"
+ test x"$have_dxr3" = x"yes" && echo " - dxr3_spu"
+ echo ""
+
+ dnl post plugins
+ echo " * post effect plugins:"
+ echo " * planar video effects:"
+ echo " - invert - expand"
+ echo " - eq - eq2"
+ echo " - boxblur - denoise3d"
+ echo " - unsharp - tvtime"
+ test x"$have_dvb" = x"yes" && echo " - vdr"
+ echo " * SFX:"
+ echo " - goom - oscope"
+ echo " - fftscope - mosaico"
+ echo ""
+
+ dnl Video plugins
+ echo " * video driver plugins:"
+ if test x"$no_x" != x"yes"; then
+ echo " - XShm (X11 shared memory)"
+ if test x"$have_xv" = x"yes"; then
+ if test x"$have_xv_static" = x"yes"; then
+ echo " - Xv (XVideo *static*)"
+ else
+ echo " - Xv (XVideo *shared*)"
+ fi
+ fi
+ if test x"$have_xxmc" = x"yes"; then
+ if test x"$have_vldexts" = x"yes"; then
+ echo " - XxMC (XVideo extended motion compensation)"
+ else
+ echo " - XxMC (XVideo motion compensation - vld extensions DISABLED)"
+ fi
+ fi
+ if test x"$have_xvmc" = x"yes"; then
+ echo " - XvMC (XVideo motion compensation)"
+ fi
+ if test x"$have_opengl" = x"yes"; then
+ if test x"$have_glu" = x"yes"; then
+ echo " - OpenGL (with GLU support)"
+ else
+ echo " - OpenGL"
+ fi
+ fi
+ test x"$have_vdpau" = x"yes" && echo " - vdpau (X11 Video Decode and Presentation API for Unix)"
+ if test x"$have_sunfb" = x"yes"; then
+ if test x"$have_sundga" = x"yes"; then
+ echo " - PGX64 (for Sun XVR100/PGX64/PGX24 cards)"
+ echo " - PGX32 (for Sun PGX32 cards)"
+ fi
+ fi
+ fi
+ if test x"$have_xcb" = x"yes"; then
+ if test x"$have_xcbshm" = x"yes"; then
+ echo " - xcb-shm (X shared memory using XCB)"
+ fi
+ if test x"$have_xcbxv" = x"yes"; then
+ echo " - xcb-xv (XVideo using XCB)"
+ fi
+ fi
+
+
+ test x"$have_aalib" = x"yes" && echo " - aa (Ascii ART)"
+ test x"$have_caca" = x"yes" && echo " - caca (Color AsCii Art)"
+ test x"$have_directfb" = x"yes" && echo " - directfb (DirectFB driver)"
+ test x"$have_directx" = x"yes" && echo " - directx (DirectX video driver)"
+ test x"$have_fb" = x"yes" && echo " - fb (Linux framebuffer device)"
+ test x"$have_libstk" = x"yes" && echo " - stk (Libstk Set-top Toolkit)"
+ test x"$have_macosx_video" = x"yes" && echo " - Mac OS X OpenGL"
+ test x"$have_sdl" = x"yes" && echo " - sdl (Simple DirectMedia Layer)"
+
+
+ if test x"$have_dxr3" = x"yes"; then
+ if test x"$have_encoder" = x"yes"; then
+ echo " - dxr3 (Hollywood+ and Creative dxr3, both mpeg and non-mpeg video)"
+ else
+ echo " - dxr3 (Hollywood+ and Creative dxr3, mpeg video only)"
+ fi
+ fi
+ if test x"$have_vidix" = x"yes"; then
+ echo $ECHO_N " - vidix ("
+
+ if test x"$no_x" != x"yes"; then
+ echo $ECHO_N "X11"
+ if test x"$have_fb" = x"yes"; then
+ echo $ECHO_N " and "
+ fi
+ fi
+
+ if test x"$have_fb" = x"yes"; then
+ echo $ECHO_N "framebuffer"
+ fi
+
+ echo $ECHO_N " support"
+
+ if test x"$enable_dha_kmod" != x"no"; then
+ echo " with dhahelper)"
+ else
+ echo ")"
+ fi
+ fi
+
+ echo ""
+
+ dnl Audio plugins
+ echo " * audio driver plugins:"
+ test x"$have_alsa" = x"yes" && echo " - alsa (ALSA - Advanced Linux Sound Architecture)"
+ test x"$have_coreaudio" = x"yes" && echo " - CoreAudio (Mac OS X audio driver)"
+ test x"$have_directx" = x"yes" && echo " - directx (DirectX audio driver)"
+ test x"$have_esound" = x"yes" && echo " - esd (Enlightened Sound Daemon)"
+ test x"$have_fusionsound" = x"yes" && echo " - fusionsound (FusionSound driver)"
+ test x"$am_cv_have_irixal" = x"yes" && echo " - irixal (Irix audio library)"
+ test x"$have_jack" = x"yes" && echo " - Jack"
+ test x"$have_oss" = x"yes" && echo " - oss (Open Sound System)"
+ test x"$have_pulseaudio" = x"yes" && echo " - pulseaudio (PulseAudio sound server)"
+ test x"$have_sunaudio" = x"yes" && echo " - sun (Sun audio interface)"
+ test "x$have_sndio" = "xyes" && echo " - sndio"
+ echo "---"
+
+
+ dnl ---------------------------------------------
+ dnl some user warnings
+ dnl ---------------------------------------------
+
+ dnl some levels of variable expansion to get final install paths
+ final_libdir="`eval eval eval eval echo $libdir`"
+ final_bindir="`eval eval eval eval echo $bindir`"
+
+ if test -r /etc/ld.so.conf && ! grep -x "$final_libdir" /etc/ld.so.conf >/dev/null ; then
+ if test "$final_libdir" != "/lib" -a "$final_libdir" != "/usr/lib" ; then
+ if ! echo "$LD_LIBRARY_PATH" | egrep "(:|^)$final_libdir(/?:|/?$)" >/dev/null ; then
+ echo
+ echo "****************************************************************"
+ echo "xine-lib will be installed to $final_libdir"
+ echo
+ echo "This path is not mentioned among the linker search paths in your"
+ echo "/etc/ld.so.conf. This means it is possible that xine-lib will"
+ echo "not be found when you try to compile or run a program using it."
+ echo "If this happens, you should add $final_libdir to"
+ echo "the environment variable LD_LIBRARY_PATH like that:"
+ echo
+ echo "export LD_LIBRARY_PATH=$final_libdir:\$LD_LIBRARY_PATH"
+ echo
+ echo "Alternatively you can add a line \"$final_libdir\""
+ echo "to your /etc/ld.so.conf."
+ echo "****************************************************************"
+ echo
+ fi
+ fi
+ fi
+
+ if ! echo "$PATH" | egrep "(:|^)$final_bindir(/?:|/?$)" >/dev/null ; then
+ echo
+ echo "****************************************************************"
+ echo "xine-config will be installed to $final_bindir"
+ echo
+ echo "This path is not in your search path. This means it is possible"
+ echo "that xine-config will not be found when you try to compile a"
+ echo "program using xine-lib. This will result in build failures."
+ echo "If this happens, you should add $final_bindir to"
+ echo "the environment variable PATH like that:"
+ echo
+ echo "export PATH=$final_bindir:\$PATH"
+ echo
+ echo "Note that this is only needed for compilation. It is not needed"
+ echo "to have xine-config in your search path at runtime. (Although"
+ echo "it will not cause any harm either.)"
+ echo "****************************************************************"
+ echo
+ fi
+
+ dnl warn if no X11 plugins will be built
+ if test "x$no_x" = "xyes"; then
+ case $host in
+ *mingw*|*-cygwin) ;;
+ *-darwin*) ;;
+ *)
+ echo
+ echo "****************************************************************"
+ echo "WARNING! No X11 output plugins will be built."
+ echo
+ echo "For some reason, the requirements for building the X11 video"
+ echo "output plugins are not met. That means, that you will NOT be"
+ echo "able to use the resulting xine-lib to watch videos in a window"
+ echo "on any X11-based display (e.g. your desktop)."
+ echo
+ echo "If this is not what you want, provide the necessary X11 build"
+ echo "dependencies (usually done by installing a package called"
+ echo "XFree86-devel or similar) and run configure again."
+ echo "****************************************************************"
+ echo
+ ;;
+ esac
+ fi
+])
diff --git a/m4/types.m4 b/m4/types.m4
new file mode 100644
index 000000000..0afa6b29e
--- /dev/null
+++ b/m4/types.m4
@@ -0,0 +1,245 @@
+dnl AC_COMPILE_CHECK_SIZEOF (TYPE SUPPOSED-SIZE)
+dnl abort if the given type does not have the supposed size
+AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], [
+ AC_MSG_CHECKING(that size of $1 is $2)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) case 0: case (sizeof ($1) == $2):;]])],
+ [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([can not build a default inttypes.h])])
+])
+
+dnl
+AC_DEFUN([AC_CHECK_LIRC],
+ [AC_ARG_ENABLE(lirc,
+ AS_HELP_STRING([--disable-lirc], [turn off LIRC support]),
+ enable_lirc=$enableval, enable_lirc=yes)
+
+ if test x"$enable_lirc" = xyes; then
+ have_lirc=yes
+ AC_REQUIRE_CPP
+ AC_CHECK_LIB(lirc_client,lirc_init,
+ AC_CHECK_HEADER(lirc/lirc_client.h, true, have_lirc=no), have_lirc=no)
+ if test "$have_lirc" = "yes"; then
+
+ if test x"$LIRC_PREFIX" != "x"; then
+ lirc_libprefix="$LIRC_PREFIX/lib"
+ LIRC_INCLUDE="-I$LIRC_PREFIX/include"
+ fi
+ for llirc in $lirc_libprefix /lib /usr/lib /usr/local/lib; do
+ AC_CHECK_FILE("$llirc/liblirc_client.a",
+ LIRC_LIBS="$llirc/liblirc_client.a"
+ AC_DEFINE(HAVE_LIRC),,)
+ done
+ else
+ AC_MSG_RESULT([*** LIRC client support not available, LIRC support will be disabled ***]);
+ fi
+ fi
+
+ AC_SUBST(LIRC_LIBS)
+ AC_SUBST(LIRC_INCLUDE)
+])
+
+dnl AC_CHECK_GENERATE_INTTYPES_H (INCLUDE-DIRECTORY)
+dnl generate a default inttypes.h if the header file does not exist already
+AC_DEFUN([AC_CHECK_GENERATE_INTTYPES],
+ [AC_CHECK_HEADER([inttypes.h],,
+ [if test ! -d $1; then mkdir $1; fi
+ AC_CHECK_HEADER([stdint.h],
+ [cat >$1/inttypes.h << EOF
+#ifndef _INTTYPES_H
+#define _INTTYPES_H
+/* helper inttypes.h for people who do not have it on their system */
+
+#include <stdint.h>
+EOF
+ ],
+ [AC_COMPILE_CHECK_SIZEOF([char],[1])
+ AC_COMPILE_CHECK_SIZEOF([short],[2])
+ AC_COMPILE_CHECK_SIZEOF([int],[4])
+ AC_COMPILE_CHECK_SIZEOF([long long],[8])
+ cat >$1/inttypes.h << EOF
+#ifndef _INTTYPES_H
+#define _INTTYPES_H
+/* default inttypes.h for people who do not have it on their system */
+#if (!defined __int8_t_defined) && (!defined __BIT_TYPES_DEFINED__)
+#define __int8_t_defined
+typedef signed char int8_t;
+typedef signed short int16_t;
+typedef signed int int32_t;
+#ifdef ARCH_X86
+typedef signed long long int64_t;
+#endif
+#endif
+#if (!defined __uint8_t_defined) && (!defined _LINUX_TYPES_H)
+#define __uint8_t_defined
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+#ifdef ARCH_X86
+typedef unsigned long long uint64_t;
+#endif
+#endif
+EOF
+ ])
+ cat >>$1/inttypes.h << EOF
+
+#ifdef WIN32
+# define PRI64_PREFIX "I64"
+#else
+# define PRI64_PREFIX "l"
+#endif
+
+#ifndef PRId8
+# define PRId8 "d"
+#endif
+#ifndef PRId16
+# define PRId16 "d"
+#endif
+#ifndef PRId32
+# define PRId32 "d"
+#endif
+#ifndef PRId64
+# define PRId64 PRI64_PREFIX "d"
+#endif
+
+#ifndef PRIu8
+# define PRIu8 "u"
+#endif
+#ifndef PRIu16
+# define PRIu16 "u"
+#endif
+#ifndef PRIu32
+# define PRIu32 "u"
+#endif
+#ifndef PRIu64
+# define PRIu64 PRI64_PREFIX "u"
+#endif
+
+#ifndef PRIx8
+# define PRIx8 "x"
+#endif
+#ifndef PRIx16
+# define PRIx16 "x"
+#endif
+#ifndef PRIx32
+# define PRIx32 "x"
+#endif
+#ifndef PRIx64
+# define PRIx64 PRI64_PREFIX "x"
+#endif
+
+#ifndef PRIX8
+# define PRIX8 "X"
+#endif
+#ifndef PRIX16
+# define PRIX16 "X"
+#endif
+#ifndef PRIX32
+# define PRIX32 "X"
+#endif
+#ifndef PRIX64
+# define PRIX64 PRI64_PREFIX "X"
+#endif
+
+#ifndef PRIdFAST8
+# define PRIdFAST8 "d"
+#endif
+#ifndef PRIdFAST16
+# define PRIdFAST16 "d"
+#endif
+#ifndef PRIdFAST32
+# define PRIdFAST32 "d"
+#endif
+#ifndef PRIdFAST64
+# define PRIdFAST64 "d"
+#endif
+
+#ifndef PRIuFAST8
+# define PRIuFAST8 "u"
+#endif
+#ifndef PRIuFAST16
+# define PRIuFAST16 "u"
+#endif
+#ifndef PRIuFAST32
+# define PRIuFAST32 "u"
+#endif
+#ifndef PRIuFAST64
+# define PRIuFAST64 PRI64_PREFIX "u"
+#endif
+
+#ifndef PRIxFAST8
+# define PRIxFAST8 "x"
+#endif
+#ifndef PRIxFAST16
+# define PRIxFAST16 "x"
+#endif
+#ifndef PRIxFAST32
+# define PRIxFAST32 "x"
+#endif
+#ifndef PRIxFAST64
+# define PRIxFAST64 PRI64_PREFIX "x"
+#endif
+
+#ifndef SCNd8
+# define SCNd8 "hhd"
+#endif
+#ifndef SCNd16
+# define SCNd16 "hd"
+#endif
+#ifndef SCNd32
+# define SCNd32 "d"
+#endif
+#ifndef SCNd64
+# define SCNd64 PRI64_PREFIX "d"
+#endif
+
+#ifndef SCNu8
+# define SCNu8 "hhu"
+#endif
+#ifndef SCNu16
+# define SCNu16 "hu"
+#endif
+#ifndef SCNu32
+# define SCNu32 "u"
+#endif
+#ifndef SCNu64
+# define SCNu64 PRI64_PREFIX "u"
+#endif
+
+#ifndef PRIdMAX
+# define PRIdMAX PRId64
+#endif
+#ifndef PRIuMAX
+# define PRIuMAX PRIu64
+#endif
+#ifndef PRIxMAX
+# define PRIxMAX PRIx64
+#endif
+#ifndef SCNdMAX
+# define SCNdMAX SCNd64
+#endif
+
+#endif
+EOF
+ ])])
+
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN([AC_CHECK_SOCKLEN_T], [
+ AC_MSG_CHECKING([for socklen_t])
+ AC_LANG_PUSH([C])
+ AC_CACHE_VAL([ac_cv_socklen_t],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <sys/socket.h>]],
+ [[socklen_t a=0; getsockname(0,(struct sockaddr*)0, &a)]])],
+ [ac_cv_socklen_t=socklen_t], [ac_cv_socklen_t=''])
+ if test x"$ac_cv_socklen_t" = x""; then
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+ #include <sys/socket.h>]],
+ [[int a=0; getsockname(0,(struct sockaddr*)0, &a);]])],
+ [ac_cv_socklen_t=int], [ac_cv_socklen_t=size_t])
+ fi])
+ AC_LANG_POP([C])
+ AC_MSG_RESULT([$ac_cv_socklen_t])
+ if test x"$ac_cv_socklen_t" != x"socklen_t"; then
+ AC_DEFINE_UNQUOTED([socklen_t], [$ac_cv_socklen_t], [Define the real type of socklen_t])
+ fi
+])
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
deleted file mode 100644
index 641c4898d..000000000
--- a/m4/uintmax_t.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-# uintmax_t.m4 serial 10
-dnl Copyright (C) 1997-2004, 2007 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Paul Eggert.
-
-AC_PREREQ(2.13)
-
-# Define uintmax_t to 'unsigned long' or 'unsigned long long'
-# if it is not already defined in <stdint.h> or <inttypes.h>.
-
-AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
-[
- AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
- AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
- AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
- test $ac_cv_type_unsigned_long_long_int = yes \
- && ac_type='unsigned long long' \
- || ac_type='unsigned long'
- AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
- [Define to unsigned long or unsigned long long
- if <stdint.h> and <inttypes.h> don't define.])
- else
- AC_DEFINE(HAVE_UINTMAX_T, 1,
- [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
- fi
-])
diff --git a/m4/video_out.m4 b/m4/video_out.m4
new file mode 100644
index 000000000..a7fec05c5
--- /dev/null
+++ b/m4/video_out.m4
@@ -0,0 +1,494 @@
+dnl -----------------
+dnl Video out plugins
+dnl -----------------
+AC_DEFUN([XINE_VIDEO_OUT_PLUGINS], [
+ dnl Setup defaults for the target operating system. For example, linuxfb is
+ dnl only ever available on Linux, so don't bother checking for it unless
+ dnl explicitly requested to do so on other operating systems.
+ dnl Notes:
+ dnl - dha_kmod is Linux only, but disabled by default
+ dnl - directx is Windows only
+ dnl - dxr3 is Linux only
+ dnl - Mac OS X video is Mac OS X only
+ dnl - OpenGL requires Xwindows
+ dnl - Vidix is FreeBSD and Linux only
+ dnl - XvMC and xxmc depend on Xv
+
+ default_enable_aalib=yes
+ default_enable_dha_kmod=no
+ default_enable_directfb=no
+ default_enable_directx=no
+ default_enable_dxr3=no
+ default_enable_glu=yes
+ default_enable_fb=no
+ default_enable_macosx_video=no
+ default_enable_opengl=yes
+ default_enable_vidix=no
+ default_enable_xinerama=yes
+ default_enable_xvmc=yes
+ default_enable_vdpau=no
+
+ default_with_caca=yes
+ default_with_libstk=no
+ default_with_sdl=yes
+ default_with_xcb=yes
+
+ case "$host_os" in
+ cygwin* | mingw*)
+ default_enable_directx=yes
+ ;;
+
+ darwin*)
+ default_enable_macosx_video=yes
+ ;;
+
+ freebsd*|kfreebsd*)
+ default_enable_vidix=yes
+ default_enable_vdpau=yes
+ ;;
+
+ gnu*)
+ default_enable_vdpau=yes
+ ;;
+
+ linux*)
+ default_enable_dxr3=yes
+ default_enable_fb=yes
+ default_enable_vidix=yes
+ default_enable_vdpau=yes
+ enable_linux=yes
+ ;;
+ esac
+
+
+ dnl Ascii-Art
+ XINE_ARG_ENABLE([aalib], [enable support for AALIB])
+ if test x"$enable_aalib" != x"no"; then
+ ACX_PACKAGE_CHECK([AALIB], [1.4], [aalib-config], [have_aalib=yes], [have_aalib=no])
+ if test x"$hard_enable_aalib" = x"yes" && test x"$have_aalib" != x"yes"; then
+ AC_MSG_ERROR([aalib support requested, but aalib not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_AA], [test x"$have_aalib" = x"yes"])
+
+
+ dnl Color AsCii Art
+ XINE_ARG_WITH([caca], [enable support for CACA])
+ if test x"$with_caca" != x"no"; then
+ PKG_CHECK_MODULES([CACA], [caca >= 0.99beta14 cucul >= 0.99beta14], [have_caca="yes"], [have_caca="no"])
+ if test x"$hard_with_caca" = x"yes" && test x"$have_caca" != x"yes"; then
+ AC_MSG_ERROR([CACA support requested, but libcaca 0.99 not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_CACA], [test x"$have_caca" = x"yes"])
+
+
+ dnl dha (Linux only)
+ XINE_ARG_ENABLE([dha-kmod], [build Linux DHA kernel module])
+ if test x"$enable_dha_kmod" != x"no"; then
+ AC_ARG_WITH([linux-path],
+ [AS_HELP_STRING([--with-linux-path=PATH], [where the linux sources are located])],
+ [linux_path="$withval"], [linux_path="/usr/src/linux"])
+ LINUX_INCLUDE="-I$linux_path/include"
+ AC_SUBST(LINUX_INCLUDE)
+ AC_CHECK_PROG([MKNOD], [mknod], [mknod], [no])
+ AC_CHECK_PROG([DEPMOD], [depmod], [depmod], [no], ["$PATH:/sbin"])
+ fi
+ AM_CONDITIONAL([HAVE_LINUX], [test x"$enable_linux" = x"yes"])
+ AM_CONDITIONAL([BUILD_DHA_KMOD], [test x"$enable_dha_kmod" != x"no"])
+
+
+ dnl DirectFB
+ XINE_ARG_ENABLE([directfb], [enable use of DirectFB])
+ if test "x$enable_directfb" = "xyes"; then
+ PKG_CHECK_MODULES([DIRECTFB], [directfb >= 0.9.22], [have_directfb=yes], [have_directfb=no])
+ if test x"$hard_enable_directfb" = x"yes" && test x"$have_directfb" != x"yes"; then
+ AC_MSG_ERROR([DirectFB support requested, but DirectFB not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_DIRECTFB], [test x"$have_directfb" = x"yes"])
+
+
+ dnl DirectX (see directx.m4)
+ AM_PATH_DIRECTX
+
+
+ dnl dxr3 / hollywood plus card
+ XINE_ARG_ENABLE([dxr3], [enable support for DXR3/HW+])
+ if test x"$enable_dxr3" != x"no"; then
+ have_dxr3=yes
+ AC_MSG_RESULT([*** checking for a supported mpeg encoder])
+ AC_CHECK_LIB([fame], [fame_open],
+ [AC_CHECK_HEADERS([fame.h], [have_libfame=yes], [have_libfame=no])], [have_libfame=no])
+ if test x"$have_libfame" = x"yes"; then
+ have_encoder=yes
+ AC_DEFINE([HAVE_LIBFAME], 1, [Define this if you have libfame mpeg encoder installed (fame.sf.net)])
+ ACX_PACKAGE_CHECK([LIBFAME], [0.8.10], [libfame-config],
+ [AC_DEFINE([HAVE_NEW_LIBFAME], 1, [Define this if you have libfame 0.8.10 or above])])
+ fi
+ AC_CHECK_LIB([rte], [rte_init],
+ [AC_CHECK_HEADERS([rte.h], [have_librte=yes], [have_librte=no])], [have_librte=no])
+ if test x"$have_librte" = x"yes"; then
+ have_encoder=yes
+ AC_MSG_WARN([this will probably only work with rte version 0.4!])
+ AC_DEFINE([HAVE_LIBRTE], 1, [Define this if you have librte mpeg encoder installed (zapping.sf.net)])
+ fi
+ if test "$have_encoder" = "yes"; then
+ AC_MSG_RESULT([*** found one or more external mpeg encoders])
+ else
+ AC_MSG_RESULT([*** no external mpeg encoder found])
+ fi
+ else
+ have_dxr3=no have_libfame=no have_librte=no have_encoder=no
+ fi
+ AM_CONDITIONAL([ENABLE_DXR3], [test x"$have_dxr3" = x"yes"])
+ AM_CONDITIONAL([HAVE_LIBFAME], [test x"$have_libfame" = x"yes"])
+ AM_CONDITIONAL([HAVE_LIBRTE], [test x"$have_librte" = x"yes"])
+
+
+ dnl LibSTK - http://www.libstk.net (project appears to be dead)
+ XINE_ARG_WITH([libstk], [Build with STK surface video driver])
+ if test x"$with_libstk" != x"no"; then
+ PKG_CHECK_MODULES([LIBSTK], [libstk >= 0.2.0], [have_libstk=yes], [have_libstk=no])
+ if test x"$hard_with_libstk" = x"yes" && test x"$have_libstk" != x"yes"; then
+ AC_MSG_ERROR([libstk support requested, but libstk not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_STK], [test x"$have_libstk" = x"yes"])
+
+
+ dnl Linux framebuffer device
+ XINE_ARG_ENABLE([fb], [enable Linux framebuffer support])
+ if test x"$enable_fb" != x"no"; then
+ AC_CHECK_HEADERS([linux/fb.h], [have_fb=yes], [have_fb=no])
+ if test x"$hard_enable_fb" = x"yes" && test x"$have_fb" != x"yes"; then
+ AC_MSG_ERROR([Linux framebuffer support requested, but required header file(s) not found])
+ elif test x"$have_fb" = x"yes"; then
+ dnl This define is needed by src/video_out/video_out_vidix.c
+ AC_DEFINE([HAVE_FB], 1, [Define this if you have linux framebuffer support])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_FB], [test x"$have_fb" = x"yes"])
+
+
+ dnl Mac OS X OpenGL video output
+ XINE_ARG_ENABLE([macosx-video], [enable support for Mac OS X OpenGL video output])
+ if test x"$enable_macosx_video" != x"no"; then
+ AC_MSG_CHECKING([for Mac OS X video output frameworks])
+ ac_save_LIBS="$LIBS" LIBS="$LIBS -framework Cocoa -framework OpenGL"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[return 0]])], [have_macosx_video=yes], [have_macosx_video=no])
+ LIBS="$ac_save_LIBS"
+ AC_MSG_RESULT([$have_macosx_video])
+ if test x"$hard_enable_macosx_video" = x"yes" && test x"$have_macosx_video" != x"yes"; then
+ AC_MSG_ERROR([Mac OS X OpenGL video output support requested, but required frameworks not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_MACOSX_VIDEO], [test x"$have_macosx_video" = x"yes"])
+
+
+ dnl OpenGL, including GLut and/or GLU
+ XINE_ARG_ENABLE([opengl], [enable support for X-based OpenGL video output])
+ XINE_ARG_ENABLE([glu], [enable support for GLU in the OpenGL plugin])
+ if test x"$enable_opengl" != x"no"; then
+ if test x"$no_x" = x"yes"; then
+ if test x"$hard_enable_opengl" = x"yes"; then
+ AC_MSG_ERROR([OpenGL support requested, but X support is disabled])
+ fi
+ enable_opengl=no
+ fi
+ fi
+ if test x"$enable_opengl" != x"no"; then
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ AC_CHECK_LIB([GL], [glBegin],
+ [AC_CHECK_HEADERS([GL/gl.h], [have_opengl=yes], [have_opengl=no])], [have_opengl=no],
+ [$X_LIBS -lm])
+ if test x"$hard_enable_opengl" = x"yes" && test x"$have_opengl" != x"yes"; then
+ AC_MSG_ERROR([OpenGL support requested, but OpenGL not found])
+ elif test x"$have_opengl" = x"yes"; then
+ OPENGL_LIBS="-lGL -lm"
+ if test x"$enable_glu" != x"no"; then
+ have_glu=no
+ AC_CHECK_LIB([GLU], [gluPerspective],
+ [AC_CHECK_HEADERS([GL/glu.h],
+ [AC_MSG_CHECKING([if GLU is sane])
+ ac_save_LIBS="$LIBS" LIBS="-lGLU $X_LIBS $OPENGL_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <GL/gl.h>
+ #include <GL/glu.h>]],
+ [[gluPerspective(45.0f, 1.33f, 1.0f, 1000.0f);
+ glBegin(GL_POINTS); glEnd()]])],
+ [have_glu=yes], [have_glu=no])
+ LIBS="$ac_save_LIBS"
+ AC_MSG_RESULT([$have_glu])], [have_glu=no])], [have_glu=no],
+ [$X_LIBS $OPENGL_LIBS])
+ if test x"$hard_enable_glu" = x"yes" && test x"$have_glu" != x"yes"; then
+ AC_MSG_ERROR([OpenGL GLU support requested, but GLU not found])
+ elif test x"$have_glu" = x"yes"; then
+ AC_DEFINE([HAVE_GLU], 1, [Define this if you have GLU support available])
+ GLU_LIBS="-lGLU"
+ fi
+ fi
+ fi
+ CPPFLAGS="$ac_save_CPPFLAGS"
+ AC_SUBST(OPENGL_CFLAGS)
+ AC_SUBST(OPENGL_LIBS)
+ AC_SUBST(GLU_LIBS)
+ fi
+ AM_CONDITIONAL([ENABLE_OPENGL], [test x"$have_opengl" = x"yes"])
+
+
+ dnl SDL
+ XINE_ARG_WITH([sdl], [Enable support for SDL video output])
+ if test x"$with_sdl" != x"no"; then
+ PKG_CHECK_MODULES([SDL], [sdl], [have_sdl=yes], [have_sdl=no])
+ if test x"$hard_with_sdl" = x"yes" && test x"$have_sdl" != x"yes"; then
+ AC_MSG_ERROR([SDL support requested, but SDL not found])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_SDL], [test x"$have_sdl" = x"yes"])
+
+
+ dnl Solaris framebuffer device support (exists for more than just Solaris)
+ AC_CHECK_HEADERS([sys/fbio.h], [have_sunfb=yes], [have_sunfb=no])
+ if test x"$have_sunfb" = x"yes"; then
+ saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I/usr/openwin/include"
+ saved_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -L/usr/openwin/lib"
+ AC_CHECK_LIB([dga], [XDgaGrabDrawable],
+ [AC_CHECK_HEADER([dga/dga.h],
+ [SUNDGA_CFLAGS="-I/usr/openwin/include"
+ SUNDGA_LIBS="-L/usr/openwin/lib -R/usr/openwin/lib -ldga"
+ have_sundga=yes])])
+ CPPFLAGS="$saved_CPPFLAGS" LDFLAGS="$saved_LDFLAGS"
+ AC_SUBST(SUNDGA_CPPFLAGS)
+ AC_SUBST(SUNDGA_LIBS)
+ fi
+ AM_CONDITIONAL([ENABLE_SUNDGA], [test x"$have_sundga" = x"yes"])
+ AM_CONDITIONAL([ENABLE_SUNFB], [test x"$have_sunfb" = x"yes"])
+
+
+ dnl xcb
+ XINE_ARG_WITH([xcb], [Enable support for XCB video out plugins])
+ if test x"$with_xcb" != x"no"; then
+ PKG_CHECK_MODULES([XCB], [xcb-shape >= 1.0], [have_xcb=yes], [have_xcb=no])
+ if test x"$hard_enable_xcb" = x"yes" && test x"$have_xcb" != x"yes"; then
+ AC_MSG_ERROR([XCB support requested, but XCB not found])
+ elif test x"$have_xcb" = x"yes"; then
+ PKG_CHECK_MODULES([XCBSHM], [xcb-shm], [have_xcbshm=yes], [have_xcbshm=no])
+ PKG_CHECK_MODULES([XCBXV], [xcb-xv], [have_xcbxv=yes], [have_xcbxv=no])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_XCB], [test x"$have_xcb" = x"yes"])
+ AM_CONDITIONAL([ENABLE_XCBSHM], [test x"$have_xcbshm" = x"yes"])
+ AM_CONDITIONAL([ENABLE_XCBXV], [test x"$have_xcbxv" = x"yes"])
+
+
+ dnl vidix/libdha
+ dnl Requires X11 or Linux framebuffer
+ XINE_ARG_ENABLE([vidix], [enable support for Vidix])
+ if test x"$enable_vidix" != x"no"; then
+ have_vidix=yes
+ if test x"$ac_cv_prog_AWK" = x"no"; then
+ have_vidix=no
+ else
+ if test x"$no_x" = x"yes" -o x"$have_fb" != x"yes"; then
+ have_vidix=no
+ else
+ case "$host_or_hostalias" in
+ i?86-*-linux* | k?-*-linux* | athlon-*-linux*) ;;
+ i?86-*-freebsd* | k?-*-freebsd* | athlon-*-freebsd* | i?86-*-kfreebsd*) ;;
+ *) have_vidix="no" ;;
+ esac
+ fi
+ fi
+ if test x"$hard_enable_vidix" = x"yes" && test x"$have_vidix" != x"yes"; then
+ AC_MSG_ERROR([Vidix support requested, but not all requirements are met])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_VIDIX], test x"$have_vidix" = x"yes")
+
+
+ dnl Xinerama
+ XINE_ARG_ENABLE([xinerama], [enable support for Xinerama])
+ if test x"$enable_xinerama" != x"no"; then
+ if test x"$no_x" != x"yes"; then
+ PKG_CHECK_MODULES([XINERAMA], [xinerama], [have_xinerama=yes],
+ [AC_CHECK_LIB([Xinerama], [XineramaQueryExtension],
+ [XINERAMA_LIBS="-lXinerama" have_xinerama="yes"], [],
+ [$X_LIBS])])
+ fi
+ if test x"$hard_enable_xinerama" = x"yes" && test x"$have_xinerama" != x"yes"; then
+ AC_MSG_ERROR([Xinerama support requested, but Xinerama not found or X disabled])
+ elif test x"$have_xinerama" = x"yes"; then
+ AC_DEFINE([HAVE_XINERAMA], 1, [Define this if you have libXinerama installed])
+ X_LIBS="$X_LIBS $XINERAMA_LIBS"
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_XINERAMA], [test x"$have_xinerama" = x"yes"])
+
+
+ dnl xv
+ AC_ARG_WITH([xv-path],
+ [AS_HELP_STRING([--with-xv-path=path], [where libXv is installed])])
+ dnl With recent XFree86 or Xorg, dynamic linking is preferred!
+ dnl Only dynamic linking is possible when using libtool < 1.4.0
+ AC_ARG_ENABLE([static-xv],
+ [AS_HELP_STRING([--enable-static-xv], [Enable this to force linking against libXv.a])],
+ [test x"$enableval" != x"no" && xv_prefer_static="yes"], [xv_prefer_static="no"])
+ case "$host_or_hostalias" in
+ hppa*) xv_libexts="$acl_cv_shlibext" ;;
+ *)
+ if test x"$xv_prefer_static" = x"yes"; then
+ xv_libexts="$acl_cv_libext $acl_cv_shlibext"
+ else
+ xv_libexts="$acl_cv_shlibext $acl_cv_libext"
+ fi
+ ;;
+ esac
+ if test x"$no_x" != x"yes"; then
+ PKG_CHECK_MODULES([XV], [xv], [have_xv=yes], [have_xv=no])
+ if test x"$have_xv" = x"no"; then
+ dnl No Xv package -- search for it
+ for xv_libext in $xv_libexts; do
+ xv_lib="libXv.$xv_libext"
+ AC_MSG_CHECKING([for $xv_lib])
+ for xv_try_path in "$with_xv_path" "$x_libraries" /usr/X11R6/lib /usr/lib; do
+ if test x"$xv_try_path" != x"" && test -f "$xv_try_path/$xv_lib"; then
+ case $xv_lib in
+ *.$acl_cv_libext) have_xv_static=yes xv_try_libs="$xv_try_path/$xv_lib" ;;
+ *.$acl_cv_shlibext) have_xv_static=no xv_try_libs="${xv_try_path:+-L}$xv_try_path -lXv" ;;
+ esac
+ ac_save_LIBS="$LIBS" LIBS="$xv_try_libs $X_PRE_LIBS $X_LIBS $X_EXTRA_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvShmCreateImage()]])], [have_xv=yes], [])
+ LIBS="$ac_save_LIBS"
+ if test x"$have_xv" = x"yes"; then
+ AC_MSG_RESULT([$xv_try_path])
+ XV_LIBS="$xv_try_libs"
+ break
+ fi
+ fi
+ done
+ test x"$have_xv" = x"yes" && break
+ AC_MSG_RESULT([no])
+ done
+ fi
+ if test x"$have_xv" = x"yes"; then
+ AC_DEFINE([HAVE_XV], 1, [Define this if you have libXv installed])
+ fi
+ fi
+ AM_CONDITIONAL([HAVE_XV], [test x"$have_xv" = x"yes"])
+
+
+ dnl XvMC
+ XINE_ARG_ENABLE([xvmc], [Enable xxmc and XvMC outplut plugins])
+ AC_ARG_WITH([xvmc-path],
+ [AS_HELP_STRING([--with-xvmc-path=PATH], [where libXvMC for the xvmc plugin are installed])],
+ [], [with_xvmc_path="$x_libraries"])
+ AC_ARG_WITH([xvmc-lib],
+ [AS_HELP_STRING([--with-xvmc-lib=LIBNAME], [The name of the XvMC library libLIBNAME.so for the xvmc plugin])],
+ [], [with_xvmc_lib="XvMCW"])
+ AC_ARG_WITH([xxmc-path],
+ [AS_HELP_STRING([--with-xxmc-path=PATH], [Where libXvMC for the xxmc plugin are installed])],
+ [], [with_xxmc_path="$x_libraries"])
+ AC_ARG_WITH([xxmc-lib],
+ [AS_HELP_STRING([--with-xxmc-lib=LIBNAME], [The name of the XvMC library libLIBNAME.so for the xxmc plugin])],
+ [], [with_xxmc_lib="XvMCW"])
+ if test x"$enable_xvmc" != x"no"; then
+ if test x"$have_xv" != x"yes"; then
+ have_xvmc=no have_xxmc=no have_xvmc_or_xxmc=no
+ else
+ ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS"
+ ac_save_LIBS="$LIBS"
+
+ dnl Check for xxmc
+ XXMC_LIBS="${with_xxmc_path:+-L}$with_xxmc_path -l$with_xxmc_lib"
+ AC_SUBST(XXMC_LIBS)
+ AC_MSG_CHECKING([whether to enable the xxmc plugin with VLD extensions])
+ AC_MSG_RESULT([])
+ LIBS="$XXMC_LIBS $X_LIBS $XV_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCPutSlice()]])], [have_xxmc=yes],
+ [LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCPutSlice()]])],
+ [have_xxmc=yes XXMC_LIBS="$XXMC_LIBS -lXvMC"])])
+ if test x"$have_xxmc" = x"yes"; then
+ AC_CHECK_HEADERS([X11/extensions/vldXvMC.h],
+ [have_vldexts=yes
+ AC_DEFINE([HAVE_VLDXVMC], 1, [Define if you have vldXvMC.h])],
+ [have_vldexts=no])
+ else
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], [have_xxmc=yes],
+ [LIBS="$XXMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])],
+ [have_xxmc=yes XXMC_LIBS="$XXMC_LIBS -lXvMC"])])
+ fi
+ if test x"$have_xxmc" = x"yes"; then
+ AC_CHECK_HEADERS([X11/extensions/XvMC.h], [], [have_xxmc=no])
+ fi
+
+ dnl Check for xvmc
+ XVMC_LIBS="${with_xvmc_path:+-L}$with_xvmc_path -l$with_xvmc_lib"
+ AC_SUBST(XVMC_LIBS)
+ AC_MSG_CHECKING([whether to enable the xvmc plugin])
+ AC_MSG_RESULT([])
+ LIBS="$XVMC_LIBS $X_LIBS $XV_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])], [have_xvmc=yes],
+ [LIBS="$XVMC_LIBS -lXvMC $X_LIBS $XV_LIBS $LIBS"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[XvMCCreateContext()]])],
+ [have_xvmc=yes XVMC_LIBS="$XVMC_LIBS -lXvMC"])])
+ if test x"$have_xvmc" = x"yes"; then
+ AC_CHECK_HEADERS([X11/extensions/XvMC.h], [], [have_xvmc=no])
+ fi
+ CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS"
+ fi
+ have_xvmc_or_xxmc="$have_xvmc"; test x"$have_xxmc" = x"yes" && have_xvmc_or_xxmc=yes
+ if test x"$hard_enable_xvmc" = x"yes" && test x"$have_xvmc_or_xxmc" != x"yes"; then
+ AC_MSG_ERROR([XvMC support requested, but neither XvMC nor xxmc could be found, or X is disabled])
+ else
+ if test x"$have_xvmc" = x"yes"; then
+ AC_DEFINE([HAVE_XVMC], 1, [Define this if you have an XvMC library and XvMC.h installed.])
+ AC_MSG_RESULT([*** Enabling old xvmc plugin.])
+ else
+ AC_MSG_RESULT([*** Disabling old xvmc plugin.])
+ fi
+ if test x"$have_xxmc" = x"yes"; then
+ if test x"$have_vldexts" = x"yes"; then
+ AC_MSG_RESULT([*** Enabling xxmc plugin with vld extensions.])
+ else
+ AC_MSG_RESULT([*** Enabling xxmc plugin for standard XvMC *only*.])
+ fi
+ else
+ AC_MSG_RESULT([*** Disabling xxmc plugin.])
+ fi
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_XVMC], [test x"$have_xvmc" = x"yes"])
+ AM_CONDITIONAL([ENABLE_XXMC], [test x"$have_xxmc" = x"yes"])
+
+
+ dnl VDPAU
+ XINE_ARG_ENABLE([vdpau], [Disable VDPAU output plugin])
+ if test x"$no_x" != x"yes" && test x"$enable_vdpau" != x"no"; then
+ PKG_CHECK_MODULES([VDPAU], [vdpau], [have_vdpau=yes], [have_vdpau=no])
+ if test x"$have_vdpau" = xno; then
+ saved_CFLAGS="$CFLAGS"
+ saved_LIBS="$LIBS"
+ CFLAGS=
+ LIBS=
+ dnl likely defaults
+ dnl if these are bad, blame nVidia for not supplying vdpau.pc
+ VDPAU_CFLAGS=
+ VDPAU_LIBS=-lvdpau
+ AC_CHECK_HEADERS([vdpau/vdpau_x11.h], [have_vdpau=yes], [have_vdpau=no])
+ if test x"$have_vdpau" = x"yes"; then
+ AC_CHECK_LIB([vdpau], [vdp_device_create_x11], [], [have_vdpau=no], [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
+ fi
+ if test x"$hard_enable_vdpau" = x"yes" && test x"$have_vdpau" != x"yes"; then
+ AC_MSG_ERROR([VDPAU support requested, but not all requirements are met])
+ fi
+ CFLAGS="$saved_CFLAGS"
+ LIBS="$saved_LIBS"
+ AC_SUBST([VDPAU_CFLAGS])
+ AC_SUBST([VDPAU_LIBS])
+ fi
+ fi
+ AM_CONDITIONAL([ENABLE_VDPAU], test x"$have_vdpau" = x"yes")
+
+])dnl XINE_VIDEO_OUT_PLUGIN
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
deleted file mode 100644
index cde2129a9..000000000
--- a/m4/wchar_t.m4
+++ /dev/null
@@ -1,20 +0,0 @@
-# wchar_t.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <stddef.h> has the 'wchar_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WCHAR_T],
-[
- AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
- [AC_TRY_COMPILE([#include <stddef.h>
- wchar_t foo = (wchar_t)'\0';], ,
- gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
- if test $gt_cv_c_wchar_t = yes; then
- AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
- fi
-])
diff --git a/m4/wint_t.m4 b/m4/wint_t.m4
deleted file mode 100644
index af5ed936c..000000000
--- a/m4/wint_t.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-# wint_t.m4 serial 2 (gettext-0.17)
-dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-dnl Test whether <wchar.h> has the 'wint_t' type.
-dnl Prerequisite: AC_PROG_CC
-
-AC_DEFUN([gt_TYPE_WINT_T],
-[
- AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
- [AC_TRY_COMPILE([
-/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
- <wchar.h>.
- BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
- before <wchar.h>. */
-#include <stddef.h>
-#include <stdio.h>
-#include <time.h>
-#include <wchar.h>
- wint_t foo = (wchar_t)'\0';], ,
- gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
- if test $gt_cv_c_wint_t = yes; then
- AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
- fi
-])
diff --git a/m4/xine.m4 b/m4/xine.m4
index a92fb54e9..db530e250 100644
--- a/m4/xine.m4
+++ b/m4/xine.m4
@@ -23,194 +23,121 @@ dnl script generated by Autoconf, you may include it under the same
dnl distribution terms that you use for the rest of that program.
dnl
-dnl AM_PATH_XINE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
-dnl Test for XINE, and define XINE_CFLAGS and XINE_LIBS
-dnl
-AC_DEFUN([AM_PATH_XINE],
-[dnl
-dnl Get the cflags and libraries from the xine-config script
-dnl
-AC_ARG_WITH(xine-prefix,
- AS_HELP_STRING([--with-xine-prefix=DIR], [prefix where XINE is installed (optional)]),
- xine_config_prefix="$withval", xine_config_prefix="")
-AC_ARG_WITH(xine-exec-prefix,
- AS_HELP_STRING([--with-xine-exec-prefix=DIR], [exec prefix where XINE is installed (optional)]),
- xine_config_exec_prefix="$withval", xine_config_exec_prefix="")
-AC_ARG_ENABLE(xinetest,
- AS_HELP_STRING([--disable-xinetest], [do not try to compile and run a test XINE program]),
- enable_xinetest=$enableval, enable_xinetest=yes)
-
- AC_LANG_PUSH([C])
+dnl _XINE_VERSION_PARSE(version)
+AC_DEFUN([_XINE_VERSION_PARSE], [`echo $1 | perl -e 'my $v = <>; chomp $v;
+my @v = split(" ", $v); $v = $v[[@S|@#v]]; $v =~ s/[[^0-9.]].*$//; @v = split (/\./, $v);
+push @v, 0 while $[#v] < 2; print $v[[0]] * 10000 + $v[[1]] * 100 + $v[[2]], "\n"'`])
- if test x$xine_config_exec_prefix != x ; then
- xine_config_args="$xine_config_args --exec-prefix=$xine_config_exec_prefix"
- if test x${XINE_CONFIG+set} != xset ; then
- XINE_CONFIG=$xine_config_exec_prefix/bin/xine-config
- fi
- fi
- if test x$xine_config_prefix != x ; then
- xine_config_args="$xine_config_args --prefix=$xine_config_prefix"
- if test x${XINE_CONFIG+set} != xset ; then
- XINE_CONFIG=$xine_config_prefix/bin/xine-config
- fi
- fi
- min_xine_version=ifelse([$1], ,0.5.0,$1)
- if test "x$enable_xinetest" != "xyes" ; then
- AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version])
- else
- AC_PATH_TOOL(XINE_CONFIG, xine-config, no)
- AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version])
- no_xine=""
- if test "$XINE_CONFIG" = "no" ; then
- no_xine=yes
+dnl _XINE_VERSION_CHECK(required, actual)
+AC_DEFUN([_XINE_VERSION_CHECK], [
+ required_version=ifelse([$1], , [0.0.0], [$1])
+ required_version_parsed=_XINE_VERSION_PARSE([$required_version])
+ actual_version=ifelse([$2], , [0.0.0], [$2])
+ actual_version_parsed=_XINE_VERSION_PARSE([$actual_version])
+ if test $required_version_parsed -le $actual_version_parsed; then
+ ifelse([$3], , [:], [$3])
else
- XINE_CFLAGS=`$XINE_CONFIG $xine_config_args --cflags 2>/dev/null`
- XINE_LIBS=`$XINE_CONFIG $xine_config_args --libs 2>/dev/null`
- XINE_ACFLAGS=`$XINE_CONFIG $xine_config_args --acflags 2>/dev/null`
- xine_version=`$XINE_CONFIG $xine_config_args --version 2>/dev/null`
- xine_config_major_version=`echo "$xine_version" | \
- sed -n 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\1/p'`
- xine_config_minor_version=`echo "$xine_version" | \
- sed -n 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\2/p'`
- xine_config_sub_version=`echo "$xine_version" | \
- sed -n 's/^\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*$/\3/p'`
- xine_data_dir=`$XINE_CONFIG $xine_config_args --datadir 2>/dev/null`
- xine_script_dir=`$XINE_CONFIG $xine_config_args --scriptdir 2>/dev/null`
- xine_plugin_dir=`$XINE_CONFIG $xine_config_args --plugindir 2>/dev/null`
- xine_locale_dir=`$XINE_CONFIG $xine_config_args --localedir 2>/dev/null`
- dnl if test "x$enable_xinetest" = "xyes" ; then
- ac_save_CFLAGS="$CFLAGS"
- ac_save_LIBS="$LIBS"
- CFLAGS="$CFLAGS $XINE_CFLAGS"
- LIBS="$XINE_LIBS $LIBS"
-dnl
-dnl Now check if the installed XINE is sufficiently new. (Also sanity
-dnl checks the results of xine-config to some extent
-dnl
- rm -f conf.xinetest
- AC_RUN_IFELSE([AC_LANG_SOURCE([[
-#include <xine.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
+ ifelse([$4], , [:], [$4])
+ fi
+])
-int
-main ()
-{
- int major, minor, sub;
- char *tmp_version;
- system ("touch conf.xinetest");
+dnl AM_PATH_XINE([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
+dnl Test for XINE, and define XINE_CFLAGS and XINE_LIBS
+dnl
+AC_DEFUN([AM_PATH_XINE], [
+ if test -z "$PKG_CONFIG"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
+ fi
- /* HP/UX 9 (%@#!) writes to sscanf strings */
- tmp_version = (char *) strdup("$min_xine_version");
- if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &sub) != 3) {
- printf("%s, bad version string\n", "$min_xine_version");
- exit(1);
- }
+ AC_ARG_VAR([XINE_CONFIG], [Full path to xine-config (xine-lib < 1.2)])
+ AC_ARG_WITH([xine-prefix],
+ [AS_HELP_STRING([--with-xine-prefix], [prefix where xine-lib is installed (optional, xine-lib < 1.2)])])
+ AC_ARG_WITH([xine-exec-prefix],
+ [AS_HELP_STRING([--with-xine-exec-prefix], [exec prefix where xine-lib is installed (optional, xine-lib < 1.2)])])
- if ((XINE_MAJOR_VERSION != $xine_config_major_version) ||
- (XINE_MINOR_VERSION != $xine_config_minor_version) ||
- (XINE_SUB_VERSION != $xine_config_sub_version))
- {
- printf("\n*** 'xine-config --version' returned %d.%d.%d, but XINE (%d.%d.%d)\n",
- $xine_config_major_version, $xine_config_minor_version, $xine_config_sub_version,
- XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION);
- printf ("*** was found! If xine-config was correct, then it is best\n");
- printf ("*** to remove the old version of XINE. You may also be able to fix the error\n");
- printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
- printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
- printf("*** required on your system.\n");
- printf("*** If xine-config was wrong, set the environment variable XINE_CONFIG\n");
- printf("*** to point to the correct copy of xine-config, and remove the file config.cache\n");
- printf("*** before re-running configure\n");
- }
- else
- {
- if ((XINE_MAJOR_VERSION > major) ||
- ((XINE_MAJOR_VERSION == major) && (XINE_MINOR_VERSION > minor)) ||
- ((XINE_MAJOR_VERSION == major) && (XINE_MINOR_VERSION == minor) && (XINE_SUB_VERSION >= sub)))
- {
- return 0;
- }
- else
- {
- printf("\n*** An old version of XINE (%d.%d.%d) was found.\n",
- XINE_MAJOR_VERSION, XINE_MINOR_VERSION, XINE_SUB_VERSION);
- printf("*** You need a version of XINE newer than %d.%d.%d. The latest version of\n",
- major, minor, sub);
- printf("*** XINE is always available from:\n");
- printf("*** http://xine.sourceforge.net\n");
- printf("***\n");
- printf("*** If you have already installed a sufficiently new version, this error\n");
- printf("*** probably means that the wrong copy of the xine-config shell script is\n");
- printf("*** being found. The easiest way to fix this is to remove the old version\n");
- printf("*** of XINE, but you can also set the XINE_CONFIG environment to point to the\n");
- printf("*** correct copy of xine-config. (In this case, you will have to\n");
- printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
- printf("*** so that the correct libraries are found at run-time))\n");
- }
- }
- return 1;
-}
-]])],[],[no_xine=yes],[echo $ac_n "cross compiling; assumed OK... $ac_c"])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
- fi
+ xine_config_args=""
+ if test x"$with_xine_exec_prefix" != x""; then
+ xine_config_args="$xine_config_args --exec-prefix=$with_xine_exec_prefix"
+ test x"$XINE_CONFIG" != x"" && XINE_CONFIG="$with_xine_exec_prefix/bin/xine-config"
+ fi
+ if test x"$with_xine_prefix" != x""; then
+ xine_config_args="$xine_config_args --prefix=$with_xine_prefix"
+ test x"$XINE_CONFIG" = x"" && XINE_CONFIG="$with_xine_prefix/bin/xine-config"
fi
- if test "x$no_xine" = x ; then
- AC_MSG_RESULT(yes)
- ifelse([$2], , :, [$2])
+
+ if "$PKG_CONFIG" --atleast-version 1.1.90 libxine; then
+ min_xine_version=ifelse([$1], , [1.2.0], [$1])
+ PKG_CHECK_MODULES([XINE], [libxine >= $min_xine_version],
+ [XINE_VERSION="`"$PKG_CONFIG" --modversion libxine`"
+ XINE_ACFLAGS="`"$PKG_CONFIG" --variable=acflags libxine`"
+ xine_data_dir="`"$PKG_CONFIG" --variable=datadir libxine`"
+ xine_script_dir="`"$PKG_CONFIG" --variable=scriptdir libxine`"
+ xine_plugin_dir="`"$PKG_CONFIG" --variable=plugindir libxine`"
+ xine_locale_dir="`"$PKG_CONFIG" --variable=localedir libxine`"
+ $2],
+ [$3])
else
- AC_MSG_RESULT(no)
- if test "$XINE_CONFIG" = "no" ; then
- echo "*** The xine-config script installed by XINE could not be found"
- echo "*** If XINE was installed in PREFIX, make sure PREFIX/bin is in"
- echo "*** your path, or set the XINE_CONFIG environment variable to the"
- echo "*** full path to xine-config."
- else
- if test -f conf.xinetest ; then
- :
- else
- echo "*** Could not run XINE test program, checking why..."
- CFLAGS="$CFLAGS $XINE_CFLAGS"
- LIBS="$LIBS $XINE_LIBS"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-#include <xine.h>
-#include <stdio.h>
-]], [[ return ((XINE_MAJOR_VERSION) || (XINE_MINOR_VERSION) || (XINE_SUB_VERSION)); ]])],
- [ echo "*** The test program compiled, but did not run. This usually means"
- echo "*** that the run-time linker is not finding XINE or finding the wrong"
- echo "*** version of XINE. If it is not finding XINE, you'll need to set your"
- echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
- echo "*** to the installed location Also, make sure you have run ldconfig if that"
- echo "*** is required on your system"
- echo "***"
- echo "*** If you have an old version installed, it is best to remove it, although"
- echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
- echo "***"],
- [ echo "*** The test program failed to compile or link. See the file config.log for the"
- echo "*** exact error that occured. This usually means XINE was incorrectly installed"
- echo "*** or that you have moved XINE since it was installed. In the latter case, you"
- echo "*** may want to edit the xine-config script: $XINE_CONFIG" ])
- CFLAGS="$ac_save_CFLAGS"
- LIBS="$ac_save_LIBS"
+ min_xine_version=ifelse([$1], , [0.5.0], [$1])
+ AC_PATH_TOOL([XINE_CONFIG], [xine-config], [no])
+ AC_MSG_CHECKING([for XINE-LIB version >= $min_xine_version])
+ XINE_CFLAGS="`$XINE_CONFIG $xine_config_args --cflags 2>/dev/null`"
+ XINE_LIBS="`$XINE_CONFIG $xine_config_args --libs 2>/dev/null`"
+ XINE_VERSION="`$XINE_CONFIG $xine_config_args --version 2>/dev/null`"
+ XINE_ACFLAGS="`$XINE_CONFIG $xine_config_args --acflags 2>/dev/null`"
+ xine_data_dir="`$XINE_CONFIG $xine_config_args --datadir 2>/dev/null`"
+ xine_script_dir="`$XINE_CONFIG $xine_config_args --scriptdir 2>/dev/null`"
+ xine_plugin_dir="`$XINE_CONFIG $xine_config_args --plugindir 2>/dev/null`"
+ xine_locale_dir="`$XINE_CONFIG $xine_config_args --localedir 2>/dev/null`"
+ _XINE_VERSION_CHECK([$min_xine_version], [$XINE_VERSION],
+ [xine_version_ok=yes; AC_MSG_RESULT([yes, $XINE_VERSION])],
+ [xine_version_ok=no; AC_MSG_RESULT([no, $XINE_VERSION])])
+ if test x"$xine_version_ok" = x"yes"; then
+ ifelse([$2], , [:], [$2])
+ else
+ AC_MSG_NOTICE([
+*** You need a version of xine-lib newer than $XINE_VERSION.
+*** The latest version of xine-lib is always available from:
+*** http://www.xinehq.de
+***
+*** If you have already installed a sufficiently new version, this error
+*** probably means that the wrong copy of the xine-config shell script is
+*** being found. The easiest way to fix this is to remove the old version
+*** of xine-lib, but you can also set the XINE_CONFIG environment variable
+*** to point to the correct copy of xine-config. In this case, you will have
+*** to modify your LD_LIBRARY_PATH enviroment variable, or edit
+*** /etc/ld.so.conf so that the correct libraries are found at run-time.
+ ])
+ ifelse([$3], , [:], [$3])
fi
- fi
- XINE_CFLAGS=""
- XINE_LIBS=""
- ifelse([$3], , :, [$3])
- fi
- AC_SUBST(XINE_CFLAGS)
- AC_SUBST(XINE_LIBS)
- AC_SUBST(XINE_ACFLAGS)
- AC_LANG_POP([C])
- rm -f conf.xinetest
+ fi
-dnl Make sure HAVE_STRSEP, HAVE_SETENV and HAVE_STRPBRK are defined as
-dnl necessary.
- AC_CHECK_FUNCS([strsep strpbrk setenv])
-dnl alloca (in public macro) and MinGW
- AC_CHECK_HEADERS([malloc.h])
+ AC_SUBST(XINE_CFLAGS)
+ AC_SUBST(XINE_LIBS)
+ AC_SUBST(XINE_ACFLAGS)
])
+
+dnl XINE_ARG_WITH(VARIABLE, HELP-TEXT)
+dnl Like AC_ARG_WITH but strictly sets variables
+dnl hard_with_VARIABLE = "yes" or "no" if the option is present, else undefined
+dnl with_VARIABLE = "yes" or "no" if the option is enabled or disabled
+dnl (falls back on default_with_VARIABLE)
+dnl if both = yes, error is permissible if missing requirement(s)
+AC_DEFUN([XINE_ARG_WITH], [
+ if test "x$default_with_[]m4_translit([[$1]], [-], [_])" = x; then
+ AC_MSG_ERROR([default_with_[]m4_translit([[$1]], [-], [_]) is not set])
+ fi
+ AC_ARG_WITH([$1], [AS_HELP_STRING([--with-$1], [$2])],
+ [test x"$withval" != xno && with_[]m4_translit([[$1]], [-], [_])=yes || with_[]m4_translit([[$1]], [-], [_])=no; hard_with_[]m4_translit([[$1]], [-], [_])="$with_[]m4_translit([[$1]], [-], [_])"],
+ [with_[]m4_translit([[$1]], [-], [_])="$default_with_[]m4_translit([[$1]], [-], [_])"; hard_with_[]m4_translit([[$1]], [-], [_])=''])])
+
+dnl XINE_ARG_ENABLE(VARIABLE, HELP-TEXT)
+dnl Like AC_ARG_WITH_X but wrapping AC_ARG_ENABLE
+AC_DEFUN([XINE_ARG_ENABLE], [
+ if test "x$default_enable_[]m4_translit([[$1]], [-], [_])" = x; then
+ AC_MSG_ERROR([default_enable_[]m4_translit([[$1]], [-], [_]) is not set])
+ fi
+ AC_ARG_ENABLE([$1], [AS_HELP_STRING([--enable-$1], [$2])],
+ [test x"$enableval" != xno && enable_[]m4_translit([[$1]], [-], [_])=yes || enable_[]m4_translit([[$1]], [-], [_])=no; hard_enable_[]m4_translit([[$1]], [-], [_])="$enable_[]m4_translit([[$1]], [-], [_])"],
+ [enable_[]m4_translit([[$1]], [-], [_])="$default_enable_[]m4_translit([[$1]], [-], [_])"; hard_enable_[]m4_translit([[$1]], [-], [_])=''])])
diff --git a/m4/xsize.m4 b/m4/xsize.m4
deleted file mode 100644
index 85bb721e4..000000000
--- a/m4/xsize.m4
+++ /dev/null
@@ -1,13 +0,0 @@
-# xsize.m4 serial 3
-dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_XSIZE],
-[
- dnl Prerequisites of lib/xsize.h.
- AC_REQUIRE([gl_SIZE_MAX])
- AC_REQUIRE([AC_C_INLINE])
- AC_CHECK_HEADERS(stdint.h)
-])
diff --git a/m4/xv.m4 b/m4/xv.m4
deleted file mode 100644
index 9b37a0b6e..000000000
--- a/m4/xv.m4
+++ /dev/null
@@ -1,93 +0,0 @@
-# AC_FIND_LIBXV_IMPL (LIB)
-# -------------------------
-#
-AC_DEFUN([AC_PATH_LIBXV_IMPL],
-[
- AC_MSG_CHECKING([for $1])
- if test -f "$xv_path/$1"; then
- AC_MSG_RESULT([found $1 in $xv_path])
- XV_LIBS="$1"
- else
- if test -f "/usr/lib/$1"; then
- AC_MSG_RESULT([found $1 in /usr/lib])
- XV_LIBS="$1"
- else
- AC_MSG_RESULT([$1 not found in $xv_path])
- fi
- fi
-])
-
-AC_DEFUN([AC_TEST_LIBXV],
-[
- dnl -----------------------------------------------
- dnl Testing installed Xv library
- dnl -----------------------------------------------
- AC_CHECK_LIB(Xv, XvShmCreateImage,
- [
- AC_DEFINE(HAVE_XV,
- 1,
- [Define this if you have libXv installed])
-
- ac_have_xv="yes"
- case x$XV_LIBS in
- x*.a)
- AC_DEFINE(HAVE_XV_STATIC,
- 1,
- [Define this if you have libXv.a])
- ac_have_xv_static="yes"
- XV_LIBS="$xv_path/$XV_LIBS"
- ;;
- x*.so)
- XV_LIBS=`echo $XV_LIBS | sed 's/^lib/-l/; s/\.so$//'`
- ;;
- *)
- AC_MSG_ERROR([sorry, I don't know about $XV_LIBS])
- ;;
- esac
- ],
- ,
- [$X_LIBS $X_PRE_LIBS -lXext $X_EXTRA_LIBS])
-
- dnl -----------------------------------------------
- dnl xine_check use Xv functions API.
- dnl -----------------------------------------------
- if test x$ac_have_xv = "xyes"; then
- EXTRA_X_LIBS="-L$xv_path $XV_LIBS -lXext"
- EXTRA_X_CFLAGS=""
- fi
- AC_SUBST(XV_LIBS)
- AC_SUBST(EXTRA_X_LIBS)
- AC_SUBST(EXTRA_X_CFLAGS)
-])
-
-# AC_PATH_LIBXV
-# -------------------------
-#
-AC_DEFUN([AC_FIND_LIBXV],
-[
- # Ensure that AC_PATH_XTRA is executed before this
- AC_REQUIRE([AC_PATH_XTRA])
-
- if test x$xv_path = x; then
- xv_path=/usr/X11R6/lib
- fi
-
- if test "x$xv_prefer_shared" = "xyes"; then
- AC_PATH_LIBXV_IMPL([libXv.so])
- else
- AC_PATH_LIBXV_IMPL([libXv.a])
- fi
-
- # Try the other lib if prefered failed
- if test x$XV_LIBS = x; then
- if ! test "x$xv_prefer_shared" = "xyes"; then
- AC_PATH_LIBXV_IMPL([libXv.so])
- else
- AC_PATH_LIBXV_IMPL([libXv.a])
- fi
- fi
-
- if ! test x$XV_LIBS = x; then
- AC_TEST_LIBXV
- fi
-])
diff --git a/misc/.hgignore b/misc/.hgignore
index e126a36c8..319895304 100644
--- a/misc/.hgignore
+++ b/misc/.hgignore
@@ -2,5 +2,4 @@ SlackBuild
build_rpms.sh
libxine.pc
relchk.sh
-xine-config
xine-lib.spec
diff --git a/misc/Makefile.am b/misc/Makefile.am
index f6c362d13..60446e2fd 100644
--- a/misc/Makefile.am
+++ b/misc/Makefile.am
@@ -1,21 +1,19 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = fonts
-
EXTRA_DIST = build_rpms.sh \
- cdda_server.c \
SlackBuild.in \
SlackBuild \
vga.xinefont.gz \
xine-config \
- xine-fontconv.c \
xine-lib.spec.in \
xine-lib.spec \
libxine.pc.in \
logo/xine_logo_text.svg \
libdvdcss-1.2.6-network.patch \
Makefile.plugins.in \
- Makefile.common
+ Makefile.common \
+ fonts/cetus.ttf
bin_SCRIPTS = xine-config
bin_PROGRAMS = xine-list-@XINE_SERIES@
@@ -25,8 +23,54 @@ pkgconfig_DATA=libxine.pc
xine_list_@XINE_SERIES@_SOURCES = xine-list.c
xine_list_@XINE_SERIES@_LDADD = $(XINE_LIB)
-xine-fontconv: xine-fontconv.c
- $(CC) -W -Wall -g -o xine-fontconv xine-fontconv.c -lz `freetype-config --cflags` `freetype-config --libs`
+fontdir = $(pkgdatadir)/fonts
+dist_font_DATA = \
+ fonts/cetus-16.xinefont.gz \
+ fonts/cetus-20.xinefont.gz \
+ fonts/cetus-24.xinefont.gz \
+ fonts/cetus-32.xinefont.gz \
+ fonts/cetus-48.xinefont.gz \
+ fonts/cetus-64.xinefont.gz \
+ fonts/cc-16.xinefont.gz \
+ fonts/cc-20.xinefont.gz \
+ fonts/cc-24.xinefont.gz \
+ fonts/cc-32.xinefont.gz \
+ fonts/cc-48.xinefont.gz \
+ fonts/cc-64.xinefont.gz \
+ fonts/cci-16.xinefont.gz \
+ fonts/cci-20.xinefont.gz \
+ fonts/cci-24.xinefont.gz \
+ fonts/cci-32.xinefont.gz \
+ fonts/cci-48.xinefont.gz \
+ fonts/cci-64.xinefont.gz \
+ fonts/mono-16.xinefont.gz \
+ fonts/mono-20.xinefont.gz \
+ fonts/mono-24.xinefont.gz \
+ fonts/mono-32.xinefont.gz \
+ fonts/mono-48.xinefont.gz \
+ fonts/mono-64.xinefont.gz \
+ fonts/sans-16.xinefont.gz \
+ fonts/sans-20.xinefont.gz \
+ fonts/sans-24.xinefont.gz \
+ fonts/sans-32.xinefont.gz \
+ fonts/sans-48.xinefont.gz \
+ fonts/sans-64.xinefont.gz \
+ fonts/serif-16.xinefont.gz \
+ fonts/serif-20.xinefont.gz \
+ fonts/serif-24.xinefont.gz \
+ fonts/serif-32.xinefont.gz \
+ fonts/serif-48.xinefont.gz \
+ fonts/serif-64.xinefont.gz
+
+dist_doc_DATA = fonts/README.cetus
+
+EXTRA_PROGRAMS = xine-fontconv cdda_server
+
+xine_fontconv_SOURCES = xine-fontconv.c
+xine_fontconv_CFLAGS = $(FT2_CFLAGS)
+xine_fontconv_LDFLAGS = $(GCSECTIONS)
+xine_fontconv_LDADD = -lz $(FT2_LIBS)
-cdda_server: cdda_server.c
- $(CC) -W -Wall -g -o cdda_server cdda_server.c -ldl
+cdda_server_SOURCES = cdda_server.c
+cdda_server_LDFLAGS = $(GCSECTIONS)
+cdda_server_LDADD = $(DYNAMIC_LD_LIBS)
diff --git a/misc/Makefile.common b/misc/Makefile.common
index 4adab1527..0202a8dea 100644
--- a/misc/Makefile.common
+++ b/misc/Makefile.common
@@ -3,13 +3,16 @@ XINE_LIB = $(top_builddir)/src/xine-engine/libxine.la
xineincludedir = $(includedir)/xine
xineplugdir = $(XINE_PLUGINDIR)
-xineplug_ldflags = $(LDFLAGS_NOUNDEFINED) -avoid-version -module
+xineplug_ldflags = $(LDFLAGS_NOUNDEFINED) $(GCSECTIONS) -avoid-version -module
xinepostdir = $(XINE_PLUGINDIR)/post
vidixdir = $(XINE_PLUGINDIR)/vidix
$(XINE_LIB):
- @cd $(top_builddir)/src/xine-engine && $(MAKE)
+ $(MAKE) -C $(top_builddir)/src/xine-engine libxine.la
+
+$(top_builddir)/contrib/libxdg-basedir/libxdg-basedir.la:
+ $(MAKE) -C $(top_builddir)/contrib/libxdg-basedir
install-data-hook:
@if test $$MAKELEVEL -le 4 ; then \
@@ -38,16 +41,6 @@ pass1:
pass2:
@$(MAKE) MULTIPASS_CFLAGS="$(PASS2_CFLAGS)"
-debug:
- @$(MAKE) CFLAGS="$(DEBUG_CFLAGS)"
-
-install-debug: debug
- @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
- @list='$(SUBDIRS)'; for subdir in $$list; do \
- (cd $$subdir && $(MAKE) $@) || exit; \
- done;
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
uninstall-hook:
@list='$(xineplug_LTLIBRARIES)'; for p in $$list; do \
p="`echo $$p | sed -e 's/\.la$$/\.so/g;s|^.*/||'`"; \
diff --git a/misc/Makefile.quiet b/misc/Makefile.quiet
new file mode 100644
index 000000000..8ee368920
--- /dev/null
+++ b/misc/Makefile.quiet
@@ -0,0 +1,2 @@
+GNU_VERBOSITY := $(if $(findstring GNU,$(shell $(MAKE) -v)),0,1)
+V ?= $(GNU_VERBOSITY)
diff --git a/misc/SlackBuild.in b/misc/SlackBuild.in
index d356a1766..118613c6a 100644
--- a/misc/SlackBuild.in
+++ b/misc/SlackBuild.in
@@ -27,7 +27,7 @@ EOF
#
do_descr() {
cat > package_descriptions << EOF
-@PACKAGE@: @PACKAGE@ @SPEC_VERSION@.
+@PACKAGE@: @PACKAGE@ @PACKAGE_VERSION@.
@PACKAGE@:
@PACKAGE@: xine-lib is the beating heart of xine (a free gpl-licensed
@PACKAGE@: video player for unix-like systems) which among others provides
@@ -53,12 +53,12 @@ do_build() {
cd $CWD
rm -rf $TMPBUILD
mkdir -p $TMPBUILD
- cd $TMPBUILD && tar -xzf $CWD/@TAR_NAME@.tar.gz
+ cd $TMPBUILD && tar -xzf $CWD/@PACKAGE_TARNAME@.tar.gz
do_install_sh;
- cd @TAR_NAME@
+ cd @PACKAGE_TARNAME@
DIE=1
- echo "./configure --prefix=$PREFIX $CONFIG_OPT && make && make install-strip DESTDIR=$PKG LIBRARY_PATH=$TMPBUILD/@TAR_NAME@/src/xine-engine/.libs" && \
- ./configure --prefix=$PREFIX $CONFIG_OPT && make && make install-strip DESTDIR=$PKG LIBRARY_PATH=$TMPBUILD/@TAR_NAME@/src/xine-engine/.libs && \
+ echo "./configure --prefix=$PREFIX $CONFIG_OPT && make && make install-strip DESTDIR=$PKG LIBRARY_PATH=$TMPBUILD/@PACKAGE_TARNAME@/src/xine-engine/.libs" && \
+ ./configure --prefix=$PREFIX $CONFIG_OPT && make && make install-strip DESTDIR=$PKG LIBRARY_PATH=$TMPBUILD/@PACKAGE_TARNAME@/src/xine-engine/.libs && \
mkdir -p $PKG/install && cp $TMPBUILD/doinst.sh $PKG/install && \
cd $PKG && \
echo "n" | /sbin/makepkg $PACKAGE && \
@@ -172,7 +172,7 @@ main() {
build_pentium
build_k6
build_k7
- mv -f $CWD/@TAR_NAME@.tar.gz $SLCK
+ mv -f $CWD/@PACKAGE_TARNAME@.tar.gz $SLCK
}
@@ -184,7 +184,7 @@ build_arch() {
mkdir -p $SLCK
rm -f config.cache && ./autogen.sh && make dist
$barch
- mv -f $CWD/@TAR_NAME@.tar.gz $SLCK
+ mv -f $CWD/@PACKAGE_TARNAME@.tar.gz $SLCK
}
case "$1" in
diff --git a/misc/build_rpms.sh.in b/misc/build_rpms.sh.in
index b3ec065b1..c3096e5f0 100644
--- a/misc/build_rpms.sh.in
+++ b/misc/build_rpms.sh.in
@@ -44,9 +44,9 @@ export XINE_BUILD=i586-pc-linux-gnu
eval $RPM_BA
-mv /usr/src/redhat/SRPMS/libxine-@SPEC_VERSION@-$DATE.src.rpm ./rpms/
-mv /usr/src/redhat/RPMS/i386/$PKGNAME-@SPEC_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@SPEC_VERSION@-$DATE.i586.rpm
-mv /usr/src/redhat/RPMS/i386/$PKGNAME-devel-@SPEC_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-devel-@SPEC_VERSION@-$DATE.i586.rpm
+mv /usr/src/redhat/SRPMS/libxine-@PACKAGE_VERSION@-$DATE.src.rpm ./rpms/
+mv /usr/src/redhat/RPMS/i386/$PKGNAME-@PACKAGE_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@PACKAGE_VERSION@-$DATE.i586.rpm
+mv /usr/src/redhat/RPMS/i386/$PKGNAME-devel-@PACKAGE_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-devel-@PACKAGE_VERSION@-$DATE.i586.rpm
echo "*****************************************************"
echo
@@ -61,7 +61,7 @@ export XINE_BUILD=i686-pc-linux-gnu
eval $RPM_BB
-mv /usr/src/redhat/RPMS/i386/$PKGNAME-@SPEC_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@SPEC_VERSION@-$DATE.i686.rpm
+mv /usr/src/redhat/RPMS/i386/$PKGNAME-@PACKAGE_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@PACKAGE_VERSION@-$DATE.i686.rpm
echo "*****************************************************"
echo
@@ -76,7 +76,7 @@ export XINE_BUILD=k6-pc-linux-gnu
eval $RPM_BB
-mv /usr/src/redhat/RPMS/i386/$PKGNAME-@SPEC_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@SPEC_VERSION@-$DATE.k6.rpm
+mv /usr/src/redhat/RPMS/i386/$PKGNAME-@PACKAGE_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@PACKAGE_VERSION@-$DATE.k6.rpm
echo "*****************************************************"
echo
@@ -91,6 +91,6 @@ export XINE_BUILD=athlon-pc-linux-gnu
eval $RPM_BB
-mv /usr/src/redhat/RPMS/i386/$PKGNAME-@SPEC_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@SPEC_VERSION@-$DATE.k7.rpm
+mv /usr/src/redhat/RPMS/i386/$PKGNAME-@PACKAGE_VERSION@-$DATE.i386.rpm ./rpms/$PKGNAME-@PACKAGE_VERSION@-$DATE.k7.rpm
echo "Done."
diff --git a/misc/fonts/Makefile.am b/misc/fonts/Makefile.am
deleted file mode 100644
index 2246db20d..000000000
--- a/misc/fonts/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-fontdir = $(XINE_FONTDIR)
-font_DATA = \
- cetus-16.xinefont.gz \
- cetus-20.xinefont.gz \
- cetus-24.xinefont.gz \
- cetus-32.xinefont.gz \
- cetus-48.xinefont.gz \
- cetus-64.xinefont.gz \
- cc-16.xinefont.gz \
- cc-20.xinefont.gz \
- cc-24.xinefont.gz \
- cc-32.xinefont.gz \
- cc-48.xinefont.gz \
- cc-64.xinefont.gz \
- cci-16.xinefont.gz \
- cci-20.xinefont.gz \
- cci-24.xinefont.gz \
- cci-32.xinefont.gz \
- cci-48.xinefont.gz \
- cci-64.xinefont.gz \
- mono-16.xinefont.gz \
- mono-20.xinefont.gz \
- mono-24.xinefont.gz \
- mono-32.xinefont.gz \
- mono-48.xinefont.gz \
- mono-64.xinefont.gz \
- sans-16.xinefont.gz \
- sans-20.xinefont.gz \
- sans-24.xinefont.gz \
- sans-32.xinefont.gz \
- sans-48.xinefont.gz \
- sans-64.xinefont.gz \
- serif-16.xinefont.gz \
- serif-20.xinefont.gz \
- serif-24.xinefont.gz \
- serif-32.xinefont.gz \
- serif-48.xinefont.gz \
- serif-64.xinefont.gz
-
-#
-# font used for osd
-#
-EXTRA_DIST = cetus.ttf README.cetus $(font_DATA)
diff --git a/misc/libxine.pc.in b/misc/libxine.pc.in
index 6c27f698d..cf5bf854e 100644
--- a/misc/libxine.pc.in
+++ b/misc/libxine.pc.in
@@ -21,7 +21,7 @@ xine_list=${bindir}/xine-list-@XINE_SERIES@@EXEEXT@
Name: libxine
Description: The xine engine library
Version: @XINE_MAJOR@.@XINE_MINOR@.@XINE_SUB@@XINE_PATCH@
-Requires:
+Requires.private: @XDG_BASEDIR_REQUIRES@
Libs: -L${libdir} -lxine
Libs.private: @ZLIB_LIBS@ @NET_LIBS@ @PTHREAD_LIBS@ @LIBICONV@ @RT_LIBS@
Cflags: -I${includedir}
diff --git a/misc/relchk.sh.in b/misc/relchk.sh.in
index 242a97486..09cce24b2 100644..100755
--- a/misc/relchk.sh.in
+++ b/misc/relchk.sh.in
@@ -4,7 +4,7 @@
##
topdir="`pwd`"
-distdir="@TAR_NAME@"
+distdir="@PACKAGE_TARNAME@"
log="$topdir/dist-log"
logerror="$topdir/dist-errors"
diff --git a/misc/xine-config.in b/misc/xine-config.in
index 700f1169c..3a3fd4b4d 100644
--- a/misc/xine-config.in
+++ b/misc/xine-config.in
@@ -16,6 +16,7 @@ usage()
{
cat <<EOF
Usage: xine-config [OPTIONS] [LIBRARIES]
+ DEPRECATED. Use pkg-config instead.
Options:
[--prefix[=DIR]]
[--exec-prefix[=DIR]]
@@ -76,6 +77,8 @@ while test $# -gt 0; do
shift
done
+echo 'xine-config is DEPRECATED. Use pkg-config instead.' >&2
+
exec pkg-config "${prefix+--define-variable=prefix=}$prefix" \
"${exec_prefix+--define-variable=exec_prefix=}$exec_prefix" \
$args libxine
diff --git a/misc/xine-lib.spec.in b/misc/xine-lib.spec.in
index 952c5e0d2..1874514e5 100644
--- a/misc/xine-lib.spec.in
+++ b/misc/xine-lib.spec.in
@@ -1,5 +1,5 @@
%define shortname libxine
-%define name libxine1
+%define name libxine2
%define version @SPEC_VERSION@
%define release 0
@@ -15,9 +15,6 @@
%if %{?BUILD_ALSA:0}%{!?BUILD_ALSA:1}
%define BUILD_ALSA 0
%endif
-%if %{?BUILD_ARTS:0}%{!?BUILD_ARTS:1}
-%define BUILD_ARTS 0
-%endif
%if %{?BUILD_DEVEL:0}%{!?BUILD_DEVEL:1}
%define BUILD_DEVEL 1
%endif
@@ -689,17 +686,11 @@ fi
%if %BUILD_STK
--with-libstk \
%endif
-%if %BUILD_ARTS
- --with-arts \
-%endif
--enable-syncfb --without-internal-vcdlibs
# Error in libfaad when compiling with mmx or sse enabled, remove it
-%{__mv} src/libfaad/Makefile src/libfaad/Makefile_save
-%{__cat} src/libfaad/Makefile_save | %{__sed} -e "s/-mmmx/-mno-mmx/g" -e "s/-msse/-mno-sse/g" > src/libfaad/Makefile
-# another problem with libavcodec
-%{__mv} src/libffmpeg/libavcodec/i386/Makefile src/libffmpeg/libavcodec/i386/Makefile_save
-%{__cat} src/libffmpeg/libavcodec/i386/Makefile_save | %{__sed} -e "s/-O3/-Os/g" -e "s/-O2/-Os/g" > src/libffmpeg/libavcodec/i386/Makefile
+%{__mv} contrib/libfaad/Makefile contrib/libfaad/Makefile_save
+%{__cat} contrib/libfaad/Makefile_save | %{__sed} -e "s/-mmmx/-mno-mmx/g" -e "s/-msse/-mno-sse/g" > contrib/libfaad/Makefile
%{__make} %{?jobs:-j%{jobs}}
@@ -739,14 +730,6 @@ echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_%{name}_alsa
%{__rm} ${RPM_BUILD_DIR}/filelist_%{name}_old
%endif
-%if %BUILD_ARTS
-echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_%{name}_arts
-%{__mv} ${RPM_BUILD_DIR}/filelist_%{name} ${RPM_BUILD_DIR}/filelist_%{name}_old
-%{__grep} "xineplug_ao_out_arts\." ${RPM_BUILD_DIR}/filelist_%{name}_old | %{__cat} - >> ${RPM_BUILD_DIR}/filelist_%{name}_arts
-%{__grep} -v "xineplug_ao_out_arts\." ${RPM_BUILD_DIR}/filelist_%{name}_old | %{__cat} - > ${RPM_BUILD_DIR}/filelist_%{name}
-%{__rm} ${RPM_BUILD_DIR}/filelist_%{name}_old
-%endif
-
%if %BUILD_ESD
echo "%defattr(-,root,root)" > ${RPM_BUILD_DIR}/filelist_%{name}_esd
%{__mv} ${RPM_BUILD_DIR}/filelist_%{name} ${RPM_BUILD_DIR}/filelist_%{name}_old
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 228cf540d..be57d979c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,9 +1,10 @@
# For updating this file, look at the result of:
-# head -n 3 po/POTFILES.in > /tmp/POTFILES.in && grep -l '[^A-Za-z_]_(' . -r --include '*.[chy]' --exclude xineintl.h | sed -e 's:^\./::' >> /tmp/POTFILES.in && cp /tmp/POTFILES.in po/
+# head -n 3 po/POTFILES.in > /tmp/POTFILES.in && grep -l '[^A-Za-z_]_(' . -r --include '*.[chy]' --exclude xineintl.h | sed -e 's:^\./::' | sort >> /tmp/POTFILES.in && cp /tmp/POTFILES.in po/
+contrib/libmpcdec/requant.c
+contrib/libmpcdec/synth_filter.c
lib/hstrerror.c
src/audio_out/audio_alsa_out.c
-src/audio_out/audio_arts_out.c
src/audio_out/audio_coreaudio_out.c
src/audio_out/audio_directx2_out.c
src/audio_out/audio_directx_out.c
@@ -15,10 +16,7 @@ src/audio_out/audio_none_out.c
src/audio_out/audio_oss_out.c
src/audio_out/audio_pulse_out.c
src/audio_out/audio_sun_out.c
-src/combined/ffmpeg/ff_audio_decoder.c
-src/combined/ffmpeg/ff_dvaudio_decoder.c
-src/combined/ffmpeg/ff_video_decoder.c
-src/combined/ffmpeg/ffmpeg_encoder.c
+src/combined/xine_ogg_demuxer.c
src/demuxers/demux_asf.c
src/demuxers/demux_avi.c
src/demuxers/demux_film.c
@@ -27,14 +25,13 @@ src/demuxers/demux_iff.c
src/demuxers/demux_mpc.c
src/demuxers/demux_mpeg_block.c
src/demuxers/demux_mpeg_pes.c
-src/demuxers/demux_ogg.c
src/demuxers/demux_snd.c
src/demuxers/demux_tta.c
src/demuxers/demux_voc.c
src/demuxers/demux_wc3movie.c
-src/dxr3/dxr3.h
src/dxr3/dxr3_decode_spu.c
src/dxr3/dxr3_decode_video.c
+src/dxr3/dxr3.h
src/dxr3/dxr3_mpeg_encoders.c
src/dxr3/dxr3_scr.c
src/dxr3/video_out_dxr3.c
@@ -65,23 +62,24 @@ src/input/vcd/vcdio.c
src/input/vcd/vcdplayer.c
src/input/vcd/vcdplayer.h
src/input/vcd/xineplug_inp_vcd.c
-src/liba52/xine_a52_decoder.c
-src/libdts/xine_dts_decoder.c
-src/libfaad/xine_faad_decoder.c
-src/libmusepack/requant.c
-src/libmusepack/synth_filter.c
-src/libmusepack/xine_musepack_decoder.c
+src/combined/ffmpeg/ff_audio_decoder.c
+src/audio_dec/ff_dvaudio_decoder.c
+src/dxr3/ffmpeg_encoder.c
+src/combined/ffmpeg/ff_video_decoder.c
src/libreal/real_common.c
-src/libreal/xine_real_video_decoder.c
src/libreal/xine_real_audio_decoder.c
-src/libspucc/xine_cc_decoder.c
-src/libspucmml/xine_cmml_decoder.c
-src/libspudvb/xine_spudvb_decoder.c
-src/libsputext/demux_sputext.c
-src/libsputext/xine_sputext_decoder.c
+src/libreal/xine_real_video_decoder.c
+src/spu_dec/xine_cc_decoder.c
+src/spu_dec/cmml_decoder.c
+src/spu_dec/sputext_demuxer.c
+src/spu_dec/sputext_decoder.c
src/libw32dll/common.c
src/libw32dll/w32codec.c
-src/libxinevdec/bitplane.c
+src/audio_dec/xine_a52_decoder.c
+src/audio_dec/xine_dts_decoder.c
+src/audio_dec/xine_faad_decoder.c
+src/audio_dec/xine_musepack_decoder.c
+src/video_dec/bitplane.c
src/post/audio/stretch.c
src/post/audio/upmix.c
src/post/audio/upmix_mono.c
@@ -92,12 +90,14 @@ src/post/mosaico/mosaico.c
src/post/mosaico/switch.c
src/post/planar/boxblur.c
src/post/planar/denoise3d.c
-src/post/planar/eq.c
src/post/planar/eq2.c
+src/post/planar/eq.c
src/post/planar/expand.c
src/post/planar/noise.c
src/post/planar/pp.c
src/post/planar/unsharp.c
+src/vdr/input_vdr.c
+src/vdr/post_vdr_video.c
src/video_out/video_out_aa.c
src/video_out/video_out_caca.c
src/video_out/video_out_directfb.c
@@ -109,7 +109,6 @@ src/video_out/video_out_pgx32.c
src/video_out/video_out_pgx64.c
src/video_out/video_out_sdl.c
src/video_out/video_out_stk.c
-src/video_out/video_out_syncfb.c
src/video_out/video_out_vidix.c
src/video_out/video_out_xcbshm.c
src/video_out/video_out_xcbxv.c
@@ -131,6 +130,7 @@ src/xine-engine/input_rip.c
src/xine-engine/io_helper.c
src/xine-engine/load_plugins.c
src/xine-engine/osd.c
+src/xine-engine/spu.c
src/xine-engine/video_decoder.c
src/xine-engine/video_out.c
src/xine-engine/vo_scale.c
diff --git a/po/cs.po b/po/cs.po
index aac1286b9..b66c7e0db 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: xine-lib 1.1.18\n"
+"Project-Id-Version: xine-lib 1.0.1\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
-"PO-Revision-Date: 2010-10-10 01:06+0200\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
+"PO-Revision-Date: 2008-11-10 16:33+0200\n"
"Last-Translator: František Dvořák <valtri@civ.zcu.cz>\n"
"Language-Team: Czech <cs@li.org>\n"
"Language: cs\n"
@@ -318,200 +318,196 @@ msgstr ""
"ke změně hlasitosti použije xine toto zařízení mixeru ALSA.\n"
"Informace o zařízeních ALSA naleznete v dokumentaci k ALSA."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr "výstupní zvukový modul xine použije zvuková zařízení/ovladaÄe alsa"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "modul zvukového výstupu xine použije artsd"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "modul zvukového výstupu xine pro Coreaudio/Mac OS X"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Chyba"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "úspěch"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "přístup odepřen"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "zdroj je již používán"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "objekt již byl inicializován"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "uvedený wave formát není podporován"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "paměťový buffer byl ztracen a musí být obnoven"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "požadované řízení bufferu není k dispozici"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "neurÄená chyba uvnitÅ™ subsystému DirectSound"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "hardwarové zařízení DirectSound není k dispozici"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "pro stávající stav objektu není funkce platná"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "byl předán neplatný parametr"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "objekt nepodporuje agregaci"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "není k dispozici žádný zvukový ovladaÄ k použití"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "požadované COM rozhraní není k dispozici"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "jiná aplikace má vyšší úroveň priority"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "nedostatek paměti"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "pro tuto funkci nízká úroveň priority"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound nebyl inicializován"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "funkce není podporována"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "neznámá chyba"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Nepodařilo se vytvořit objekt direct sound."
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr "Nelze nastavit kooperativní úroveň direct sound."
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "Nepodařilo se vytvořit sekundární buffer direct sound"
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "Nelze přehrát zvukový buffer"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "Nelze zastavit zvukový buffer"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "Nelze získat pozici bufferu"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "Nelze nastavit pozici bufferu"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "Nelze nastavit hlasitost zvuku"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": buffer ztracen, zkusí se obnovit\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "Nešlo zamknou buffer direct sound"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "Nešlo odemknout buffer direct sound"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "Nepodařilo se vytvořit primární buffer direct sound."
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
": kurzor přehrávání se předběhl (data %u, min %u), resetování bufferů\n"
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": nelze vytvořit pthread condition: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": nelze vytvořit pthread mutex: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": nelze vytvořit vlákno bufferu: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": nelze zlikvidovat vlákno bufferu: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ": nelze zlikvidovat pthread condition: %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": nelze zlikvidovat pthread mutex: %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ": neznámý řídicí příkaz: %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "druhý modul zvukového výstupu xine používající DirectX"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "modul zvukového výstupu xine pro win32 používající directx"
@@ -544,11 +540,11 @@ msgstr ""
"zadáním pevného posunu.\n"
"Jednotka hodnoty je jeden tik PTS, což je 1/90000 sekundy."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "modul zvukového výstupu xine použije esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "modul zvukového výstupu xine do souboru"
@@ -587,7 +583,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "modul zvukového výstupu xine pro JACK Audio Connection Kit"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "fiktivní modul zvukového výstupu xine"
@@ -793,7 +789,7 @@ msgstr ""
"Rozsah této hodnoty je -1 nebo 0-15. Toto nastavení je ignorováno, pokud je "
"jméno zvukového zařízení OSS nastaveno na \"auto\"."
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: open() mixer %s selhalo: %s\n"
@@ -810,20 +806,20 @@ msgstr "zařízení použité pro pulseaudio"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr "pro nastavení jímacího zařízení pulseaudia použijte '[server[:sink]]'"
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "modul zvukového výstupu xine použije server pulseaudio"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: otevírání zvukového zařízení %s selhalo: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "jméno zvukového zařízení Sun"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -836,197 +832,30 @@ msgstr ""
"obsahem. A tak by jste si měli být jisti, že hodnota, kterou zadáváte, je "
"skuteÄnÄ› náležité zvukové zařízení Sun."
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: zvukové ioctl na zařízení %s selhalo: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr "výstupní zvukový modul použije zvuková zařízení/ovladaÄe sun"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: zvÄ›tÅ¡ení bufferu na %d, aby se pÅ™edeÅ¡lo pÅ™eteÄení.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr "ffmpeg_audio_dec: nelze nalézt dekodér ffmpeg pro buffer typu 0x%X\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: pokus o otevření kodeku null\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: nelze otevřít dekodér\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: nelze otevřít dekodér\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "dvaudio: zvÄ›tÅ¡ení bufferu na %d, aby se pÅ™edeÅ¡lo pÅ™eteÄení.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: nepodporovaný formát, DR1 zakázáno.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: nepodporované rozměry snímku, DR1 zakázáno.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr "ffmpeg_video_dec: nelze nalézt dekodér ffmpeg pro buffer typu 0x%X\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: nelze otevřít dekodér\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: nelze otevřít dekodér (2. průchod)\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: přímé renderování povoleno\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_video_dec: zvÄ›tÅ¡ení bufferu na %d, aby se pÅ™edeÅ¡lo pÅ™eteÄení.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "kvalita dodateÄného zpracování MPEG-4"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-"Můžete pÅ™izpůsobit množství dodateÄného zpracování použitého na video "
-"MPEG-4.\n"
-"Vyšší hodnoty mají za následek lepší kvalitu, ale více zatíží CPU. Menší "
-"hodnoty mohou mít za následek defekty v obrázku, např. blokové artefakty. "
-"Pro vysokou kvalitu videa může příliÅ¡ silné dodateÄné zpracování způsobit "
-"horší obraz tím, že ho více rozmaže."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr "PoÄet vláken na dekódování videa FFmpegem"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Můžete upravit poÄet vláken dekódující video, které má FFmpeg používat.\n"
-"Vyšší hodnoty by měly urychlit dekódování, ale záleží také na tom, jestli "
-"daný kodek podporuje paralelní dekódování. Zpravidla je dobré mít jedno "
-"dekódovací vlákno na jeden logický procesor (typicky od 1 do 4).\n"
-"Změna tohoto nastavení se projeví při přehrávání následujícího videa."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr "PÅ™eskakování filtru ve smyÄce"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Můžete řídit, pro které snímky by mÄ›l být po dekódování pÅ™eskoÄen filtr ve "
-"smyÄce.\n"
-"PÅ™eskakování filtru ve smyÄce urychlí dekódování, ale může vést k "
-"artefaktům. PoÄet pÅ™eskoÄených snímků je od 'none' (žádné) po "
-"'all' (všechny).Výchozí hodnota ponechává rozhodnutí na implementaci.\n"
-"Změna tohoto nastavení se projeví při přehrávání následujícího videa."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr "Upřednostnit rychlost před vyhověním specifikacím"
-
-# "zneuctívají specifikace kodeku" ;-)
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Můžete chtít umožnit rychlostní cheaty, které porušují specifikace kodeku.\n"
-"Cheaty mohou urychlit dekódování, ale také vedou k dekódovacím artefaktům.\n"
-"Změna tohoto nastavení se projeví při přehrávání následujícího videa."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "výstupní rychlost mpegu libavcodec (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-"Bitová rychlost knihovny libavcodec kódující mpeg, jaká by se měla používat "
-"v režimu kódování DXR3. Vyšší hodnoty zvýší využití procesoru a kvalitu.\n"
-"Toto nastavení je uvažováno pouze, když je zakázán režim konstantní kvality."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "režim konstantní kvality"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-"Když bude povoleno, libavcodec použije režim konstantní kvality dynamickou "
-"kompresí obrázků na základě jejich složitosti. Když bude zakázáno, "
-"libavcodec použije režim konstantní bitové rychlosti."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "minimální komprese"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-"Minimální komprese, která se použije na obraz v režimu konstantní kvality."
+"ogg: zjiÅ¡tÄ›na zvuková stopa vorbis, ale nenalezena žádná hlaviÄka dat "
+"vorbis.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr "Maximální kvantizér"
+#: src/combined/xine_ogg_demuxer.c:2173
+#, fuzzy
+msgid "Annodex demux plugin"
+msgstr "xine: nalezen demultiplexní modul: %s\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
-"Maximální komprese, která se použije na obraz v režimu konstantní kvality."
#: src/demuxers/demux_asf.c:450
#, c-format
@@ -1046,6 +875,10 @@ msgstr "demux_asf: varování: Proud dat Äíslo %d je zaÅ¡ifrovaný.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Proud dat je zamíchán/zašifrován"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Obnovuje se index..."
@@ -1067,16 +900,24 @@ msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
"demux_avi: selhalo nastavení pozice na další data (pozice %<PRIdMAX>)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "neplatná velikost datového bloku FILM\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "nerozpoznaný datový blok FILM\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1092,6 +933,11 @@ msgstr "v tomto souboru žádné video ani zvuk\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr "hlaviÄka posloupnosti příliÅ¡ veliká (%u bytů)!\n"
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "Vstupní modul pro video CD"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1107,12 +953,20 @@ msgstr "iff-ilbm: neznámá komprese: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: neznámý datový blok: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr "demux_mpc: snímek příliš velký do bufferu"
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1121,20 +975,20 @@ msgstr ""
"xine-lib:demux_mpeg_block: Nerozpoznané stream_id 0x%02x. Prosím oznamte to "
"vývojářům xine.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
"demux_mpeg_block: Chyba! Uvolní se. Prosím oznamte to vývojářům xine.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: varování: 10 rezervovaných bitů hlaviÄky PES nenalezeno\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1143,7 +997,11 @@ msgstr ""
"demux_mpeg_block: varování: hlaviÄka PES indikuje, že tyto data mohou být "
"zašifrována (šifrovací mód: %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1152,18 +1010,18 @@ msgstr ""
"xine-lib:demux_mpeg_pes: Nerozpoznané stream_id 0x%02x. Prosím oznamte to "
"vývojářům xine.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr "demux_mpeg_pes: varování: selhalo dekódování sekvence PACK id=0x%x.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_pes: varování: 10 rezervovaných bitů hlaviÄky PES nenalezeno\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1172,7 +1030,7 @@ msgstr ""
"demux_mpeg_pes: varování: hlaviÄka PES indikuje, že tyto data mohou být "
"zašifrována (šifrovací mód: %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1181,12 +1039,9 @@ msgstr ""
"demux_mpeg_pes: Nerozpoznaný soukromý proud dat 1 0x%02x. Prosím oznamte to "
"vývojářům xine.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
-"ogg: zjiÅ¡tÄ›na zvuková stopa vorbis, ale nenalezena žádná hlaviÄka dat "
-"vorbis.\n"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1198,11 +1053,21 @@ msgstr "demux_snd: Å¡patné parametry hlaviÄky\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: nepodporovaný typ zvuku: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "modul pro vstup ze souboru"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr "demux_tta: celkový poÄet snímků příliÅ¡ velký\n"
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: nalezen demultiplexní modul: %s\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1214,6 +1079,11 @@ msgid ""
"unknown VOC compression type (0x%02X); please report to xine developers\n"
msgstr "neznámý typ komprese VOC (0x%02X); prosím oznamte vývojářům xine\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "modul pro vstup ze souboru"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1225,38 +1095,42 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr "demux_wc3movie: Byl zde problém bÄ›hem naÄítání datových bloků palety\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "Číslo zařízení DXR3"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-"Jestliže máte ve vaÅ¡em poÄítaÄi více než jednu DXR3, můžete uvézt, kterou z "
-"nich zde použít."
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: Selhalo otevření zařízení titulků %s (%s)\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "požadované tlaÄítko není k dispozici\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr "dxr3_decode_video: Selhalo otevření řídícího zařízení %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "použít informaci Pan & Scan"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1286,11 +1160,11 @@ msgstr ""
"způsobí, že se použije Active Format Descriptor (AFD) používaný některými "
"Evropskými kanály."
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "Zkusit synchronizovat video každý snímek"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1302,19 +1176,19 @@ msgstr ""
"nastavena pouze obÄas.\n"
"Toto je odůvodněné pouze pro postupné video (většina filmů PAL)."
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "použít hladký režim přehrávání"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "Povolením této volby se využije hladší režim přehrávání."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "opravovat dobu trvání snímků v porušených datových proudech"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1326,39 +1200,51 @@ msgstr ""
"NTSC streamy mylnÄ› oznaÄené jako PAL streamy. Povolte to pouze tehdy, když "
"se s takovými streamy setkáte."
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Selhalo otevření video zařízení %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: zápis do zařízení by blokoval. okamžité zapsání\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: zápis do video zařízení selhal (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: VAROVÃNÃ: neznámý kód rychlosti snímků %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
"dxr3_decode_video: VAROVÃNÃ: oprava kódu rychlosti snímků z PAL na NTSC\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "Číslo zařízení DXR3"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+"Jestliže máte ve vaÅ¡em poÄítaÄi více než jednu DXR3, můžete uvézt, kterou z "
+"nich zde použít."
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: selhala inicializace librte\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1366,21 +1252,21 @@ msgid ""
msgstr ""
"dxr3_mpeg_encoder: rte pracuje pouze s rozměry videa, které jsou násobky 16\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: selhalo získání kontextu rte.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: nešlo vytvořit kodek.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "výstupní rychlost rte mpeg (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
@@ -1388,26 +1274,26 @@ msgstr ""
"Bitová rychlost knihovny librte kódující mpeg, jaká by se měla používat v "
"režimu kódování DXR3. Vyšší hodnoty zvýší využití procesoru a kvalitu."
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: nelze inicializovat kontext: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: nelze zaÄít s kódováním: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: Nešlo spustit knihovnu FAME\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "kvalita kódování MPEG knihovny fame"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1429,11 +1315,15 @@ msgstr ""
"ÄasovaÄ unixového systému. Hodnoty vÄ›tší než 5 vynutí použití jako zdroj "
"synchronizace vnitřních hodin DXR3."
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "prohodit liché a sudé řádky"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1443,11 +1333,11 @@ msgstr ""
"Povolte tuto volbu pro média v jiném formátu než MPEG, které vytváří na "
"obrazovce vodorovné chvění."
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "upravit pomÄ›r stran pÅ™idáním Äerných pruhů"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
@@ -1455,31 +1345,31 @@ msgstr ""
"PÅ™idá Äerné pruhy, jestliže má obraz pomÄ›r stran, se kterým karta nemůže "
"pracovat přímo. Je to nutné k udržení patÅ™iÄných proporcí obrázku."
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr "pro kodér MPEG použít hladký režim přehrávání"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Povolením této volby se využije pro ne-MPEG obsah hladší režim přehrávání."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Selhalo otevření řídícího zařízení %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Selhalo otevření video zařízení %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "kodér pro ne-MPEG obsah"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1503,22 +1393,22 @@ msgstr ""
"\"fame\" a \"rte\" zde stále jsou, ale jejich podpora ve xine je zastaralá, "
"takže tyto by nemusely fungovat."
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr "video_out_dxr3: Selhala inicializace Mpeg kodéru.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: Selhala inicializace Mpeg kodéru rte.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: Selhala inicializace Mpeg kodéru fame.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1535,7 +1425,7 @@ msgstr ""
"video_out_dxr3: moci přehrávat ne-MPEG obsah. Detaily o konfiguraci kodéru\n"
"video_out_dxr3: viz README.dxr3.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1552,12 +1442,12 @@ msgstr ""
"video_out_dxr3: moci přehrávat ne-MPEG obsah. Detaily o konfiguraci kodéru\n"
"video_out_dxr3: viz README.dxr3.\n"
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "režim výstupu videa (TV nebo překrývaní)"
# TODO: dopřeložit
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1617,11 +1507,11 @@ msgstr ""
"switching to TV out by hiding the video window. This is the common variant "
"of DXR3 overlay."
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr "hodnota klíÄové barvy pÅ™ekrývání"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
@@ -1631,11 +1521,11 @@ msgstr ""
"Pokud při použití překryvného režimu DXR3 zjistíte, že se okna stávají "
"transparentní, můžete vyzkoušet jiné hodnoty."
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr "rozsah klíÄové barvy pÅ™ekrývání"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1647,11 +1537,11 @@ msgstr ""
"transparentní, můžete vyzkoušet nižší hodnoty. Ale při použití příliš "
"nízkého nastavení mohou mizet Äásti okrajů obrazu."
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "oříznout překrývanou oblast nahoře a dole"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1659,16 +1549,16 @@ msgstr ""
"Odstraní jeden bodový řádek z hořejšku a dolejšku překrývaného obrazu. Toto "
"povolte, pokud vidíte nahoře a dole zelené řádky."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: spusťte prosím autocal, překrývání zakázáno\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "přednost režimu TV"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1684,12 +1574,12 @@ msgstr ""
"pal60: PAL na 60Hz\n"
"default: zachovat nastavení karty"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: selhalo nastavení režimu videa.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1698,37 +1588,37 @@ msgstr ""
"video_out_dxr3: K přehrávání ne-MPEG videa na dxr3 potřebujete MPEG kodér\n"
"video_out_dxr3: Detaily viz README.dxr3.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: CHYBA Ätení souboru inicializace pÅ™ekrývání. SpusÅ¥te "
"autocal!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: http: nelze se připojit k %s:%d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: úspěšně připojeno k CDDB serveru '%s:%d'.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: nelze se připojit k CDDB serveru '%s:%d' (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "digitální zvukové CD (CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "zařízení použité pro zvukové CD"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1736,11 +1626,11 @@ msgstr ""
"Cesta k zeřízení, obvykle CD nebo DVD mechanika, které máte v úmyslu "
"používat k přehrávání zvukových CD."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "dotazovat se CDDB"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1754,11 +1644,11 @@ msgstr ""
"internetového serveru, který by pak mohl znát profil vašich poslechových "
"zvyků."
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "jméno serveru CDDB"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1771,37 +1661,21 @@ msgstr ""
"posílány informace o vašich poslechovích zvycích a také mohl by odpovídat na "
"dotazy zákeÅ™nými odpovÄ›Ämi. UjistÄ›te se, že serveru můžete důvěřovat."
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "port serveru CDDB"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
"Port serveru, který se použije, aby se z něj získávaly nadpisy a informace o "
"stopÄ›."
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "adresář se záznamy CDDB"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-"Odpovědi z CDDB serveru budou uchovávány v tomto adresáři.\n"
-"Toto nastavení je kritické s ohledem na bezpeÄnost, protože mohou být v "
-"tomto adresáři vytvářeny soubory s nekontrolovatelnými jmény. Ujistěte se, "
-"že daný adresář není používán pro nic jiného než cachování CDDB."
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "zpomalit diskovou jednotku na tento rychlostní faktor"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1815,57 +1689,57 @@ msgstr ""
"potřebné, a tak by nemělo zpomalení ovlivnit výkon přehrávání.\n"
"Hodnota nula zde zakáže zpomalování."
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: selhalo otevření souboru kanálu dvb '%s': %s\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: soubor kanálu dvb '%s' není běžný soubor\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: selhalo nastavení kanálu\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr "input_dvb: DVB rozhraní %s\n"
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: nelze otevřít zařízení dvb\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr "input_dvb: kanál %d mimo rozsah, použije se výchozí 0\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: hledání kanálu %s\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr "input_dvb: pÅ™esná shoda pro %s nenalezena: zkusí se ÄásteÄné shody\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: nalezen odpovídající kanál %s\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr "input_dvb: kanál %s nenalezen v channels.conf, použije se výchozí.\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
@@ -1873,12 +1747,12 @@ msgid ""
msgstr ""
"input_dvb: neplatná specifikace kanálu, použije se naposledy sledovaný\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr "input_dvb: neplatná specifikace kanálu, použije se výchozí kanál 0\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
@@ -1887,7 +1761,7 @@ msgstr ""
"input_dvb: bylo uvedeno MRL DVBS, ale nezdá se, že by tuner byl QPSK (DVB-"
"S)\n"
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1896,7 +1770,7 @@ msgstr ""
"input_dvb: bylo uvedeno MRL DVBT, ale nezdá se, že by byl tuner OFDM (DVB-"
"T)\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1904,7 +1778,7 @@ msgid ""
msgstr ""
"input_dvb: bylo uvedeno MRL DVBC, ale nezdá se, že by byl tuner QAM (DVB-C)\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1913,21 +1787,21 @@ msgstr ""
"input_dvb: bylo uvedeno MRL DVBA, ale nezdá se, že by byl tuner ATSC (DVB-"
"A)\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: nelze otevřít zařízení dvr '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_dvb: nelze vytvořit vlákno na aktualizace EPG\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr "použít 'středový výsek' DVB (zvětšení)"
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -1935,15 +1809,15 @@ msgstr ""
"Toto dovolí přehrát obsah 4:3 na celé obrazovce, který byl přenášen ve "
"formátu 16:9."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "vstupní modul DVB (digitální TV)"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr "Pamatovat si naposledy sledovaný kanál DVB"
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
@@ -1951,21 +1825,21 @@ msgstr ""
"Při automatickém přehrávání xine přepne na poslední kanál uvedený v media."
"dvb.last_channel."
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr "Naposledy sledovaný kanál DVB"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
"Pokud je povoleno, xine si bude pamatovat tento kanál a bude se na něj "
"automaticky přepínat."
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr "PoÄet sekund, než nechat ukonÄit ladÄ›ní."
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
@@ -1973,56 +1847,50 @@ msgstr ""
"Ponechání na 0 znamená zkouÅ¡et bez pÅ™estání. Více než 0 znamená Äekat na "
"získání zámku uvedený poÄet sekund. Minimum je 5 sekund."
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "PoÄet karet DVB, které se mají použít."
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-"Nechte to na nule, pokud opravdu nechcete ve vašem systému více než jednu "
-"kartu."
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr "Povolit rozhraní DVB"
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr "Povolí rozhraní DVB - nahrávání a přepínání kanálů řízené myší."
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr "KonfiguraÄní soubor kanálů DVB"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "PoÄet karet DVB, které se mají použít."
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-"KonfiguraÄní soubor kanálů DVB, který použít, místo ~/.xine/channels.conf."
+"Nechte to na nule, pokud opravdu nechcete ve vašem systému více než jednu "
+"kartu."
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
"input_dvd: values of \\beta will give rise to dom! (pět korun za překlad)\n"
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Chyba získání bloku z DVD (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: chyba otevírání zařízení DVD\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "zařízení použité pro přehrávání DVD"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -2030,11 +1898,11 @@ msgstr ""
"Cesta k zařízení, obvykle DVD mechanice, které chcete používat pro "
"přehrávání DVD."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "cesta k raw zařízení nastavenému pro přístup k DVD"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -2052,11 +1920,11 @@ msgstr ""
"použita pouze jednou.\n"
"Další informace viz dokumentace o raw zařízeních (man raw)."
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "metoda dešifrování CSS"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
@@ -2066,29 +1934,11 @@ msgstr ""
"chráněních proti kopírování. Pokud máte problémy s přehráváním zakódovaných "
"DVD, vyzkoušejte různé metody."
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr "cesta ke cache klíÄů titulů"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-"Protože crackování ochrany kopírování zaÅ¡ifrovaných DVD může být ÄasovÄ› "
-"celkem nároÄné, libdvdcss bude v tomto adresáři cachovat cracklé klíÄe.\n"
-"Toto nastavení je kritické s ohledem na bezpeÄnost, protože mohou být v "
-"tomto adresáři vytvářeny soubory s nekontrolovatelnými jmény. Ujistěte se, "
-"že daný adresář není kromÄ› cachování DVD klíÄů používán na nic jiného."
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "DVD pÅ™ehrávaÄ tvrdí, že je v oblasti (1 až 8)"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
@@ -2098,11 +1948,11 @@ msgstr ""
"na špatný kód oblasti. Nemá to nic dělat s kódem oblasti nastaveným v DVD "
"mechanikách, je to ÄistÄ› softwarové."
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "výchozí jazyk pro přehrávání DVD"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
@@ -2112,11 +1962,11 @@ msgstr ""
"bude podporovat, volby a zvukové stopy budou prezentovány v tomto jazyce.\n"
"Hodnotou musí být dva znaky jazykového kódu ISO639."
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "read-ahead cachování"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
@@ -2126,11 +1976,11 @@ msgstr ""
"To může vést na pomalých mechanikách ke škubavému přehrávání, ale na "
"rychlejších mechanikách to zlepší výsledek změny vrstvy DVD."
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "jednotka pro akci skoku"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -2162,11 +2012,11 @@ msgstr ""
"skip title\n"
"pÅ™eskoÄí DVD titul, což je stavební jednotka reprezentující celé DVD"
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "jednotka pro nastavení pozice"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -2190,11 +2040,11 @@ msgstr ""
"nastavování pozice se týká programu DVD, což je navigaÄní jednotka "
"reprezentující kapitolu souÄasného dÄ›jství"
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr "režim přehrávání, když je zadán titul nebo kapitola"
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -2219,38 +2069,38 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: chyba Ätení (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Přístup odepřen: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Soubor nenalezen >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Soubor prázdný: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "modul pro vstup ze souboru"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "poÄáteÄní umístÄ›ní pÅ™i procházení souborů"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr "ProhlížeÄ vybírající soubor k pÅ™ehrání zaÄne na tomto umístÄ›ní."
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "ukazovat skryté soubory"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
@@ -2258,91 +2108,91 @@ msgstr ""
"Pokud je povoleno, bude prohlížeÄ vybírající soubor k pÅ™ehrání ukazovat také "
"skryté soubory."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "vstupní modul gnome-vfs dodaný se xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: selhalo gethostbyname(%s): %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: chyba Ätení %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Připojuje se k HTTP serveru..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: neplatná odpovÄ›Ä http\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: přesměrování 3xx: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: stav http není 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: délka obsahu = %<PRIdMAX> bytů\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: buffer vyÄerpán po %d bytech"
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "vstupní modul http"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "HTTP proxy host"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "Hostitelské jméno HTTP proxy."
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "HTTP proxy port"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "Číslo portu HTTP proxy."
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "Uživatelské jméno HTTP proxy"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "Uživatelské jméno pro HTTP proxy."
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "Heslo HTTP proxy"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "Heslo pro HTTP proxy."
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr "Domény, pro které ignorovat HTTP proxy"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2353,15 +2203,15 @@ msgstr ""
"Pokud bude doménové jméno zaÄínat na '=', pak bude zpracováno pouze jako "
"hostitelské jméno (bude vyžadována rovnost celého jména)."
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "vstupní modul mms pro streamovaná data"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "šířka pásma sítě"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
@@ -2371,11 +2221,11 @@ msgstr ""
"případě, že streamovací servery poskytnou různé verze stejných dat s "
"rozdílnými požadavky na šířku pásma."
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "protokol MMS"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2383,76 +2233,76 @@ msgstr ""
"Vyberte protokol zapouzdřující MMS. TCP je lepší, ale za firewallem můžete "
"potřebovat HTTP."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: nelze zjistit adresu '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: nelze se připojit k '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "vstupní modul pro síť dodaný se xine"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "vstupní modul pnm pro streamovaná data"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: chyba vytváření souboru pvr (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: chyba otevírání souboru pvr (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: chyba Ätení (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: chyba otevírání zařízení %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: selhalo IVTV_IOC_G_CODEC, možná se změnilo API?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: selhalo IVTV_IOC_S_CODEC, možná se změnilo API?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "Vstupní modul WinTV-PVR 250/350"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "zařízení použité pro WinTV-PVR 250/350 (modul pvr)"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "Cesta k zařízení vaší karty WinTV."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "Vstupní modul WinTV-PVR 250/350"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2502,141 +2352,141 @@ msgstr "nelze se připojit k '%s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: ukonÄuje se Ätecí vlákno...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: Ätecí vlákno ukonÄeno\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Otevírání >soubor:%s port:%d rozhraní:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: nelze vytvořit nové vlákno (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "vstupní modul pro RTP a UDP dodaný se xine"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "vstupní modul rtsp pro streamovaná data"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "Vstupní modul CIFS/SMB založený na libsmbclient"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: nelze se posunout zpět! (%<PRIdMAX> < %<PRIdMAX>)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: selhalo otevření '%s'\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "vstupní modul pro data ze standardního vstupu"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Buffer podtekl..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Buffer přetekl..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Přizpůsobuje se..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Jméno tuneru nenalezeno\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "vstupní modul v4l tv"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "vstupní modul v4l rádio"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "zařízení videa v4l"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "Cesta k vašemu zařízení videa Video4Linux."
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
msgid "v4l ALSA audio input device"
msgstr "vstupní zvukové zařízení v4l ALSA"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "Název zvukového zařízení, které koresponduje s vaším Video4Linux."
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr "TV standard v4l"
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
"Vybírá televizní standard vstupního signálu. BuÄ AUTO, PAL, NTSC nebo SECAM."
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "vstupní modul v4l rádio"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "zařízení rádia v4l"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "Cesta k vašemu zařízení rádia Video4Linux."
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: Neplatné MRL. Použijte vcdo:/<stopa #>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: neplatná stopa %d (platný rozsah: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "Vstupní modul pro video CD"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "nelze otevřít %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: nelze otevřít %s: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "Vstupní modul pro video CD"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "zařízení použité pro přehrávání VCD"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
@@ -2644,12 +2494,12 @@ msgstr ""
"Cesta k zařízení, obvykle CD nebo DVD mechanika, se kterým zamýšlíte "
"přehrávat VideoCD."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: špatné MRL: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: nelze se připojit k '%s'\n"
@@ -2730,7 +2580,7 @@ msgstr "nepodporovaný protokol\n"
msgid "Buffering..."
msgstr "Nahrává se..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2739,12 +2589,12 @@ msgstr ""
"input_pnm: bÄ›hem Ätení proudu dat pÅ™iÅ¡la zpráva ze serveru:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: nelze se připojit k '%s'\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: selhalo nastavení proudu dat\n"
@@ -2793,40 +2643,40 @@ msgstr "byl předán parametr třídy null"
msgid "Invalid current entry type"
msgstr "Neplatný typ aktuální položky"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr "modul video CD s PBC a podporou: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "výbÄ›r nemá položku NÃVRAT"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr "VÃCHOZà vybráno, ale PBC není zapnuto."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "výbÄ›r nemá položku DALÅ Ã"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "výbÄ›r nemá položku PŘEDCHOZÃ"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Neznámý typ události: "
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "Výše uvedená zpráva má neznámou logovací úroveň vcdimageru"
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr "modul video CD s PBC a podporou: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr "výchozí typ VCD, který se použije na automatické přehrání"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
@@ -2834,11 +2684,11 @@ msgstr ""
"Jednotka přehrávání VCD, kterou použít, jestliže není žádná uvedena v MRL. "
"NapÅ™. vcd:// nebo vcd:///dev/dvd:"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr "výchozí zařízení CD-ROM použité pro VCD, jestliže není žádné zadáno"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
@@ -2846,28 +2696,28 @@ msgstr ""
"Co použít, jestliže není uvedeno zařízení. Jestliže je nastavení prázdné, "
"xine prozkoumá jednotky CD."
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr "rozsah ukazatele pozice VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr "Rozsah ukazatele pozice přehrávání přítomného při přehrávání."
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr "read-ahead cachování VCD?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr "Na slabších strojích může toto vést k trhanému přehrávání"
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr "automaticky postupovat po stopách nebo položkách VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
@@ -2875,11 +2725,11 @@ msgstr ""
"Jestliže je povoleno, měli bychom automaticky postoupit na další položku "
"nebo stopu. Použito pouze, když není zapnuta kontrola přehrávání (PBC)."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr "zobrazit 'odmítané' VCD LID?"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
@@ -2889,11 +2739,11 @@ msgstr ""
"nezobrazovaly. Ale pokud je nastavena tato volba, můžete je vidět v seznamu "
"MRL. Odmítané položky jsou oznaÄeny hvÄ›zdiÄkou (*) pÅ™idanou na konec MRL."
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr "VCD formát řetězce pro nápis na obrazovce"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2931,11 +2781,11 @@ msgstr ""
" Äíslo 1 až poÄet svazků\n"
" %% : %\n"
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr "formátovací řetězec VCD pro pole komentáře proudu dat"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2948,11 +2798,11 @@ msgstr ""
"Jejich význam viz nápověda k title_format."
# odvšivovací
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr "debugovací maska příznaků VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2982,96 +2832,201 @@ msgstr ""
"1024: nehybný snímek\n"
"2048: debugování z VCDINFO\n"
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "POMÓC! Zvukový ovladaÄ pouze mono?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: zvÄ›tÅ¡ení bufferu na %d, aby se pÅ™edeÅ¡lo pÅ™eteÄení.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "hlasitost A/52"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr "ffmpeg_audio_dec: nelze nalézt dekodér ffmpeg pro buffer typu 0x%X\n"
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: pokus o otevření kodeku null\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: nelze otevřít dekodér\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: nelze otevřít dekodér\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-"U zvuku A/52 můžete změnit hlasitost na úrovni dekódování. To má výhodu, že "
-"zvuk je již dekódován na specifikovanou hlasitost, takže pozdější operace "
-"jako smixovávání kanálů budou pracovat na zvukových datech dané hlasitosti."
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "povolit zhuštění dynamického rozsahu A/52"
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "dvaudio: zvÄ›tÅ¡ení bufferu na %d, aby se pÅ™edeÅ¡lo pÅ™eteÄení.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "vstupní modul v4l rádio"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "výstupní rychlost mpegu libavcodec (kbit/s)"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-"Zhuštění dynamického rozsahu omezí dynamický rozsah zvuku. To znamená, že "
-"hlasité zvuky se stanou tiššími a tiché zvuky hlasitějšími, a tak můžete "
-"lépe slyšet zvuk v hlasitém prostředí bez toho, abyste kohokoliv rušili."
+"Bitová rychlost knihovny libavcodec kódující mpeg, jaká by se měla používat "
+"v režimu kódování DXR3. Vyšší hodnoty zvýší využití procesoru a kvalitu.\n"
+"Toto nastavení je uvažováno pouze, když je zakázán režim konstantní kvality."
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "redukce zvuku do 2.0 surround stereo"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "režim konstantní kvality"
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-"Jestli chcete poslouchat vícekanálový surround zvuk, ale máte pouze dva "
-"reproduktory, surround dekodér nebo zesilovaÄ, který provádí nÄ›jaké maticové "
-"surround dekódování jako např. prologic, měli byste tuto volbu povolit. Pak "
-"budou dodateÄné kanály pÅ™imixovávány do stereo signálu."
+"Když bude povoleno, libavcodec použije režim konstantní kvality dynamickou "
+"kompresí obrázků na základě jejich složitosti. Když bude zakázáno, "
+"libavcodec použije režim konstantní bitové rychlosti."
-#: src/libfaad/xine_faad_decoder.c:136
-#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: selhala funkce NeAACDecOpen().\n"
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "minimální komprese"
-#: src/libfaad/xine_faad_decoder.c:145
-#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: selhala funkce NeAACDecInit2.\n"
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+"Minimální komprese, která se použije na obraz v režimu konstantní kvality."
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr "Maximální kvantizér"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+"Maximální komprese, která se použije na obraz v režimu konstantní kvality."
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: selhala funkce NeAACDecInit.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: nepodporovaný formát, DR1 zakázáno.\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr "libmusepack: selhalo mpc_demux_init\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: nepodporované rozměry snímku, DR1 zakázáno.\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr "libmusepack: mpc_streaminfo_read selhalo: %d\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr "ffmpeg_video_dec: nelze nalézt dekodér ffmpeg pro buffer typu 0x%X\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr "libmusepack: data po posledním snímku ignorována\n"
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: nelze otevřít dekodér\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:352
+#, fuzzy, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: nelze otevřít dekodér\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr "libmusepack: selhalo mpc_decoder_initialise\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: přímé renderování povoleno\n"
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr "libmusepack: selhalo mpc_decoder_decode: %d\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_video_dec: zvÄ›tÅ¡ení bufferu na %d, aby se pÅ™edeÅ¡lo pÅ™eteÄení.\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "kvalita dodateÄného zpracování MPEG-4"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"Můžete pÅ™izpůsobit množství dodateÄného zpracování použitého na video "
+"MPEG-4.\n"
+"Vyšší hodnoty mají za následek lepší kvalitu, ale více zatíží CPU. Menší "
+"hodnoty mohou mít za následek defekty v obrázku, např. blokové artefakty. "
+"Pro vysokou kvalitu videa může příliÅ¡ silné dodateÄné zpracování způsobit "
+"horší obraz tím, že ho více rozmaže."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr "PoÄet vláken na dekódování videa FFmpegem"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Můžete upravit poÄet vláken dekódující video, které má FFmpeg používat.\n"
+"Vyšší hodnoty by měly urychlit dekódování, ale záleží také na tom, jestli "
+"daný kodek podporuje paralelní dekódování. Zpravidla je dobré mít jedno "
+"dekódovací vlákno na jeden logický procesor (typicky od 1 do 4).\n"
+"Změna tohoto nastavení se projeví při přehrávání následujícího videa."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr "PÅ™eskakování filtru ve smyÄce"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Můžete řídit, pro které snímky by mÄ›l být po dekódování pÅ™eskoÄen filtr ve "
+"smyÄce.\n"
+"PÅ™eskakování filtru ve smyÄce urychlí dekódování, ale může vést k "
+"artefaktům. PoÄet pÅ™eskoÄených snímků je od 'none' (žádné) po "
+"'all' (všechny).Výchozí hodnota ponechává rozhodnutí na implementaci.\n"
+"Změna tohoto nastavení se projeví při přehrávání následujícího videa."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr "Upřednostnit rychlost před vyhověním specifikacím"
+
+# "zneuctívají specifikace kodeku" ;-)
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Můžete chtít umožnit rychlostní cheaty, které porušují specifikace kodeku.\n"
+"Cheaty mohou urychlit dekódování, ale také vedou k dekódovacím artefaktům.\n"
+"Změna tohoto nastavení se projeví při přehrávání následujícího videa."
#: src/libreal/real_common.c:139
msgid "path to RealPlayer codecs"
@@ -3091,11 +3046,6 @@ msgstr ""
"použije je pro vás k dekódování RealPlayer obsahu. Více informací, jak "
"nainstalovat kodeky, získáte z xine FAQ."
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr "libreal: Chyba hledání symbolů! (nekompatibilita verzí?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -3116,53 +3066,66 @@ msgstr "libareal: nastavení esence dekodéru selhalo, chybový kód: 0x%x\n"
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: jejda, real může mít více než 2 kanály?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr "libreal: Chyba hledání symbolů! (nekompatibilita verzí?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "zobrazovat skryté titulky v sekvencích MPEG-2"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
"Skryté titulky jsou titulky urÄené hlavnÄ› na pomoc sluchovÄ› postiženým."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "podoba skrytých titulků (popředí/pozadí)"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Vyberte váš oblíbený způsob vykreslování skrytých titulků."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "standardní font skrytých titulků"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Vyberte font pro normální text u skrytých titulků."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "font kurzívy skrytých titulků"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "Vyberte font pro text kurzívy u skrytých titulků."
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "velikost fontu skrytých titulků"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr "Vyberte velikost fontu pro text skrytých titulků."
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "přizpůsobení centrování skrytých titulků"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
@@ -3170,23 +3133,37 @@ msgstr ""
"Pokud je povoleno, skryté titulky budou umisťovány doprostřed jednotlivých "
"řádků."
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "velikost fontu skrytých titulků"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "font externích titulků"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr "vertikální posun titulků (vzhledem k velikosti okna)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "kódování titulků"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: nalezen demultiplexní modul: %s\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "výchozí doba zobrazení titulků v sekundách"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -3197,12 +3174,16 @@ msgstr ""
"bude mít za následek, že titulek bude vždy zobrazen tak dlouho, než se "
"objeví další."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "velikost titulků"
# FIXME: correct original?
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
@@ -3210,12 +3191,12 @@ msgstr ""
"Zde můžete upravit velikost titulků. Nastavení bude bráno relativně k "
"velikosti okna."
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "vertikální posun titulků"
# FIXME: correct original?
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
@@ -3223,29 +3204,28 @@ msgstr ""
"Můžete upravit svislou polohu titulků. Nastavení bude bráni relativně k "
"velikosti okna."
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "font titulků"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr "Font z adresáře fontů xine, který se použije na text s titulky."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
"Vnější font jako soubor (např. .ttf), který se použije na text s titulky."
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr "jestli použít vnější font freetype"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "kódování titulků"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3257,11 +3237,11 @@ msgstr ""
"znaky zobrazeny tak, jak oÄekáváte, zeptejte se toho, kdo titulky vytvářel, "
"jaké bylo použito kódování."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "používat OSD bez změn měřítka, je-li to možné"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3354,31 +3334,151 @@ msgstr "w32codec: Chyba inicializace DirectShow zvuku\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: Chyba inicializace DMO zvuku\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "modul zvukového výstupu xine do souboru"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "POMÓC! Zvukový ovladaÄ pouze mono?!\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "hlasitost A/52"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+"U zvuku A/52 můžete změnit hlasitost na úrovni dekódování. To má výhodu, že "
+"zvuk je již dekódován na specifikovanou hlasitost, takže pozdější operace "
+"jako smixovávání kanálů budou pracovat na zvukových datech dané hlasitosti."
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "povolit zhuštění dynamického rozsahu A/52"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+"Zhuštění dynamického rozsahu omezí dynamický rozsah zvuku. To znamená, že "
+"hlasité zvuky se stanou tiššími a tiché zvuky hlasitějšími, a tak můžete "
+"lépe slyšet zvuk v hlasitém prostředí bez toho, abyste kohokoliv rušili."
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "redukce zvuku do 2.0 surround stereo"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+"Jestli chcete poslouchat vícekanálový surround zvuk, ale máte pouze dva "
+"reproduktory, surround dekodér nebo zesilovaÄ, který provádí nÄ›jaké maticové "
+"surround dekódování jako např. prologic, měli byste tuto volbu povolit. Pak "
+"budou dodateÄné kanály pÅ™imixovávány do stereo signálu."
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: selhala funkce NeAACDecOpen().\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: selhala funkce NeAACDecInit2.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: selhala funkce NeAACDecInit.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, fuzzy, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr "libmusepack: selhalo mpc_decoder_initialise\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr "libmusepack: mpc_streaminfo_read selhalo: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr "libmusepack: data po posledním snímku ignorována\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr "libmusepack: selhalo mpc_decoder_initialise\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr "libmusepack: selhalo mpc_decoder_decode: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: chyba při provádění dekomprese ByteRun1\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: V tomto okamžiku není Anim Opt 1 podporován\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: V tomto okamžiku není Anim Opt 2 podporován\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: V tomto okamžiku není Anim ASCIIJ podporován\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: V tomto okamžiku není tento typ anim podporován\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3390,6 +3490,10 @@ msgstr ""
"napÅ™. použít tento filtr ke shlédnutí filmu v kratším Äase, než byl původnÄ› "
"natoÄen.\n"
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3408,6 +3512,10 @@ msgstr ""
"frontendu.\n"
"\n"
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3435,6 +3543,11 @@ msgstr[2] ": namixování jednoho kanálu z %d kanálů v původních datech.\n"
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ": zvukové zařízení nemá schopnost AO_CAP_MODE_STEREO.\n"
+#: src/post/audio/upmix_mono.c:346
+#, fuzzy
+msgid "converts Mono into Stereo"
+msgstr ": namixování Mono na Stereo.\n"
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3452,7 +3565,12 @@ msgstr ""
"na vyhlazení variací využitím standardního váženého průměru přes předchozí "
"vzorky.\n"
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
+#, fuzzy
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
"This plugin aims to provide deinterlacing mechanisms comparable to high "
@@ -3507,7 +3625,7 @@ msgid ""
"Deinterlacing methods: (Not all methods are available for all platforms)\n"
"\n"
msgstr ""
-"Zdokonalený modul tvtime/deinterlacer s detekcí \"pulldown\"\n"
+"Zdokonalený modul tvtime/deinterlacer s pulldown detekcí\n"
"Tento modul má za cíl poskytnout mechanizmy korekce prokládání srovnatelné s "
"vysoce kvalitními postupnými pÅ™ehrávaÄi DVD a takzvanými \"zdvojovaÄi řádek"
"\" (line-doublers) pro použití s poÄítaÄovými monitory, projektory a jinými "
@@ -3516,24 +3634,21 @@ msgstr ""
"Parametry\n"
"\n"
" Method: Vybrat metodu (algoritmus), kterou použít. Vysvětlení všech metod "
-"viz dále.\n"
+"je dále.\n"
"\n"
" Enabled: Povolit nebo zakázat modul.\n"
"\n"
-" Pulldown_error_wait: Zajistí, že před změnou filmového režimu zůstane typ "
-"vzorkování pro zadaný poÄet snímků stálý.\n"
-"\n"
" Pulldown: Vybrat detekÄní algoritmus 2-3 pulldown. Filmy s rychlostí 24 "
-"snímků/s, které se konvertují do NTSC, mohou být detekovány a inteligentně "
-"rekonstruovány do původních (neprokládaných) snímků.\n"
+"snímků/s, které byly konvertovány do NTSC mohou být detekovány a "
+"inteligentně rekonstruovány do původních (neprokládaných) snímků.\n"
"\n"
" Framerate_mode: Vybráním 'full' se bude korigovat prokládání každého "
"půlsnímku do unikátního snímku. Získá se tím televizní nebo i vyšší kvalita. "
-"Tato funkce úÄinnÄ› zdvojnásobí rychlost snímků, což zlepší plynulost. "
+"Tato funkce úÄinnÄ› zdvojnásobí rychlost snímků, což zlepší hladkost. "
"Poznamenejme však, že plných 59.94 snímků/s nelze dosáhnout s neupraveným "
"jádrem Linuxu 2.4 (to používá frekvenci pÅ™eruÅ¡ení ÄasovaÄe 100 Hz). NovÄ›jší "
-"jádra RedHatu a jádra 2.6 používají vyšší nastavení HZ (512, případně 1000) "
-"a měly fungovat dobře.\n"
+"jádra RedHatu a jádra 2.6 používají vyšší nastavení HZ (512 a 1000, v "
+"pořadí) a měly by v pohodě fungovat.\n"
"\n"
" Judder_correction: Je-li povoleno 2-3 pulldown a je detekován filmový "
"materiál, je možné omezit rychlost snímků na původní použitou rychlost (24 "
@@ -3541,7 +3656,7 @@ msgstr ""
"Äas bude souhlasit a eliminuje se chvÄ›ní.\n"
"\n"
" Use_progressive_frame_flag: Dobře nahrané streamy MPEG2 používají příznak "
-"indikující postupný materiál. Toto nastavení řídí, zda věříme Äi nevěříme "
+"k indikaci postupného materiálu. Toto nastavení řídí, zda věříme Äi nevěříme "
"tomuto příznaku (některé ojedinělé chybné streamy mpeg2 ho mají nastavený "
"špatně).\n"
"\n"
@@ -3563,16 +3678,24 @@ msgstr ""
"platformy)\n"
"\n"
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: Nejsou k dispozici žádné metody korekce prokládání, konec.\n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "snímků generovaných za sekundu"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3580,27 +3703,27 @@ msgstr ""
"S více snímky za sekundu bude animace hladší a rychlejší, ale také to bude "
"vyžadovat více výkonu CPU."
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr "šířka obrazu Goomu"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "Šířka generovaného obrazu v pixelech."
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr "výška obrazu Goomu"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "Výška generovaného obrazu v pixelech."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr "metoda konverze barev"
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
@@ -3608,7 +3731,11 @@ msgstr ""
"Můžete vybrat metodu konverze barevného prostoru použitou goomem.\n"
"Výběry k dispozici by měly být samovysvětlující."
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3628,7 +3755,12 @@ msgstr ""
" w: šířka obrazu\n"
" h: výška obrazu\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3658,6 +3790,10 @@ msgstr ""
"\n"
"* boxblur mplayeru (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3684,31 +3820,9 @@ msgstr ""
"\n"
"* denoise3d mplayeru (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
-"Softwarový ekvalizér s interaktivním ovládáním tak jako u hardwarového "
-"ekvalizéru pro karty, které nepodporují řízení jasu a kontrastu hardwarově.\n"
-"Parametry\n"
-" světlost\n"
-" kontrast\n"
-"\n"
-"Poznámka: K nastavení těchto parametrů je možné použít okno ovládání "
-"frontendů.\n"
-"\n"
-"* eq mplayeru (C) Richard Felker\n"
#: src/post/planar/eq2.c:361
msgid ""
@@ -3754,7 +3868,46 @@ msgstr ""
"\n"
"* eq2 mplayeru (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+"Softwarový ekvalizér s interaktivním ovládáním tak jako u hardwarového "
+"ekvalizéru pro karty, které nepodporují řízení jasu a kontrastu hardwarově.\n"
+"Parametry\n"
+" světlost\n"
+" kontrast\n"
+"\n"
+"Poznámka: K nastavení těchto parametrů je možné použít okno ovládání "
+"frontendů.\n"
+"\n"
+"* eq mplayeru (C) Richard Felker\n"
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3779,7 +3932,7 @@ msgstr ""
" Centre_cut_out_mode: vytáhne obraz 4:3 obsažený v 16:9\n"
"\n"
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3811,7 +3964,11 @@ msgstr ""
"\n"
"* noise mplayeru (C) Michael Niedermayer\n"
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3823,7 +3980,7 @@ msgstr ""
"Parametry\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3831,6 +3988,11 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+#, fuzzy
+msgid "plugin for ffmpeg libpostprocess"
+msgstr "použít modul divx4 pro sekvence msmpeg4v3"
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3883,11 +4045,126 @@ msgstr ""
"\n"
"* unsharp mplayeru (C) 2002 Rémi Guyomarch\n"
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_rip: selhalo nastavení pozice: %s\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ": nelze vytvořit pthread condition: %s\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: ukonÄuje se Ätecí vlákno...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, fuzzy, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "RTP: Ätecí vlákno ukonÄeno\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: ukonÄuje se Ätecí vlákno...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "RTP: Ätecí vlákno ukonÄeno\n"
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "stdin: selhalo otevření '%s'\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "stdin: selhalo otevření '%s'\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: nelze se připojit k '%s'\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: http: nelze se připojit k %s:%d\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "stdin: selhalo otevření '%s'\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: nelze vytvořit nové vlákno (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "výstupní modul videa xine použije knihovnu ascii-art"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "výstupní modul videa xine použije knihovnu Color AsCii Art"
@@ -3932,8 +4209,8 @@ msgid "video colour key"
msgstr "klíÄová barva videa"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -4017,31 +4294,31 @@ msgstr ""
"video_out_directfb: škálování obrazu s korekcí prokládání je hardwarově "
"urychlované.\n"
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr "ID vrstvy videa (auto: -1)"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr "Vybere vrstvu výstupu videa podle jeho ID."
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_directfb: použije se obrazová vrstva #%d.\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "výstupní modul videa xine použije DirectFB."
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
"video_out_directfb: žádná použitelná obrazová vrstva nebyla nalezena!\n"
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "výstupní modul videa xine použije DirectFB pod XDirectFB."
@@ -4058,11 +4335,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "výstupní modul videa xine pro win32 používající directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -4072,11 +4349,11 @@ msgstr ""
"(%d).\n"
" Zkontrolujte 'fbset -i' nebo zkuste 'fbset -depth 16'.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "jméno zařízení framebufferu"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -4089,21 +4366,20 @@ msgstr ""
"obsahem. A tak by jste si měli být jistí, že hodnota, kterou zadáváte, "
"skuteÄnÄ› je náležité zařízení framebufferu."
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out_fb: Váš videorežim nebyl rozpoznán, bohužel.\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: je k dispozici %d video RAM bufferů.\n"
-#: src/video_out/video_out_fb.c:956
-#, c-format
+#: src/video_out/video_out_fb.c:939
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
@@ -4112,40 +4388,42 @@ msgstr ""
" pouze %d bufferů, což je ménÄ› než doporuÄovaných %d bufferů.\n"
" Mohlo by pomoci snížení rozlišení bufferu.\n"
-#: src/video_out/video_out_fb.c:967
-#, c-format
+#: src/video_out/video_out_fb.c:950
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
"VAROVÃNÃ: video_out_fb: Buffery s nulami jsou ZAKÃZÃNY, protože ovladaÄ "
"jádra\n"
" nepodporuje \"screen panning\" (použito pro přepínání snímků).\n"
-#: src/video_out/video_out_fb.c:1036
-#, c-format
+#: src/video_out/video_out_fb.c:1019
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"VAROVÃNÃ: video_out_fb: souÄasná hloubka displeje je %d. Pro lepší výkon\n"
-" je doporuÄována hloubka 16 bitů/bod!\n"
+"\n"
+"\n"
+"VAROVÃNÃ: hloubka souÄasného displeje je %d. Pro lepší výkon\n"
+"je doporuÄována hloubka 16 bitů/bod!\n"
"\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr "výstupní modul videa xine použije zařízení framebuffer"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "výstupní modul videa xine, které nezobrazuje nic"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr "renderer OpenGL"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -4197,11 +4475,11 @@ msgstr ""
"Environment_Mapped_Torus\n"
"Zobrazuje obrázky odražené v otáÄejícím se anuloidu. Hezký způsob =)"
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr "minimální rychlost snímků OpenGL"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
@@ -4209,12 +4487,12 @@ msgstr ""
"Minimální rychlost snímků animaÄních renderovacích podprogramů.\n"
"Ignorováno u statických renderovacích podprogramů.\n"
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "povolit dvojité bufferování"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
@@ -4225,7 +4503,7 @@ msgstr ""
"ale také to velmi redukuje třepotání.\n"
"Nemělo by to mít žádný dopad na výkon."
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "výstupní modul videa xine používající OpenGL 3D grafické API"
@@ -4244,6 +4522,11 @@ msgstr "video_out_dxr3: Chyba: selhalo ioctl, špatné zařízení (%s)\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr "video_out_pgx32: Chyba: '%s' není zařízení framebufferu pgx32\n"
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr "výstupní modul videa xine použije libvidix pro linux frame buffer"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -4283,32 +4566,32 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr "video_out_pgx64: Chyba: nelze nastavit vlastnosti okna\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr "video_out_pgx64: Varování: málo videopaměti, multi-buffering zakázán\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Chyba: nedostatek videopaměti\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Varování: málo videopaměti, double-buffering zakázán\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Chyba: selhalo ioctl (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr "hodnota klíÄové barvy pÅ™ekrývání"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
@@ -4318,11 +4601,11 @@ msgstr ""
"zobrazit obraz videa. Pokud vidíte video zobrazované skrz jiná okna, "
"vyzkoušejte jiné hodnoty."
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr "povolit klíÄování barvou"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
@@ -4330,16 +4613,21 @@ msgstr ""
"RadÄ›ji kreslit grafiku OSD nahoÅ™e na klíÄové barvÄ› overlay než ji míchat do "
"každého snímku."
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "povolit multi-buffering"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr "Multi buffering zvýší výkon na úkor využití více grafické paměti."
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr "výstupní modul videa xine použije libvidix pro linux frame buffer"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "použít hardwarovou akceleraci videa, je-li k dispozici"
@@ -4364,133 +4652,40 @@ msgstr "SDL musí emulovat 16bitové povrchy, to vše zpomalí.\n"
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: celoobrazovkový režim NENà podporován\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "výstupní modul videa xine použije Simple Direct Media Layer"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
"výstupní modul videa xine použije knihovnu Libstk Surface Set-top Toolkit"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: chyba. (formát YUY2 není podporován vaší grafickou "
-"kartou)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: chyba. (formát YV12 není podporován vaší grafickou "
-"kartou)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: info. (modul SyncFB podporuje YUV 4:2:0 (3 roviny))\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: info. (modul SyncFB podporuje YUV 4:2:0 (2 roviny))\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr "video_out_syncfb: info. (modul SyncFB podporuje YUV 4:2:2)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: info. (modul SyncFB podporuje YUY2)\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: info. (modul SyncFB podporuje RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: ruší se. (modul SyncFB nepodporuje YV12, YUY2 ani RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: info. (nebude k dispozici řízení jasu a kontrastu, protože "
-"se zdá, že je váš modul jádra SyncFB zastaralý. Informace o tom, jak ho "
-"aktualizovat, získáte z README.syncfb.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "Výchozí poÄet opakování snímku"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr "Toto urÄuje, kolikrát po sobÄ› se bude jeden videosnímek zobrazovat."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"výstupní modul videa xine použije modul SyncFB pro karty Matrox G200/G400"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "Jméno zařízení SyncFB"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-"Specifikuje jméno souboru pro SyncFB (TeleTux), které se má použít.\n"
-"Toto nastavení je kritické s ohledem na bezpeÄnost, protože pÅ™i zmÄ›nÄ› na "
-"jiný soubor může být xine použito k vyplnění tohoto souboru libovolným "
-"obsahem. A tak by jste si měli být jisti, že hodnota, kterou zadáváte, je "
-"skuteÄnÄ› náležité zařízení framebufferu."
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "intenzita Äervené"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr "Intenzita Äervené barevné složky."
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "intenzita zelené"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr "Intenzita zelené barevné složky."
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "intenzita modré"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr "Intenzita modré barevné složky."
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
@@ -4500,81 +4695,85 @@ msgstr ""
"úplné obrazovky (\"vertikální zpětný běh paprsku\"). Toto eliminuje blikání "
"a trhané artefakty, ale bude použito více grafické paměti."
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: adaptér podporuje formát yuy2\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: adaptér podporuje formát yv12\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: Máte špatnou verzi knihovny VIDIX\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: Nelze nalézt fungující ovladaÄ VIDIX\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: použije se ovladaÄ: %s od %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "klíÄová barva pÅ™ekrývání videa Äervené složky"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "klíÄová barva pÅ™ekrývání videa zelené složky"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "klíÄová barva pÅ™ekrývání videa modré složky"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "výstupní modul videa xine použije libvidix pro X11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr "výstupní modul videa xine použije libvidix pro linux frame buffer"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-"video_out_xcbshm: %s: alokování obrázku\n"
-"video_out_xcbshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xcbshm.c:159
-#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
+#, fuzzy, c-format
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr "výstupní modul videa xine použije rozšíření MIT X shared memory"
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, fuzzy, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-"video_out_xcbshm: chyba sdílené paměti (chyba adresy) během alokování "
-"obrázku\n"
-"video_out_xcbshm: => rozšíření MIT Shared Memory se nepoužije.\n"
+"video_out_xshm: chyba sdílené paměti (chyba adresy) během alokování obrázku\n"
+"video_out_xshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-"video_out_xcbshm: chyba x11 během vytváření XImage ve sdílené paměti\n"
-"video_out_xcbshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4589,91 +4788,82 @@ msgstr ""
"je doporuÄována hloubka 16 bitů/bod!\n"
"\n"
-#: src/video_out/video_out_xcbshm.c:1114
-#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
+#, fuzzy, c-format
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-"video_out_xcbshm: Rozšíření MIT shared memory není na displeji přítomno.\n"
+"video_out_xshm: Rozšíření MIT shared memory není na displeji přítomno.\n"
-#: src/video_out/video_out_xcbshm.c:1213
-#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xcbshm: váš videorežim nebyl rozpoznán, bohužel :-(\n"
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
+#, fuzzy, c-format
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "video_out_fb: Váš videorežim nebyl rozpoznán, bohužel.\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr "výstupní modul videa xine použije rozšíření MIT X shared memory"
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-"video_out_xcbxv: funkce XvShmCreateImage vrátila nulovou velikost\n"
-"video_out_xcbxv: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-"video_out_xcbxv: chyba sdílené paměti v shmget: %s\n"
-"video_out_xcbxv: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-"video_out_xcbxv: chyba x11 během vytváření XImage\n"
-"video_out_xcbxv: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xcbxv.c:1358
-#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
-msgstr "video_out_xcbxv: Rozšíření Xv není přítomno.\n"
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
+#, fuzzy, c-format
+msgid "%s: Xv extension not present.\n"
+msgstr "video_out_xv: Rozšíření Xv není přítomno.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
-msgstr "%s: nepodařilo se otevřít Xv port %d - najde se automaticky\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
+msgstr "%s: nepodařilo se otevřít Xv port %lu - najde se automaticky\n"
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
-msgstr "%s: není k dispozici port typu \"%s\", použije se výchozí...\n"
+msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
-"video_out_xcbxv: Rozšíření Xv je přítomno, ale nepodařilo se nalézt "
-"použitelný port yuv12.\n"
+"video_out_xv: Rozšíření Xv je přítomno, ale nepodařilo se nalézt použitelný "
+"port yuv12.\n"
" Vypadá to, jako by váš grafický hardwarový ovladaÄ "
"nepodporoval Xv?!\n"
-#: src/video_out/video_out_xcbxv.c:1417
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1254
+#, fuzzy, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xcbxv: pro hardwarovou konverzi barevného prostoru a škálování se "
-"použije Xv port %d z adaptéru %s.\n"
+"video_out_xv: pro hardwarovou konverzi barevného prostoru a škálování se "
+"použije Xv port %ld z adaptéru %s.\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr "povolit synchronizaci s vblank"
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -4686,234 +4876,44 @@ msgstr ""
"\" a v kartě XVideo Settings vybrat, se kterým zařízením obrazovky "
"synchronizovat."
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xcbxv: tento adaptér podporuje formát yv12.\n"
-
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xcbxv: tento adaptér podporuje formát yuy2.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "metoda korekce prokládání (zavrženo)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-"Tato položka nastavení konfigurace je zavržena. Měli byste používat nové "
-"nastavení dodateÄné korekce prokládání.\n"
-"\n"
-"Ze starých Äasů analogové televize, kde by mÄ›ly být sudé a liché řádky "
-"zobrazovány v různých Äasech, pochází myÅ¡lenka zvýšit hladkost pohybu "
-"zaznamenáváním řádek v různých Äasech. Tomu se říká \"prokládání\". Ale "
-"naneÅ¡tÄ›stí, dneÅ¡ní zobrazovaÄe zobrazují vÅ¡echny sudé a liché řádky najednou "
-"jako jeden kompletní snímek (tzv. \"postupný zobrazovaÄ\"), což má za "
-"následek ošklivé chyby známé jako hřebenové artefakty. Softwarová korekce "
-"prokládání je způsob, jak redukovat tyto artefakty. Jednotlivé hodnoty "
-"jsou:\n"
-"\n"
-"none\n"
-"Zakáže softwarovou korekci prokládání.\n"
-"\n"
-"bob\n"
-"Interpoluje mezi řádky pohyblivých Äástí obrazu.\n"
-"\n"
-"weave\n"
-"Podobné jako bob, ale se snahou zachovat plné rozlišení, lepší u velkých "
-"detailů v ne moc pohyblivých scénách.\n"
-"\n"
-"greedy\n"
-"Velmi dobrý přizpůsobivý korektor prokládání, ale potřebuje velký výkon "
-"CPU.\n"
-"\n"
-"onefield\n"
-"Interpoluje vždy a redukuje svislé rozlišení.\n"
-"\n"
-"onefieldxv\n"
-"Stejné jako onefield, ale interpoluje hardwarově.\n"
-"\n"
-"linearblend\n"
-"K odstranění hřebenových artefaktů použije lehké rozmazání. Dobré výsledky "
-"se střední zátěží CPU."
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
+#, fuzzy, c-format
+msgid "%s: this adaptor supports the %s format.\n"
+msgstr "video_out_xv: tento adaptér podporuje formát yv12.\n"
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "výstupní modul videa xine použije rozšíření MIT X video"
-#: src/video_out/video_out_xshm.c:194
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-"video_out_xshm: chyba sdílené paměti během alokování obrázku\n"
-"video_out_xshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-#: src/video_out/video_out_xshm.c:210
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-"video_out_xshm: %s: alokování obrázku\n"
-"video_out_xshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: chyba sdílené paměti (chyba adresy) během alokování obrázku\n"
-"video_out_xshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: chyba x11 během vytváření XImage ve sdílené paměti\n"
-"video_out_xshm: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: Rozšíření MIT shared memory není na displeji přítomno.\n"
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: váš videorežim nebyl rozpoznán, bohužel :-(\n"
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: selhalo XvShmCreateImage\n"
-"video_out_xv: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: funkce XvShmCreateImage vrátila nulovou velikost\n"
-"video_out_xv: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xv.c:332
-#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: chyba sdílené paměti v shmget: %s\n"
-"video_out_xv: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: chyba x11 během vytváření XImage\n"
-"video_out_xv: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: Rozšíření Xv není přítomno.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr "%s: nepodařilo se otevřít Xv port %<PRId32> - vyhledá se automaticky\n"
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: Rozšíření Xv je přítomno, ale nepodařilo se nalézt použitelný "
-"port yuv12.\n"
-" Vypadá to, jako by váš grafický hardwarový ovladaÄ "
-"nepodporoval Xv?!\n"
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
+#, fuzzy, c-format
msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xv: pro hardwarovou konverzi barevného prostoru a škálování se "
"použije Xv port %ld z adaptéru %s.\n"
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje formát yv12.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje formát yuy2.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "výstupní modul videa xine použije X video rozšíření XvMC"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: rozšíření XvMC není přítomno.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -4922,7 +4922,7 @@ msgstr ""
"video_out_xvmc: rozšíření Xv je přítomno, ale nebyl nalezen použitelný port "
"yuv12\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -4931,104 +4931,35 @@ msgstr ""
"video_out_xvmc: pro hardwarovou konverzi barevného prostoru a škálování\n"
" se použije Xv port %ld z adaptéru %s\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " idct a akcelerace kompenzace pohybu\n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " pouze akcelerace kompenzace pohybu\n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " žádná podpora XvMC\n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " S Overlay = %d; UnsignedIntra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: selhalo XvShmCreateImage\n"
-"video_out_xxmc: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: funkce XvShmCreateImage vrátila nulovou velikost\n"
-"video_out_xxmc: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: chyba sdílené paměti v shmget: %s\n"
-"video_out_xxmc: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: chyba x11 během vytváření XImage ve sdílené paměti\n"
-"video_out_xxmc: => rozšíření MIT Shared Memory se nepoužije.\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xxmc: rozšíření Xv není přítomno.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xxmc: Rozšíření Xv je přítomno, ale nepodařilo se nalézt "
-"použitelný\n"
-" port yuv12.\n"
-" Vypadá to, jako by váš grafický hardwarový ovladaÄ\n"
-" nepodporoval Xv?!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xxmc: pro hardwarovou konverzi barevného prostoru a škálování se "
-"použije Xv port %ld z adaptéru %s.\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xxmc: tento adaptér podporuje formát yv12.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xxmc: tento adaptér podporuje formát yuy2.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "výstupní modul videa xine použije X video rozšíření XvMC"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr "PÅ™imÄ›t XvMC alokovat více snímků za úÄelem lepšího bufferování."
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
@@ -5038,11 +4969,11 @@ msgstr ""
"Tato volba, pokud je zapnuta, pÅ™imÄ›je ovladaÄ zkusit alokovat 15 snímků. "
"Nutnost pro unichrome a live VDR.\n"
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr "Šetření procesoru unichrome"
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
@@ -5052,11 +4983,11 @@ msgstr ""
"Pouze pro jádra Linuxu řady 2.6 nebo 2.4 s multimediálním patchem.\n"
"Experimentální.\n"
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr "Opravovat chybné barvy elementů XvMC"
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
@@ -5064,11 +4995,11 @@ msgstr ""
"V knihovnÄ› XvMC od NVidie je chyba, která způsobuje, že Äervené barvy OSD "
"vypadají modře a naopak. Tato volba umožňuje chybu obejít.\n"
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr "Použít 'bob' jako akcelerovanou metodu korekce prokládání."
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
@@ -5078,11 +5009,11 @@ msgstr ""
"snímků.\n"
# TODO
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr "Nepoužívat korekci prokládání bob pro postupné snímky."
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
@@ -5090,11 +5021,11 @@ msgstr ""
"Postupné snímky nepotřebují korekci prokládání, takže zakázat ji podle "
"potřeby by mělo vést k lepšímu zobrazení.\n"
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr "Nepoužívat korekci prokládání bob, pokud je aktivní škálované OSD"
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -5195,16 +5126,15 @@ msgstr ""
"(Platí jen při použití autodetekce portů Xv.)"
#: src/video_out/xv_common.h:81
+#, fuzzy
msgid "bicubic filtering"
-msgstr "bikubický filtr"
+msgstr "filtr mihotání"
#: src/video_out/xv_common.h:82
msgid ""
"This option controls bicubic filtering of the video image. It may be used "
"instead of, or as well as, xine's deinterlacers."
msgstr ""
-"Tato volba řídí bikubický filtr obrazu videa. Filtr může být použit spoleÄnÄ› "
-"s korekcemi prokládání, nebo jako jejich náhrada."
#: src/xine-engine/alphablend.c:2150
msgid "disable exact alpha blending of overlays"
@@ -5223,21 +5153,21 @@ msgstr ""
"Výsledkem bude, že alfa míchání overlayů bude méně přesné než předtím, ale "
"také se sníží využití procesoru."
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: není k dispozici žádný modul ke zpracování '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: chyba, neznámý typ bufferu: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "poÄet bufferů zvuku"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5247,7 +5177,7 @@ msgstr ""
"vnitřní frontě. Vyšší hodnoty znamenají hladší přehrávání u nespolehlivých "
"vstupů, ale také zvýšené zpoždění a spotřebu paměti."
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
@@ -5255,31 +5185,31 @@ msgstr ""
"audio_out: výpoÄet Äekání není možný, pokud není k dispozici zvukové "
"zařízení\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr "Zápis do zvukové karty selhal. Zařízení považováno za odpojené.\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "8 bitů není ovladaÄem podporováno, konvertuje se na 16 bitů.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "mono není ovladaÄem podporováno, konvertuje se na stereo.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "stereo není ovladaÄem podporováno, konvertuje se na mono.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "metoda synchronizace zvuku a videa"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -5320,11 +5250,11 @@ msgstr ""
"digital passthrough, kde jsou zvuková data posílána do vnějšího dekodéru v "
"digitální formě."
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr "povolit převzorkovávání"
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -5336,11 +5266,11 @@ msgstr ""
"\" (\"resampling\"). Zde můžete vybrat, zda je převzorkovávání povoleno, "
"zakázáno nebo použito automaticky v případě potřeby."
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr "vždy převzorkovat na danou frekvenci (0 zakáže)"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
@@ -5350,11 +5280,11 @@ msgstr ""
"Nastavením hodnoty jiné, než je nula, můžete vnutit převzorkovávání "
"zvukových dat na danou rychlost."
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr "posun pro digital passthrough"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
@@ -5364,11 +5294,11 @@ msgstr ""
"můžete zde zadat pevný posuv, který to bude kompenzovat.\n"
"Jednotka hodnoty je jeden tik PTS, což je 1/90000 sekundy."
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr "přehrávat zvuk i při pomalých a rychlých rychlostech"
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -5380,79 +5310,79 @@ msgstr ""
"Pokud chcete experimentovat se zachováním výšky, můžete vyzkoušet místo "
"tohoto modulu zvukový post modul 'stretch'."
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "hlasitost zvuku při startu"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "Celková úroveň hlasitosti při startu."
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "obnovit úroveň hlasitosti při startu"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"Pokud je zakázáno, xine nebude při spuštění měnit žádná nastavení mixeru."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"audio_out: Litujeme, toto by se nemělo přihodit. Prosím restartujte xine.\n"
# příliš mnoho svobody ;-)
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr "xine-lib: buffer.c: DoÅ¡lo k fatální chybÄ›: PŘÃLIÅ  MNOHO FREE\n"
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr "Stávající konfiguraÄní soubor byl upraven novÄ›jší verzí xine."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
-msgstr "NaÄtena konfigurace ze souboru '%s'\n"
+msgstr ""
-#: src/xine-engine/configfile.c:997
-#, c-format
+#: src/xine-engine/configfile.c:1011
+#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
-msgstr "Selhalo naÄtení konfigurace ze souboru '%s': %s\n"
+msgstr "input_dvb: selhalo otevření souboru kanálu dvb '%s': %s\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
"configfile: VAROVÃNÃ: zálohování konfiguraÄního souboru do %s selhalo\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: VAROVÃNÃ: vaÅ¡e konfigurace nebude uložena\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: VAROVÃNÃ: zápis konfigurace do %s selhal\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: VAROVÃNÃ: odstraní se pravdÄ›podobnÄ› poÅ¡kozený konfiguraÄní "
"soubor %s\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: VAROVÃNÃ: mÄ›li byste zkontrolovat záložní soubor %s\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: údaj '%s' nesmí být modifikován z MRL\n"
@@ -5468,58 +5398,58 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr "info_helper: nepodporovaná konverze %s -> UTF-8, nebude prováděna\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ": funkce open() by nikdy neměla být volána\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": vstupní modul není definován!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: Ätení uložených dat selhalo: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: Ätení vstupním modulem selhalo\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: chyba zápisu %<PRIdMAX> bytů do souboru: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: funkce open() by nikdy neměla být volána\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: selhalo nastavení pozice\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: selhalo nastavení pozice: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: zahozeno %<PRIdMAX> bytů\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: vstupní modul není definován!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -5528,7 +5458,7 @@ msgstr ""
"input_rip: cílový adresář nebyl specifikován, prosím vyplňte volbu 'misc."
"save_dir'\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5536,12 +5466,12 @@ msgstr ""
"Vlastnost ukládání dat je zakázána, dokud nenastavíte v konfiguraci 'misc."
"save_dir'."
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: ukládání z tohoto zdroje není povoleno!\n"
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
@@ -5549,51 +5479,51 @@ msgstr ""
"xine nemá dovoleno ukládat z tohoto zdroje (možná materiál chráněný "
"autorskými právy?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: nebyl dán název souboru!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: chyba otevírání souboru %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: Äekání ukonÄeno\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "io_helper: Äekání selhalo: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "selhalo získání stavu soketu"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Přístup odepřen\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Soubor nenalezen\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Spojení odmítnuto\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr "map_decoder_list: není prostor pro dekodér, pÅ™eskoÄen.\n"
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -5601,12 +5531,12 @@ msgstr ""
"load_plugins: ignoruje se zásuvný modul %s, nesprávná verze rozhraní %d "
"(měla by být %d)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "priorita dekodéru %s"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
@@ -5616,7 +5546,7 @@ msgstr ""
"zpracovávána více než jedním dekodérem.\n"
"Priorita 0 povoluje výchozí prioritu dekodéru."
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
@@ -5625,7 +5555,7 @@ msgstr ""
"load_plugins: demultiplexní modul %s neposkytuje prioritu, xine-lib použije "
"výchozí hodnotu.\n"
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -5634,43 +5564,43 @@ msgstr ""
"load_plugins: vstupní modul %s neposkytuje prioritu, xine-lib použije "
"výchozí hodnotu.\n"
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: nalezen modul %s\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: nalezen statický modul\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: dosažen limit poÄtu modulů, %s nemohl být nahrán\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
"load_plugins: dosažen limit poÄtu modulů, statický modul nemohl být nahrán\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: neznámý typ modulu %d v %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: neznámý typ %d staticky linkovaného modulu\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: nelze provést stat na %s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5679,7 +5609,7 @@ msgstr ""
"load_plugins: nelze otevřít knihovnu modulu %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5688,12 +5618,12 @@ msgstr ""
"load_plugins: nelze získat informace modulu z %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: pÅ™eskoÄí se adresář s moduly %s.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5702,42 +5632,47 @@ msgstr ""
"load_plugins: nelze (fáze 2) otevřít knihovnu modulu %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: Co?! %s neobsahuje informace modulu.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Nepodařilo se vytvořit objekt direct sound."
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
-msgstr "uložení do katalogu selhalo: %s\n"
+msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
-msgstr "nahrazení katalogu selhalo: %s\n"
+msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
-msgstr "smazání nového katalogu selhalo: %s\n"
+msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: neznámá strategie %d zjišťování obsahu\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: použije se demultiplexor '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: nelze naÄíst zvukový modul <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5746,7 +5681,7 @@ msgstr ""
"load_plugins: automatické testování zvukového výstupu nenašlo žádný "
"použitelný zvukový ovladaÄ.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5755,52 +5690,52 @@ msgstr ""
"load_plugins: nelze uvolnit knihovnu modulu %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "font '%s-%d' je již nahrán, divné.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "naÄítání fontu '%s' selhalo (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr "nesprávná verze u fontu '%s'. oÄekávána %d, nalezena %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: nelze inicializovat knihovnu ft2\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: chyba přiřazení fontu %s pomocí FontConfig"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: chyba naÄítání fontu %s pomocí FontConfig"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: chyba hledání fontu %s pomocí FontConfig"
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr "osd: chyba naÄítání fontu %s pomocí ft2\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: nelze inicializovat knihovnu ft2\n"
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr "osd: chyba při nastavování velikosti fontu (font není škálovatelný?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5809,46 +5744,46 @@ msgstr ""
"osd: neznámá sekvence zaÄínající bytem 0x%02X v kódování \"%s\", pÅ™eskoÄí "
"se\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: nelze zjistit aktuální kódovou stránku\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: nepodporovaná konverze %s -> %s, nebude prováděna\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: font není definován\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: chyba naÄítaní glyfu\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: chyba v renderování glyfu\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: chyba naÄítání glyfu %i\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: chyba při renderování\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "paleta (popředí-okraj-pozadí) použitá na titulky a OSD"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
@@ -5857,11 +5792,19 @@ msgstr ""
"Paleta on-screen-display a některých formátů titulků, které samy o sobě "
"nespecifikují žádnou barvu. Paleta je uvedena ve formě: popředí-okraj-pozadí."
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5876,21 +5819,21 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: není k dispozici žádný modul ke zpracování '%s'\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: chyba, neznámý typ bufferu: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "poÄet bufferů videa"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5901,13 +5844,13 @@ msgstr ""
"vstupů, ale také zvýšené zpoždění a spotřebu paměti."
# This message should match with FAQ_cs.
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d snímků pÅ™edaných, %d snímků pÅ™eskoÄených, %d snímků zahozených\n"
# This message should match with FAQ_cs.
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -5916,16 +5859,16 @@ msgstr ""
"video_out: zahození obrazu s pts %<PRId64>, protože je příliš starý "
"(rozdíl : %<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5941,11 +5884,11 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr "výchozí poÄet videosnímků"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
@@ -5953,11 +5896,11 @@ msgstr ""
"Výchozí poÄet videosnímků, který se bude žádat z videovýstupního ovladaÄe "
"xine. NÄ›které ovladaÄe použijí své vlastní hodnoty místo této."
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "procentní tolerance pÅ™eskoÄených snímků"
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
@@ -5965,11 +5908,11 @@ msgstr ""
"Pokud se nezobrazí více než toto procento snímků, protože nebyly vÄas "
"dekódovány, pošle xine hlášení."
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "procentní tolerance zahozených snímků"
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
@@ -5977,17 +5920,17 @@ msgstr ""
"Pokud se nezobrazí více než toto procento snímků, protože nebyly vÄas "
"naplánovány k zobrazení, pošle xine hlášení."
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: Litujeme, toto by se nemělo přihodit. Prosím restartujte xine.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "horizontální pozice obrazu ve výstupním okně videa"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5999,11 +5942,11 @@ msgstr ""
"Pozice se zde udává jako procento, takže hodnota 50 znamená \"uprostřed\", "
"zatímco 0 znamená \"co nejvíce vlevo\" a 100 \"co nejvíce vpravo\"."
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "vertikální pozice obrazu ve výstupním okně videa"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -6015,11 +5958,11 @@ msgstr ""
"takže hodnota 50 znamená \"uprostřed\", zatímco hodnota 0 znamená \"nahoře\" "
"a 100 \"dole\"."
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "zakázat veškeré změny měřítka"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -6037,149 +5980,149 @@ msgstr ""
"některými videovýstupy jako je XShm, kde není škálování obrazu hardwarově "
"urychlováno, může toto dramaticky snížit využití CPU."
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: chyba během zpracování MRL\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: nelze nalézt vstupní modul: %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: vstupní modul nemůže otevřít MRL [%s]\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: nelze nalézt vstupní modul pro MRL [%s]\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: selhalo spuštění demultiplexoru %s\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: připojen ripovací vstupní modul\n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: chyba otevírání instance ripovacího vstupního modulu\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: selhalo spuštění posledního vyzkoušeného demultiplexoru %s\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "ignoruje se video\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "ignoruje se zvuk\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "ignorují se titulky\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr "vstupní modul cache zakázán\n"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "otevřeno MRL titulků '%s'\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: chyba otevírání MRL titulků\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: chyba během zpracování MRL\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: změna volby '%s' z MRL není povolena\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr ""
"xine: nepodaÅ™ilo se naÄíst demultiplexor %s požadovaný vstupním modulem pro >"
"%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: nelze nalézt demultiplexor pro >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: nalezen demultiplexní modul: %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: demultiplexor již skonÄil. to bylo rychlé!\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: selhalo spuštění demultiplexoru\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: žádný dostupný demultiplexor\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: selhalo spuštění demultiplexoru\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
"xine: Uvedený adresář pro ukládání \"%s\" by mohl znamenat bezpeÄnostní "
"riziko.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr "Uvedený adresář pro ukládání by mohl znamenat bezpeÄnostní riziko."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: locale není podporováno knihovnou C\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "strategie zjišťování formátu dat"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -6210,11 +6153,11 @@ msgstr ""
"extension\n"
"Detekovat pouze podle přípony jména souboru.\n"
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "adresář pro ukládání dat"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -6230,11 +6173,11 @@ msgstr ""
"Proto byste si měli být jisti, že je v uvedeném adresáři bezproblémový "
"jakýkoliv obsah v jakémkoliv souboru."
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr "povolit implicitní změny v konfiguraci (např. pomocí MRL)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -6251,11 +6194,11 @@ msgstr ""
"dovolíte libovolnÄ› mÄ›nit vaÅ¡i konfiguraci, můžete skonÄit s úplnÄ› rozhozeným "
"xine."
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr "Timeout Ätení dat ze sítÄ› (v sekundách)"
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
@@ -6265,76 +6208,76 @@ msgstr ""
"by mohly přerušovat přehrávání, pokud je zdroj pomalý nebo je zabrané pásmo, "
"příliÅ¡ vysoké hodnoty zablokují pÅ™ehrávaÄ, pokud se ztratí spojení."
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "zprávy"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "modul"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "trasování"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Varování:"
# standarní hláška hstrerror
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "Neznámý host:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Neznámé zařízení: "
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Síť není dosažitelná"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Spojení odmítnuto:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "Soubor nenalezen:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Chyba Ätení z:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "Chyba naÄítání knihovny:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "Detekována šifrovaná multimediální data"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "BezpeÄnostní zpráva:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "Zvukové zařízení není k dispozici"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Chyba povolení přístupu"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "Soubor je prázdný:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "metoda memcpy použitá xine"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
@@ -6344,7 +6287,7 @@ msgstr ""
"dneÅ¡ních poÄítaÄích. Proto xine poskytuje různé vyladÄ›né metody, které "
"provádějí toto kopírování. Obvykle je nejlepší metoda zjišťována automaticky."
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Výkonnostní testování metod memcpy (menší je lepší):\n"
diff --git a/po/de.po b/po/de.po
index b2d1218d6..24eba95bc 100644
--- a/po/de.po
+++ b/po/de.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.1.6\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2007-04-18 11:00+0200\n"
"Last-Translator: Philipp Hahn <pmhahn@users.sf.net>\n"
"Language-Team: German <de@li.org>\n"
@@ -317,199 +317,195 @@ msgstr ""
"xine benutzt dieses ALSA Mixergerät, um die Lautstärke zu ändern.\n"
"Lesen Sie die ALSA-Dokumentation für Informationen zu ALSA-Geräten."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr "xine Soundausgabe benutzt ALSA-kompatibles Gerät/Treiber"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "xine Soundausgabe benutzt kde artsd"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "xine Soundausgabe benutzt Coreaudio/Mac OS X"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Fehler"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "Erfolg"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "Zugriff verweigert"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "Ressource bereits in Benutzung"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "Objekt bereits initialisiert"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "Angegebenes wave-Format nicht unterstützt"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "Speicherpuffer verloren und muß wiederhergesteööt werden"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "Angeforderter Puffereinstellung nicht verfügbar"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "Unbestimmter Fehler in DirectSound-System"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "DirectSound-Hardware nicht verfügbar"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "Funktion ist ungültig im aktuellen Zustand des Objekts"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "Ungültiger Parameter wurde übergeben"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "Objekt unterstützt keine Aggregation"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "Kein Sound-Treiber verfügbar"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "Angeforderte COM-Schnittstelle nicht verfügbar"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "Eine andere Anwendung hat eine höhere Priorität"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "Ungenügend Speicher"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "Niedrige Priorität für diese Funktion"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound wurde nicht initialisiert"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "Funtkion wird nicht unterstützt"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "Unbekannter Fehler"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Kann DirectSound-Objekt nicht erzeugen."
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr "Konnte DirectSound-Kooperationslevel nicht setzen."
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "Konnte keinen sekundären DirectSound-Puffer erzeugen"
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "Konnte Soundpuffer nicht wiedergeben"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "Konnte Soundpuffer nicht stoppen"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "Konnte Pufferposition nicht ermitteln"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "Konnte Pufferposition nicht setzen"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "Konnte Lautstärke nicht setzen"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": Puffer verloren, versuche wiederherzustellen\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "Konnte DirectSound-Puffer nicht belegen"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "Konnte DirectSound-Puffer nicht freigeben"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "Konnte keinen primären DirectSound-Puffer erzeugen."
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, fuzzy, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ": Wiedergabeposition überrannt, leere Puffer\n"
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": Kann PThread-Bedingung nicht erzeugen: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": Kann PThread-Mutex nicht erzeugen: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": Kann Puffer-PThread nicht erzeugen: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": Kann Puffer-PThread nicht freigeben: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ": Kann PThread-Bedigung nicht freigeben: %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": Kann PThread-Mutex nicht freigeben: %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ": Unbekanntes Steuerkommando %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "2. xine Soundausgabe benutzt directx"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "xine Soundausgabe benutzt directx für win32"
@@ -543,11 +539,11 @@ msgstr ""
"Die Einheit dieses Wertes ist ein \"PTS-Tick\", was dem 90.000stel einer "
"Sekunde entspricht."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "xine Soundausgabe benutzt esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "xine Date Soundausgabe"
@@ -586,7 +582,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "xine Soundausgabe für JACK Audio System"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "xine Dummy Soundausgabe"
@@ -788,7 +784,7 @@ msgstr ""
"Der gültige Bereich ist -1 oder 0-15. Diese Einstellung wird ignoriert, "
"falls OSS Audio-Gerätenamen auf \"auto\" steht."
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: open() Mixer %s schlug fehl: %s\n"
@@ -805,20 +801,20 @@ msgstr "Gerät für Pulse-Audio"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr "Benutze 'Server[:Senke]' um das Zeil des Puse-Audio Gerätes zu setzen."
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "xine Soundausgabe benutzt Pulse-Audio Soundserver"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: Öffnen des Audiogeräts %s schlug fehl: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "Sun Audio-Gerätename"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -831,182 +827,28 @@ msgstr ""
"sollten sich deshalb sehr sicher sein, daß Ihre Eingabe wirklich das Sun "
"Audiogerät bezeichnet."
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: Audio ioctl auf Gerät %s schlug fehl: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr "xine Soundausgabe benutzt SUN-kompatibles Gerät/Treiber"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: Vergrößere Puffer auf %d um Überlauf zu vermeiden.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_audio_dec: Konnte keinen ffmpeg-Dekoder für Puffertyp 0x%X finden\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: Besuche NULl-Codec zu öffnen\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: Konnte Dekoder nicht öffnen\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: Konnte Dekoder nicht öffnen\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "dvaudio: Vergrößere Puffer auf %d um Überlauf zu vermeiden.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: Nichtunterstütztes Bildformat, DR1 deaktiviert.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: Nichtunterstütztes Bildformat, DR1 deaktiviert.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_video_dec: Konnte keinen ffmpeg-Dekoder für Puffertyp 0x%X finden\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: Konnte Dekoder nicht öffnen\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: Konnte Dekoder nicht öffnen\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: Direktausgabe aktiviert\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_video_dec: Vergrößere Puffer auf %d um Überlauf zu vermeiden.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "Qualität der MPEG-4 Nachbearbeitungsstufe"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-"Die Umfang der Nachbearbeitung bei MPEG-4 Videos kann angepasst werden.\n"
-"Höhere Werte verwessern die Qualität zu Lasten der CPU-Belastunga. Niedrige "
-"Werte können zu Defekten wie Artefakte führen. Bei hochqualitativen Inhalten "
-"kann zu starke Nachbearbeitung das Bild durch zu starkes verwischen "
-"verschlechtern."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "libavcodec MPEG Ausgangsbitrate (kBit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-"Bitrate für die MPEG-Enkodierungsbibliothek libavcodec zur DXR3 Enkodierung. "
-"Höhere Werte verwessern die Qualität zu Lasten der CPU-Belastung.\n"
-"Diese Einstellung ist nur wirksam, wenn der Modus für konstante Qualität "
-"deaktiviert ist."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+msgstr "ogg: vorbis Tonspur erkannt, aber kein Heder im Datenstrom gefunden.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "Modus für konstante Qualität"
+#: src/combined/xine_ogg_demuxer.c:2173
+#, fuzzy
+msgid "Annodex demux plugin"
+msgstr "xine: Demultiplexer-Plugin gefunden: %s\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
-"Falls aktiviert benutzt libavcodec einen Modus für konstante Qualität, bei "
-"der Bilder je nach Komplexität dynamische komprimiert werden. Anderenfalls "
-"benutzt libavcodec eine Modus mit konstanter Bitrate."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "Minimale Kompression"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
-msgstr "Minimale Kompression für ein Bild im Modus konstanter Qualität"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr "Maximaler Quantisierer"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
-msgstr "Maximale Kompression für ein Bild im Modus konstanter Qualität"
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -1026,6 +868,10 @@ msgstr "demux_asf: Warnung: Datenstrom id=%d ist verschlüsselt.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Medienstrom gestört/verschlüsselt"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Stelle Index wiederher..."
@@ -1047,16 +893,24 @@ msgstr ""
"demux_avi: Positionierung zum nächsten Paket (Position %<PRIdMAX>) schlug "
"fehl\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "Ungültige Größe des FILM-Pakets\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "Nicht erkanntes FILM-Paket\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1072,6 +926,11 @@ msgstr "Weder ein Video- noch ein Audio-Datenstrom in dieser Datei.\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "Video-CD Plugin"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1087,12 +946,20 @@ msgstr "iff-ilbm: Unbekannte Kompression: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: Unbekanntes Paket: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr "demux_mpc: Bild zu grpß für Puffer"
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1101,20 +968,20 @@ msgstr ""
"xine-lib:demux_mpeg_block: Unbekannte Strom-Id 0x%02x. Bitte bei den xine-"
"Entwicklern melden.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
"demux_mpeg_block: Fehler! Freigabe. Bitte bei den xine-Entwicklern melden.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: Warnung: PES-Header reserviert 10 Bits nicht gefunden\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1123,7 +990,11 @@ msgstr ""
"demux_mpeg_block: Warnung: PES-Header deutet an, das dieser Datenstrom "
"verschlüsselt sein könnte (Verschlüsselungsmodus %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1132,20 +1003,20 @@ msgstr ""
"xine-lib:demux_mpeg_ps: Unbekannte Strom-Id 0x%02x. Bitte bei den xine-"
"Entwicklern melden.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
"demux_mpeg_pes: Warnung: PACK-Datenstrom id=0x%x Dekodierung "
"fehlgeschlagen.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_pes: Warnung: PES-Header reserviert 10 Bits nicht gefunden\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1154,7 +1025,7 @@ msgstr ""
"demux_mpeg_pes: Warnung: PES-Header deutet an, das dieser Datenstrom "
"verschlüsselt sein könnte (Verschlüsselungsmodus %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1164,10 +1035,9 @@ msgstr ""
"Entwicklern melden.\n"
"melden\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
-msgstr "ogg: vorbis Tonspur erkannt, aber kein Heder im Datenstrom gefunden.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
+msgstr ""
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1179,11 +1049,21 @@ msgstr "demux_snd: Ungültige Header-Parameter\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: Unbekannter Audiotyp: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "Datei Plugin"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr "demux_tta: Gesamt-Bildanzahl zu hoch\n"
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: Demultiplexer-Plugin gefunden: %s\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1198,6 +1078,11 @@ msgstr ""
"Unbekannter VOC-Kompressionstyp (0x%02X); bitte bei den xine-Entwicklern "
"melden\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "Datei Plugin"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1208,38 +1093,42 @@ msgstr "demux_wc3movie: SHOT Paket referenziert ungültige Palette (%d >= %d)\n"
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr "demux_wc3movie: Beim Laden der Palette ist ein Problem aufgetreten\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "DXR3 Gerätenummer"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-"Falls Sie mehr als eine DXR3 in Ihrem Computer haben, können Sie hier "
-"angeben, welche benutzt werden soll."
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: Öffnen des SPU-Geräts %s (%s) schlug fehl\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "Angeforderter Knopf nicht verfügbar\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr "dxr3_decode_video: Öffnen des Steuer-Geräts %s (%s) schlug fehl\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "Benutze Pan & Scan Informationen"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1269,11 +1158,11 @@ msgstr ""
"Datenstrom eingebettet sind. Dies benutzt den Active Fromat Descriptor "
"(AFD), der in manchen europäischen DVB Datenströmen benutzt wird."
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "Versuche Video mit jedem Bild zu synchonisieren"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1285,19 +1174,19 @@ msgstr ""
"Zeitmarken erzeugt werden.\n"
"Dies ist nur für progressive Videos (die meisten PAL Filme) relevant."
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "Benutze weichen Wiedergabemodus"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "Das Aktivieren dieser Option sorgt für eine flüssigere Wiedergabe."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "Korrigiere Framedauer in kaputten Streams"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1309,27 +1198,27 @@ msgstr ""
"NTSC Ströme implementiert, die fälschlicherweise als PAL markeirt sind. "
"Aktivieren Sie dier nur, wenn Sie einen solchen Datenstrom antreffen."
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Öffnen des Video-Geräts %s (%s) schlug fehl\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: Schreibzugriff würde blockieren. Leeren\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: Schreibzugriff auf Video-Gerät schlug fehl (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: WARNUNG: Unbekannter Code für Wiederholrate %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
@@ -1337,12 +1226,24 @@ msgstr ""
"dxr3_decode_video: WARNUNG: Korrigiere Code für Wiederholrate von PAL zu "
"NTSC\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "DXR3 Gerätenummer"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+"Falls Sie mehr als eine DXR3 in Ihrem Computer haben, können Sie hier "
+"angeben, welche benutzt werden soll."
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: Initialisierung von librte schlug fehl\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1351,21 +1252,21 @@ msgstr ""
"dxr3_mpeg_encoder: rte unterstützt nur Videoformate, die Vielfache von 16 "
"sind\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: rte-Kontext konnte nicht geholt werden.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: CODEC konnte nicht erzeugt werden.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "Bitrate der librte MPEG Wiedergabe (kBit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
@@ -1373,26 +1274,26 @@ msgstr ""
"Bitrate für die MPEG-Enkodierungsbibliothek librte zur DXR3 Enkodierung. "
"Höhere Werte verwessern die Qualität zu Lasten der CPU-Belastung."
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: Konnte Kontext nicht initialisieren: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: Kodierung kann nicht gestartet werden: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: FAME-Bibliothek konnte nicht gestartet werden\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "fame-MPEG-Enkodierungsqualität"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1415,11 +1316,15 @@ msgstr ""
"Systemuhr zur Synchronisation benutzt wird; Werte größer 5 erzwingen die "
"Verwendung der internen Uhr der DXR3 als Synchronisationsquelle."
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "Vertausche gerade und ungerade Zeilen"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1429,11 +1334,11 @@ msgstr ""
"Aktivieren Sie diese Option für nicht-MPEG-Material, welches ein vertikales "
"Zittern am Bildschirm zeigt."
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "Schwarze Balken zur Korrektur des Seitenverhältnisses hinzufügen"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
@@ -1442,32 +1347,32 @@ msgstr ""
"nicht direkt verarbeiten kann. Dies ist zum wahren korrekter "
"Bildeigenschaften nötig."
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr "Benutze weichen Wiedergabemodus für MPEG-kodierte Wiedergabe"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Das Aktivieren dieser Option sorgt für eine flüssigere Wiedergabe von nicht-"
"MPEG-Inhalten."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Öffnen des Steuer-Geräts %s (%s) schlug fehl\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Öffnen des Video-Geräts %s (%s) schlug fehl\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "Der Enkodierer für nicht-MPEG-Inhalte"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1491,24 +1396,24 @@ msgstr ""
"\"fame\" und \"rte\" werden noch angeboten, aber die xine-Unterstützung für "
"sie ist veraltet und evtl. sogar defekt."
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
"video_out_dxr3: MPEG-Kodierer libavcodec konnte nicht initialisiert werden.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: MPEG-Kodierer rte konnte nicht initialisiert werden.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr ""
"video_out_dxr3: MPEG-Kodierer fame konnte nicht initialisiert werden.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1525,7 +1430,7 @@ msgstr ""
"video_out_dxr3: wiedergeben. Lesen Sie README.dxr3, um einen Kodierer zu "
"konfigurieren.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1542,11 +1447,11 @@ msgstr ""
"video_out_dxr3: wiedergeben. Lesen Sie README.dxr3, um einen Kodierer zu "
"konfigurieren.\n"
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "Videoausgabemodus (TV oder Overlay)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1606,11 +1511,11 @@ msgstr ""
"Sofortumschaltung auf TV-Ausgabe durch Verstecken des Videofensters. Dies "
"ist die Standardvariante bei DXR3 Overlays."
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr "Farbwert für Overlay"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
@@ -1620,11 +1525,11 @@ msgstr ""
"Sie können verschiedene Werte probieren, falls bei der Benutzung des DXR3-"
"Overlaymodus Fenster transparent werden."
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr "Farbvarianz für Overlay"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1636,11 +1541,11 @@ msgstr ""
"Overlaymodus Fenster transparent werden; bei zu niedrigen Werten können "
"teile der Bildränder verschwinden."
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "Beschneidet den Overlaybereich oben und unten"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1648,16 +1553,16 @@ msgstr ""
"Entfernt eine Pixelzeile am oberen und unteren Rand des Overlays. Aktivieren "
"Sie dies, falls Sie grüne Linien am oberen oder unteren Rand sehen."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: Starten Sie autocal, Überlagerung deaktiviert\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "Bevorzugter TV-Modues"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1673,12 +1578,12 @@ msgstr ""
"pal60: PAL bei 60Hz\n"
"default: Einstellungen der Karte beibehalten"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: Setzen des Videomodus schlug fehl.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1688,38 +1593,38 @@ msgstr ""
"Videos on dxr3\n"
"video_out_dxr3: Lesen Sie README.dxr3 für Details.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: Fehler beim Lesen der Überlagerungsdatei. Starten Sie "
"autocal!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: Kann keine Verbindung zu '%s:%d' aufbauen\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: Verbindung zum CDDB-Server '%s:%d' steht.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr ""
"input_cdda: Kann keine Verbindung zum CDDB-Server '%s:%d' (%s) herstellen.\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "CD Digital Audio (CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "Gerät für CD-Audio"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1727,11 +1632,11 @@ msgstr ""
"Pfadangabe zum Gerät (normalerweise CD oder DVD Laufwerk), das zur "
"Wiedergabe von Audio-CDs benutzt werden soll."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "CDDB abfragen"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1744,11 +1649,11 @@ msgstr ""
"Informationen von einem Internetserver bezogen werden, der ein Profil Ihrer "
"Hörgewohnheiten erstellen kann."
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "CDDB Servername"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1760,36 +1665,19 @@ msgstr ""
"Ihren Hörgewohnheiten erhält und bösartige Antworten senden kann. Geben Sie "
"nur einen Server ihres Vertrauens an."
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "CDDB Serverport"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr "Der Serverport, vom dem Titelinformationen bezogen werden sollen."
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "CDDB Cacheverzeichnis"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-"Die Antworten des CDDB-Servers werden in diesem Verzeichnis "
-"zwischengepuffert.\n"
-"Diese Einstellung ist Sicherheitskritisch, da Dateien mit unkontrollierten "
-"Namen innerhalb dieses Verzeichnises angelegt werden. Stellen Sie sicher, "
-"daß das Verzeichnis nur für CDDB Zwischenpufferung genutzt wird."
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "Laufwerk auf diesen Faktor verlangsamen"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1804,59 +1692,59 @@ msgstr ""
"auf die Wiedergabeleistung haben sollte.\n"
"Ein Wert von Null deaktiviert das Bremsen."
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, fuzzy, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: Öffnen der DVB-Kanaldatei '%s' schlug fehl\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, fuzzy, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: Öffnen der DVB-Kanaldatei '%s' schlug fehl\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: tuner_set_channel schlug fehl\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: Kann DVB-Gerät nicht öffnen\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr "input_dvb: Kanal %d außerhalb des Bereis, benutzt 0\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: Suche nach Kanal %s\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
"input_dvb: Keine exakte Übereinstimmung für %s gefunden: versuche teilweise "
"Übereinstimmung\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: Übereinstimmung mit Kanal %s gefunden\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr "input_dvb: Kanal %s nicht in channels.conf gefunden, Standardkanal.\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
@@ -1864,12 +1752,12 @@ msgid ""
msgstr ""
"input_dvb: Ungültige Kanalspezifikation, benutze zulest gesehenen Kanal.\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr "input_dvb: Ungültige Kanalspezifikation, benutze Kanal 0\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
@@ -1878,7 +1766,7 @@ msgstr ""
"input_dvb: DVB-S MRL angegeben, aber Tuner scheint kein QPSK (DVB-S) zu "
"sein\n"
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1887,7 +1775,7 @@ msgstr ""
"input_dvb: DVB-T MRL angegeben, aber Tuner scheint kein OFDM (DVB-T) zu "
"sein\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1895,7 +1783,7 @@ msgid ""
msgstr ""
"input_dvb: DVB-C MRL angegeben, aber Tuner scheint kein QAM (DVB-C) zu sein\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, fuzzy, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1903,21 +1791,21 @@ msgid ""
msgstr ""
"input_dvb: DVB-C MRL angegeben, aber Tuner scheint kein QAM (DVB-C) zu sein\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: Kann DVR-Gerät '%s' nicht öffnen\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_dvb: Kann EPG-Aktualisierungsthread nicht erstellen\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr "Benutze DVB 'center cutout' (Zoom)"
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -1925,15 +1813,15 @@ msgstr ""
"Dies erlaubt Vollbildwiedergabe von 4:3 Inhalten, die in 16:9 übertragen "
"werden."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "DVB (Digital TV) Plugin"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr "Zuletzt gesehenen DVB-Kanal vermerken"
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
@@ -1941,71 +1829,66 @@ msgstr ""
"Bei automatischer Widergabe wechselt xine zum zuletztgesehenen Kanal media."
"dvb.last_channel. "
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr "Zuletzt gesehener DVB-Kanal"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr "Falls aktiviert vermerkt xine den Kanal und wechselt zu diesem. "
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "Nummer der zu benutzenden DVB-Karte."
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-"Belassen Sie den Wert 0, außer Sie haben mehr als eine Karte in ihrem System."
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "Nummer der zu benutzenden DVB-Karte."
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
+"Belassen Sie den Wert 0, außer Sie haben mehr als eine Karte in ihrem System."
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr "input_dvd: Werte von \\beta werden dom erhöhen!\n"
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Fehler beim Lesen des nächsten Blocks von DVD (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Fehler beim Öffnen des DVD-Geräts\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "Gerät für DVD Wiedergabe"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -2013,11 +1896,11 @@ msgstr ""
"Pfadangabe zum Gerät (normalerweise ein DVD Laufwerk), das zur Wiedergabe "
"von DVDs benutzt werden soll."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "Pfad zum RAW-Device des DVD-Laufwerks"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -2035,11 +1918,11 @@ msgstr ""
"Lesen Sie die Dokumentation zu RAW-Devices (man raw) für weitere "
"Informationen."
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "CSS Entschlüsselungsmethode"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
@@ -2050,31 +1933,11 @@ msgstr ""
"Methoden, falls Probleme bei der Wiedergabe von verschlüsselten DVDs "
"auftreten."
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr "Pfad zum Titelschlüsselcache"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-"Da das Cracken des Kopierschutzes von verschlüsselten DVDs viel Zeit "
-"erfordern kann, speichert libdvdcss gefundenen Schlüssel in diesem "
-"Verzeichnis zwischen.\n"
-"Diese Einstellung ist Sicherheitskritisch, da Dateien mit unkontrollierten "
-"Namen innerhalb dieses Verzeichnises angelegt werden. Stellen Sie sicher, "
-"daß das Verzeichnis nur für die Zwischenpufferung von DVD Titelschlüssel "
-"genutzt wird."
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "Region (1-8), aus der der DVD Player zu kommen scheint"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
@@ -2084,11 +1947,11 @@ msgstr ""
"sich über ein falscher Regionscode beschwert wird. Dies hat nichts mit dem "
"Regionscode im DVD-Laufwerk zu tun, dies ist nur für die Software."
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "Standardsprache für die DVD-Wiedergabe"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
@@ -2098,11 +1961,11 @@ msgstr ""
"DVD dies unterstützt, werden Menüs und Titel in dieser Sparche angezeigt.\n"
"Der Wert muß ein zweibuchstabiger ISO639-Sprachcode sein."
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "Vorauseilendes Caching benutzen"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
@@ -2112,11 +1975,11 @@ msgstr ""
"Dies kann bei langsamen Laufwerken zu einer stotternden Wiedergabe führen, "
"verbessert aber den Einfluß von DVD-Ebenenwechseln bei schnellen Laufwerken."
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "Einheit für die Überspringen-Aktion"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -2151,11 +2014,11 @@ msgstr ""
"Überspringt eine DVD-Titel, was eine Struktureinheit ist, die einem "
"kompletten DVD Film entspricht"
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "Einheit beim Suchen"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -2179,11 +2042,11 @@ msgstr ""
"Der Suchbereich umfaßt ein DVD-Programm, was eine Navigationseinheit ist, "
"die einem Kapitel des aktuellen Films entspricht"
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr "Wiedergabemodus falls Titel/Kapitel angegeben"
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -2208,128 +2071,128 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: Lesefehler (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Zugriff verweigert: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Datei nicht gefunden: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Datei leer: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "Datei Plugin"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "Startverzeichnis für Dateisuche"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr "Die Dateiauswahl startet an dieser angegebenen Pfadposition"
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "Versteckte Dateien anzeigen"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr "Fals aktiviert zeigt die Dateiauswahl auch versteckte Dateien."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "Mit xine ausgeliefertes gnome-vfs Plugin"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s) schlug fehl: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: Lesefehler %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Kontaktiere HTTP Server..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: Ungültige http-Antwort\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx Weiterleitung : >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: http-Status ungleich 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: Inhaltslänge = %<PRIdMAX> bytes\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: Puffer erschöpft nach %d Bytes."
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "http Plugin"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "HTTP Proxy Rechnername"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "Der Rechnername des HTTP Proxys."
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "HTTP Proxy Portnummer"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "Die Portnummer des HTTP Proxys."
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "HTTP Proxy Benutzername"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "Der Benutzername für den HTTP Proxy."
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "HTTP Proxy Passwort"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "Das Passwort für den HTTP Proxy."
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr "Domains, die den HTTP Proxy umgehen"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2341,15 +2204,15 @@ msgstr ""
"Wenn ein Domain-Name mit einem '=' beginnt, trifft er nur auf Hostnamen zu "
"(vollständige Übereinstimmung nötig)."
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "MMS-Streaming-Plugin"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "Netzwerkbandbreite"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
@@ -2359,11 +2222,11 @@ msgstr ""
"benutzt, falls Streaming-Server verschiedene Versionen eines Datenstroms mit "
"unterschiedlichen Bandbreitenanforderungen anbieten."
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "MMS-Protokoll"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2371,76 +2234,76 @@ msgstr ""
"Wählt das Protokoll über MMS.\n"
"TCP ist besser, aber hinter einer Firewall kann HTTP benötigt werden."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: Kann '%s' nicht auflösen.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: Kann keine Verbindung zu '%s' herstellen.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "Mit xine ausgeliefertes net Plugin"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "PNM Streaming-Plugin"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: Fehler beim Erstellen der PVR-Datei (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: Fehler beim Öffnen der PVR-Datei (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: Lesefehler (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: Fehler beim Öffnen der Geräts %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_G_CODEC schlug fehl, vielleicht API-Änderung?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_S_CODEC schlug fehl, vielleicht API-Änderung?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "WinTV-PVR 250/350 Plugin"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "Gerät für WinTV-PVR 250/350 (PVR) Plugin"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "Pfadangame zum Gerät der WinTV-Karte"
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "WinTV-PVR 250/350 Plugin"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2490,142 +2353,142 @@ msgstr "Kann keine Verbindung zu '%s' herstellen.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: Stoppe Lese-Thread...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: Lese-Thread terminiert\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Öffne >Dateiname:%s Port:%d Schnittstelle:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: Kann neuen Thread (%s) nicht erstellen\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "Mit xine ausgeliefertes RTP und UDP Plugin"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "RTSP Streaming-Plugin"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "CIFS/SMB Plugin basierend auf libsmbclient"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "Standardeingabe: Kann nicht zurückspulen! (%<PRIdMAX> > %<PRIdMAX>)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "Standardeingabe: Öffnen von '%s' schlug fehl\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "Standardeingabe Streaming-Plugin"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Pufferunterlauf..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Pufferüberlauf..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Anpassen..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Empfängername nicht gefunden\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "V4L TV Plugin"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "V4L Radio Plugin"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "Pfad zum V4L Videogerät"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "Pfad zum Video4Linux Videogerät"
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "Pfad zum V4L Radiogerät"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "Pfad zum Video4Linux Videogerät"
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "V4L Radio Plugin"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "Pfad zum V4L Radiogerät"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "Pfad zum Video4Linux Radiogerät"
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: Ungültige MRL: Benutze vcdo:/<Track #>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: Fehlerhafter Track %d (Gültiger Bereich: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "Video-CD Plugin"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "Kann %s nicht öffnen: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: Kann %s nicht öffnen: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "Video-CD Plugin"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "Gerät für VCD Wiedergabe"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
@@ -2633,12 +2496,12 @@ msgstr ""
"Pfadangabe zum Gerät (normalerweise CD oder DVD Laufwerk), das zur "
"Wiedergabe von Video-CDs benutzt werden soll."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: Fehlerhafte mrl: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: Kann keine Verbindung zu '%s' aufbauen\n"
@@ -2717,7 +2580,7 @@ msgstr "Nichtunterstütztes Protokoll\n"
msgid "Buffering..."
msgstr "Puffern..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2726,12 +2589,12 @@ msgstr ""
"input_pnm: Während dem Lesen ist eine Nachricht vom Server eingetroffen:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: Kann keine Verbindung zu '%s' herstellen.\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: Datenstrom konnte nicht eingerichtet werden\n"
@@ -2780,42 +2643,42 @@ msgstr "Es wurde ein NULL-Klassenparameter übergeben"
msgid "Invalid current entry type"
msgstr "Ungültiger Eintragstyp"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-"Video-CD Plugin mit PBC und Unterstützung für (X)VCD, (X)SVCD, HQVCD, "
-"CVD, ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "Auswahl hat keinen RETURN-Eintrag"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr "DEFAULT ausgewählt, aber PBC ist nicht an."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "Auswahl hat keinen NEXT-Eintrag"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "Auswahl hat keinen PREVIOUS-Eintrag"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Unbekannter Ereignistyp"
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "Die vorherige Nachricht hat einen unbekannten Log-Level"
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+"Video-CD Plugin mit PBC und Unterstützung für (X)VCD, (X)SVCD, HQVCD, "
+"CVD, ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr "Standardlaufwerk für VCD bei automatischer Wiedergabe"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
@@ -2823,11 +2686,11 @@ msgstr ""
"Das zu benutzende Laufwerk, wenn keins in der MRL angegeben ist (z.B. vcd:// "
"oder vcd:///dev/dvd:)"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr "Standard CD-ROM-Laufwerk für VCD, wenn keins angegeben wird"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
@@ -2835,29 +2698,29 @@ msgstr ""
"Welches Laufwerk benutzt werden soll, falls kein angegeben ist. Falls die "
"Einstellung leer ist, wird xine nach CD-Laufwerken suchen."
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr "VCD Positionierungsbereich"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
"Der Bereich, den der Positionsschieber bei Wiedergabe von VCDs repräsentiert."
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr "Vorauseilendes Caching für VCDs benutzen?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr "Kann zu ruckliger Wiedergabe auf leistungsschwachen Rechnern führen."
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr "Automatisch Spur/Eintrag weiterschalten bei VCDs"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
@@ -2866,11 +2729,11 @@ msgstr ""
"weitergeschaltet. Wird nur benutzt, wenn die Wiedergabekontrolle PBC nicht "
"aktiviert ist."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr "'Ablegehnte' VCD LIDs anzeigen"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
@@ -2880,11 +2743,11 @@ msgstr ""
"Anwahl dieser Option werden sie trozem angezeigt und mit einem Stern (*) am "
"Ende der MRL gekennzeichnet."
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr "Formatvorlage für Fenstertitle bei VCDs"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2923,11 +2786,11 @@ msgstr ""
" Eine Nummer zwischen 1 und der Serienlänge.\n"
" %% : ein %\n"
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr "Formatvorlage für Kommentarfeld eines VCD Datenstroms."
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2939,11 +2802,11 @@ msgstr ""
"%c, %F, %I, %L, %N, %P, %p, %S, %T, %V, %v, und %%.\n"
"Siehe Hilfe für title_format bezüglich deren Bedeutung."
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr "Bitfeld für VCD Fehlersuche"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2973,98 +2836,186 @@ msgstr ""
"1024: Standbilder\n"
"2048: Debugging von VCDINFO\n"
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "HILFE! Ein nur-Mono-Audiogerät?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: Vergrößere Puffer auf %d um Überlauf zu vermeiden.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "A/52 Lautstärke"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_audio_dec: Konnte keinen ffmpeg-Dekoder für Puffertyp 0x%X finden\n"
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: Besuche NULl-Codec zu öffnen\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: Konnte Dekoder nicht öffnen\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: Konnte Dekoder nicht öffnen\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-"Mit A/52 Audio kann die Lautstärke auf Dekoderebene verändert werden. Dies "
-"hat den Vorteil, daß die Audiodaten bereits für die spezifische Lautstärke "
-"dekodiert sind und nachfolgende Operationen wie Heruntermischen direkt mit "
-"diesen Audiodaten arbeiten können."
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "Benutze dynamische A/52 Bereichskomprimierung"
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "dvaudio: Vergrößere Puffer auf %d um Überlauf zu vermeiden.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "V4L Radio Plugin"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "libavcodec MPEG Ausgangsbitrate (kBit/s)"
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-"Dynamische Bereichskomprimierung reduziert den dynamischen Bereich des Tons: "
-"Laute Geräusche klingen leiser und leise Geräusche klingen lauter. Dies "
-"ermöglicht ein besseres Verständnis des Tons in lauten Umgebungen, ohne "
-"dabei andere zu stören."
+"Bitrate für die MPEG-Enkodierungsbibliothek libavcodec zur DXR3 Enkodierung. "
+"Höhere Werte verwessern die Qualität zu Lasten der CPU-Belastung.\n"
+"Diese Einstellung ist nur wirksam, wenn der Modus für konstante Qualität "
+"deaktiviert ist."
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "Heruntermischen zu Zweikanal Stereo Raumklang"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "Modus für konstante Qualität"
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-"Aktivieren sie dies, falls Sie Mehrkanal-Raumklang anhören wollen, aber nur "
-"zwei Lautsprecher oder einen Surround-Dekodierer haben, der Matrix-Surround-"
-"Dekodierung wie ProLogic unterstützt, damit die zusätzlichen Kanäle in das "
-"Stereo-Signal gemixt werden."
+"Falls aktiviert benutzt libavcodec einen Modus für konstante Qualität, bei "
+"der Bilder je nach Komplexität dynamische komprimiert werden. Anderenfalls "
+"benutzt libavcodec eine Modus mit konstanter Bitrate."
+
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "Minimale Kompression"
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr "Minimale Kompression für ein Bild im Modus konstanter Qualität"
-#: src/libfaad/xine_faad_decoder.c:136
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr "Maximaler Quantisierer"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr "Maximale Kompression für ein Bild im Modus konstanter Qualität"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad NeAACDecOpen() schlug fehl.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: Nichtunterstütztes Bildformat, DR1 deaktiviert.\n"
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit2 schlug fehl.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: Nichtunterstütztes Bildformat, DR1 deaktiviert.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit schlug fehl.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_video_dec: Konnte keinen ffmpeg-Dekoder für Puffertyp 0x%X finden\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: Konnte Dekoder nicht öffnen\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, fuzzy, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr "libmusepack: mpc_decoder_initialise schlug fehl\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: Konnte Dekoder nicht öffnen\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr "libmusepack: mpc_streaminfo_read schlug fehl: %d\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: Direktausgabe aktiviert\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr "libmusepack: Daten nach letzem Bild ignoriert\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_video_dec: Vergrößere Puffer auf %d um Überlauf zu vermeiden.\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr "libmusepack: mpc_decoder_initialise schlug fehl\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr "libmusepack: mpc_decoder_decode schlug fehl: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "Qualität der MPEG-4 Nachbearbeitungsstufe"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"Die Umfang der Nachbearbeitung bei MPEG-4 Videos kann angepasst werden.\n"
+"Höhere Werte verwessern die Qualität zu Lasten der CPU-Belastunga. Niedrige "
+"Werte können zu Defekten wie Artefakte führen. Bei hochqualitativen Inhalten "
+"kann zu starke Nachbearbeitung das Bild durch zu starkes verwischen "
+"verschlechtern."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
#: src/libreal/real_common.c:139
msgid "path to RealPlayer codecs"
@@ -3085,11 +3036,6 @@ msgstr ""
"Konsultieren Sie die xine FAQ für weitere Informationen, wie die Codecs zu "
"installieren sind."
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr "libreal: Kann Symbole nicht auflösen! (Version inkompatibel?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -3111,52 +3057,65 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: Ups, Real ünterstützt mehr als 2 Kanäle?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr "libreal: Kann Symbole nicht auflösen! (Version inkompatibel?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "Untertitel in MEPG-2-Strömen anzeigen"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr "Untertitel sollen Hörgeschädigten helfen."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "Untertitelschema für Vordergrund-/Hintergrundfarbe"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Wählen Sie eine Darstellung für Untertitel."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "Standard Zeichensatz für Untertitel"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Wählen Sie den Zeichensatz für standard Untertiteltexte."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "Italic Zeichensatz für Untertitel"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "Wählen Sie den Zeichensatz für kursive Untertiteltexte."
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "Zeichensatzgröße für Untertitel"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr "Wählen Sie die Zeichensatzgröße für Untertiteltexte."
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "Zentrieren von Untertiteln"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
@@ -3164,23 +3123,37 @@ msgstr ""
"Falls aktiviert werden die Zeilen des Untertitels jeweils mittig "
"ausgerichtet."
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "Zeichensatzgröße für Untertitel"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "Zeichensatz für externe Untertitel"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr "Vertikaler Versatz für Untertitel (Relativ zu Fenstergröße)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "Zeichenkodierung für Untertitel"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: Demultiplexer-Plugin gefunden: %s\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "Standardzeitspanne in Sekunden bis zum Ausblenden des Untertitels"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -3191,22 +3164,26 @@ msgstr ""
"angegeben, werden die Untertitel solange angezeigt, bis sie vom nächsten "
"ersetzt werden."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "Untertitelgröße"
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
"Passt die Untertitelgröße an. Diese Einstellung ist relativ zur Fenstergröße."
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "Vertikaler Versatz für Untertitel"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
@@ -3214,29 +3191,28 @@ msgstr ""
"Passt den vertikalen Versatz der Untertitel an. Diese Einstellung ist "
"relativ zur Fenstergröße."
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "Zeichensatz für Untertitel"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
"Ein Zeichensatz aus xines font-Verzeichnis zur Anzeige von Untertiteln."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr "Ein Zeichensatz (z.B. .ttf) zur Anzeige von Untertiteln."
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr "ob Freetype-Zeichensätze genutzt werden"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "Zeichenkodierung für Untertitel"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3248,11 +3224,11 @@ msgstr ""
"anders als erwartet dargestellt werden, fragen Sie den Ersteller der "
"Untertitel nach der verwendeten Kodierung."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "Benutze unskaliertes OSD falls möglich"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3348,31 +3324,153 @@ msgstr "w32codec: Fehler beim Initialisieren von DirectShow Audio\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: Fehler beim Initialisieren von DMO Audio\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "xine Date Soundausgabe"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "HILFE! Ein nur-Mono-Audiogerät?!\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "A/52 Lautstärke"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+"Mit A/52 Audio kann die Lautstärke auf Dekoderebene verändert werden. Dies "
+"hat den Vorteil, daß die Audiodaten bereits für die spezifische Lautstärke "
+"dekodiert sind und nachfolgende Operationen wie Heruntermischen direkt mit "
+"diesen Audiodaten arbeiten können."
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "Benutze dynamische A/52 Bereichskomprimierung"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+"Dynamische Bereichskomprimierung reduziert den dynamischen Bereich des Tons: "
+"Laute Geräusche klingen leiser und leise Geräusche klingen lauter. Dies "
+"ermöglicht ein besseres Verständnis des Tons in lauten Umgebungen, ohne "
+"dabei andere zu stören."
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "Heruntermischen zu Zweikanal Stereo Raumklang"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+"Aktivieren sie dies, falls Sie Mehrkanal-Raumklang anhören wollen, aber nur "
+"zwei Lautsprecher oder einen Surround-Dekodierer haben, der Matrix-Surround-"
+"Dekodierung wie ProLogic unterstützt, damit die zusätzlichen Kanäle in das "
+"Stereo-Signal gemixt werden."
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad NeAACDecOpen() schlug fehl.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit2 schlug fehl.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit schlug fehl.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, fuzzy, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr "libmusepack: mpc_decoder_initialise schlug fehl\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr "libmusepack: mpc_streaminfo_read schlug fehl: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr "libmusepack: Daten nach letzem Bild ignoriert\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr "libmusepack: mpc_decoder_initialise schlug fehl\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr "libmusepack: mpc_decoder_decode schlug fehl: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: Fehler beim ByteRun1-Dekomprimieren\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 wird momentan nicht unterstützt\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 wird momentan nicht unterstützt\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ wird momentan nicht unterstützt\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: Dieser anim-Type wird momentan nicht unterstützt\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3384,6 +3482,10 @@ msgstr ""
"erhalten werden, was es z.B. möglich macht, einen Film in weniger als seiner "
"originalen Aufnahmedauer anzusehen.\n"
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3402,6 +3504,10 @@ msgstr ""
"diese Parameter zu setzen.\n"
"\n"
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3429,6 +3535,11 @@ msgstr[1] ": mische einen Kanal von ursprünglich %d Kanälen hoch.\n"
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ": Audiogerät ist nicht AO_CAP_MODE_STEREO fähig.\n"
+#: src/post/audio/upmix_mono.c:346
+#, fuzzy
+msgid "converts Mono into Stereo"
+msgstr ": mische Mono zu Stereo hoch.\n"
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3447,6 +3558,10 @@ msgstr ""
"(Standard); 2: Benutzt mehrere Abtastpunkte, um die Variationen mit Hilfe "
"des gewichteten Mittels über vorherige Abtastpunkte zu glätten.\n"
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
#, fuzzy
msgid ""
@@ -3558,16 +3673,24 @@ msgstr ""
"Verfügung)\n"
"\n"
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: Keine Deinterlacingmethoden verfügbar, beendet.\n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "Zu generierende Bilder/Sekunde"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3575,27 +3698,27 @@ msgstr ""
"Mit mehr Bildern pro Sekunde wird die Animation flüssiger und schneller, "
"benötigt aber mehr CPU Rechenzeit."
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr "Goom Bildbreite"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "Die Breite des zu generierenden Bilds in Pixeln."
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr "Goom Bildhöhe"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "Die Höhe des zu generierenden Bilds in Pixeln."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr "Farbraumkonvertierungsmethode"
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
@@ -3603,7 +3726,11 @@ msgstr ""
"Sie können die Methode zum Konvertieren des Farmraums in Goom wählen.\n"
"Die auswählbaren Möglichkeiten sollten selbsterklärend sein."
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3623,7 +3750,12 @@ msgstr ""
" w: Die Breite des Bilds\n"
" h: Die Höhe des Bilds\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3654,6 +3786,10 @@ msgstr ""
"\n"
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3680,33 +3816,9 @@ msgstr ""
"\n"
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
-"Software-Equalizer mit interaktiver Steuerung ähnlich Hardware-Equalizer für "
-"solche Karten/Treiber, die keine Helligkeits-/Kontraststeuerung in Hardware "
-"besitzen.\n"
-"\n"
-"Parameters\n"
-" brightness: Helligkeit\n"
-" contrast: Kontrast\n"
-"\n"
-"Hinweis: Es kann das Kontrollfenster der Bedienoberfläche benutzt werden, um "
-"diese Parameter zu setzen.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
#: src/post/planar/eq2.c:361
msgid ""
@@ -3751,7 +3863,48 @@ msgstr ""
"\n"
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+"Software-Equalizer mit interaktiver Steuerung ähnlich Hardware-Equalizer für "
+"solche Karten/Treiber, die keine Helligkeits-/Kontraststeuerung in Hardware "
+"besitzen.\n"
+"\n"
+"Parameters\n"
+" brightness: Helligkeit\n"
+" contrast: Kontrast\n"
+"\n"
+"Hinweis: Es kann das Kontrollfenster der Bedienoberfläche benutzt werden, um "
+"diese Parameter zu setzen.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3778,7 +3931,7 @@ msgstr ""
" Centre_cut_out_mode: Extrahiert 4:3 Bilder aus 16:9 Bildern\n"
"\n"
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3811,7 +3964,11 @@ msgstr ""
"\n"
"* mplayer's noise (C) Michael Niedermayer\n"
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3823,7 +3980,7 @@ msgstr ""
"Parameter\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3831,6 +3988,11 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+#, fuzzy
+msgid "plugin for ffmpeg libpostprocess"
+msgstr "Benutzte divx4-Plugin für MSmpeg4v3-Ströme"
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3877,11 +4039,126 @@ msgstr ""
"\n"
"* mplayer's unsharp (C) 2002 Rémi Guyomarch\n"
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_rip: Positionierung fehlgeschlagen: %s\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ": Kann PThread-Bedingung nicht erzeugen: %s\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: Stoppe Lese-Thread...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, fuzzy, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "RTP: Lese-Thread terminiert\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: Stoppe Lese-Thread...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "RTP: Lese-Thread terminiert\n"
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "Standardeingabe: Öffnen von '%s' schlug fehl\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "Standardeingabe: Öffnen von '%s' schlug fehl\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: Kann keine Verbindung zu '%s' aufbauen\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: Kann keine Verbindung zu '%s:%d' aufbauen\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "Standardeingabe: Öffnen von '%s' schlug fehl\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "demux_ts: Kann neuen Thread (%s) nicht erzeugen\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "xine Videoausgabe benutzt ASCII-Art Bibliothek"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "xine Videoausgabe benutzt Farb-ASCII-Art Bibliothek"
@@ -3927,8 +4204,8 @@ msgid "video colour key"
msgstr "Farbschlüssel für Overlay"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -4012,30 +4289,30 @@ msgstr ""
"video_out_directfb: Bildskalierung mit deinterlating ist "
"hardwarebeschleunigt.\n"
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr "Videoebenen-Id (automatisch: -1)"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr "Wählt die Ausgabeebene für videos bei Id."
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_directfb: Benutze Anzeigenebene #%d.\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "xine Videoausgabe benutzt DirectFB"
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr "video_out_directfb: Keine benutzbare Anzeigenebene gefunden!\n"
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "xine Videoausgabe benutzt DirectFB unter XDirectFB"
@@ -4052,11 +4329,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "xine Videoausgabe benutzt für win32 benutzt directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -4065,11 +4342,11 @@ msgstr ""
"video_out_fb: Nur packed truecolor/directcolor wird unterstützt (%d).\n"
" Überprüden Sie 'fbset -i' oder versuchen Sie 'fbset -depth 16'.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "Framebuffer Gerät"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -4082,21 +4359,20 @@ msgstr ""
"sollten sich deshalb sehr sicher sein, daß Ihre Eingabe wirklich das "
"Framebuffer-Gerät bezeichnet."
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out_fb: Ihr Videomodues wurde nicht erkannt, Entschuldigung.\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: %d Video-Ram-Puffer sind verfügbar.\n"
-#: src/video_out/video_out_fb.c:956
-#, c-format
+#: src/video_out/video_out_fb.c:939
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
@@ -4106,39 +4382,41 @@ msgstr ""
"Verringern\n"
" der Framebuffer-Auflösung kann helfen.\n"
-#: src/video_out/video_out_fb.c:967
-#, c-format
+#: src/video_out/video_out_fb.c:950
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
"WARNUNG: video_out_fb: Null-Kopie-Puffer sind DEAKTIVIERT, weil der Kernel-"
"Treiber\n"
" kein screen-panning unterstützt (benutzt für Bildwechsel).\n"
-#: src/video_out/video_out_fb.c:1036
-#, c-format
+#: src/video_out/video_out_fb.c:1019
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"WARNUNG: video_out_fb: Momentane Farbtiefe ist %d. Für bessere Leistung wird "
-"eine Farbtiefe von 16 bpp empfohlen!\n"
+"\n"
+"\n"
+"WARNUNG: Aktuelle Farbtiefe ist %d. Für bessere Leistung wird eine Farbtiefe "
+"von 16 bpp empfohlen!\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr "xine Videoausgabe benutzt Linux Framebuffer"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "xine Videoausgabe zeigt nichts an"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr "OpenGL Renderer"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -4194,11 +4472,11 @@ msgstr ""
"Environment_Mapped_Torus\n"
"Zeigt Bilder auf einem sich drehenden spiegelndem Torus. Sehr cool =)"
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr "Minimale OpenGL Bildrate"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
@@ -4206,12 +4484,12 @@ msgstr ""
"Minimale Bildrate für animierte Renderroutinen.\n"
"Ignoriert für statische Renderroutinen.\n"
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "Doppelpufferung benutzen"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
@@ -4221,7 +4499,7 @@ msgstr ""
"sondern reduziert auch Flackern.\n"
"Es sollte keine Leistungseinbußen haben."
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "xine Videoausgabe mit OpenGL 3D Grafikschnittstelle"
@@ -4241,6 +4519,11 @@ msgstr "video_out_pgx32: Fehler: ioctl schlug fehl, fehlerhaftes Gerät (%s)\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr "video_out_pgx32: Fehler: '%s' ist kein pgx32 Framebuffer Gerät\n"
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr "xine Videoausgabe benutzt libvidix für Linux Framebuffer"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -4281,34 +4564,34 @@ msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
"video_out_pgx64: Fehler: Fenstereigenschaften kónnen nicht gesetzt werden\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Warnung: Wenig Videospeicher, Mehrfachpufferung "
"deaktiviert\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Fehler: Ungenügend Videospeicher\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Warnung: Wenig Videospeicher, Doppelpufferung deaktiviert\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Fehler: ioctl(FBIOGATTR) schlug fehl\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr "Farbschlüssel für Overlay"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
@@ -4318,11 +4601,11 @@ msgstr ""
"eingeblendet werden kann. Probieren Sie verschiedenen Werte, falls das Video "
"bei anderen Fenstern durchscheint."
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr "Benutze Farbschlüssel"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
@@ -4330,11 +4613,11 @@ msgstr ""
"OSD-Grafiken werden an den Stellen des Farbschlüssels dargestellt, anstatt "
"sie in jedes Bild einzublenden."
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "Mehrfachpufferung benutzen"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
@@ -4342,6 +4625,11 @@ msgstr ""
"Mehrfachpufferung erhöht die Leistung auf Kosten eines erhöhten Verbrauchs "
"von Grafikspeicher."
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr "xine Videoausgabe benutzt libvidix für Linux Framebuffer"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "Benutze Hardwarebeschleunigung falls verfügbar"
@@ -4366,130 +4654,39 @@ msgstr "SDL muß eine 16 Bit Ausgabe emulieren, was alles verlangsamt.\n"
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: Vollbildmodus wird NICHT unterstützt\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "xine Videoausgabe benutzt 'Simple Direct Media Layer'"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr "xine Videoausgabe benutzt LibStk Surface Set-top Toolkit"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: Fehler. (YUY2 wird von der Grafikkarte nicht unterstützt)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: Fehler. (YV12 wird von der Grafikkarte nicht unterstützt)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: Info. (SyncFB-Modul unterstützt YUV 4:2:0 (3 Ebenen))\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: Info. (SyncFB-Modul unterstützt YUV 4:2:0 (2 Ebenen))\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr "video_out_syncfb: Info. (SyncFB-Modul unterstützt YUV 4:2:2)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: Info. (SyncFB-Modul unterstützt YUY2)\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: Info. (SyncFB-Modul unterstützt RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: Abbruch. (SyncFB unterstützt weder YV12, YUY2 noch "
-"RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, fuzzy, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: Info. (Helligkeit-/Kontraststeuerung nicht verfügbar, weil "
-"das SyncFB-Kernelmodul veraltet scheint. Lesen Sie bitte README.syncfb zu "
-"Updateinformationen.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "Standardanzahl von Bildwiederholungen"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr "Gibt an, wie oft ein einzelnes Videobild fortlaufend angezeigt wird."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr "xine Videoausgabe benutzt SyncFB-Modul für Matrox G200/G400-Karten"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "SyncFB Gerätename"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-"Gibt den Namen für das SyncFB (TeleTux) Gerät an.\n"
-"Diese Einstellung ist Sicherheitskritisch, da falls sie auf eine andere "
-"Datei geändert wird, xine diese mit willkürlichen Inhalt überschreibt. Sie "
-"sollten sich deshalb sehr sicher sein, daß Ihre Eingabe wirklich das "
-"Framebuffer-Gerät bezeichnet."
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "Rot-Intensität"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr "Die Intensität rotet Farbanteile"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "Grün-Intensität"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr "Die Intensität grüner Farbanteile"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "Blau-Intensität"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr "Die Intensität blauer Farbanteile"
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
@@ -4499,81 +4696,85 @@ msgstr ""
"Darstellung des gesamten Bildschirms (\"Strahlenrücklauf\"). Dies verhindert "
"Flackern und Fransenbildung, benötigt aber mehr Grafikspeicher."
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: Adapter unterstützt das YUY2 Format\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: Adapter unterstützt das YV12 Format\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: Sie haben die falsche Version der VIDIX-Bibliothek\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: Kein funktionierende VIDIX-Treiber gefunden\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: Benutzer Treiber: %s von %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "Rot-Komponente des Farbschlüssels für Overlays"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "Grün-Komponente des Farbschlüssels für Overlays"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "Blau-Komponente des Farbschlüssels für Overlays"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "xine Videoausgabe benutzt libvidix für X11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr "xine Videoausgabe benutzt libvidix für Linux Framebuffer"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-"video_out_xcbshm: %s: Belege Bild\n"
-"video_out_xcbshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xcbshm.c:159
-#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
+#, fuzzy, c-format
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr "xine Videoausgabe benutzt 'MIX X Shared Memory' Erweiterung"
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, fuzzy, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-"video_out_xcbshm: Shared-Memory-Fehler (Adressfehler) beim Belegen des "
-"Bilds\n"
-"video_out_xcbshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
+"video_out_xshm: Shared-Memory-Fehler (Adressfehler) beim Belegen des Bilds\n"
+"video_out_xshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-"video_out_xcbshm: X11-Fehler bei Shared-Memory-XImage-Erstellung\n"
-"video_out_xcbshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4587,92 +4788,81 @@ msgstr ""
"WARNUNG: Aktuelle Farbtiefe ist %d. Für bessere Leistung wird eine Farbtiefe "
"von 16 bpp empfohlen!\n"
-#: src/video_out/video_out_xcbshm.c:1114
-#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
+#, fuzzy, c-format
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-"video_out_xcbshm: MIT-Shared-Memory-Erweiterung für Anzeige nicht "
-"vorhanden.\n"
+"video_out_xshm: MIT-Shared-Memory-Erweiterung für Anzeige nicht vorhanden.\n"
-#: src/video_out/video_out_xcbshm.c:1213
-#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-"video_out_xcbshm: Der Videomodus wurde nicht erkannt, Entschuldigung :-(\n"
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
+#, fuzzy, c-format
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "video_out_fb: Ihr Videomodues wurde nicht erkannt, Entschuldigung.\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr "xine Videoausgabe benutzt 'MIX X Shared Memory' Erweiterung"
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-"video_out_xcbv: XvShmCreateImage lieferte Größe 0 zurück\n"
-"video_out_xcbv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-"video_out_xcbxv: Shared-Memory-Fehler bei shmget: %s\n"
-"video_out_xcbxv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-"video_out_xcbxv: X11-Fehler bei Shared-Memory-XImage-Erstellung\n"
-"video_out_xcbxv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xcbxv.c:1358
-#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
-msgstr "video_out_xcbxv: Xv-Erweiterung nicht vorhanden.\n"
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
+#, fuzzy, c-format
+msgid "%s: Xv extension not present.\n"
+msgstr "video_out_xv: Xv-Erweiterung nicht vorhanden.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
-"video_out_xcbxv: Xv-Erweiterung ist vorhanden, aber es wurde kein "
-"benutzbarer YUV12-Port gefunden.\n"
+"video_out_xv: Xv-Erweiterung ist vorhanden, aber es wurde kein benutzparer "
+"YUV12-Port gefunden.\n"
" Unterstützt die Grafikhardware evtl. kein Xv?!\n"
-#: src/video_out/video_out_xcbxv.c:1417
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1254
+#, fuzzy, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xcbxv: Benutze Xv-Port %d von Adapter %s for Hardware-"
+"video_out_xv: Benutze Xv-Port %ld von Adapter %s for Hardware-"
"Farbraumtransformation und Skalierung.\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
#, fuzzy
msgid ""
"This option will synchronize the update of the video image to the repainting "
@@ -4684,232 +4874,44 @@ msgstr ""
"Darstellung des gesamten Bildschirms (\"Strahlenrücklauf\"). Dies verhindert "
"Flackern und Fransenbildung, benötigt aber mehr Grafikspeicher."
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xcbxv: Adapter unterstützt YV12 Format.\n"
-
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xcbxv: Adapter unterstützt YUY2 Format.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "Deinterlace-Methode (veraltet)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-"Die Konfigurationseinstellung ist veraltet; Sie sollten stattdessen die "
-"Einstellungen der Deinterlacing Nachbearbeitung verwenden.\n"
-"\n"
-"In den Anfangstagen des analogen Fernsehens wurden die geraden und ungeraden "
-"Zeilen des Videobildes zu verschiedenen Zeiten aufgenommen und angezeigt, um "
-"Bewegungen flüssiger darzustellen. Dies nennt man \"interlacing\". "
-"Unglücklicherweise zeigen heutige Bildschirme sowohl gerade und ungerade "
-"Zeilen immer gleichzeitig als vollständiges Bild an, genannt \"progressiv\", "
-"was zu Kammartefakten genannten Bildfehlern führt. Softwareinterlacing ist "
-"ein Ansatz, diese Artefakte zu reduzieren. Die Werte bedeuten:\n"
-"\n"
-"none\n"
-"Deaktiviert Softwaredeinterlacing.\n"
-"\n"
-"bob\n"
-"Interpoliert zwischen den Linien in bewegten Teilen des Bildes.\n"
-"\n"
-"weave\n"
-"Ähnlich wie bob, mit der Tendez, die volle Auflösung zu erhalten, besser für "
-"hohe Details in Szenen mit wenig Bewegung.\n"
-"\n"
-"greedy\n"
-"Sehr guter adaptiver Deinterlacer, der aber viel CPU-Leistung benötigt.\n"
-"\n"
-"onefield\n"
-"Interpoliert immer und reduziert die vertikale Auflösung.\n"
-"\n"
-"onefieldxv\n"
-"Wie onefield, benutzt aber die Hardware zur Interpolation.\n"
-"\n"
-"linearblend\n"
-"Verwischt das Bild vertikal, um Kammartefakte zu entfernen. Gute Resultate "
-"bei mittlerer CPU-Auslastung."
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
+#, fuzzy, c-format
+msgid "%s: this adaptor supports the %s format.\n"
+msgstr "video_out_xv: Adapter unterstützt YV12 Format.\n"
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "xine Videoausgabe benutzt 'MIX XVideo' Erweiterung"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: Shared-Memory-Fehler beim Speicherbelegen\n"
-"video_out_xshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: %s: Belege Bild\n"
-"video_out_xshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: Shared-Memory-Fehler (Adressfehler) beim Belegen des Bilds\n"
-"video_out_xshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: X11-Fehler bei Shared-Memory-XImage-Erstellung\n"
-"video_out_xshm: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: MIT-Shared-Memory-Erweiterung für Anzeige nicht vorhanden.\n"
-
-#: src/video_out/video_out_xshm.c:1254
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-"video_out_xshm: Der Videomodus wurde nicht erkannt, Entschuldigung :-(\n"
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage schlug fehl\n"
-"video_out_xv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-"video_out_xv: XvShmCreateImage lieferte Größe 0 zurück\n"
-"video_out_xv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: Shared-Memory-Fehler bei shmget: %s\n"
-"video_out_xv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: X11-Fehler bei Shared-Memory-XImage-Erstellung\n"
-"video_out_xv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: Xv-Erweiterung nicht vorhanden.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-"video_out_xv: Xv-Erweiterung ist vorhanden, aber es wurde kein benutzparer "
-"YUV12-Port gefunden.\n"
-" Unterstützt die Grafikhardware evtl. kein Xv?!\n"
-#: src/video_out/video_out_xv.c:1460
-#, c-format
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
+#, fuzzy, c-format
msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xv: Benutze Xv-Port %ld von Adapter %s for Hardware-"
"Farbraumtransformation und Skalierung.\n"
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: Adapter unterstützt YV12 Format.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: Adapter unterstützt YUY2 Format.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "xine Videoausgabe benutzt XvMC XVideo-Erweiterung"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: XvMC-Erweiterung nicht vorhanden.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -4918,7 +4920,7 @@ msgstr ""
"video_out_xvmc: Xv-Erweiterung ist vorhanden, aber es wurde kein benutzparer "
"YUV12-Port gefunden.\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -4927,102 +4929,35 @@ msgstr ""
"video_out_xvmc: Benutze Xv-Port %ld von Adapter %s for Hardware-"
"Farbraumtransformation und Skalierung\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " IDCT und Bewegungskompensationsbeschleunigung \n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " nur Bewegungskompensationsbeschleunigung\n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " Keine XvMC-Unterstützung \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " Mit Überlagerung = %d; UnsignedIntra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage schlug fehl\n"
-"video_out_xxmc: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage lieferte Größe 0 zurück\n"
-"video_out_xv: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: Shared-Memory-Fehler bei shmget: %s\n"
-"video_out_xxmc: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: X11-Fehler bei Shared-Memory-XImage-Erstellung\n"
-"video_out_xxmc: => MIT-Shared-Memory-Erweiterung wird nicht genutzt.\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xxmc: Xv-Erweiterung nicht vorhanden.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xxmc: Xv-Erweiterung ist vorhanden, aber es wurde kein benutzparer "
-"YUV12-Port gefunden.\n"
-" Unterstützt die Grafikhardware evtl. kein Xv?!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xxmc: Benutze Xv-Port %ld von Adapter %s for Hardware-"
-"Farbraumtransformation und Skalierung.\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xxmc: Adapter unterstützt YV12 Format.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xxmc: Adapter unterstützt YUY2 Format.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "xine Videoausgabe benutzt XvMC XVideo-Erweiterung"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr "XvMC belegt zur besseren Pufferung mehr Bildspeicher."
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
@@ -5032,11 +4967,11 @@ msgstr ""
"Diese Option, wenn ausgewählt, veranlasst den Treiber 15\n"
"Bilder zu belegen. Ein Muß für Unichrome oder live VDR.\n"
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr "Unichrome Prozessorschoner"
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
@@ -5047,11 +4982,11 @@ msgstr ""
"Patch.\n"
"Experimentell.\n"
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr "Behebe NVIDIA XvMV Subpicture-Farbfehler"
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
@@ -5060,11 +4995,11 @@ msgstr ""
"blau darstellt und umgekehrt. Diese Option liefert eine provisorische "
"Lösung.\n"
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr "Benutze BOB als beschleunigte Deinterlacingmethode."
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
@@ -5073,21 +5008,21 @@ msgstr ""
"alterniere zwischen oberer und unterer Hälfte bei doppelter "
"Bildwiederholrate.\n"
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -5213,21 +5148,21 @@ msgstr ""
"Als Resultat ist das Alpha-Blending weniger akkurat als vorher, dafür ist "
"aber die CPU-Belastung geringer."
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: Kein Plugin verfügbar zur Berhandlung von '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: Fehler, unbekannter Puffertyp: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "Anzahl der Audiopuffer"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5238,7 +5173,7 @@ msgstr ""
"unzuverlässigen Quellen, erhöhen aber auch die Latenzzeit und den "
"Speicherverbrauch."
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
@@ -5246,31 +5181,31 @@ msgstr ""
"audio_out: Berechnung der Verzögerung unmöglich mit einem nicht verfügbaren "
"Audiogerät\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, fuzzy, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr "Schreiben an Soundkarte schlug fehl. Wurde ein USB-Gerät entfernt?\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "Keine Treiberunterstützung für 8 Bit, Konvertierung zu 16 Bit.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "Keine Treiberunterstützung für Mono, Konvertierung zu Stereo.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "Keine Treiberunterstützung für Stereo, Konvertierung zu Mono.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "Methode für Audio/Videosynchronisation"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -5313,11 +5248,11 @@ msgstr ""
"funktioniert nicht für digitales Passthrough, wo die Audiodaten in digitaler "
"Form direkt an einen externen Dekoder geleitet werden."
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr "Resampling benutzen"
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -5329,11 +5264,11 @@ msgstr ""
"Diese Adaption kann dauerhaft aktiviert, deaktiviert oder bei Bedarf "
"automatisch aktiviert werden."
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr "Wenn !=0, immer auf diese Rate anpassen"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
@@ -5343,11 +5278,11 @@ msgstr ""
"Durch Eingabe eines Wertes ungleich Null wird erzwungen, daß "
"Audiodatenströme immer auf die angegebene Rate resampled werden."
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr "Versatz für digitales Passthrough"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
@@ -5359,11 +5294,11 @@ msgstr ""
"Die Einheit dieses Wertes ist ein \"PTS-Tick\", was dem 90.000stel einer "
"Sekunde entspricht."
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr "Audiowiedergabe während langsamer/schneller Geschwindigkeit"
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -5376,79 +5311,79 @@ msgstr ""
"erhalten wollen, versuchen sie stattdessen das 'stretch' Audio-Wiedergabe-"
"Plugin."
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "Startlautstärke"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "Gesamtlautstärke beim Starten von xine."
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "Lautstärke beim Starten wiederherstellen"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"Wenn nicht angewählte, lässt xine die Lautstärke beim Starten unverändert."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"audio_out: Ups, das sollte eigentlich nicht passieren, bitte xine "
"neustarten.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr "xine-lib: buffer.c: Fataler Defekt: ZU VIELE FREIGABEN\n"
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
"Die Konfigurationsdatei wurde von einer neueren Version von xine modifiziert."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: Öffnen der DVB-Kanaldatei '%s' schlug fehl\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
"configfile: WARNUNG: Sichern der Konfigurationsdatei nach %s schlug fehl\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: WARNUNG: Ihre Konfigurationsdatei wird nicht gesichert\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: WARNUNG: Schreiben der Konfiguration nach %s schlug fehl\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: WARNUNG: Entferne möglicherweise kaputte Konfigurationsdatei %s\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: WARNUNG: Überprüfen Sie die Sicherheitskopie %s\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: Eintrag '%s' darf nicht per MRL geändert werden\n"
@@ -5466,58 +5401,58 @@ msgstr ""
"info_helper: Nichtunterstützte Konvertierung %s -> UTF-8, keine "
"Konvertierung durchgeführt\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ": open()-Funktion sollte niemals aufgerufen werden\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": Input-Plugin nicht definiert!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: Fehlschlag beim Lesen der gespeicherten Daten: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: Lesefehler im input_rip-Plugin\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: Schreibfehler in Datei bei %<PRIdMAX> Bytes: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: open()-Funktion sollte niemals aufgerufen werden\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: Positionierung fehlgeschlagen\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: Positionierung fehlgeschlagen: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %<PRIdMAX> Bytes verworfen\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: Input-Plugin nicht definiert!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -5526,7 +5461,7 @@ msgstr ""
"input_rip: Zielverzeichnis nicht angegeben, bitte die Option 'media.capture."
"save_dir' angeben\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5534,12 +5469,12 @@ msgstr ""
"Das Abspeichern von Datenströmen ist solange deaktiviert, bis media.capture."
"save_dir in der Konfiguration gesetzt ist."
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: Rippen/Zwischenspeichern dieser Quelle nicht erlaubt!\n"
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
@@ -5547,51 +5482,51 @@ msgstr ""
"xine darf diese Quelle nicht speichern. (Möglicherweise kopiergeschütztes "
"Material?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: Dateiname nicht angegeben!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_ipd: Fehler beim Öffnen der Datei %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: Warten aufgegeben\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "io_helper: Warten fehlgeschlagen: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "Status des Sockets konnte nicht ermittelt werden"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Zugriff verweigert\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Datei nicht gefunden\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Verbindung verweigert\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr "map_decoder_list: Kein Platz für Dekoder, übersprungen.\n"
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -5599,12 +5534,12 @@ msgstr ""
"load_plugins: Ignoriere Plugin %s, falsche iface-Version %d (sollte %d "
"sein)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "Priorität für Dekoder %s"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
@@ -5614,7 +5549,7 @@ msgstr ""
"Dekoder behandelt werden können.\n"
"Eine Priorität von 0 aktiviert den Dekoder mit seiner Standardpriorität."
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
@@ -5623,7 +5558,7 @@ msgstr ""
"load_plugins: Demultiplexer-Plugin %s liefert keine Priorität, xine-lib "
"benutzt die Standardpriorität.\n"
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -5632,44 +5567,44 @@ msgstr ""
"load_plugins: Input-Plugin %s liefert keine Priorität, xine-lib benutzt die "
"Standardpriorität.\n"
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: Plugin %s gefunden\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: statisches Plugin gefunden\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: Plugingrenze erreicht, %s konnte nicht geladen werden\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
"load_plugins: Plugingrenze erreicht, statisches Plugin konnte nicht geladen "
"werden\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: Unbekannter Plugintyp %d in %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: Unbekannter statisch eingebundener Plugintyp %d\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: Kann %s nicht untersuchen\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5678,7 +5613,7 @@ msgstr ""
"load_plugins: Kann Pluginbibliothek %s nicht öffnen:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5687,12 +5622,12 @@ msgstr ""
"load_plugins: Kann Plugininformation von %s nicht lesen:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: Überspringe unlesbares Pluginverzeichnis %s.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5701,42 +5636,47 @@ msgstr ""
"load_plugins: (Stufe 2) Kann Pluginbibliothek %s nicht öffnen:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: Dreck! %s enthält keine Plugininformation.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Kann DirectSound-Objekt nicht erzeugen."
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: Unbekannte Inhaltserkennungsstrategie %d\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: Benutze Demultiplexer '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: Audio-Plugin <%s> konnte nicht geladen werden\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5745,7 +5685,7 @@ msgstr ""
"load_plugins: Suche nach Audio-Ausgabe fand keinen benutzbaren "
"Audiotreiber.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5754,54 +5694,54 @@ msgstr ""
"load_plugins: Kann Pluginbibliothek %s nicht entladen:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "Zeichensatz '%s-%d' bereits geladen, seltsam.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "Laden des Zeichensatzs '%s' schlug fehl (%d <%d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr "Falsche Version von Zeichensatz '%s'. Erwartet %d gefunden %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: Kann ft2-Bibliothek nicht initialisieren\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: Fehler beim Suchen des Zeichensatzes %s mit FontConfig"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: Fehler beim Laden des Zeichensatzes %s mit FontConfig"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: Fehler beim Zusammenstellen des Zeichensatzes %s mit FontConfig"
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr "osd: Fehler beim Laden des Zeichensatzes %s mit ft2\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: Kann ft2-Bibliothek nicht initialisieren\n"
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
"osd: Fehler beim Setzen der Zeichensatzgröße (kein skalierbarer "
"Zeichensatz?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5810,48 +5750,48 @@ msgstr ""
"osd: Unbekannte Sequenz startet mit Byte 0x%02X in Kodierung \"%s\", "
"überspringe\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: Kann locale-Zeichensatz nicht erkennen\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr ""
"osd: Nichtunterstützte Konvertierung %s -> %s, keine Konvertierung "
"durchgeführt\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: Zeichensatz nicht definiert\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: Fehler beim Laden von Bildzeichen\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: Fehler beim Darstellen von Bildzeichen\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: Fehler beim Laden des Bildzeichens %i\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: Fehler beim Darstellen\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "Farbpalette (Vordergrund-Rand-Hintergrund) für Untertitel und OSD"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
@@ -5861,11 +5801,19 @@ msgstr ""
"Färbung spezifizieren. Die Paletten sind in der Form Vordergrund-Rand-"
"Hintergrund aufgelistst."
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5880,21 +5828,21 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: Kein Plugin gefunden zur Behandlung von '%s'\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: Fehler, unbekannter Puffertyp: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "Anzahl der Videopuffer"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5905,12 +5853,12 @@ msgstr ""
"unzuverlässigen Quellen, erhöhen aber auch die Latenzzeit und den "
"Speicherverbrauch."
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d Bilder angezeigt, %d Bilder übersprungen, %d Bilder verworfen\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -5919,16 +5867,16 @@ msgstr ""
"video_out: Verwerfe Bild mit pts %<PRId64>, weil es zu alt ist (Unterschied: "
"%<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5944,11 +5892,11 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr "Standardanzahl von Videobildern"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
@@ -5957,11 +5905,11 @@ msgstr ""
"angefordert werden. Einige Treiber überschreiben diese Einstellung mit ihren "
"eigenen Werten."
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "Erlaubter Prozentsatz für übersprungene Frames"
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
@@ -5969,11 +5917,11 @@ msgstr ""
"xine zeigt eine Meldung an, wenn mehr Frames als dieser Prozentsatz nicht "
"angezeigt werden, weil sie nicht rechtzeitig dekodiert werden konnten."
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "Erlaubter Prozentsatz für verworfene Frames"
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
@@ -5981,18 +5929,18 @@ msgstr ""
"xine zeigt eine Meldung an, wenn mehr Frames als dieser Prozentsatz nicht "
"angezeigt werden, weil sie nicht rechtzeitig dargestellt werden konnten."
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out : Ups, das sollte eigentlich nicht passieren, bitte xine "
"neustarten.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "Horizontale Bildposition im Ausgabefenster"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -6005,11 +5953,11 @@ msgstr ""
"Die Position wird als Prozentzahl angegeb: Der Wert 50 bedeutet \"in der "
"Mitte\", während 0 \"ganz links\" und 100 \"ganz rechts\" bedeuten."
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "Vertikale Bildposition im Ausgabefenster"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -6022,11 +5970,11 @@ msgstr ""
"Die Position wird als Prozentzahl angegeb: Der Wert 50 bedeutet \"in der "
"Mitte\", während 0 \"ganz oben\" und 100 \"ganz unten\" bedeuten."
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "Alle Videoskalierungen deaktivieren"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -6044,145 +5992,145 @@ msgstr ""
"einige Videoausgabetreiber wie XShm davon, deren Bildskalierung nicht "
"hardwarebeschleunigt ist, wodurch die CPU-Auslastung drastisch sinkt."
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: Fehler beim Parsen der MRL\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: Inputplugin gefunden: %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: Plugin kann MRL [%s] nicht öffnen\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: Kann kein Plugin für MRL [%s] finden\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: Demultiplexer-Plugins %s startete nicht\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: Join rip Plugin\n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: Fehler beim Öffnen einer RIP-Plugin-Instanz\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: Letztes Demultiplexer-Plugins %s startete nicht\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "Ignoriere Video\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "Ignoriere Audio\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "Ignoriere Untertitel\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr "Input-Cache Plugin deaktiviert\n"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "Untertitel-MRL öffnet '%s'\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: Fehler beim Öffnen der Untertitel-MRL\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: Fehler beim parsen der MRL\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: Das Ändern der Option '%s' per MRL ist verboten\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: Kann keinen Demultiplexer für >%s< finden\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: Kann keinen Demultiplexer für >%s< finden\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: Demultiplexer-Plugin gefunden: %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, fuzzy, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: Demultiplexer-Plugins startete nicht\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: Demultiplexer-Plugins startete nicht\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: Kein Demultiplexer vorhanden\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: Demultiplexer startete nicht\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr "xine: Das angegebene save_dir '%s' kann ein Sicherheitsproblem sein.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr "Das angegebene save_dir kann ein Sicherheitsproblem sein."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: Locale wird nicht von C-Bibliothek unterstützt\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "Medienformaterkennungsstrategie"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -6214,11 +6162,11 @@ msgstr ""
"extension\n"
"Nur anhand der Dateiendung erkennen.\n"
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "Pfad zum Sichen von Datenströmen"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -6233,11 +6181,11 @@ msgstr ""
"benutzt werden kann, um Dateien mit beliebigen Inhalt zu füllen. Stellen Sie "
"sicher, daß das Verzeichnis robust ist für beliebige Inhalte in jeder Datei."
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr "Erlaube implizierte Änderungen an Konfiguration (z.B. durch MRL)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -6253,11 +6201,11 @@ msgstr ""
"unvertrauenswürdigen Stellen empfangen kann. Falls diese willkürlichen "
"Änderungen erlaubt sind, kann dies zu einem verkonfigurierten xine führen."
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr "Zeitüberschreitung für Netzwerkdatenströme (in Sekunden)"
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
@@ -6268,75 +6216,75 @@ msgstr ""
"langsam ist oder die Bandbreite erschöpft ist. Zu hohe Werte können xine "
"einfrieren lassen, wenn die Verbindung abbricht."
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "Nachrichten"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "Plugin"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "Programmverfolgung"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Warnung:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "Unbekannter Rechner:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Unbekanntes Gerät:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Netzwerk unerreichbar"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Verbindung verweigert:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "Datei nicht gefunden:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Lesefehler von:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "Fehler beim Laden der Bibliothek:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "VerschRlüsselter Mediendatenstrom erkannt"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "Sicherheitsmeldung:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "Audiogerät nicht verfügbar"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Berechtigungsfehler"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "Datei ist leer:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "xines Methode zum Kopieren von Speicher"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
@@ -6347,7 +6295,7 @@ msgstr ""
"Methoden für dieses Kopieren, von denen normalerweise automatisch die beste "
"gewählt wird."
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Geschwindigkeitsvergleich der memcpy-Methoden (klein ist besser):\n"
diff --git a/po/en_US.po b/po/en_US.po
index c9d84b289..c6d6de694 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib.hg\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2009-01-15 19:04+0000\n"
"Last-Translator: Not translated <null@example.com>\n"
"Language-Team: en_US <none>\n"
@@ -263,199 +263,195 @@ msgid ""
"See the alsa documentation for information on alsa devices."
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr ""
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr ""
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr ""
@@ -485,11 +481,11 @@ msgid ""
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr ""
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr ""
@@ -523,7 +519,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr ""
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr ""
@@ -670,7 +666,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr ""
@@ -687,20 +683,20 @@ msgstr ""
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr ""
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr ""
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr ""
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -708,167 +704,26 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr ""
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
+#: src/combined/xine_ogg_demuxer.c:2173
+msgid "Annodex demux plugin"
msgstr ""
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
#: src/demuxers/demux_asf.c:450
@@ -889,6 +744,10 @@ msgstr ""
msgid "Media stream scrambled/encrypted"
msgstr ""
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr ""
@@ -908,16 +767,24 @@ msgstr ""
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr ""
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr ""
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -933,6 +800,10 @@ msgstr ""
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+msgid "Flash Video file demux plugin"
+msgstr ""
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -948,70 +819,81 @@ msgstr ""
msgid "iff: unknown Chunk: %s\n"
msgstr ""
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
"encrypted (encryption mode %d)\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
"encrypted (encryption mode %d)\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
"xine developers.\n"
msgstr ""
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
#: src/demuxers/demux_snd.c:100
@@ -1024,11 +906,19 @@ msgstr ""
msgid "demux_snd: unsupported audio type: %d\n"
msgstr ""
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+msgid "SND/AU file demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+msgid "True Audio demux plugin"
+msgstr ""
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1040,6 +930,10 @@ msgid ""
"unknown VOC compression type (0x%02X); please report to xine developers\n"
msgstr ""
+#: src/demuxers/demux_voc.c:336
+msgid "VOC file demux plugin"
+msgstr ""
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1050,36 +944,42 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr ""
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1095,11 +995,11 @@ msgid ""
"use of the Active Format Descriptor (AFD) used in some European DVB channels."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1107,19 +1007,19 @@ msgid ""
"This is relevant for progressive video only (most PAL films)."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1127,84 +1027,94 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr ""
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
"16\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1221,51 +1131,55 @@ msgid ""
"clock as sync source."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
"screen."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1279,22 +1193,22 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1305,7 +1219,7 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1316,11 +1230,11 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1352,22 +1266,22 @@ msgid ""
"of DXR3 overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
"when using DXR3 overlay mode."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1375,26 +1289,26 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1404,57 +1318,57 @@ msgid ""
"default: keep the card's setting"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
"video_out_dxr3: Read the README.dxr3 for details.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr ""
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr ""
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr ""
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr ""
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr ""
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1463,11 +1377,11 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1475,31 +1389,19 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr ""
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr ""
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1508,204 +1410,199 @@ msgid ""
"A value of zero here will disable the slowdown."
msgstr ""
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr ""
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr ""
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr ""
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr ""
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr ""
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr ""
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr ""
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
"T)\n"
msgstr ""
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
"C)\n"
msgstr ""
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
"A)\n"
msgstr ""
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr ""
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr ""
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
msgstr ""
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr ""
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr ""
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr ""
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
msgstr ""
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr ""
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr ""
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
msgstr ""
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr ""
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1716,68 +1613,55 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr ""
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr ""
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr ""
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr ""
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr ""
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1796,11 +1680,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr ""
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1814,11 +1698,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1835,128 +1719,128 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr ""
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr ""
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr ""
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr ""
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr ""
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr ""
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr ""
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr ""
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr ""
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr ""
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr ""
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr ""
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr ""
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr ""
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr ""
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr ""
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr ""
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr ""
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr ""
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr ""
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr ""
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr ""
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -1964,101 +1848,101 @@ msgid ""
"(full match required)."
msgstr ""
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr ""
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr ""
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr ""
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
msgstr ""
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr ""
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr ""
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr ""
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr ""
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr ""
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr ""
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr ""
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr ""
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr ""
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr ""
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr ""
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr ""
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr ""
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr ""
+
#: src/input/input_rtp.c:183
#, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2108,151 +1992,151 @@ msgstr ""
msgid "recv(): %s.\n"
msgstr ""
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr ""
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr ""
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr ""
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr ""
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr ""
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr ""
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr ""
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr ""
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr ""
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr ""
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr ""
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr ""
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr ""
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr ""
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr ""
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr ""
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr ""
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr ""
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
msgid "v4l ALSA audio input device"
msgstr ""
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr ""
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr ""
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr ""
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr ""
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr ""
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr ""
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr ""
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr ""
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr ""
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr ""
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr ""
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr ""
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr ""
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr ""
@@ -2331,19 +2215,19 @@ msgstr ""
msgid "Buffering..."
msgstr ""
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
"%s\n"
msgstr ""
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr ""
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr ""
@@ -2392,98 +2276,98 @@ msgstr ""
msgid "Invalid current entry type"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2504,11 +2388,11 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2516,11 +2400,11 @@ msgid ""
"See the help for the title_format for the meanings of these."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2537,85 +2421,170 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:830
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+msgid "dv audio decoder plugin"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
#: src/libreal/real_common.c:139
@@ -2631,11 +2600,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2656,122 +2620,150 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+msgid "closed caption decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr ""
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+msgid "sputext demuxer plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr ""
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
"in the subtitle being shown until the next one takes over."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -2779,11 +2771,11 @@ msgid ""
"used."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -2862,31 +2854,140 @@ msgstr ""
msgid "w32codec: Error initializing DMO Audio\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+msgid "win32 binary audio codec plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr ""
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -2894,6 +2995,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -2905,6 +3010,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -2929,6 +3038,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -2939,6 +3052,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -2995,48 +3112,60 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr ""
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr ""
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
msgstr ""
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr ""
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr ""
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr ""
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3048,7 +3177,12 @@ msgid ""
" h: the height of the picture\n"
msgstr ""
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3067,6 +3201,10 @@ msgid ""
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3082,20 +3220,8 @@ msgid ""
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
msgstr ""
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3122,7 +3248,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3137,7 +3292,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3155,7 +3310,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3163,12 +3322,16 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3197,11 +3360,126 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1798
+#, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2049
+#, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2089
+#, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr ""
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr ""
@@ -3240,8 +3518,8 @@ msgid "video colour key"
msgstr ""
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3313,30 +3591,30 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr ""
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr ""
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr ""
@@ -3353,22 +3631,22 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr ""
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
" Check 'fbset -i' or try 'fbset -depth 16'.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr ""
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3376,53 +3654,52 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
+#: src/video_out/video_out_fb.c:876
#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:950
+#: src/video_out/video_out_fb.c:933
#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+msgid "%s: %d video RAM buffers are available.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr ""
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr ""
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3451,29 +3728,29 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr ""
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr ""
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr ""
@@ -3492,6 +3769,10 @@ msgstr ""
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
+#: src/video_out/video_out_pgx32.c:864
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3525,57 +3806,61 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+#: src/video_out/video_out_pgx64.c:1486
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr ""
@@ -3597,190 +3882,122 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr ""
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr ""
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr ""
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -3790,78 +4007,75 @@ msgid ""
"\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -3869,324 +4083,136 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1592
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
+msgid "%s: this adaptor supports the %s format.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr ""
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-#: src/video_out/video_out_xv.c:364
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
"port.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
" for hardware colour space conversion and scaling\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4290,58 +4316,58 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr ""
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr ""
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4364,11 +4390,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr ""
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4376,33 +4402,33 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr ""
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr ""
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4410,73 +4436,73 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr ""
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr ""
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr ""
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr ""
@@ -4492,370 +4518,383 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr ""
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr ""
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr ""
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr ""
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
"'media.capture.save_dir'\n"
msgstr ""
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
msgstr ""
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr ""
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr ""
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr ""
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr ""
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr ""
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr ""
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr ""
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
"the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
"driver.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr ""
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr ""
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
+#, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1110
#, c-format
-msgid "osd: error loading font %s with ft2\n"
+msgid "osd: cannot initialize ft2 library\n"
msgstr ""
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
"skipping\n"
msgstr ""
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr ""
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr ""
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr ""
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr ""
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr ""
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr ""
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -4870,49 +4909,49 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr ""
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr ""
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
"(diff : %<PRId64>).\n"
msgstr ""
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -4928,46 +4967,46 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr ""
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -4975,11 +5014,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -4987,11 +5026,11 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr ""
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5002,145 +5041,145 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr ""
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr ""
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr ""
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr ""
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr ""
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr ""
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr ""
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr ""
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr ""
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr ""
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr ""
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr ""
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr ""
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr ""
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr ""
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr ""
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr ""
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr ""
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr ""
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5158,11 +5197,11 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr ""
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5172,11 +5211,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5186,93 +5225,93 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr ""
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr ""
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr ""
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr ""
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr ""
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr ""
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr ""
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr ""
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr ""
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr ""
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr ""
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr ""
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr ""
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr ""
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr ""
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr ""
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr ""
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr ""
diff --git a/po/eo.po b/po/eo.po
index 39779fa4d..743a35faa 100644
--- a/po/eo.po
+++ b/po/eo.po
@@ -12,7 +12,7 @@ msgid ""
msgstr ""
"Project-Id-Version: eo\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2007-05-24 17:57+0200\n"
"Last-Translator: Antonio C. Codazzi <f_sophia@libero.it>\n"
"Language-Team: <it@li.org>\n"
@@ -274,199 +274,195 @@ msgstr ""
"xine uzos tiun ĉi alsa-miksilon por ÅanÄi laÅ­tecon.\n"
"Legu dokumentaron de alsa por havi informojn pri aparatoj de alsa."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr "aŭdeliga xine-kromaĵo uzanta alsa-favorajn aŭdajn aparatojn/zorgilojn"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "kde-artsd-uzanta kromaĵo de aŭdeligo de xine"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "kromaĵo de aŭdeligo por Coreaudio/Mac OS X"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Eraro"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "sukceso"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "aliro rifuzita"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "risurco estas nune uzata"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "objekto estis jam pravalorizita"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "la specifita ondoformato ne estas subtenita"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "memorbufro estis perdita kaj Äi estas restarigenda"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "mendita bufradministrilo ne estas disponebla"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "nedifinita eraro en subsistemo de DirectSound"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "DirectSound hardvaparato estas nedisponebla"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "funkcio estas nevalida laÅ­ nuna stato de objekto"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "havigitaj parametroj estas nevalidaj"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "la objekto ne subtenas agragadon"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "neniu sonzorgilo estas disponebla por uzo"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "mendita COM interfaco ne estas disponebla"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "alia programo havas pli altan gradon de prioritato"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "nesufiĉa memoro"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "malalta grado de prioritato por tiu ĉi funkcio"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound ne estis pravalorizita"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "funkcio ne estas subtenita"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "nekonata eraro"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Mi estas nekapabla krei objekton de directsound"
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr "Estas neeble agordi gradon de kunagado por directsound"
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "Mi estas nekapabla krei duan bufron de directsound"
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "Estas neeble ludi aÅ­dobufron"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "Estas neeble fermi aÅ­dobufron"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "Estas neeble determini lokon de bufro"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "Estas neeble agordi lokadon de bufro"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "Estas neeble agordi laÅ­tecon"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": perdita bufro, mi provas restarigi Äin\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "Estas neeble bloki bufron de directsound"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "Estas neeble malbloki bufron de directsound"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "Mi estas nekapabla krei ĉefan bufro de directsound"
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, fuzzy, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ": indikilo de legado translimiÄis, do mi elbufriÄas\n"
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": estas neeble krei kondiĉon de pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": estas neeble krei pthread mutex: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": estas neeble krei bufron de pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": estas neeble detrui bufron de pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ": estas neeble detrui kondiĉon de pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": estas neeble detrui pthread mutex: %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ": nekonata komando de regado %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "dua direcx-uzanta kromaĵo de aŭdeligo de xine"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "direcx-uzanta kromaĵo de aŭdeligo de xine por win32"
@@ -496,11 +492,11 @@ msgid ""
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "aŭdeliga xine-kromaĵo uzanta esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "kromaĵo de aŭdeligo por xine dosiero"
@@ -536,7 +532,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "kromaĵo de aŭdeligo por Coreaudio/Mac OS X"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "testanta kromaĵo de aŭdeligo de xine"
@@ -696,7 +692,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: open() de miksilo %s malsukcesis: %s\n"
@@ -714,20 +710,20 @@ msgstr "aparato uzata por pulsa aÅ­do"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr "uzu 'server[:sink]' por agordi aparato de pulsa aÅ­do."
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "aŭdeliga xine-kromaĵo uzanta sonservilon de pulseaudio"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: malfermo de aÅ­daparato %s malsukcesis: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "nomo de Sun aÅ­daparato"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -735,183 +731,31 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: aÅ­da ioctl super aparato %s malsukcesis: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"kromaĵo de xine-aŭdligo kiu uzas aŭdajn aparatojn/zorgiloj SUN-favorajn"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: agordo de bufro je %d por eviti troon.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_audio_dec: estas neeble trovi malkodilo de ffmpeg por bufrospeco 0x"
-"%X\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: mi provas malfermi nulan kodaĵon\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: estas neeble malfermi malkodilon\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: estas neeble malfermi malkodilon\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "dvaudio: agordo de bufro je %d por eviti troon.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-"ffmpeg_video_dec: nesubtenita formato de bildero, DR1 estas malebligita.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-"ffmpeg_video_dec: nesubtenitaj dimensioj de bildero, DR1 estas malebligita.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_video_dec: estas neeble trovi malkodilo de ffmpeg por bufrospeco 0x"
-"%X\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: estas neeble malfermi malkodilon\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: estas neeble malfermi malkodilon\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: ebligita rekta bildigo\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_video_dec: agordo de bufro je %d por eviti troon.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "kvalito de MPEG-4 postprocesado"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-"Vi povas aranÄi kvanton de postprocezado aplikita al MPEG-4 video.\n"
-"Pli alta valoro atingas pli bonan kvaliton, sed Äi nacesas pli CPU. Malaltaj "
-"valoroj povas krei difektojn kiel blokartefaktojn. AnkaÅ­ se la enhavo estas "
-"altkvalita, grava postprocezado povas igi bildon pli aĉa ĉar Äi estas tro "
-"malfokusita."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "bitkvanto de mpeg eligo por libavcodec (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
+"ogg: vorbis-aŭdotrako estas indikita sed nenio ĉapo de vorbis-datumstrio "
+"estis trovita.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "moduso de konstanta kvalito"
+#: src/combined/xine_ogg_demuxer.c:2173
+#, fuzzy
+msgid "Annodex demux plugin"
+msgstr "xine: malmuksora kromaĵo estis trovita: %s\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
-"Se Äi estas ebligita, libavcodec uzos moduson de konstanta kvalito per "
-"dinamika kompleksecbazita kunpremado de la bildoj. Se Äi estas malebligita, "
-"libavcodec uzos moduson de konstanta bitkvanto."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "minimuma kunpremo"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
-msgstr "Minimuma kunpremo aplikenda al bildo kun moduso de konstanta kvalito."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr "maksimuma ciferecigilo"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
-msgstr "Maksimuma kunpremo aplikenda al bildo kun moduso de konstanta kvalito."
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -931,6 +775,10 @@ msgstr "demux_asf: averto: datumstrio id=%d estas cifrata.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Plurmedia datumstrio estas cifrata"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Restarigo de indekso..."
@@ -950,16 +798,24 @@ msgstr "demux_avi: avi-indekso estas difektita\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr "demux_avi: relokado al sekva parto malsukcesis (pos %<PRIdMAX>)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "nevalida grando por peco de FILMo\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "nerekonata peco de FILMo\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -975,6 +831,11 @@ msgstr ""
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "Eniga kromaĵo por Videa KD (VCD)"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -990,12 +851,20 @@ msgstr "iff-ilbm: kunpremo nekonata: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: peco nekonata: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr "demux_mpc: filmero estas tro granda por bufro"
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1004,7 +873,7 @@ msgstr ""
"xine-lib:demux_mpeg_block: Nerokonita datumstrio_id 0x%02x. Bonvolu komuniki "
"tion al disvolvantoj de xine.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
@@ -1012,12 +881,12 @@ msgstr ""
"demux_mpeg_block: eraro de malokupo! Bonvolu komuniki tion al disvolvantoj "
"de xine.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr "demux_mpeg_block: averto: PES-ĉapo rezervis 10 netrovitajn bitojn\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1026,7 +895,11 @@ msgstr ""
"demux_mpeg_block: averto: PES-ĉapo indikas ke tiu ĉi datumstrio eble estas "
"cifrata (moduso de cifrado %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1035,18 +908,18 @@ msgstr ""
"xine-lib:demux_mpeg_pes: Nerekonita datumstrio_id 0x%02x. Bonvolu komuniki "
"tion al disvolvantoj de xine.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
"demux_mpeg_pes: averto: malcodado de PACK-datumstrio id=0x%x malsukcesis.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr "demux_mpeg_pes: averto: PES-ĉapo rezervis 10 netrovitajn bitojn\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1055,7 +928,7 @@ msgstr ""
"demux_mpeg_pes: averto: PES-ĉapo indikas ke tiu ĉi datumstrio eble estas "
"cifrata (moduso de cifrado %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1064,12 +937,9 @@ msgstr ""
"demux_mpeg_pes: Nerekonita privata datumstrio 1 0x%02x. Bonvolu komuniki "
"tion al disvolvantoj de xine.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
-"ogg: vorbis-aŭdotrako estas indikita sed nenio ĉapo de vorbis-datumstrio "
-"estis trovita.\n"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1081,11 +951,21 @@ msgstr "demux_snd: nevalidaj parametroj de ĉapo\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: nesubtenita aÅ­dospeco: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "eniga kromaĵo de dosiero"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: malmuksora kromaĵo estis trovita: %s\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1101,6 +981,11 @@ msgstr ""
"nekonata VOC-kunpremspeco (0x%02X); bonvolu komuniki tion al disvolvantoj de "
"xine\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "eniga kromaĵo de dosiero"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1112,36 +997,42 @@ msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr ""
"demux_wc3movie: okazis problemo dum Åargo de grandaj pecoj de paletro\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "Numero de DXR3 aparato"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: Malsukcesis malfermado de SPU-aparato %s (%s)\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "mendita butono ne estas disponebla\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr "dxr3_decode_video: Malsukcesis malfermo de stiraparato %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "Uzu informojn pri Pan & Skan"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1157,11 +1048,11 @@ msgid ""
"use of the Active Format Descriptor (AFD) used in some European DVB channels."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "provu sinkronigi videon por ĉiu filero"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1169,19 +1060,19 @@ msgid ""
"This is relevant for progressive video only (most PAL films)."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "uzu glatiga moduso de lego"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "Ebligante tiun ĉi opcion, glatiga moduso de lego estos utiligebla."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "korektu daÅ­ron de filmeroj en difektitaj datumstrioj"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1189,39 +1080,49 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Malfermo de videoaparato %s (%s) malsukcesis\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: skribo en aparato povus blokigi elbufrigon\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: skribo en videoaparato malsukcesis (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: ATENTU: kodo de filmerkvanto estas nekonata %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
"dxr3_decode_video: ATENTU: korektante kodon de filmerkvanto, de PAL en NTSC\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "Numero de DXR3 aparato"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: malsukcesis preparado de librte\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1230,46 +1131,46 @@ msgstr ""
"dxr3_mpeg_encoder: rte administras nur videograndojn kiuj estas multobloj de "
"16\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: malsukcesis akiro de kunteksto rte.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: estas neeble krei kodaĵon.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "bitkvanto de eligo de MPEG rte (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: estas neeble prepari la kunteston: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: estas neeble lanĉi kodon: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: Estas neeble lanĉi bibliotekon FAME\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "Kvalito de MPEG-kodigo por filmero"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1286,53 +1187,57 @@ msgid ""
"clock as sync source."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "inerÅangado de plataj kaj senkunaj liniojn"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
"screen."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "aldonu nigrajn bendojn por aranÄi proporciojn"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr "uzu glatigan moduson de lego por re-legado per mpeg-enkodilo"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Ebligante tiun ĉi opcion, glatiga moduso de lego estos uzebla por ne-MPEG-"
"aĵoj."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Malsukcesis malfermado de stiraparato %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Malsukcesis malfermado de videoaparato %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "enkodilo por ne-mpeg-aĵoj"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1346,23 +1251,23 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
"video_out_dxr3: malsukcesis preparado de Mpeg-enkodilo nomita libavicodec.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: malsukcesis preparado de Mpeg-enkodilo nomita rte.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: malsukcesis preparado de Mpeg-enkodilo nomita fame.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1373,7 +1278,7 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1384,11 +1289,11 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "moduso de videoeligo (TV aÅ­ surmeto)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1420,11 +1325,11 @@ msgid ""
"of DXR3 overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr "valoro de kromata Ålosilo de surmeto"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
@@ -1434,11 +1339,11 @@ msgstr ""
"Vi povas provi malsamajn valorojn, se vi vidas diafanajn fenestrojn kiam vi "
"uzas DXR3-moduson de surmeto."
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr "tolero de kromata Ålosilo de surmeto"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1446,11 +1351,11 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "tranĉu area de surmeto en supraj kaj subaj partoj"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1458,16 +1363,16 @@ msgstr ""
"Äœi formovas unu bilderolinion el supraj kaj subaj partoj de la surmeto. "
"Ebligu Äin, se estas verdaj linioj en supraj kaj subaj partoj de la surmeto."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: bonvolu lanĉi autocal, surmeto estas malebligita\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "favorata tv-moduso"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1483,12 +1388,12 @@ msgstr ""
"pal60: PAL - 60Hz\n"
"default: tenu agordojn de la sonkarto"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: agordado de videomoduso malsukcesis.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1497,47 +1402,47 @@ msgstr ""
"video_out_dxr3: Estas necese mpeg enkodilo por legi ne-mpeg videoj en dxr3\n"
"video_out_dxr3: Legu README.dxr3 por pluaj detaloj.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: ERARO dum lego de preparaddosiero de surmeto. Lanĉu "
"autocal!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: estas neeble konektigi %s:%d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: sukcesa konekto kun cddb servilo '%s:%d'.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: malsukcesa konekto kun cddb servilo '%s:%d' (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "KD DiÄita AÅ­do (alie CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr ""
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "informmendo de CDDB"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1546,11 +1451,11 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "Nomo de servilo de CDDB"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1558,31 +1463,19 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "Servilpordo de CDDB"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "Dosierujo de kaÅmemoro de CDDB"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "Malrapidigu disk-turnilon per faktoro je tiu ĉi rapideco"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1591,60 +1484,60 @@ msgid ""
"A value of zero here will disable the slowdown."
msgstr ""
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, fuzzy, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: malsukcesis malfermo de dosiero de dvb-kanalo '%s'\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, fuzzy, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: malsukcesis malfermo de dosiero de dvb-kanalo '%s'\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: tuner_set_channel malsukcesis\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: estas neeble malfermi dvb-aparaton\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr "input_dvb: kanalo %d estas ekstera de intervalo, agordante je 0\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: serĉante kanalon %s\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
"input_dvb: preciza kongruo ne estis trovita por %s: provante partan "
"kongruon\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: estas trovita kongrua kanalo %s\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
"input_dvb: kanalo %s ne trovita en channels.conf, agordante per defaÅ­lto.\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
@@ -1653,20 +1546,20 @@ msgstr ""
"input_dvb: nevalida specifo de kanalo, defaÅ­lte agordante per valoroj de "
"lasta vidita kanalo.\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
"input_dvb: nevalida specifo de kanalo, defaÅ­lte agordante al kanalo 0\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1675,7 +1568,7 @@ msgstr ""
"input_dvb: dvbt mrl estis specifita sed sintonizilo Åajnas ne esti OFDM (DVB-"
"T)\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1684,7 +1577,7 @@ msgstr ""
"input_dvb: dvbt mrl estis specifita sed sintonizilo Åajnas ne esti QAM (DVB-"
"C)\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, fuzzy, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1693,21 +1586,21 @@ msgstr ""
"input_dvb: dvbt mrl estis specifita sed sintonizilo Åajnas ne esti QAM (DVB-"
"C)\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: estas neeble malfermi dvr-aparaton '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_dvb: estas neeble krei fadenon de Äisdatigo EPG\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr "uzu 'centran tranĉon' DVB (zomo)"
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -1715,94 +1608,89 @@ msgstr ""
"Äœi ebligas tutekrame vidigon laÅ­ entenoj kiu havas formato de 4:3 sed "
"elsenditaj per filmeroj en 16:9-formato."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "eniga kromaĵo por DVB (DiÄita TV)"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr "Memorigu lastan viditan DVB-kanalon"
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr "Lasta vidita DVB-kanalo"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "Numero de uzenda DVB-karto"
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "Numero de uzenda DVB-karto"
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Eraro dum la akirado de sekva bloko el DVD (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Eraro dum malfermado de DVD-apararo\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "aparato uzata por legi/ludi DVD"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
msgstr ""
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "kruda aparato agordita por eniro al DVD"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1813,68 +1701,55 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "Metodo de deĉifrado CSS"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr "raÅ­to por kaÅmemoro de Ålosiloj de titoloj"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "zono kie DVD-legilo deklari sian lokiÄon (de 1 Äis 8)"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "defaÅ­lta lingvo por legi/ludi DVD"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "lega-senkapa kaÅmemorigado"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "unito de preterlaso"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1893,11 +1768,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "unito de enpoziciigo"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1911,11 +1786,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr "moduso de lego kiam oni havigas titolon/ĉapitron"
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1932,128 +1807,128 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: eraro de lego (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Rifuzita permeso: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Netrovita dosierod: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Vakua dosiero: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "eniga kromaĵo de dosiero"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "startpunkto de foliumo"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "listo de kaÅitaj dosieroj"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr ""
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "gnome-vfs-eniga kromaĵo kiu estas entenata en xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s) malsukcesis: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: eraro de lego %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Konektigante servilon de HTTP..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: nevalida demando de http\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx-alidirektado: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: stato de http ne estas 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: entenlongo = %<PRIdMAX> bytes\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: bufro estis plenigita post %d bajtoj."
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "eniga kromaĵo por HTTP"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "HTTP-prokura ĉefkomputilo"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "Nomo de ĉefkomputilo por prokura servo de HTTP"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "HTTP-prokura pordo"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "Numero de pordo por prokura servo de HTTP"
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "HTTP-prokura uzantnomo"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "Nomo de uzanto por prokura servo de HTTP"
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "HTTP-prokura pasvorto"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "Pasvorto por prokura servo de HTTP"
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr "Domajnoj kiuj devas ignori prokuran servon de HTTP"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2064,26 +1939,26 @@ msgstr ""
"Se la nomo de domajno havas antaÅ­metan '=' do Äi estas konsiderita kiel "
"unuopa nomo de gastiga komputilo (plena kongruo estas necesa)."
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "eniga kromaĵo por MMS"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "bendolarÄo de reto"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "MMS-protokolo"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2091,76 +1966,76 @@ msgstr ""
"Elektu protokolon por enpakigita MMS.\n"
"TCP estas la plej bona sed povus necesi HTTP trans fajroÅirmo."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: mi estas nekapabla solvi '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: mi estas nekapabla konektigi '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "eniga xine-entenita kromaĵo de reto"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "eniga kromaĵo por pmn-datumstio"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: eraro dum kreado de dosiero pvr (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: eraro dum malfermado de dosiero pvr (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: eraro de lego (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: eraro dum malfermado de aparato %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_G_CODEC malsukcesis, ĉu API estas ÅanÄita?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_S_CODEC malsukcesis, ĉu API estas ÅanÄita?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "eniga kromaĵo WinTV-PVR 250/350"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "aparato uzata por WinTV-PVR 250/350 (pvr-kromaĵo)"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "RaÅ­to por la aparato de WinTV-karto."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "eniga kromaĵo WinTV-PVR 250/350"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2210,153 +2085,153 @@ msgstr "mi estas nekapabla bindi al '%s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: lego de fadeno estas haltanta...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: lego de fadeno finiÄis\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Malfermante >dosiernomon:%s pordon:%d interfacon:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: estas neeble krei novan fadenon (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "eniga kromaĵo entenata en xine por RTP kaj UDP"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "eniga kromaĵo por datumstrio de RTSP"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "CIFS/SMB-eniga kromaĵo bazita sur libsmbclient"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: estas neeble retro-enpoziciigi! (%<PRIdMAX> > %<PRIdMAX>)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: malsukcesis malfermo de '%s'\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "eniga kromaĵo por datumstrio de stdin"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Troo de bufro..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Maltroo de bufro..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "AranÄante..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Nomo de sintonizilo ne estis trovita\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "v4l eniga kromaĵo por tv"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "v4l eniga kromaĵo por radio"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "v4l videoaparato"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "RaÅ­to por videoaparato de Video4Linux."
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "v4l radiooaparato"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "RaÅ­to por videoaparato de Video4Linux."
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "v4l eniga kromaĵo por radio"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "v4l radiooaparato"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "RaÅ­to por radioaparato de Video4Linux"
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: difektita MRL. Uzu vcdo:/<track #>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: nevalida trako %d (valida intervalo: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "Eniga kromaĵo por Videa KD (VCD)"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "Mi estas nekapabla malfermi %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: mi estas nekapabla malfermi %s: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "Eniga kromaĵo por Videa KD (VCD)"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "aparato uzata por legi/ludi VCD"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr ""
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: nevalida mrl: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: malsukcesis konekto kun '%s'\n"
@@ -2437,7 +2312,7 @@ msgstr "nesubtenita protokolo\n"
msgid "Buffering..."
msgstr "Bufrado..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2446,12 +2321,12 @@ msgstr ""
"input_pnm: mesaÄo el servilo dum lego de datumstrio:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "nput_pnm: malsukcesis konekto '%s'\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: agordado de datumstrio malsukcesis\n"
@@ -2500,100 +2375,100 @@ msgstr "nula parametro de klaso estis havigita"
msgid "Invalid current entry type"
msgstr "Nevalida speco de nuna enigo"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-"Kromaĵo por Videa KD kun PBC kaj subteno por: (X)VCD, (X)SVCD, HQVCD, "
-"CVD ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "elekto ne havas eron de speco RETURN"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr "elektita DEFAULT, sed PBC ne estas ebligita."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "elekto ne havas eron de speco NEXT"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "elekto ne havas eron de speco PREVIOUS"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Nekonata speco de evento:"
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+"Kromaĵo por Videa KD kun PBC kaj subteno por: (X)VCD, (X)SVCD, HQVCD, "
+"CVD ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr "DefaÅ­lta speco de VCD uzenda por aÅ­tomata lego"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr "Lumdiskingo uzenda por VCD kiam Äi estas ne specifita"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr "intervalo de Åovindikilo por VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr "Ĉu lega-senkapa kaÅmemorigo de VCD?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr "Tiu ĉi klaso povas kaŭzi singultan legadon laŭ malrapidaj komputiloj."
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr "mem-pluiro laÅ­ trako/ero de VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr "montru LID de \"rifuzitaj\" VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr "VDC-formata Ĉeno por vidigi rulbandon"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2614,11 +2489,11 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr "VDC-formata Ĉeno por fako de komento pri datumstrio"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2626,11 +2501,11 @@ msgid ""
"See the help for the title_format for the meanings of these."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr "Masko de flago por sencimigi VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2647,86 +2522,186 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "HELPO! Ĉu nur unufonia aŭdozorgilo?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: agordo de bufro je %d por eviti troon.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "A/52 laÅ­teco"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_audio_dec: estas neeble trovi malkodilo de ffmpeg por bufrospeco 0x"
+"%X\n"
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: mi provas malfermi nulan kodaĵon\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: estas neeble malfermi malkodilon\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: estas neeble malfermi malkodilon\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "uzu A/52 dinamikan kunpremon"
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "dvaudio: agordo de bufro je %d por eviti troon.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "v4l eniga kromaĵo por radio"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "bitkvanto de mpeg eligo por libavcodec (kbit/s)"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "downmix aÅ­do kun 2 (surround) stereaj kanaloj"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "moduso de konstanta kvalito"
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
+"Se Äi estas ebligita, libavcodec uzos moduson de konstanta kvalito per "
+"dinamika kompleksecbazita kunpremado de la bildoj. Se Äi estas malebligita, "
+"libavcodec uzos moduson de konstanta bitkvanto."
-#: src/libfaad/xine_faad_decoder.c:136
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "minimuma kunpremo"
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr "Minimuma kunpremo aplikenda al bildo kun moduso de konstanta kvalito."
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr "maksimuma ciferecigilo"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr "Maksimuma kunpremo aplikenda al bildo kun moduso de konstanta kvalito."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad NeAACDecOpen() malsukcesis.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr ""
+"ffmpeg_video_dec: nesubtenita formato de bildero, DR1 estas malebligita.\n"
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit2 malsukcesis.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr ""
+"ffmpeg_video_dec: nesubtenitaj dimensioj de bildero, DR1 estas malebligita.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit malsukcesis.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_video_dec: estas neeble trovi malkodilo de ffmpeg por bufrospeco 0x"
+"%X\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: estas neeble malfermi malkodilon\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, fuzzy, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr "libmusepack: mpc_decoder_initialise malsukcesis\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: estas neeble malfermi malkodilon\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr "libmusepack: mpc_streaminfo_read malsukcesis: %d\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: ebligita rekta bildigo\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr "libmusepack: datumoj post lasta filmero estis ignorataj\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_video_dec: agordo de bufro je %d por eviti troon.\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr "libmusepack: mpc_decoder_initialise malsukcesis\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr "libmusepack: mpc_decoder_decode malsukcesis: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "kvalito de MPEG-4 postprocesado"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"Vi povas aranÄi kvanton de postprocezado aplikita al MPEG-4 video.\n"
+"Pli alta valoro atingas pli bonan kvaliton, sed Äi nacesas pli CPU. Malaltaj "
+"valoroj povas krei difektojn kiel blokartefaktojn. AnkaÅ­ se la enhavo estas "
+"altkvalita, grava postprocezado povas igi bildon pli aĉa ĉar Äi estas tro "
+"malfokusita."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
#: src/libreal/real_common.c:139
msgid "path to RealPlayer codecs"
@@ -2741,12 +2716,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-"libreal: Eraro dum solvado de simboloj! (ĉu nekompatibileco de versioj?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2767,75 +2736,103 @@ msgstr "libareal: agordado de malkodilspeco malsukcesis, erarkodo: 0x%x\n"
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: huj, ĉu REAL povas uzi pli ol 2 kanalojn ?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+"libreal: Eraro dum solvado de simboloj! (ĉu nekompatibileco de versioj?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "vidigu fermitajn ĉapitrojn en MPEG-2 datumstrioj"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
"Fermitaj Ĉapitroj estas surskribaĵojn kutime uzatajn por helpi surdulojn."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "skemo de fonaj/malfonaj koloroj por fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Elektu vian favoratan bildigon por fermitaj ĉapitroj."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "defaŭlta tiparo de fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Elektu tiparon por defaŭlta teksto de fermitaj ĉapitroj."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "kursivo por fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "Elektu tiparon por kursiva teksto de fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "tipargrando por fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr "Elektu tipargrandon por teksto de fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "centrigo de fermitaj ĉapitroj"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "tipargrando por fermitaj ĉapitroj"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "tiparo por eksteraj surskribaĵoj"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr "vertikala deÅovo de surskribaĵoj (rilata al fenestrogrando)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "kodo de surskribaĵoj"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: malmuksora kromaĵo estis trovita: %s\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "defaŭlta pludaŭro de surskribaĵoj en sekundoj"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -2845,49 +2842,52 @@ msgstr ""
"vi povas ĉi tie agordi defaŭltan pludaŭro. Agordante je nulo, la surskribaĵo "
"pludaÅ­ras Äis anstataÅ­igo de Äi per la sekvanta."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "grando de surskribaĵoj"
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "vertikala deÅovo de surskribaĵoj"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "tiparo por surskribaĵoj"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
"Tipardosiero (el dosierujo de tiparoj de xine) uzenda por surskribaĵoj."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr "Ekstera tipardosiero (ekz. .ttf) uzenda por surskribaĵoj."
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr "uzu libertiparan tiparon, se Äi estas farebla"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "kodo de surskribaĵoj"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -2898,11 +2898,11 @@ msgstr ""
"bildigi ne-ASCII-ajn tipojn. Se ne-ASCII-ajn tipojn ne estas vidigitaj kiel "
"vi supozas, demandu al kreanto de surskribaĵoj pri uzata kodo."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "uzu neskalitan OSD, se Äi estas farebla"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -2994,31 +2994,141 @@ msgstr "w32codec: Eraro dum preparado de DirectShow AÅ­do\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: Eraro dum preparado de DMO AÅ­do\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "kromaĵo de aŭdeligo por xine dosiero"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "HELPO! Ĉu nur unufonia aŭdozorgilo?!\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "A/52 laÅ­teco"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "uzu A/52 dinamikan kunpremon"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "downmix aÅ­do kun 2 (surround) stereaj kanaloj"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad NeAACDecOpen() malsukcesis.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit2 malsukcesis.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit malsukcesis.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, fuzzy, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr "libmusepack: mpc_decoder_initialise malsukcesis\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr "libmusepack: mpc_streaminfo_read malsukcesis: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr "libmusepack: datumoj post lasta filmero estis ignorataj\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr "libmusepack: mpc_decoder_initialise malsukcesis\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr "libmusepack: mpc_decoder_decode malsukcesis: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: eraro dum malkumpremado de ByteRun1\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 nun ne estas ankoraÅ­ subtenita\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 nun ne estas ankoraÅ­ subtenita\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ nun ne estas ankoraÅ­ subtenita\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: Tiu ĉi anim-speco nun ne estas ankoraŭ subtenita\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3029,6 +3139,10 @@ msgstr ""
"rapide per iu faktoro. La tembro estas, laÅ­pete, konservita, do vi povas uzi "
"tion, ekzemple, por vidi filmon dum pli mallonga tempo.\n"
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3040,6 +3154,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3067,6 +3185,11 @@ msgstr[1] ": miksante unuopan kanalon el originala datumstrio je %d kanaloj.\n"
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ": aÅ­daparato ne kapablas uzi AO_CAP_MODE_STEREO.\n"
+#: src/post/audio/upmix_mono.c:346
+#, fuzzy
+msgid "converts Mono into Stereo"
+msgstr ": miksante de Unuofonio al Sterefonio.\n"
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3077,6 +3200,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3133,17 +3260,25 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr ""
"tvtime: Neniu disponebla metodo de malplektado; do estas devige eliri.\n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "kreotaj filmeroj por sekundo"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3151,27 +3286,27 @@ msgstr ""
"Ju pli filmeroj por sekundo, des pli rapida kaj pli flua estos la animacio, "
"sed Äi necesos pli povumon de CPU."
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr "larÄo de goom-bildo"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "LarÄo en bilderoj de la bildo kiu estos kreita."
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr "alto de goom-bildo"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "Alto en bilderoj de la bildo kiu estos kreita."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr "metodo de kolor-konvertado"
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
@@ -3179,7 +3314,11 @@ msgstr ""
"Vi povas elekti metodon de kolor-konvertado kiu estas uzata far goom.\n"
"La disponeblaj elektadoj devus estis mem-esplikantaj."
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3199,7 +3338,12 @@ msgstr ""
" w: larÄo de la bildo\n"
" h: alto de la bildo\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3225,6 +3369,10 @@ msgstr ""
"\n"
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3240,20 +3388,8 @@ msgid ""
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
msgstr ""
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3280,7 +3416,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3295,7 +3460,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3313,7 +3478,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3325,12 +3494,16 @@ msgstr ""
"Parametoj\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3359,11 +3532,126 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: lego de fadeno estas haltanta...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: lego de fadeno estas haltanta...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "stdin: malsukcesis malfermo de '%s'\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: malsukcesis konekto kun '%s'\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: estas neeble konektigi %s:%d\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "stdin: malsukcesis malfermo de '%s'\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: estas neeble krei novan fadenon (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "videoeliga kromaĵo de xine uzas bibliotekon ascii-art"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "videoeliga kromaĵo de xine uzas bibliotekon de Color AsCii Art"
@@ -3402,8 +3690,8 @@ msgid "video colour key"
msgstr "videa kolorÅlosilo"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3477,30 +3765,30 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr "ID de videotavolo (auto: -1)"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr "Elektu videoeligan tavolon per sia ID"
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_directfb: uzante vidigantan tavolon #%d.\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "videoeliga xine-kromaĵo uzas DirectFB."
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr "video_out_directfb: neniu vidigantan tavolon estis trovita!\n"
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "videoeliga xine-kromaĵo uzas DirectFB sub XDirectFB."
@@ -3517,11 +3805,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "videoeliga kromaĵo de xine por win32 uzas directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -3530,11 +3818,11 @@ msgstr ""
"video_out_fb: estas subtenita nur enpakigita verkoloro/rektkoloro (%d).\n"
" Kontrolu per 'fbset -i' aÅ­ provu 'fbset -depth 16'.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "nomo de kvadrobrufrilo"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3542,21 +3830,20 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out_fb: Videomoduso ne estis rekonita, mi bedaÅ­ras :-(\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: %d videaj RAM-bufroj estas disponeblaj.\n"
-#: src/video_out/video_out_fb.c:956
-#, c-format
+#: src/video_out/video_out_fb.c:939
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
@@ -3566,41 +3853,43 @@ msgstr ""
"kadrobufra \n"
" difino povus helpi.\n"
-#: src/video_out/video_out_fb.c:967
-#, c-format
+#: src/video_out/video_out_fb.c:950
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
"ATENTU: video_out_fb: la nulkopiaj bufroj estas MALEBLIGITAJ ĉar zorgilo de "
"kerno\n"
" ne subtenas delokadon de ekrano (uzata por inversigoj de filmeroj).\n"
-#: src/video_out/video_out_fb.c:1036
-#, c-format
+#: src/video_out/video_out_fb.c:1019
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"WARNING: video_out_fb: la profundeco de nuna ekranbloko estas je %d. Por "
-"havi\n"
-" pli bona performanco, oni rekomendas profundecon je 16 bpp!\n"
+"\n"
+"\n"
+"ATENTU: nuna profundeco por ekranbloko estas %d. Por havi pli bonan "
+"performancon, \n"
+"oni rekomendas profundecon je 16 bpp!\n"
"\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr "videoeliga kromaĵo de xine uzas kadrobufrilon de Linukso"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "videoeliga xine-kromaĵo kiu vidigas nenion"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr "Bildigo de OpenGL"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3629,11 +3918,11 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr "Minimuma filmerkvanto por OpenGL"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
@@ -3641,19 +3930,19 @@ msgstr ""
"Minimuma filmerkvanto por animacioj.\n"
"Ĝi estas ignorita por statikaĵoj.\n"
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "ebligu duoblan bufradon"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "videoeliga kromaĵo de xine uzas 3D-grafikan API de OpenGL"
@@ -3673,6 +3962,11 @@ msgstr "video_out_pgx32: Eraro: ioctl malsukcesis, nevalida aparato (%s)\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr "video_out_pgx32: Eraro: '%s' ne estas pgx32-kadrobufrilo\n"
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr "videoeliga kromaĵo de xine uzas libvidix por linuksa kvadrobrufrilo"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3711,59 +4005,64 @@ msgstr "video_out_pgx64: Eraro: videa surmeto sur ĉi ekrano estas jam uzata\n"
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr "video_out_pgx64: Eraro: mi estas nekapabla agordi fenestron\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Atentu: eta videomemoro, plur-bufrado estas malebligita\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Eraro: nesufiĉa videomemoro\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Atentu: eta videomemoro, duobla-bufrado estas malebligita\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Error: ioctl malsukcesis (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr "kolorÅlosilo de videa surmeto"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr "ebligu Ålosiligon de kromata gamo"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "ebligu plur-bufradon"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr "videoeliga kromaĵo de xine uzas libvidix por linuksa kvadrobrufrilo"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "uzu hardvaran akcelado se Äi estas disponebla"
@@ -3785,208 +4084,126 @@ msgstr "sdl devas imiti 16-bitan surfacon, do tio malrapidigos ĉion.\n"
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: tutekrana moduso NE estas subtenita\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "videoeliga kromaĵo de xine uzas Simple Direct Media Layer"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr "videoeliga kromaĵo de xine uzas Libstk Surface Set-top Toolkit"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: eraro. (YUY2 ne estas subtenita de via grafika karto)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: eraro. (YV12 ne estas subtenita de via grafika karto)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: informo. (SyncFB-modjulo subtenas YUV 4:2:0 (3 plano))\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: informo. (SyncFB-modjulo subtenas YUV 4:2:0 (2 plano))\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr "video_out_syncfb: informo. (SyncFB-modjulo subtenas YUV 4:2:2)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: informo. (SyncFB-modjulo subtenas YUY2))\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: informo. (SyncFB-modjulo subtenas RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: ĉesigo. (SyncFB-modjulo ne subtenas YV12, YUY2 aŭ RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, fuzzy, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: informoj. (stirado de heleco/kontrasto ne estas disponebla "
-"ĉar via SyncFB-kernomodjulo Åajnas kadukiÄinta. Bonvolu legi README.syncfb "
-"por informoj pri Äisdatigo de Äi.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "defaÅ­lta nombro da ripetoj de filmeroj"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr "Tio difinas kiom da fojoj estos unu filmero estos vidigita sekve."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"videoeliga kromaĵo de xine estas uzanta la SyncFB-modjulon por Matrox G200/"
-"G400 kartoj"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "Nomo de SyncFB-aparato"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "ruÄintenso"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "verdintenso"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "bluintenso"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: adaptilo subtenas formaton yuy2\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: adaptilo subtenas formaton yv12\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: Erara versio de VIDIX-biblioteko\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr ""
"video_out_vidix: estas neeble trovi funkcikapablan zorgilon por VIDIX\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: uzante zorgilon: %s far de %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "ruÄa komponanto de kolorÅlosilo por videa surmeto"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "verda komponanto de kolorÅlosilo por videa surmeto"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "blua komponanto de kolorÅlosilo por videa surmeto"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "videoeliga kromaĵo de xine uzas libvidix por x11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr "videoeliga kromaĵo de xine uzas libvidix por linuksa kvadrobrufrilo"
-#: src/video_out/video_out_xcbshm.c:150
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
+#, c-format
+msgid "%s: %s: allocating image\n"
msgstr ""
-"video_out_xshm: %s: nomumante bildon\n"
-"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, fuzzy, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr "videoeliga kromaĵo de xine uzas MIT-etendilon por opuza memoro"
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, fuzzy, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
"video_out_xshm: eraro de opuza memoro (eraro de adreso) kiam oni nomumas "
"bildon \n"
"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbshm.c:170
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-"video_out_xshm: eraro de x11 dum kreado de XImage en opuza memoro\n"
-"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4002,90 +4219,81 @@ msgstr ""
"oni rekomendas profundecon je 16 bpp!\n"
"\n"
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, fuzzy, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
"video_out_xshm: MIT-etendilo por opuza memoro neĉeestas en ekranbloko.\n"
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, fuzzy, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
msgstr "video_out_xshm: videomoduso ne estis rekonita, mi bedaÅ­ras :-(\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr "videoeliga kromaĵo de xine uzas MIT-etendilon por opuza memoro"
-#: src/video_out/video_out_xcbxv.c:270
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
+#, c-format
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-"video_out_xv: XvShmCreateImage revenigis nulan grandon\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbxv.c:279
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
+#, c-format
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-"video_out_xv: eraro de opuza memoro en shmget: %s\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbxv.c:298
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbxv.c:285
+#, c-format
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-"video_out_xv: eraro de x11 dum kreado de XImage en opuza memoro\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, fuzzy, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr "video_out_xv: Xv-etendilo neĉeestas.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
"video_out_xxmc: Xv-etendilo ĉeestas sed estas neeble trovi uzeblan yuv12 "
"pordon.\n"
" Åœajnas ke la zorgilo de la grafika hardvaro ne subtenas Xv!\n"
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, fuzzy, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xxmc: uzante Xv-pordon %ld el adaptilo %s por konverto de hardvara "
"kolorspaco kaj skalado.\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -4093,199 +4301,44 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, fuzzy, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
+msgid "%s: this adaptor supports the %s format.\n"
msgstr "video_out_xv: tiu ĉi adaptilo subtenas formaton yv12.\n"
-#: src/video_out/video_out_xcbxv.c:1592
-#, fuzzy, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: tiu ĉi adaptilo subtenas formaton yuy2.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "metodo de malplektado (evitinda)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "videoeliga kromaĵo de xine uzas videan etendilon MIT X"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: eraro de opuza memoro kiam oni nomumas bildon\n"
-"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: %s: nomumante bildon\n"
-"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: eraro de opuza memoro (eraro de adreso) kiam oni nomumas "
-"bildon \n"
-"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: eraro de x11 dum kreado de XImage en opuza memoro\n"
-"video_out_xshm: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: MIT-etendilo por opuza memoro neĉeestas en ekranbloko.\n"
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: videomoduso ne estis rekonita, mi bedaÅ­ras :-(\n"
-
-#: src/video_out/video_out_xv.c:298
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage malsukcesis\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-"video_out_xv: XvShmCreateImage revenigis nulan grandon\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-"video_out_xv: eraro de opuza memoro en shmget: %s\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: eraro de x11 dum kreado de XImage en opuza memoro\n"
-"video_out_xv: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: Xv-etendilo neĉeestas.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xxmc: Xv-etendilo ĉeestas sed estas neeble trovi uzeblan yuv12 "
-"pordon.\n"
-" Åœajnas ke la zorgilo de la grafika hardvaro ne subtenas Xv!\n"
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
+#, fuzzy, c-format
msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xxmc: uzante Xv-pordon %ld el adaptilo %s por konverto de hardvara "
"kolorspaco kaj skalado.\n"
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: tiu ĉi adaptilo subtenas formaton yv12.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: tiu ĉi adaptilo subtenas formaton yuy2.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "videoeliga kromaĵo uzas videan etendilon de XvMC X"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: etendilo de XvMC neĉeestas.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -4294,7 +4347,7 @@ msgstr ""
"video_out_xvmc: la Xv-etendilo ĉeestas sed estas neeble trovi uzeblan yuv12 "
"pordon.\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -4303,124 +4356,57 @@ msgstr ""
"video_out_xvmc: uzante Xv-pordon %ld el adaptilo %s\n"
" por hardvara konverto de kolorspaco kaj skalado\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " idct kaj kompensado por akcelo de movo \n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " nur kompensado por akcelo de movo\n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " neniu XvMC-subteno \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " Kun Surmeto = %d; NesignitaIntra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage malsukcesis\n"
-"video_out_xxmc: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage revenigis nulan grandon\n"
-"video_out_xxmc: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: eraro de opuza memoro en shmget: %s\n"
-"video_out_xxmc: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: eraro de x11dum kreado de opuza memoro por XImage\n"
-"video_out_xxmc: => ne uzante etendilon de MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xxmc: etendilo de Xv neĉeestas.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xxmc: Xv-etendilo ĉeestas sed estas neeble trovi uzeblan yuv12 "
-"pordon.\n"
-" Åœajnas ke la zorgilo de la grafika hardvaro ne subtenas Xv!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xxmc: uzante Xv-pordon %ld el adaptilo %s por konverto de hardvara "
-"kolorspaco kaj skalado.\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xxmc: tiu ĉi adaptilo subtenas formaton yv12.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xxmc: tiu ĉi adaptilo subtenas formaton yuy2.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "videoeliga kromaĵo uzas videan etendilon de XvMC X"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr "Igu XvMc disponiganta de pluraj filemroj por la plej bona brufrado"
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr "Konservo de Unichrome CPU"
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr "Koretku cimajn colorojn de sub-bildoj por NVIDIA-XvMC"
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
@@ -4429,31 +4415,31 @@ msgstr ""
"koloron\n"
"kaj inverse. Tiu ĉi opcio havigas laboradon.\n"
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr "Uzu metodon nomitan bob kiel metodo de akcelita malplektado."
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4565,61 +4551,61 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: neniu disponebla kromaĵo por administi '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: eraro, nekonata speco de bufro: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "nombro da bufroj de aÅ­do"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
"audio_out: kalkulo de malfruo estas malebla kun nedisponebla aÅ­daparato\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, fuzzy, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr "skribo en sonkarto malsukcesis. Ĉu estas la USB-aparato nekonektita?\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr ""
"moduso de 8 bitoj ne estas subtenita de zorgiloj, konvertante en moduso de "
"16 bitoj.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "unufonio ne estas subtenita de zorgiloj, konvertante en stereofonio.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "stereofonio ne estas subtenita de zorgiloj, konvertante en unufonio.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "metodo de sinkronigo por aÅ­do kaj video"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4642,11 +4628,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr "ebligu re-sampladon"
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4654,33 +4640,33 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr "re-sampligu ĉiam per tiu ĉi kvanto (0 por malebligi)"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr "deÅovo por diÄita rekta transiro"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr "ludu aÅ­don ankaÅ­ se Äi estas rapida aÅ­ malrapida"
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4688,77 +4674,77 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "starta laÅ­teco"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "Äœenerala laÅ­teco kiu estos uzata dum preparado de xine."
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "restarigu nivelon de laÅ­teco dum preparado"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"Se Äi estas malebligita, xine ne povas ÅanÄi agordojn de miksilo dum "
"preparado."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr "audio_out: pardonu, tio ne devus okazi. bonvolu restartigi xine.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
"La nuna dosiero de agordoj estas modifita far de pli nova versio de xine."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: malsukcesis malfermo de dosiero de dvb-kanalo '%s'\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr "configfile: WARNING: reservado de configfile en %s malsukcesis\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: ATENTU: via agordaĵo ne estos konservita\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: ATENTU: skribo de agordaĵo en %s malsukcesis\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: ATENTU: formovovo de probable difektita dosiero de agordoj %s\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: ATENTU: kontrolu restaÅ­rdosieron %s\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: ero '%s' ne devas esti modifita el MRL\n"
@@ -4775,58 +4761,58 @@ msgid ""
msgstr ""
"info_helper: nesubtenita konvertado %s -> UTF-8, neniu transigo plenumiÄis\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ": la funkcio pen() neniam estas alvokenda\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": eniga kromaĵo ne estas difinita!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: lego de konservitaj datumoj malsukcesis: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: lego far de eniga kromaĵo malsukcesis\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: eraro dum skribo en dosiero laÅ­ %<PRIdMAX> bajtoj: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: la funkcio open() estas nepre alvokenda\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: enpoziciigado malsukcesis\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: enpoziciigado malsukcesis: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %<PRIdMAX> falitaj bajtoj\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: eniga kromaĵo ne estas difinita!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -4835,7 +4821,7 @@ msgstr ""
"input_rip: celdosierujo ne estas difinita, bonvolu kompletigi la opcion "
"'media.capture.save_dir'\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -4843,63 +4829,63 @@ msgstr ""
"La funkcio por konservi datumstrion estas malebligita Äis ne estos "
"kompletigita media.capture.save_dir fakon en la agordoj."
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: eltirado/kaÅmemorigado de ĉi fonto ne estas permesita!\n"
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
"xine ne estas ebligita konservi de tiu ĉi fonto. (ĉu Äi estas kopirajtigita?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: dosiernomo ne estas havigita!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: eraro dum malfermado de dosiero %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: nuligita atendado\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "io_helper: atendado malsukcesis: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "malsukcesis akiro de informoj pri stato de la kontaktoscatolo"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Rifuzita permeso\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Netrovita dosiero\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Rifuzita konektado\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr "map_decoder_list: neniu spaco por malkodilo, do Äi estis forlasita.\n"
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -4907,19 +4893,19 @@ msgstr ""
"load_plugins: kromaĵo %s estis ignorita, erara versio de interfaco %d (Äi "
"devas esti %d)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "antaÅ­eco por %s malkodilo"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
@@ -4928,7 +4914,7 @@ msgstr ""
"load_plugins: malmuksor-kromaĵo %s ne havigi antaŭecon, xine-lib uzos "
"defaÅ­ltan antaÅ­eco.\n"
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -4937,44 +4923,44 @@ msgstr ""
"load_plugins: eniga kromaĵo %s ne havigi antaŭecon, xine-lib uzos defaŭltan "
"antaÅ­eco.\n"
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: kromaĵo %s estis trovita\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: statika kromaĵo estis trovita\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: oni atingas limon de kromaĵo, estas neeble Åargi %s\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
"load_plugins: oni atingas limon de kromaĵo, estas neeble Åargi statikan "
"kromaĵon\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: nekonata kromaĵospeco %d en %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: nekonata statika kromaĵospeco %d\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: mi estas nekapabla trovi %s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -4983,7 +4969,7 @@ msgstr ""
"load_plugins: estas neeble malfermi bibliotekon de kromaĵo %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -4992,12 +4978,12 @@ msgstr ""
"load_plugins: estas neeble akiri informojn pri kromaĵo el %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: preterlasante nelegeblan kromaĵodosierujon %s.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5006,42 +4992,47 @@ msgstr ""
"load_plugins: estas neeble malfermi bibliotekon de kromaĵo %s (dua fazo):\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: Ve! %s ne entenas informojn pri kromaĵo.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Mi estas nekapabla krei objekton de directsound"
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: nekonata strategio de rekono de enhavo %d\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: uzante malmuksoron '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: Åargo de aÅ­deliga kromaĵo malsukcesis <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5049,7 +5040,7 @@ msgid ""
msgstr ""
"load_plugins: mem-rekonado de aÅ­deligo ne trovis uzelban aÅ­dozorgilon.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5058,54 +5049,54 @@ msgstr ""
"load_plugins: estas neeble malÅargi bibliotekon de kromaĵo %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "tiparo '%s-%d' jam estas Åargita, strange.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "Åargo de tiparo '%s' malsukcesis (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr "erara versio de tiparo '%s'. atendita %d trovita %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: estas neeble prepari ft2 bibliotekon\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: eraro dum kongruado de tiparo %s kun FontConfig"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: eraro dum Åargado de tiparo %s kun FontConfig"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: eraro dum serĉado de tiparo %s kun FontConfig"
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr "osd: eraro dum Åargado de tiparo %s kun ft2\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: estas neeble prepari ft2 bibliotekon\n"
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
"osd: eraro dum la argordado de tipargrando (ĉu Äi estas nereadaptebla "
"tiparo?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5113,57 +5104,65 @@ msgid ""
msgstr ""
"osd: nekonata sinsekvo startas je bajto 0x%02X en kodo\"%s\", do miforlasas\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: estas neeble trovi nunan lokan tiparon\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: nesubtenita konvertado %s -> %s, neniu konverto plenumiÄis\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: tiparo ne estas difinita\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: eraro dum Åargado de glyph\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: eraro de bildigo de glyph\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: eraro dum Åargado de glyph %i\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: eraro de bildigo\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "uzenda paletro (malfono-randoj-fono) por surskribaĵoj kaj OSD"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5178,34 +5177,34 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: neniu disponebla kromaĵo por administi '%s'\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: eraro, nekonata speco de bufro: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "nombro da videobufroj"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr ""
"%d filmeroj liveritaj, %d filmeroj forlasitaj, %d filmeroj formetitaj\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -5214,16 +5213,16 @@ msgstr ""
"video_out: bildo kun pts %<PRId64> estas rifuzita ĉar Äi estas tro malnova "
"(diff : %<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5239,46 +5238,46 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr "defaÅ­lta nombro da filmeroj"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "tolerenda procento je forlasitaj filmeroj"
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "tolerenda procento je formetitaj filmeroj"
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr "video_out: pardonu, tio ne devus okazi. bonvolu restartigi xine.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "horizontala lokiÄo de bildo en eligfenestro"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5286,11 +5285,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "vertikala lokiÄo de bildo en eligfenestro"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5298,11 +5297,11 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "malebligu readapton de video"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5313,146 +5312,146 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: eraro dum sintaksa analizo de mrl\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: trovita enigkromaĵo : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: eniga kromaĵo ne povas malfermi MRL [%s]\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: estas neeble trovi enigan kromaĵon por MRL [%s]\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: specifita malmuksoro %s malsukcesis starti\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: startigo de eniga kromaĵo por eltiri\n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: eraro dum malfermado de eniga kromaĵo por eltiri\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: lasta testita malmuksoro %s malsukcesis starti\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "ignorante videon\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "ignorante aÅ­don\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "ignorante sub-bildojn\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr "eniga kromaĵo por kaÅmemoro estas malebligita\n"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "mrl-surskribaĵo malfermita '%s'\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: eraro dum malfermado de mrl-surskribaĵo\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: eraro dum sintaksa analizo de MRL\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: ÅanÄo de opcio '%s' el MRL ne estas permesita\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: estas neeble trovi malmuksilo por >%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: estas neeble trovi malmuksilo por >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: malmuksora kromaĵo estis trovita: %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, fuzzy, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: malmuksoro malsukcesis starti\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: malmuksoro malsukcesis starti\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: neinu disponebla malmuksado\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: malmuksilo malsukcesis starti\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
"xine: La specifita savdosierujo \"%s\" povus esti danÄero por secureco.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr "La specifita savdosierujo povus esti danÄero por secureco."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: \"locale\" ne estas subtenita de C-biblioteko\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "strategio por rekoni plurmedian formaton"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5470,11 +5469,11 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "dosierujo por konservi datumstriojn"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5484,11 +5483,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr "ebligu implicitajn ÅanÄojn en la agordaĵo (ekz. far de MRL)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5498,93 +5497,93 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr "Tempofino por legado de ret-datumstrioj (en sekundoj)"
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "mesaÄoj"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "kromaĵo"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "bildigo"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Atentu:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "Nekonata gastiga komputilo:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Nekonata aparato:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Neatingebla reto"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Rifuzita konekto:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "Netrovita dosiero:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Eraro de lego el:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "Eraro dum Åargo de biblioteko:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "Ĉifrita datumstio estis rekonita"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "MesaÄo de sekureco:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "AÅ­daparato estas nedisponebla"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Eraro de permeso"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "Dosiero estas vakua:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "metodo de memorkopio uzata de xine"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Testo de rapideco por medoto de memorkopio (pli eta estas pli bona):\n"
diff --git a/po/es.po b/po/es.po
index a4200b779..fa24fd765 100644
--- a/po/es.po
+++ b/po/es.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib.hg\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2008-04-02 01:05+0200\n"
"Last-Translator: Carlos E. R. M. <carloser@users.sourceforge.net>\n"
"Language-Team: Spanish <none>\n"
@@ -328,201 +328,197 @@ msgstr ""
"xine usará este dispositivo mezclador alsa para cambiar el volumen.\n"
"Vea la documentación de alsa para información de dispositivos alsa."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
"complemento de xine de salida de audio usando dispositvos/drivers "
"compatibles alsa"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "complemento de xine de salida de audio usando artsd de kde"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "complemento de xine de salida de audio para Coreaudio/Mac OS X"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Error"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "éxito"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "acceso denegado"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "el recurso ya está siendo utilizado"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "el objecto ya fué inicializado"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "el formato de onda especificado no está soportado"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "el búfer en memoria se ha perdido y debe ser restaurado"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "el control del búfer pedido no está disponible"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "error indeterminado dentro del subsistema DirectSound"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "dispositivo físico DirectSound no disponible"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "función no válida para el estado actual del object"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "se ha pasado un parámetro inválido"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "el objeto no soporta agregación"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "no hay driver de sonido disponible para su uso"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "interfase COM solicitada no disponible"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "otra aplicación tiene un nivel de prioridad más alto"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "memoria insuficiente"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "nivel de prioridad bajo para ésta función"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound no fué inicializado"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "función no soportada"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "error desconocido"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Incapaz de crear el objeto de sonido directo."
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr "No pude poner el nivel cooperativo del sonido directo."
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "Incapaz de crear búfer secundario de sonido directo"
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "No pude tocar el búfer de sonido"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "No pude parar el búfer de sonido"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "No puedo conseguir la posición del búfer"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "No puedo poner la posición del búfer"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "No puedo poner el volumen de sonido"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": búfer perdido, intentando restaurar\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "No pude bloquear el búfer de sonido directo"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "No pude desbloquear el búfer de sonido directo"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "Incapaz de crear el búfer primario de sonido directo."
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, fuzzy, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ": cursor de ejecución desbordado, vaciando búffers\n"
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": no puedo crear condición pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": no puedo crear mutex pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": no puedo crear búfer pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": no puedo destruir búfer: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ": no puedo crear condición pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": no puedo destruir mutex pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ": comando de control desconocido %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "segundo complemento de xine de salida de audio usando directx"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr ""
"segundo complemento de xine de salida de audio para win32 usando directx"
@@ -556,11 +552,11 @@ msgstr ""
"introducir aquí un desfase fijo para compensar.\n"
"La unidad del valor es una marca PTS, que es 1/90000 segundo."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "complemento de xine de salida de audio usando esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "complemento de xine de salida de audio a fichero"
@@ -599,7 +595,7 @@ msgid "xine output plugin for JACK Audio Connection Kit"
msgstr ""
"complemento de xine de salida de audio para \"JACK Audio Connection Kit\""
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "complemento ficticio de xine de salida de audio "
@@ -809,7 +805,7 @@ msgstr ""
"El rango de este valor es -1 o 0-15. Este parámetro se ignora cuando el "
"nombre del dispositivo audio OSS está puesto a \"auto\"."
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: función open() mezclador %s falló: %s\n"
@@ -832,22 +828,22 @@ msgstr ""
"use 'server[:sink]' para definir el sumidero del dispositivo audio a pulsos."
# Cer: ¿pulseaudio?
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr ""
"complemento de xine de salida de audio usando servidor de sonido audio a "
"pulsos"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: fallo al abrir el dispositivo audio %s: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "Nombre del dispositivo audio de Sun"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -861,215 +857,32 @@ msgstr ""
"ello deberá ser usted cuidadoso de que el parámetro que introduzca sea "
"realmente un dispositivo audio de Sun."
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr ""
"audio_sun_out: fallo al abrir el controlador del dispositivo audio %s: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"complemento de xine de salida de audio usando dispositivos/drivers "
"compatibles sun"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"ffmpeg_audio_dec: incrementando el tamaño de la memoria tampón a %d para "
-"evitar el desbordamiento.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_audio_dec: no pude encontrar el decodificador ffmpeg para el tipo de "
-"tampón 0x%X\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: intentando abrir códec nulo\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: no pude abrir el decodificador\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: no pude abrir el decodificador\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"dvaudio: incrementando el tamaño de la memoria tampón a %d para evitar el "
-"desbordamiento.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: formato de cuadro no soportado, DR1 desactivado.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-"ffmpeg_video_dec: dimensiones de cuadro no soportadas, DR1 desactivado.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_video_dec: no pude encontrar el decodificador ffmpeg para el tipo de "
-"tampón 0x%X\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: no pude abrir el decodificador\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: no pude abrir el decodificador\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: renderizado directo activado\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"ffmpeg_video_dec: incrementando el tamaño de la memoria tampón a %d para "
-"evitar el desbordamiento.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "calidad de postprocesado MPEG-4"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-"Puede ajustar la cantidad de postprocesado aplicado a video MPEG-4.\n"
-"Valores más altos pueden resultar en mejor calidad, pero necesitarán más "
-"CPU. Valores más bajos resultarán en defectos de imagen como artefactos de "
-"bloque. Para contenido de alta calidad, demasiado postprocesado puede de "
-"hecho hacer la imagen peor emborronándola demasiado."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr "Conteo de hilos decodificando vídeo FFmpeg"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Puede ajustar el número de hilos decodificadores que pueda usar FFmpeg.\n"
-"Valores más altos deben acelerar la decodificación, pero depende del códec "
-"si se soporta procesado en paralelo. Una regla general es tener un hilo "
-"decodificador por cada CPU lógica (típicamente de 1 a 4). Un cambio hará "
-"efecto cuando se reproduzca el siguiente flujo."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr "Saltarse filtro de bucle"
-
-# Cer "saltar" por"skip" suena raro.
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Puede controlar para que cuadros el filtro de bucle será saltado después de "
-"decodificar.\n"
-"Omitir el filtro de bucle acelerará la decodificación, pero puede llevarnos "
-"a tener artefactos. El número de cuadros para los que se salta aumenta de "
-"'none' a 'all' (“nada†a “todosâ€). El valor por omisión deja la decisión en "
-"manos de la implementación.\n"
-"Un cambio de este ajuste tendrá efecto a la reproducción de siguiente flujo."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr "Elegir velocidad en vez de conformidad con la especificación"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Usted puede querer permitir trampas de velocidad que violan las "
-"especificaciones del códec.\n"
-"Hacer trampas puede acelerar la decodificación pero también provocar "
-"artefactos de decodificación.\n"
-"Un cambio de este ajuste tendrá efecto a la reproducción de siguiente flujo."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "tasa de bits salida mpeg de libavcodec (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-"La velocidad de salida (tasa de bits) que el codificador mpeg de libavcodec "
-"debería usar para el modo de codificado de DXR3. Valores más altos "
-"aumentarán la calidad y el uso de CPU.\n"
-"Este ajuste sólo se considera cuando el modo de calidad constante está "
-"desactivado."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "modo de calidad constante"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-"Cuando se activa, libavcodec usará un modo de calidad constante "
-"dinámicamente comprimiendo las imágenes basado en su complejidad. Cuando se "
-"desactiva, libavcodec usará el modo de tasa de bits constante."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "compresión mínima"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-"La mínima compresión a aplicar a una imagen en el modo de calidad constante."
+"ogg: pista de audio vorbis indicada pero cabecera de flujo de bits vorbis no "
+"encontrada.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr "cuantificador máximo"
+#: src/combined/xine_ogg_demuxer.c:2173
+msgid "Annodex demux plugin"
+msgstr "Complemento demultiplexor annodex"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
-msgstr ""
-"La máxima compresión a aplicar a una imagen en modo de calidad constante."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
+msgstr "Complemento demultiplexor OGG"
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -1089,6 +902,10 @@ msgstr "demux_asf: aviso: El flujo de bits (stream) id=%d está encriptado.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Flujo de bits del medio revuelto/encriptado"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr "Complemento demultiplexor ASF"
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Restaurando índice..."
@@ -1109,16 +926,24 @@ msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
"demux_avi: falló el posicionamiento al siguiente bloque (pos %<PRIdMAX>)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr "Complemento demultiplexor AVI/RIFF"
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "tamaño de bloque FILM inválido\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "bloque FILM no reconocido\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr "Complemento demultiplexor FILM (CPK)"
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1134,6 +959,10 @@ msgstr "no hay flujo de vídeo ni audio en este fichero.\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+msgid "Flash Video file demux plugin"
+msgstr "Complemento demultiplexor para fichero Flash Video"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1149,12 +978,20 @@ msgstr "iff-ilbm: compresión desconocida: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: Bloque no reconocido: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr "Complemento demultiplexor IFF"
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr "demux_mpc: marco demasiado grande para el búfer"
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr "Complemento demultiplexor Musepack"
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1163,7 +1000,7 @@ msgstr ""
"xine-lib:demux_mpeg_block: Identificador de flujo de bits no reconocido, "
"stream_id 0x%02x. Por favor, repórtelo a los desarrolladores de xine.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
@@ -1171,14 +1008,14 @@ msgstr ""
"demux_mpeg_block: ¡error! liberando. Por favor, repórtelo a los "
"desarrolladores de xine.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: aviso: 10 bits reservados de la cabecera PES no "
"encontrados\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1187,7 +1024,11 @@ msgstr ""
"demux_mpeg_block: aviso: la cabecera PES indica que este flujo de bits puede "
"estar encriptado (modo de encriptación %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr "Complemento demultiplexor DVD/VOB"
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1196,19 +1037,19 @@ msgstr ""
"xine-lib:demux_mpeg_pes: Identificador de flujo de bits no reconocido 0x"
"%02x. Por favor, repórtelo a los desarrolladores de xine.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
"demux_mpeg_pes: aviso: decodificado del flujo de bits PACK id=0x%x falló.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_pes: aviso: 10 bits reservados de la cabecera PES no encontrados\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1217,7 +1058,7 @@ msgstr ""
"demux_mpeg_pes: aviso: la cabecera PES indica que este flujo de bits puede "
"estar encriptado (modo de encriptación %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1226,12 +1067,9 @@ msgstr ""
"demux_mpeg_pes:flujo de bits privado 1 0x%02x. Por favor, repórtelo a los "
"desarrolladores de xine.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
-msgstr ""
-"ogg: pista de audio vorbis indicada pero cabecera de flujo de bits vorbis no "
-"encontrada.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
+msgstr "Complemento demultiplexor pes mpeg"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1243,11 +1081,19 @@ msgstr "demux_snd: parámetros de cabecera malos\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: tipo de audio no soportado: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+msgid "SND/AU file demux plugin"
+msgstr "Complemento demultiplexor para fichero SND/AU"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr "demux_tta: la cuenta total de cuadros es demasiado alta\n"
+#: src/demuxers/demux_tta.c:326
+msgid "True Audio demux plugin"
+msgstr "Complemento demultiplexor True Audio (audio verdadero)"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1263,6 +1109,10 @@ msgstr ""
"tipo de compresión VOC desconocida (0x%02X); Por favor, repórtelo a los "
"desarrolladores de xine\n"
+#: src/demuxers/demux_voc.c:336
+msgid "VOC file demux plugin"
+msgstr "Complemento demultiplexor fichero VOC"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1275,39 +1125,47 @@ msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr ""
"demux_wc3movie: Hubo un problema mientras se cargaban bloques de paleta\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "número de dispositivo DXR3"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr "Complemento demultiplexor Wing Commander III Movie (MVE)"
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-"Si tiene más de un DXR3 en su computadora, puede especificar cual debe "
-"usarse aquí."
+"complemento decodificador de subtítulos usando las capacidades "
+"decodificadoras en hardware de una tarjeta decodificadora DXR3"
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: Falló la apertura de dispositivo spu %s (%s)\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "botón pedido no disponible\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+"Complemento decodificador de MPEGI/II usando las capacidades decodificadoras "
+"en hardware de una tarjeta decodificadora DXR3."
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
"dxr3_decode_video: Fallí la apertura del dispositivo de control %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "use información Pan & Scan"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1338,11 +1196,11 @@ msgstr ""
"Esto hace uso del Descriptor de Formato Activo (AFD) usado en algunos "
"canales DVB europeos."
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "probar de sincronizar video en cada cuadro"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1355,19 +1213,19 @@ msgstr ""
"Esto es relevante sólo para video progresivo (la mayoría de las películas "
"PAL)."
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "use modo visualización suave (smooth play)"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "Activando esta opción se utilizará unmodo de visualización más suave."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "corregir las duraciones de los cuadros en flujos de bits rotos"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1380,28 +1238,28 @@ msgstr ""
"etiquetada como PAL. Actívelo únicamente cuando se encuentre un flujo de "
"bits de esa clase."
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Falló al abrir el dispositivo de vídeo %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: escribir al dispositivo se bloquearía. Vaciando\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: escritura al dispositivo de vídeo falló (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr ""
"dxr3_decode_video: AVISO: código de frecuencia de cuadro desconocido %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
@@ -1409,12 +1267,24 @@ msgstr ""
"dxr3_decode_video: AVISO: corrigiendo código de frecuencia de cuadro de de "
"PAL a NTSC\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "número de dispositivo DXR3"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+"Si tiene más de un DXR3 en su computadora, puede especificar cual debe "
+"usarse aquí."
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: falló al inicializar librte\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1423,21 +1293,21 @@ msgstr ""
"dxr3_mpeg_encoder: rte sólo maneja dimensiones de vídeo que son múltiplos de "
"16\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: falló en conseguir el contexto de rte.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: no pudo crear el códec.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "frecuencia de bits rte de salida mpeg (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
@@ -1446,26 +1316,26 @@ msgstr ""
"debiera usar para el modo codificación DXR3's. Los valores más altos "
"aumentarán la calidad y el uso de CPU."
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: no puedo inicializar el contexto: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: no puedo empezar a codificar: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: No pude arrancar la librería FAME\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "calidad del codificador fame mpeg"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1487,11 +1357,17 @@ msgstr ""
"usará el temporizador del sistema unix. Valores mayores de 5 fuerzan a usar "
"el reloj interno del DXR3's como fuente de sincronismo."
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+"complemento de salida de vídeo mostrando imágenes a través de su tarjeta "
+"decodificadora DXR3"
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "intercambiar lineas impares y pares"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1501,11 +1377,11 @@ msgstr ""
"Active esta opción para material no MPEG que produce una inestabilidad "
"vertical en la pantalla."
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "añade barras negras para corregir la razón de aspecto"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
@@ -1514,32 +1390,32 @@ msgstr ""
"tarjeta no puede manejar por si misma Esto es necesario para mantener las "
"proporciones de imagen adecuadas."
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr "use modo de ejecución suave para reproducción con codificador mpeg"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Activando esta opción utilizará un modo de ejecución más suave para "
"contenido no MPEG."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Falló la apertura del dispositivo de control %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Falló la apertura del dispositivo de vídeo %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "codificador para contenido no mpeg"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1563,23 +1439,23 @@ msgstr ""
"\"fame\" y \"rte\" siguen estando, pero su soporte por xine es anticuado, "
"así que pueden fallar."
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
"video_out_dxr3: el codificador de MPEG libavcodec falló al iniciarse.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: el codificador de MPEG rte falló al iniciarse.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: el codificador de MPEG fame falló al iniciarse.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1597,7 +1473,7 @@ msgstr ""
"video_out_dxr3: de vídeo. Vea README.dxr3 para detalles de como configurar "
"un codificador.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1616,11 +1492,11 @@ msgstr ""
"un codificador.\n"
# Overlay?
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "modo de salida de vídeo (TV u overlay)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1680,11 +1556,11 @@ msgstr ""
"conmutar al vuelo a salida de TV escondiendo la ventana de vídeo. Esta es la "
"variante común de superposición DXR3."
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr "superponer valor del código de color"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
@@ -1694,11 +1570,11 @@ msgstr ""
"Puede probar diferentes valores, si observa que las ventanas se vuelven "
"transparentes cuando usa modo superpuesto DXR3."
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr "tolerancia de código de color de superposición"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1710,11 +1586,11 @@ msgstr ""
"transparentes cuando usa modo superpuesto DXR3, pero partes de los bordes de "
"la imagen pueden desaparecer cuando use un ajuste demasiado bajo."
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "cortar el area de superposición arriba y abajo"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1722,17 +1598,17 @@ msgstr ""
"Quita una linea de pixels encima y debajo de la superposición. Active esto "
"si observa lineas verdes encima y debajo de la superposición."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr ""
"video_out_dxr3: por favor, ejecute autocal, superposición desactivada\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "modo preferido de TV"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1749,12 +1625,12 @@ msgstr ""
"pal60: PAL a 60Hz\n"
"default: mantener la configuración de la tarjeta"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: falló el establecimiento del modo de video..\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1764,37 +1640,37 @@ msgstr ""
"mpeg en DXR3\n"
"video_out_dxr3: Lea el README.dxr3 para más detalles.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: ERROR leyendo en fichero de inicialización de la "
"superposición. ¡Ejecute autocal!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: no se puede conectar a %s:%d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: conectado con éxito al servidor cddb '%s:%d'.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: falló al conectar al servidor cddb '%s:%d' (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "audio CD digital (alias CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "dispositivo usado para audio CD"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1802,11 +1678,11 @@ msgstr ""
"El camino al dispositivo, normalmente un lector de de CD o DVD, que desea "
"usar para reproducir CDs de audio."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "consultar la CDDB"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1820,11 +1696,11 @@ msgstr ""
"información se obtiene de un servidor en Internet que podría sacar un perfil "
"de sus hábitos de escucha."
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "nombre del servidor CDDB"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1837,37 +1713,20 @@ msgstr ""
"consultas con respuestas maliciosas. Asegúrese de poner un servidor del que "
"se pueda fiar."
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "puerto del servidor CDDB"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
"El puerto del servidor usado para obtener la información de título y pista."
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "directorio caché del CDDB"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-"Las respuestas del servidor CDDB serán almacenadas temporalmente en este "
-"directorio.\n"
-"Esta configuración es crítica para su seguridad, porque nombres sin control "
-"serán creados en este directorio. Asegúrese de poner un directorio dedicado "
-"que no se use para ninguna otra cosa que el cacheado del CDDB."
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "enlentecer la unidad de disco a este factor de velocidad"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1882,63 +1741,63 @@ msgstr ""
"que el enlentecimiento no afectaría el rendimiento de la reproducción.\n"
"Un valor de cero desactivará el enlentecimiento."
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: falló al abrir el fichero de canales'%s': %s\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr ""
"input_dvb: el fichero de canales dvb '%s' no es un fichero texto plano\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: falló tuner_set_channel\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr "input_dvb: IGU de DVB %s\n"
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: no puedo abrir dispositivo DVB\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr "input_dvb: canal %d fuera de rango, poniendo a 0\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: buscando el canal %s\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
"input_dvb: no encontrada una coincidencia exacta para %s: probando "
"coincidencias parciales\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: encontrado el canal correspondiente %s\n"
# Cer: (temporal) "valores por defecto" no es la traducción exacta
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
"input_dvb: canal %s no encontrado en channels.conf, yendo a valores por "
"defecto.\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
@@ -1947,12 +1806,12 @@ msgstr ""
"input_dvb: especificación de canal inválida, usaremos el ultimo canal "
"visualizado.\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr "input_dvb: especificación de canal inválida, usaremos el canal 0.\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
@@ -1961,7 +1820,7 @@ msgstr ""
"input_dvb: se especificó mrl dvbs pero el sintonizador no aparenta ser QPSK "
"(DVB-S)\n"
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1970,7 +1829,7 @@ msgstr ""
"input_dvb: se especificó mrl dvbt pero el sintonizador no aparenta ser OFDM "
"(DVB-T)\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1979,7 +1838,7 @@ msgstr ""
"input_dvb: se especificó mrl dvbc pero el sintonizador no aparenta ser QAM "
"(DVB-C)\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1988,21 +1847,21 @@ msgstr ""
"input_dvb: se especificó mrl dvba pero el sintonizador no aparenta ser ATSC "
"(DVB-A)\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: no se puede abrir el dispositivo DVR '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_dvb: no se puede crear el hilo actualizador de EPG\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr "usar corte de la zona central del DVB (zoom)"
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -2010,15 +1869,15 @@ msgstr ""
"Esto permitirá reproducción a pantalla completa de contenido en formato 4:3 "
"transmitido en un cuadro 16:9."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "complemento de entrada DVB (TV Digital)"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr "Recordar el último canal DVB visto"
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
@@ -2026,19 +1885,19 @@ msgstr ""
"En autoejecución, xine recordará y cambiará al canal indicado en media.dvb."
"last_channel. "
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr "Último canal DVB visto"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr "Si se activa xine recordará y cambiará a este canal. "
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr "Número de segundos hasta que la sintonización temporice."
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
@@ -2046,55 +1905,50 @@ msgstr ""
"Dejar como 0 significa probar indefinidamente. Mayor que cero significa "
"esperar esos segundos hasta conseguir un ajuste. El mínimo son 5 segundos."
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "Número de tarjeta DVB a usar."
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-"Dejar esto a cero a menos que realmemte tenga más de 1 tarjeta en sus "
-"sistema."
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr "Activar el IGU de DVB"
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
"Activar el IGU de DVB, grabación y cambio de canal controlados por ratón."
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "Número de tarjeta DVB a usar."
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
+"Dejar esto a cero a menos que realmemte tenga más de 1 tarjeta en sus "
+"sistema."
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr "input_dvd: ¡valores de \\beta darán lugar a 'dom'!\n"
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Error al conseguir el siguiente bloque desde el DVD (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Error abriendo dispositivo DVD\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr "Navegador de DVD"
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "dispositivo usado para reproducción de DVD"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -2102,11 +1956,11 @@ msgstr ""
"El camino al dispositivo, usualmente una unidad de DVD, que desea usar para "
"reproducir DVDs."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "dispositivo bruto usado para acceso al DVD"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -2125,11 +1979,11 @@ msgstr ""
"Vea la documentación de configuración de dispositivos en bruto (man raw) "
"para más información."
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "método de desencriptación CSS"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
@@ -2139,29 +1993,11 @@ msgstr ""
"DVDs protegidos de copia. Pruebe los varios métodos, si tiene problemas "
"reproduciendo DVDs cifrados."
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr "camino al caché de claves de títulos"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-"Puesto que rompler la protección de copia de DVDs crifrados puede consumir "
-"bastante tiempo, libdvdcss almacenará las claves rotas en éste directorio.\n"
-"Esta configuración es de seguridad crítica, porque en este directorio se "
-"crearán ficheros con nombres incontrolables. Asegúrse de usar un directorio "
-"dedicado que no se use para otra cosa excepto cacheado de claves de DVDs."
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "Región a la cual el reproductor de DVDs dice pertenecer (1 a 8)"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
@@ -2171,11 +2007,11 @@ msgstr ""
"código regional equivocado. No tiene nada ue ver con el código regional "
"puesto en los reproductores de DVD, esto es puramente software."
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "idioma por defecto para reproducción de DVD"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
@@ -2186,11 +2022,11 @@ msgstr ""
"idioma.\n"
"El valor debe ser un código de idioma de dos caracteres según ISO639."
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "caché de lectura adelantada"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
@@ -2200,11 +2036,11 @@ msgstr ""
"Esto puede dar lugar a reproducción a golpes en unidades lentas, pero mejora "
"el impacto del cambio de capa del DVD en unidades más rápidas."
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "unidad para la acción de salto (skip)"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -2240,11 +2076,11 @@ msgstr ""
"saltará un título del DVD, que es una unidad estructural representando "
"piezas completas en el DVD"
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "unidad para búsqueda"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -2269,11 +2105,11 @@ msgstr ""
"la busqueda abarcará un programa del DVD, que es una unidad navigacional "
"representando un capítulo de la feature actual"
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr "modo de ejecución cuando se da el título/capítulo"
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -2299,40 +2135,40 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: error de lectura (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Permiso denegado: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Fichero no encontrado: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Fichero vacío: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "complemento de fichero entrada"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "localización de comienzo de ojeado de ficheros"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
"El ojeador para seleccionar el fichero a reproducir comenzará en esta "
"localización."
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "listar ficheros ocultos"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
@@ -2340,91 +2176,91 @@ msgstr ""
"si se activa. el ojeador para seleccionar el fichero a reproducir también "
"mostrará los ficheros ocultos."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "complemento de entrada gnome-vfs tal como vino con xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s) falló: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: error de lectura %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Conectando servidor HTTP..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: respuesta http no válida\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: redirección 3xx: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: el estado de http no es 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: longitud del contenido = %<PRIdMAX> bytes\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: tampón agotado después de %d bytes."
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "complemento de entrada http"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "Servidor delegado de HTTP"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "El nombre del servidor delegado (\"proxy\") de HTTP."
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "Puerto del servidor delegado de HTTP"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "El número de puerto en el servidor delegado (\"proxy\") de HTTP."
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "Usuario en el servidor delegado de HTTP"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "El nombre de usuario en el servidor delegado de HTTP."
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "Contraseña en el servidor delegado de HTTP"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "La contraseña en el servidor delegado de HTTP."
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr "Dominios para los cuales se ignorará el servidor HTTP delegado"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2436,15 +2272,15 @@ msgstr ""
"Si un nombre de dominio se antecede con '=' entonces se trata como un "
"nombre de servidor sólamente (se requiere coincidencia completa)."
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "complemento de flujo de bits mms"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "ancho de banda de red"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
@@ -2454,11 +2290,11 @@ msgstr ""
"usará cuando servidores de flujos de bits ofrezcan diferentes versiones con "
"diferentes requisitos de ancho de banda del mismo flujo."
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "protocolo MMS"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2466,80 +2302,80 @@ msgstr ""
"Seleccione el protocolo para encapsular MMS.\n"
"TCP es mejor pero puede que necesite HTTP detrás de un cortafuegos."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: no se puede resolver '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: no se puede conectar a '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "complemento de entrada de red incluido en xine"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "complemento de flujo de bits pnm de entrada"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: error al crear el archivo pvr (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: error al abrir el archivo pvr (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: error de lectura (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: error al abrir el dispositivo %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
"input_pvr: IVTV_IOC_G_CODEC falló, ¿quizás cambió la API? (interfase para "
"programación de aplicaciones)\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
"input_pvr: IVTV_IOC_S_CODEC falló, ¿quizás cambió la API? (interfase para "
"programación de aplicaciones)\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "complemento de entrada para WinTV-PVR 250/350"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "dispositivo usado para WinTV-PVR 250/350 (complemento pvr)"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "El camino al dispositivo de su tarjeta WinTV."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "complemento de entrada para WinTV-PVR 250/350"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2589,89 +2425,85 @@ msgstr "incapaz de conectar a '%s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: parando el hilo de lectura...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: hilo de lectura terminado\n"
# Cer: no esoy seguro del formato.
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Abriendo >fichero:%s puerto:%d interfase:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: no se puede crear un hilo nuevo (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "complemento de entrada RTP y UDP original de xine"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "complemento de flujo de bits de entrada rtsp"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "Complemento de entrada CIFS/SMB basado en libsmbclient"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: ¡no puedo ir hacia atrás! (%<PRIdMAX> > %<PRIdMAX>)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: falló al abrir '%s'\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "complemento de entrada de flujo de bits"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Memoria intermedia vacía..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Memoria intermedia rebosando..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Ajustando..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Nombre del sintonizador no encontrado\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "Complemento de entrada v4l tv"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "Complemento de entrada v4l radio"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "dispositivo vídeo v4l"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "El camino a su dispositivo de vídeo Video4Linux."
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
msgid "v4l ALSA audio input device"
msgstr "dispositivo audio de entrada ALSA v4l"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
@@ -2679,11 +2511,11 @@ msgstr ""
"El nombre del dispositivo de audio que corresponde a su dispositivo de vídeo "
"Video4Linux."
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr "Estandar v4l de TV"
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
#, fuzzy
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
@@ -2692,43 +2524,47 @@ msgstr ""
"Selecciona el estandar de TV de las señales de entrada. Ha de ser una de: "
"PAL, NTSC o SECAM. "
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "Complemento de entrada v4l radio"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "dispositivo audio v4l"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "El camino a su dispositivo de radio Video4Linux."
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: MRL mal formada. Use vcdo:/<núm. pista>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: pista %d no válida (rango válido: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "Complemento de entrada de vídeo CD"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "incapaz de abrir %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: incapaz de abrir %s: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "Complemento de entrada de vídeo CD"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "dispositivo usado para reproducción de VCD"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
@@ -2736,12 +2572,12 @@ msgstr ""
"El camino al dispositivo, usualmente una unidad de CD o DVD, que quiere usar "
"para reproducir sus VideoCDes."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: mal mrl: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: falló en conectar a '%s'\n"
@@ -2827,7 +2663,7 @@ msgstr "protocolo no soportado\n"
msgid "Buffering..."
msgstr "Precargando..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2837,12 +2673,12 @@ msgstr ""
"bits:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: falló en conectar '%s'\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: falló en poner el flujo de bits\n"
@@ -2891,42 +2727,42 @@ msgstr "se pasó un parámetro de clase nula"
msgid "Invalid current entry type"
msgstr "Tipo de entrada actual incorrecta"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-"Complemento de entrada Video CD con PBC y soporte para: (X)VCD, (X)SVCD, "
-"HQVCD, CVD ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "la selección no tiene entrada RETURN"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr "se seleccionó DEFAULT, pero PBC no está activado."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "la selección no tiene entrada NEXT"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "la selección no tiene entrada PREVIOUS"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Tipo de evento desconocido: "
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "El mensaje de arriba tenía nivel de registro vcdimager desconocido"
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+"Complemento de entrada Video CD con PBC y soporte para: (X)VCD, (X)SVCD, "
+"HQVCD, CVD ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr "tipo por defecto VCD a usar en autoreproducción"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
@@ -2934,11 +2770,11 @@ msgstr ""
"La unidad de reproducción VCD a usar cuando ninguna se especifica en un MRL, "
"p.e. vcd:// o vcd:///dev/dvd:"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr "Unidad de CD-ROM usada para VCD cuando no se da ninguno"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
@@ -2946,31 +2782,31 @@ msgstr ""
"Que usar si no se especifica unidad. Si la configuración está vacía, xine "
"buscará unidades CD."
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr "rango de la barra deslizadora de posiciones del VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
"rango que la barra deslizadora de posiciones del flujo de bits representa al "
"reproducir un VCD."
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr "¿Memoria intermedia de lectura adelantada del VCD?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
"La clase puede llevar a reproducción temblorosa en máquinas de gama inferior."
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr "automáticamente avanzar pista/entrada en el VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
@@ -2978,11 +2814,11 @@ msgstr ""
"Si se activa, deberíamos avanzar automáticamente a la siguiente entrada o "
"pista. Se usa sólo cuando el control de reproducción (PBC) está desactivado."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr "mostrar LIDs de VCD 'rechazados' "
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
@@ -2992,11 +2828,11 @@ msgstr ""
"pero puede verlas en la lista de MRL si se activa esto. Las entradas "
"rechazadas se marcan con un asterisco (*) anexado al MRL."
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr "Cadena de formato VCD para pantalla banderola"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -3036,11 +2872,11 @@ msgstr ""
" Un número entre 1 y el contador de volúmenes.\n"
" %% : a %\n"
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr "Cadena de formato VCD para campo de comentario"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -3053,11 +2889,11 @@ msgstr ""
"%.\n"
"Vea la ayuda para title_format para ver su significado."
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr "Máscara de banderas de depuración VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -3087,98 +2923,215 @@ msgstr ""
"1024: Cuadro congelado\n"
"2048: Depurando desde VCDINFO\n"
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "¡AYUDA! ¿¡Un manejador de audio exclusivamente mono-aural?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+"ffmpeg_audio_dec: incrementando el tamaño de la memoria tampón a %d para "
+"evitar el desbordamiento.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "Volúmen A/52"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_audio_dec: no pude encontrar el decodificador ffmpeg para el tipo de "
+"tampón 0x%X\n"
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: intentando abrir códec nulo\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: no pude abrir el decodificador\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: no pude abrir el decodificador\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr "complemento decodificador de audio basado en ffmpeg"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
msgstr ""
-"Con audio A/52, puede modificar el volúmen en el decodificador. Esto tiene "
-"la ventaja que el sonido se ya se decodifica para el volúmen especificado, "
-"de modo que las operaciones posteriores como mezclado hacia abajo de canales "
-"trabajaran en un flujo de bits de audio del volúmen dado."
+"dvaudio: incrementando el tamaño de la memoria tampón a %d para evitar el "
+"desbordamiento.\n"
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "use A/52 compresión de rango dinámico"
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+msgid "dv audio decoder plugin"
+msgstr "complemento decodificador de audio dv"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "tasa de bits salida mpeg de libavcodec (kbit/s)"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-"La compresión de rango dinámico limita el rango dinámico del sonido. Esto "
-"significa hacer más suaves los sonidos fuertes, y más fuertes los sonidos "
-"flojos, de modo que puede escuchar el audio en un entorno ruidoso sin "
-"molestar a nadie."
+"La velocidad de salida (tasa de bits) que el codificador mpeg de libavcodec "
+"debería usar para el modo de codificado de DXR3. Valores más altos "
+"aumentarán la calidad y el uso de CPU.\n"
+"Este ajuste sólo se considera cuando el modo de calidad constante está "
+"desactivado."
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "mezcla reducida de audio a 2 canales estereo envolvente"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "modo de calidad constante"
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-"Cuando desee escuchar sonido envolvente multicanal, pero sólo tiene dos "
-"altavoces o un decodificador o amplificador envolvente que hace algún tipo "
-"de decodificación envolvente matricial como prologic, debería activar esta "
-"opción de modo que los canales adicionales se mezclen en la señal estéreo."
+"Cuando se activa, libavcodec usará un modo de calidad constante "
+"dinámicamente comprimiendo las imágenes basado en su complejidad. Cuando se "
+"desactiva, libavcodec usará el modo de tasa de bits constante."
-#: src/libfaad/xine_faad_decoder.c:136
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "compresión mínima"
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+"La mínima compresión a aplicar a una imagen en el modo de calidad constante."
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr "cuantificador máximo"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+"La máxima compresión a aplicar a una imagen en modo de calidad constante."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad NeAACDecOpen() falló.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: formato de cuadro no soportado, DR1 desactivado.\n"
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit2 falló.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr ""
+"ffmpeg_video_dec: dimensiones de cuadro no soportadas, DR1 desactivado.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit falló.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_video_dec: no pude encontrar el decodificador ffmpeg para el tipo de "
+"tampón 0x%X\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: no pude abrir el decodificador\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, fuzzy, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr "libmusepack: falló mpc_decoder_initialise\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: no pude abrir el decodificador\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr "libmusepack: falló lectura mpc_streaminfo_read: %d\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: renderizado directo activado\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr "libmusepack: datos después de la última trama ignorados\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+"ffmpeg_video_dec: incrementando el tamaño de la memoria tampón a %d para "
+"evitar el desbordamiento.\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr "libmusepack: falló mpc_decoder_initialise\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr "complemento decodificador de vídeo basado en ffmpeg"
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr "libmusepack: falló mpc_decoder_decode: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "calidad de postprocesado MPEG-4"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"Puede ajustar la cantidad de postprocesado aplicado a video MPEG-4.\n"
+"Valores más altos pueden resultar en mejor calidad, pero necesitarán más "
+"CPU. Valores más bajos resultarán en defectos de imagen como artefactos de "
+"bloque. Para contenido de alta calidad, demasiado postprocesado puede de "
+"hecho hacer la imagen peor emborronándola demasiado."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr "Conteo de hilos decodificando vídeo FFmpeg"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Puede ajustar el número de hilos decodificadores que pueda usar FFmpeg.\n"
+"Valores más altos deben acelerar la decodificación, pero depende del códec "
+"si se soporta procesado en paralelo. Una regla general es tener un hilo "
+"decodificador por cada CPU lógica (típicamente de 1 a 4). Un cambio hará "
+"efecto cuando se reproduzca el siguiente flujo."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr "Saltarse filtro de bucle"
+
+# Cer "saltar" por"skip" suena raro.
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Puede controlar para que cuadros el filtro de bucle será saltado después de "
+"decodificar.\n"
+"Omitir el filtro de bucle acelerará la decodificación, pero puede llevarnos "
+"a tener artefactos. El número de cuadros para los que se salta aumenta de "
+"'none' a 'all' (“nada†a “todosâ€). El valor por omisión deja la decisión en "
+"manos de la implementación.\n"
+"Un cambio de este ajuste tendrá efecto a la reproducción de siguiente flujo."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr "Elegir velocidad en vez de conformidad con la especificación"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Usted puede querer permitir trampas de velocidad que violan las "
+"especificaciones del códec.\n"
+"Hacer trampas puede acelerar la decodificación pero también provocar "
+"artefactos de decodificación.\n"
+"Un cambio de este ajuste tendrá efecto a la reproducción de siguiente flujo."
#: src/libreal/real_common.c:139
msgid "path to RealPlayer codecs"
@@ -3199,12 +3152,6 @@ msgstr ""
"RealPlayer para usted. Consulte el FAQ de xine FAQ para más información "
"sobre cómo instalar los codificadores."
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-"libreal: ¡Error resolviendo símbolos! (¿incompatibilidad de versión?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -3228,55 +3175,72 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: Ostras, ¿puede real hacer más de dos canales?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+# Cer: dudoso
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+"complemento decodificador de audio basado en exclusivamente binario “realâ€"
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+"libreal: ¡Error resolviendo símbolos! (¿incompatibilidad de versión?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+"complemento decodificador de vídeo basado en exclusivamente binario “realâ€"
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "mostrar los subtítulos en flujos MPEG-2"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
"Son subtítulos (Closed Captions) pensados mayormente para ayudar a las "
"personas con deficiencias auditivas."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "esquema de subtitulado en primer o segundo plano"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Escoja su renderizado favorito de los subtítulos."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "tipografía estándard de subtitulado"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Escoja la fuente tipográfica estándard para el texto del subtitulado."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "tipografía cursiva de subtitulado"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "Escoja la fuente tipográfica cursiva para el texto del subtitulado."
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "tamaño de la tipografía del subtitulado"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
"Escoja el tamaño de la fuente tipográfica para el texto del subtitulado."
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "subtitulado ajustado al centro "
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
@@ -3284,24 +3248,36 @@ msgstr ""
"Cuando se activa, el subtitulado se posicionará en el centro de las lineas "
"individuales."
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+msgid "closed caption decoder plugin"
+msgstr "complemento decodificador de subtitulado para sordos"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "tipografía para subtítulos externos"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr ""
"desplazamiento vertical de los subtítulos (relativo al tamaño de ventana)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr "complemento decodificador de subtítulos CMML"
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "codificado de los subtítulos"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+msgid "sputext demuxer plugin"
+msgstr "complemento demultiplexor sputext"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "duración por defecto de la exhibición de los subtítulos en segundos"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -3312,11 +3288,15 @@ msgstr ""
"a cero hará que el subtítulo se siga mostrando hasta que aparezca el "
"siguiente."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr "complemento decodificador de subtítulos externo"
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "tamaño de subtítulo "
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
@@ -3324,11 +3304,11 @@ msgstr ""
"Puede ajustar el tamaño de los subtítulos aquí. El ajuste será evaluado "
"relativo al tamaño de la ventana."
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "desplazamiento vertical de los subtítulos"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
@@ -3336,32 +3316,31 @@ msgstr ""
"Puede ajustar la posición vertical de los subtítulos aquí. El ajuste será "
"evaluado relativo al tamaño de la ventana."
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "tipografía para los subtítulos"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
"Tipografía del directorio de xine que será usada para el texto de los "
"subtítulos."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
"Un fichero de tipografía tipo linea (pe: a.ttf) que será usada para el texto "
"de los subtítulos."
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr "si debemos usar una tipografía freetype"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "codificación de los subtítulos"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3373,11 +3352,11 @@ msgstr ""
"caracteres no ASCII no se muestran de la forma que usted espera, pregúntele "
"al creador de los subtítulos que codificación se usó."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "use OSD sin escalar si es posible"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3473,31 +3452,154 @@ msgstr "w32codec: Error inicializando audio DirectShow\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: Error inicializando audio DMO\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr "complemento binario win32 codec de vídeo"
+
+#: src/libw32dll/w32codec.c:1641
+msgid "win32 binary audio codec plugin"
+msgstr "complemento binario win32 codec de audio"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "¡AYUDA! ¿¡Un manejador de audio exclusivamente mono-aural?!\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr "complemento decodificador de audio a52 basado en liba52"
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "Volúmen A/52"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+"Con audio A/52, puede modificar el volúmen en el decodificador. Esto tiene "
+"la ventaja que el sonido se ya se decodifica para el volúmen especificado, "
+"de modo que las operaciones posteriores como mezclado hacia abajo de canales "
+"trabajaran en un flujo de bits de audio del volúmen dado."
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "use A/52 compresión de rango dinámico"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+"La compresión de rango dinámico limita el rango dinámico del sonido. Esto "
+"significa hacer más suaves los sonidos fuertes, y más fuertes los sonidos "
+"flojos, de modo que puede escuchar el audio en un entorno ruidoso sin "
+"molestar a nadie."
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "mezcla reducida de audio a 2 canales estereo envolvente"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+"Cuando desee escuchar sonido envolvente multicanal, pero sólo tiene dos "
+"altavoces o un decodificador o amplificador envolvente que hace algún tipo "
+"de decodificación envolvente matricial como prologic, debería activar esta "
+"opción de modo que los canales adicionales se mezclen en la señal estéreo."
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr "complemento decodificador de formato audio paso a través DTS"
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad NeAACDecOpen() falló.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit2 falló.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit falló.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+"Decodificador de audio Freeware avanzado (“Freeware Advanced Audio Decoderâ€, "
+"faad)"
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, fuzzy, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr "libmusepack: falló mpc_decoder_initialise\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr "libmusepack: falló lectura mpc_streaminfo_read: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr "libmusepack: datos después de la última trama ignorados\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr "libmusepack: falló mpc_decoder_initialise\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr "libmusepack: falló mpc_decoder_decode: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr "mpc: complemento decodificador de audio musepack"
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: error haciendo descompresión ByteRun1\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 no está soportado de momento\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 no está soportado de momento\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ no está soportado de momento\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: Este tipo anim no está soportado de momento\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr "complemento decodificador de vídeo plano de bits en bruto"
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3509,6 +3611,10 @@ msgstr ""
"que es posible, por ejemplo, usarlo para visualizar una película en menos "
"tiempo del que fué originalmente rodada.\n"
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr "Estirar el tiempo en un factor dado, opcionalmente manteniendo el tono"
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3528,6 +3634,10 @@ msgstr ""
"estos parámetros.\n"
"\n"
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr "mezcla mejorada (“upmixâ€)"
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3558,6 +3668,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ": dispositivo audio incapaz de AO_CAP_MODE_STEREO.\n"
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr "convierte mono a estéreo"
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3574,6 +3688,10 @@ msgstr ""
"varias muestras para nivelar las variaciones vía la media ponderada standard "
"de las muestras pasadas.\n"
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr "Normalizar el volumen"
+
# Cer: pulldown: se refiere a curiosos mecanismos de adaptación
# de las diferentes frecuencias de cuadro entre pelicula y vídeo
# (ver http://en.wikipedia.org/wiki/Telecine#2:3_pulldown).
@@ -3694,16 +3812,28 @@ msgstr ""
"está disponibles para todas las plataformas)\n"
"\n"
-#: src/post/deinterlace/xine_plugin.c:335
+# Pull down es demoler, pero... no pega.
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+"complemento desentrelazador avanzado con detección de ajuste de frecuencia "
+"de cuadro en el telecine"
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: No hay métodos de desentrelazado disponibles, saliendo.\n"
-#: src/post/goom/xine_goom.c:206
+# Cer: no se que quieren decir.
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr "Vaya un GOOM"
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "cuadros por segundo a generar"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3712,29 +3842,29 @@ msgstr ""
"también requiere más potencia de CPU."
# Cer: ¿goom?
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr "anchura de imagen goom"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "La anchura en píxeles de la imagen a ser generada."
# Cer: ¿goom?
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr "altura de imagen goom"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "La altura en píxeles de la imagen a ser generada."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr "método de conversión del espacio de color"
# Cer: ¿goom?
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
@@ -3742,7 +3872,11 @@ msgstr ""
"Puede escoger el método de conversión del espacio de color usado por goom.\n"
"Las selecciones disponibles deberían ser autoexplicativas."
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr "Mosaico es un post-complemento de imagen en imagen (“pipâ€) "
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3763,7 +3897,14 @@ msgstr ""
" w: anchura de la imagen\n"
" h: altura de la imagen\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+"Switch es un post-complemento capaz de conmutar en cualquier momento entre "
+"dos flujos diferentes"
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3794,6 +3935,10 @@ msgstr ""
"\n"
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr "filtro caja borrosa de mplayer"
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3820,33 +3965,9 @@ msgstr ""
"\n"
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
-msgstr ""
-"Ecualizador en software con controles interactivos justo como el ecualizador "
-"en hardware, para tarjetas/drivers que no soportan controles de brillo y "
-"contraste en hardware.\n"
-"\n"
-"Parámetros\n"
-" brightness (brillo)\n"
-" contrast (contraste)\n"
-"\n"
-"Note: es posible usar los la ventana de control de la interfaz para ajustar "
-"estos parámetros.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
+msgstr "“3D Denoiser†(filtro variable pasobajo antiruido)"
#: src/post/planar/eq2.c:361
msgid ""
@@ -3892,7 +4013,50 @@ msgstr ""
"\n"
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr "Ecualizador de vídeo en software"
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+"Ecualizador en software con controles interactivos justo como el ecualizador "
+"en hardware, para tarjetas/drivers que no soportan controles de brillo y "
+"contraste en hardware.\n"
+"\n"
+"Parámetros\n"
+" brightness (brillo)\n"
+" contrast (contraste)\n"
+"\n"
+"Note: es posible usar los la ventana de control de la interfaz para ajustar "
+"estos parámetros.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr "ecualizador blando de vídeo"
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+"añade bordes negros al tope superior e inferior del vídeo para expandirlo a "
+"la razón de aspecto 4:3"
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3920,7 +4084,7 @@ msgstr ""
" Centre_cut_out_mode: extrae la imagen 4:3 contenida en un cuadro 16:9\n"
"\n"
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3953,7 +4117,11 @@ msgstr ""
"\n"
"* mplayer's noise (C) Michael Niedermayer\n"
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr "añade ruido"
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3965,7 +4133,7 @@ msgstr ""
"Parámetros\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3973,6 +4141,10 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr "complemento para libpostprocess ffmpeg "
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -4026,13 +4198,132 @@ msgstr ""
"\n"
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+"Unsharp mask & gaussian blur (máscara de des-nitidez y borrosidad gaussiana)"
+
+# Cer: no lo tengo claro
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "%s: evento de entrada escribe: %s.\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr "%s: ¡buffer_pool_alloc() falló!\n"
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr "%s: vaciar tampones (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr "%s: cerrando el hilo rpc (temporizado: %d ms) ...\n"
+
+#: src/vdr/input_vdr.c:1791
+#, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr "%s: cancelando el hilo rpc en la función %d...\n"
+
+#: src/vdr/input_vdr.c:1798
+#, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "%s: uniendo el hilo rpc ...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "%s: hilo rpc unido.\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "%s: uniendo el hilo rpc ...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "%s: hilo rpc unido.\n"
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "%s: falló en abrir '%s' (%s)\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr "expiró el límite de tiempo durante la fase de configuración"
+
+#: src/vdr/input_vdr.c:2035
+#, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "%s: fallo al crear el socket para el puerto %d (%s)\n"
+
+#: src/vdr/input_vdr.c:2049
+#, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "%s: falló en conectar al puerto %d (%s)\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr "%s: abriendo socket (puerto %d) con éxito, fd = %d\n"
+
+#: src/vdr/input_vdr.c:2084
+#, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: conectando a vdr.\n"
+
+#: src/vdr/input_vdr.c:2089
+#, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "%s: falló al resolver el nombre de equipo '%s' (%s)\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr "%s: la conexión a todos los sockets (puerto %d .. %d) tuvo éxito.\n"
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+"%s: ¡MRL (%s) inválido! El MRL debiera empezar con vdr://camino/a/flujo/fifo "
+"o netvdr://equipo:puerto donde ':puerto' es opcional.\n"
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "%s: no puedo crear nuevo hilo (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr "complemento de dispositivo de visualización VDR"
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr "modifica todos los cuadros de vídeo como lo pida el VDR"
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ": vep: (%d, %d)-(%d, %d)@%lg\n"
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr ""
"Complemento de xine de salida de vídeo usando la librería de arte ascii "
"(ascii-art)"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr ""
"Complemento de xine de salida de vídeo usando la librería de arte ascii a "
@@ -4080,8 +4371,8 @@ msgid "video colour key"
msgstr "llave de color de vídeo"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -4163,31 +4454,31 @@ msgstr ""
"video_out_directfb: escalado de imagen con desentrelazado es acelerado en "
"hardware.\n"
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr "id. de la capa de vídeo (auto: -1)"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr "Seleccione la capa de salida de vídeo por su id."
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_directfb: usando capa de visualización nº %d.\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "complemento de xine de salida de vídeo usando DirectFB."
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
"video_out_directfb: ¡no se encontró una capa de visualización usable!\n"
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "complemento de xine de salida de vídeo usando DirectFB bajo XDirectFB."
@@ -4204,11 +4495,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "complemento de xine de salida de vídeo para win32 usando directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -4218,11 +4509,11 @@ msgstr ""
"directo) empaquetado (%d).\n"
" Compruebe 'fbset -i' o pruebe 'fbset -depth 16'.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "nombre del dispositivo framebuffer"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -4236,70 +4527,70 @@ msgstr ""
"arbitrario. De modo que debería ser cuidadoso de que el valor que introduzca "
"es realmente un verdadero dispositivo framebuffer."
-#: src/video_out/video_out_fb.c:893
+#: src/video_out/video_out_fb.c:876
#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
-msgstr "video_out_fb: Lo sentimos, su modo de vídeo no fue reconocido .\n"
+msgid "%s: Your video mode was not recognized, sorry.\n"
+msgstr "%s: Lo sentimos, su modo de vídeo no fue reconocido.\n"
-#: src/video_out/video_out_fb.c:950
+# CER: hacer update-po, no coincide con el fuente.
+#: src/video_out/video_out_fb.c:933
#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
-msgstr "video_out_fb: están disponibles %d tampones de vídeo en RAM.\n"
+msgid "%s: %d video RAM buffers are available.\n"
+msgstr "%s: están disponibles %d tampones de vídeo en RAM.\n"
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-"AVISO: video_out_fb: Tampones Zero copy (copia Cero) están DESACTIVADOS "
-"porque sólo %d tampones\n"
-" están disponibles que son menos que los recomendados %d tampones. "
-"Disminuyendo\n"
-" la resolución del tampón de cuadro podría ayudar.\n"
+"AVISO: %s: Tampones “zero copy†(copia Cero) están DESACTIVADOS porque sólo "
+"hay\n"
+" disponibles %d tampones lo cual es menos que los recomendados %d "
+"tampones.\n"
+" Disminuir la resolución del tampón de cuadro podría ayudar.\n"
# Cer: panning --> panoramizado
# frame flips --> volteos de cuadro
# Zero copy buffers --> tampones copia cero
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-"AVISO: video_out_fb: Los tampones copia cero están DESACTIVADOS porque el "
-"driver del kernel\n"
+"AVISO: %s: Los tampones copia cero están DESACTIVADOS porque el driver del "
+"kernel\n"
" no soporta panoramizado de pantalla (usado para volteos de cuadro ).\n"
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"AVISO: video_out_fb: la profundidad actual de pantalla es %d. ¡Para tener "
-"mejor rendimiento \n"
+"AVISO: %s: la profundidad actual de pantalla es %d. ¡Para tener mejor "
+"rendimiento \n"
" se recomienda una profundidad de 16 bpp!\n"
"\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
"Complemento de xine de salida de vídeo usando el dispositivo Linux tampón de "
"cuadro (frame buffer device)"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "Complemento de xine de salida de vídeo que no muestra nada"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr "renderizador OpenGL"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -4355,11 +4646,11 @@ msgstr ""
"Environment_Mapped_Torus\n"
"Muestra las imágenes en un toro dando vueltas. Muy guais =)"
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr "frecuencia de cuadro mínima OpenGL"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
@@ -4367,12 +4658,12 @@ msgstr ""
"Frecuencia mínima de cuadro para rutinas animadas de renderizado.\n"
"Ignorado para rutinas estáticas de renderizado.\n"
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "activar doble tamponeado"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
@@ -4382,7 +4673,7 @@ msgstr ""
"también reduce un montón el parpadeo.\n"
"No debería impactar nada el rendimiento."
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "Complemento de xine de salida de vídeo usando la API gráfica 3D OpenGL"
@@ -4405,6 +4696,10 @@ msgstr ""
"video_out_pgx32: Error: '%s' no es un dispositivo tampón de cuadro "
"(framebuffer) pgx32\n"
+#: src/video_out/video_out_pgx32.c:864
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr "complemento de salida de vídeo para tampón de cuadro Sun PGX32 "
+
# Cer: Mmm, coger :-?
#: src/video_out/video_out_pgx64.c:278
#, c-format
@@ -4449,33 +4744,33 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr "video_out_pgx64: Error: incapaz de poner las propiedades de ventana\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Aviso: memoria de vídeo baja, multi-tamponeado desactivado\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Error: memoria de vídeo insuficiente\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Aviso: memoria de vídeo baja, tamponeado-doble desactivado\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Error: falló ioctl (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr "llave de color de superposición de vídeo"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
@@ -4485,11 +4780,11 @@ msgstr ""
"superponer la imagen de vídeo. Pruebe usando diferentes valores si ve que el "
"vídeo asoma a través de otras ventanas."
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr "activa llave croma (chroma keying)"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
@@ -4497,11 +4792,11 @@ msgstr ""
"Dibuja gráficos VEP (OSD) encima de la llave de color de la superposición de "
"vídeo en vez de mezclarlos en cada cuadro."
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "activa multi-tamponeado"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
@@ -4509,6 +4804,12 @@ msgstr ""
"Multi-tamponeado incrementa el rendimiento a costa de usar más memoria "
"gráfica."
+#: src/video_out/video_out_pgx64.c:1486
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+"complemento de xine de salida de vídeo para tampones-de-cuadro Sun XVR100/"
+"PGX64/PGX24"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "use aceleración gráfica si está disponible"
@@ -4535,136 +4836,42 @@ msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: el modo de pantalla completa NO está soportado\n"
# Cer: traducción incierta
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr ""
"complemento de xine de salida de vídeo usando la Capa Simple de Medios "
"Directo"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
"complemento de vídeo de xine usando el \"Libstk Surface Set-top Toolkit\""
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: error. (YUY2 no está soportado por su tarjeta gráfica)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: error. (YV12 no está soportado por su tarjeta gráfica)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr "video_out_syncfb: info. (módulo SyncFB soporta YUV 4:2:0 (3 planos))\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr "video_out_syncfb: info. (módulo SyncFB soporta YUV 4:2:0 (2 planos))\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr "video_out_syncfb: info. (módulo SyncFB soporta YUV 4:2:2)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: info. (módulo SyncFB soporta YUY2)\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: info. (módulo SyncFB soporta RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: abortando. (módulo SyncFB no soporta YV12, YUY2 ni "
-"RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, fuzzy, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: info. (control de brillo/contraste no estará disponible "
-"porque su módulo del kernel SyncFB parece estar anticuado. Por favor, "
-"refiérase a README.syncfb para información sobre como actualizarlo.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "número por defecto de repeticiones de cuadros"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-"Esto especifica cuantas veces se mostrará consecutivamente el mismo cuadro "
-"de vídeo."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"complemento de vídeo de xine usando el módulo SyncFB para tarjetas Matrox "
-"G200/G400"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "Nombre de dispositivo de SyncFB"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-"Especifica el nombre de fichero para el dispositivo SyncFB (TeleTux) a ser "
-"usado.\n"
-"Este ajuste es crítico para la seguridad, porque cuando se cambia a un "
-"fichero diferente, xine puede usarse para llenar este fichero con contenido "
-"arbitrario. Así que debiera ser cuidadoso con que el valor que introduzca "
-"sea realmente un dispositivo framebuffer adecuado."
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "intensidad de rojo "
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr "La intensidad de los componentes de color rojo."
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "intensidad de verde"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr "La intensidad de los componentes de color verde."
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "intensidad de azul"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr "La intensidad de los componentes de color azul."
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
@@ -4675,87 +4882,88 @@ msgstr ""
"vertical). Esto elimina el parpadeo y artifactos de rajado, pero usa más "
"memoria gráfica."
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: el adaptador soporta el formato yuy2\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: el adaptador soporta el formato yv12\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr ""
"video_out_vidix: Tiene usted la versión incorrecta de la librería VIDIX\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: No pude localizar el driver VIDIX que funcione\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: usando driver: %s por %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "clave de componente rojo en superposición de vídeo"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "clave de componente verde en superposición de vídeo"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "clave de componente azul en superposición de vídeo"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "complemento de salida de vídeo usando libvidix para x11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
"complemento de salida de vídeo usando libvidix para frame buffer de linux"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xcbshm: %s: ubicando imagen\n"
-"video_out_xcbshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+msgid "%s: %s: allocating image\n"
+msgstr "%s: %s: ubicando imagen\n"
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
-"video_out_xcbshm: error de memoria compartida (error de dirección) ) al "
-"ubicar imagen\n"
-"video_out_xcbshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+"%s: => no usando la extensión de memoria compartida MIT (MIT Shared "
+"Memory).\n"
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-"video_out_xcbshm: x11 error durante creación de XImage en memoria "
-"compartida\n"
-"video_out_xcbshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+"%s: error de memoria compartida (error de dirección) ) al ubicar imagen\n"
+
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
+msgstr "%s: x11 error durante creación de XImage en memoria compartida\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4770,96 +4978,84 @@ msgstr ""
"rendimiento se recomienda una profundidad de 16 bpp!\n"
"\n"
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-"video_out_xcbshm: la extensión de memoria compartida del MIT (MIT Shared "
-"Memory) no está presente en la pantalla.\n"
+"%s: la extensión de memoria compartida del MIT (MIT Shared Memory) no está "
+"presente en la pantalla.\n"
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xcbshm: su modo de vídeo no fué reconocido, lo siento :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "%s: lo sentimos, su modo de vídeo no fue reconocido :-(\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
"complemento de salida de vídeo de xine usando la extensión de memoria "
"compartida del MIT (MIT Shared Memory) "
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xcbxv: XvShmCreateImage retornó un tamaño cero\n"
-"video_out_xcbxv: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
+msgstr "%s: XvShmCreateImage retornó un tamaño cero\n"
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xcbxv: error de memoria compartida en shmget: %s\n"
-"video_out_xcbxv: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+msgid "%s: shared memory error in shmget: %s\n"
+msgstr "%s: error de memoria compartida en shmget: %s\n"
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xcbxv: x11 error durante creación de XImage en memoria compartida\n"
-"video_out_xcbxv: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+msgid "%s: shared memory error (address error)\n"
+msgstr "%s: error de memoria compartida (error de dirección)\n"
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
-msgstr "video_out_xcbxv: la extensión Xv no está presente.\n"
+msgid "%s: Xv extension not present.\n"
+msgstr "%s: la extensión Xv no está presente.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
-msgstr "%s: no se pudo abrir el puerto Xv %d - autodetectando\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
+msgstr "%s: no se pudo abrir el puerto Xv %lu - autodetectando\n"
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, c-format
msgid ""
-"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"
msgstr ""
-"video_out_xcbxv: la extensión Xv está presente pero no pude encontrar un "
-"puerto yuv12 usable.\n"
+"%s: la extensión Xv está presente pero no pude encontrar un puerto yuv12 "
+"usable.\n"
" ¡¿Parece que su driver de hardware gráfico no soporta Xv?!\n"
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xcbxv: usando puerto Xv %d del adaptador %s para conversión y "
-"escalado de espacio de color en hardware .\n"
+"%s: usando puerto Xv %d del adaptador %s para conversión y escalado de "
+"espacio de color en hardware .\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr "activar sincronismo de blanqueo vertical (vblank sync)"
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -4873,245 +5069,47 @@ msgstr ""
"\" (configuración de nvidia) y escoger que dispositivo de pantalla debe "
"sincronizar bajo la pestaña de configuración de XVideo"
-#: src/video_out/video_out_xcbxv.c:1587
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xcbxv: éste adaptador soporta el formato yv12.\n"
+msgid "%s: this adaptor supports the %s format.\n"
+msgstr "%s: éste adaptador soporta el formato %s.\n"
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xcbxv: éste adaptador soporta el formato yuy2.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "método de desentrelazado (obsolescente)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-"Este ajuste de configuración es obsolescente. Debería usar los ajustes del "
-"postprocesado de desentrelazado nuevo en su lugar.\n"
-"\n"
-"De los antiguos dias de la televisión analógica, donde las lineas pares e "
-"impares de los cuadros de vídeo se visualizan en tiempos distintos viene la "
-"idea de mejorar el suavizado del movimiento grabando también las lineas en "
-"tiempos distintos. Esto se llama \"entrelazado\". Pero desafortunadamente, "
-"las pantallas cotidianas muestran las lineas pares e impares como un cuadro "
-"completo, todas de golpe (se llama \"progressive display\", visualización "
-"progresiva), lo que resulta en feos errores de cuadro conocidos como "
-"artifactos de peine. Desentrelazado en software es un which results in ugly "
-"frame errors known as comb artifacts. Software deinterlacing is an enfoque "
-"para reducir estos artifactos. Los valores individuales son:\n"
-"\n"
-"none (nada)\n"
-"Desactiva el desentrelazado en software.\n"
-"\n"
-"bob\n"
-"Interpola entre las lineas para las partes en movimiento de la imagen.\n"
-"\n"
-"weave (tejido)\n"
-"Similar a bob, pero con tendencia a preservar la resolución completa, mejor "
-"para mayor detalle de las escenas con poco movimiento.\n"
-"\n"
-"greedy (codicioso)\n"
-"Desentrelazador adaptativo muy bueno, pero necesita un montón de potencia de "
-"CPU.\n"
-"\n"
-"onefield (un campo)\n"
-"Siempre interpoa y reduce la resolución vertical.\n"
-"\n"
-"onefieldxv\n"
-"Igual que onefield, pero hace la interpolación en hardware.\n"
-"\n"
-"linearblend (mezcla lineal)\n"
-"Aplica un ligero borrón vertical para eliminar los artifactos de peine. "
-"Buenos resultados con uso de CPU mediano."
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "complemento de salida de vídeo usando la extensión MIT X vídeo"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: error de memoria compartida al ubizar imagen\n"
-"video_out_xshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: %s: ubicando imagen\n"
-"video_out_xshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: error de memoria compartida (error de dirección) al ubicar "
-"imagen\n"
-"video_out_xshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: x11 error durante creación de XImage en memoria compartida\n"
-"video_out_xshm: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: la extensión de memoria compartida del MIT (MIT Shared "
-"Memory) no está presente en la pantalla.\n"
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: su modo de vídeoo no fué reconocido, lo siento :-(\n"
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: falló XvShmCreateImage\n"
-"video_out_xv: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
-
-#: src/video_out/video_out_xv.c:324
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage retornó un tamaño cero\n"
-"video_out_xv: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+msgid "%s: shared memory error when allocating image\n"
+msgstr "%s: error de memoria compartida al ubicar imagen\n"
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
"video_out_xv: error de memoria compartida en shmget: %s\n"
"video_out_xv: => no usando la extensión de memoria compartida MIT (MIT "
"Shared Memory).\n"
-#: src/video_out/video_out_xv.c:364
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xv: x11 error durante creación de XImage en memoria compartida\n"
-"video_out_xv: => no usando la extensión de memoria compartida MIT (MIT "
-"Shared Memory).\n"
+"%s: usando puerto Xv %ld del adaptador %s para conversión y escalado de "
+"espacio de color en hardware .\n"
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: la extensión Xv no está presente.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, fuzzy, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr "%s: no se pudo abrir el puerto Xv %d - autodetectando\n"
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: la extensión Xv está presente pero no pude encontrar un "
-"puerto yuv12 usable.\n"
-" ¡¿Parece que su driver de hardware gráfico no soporta Xv?!\n"
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xv: usando puerto Xv %ld del adaptador %s para conversión y "
-"escalado de espacio de color en hardware .\n"
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: éste adaptador soporta el formato yv12.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: éste adaptador soporta el formato yuy2.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "complemento de vídeo de xine usando extensión de vídeo X XvMC"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: extensión XvMC no presente.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -5120,7 +5118,7 @@ msgstr ""
"video_out_xvmc: la extensión Xv está presente pero no pude encontrar un "
"puerto yuv12 usable.\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -5129,108 +5127,35 @@ msgstr ""
"video_out_xvmc: usando puerto %ld de Xv del adaptador %s\n"
" para conversión del espacio de color y escalado en hardware\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " compensación de movimiento y aceleración idct \n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " sólo compensación de aceleración \n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " sin soporte XvMC \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " Con Overlay = %d; UnsignedIntra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: falló XvShmCreateImage \n"
-"video_out_xxmc: => no se usará la extensión \"MIT Shared Memory\" (memoria "
-"compartida MIT).\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage retornó un tamaño cero\n"
-"video_out_xxmc: => no se usará la extensión \"MIT Shared Memory\" (memoria "
-"compartida MIT).\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: error de memoria compartida en \"shmget\": %s\n"
-"video_out_xxmc: => no se usará la extensión \"MIT Shared Memory\" (memoria "
-"compartida MIT).\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: x11 error durante la creación de \"XImage\" en memoria "
-"compartida\n"
-"video_out_xxmc: => no se usará la extensión \"MIT Shared Memory\" (memoria "
-"compartida MIT).\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xxmc: extensión Xv no presente.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xxmc: la extensión Xv está presente pero no pude encontrar un "
-"puerto yuv12 usable.\n"
-" ¿Parece como que su driver de hardware gráfico no soporta "
-"Xv?!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xxmc: usando el puerto %ld de Xv del adaptador %s para conversión "
-"y escalado del espacio de color en hardware.\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xxmc: éste adaptador soporta el formato yv12.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xxmc: éste adaptador soporta el formato yuy2.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "complemento de vídeo de xine usando extensión de vídeo X XvMC"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr "Hacer que XvMC ubique más cuadros more cuadros para mejor tamponeado."
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
@@ -5240,11 +5165,11 @@ msgstr ""
"Esta opción, cuando se activa, hace que el manejador trate de\n"
"ubicar 15 cuadros. hay que tenerlo para VDR uni cromático y en vivo.\n"
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr "Ahorro de cpu unichrome"
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
@@ -5254,11 +5179,11 @@ msgstr ""
"Sólo para Linux con kernel serie 2.6 series o 2.4 con parche multimedia.\n"
"Experimental.\n"
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr "Arreglar colores de subimagen en NVIDIA XvMC con errores"
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
@@ -5267,11 +5192,11 @@ msgstr ""
"rojo en el DEP aparezca como azul y viceversa.\n"
"Esta opción proporciona un arreglo.\n"
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr "Use «bob» como método acelerado de desentrelazado."
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
@@ -5280,11 +5205,11 @@ msgstr ""
"en hardware, alterna entre el campo superior e inferior\n"
"al doble de la frecuencia de cuadro.\n"
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr "No usar desentrelazado «bob» para cuadros progresivos."
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
@@ -5292,12 +5217,12 @@ msgstr ""
"Los cuadros progresivos no necesitan desentrelazado, de manera\n"
"que desentrelazarlos bajo demanda no resultará en una mejor imagen.\n"
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
"No usar desentrelazado «bob» mientras una escalado de VEP (OSD) está activo."
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -5431,21 +5356,21 @@ msgstr ""
"El resultado es que la mezcla alfa de superposiciones son menos precisos que "
"antes, pero el uso de la CPU también disminuirá."
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: no hay disponible complemento para manejar '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: error, tipo de tampón desconocido: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "número de tampones de audio"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5456,7 +5381,7 @@ msgstr ""
"entradas poco fiables, pero también aumentan la latencia y el consumo de "
"memoria."
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
@@ -5464,33 +5389,33 @@ msgstr ""
"audio_out: cálculo de retardo imposible con un dispositivo de sonido no "
"disponible\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
"la escritura a la tarjeta de sonido falló. Supondremos que el dispositivo se "
"desconectó.\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "8 bits no soportados por el driver, convirtiendo a 16 bits.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "mono no soportado por el driver, convirtiendo a estéreo.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "estéreo no soportado por el driver, convirtiendo a mono.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "método para sincronizar audio y vídeo"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -5532,11 +5457,11 @@ msgstr ""
"audio. Esto no funciona para para paso a través digital, donde los datos de "
"audio se pasan a un decodificador externo en forma digital."
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr "activar remuestreo (resampling)"
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -5548,11 +5473,11 @@ msgstr ""
"\"remuestreo\". Aquí puede seleccionar si se activa el remuestreo, se "
"desactiva, o se usa automáticamente cuando sea necesario."
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr "siempre remuestrear a ésta cadencia (0 para desactivar)"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
@@ -5562,11 +5487,11 @@ msgstr ""
"hardware de audio. Poniendo este valor a algo distinto de cero aquí, puede "
"forzar el flujo de datos de audio a ser remuestreado a la cadencia dada."
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr "compensación para paso a través digital"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
@@ -5577,11 +5502,11 @@ msgstr ""
"para compensar.\n"
"Las unidades del valor es una marca PTS, que es 1/90000 segundo."
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr "reproduzca vídeo incluso a velocidades lentas/rápidas"
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -5593,82 +5518,82 @@ msgstr ""
"grave). Si desea experimentar preservando el tono, puede probar el post-"
"complemento de sonido 'stretch' en su lugar."
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "volumen de audio inicial"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "El volumen de sonido al arrancar xine."
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "restaurar el nivel del volumen al arrancar"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"Si se desactiva, xine no modificará ningún ajuste del mezclador al arrancar."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"audio_out: lo siento, ésto no debiera ocurrir. Por favor reinicie xine.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
"xine-lib: buffer.c: Ha ocurrido un error fatal: DEMASIADAS LIBERACIONES DE "
"MEMORIA (FREE'S)\n"
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
"El fichero actual de configuración ha sido modificado por una versión de "
"xine más nueva."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: falló al abrir el fichero de canales'%s': %s\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
"configfile: AVISO: la copia de seguridad del fichero de configuración a %s "
"falló\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: AVISO: su configuración no será guardada\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: AVISO: la escritura de la configuración a %s falló\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: AVISO: eliminando fichero de configuración %s posiblemente roto\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: AVISO: debería comprobar el fichero de respaldo %s\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: la entrada '%s' no debería ser modificada desde MRL\n"
@@ -5687,58 +5612,58 @@ msgid ""
msgstr ""
"info_helper: conversión no soportada %s -> UTF-8, conversión no realizada\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ": la función open() no debiera ser nunca llamada\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": ¡complemento de entrada no definido!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: falló la lectura de los datos guardados: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: falló la lectura por complemento de entrada\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: error escribiendo al fichero %<PRIdMAX> bytes: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: la función open() no debiera ser nunca llamada\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: la búsqueda falló\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: la búsqueda falló: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %<PRIdMAX> bytes desechados\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: ¡complemento de entrada no definido!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -5747,7 +5672,7 @@ msgstr ""
"input_rip: el directorio de destino no fué especificado, por favor rellene "
"la opción 'media.capture.save_dir'\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5756,13 +5681,13 @@ msgstr ""
"defina media.capture.save_dir en la configuración."
# CER: ¿ripeado?
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: ¡ripeado/cacheado de esta fuente no está permitido!\n"
# CER: el "." está mal colocado, pero al final daría eror.
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
@@ -5770,51 +5695,51 @@ msgstr ""
"a xine no se le permite grabar desde esta fuente. (¿puede ser material con "
"copyright?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: file ¡el nombre no está dado!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: error abriendo fichero %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: espera abandonada\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "io_helper: falló la espera: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "falló la consecución de un socket"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Permiso denegado\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Fichero no encontrado\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Conexión Rechazada\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr "map_decoder_list: no hay espacio para el decodificador, omitido.\n"
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -5822,13 +5747,13 @@ msgstr ""
"load_plugins: ignorando complemento%s, versión \"iface\" equivocada%d "
"(debería ser %d)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "prioridad para decodificador %s"
# CER: ¿rank?
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
@@ -5838,7 +5763,7 @@ msgstr ""
"manejado por más de un decodificador.\n"
"Una prioridad de 0 activa la prioridad por omisión del decodificador."
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
@@ -5847,7 +5772,7 @@ msgstr ""
"load_plugins: el complemento desmultiplexor %s no proporciona una prioridad, "
"xine-lib usará la prioridad por defecto.\n"
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -5856,47 +5781,47 @@ msgstr ""
"load_plugins: el complemento de entrada %s no proporciona una prioridad, "
"xine-lib usará la prioridad por defecto.\n"
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: encontrado complemento %s\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: encontrado complemento estático\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr ""
"load_plugins: alcanzado límite de complementos, %s no pudo ser cargado\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
"load_plugins: alcanzado límite de complementos, complemento estático no "
"pudo ser cargado\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: tipo de complemento desconocido %d en %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr ""
"load_plugins: tipo de complemento estáticamente ligado desconocido %d\n"
# CER: ¿stat?
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: incapaz de obtener estado %s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5905,7 +5830,7 @@ msgstr ""
"load_plugins: no puedo abrir librería de complemento %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5914,12 +5839,12 @@ msgstr ""
"load_plugins: no puedo conseguir información del complemento de %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: omitiendo directorio de complementos ilegible %s.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5928,42 +5853,47 @@ msgstr ""
"load_plugins: no puedo (etapa 2) abrir librería de complementos %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: ¡Ondiá! %s no contiene información del complemento.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Incapaz de crear el directorio %s: %s\n"
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: estrategia %d de detección de contenido desconocida\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: usando desmultiplexor '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: fallé al cargar complemento de salida de audio <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5972,7 +5902,7 @@ msgstr ""
"load_plugins: el auto-probado de salida de audio no encontró ningún driver "
"de audio usable audio.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5981,53 +5911,53 @@ msgstr ""
"load_plugins: no puedo descargar librería de complementos %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "la tipografía '%s-%d' ya estaba cargada, raro.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "la carga de la tipografía '%s' falló (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
"versión incorrecta para la tipografía '%s'. Se esperaba %d se encontró %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: no puedo inicializar librería ft2\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: error encajando tipografía %s con FontConfig"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: error cargando tipografía %s con FontConfig"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: error buscando tipografía %s con FontConfig"
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
#, c-format
-msgid "osd: error loading font %s with ft2\n"
-msgstr "osd: error cargando tipografía %s con ft2\n"
+msgid "osd: error loading font %s with in XDG data directories.\n"
+msgstr "osd: error cargando tipografía %s con directorios de datos XDG\n"
+
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: no puedo inicializar librería ft2\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr "osd: error poniendo tamaño de (¿tipografía no escalable?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -6036,46 +5966,46 @@ msgstr ""
"osd: secuencia desconocida comenzando con byte 0x%02X en codificación \"%s"
"\", saltando\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: no puedo encontrar juego de caracteres actual del \"locale\"\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: conversión no soportada %s -> %s, conversión no realizada\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: la tipografía no está definida\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: error cargando glifo\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: error en renderizado de glifo\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: error cargando glifo %i\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: error en renderizado\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "paleta (frente-borde-fondo) a usar para subtítulos y VEP (OSD)"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
@@ -6085,11 +6015,20 @@ msgstr ""
"que no especifican ningún coloreado ellos mismos. Las paletas se listan en "
"la forma:frente-borde-fondo."
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr "opacidad para las partes negras de los subtítulos mapeados por bits"
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
+"opacidad para las partes coloreadas de los subtítulos mapeados por bits"
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -6104,21 +6043,21 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: no hay complemento disponible para manejar '%s'\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: error, tipo de tampón desconocido: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "número de tampones de vídeo"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -6129,12 +6068,12 @@ msgstr ""
"entradas poco fiables, pero también aumentan la latencia y el consumo de "
"memoria."
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d marcos entregados, %d cuadros omitidos, %d cuadros descartados\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -6143,16 +6082,16 @@ msgstr ""
"video_out: tirando la imagen con pts %<PRId64> porque es demasiado vieja "
"(diff : %<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -6168,11 +6107,11 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr "número por defecto de marcos de vídeo"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
@@ -6180,11 +6119,11 @@ msgstr ""
"El número por omisión de cuadros de vídeo a pedir del manejador de vídeo de "
"salida. Algunos manejadores invalidará este ajuste con sus propios valores."
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "porcentaje de cuadros omitidos a tolerar"
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
@@ -6192,11 +6131,11 @@ msgstr ""
"Cuando más de este porcentaje de cuadros no sean mostrados, porque no fueron "
"decodificados a tiempo, xine envía una notificación."
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "porcentaje de cuadros descartados a tolerar"
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
@@ -6204,17 +6143,17 @@ msgstr ""
"Cuando más de este porcentaje de cuadros no sean mostrados, porque no fueron "
"programados para su visualización a tiempo, xine envía una notificación."
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: Lo siento, esto no debería ocurrir. Por favor, reinicie xine.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "posición horizontal de la imagen en la ventana de salida"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -6227,11 +6166,11 @@ msgstr ""
"\"en el centro\", mientras que 0 significa \"a la izquierda del todo\" y 100 "
"\"a la deracha del todo\"."
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "posición vertical de la imagen en la ventana de salida"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -6244,11 +6183,11 @@ msgstr ""
"\"en el centro\", mientras que 0 significa\"arriba a tope\" y 100 \"abajo al "
"fondo\"."
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "desactive todo escalado de vídeo"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -6267,152 +6206,152 @@ msgstr ""
"imagen no está acelerado en hardware, esto puede reducir drásticamente el "
"uso de cpu."
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: error mientras se interpretaba mrl\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: encontrado complemento de entrada : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: el complemento de entrada no puede abrir el MRL [%s]\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: no se puede encontrar el complemento de entrada para MRL [%s]\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: fallo al iniciar el demultiplexor %s especificado\n"
# cer: ¿join rip?
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: complemento de entrada join rip \n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: error al abrir instancia de complemento de entrada rip\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr ""
"xine: el último demultiplexor probado (last_probed) %s no consiguió "
"iniciarse \n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "ignorando vídeo\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "ignorando audio\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "ignorando subimagen\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr "caché del complemento de entrada desactivado\n"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "abierto mrl de subtítulos '%s'\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: error abriendo mrl de subtítulos\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: error al interpretar MRL\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: cambiar la ocpión '%s' del MRL no está permitido\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: no se pudo encontrar un demultiplexor para >%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: no se pudo encontrar un demultiplexor para >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: encontrado complemento demultiplexor: %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: el demultiplexor ya ha terminado, ¡eso fué rápido\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: fallo al iniciar el demultiplexor\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: no hay disponible un demultiplexor\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: fallo al iniciar el demultiplexor\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
"xine: El directorio (save_dir) especificado \"%s\" pudiera ser un riesgo "
"para la seguridad.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
"El directorio (save_dir) especificado pudiera ser un riesgo para la "
"seguridad."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: \"locale\" no soportada por la librería de C\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "estrategia de detecciónde formato"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -6446,11 +6385,11 @@ msgstr ""
"extension\n"
"Detectar sólo por la extensión del nombre del fichero.\n"
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "directorio para guardar flujos de bits"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -6466,11 +6405,11 @@ msgstr ""
"arbitrario. Así que debiera ser cuidadoso que el directorio especificado sea "
"robusto contra cualquier contenido en cualquier fichero."
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr "permitir cambios implícitos a la configuración (p.e. por MRL)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -6487,11 +6426,11 @@ msgstr ""
"arbitrariamente cambiar su configuración, usted podría acabar con un xine "
"totalmente enredado."
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr "Temporización para lectura de flujos de bits desde red (en segundos)"
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
@@ -6502,75 +6441,75 @@ msgstr ""
"fuente es lenta o el ancho de banda está ocupado; valores demasiado altos "
"congelarán el reproductor si se pierde la conexión."
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "mensajes"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "complemento"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "traza"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Aviso:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "host desconocido:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Dispositivo desconocido:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Red no alcanzable"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Conexión rechazada:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "Fichero no encontrado:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Error de lectura desde:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "Error de carga de librería:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "Detectado flujo de bits de medios encriptado"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "Mensaje de seguridad:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "Dispositivo de audio no disponible"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Error de permisos"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "El fichero está vacío:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "método \"memcopy\" usado por xine"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
@@ -6581,7 +6520,7 @@ msgstr ""
"ajustados para hacer este copiado. Usualmente, el método mejor se detecta "
"automáticamente."
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Evaluando métodos \"memcpy\" (menor es mejor):\n"
diff --git a/po/eu.po b/po/eu.po
index b76c08bf6..b2218493e 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib-1\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2005-02-17 14:29+0100\n"
"Last-Translator: Piarres Beobide <pi@beobide.net>\n"
"Language-Team: lubrezale <librezale@librezale.org>\n"
@@ -320,207 +320,203 @@ msgstr ""
"xinek alsa nahaslea erabiliko du bolumena aldatzeko.\n"
"Begiratu alsa dokumentazioa alsa gailueri buruzko argibideentzat."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
"xine audio irteera plugina alsa-konpilaturiko audio gailu/kontrolatzailea "
"erabiliaz"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "xine audio irteera plugina kde artsd erabiliaz"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "xine irteera plugina Coreaudio/Mac OS X-entzat"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
#, fuzzy
msgid "Error"
msgstr "Errorerik ez"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
#, fuzzy
msgid "requested buffer control is not available"
msgstr "eskatutako botoia ez da erabilgarri\n"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
#, fuzzy
msgid "DirectSound hardware device is unavailable"
msgstr "Erabili hardware azelerazioa eskuragarri badago"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
#, fuzzy
msgid "requested COM interface not available"
msgstr "eskatutako botoia ez da erabilgarri\n"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
#, fuzzy
msgid "unknown error"
msgstr "Errore ezezaguna"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, fuzzy, c-format
msgid ": can't create pthread condition: %s\n"
msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, fuzzy, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, fuzzy, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, fuzzy, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, fuzzy, c-format
msgid ": unknown control command %d\n"
msgstr "iff-ilbm: konpresio ezezaguna: %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
#, fuzzy
msgid "second xine audio output plugin using directx"
msgstr "xine audio irteera plugina win32-arentzat directx erabiliaz"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "xine audio irteera plugina win32-arentzat directx erabiliaz"
@@ -553,11 +549,11 @@ msgstr ""
"konpondu dezakezu.\n"
"Unitatearean balioa PTS marka, segundu baten 90000-garren zatia da."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "xine audio irteera plugina esound erabiliz"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "xine fitxategi audio irteera plugina"
@@ -596,7 +592,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "xine irteera plugina Coreaudio/Mac OS X-entzat"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "xine gezurrezko audio irteera plugina"
@@ -796,7 +792,7 @@ msgstr ""
"Balio honen eremua -1 eta 1-15 artekoa da. OSS gailu izena \"auto\" bezala "
"ezarririk dagoenean ezarpen hau alde batetara utziko da."
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: huts %s nahaslea abiaraztean: %s\n"
@@ -815,21 +811,21 @@ msgstr "CD audio-k erabiliko duen gailua"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
#, fuzzy
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "xine audio irteera plugina esound erabiliz"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: huts %s audio gailua irekitzerakoan: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "Sun audio gailu izena"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -841,171 +837,30 @@ msgstr ""
"aldatzean, xine erbili daiteke fitxategi hau eduki arbitrarioez bete dezake. "
"Beraz kontu izan behar duzu Sun audio gailu egoki bat ezartzea."
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, fuzzy, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: huts %s audio gailua irekitzerakoan: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"xine audio irteera plugina sun-kompilaturiko audio gailu/kontrolatzailea"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: bufferra%d-ra handitzen askieza sahiesteko.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: ezin da deskodetzailea ireki\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: ezin da deskodetzailea ireki\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: ezin da deskodetzailea ireki\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "dvaudio: bufeera %d -ra handitzen askieza sahiesteko.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: marko formatu onartezina, DR1 ezgaiturik.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: marko formatu onartezina, DR1 ezgaiturik.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: ezin da deskodetzailea ireki\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: ezin da deskodetzailea ireki\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: direct reenderizazioa gaiturik\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_video_dec: bufferra %d -ra handitzen askieza saiesteko.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "MPEG-4 postprozesatze kalitatea"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "libavcodec mpeg irteera bit tasa (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "kalitate modu iraunkorra"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "konpresio txikiena"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-"Kalitate iraunkorreko kalitate moduko ezarriko den gutxienezko konpresioa."
+"ogg: vorbis audio pista esan da baina ez da vorbis korronte bururik "
+"aurkitu.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
+#: src/combined/xine_ogg_demuxer.c:2173
+msgid "Annodex demux plugin"
msgstr ""
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
-"Kalitate iraunkorreko kalitate moduko ezarriko den gehinezko konpresioa."
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -1025,6 +880,10 @@ msgstr "demux_asf: abisua: id=%d korrontea enkriptaturik dago.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Medioa korrontea nahasi/enkriptaturik"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Indizea bersortzen..."
@@ -1044,16 +903,24 @@ msgstr "demux_avi: avi indizea hautsirik dago\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr "demux_avi: huts hurrengo zatira pasatzekoan (%lld kokalekua)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "baliogabeko FILMA zati tamaina\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "FILMA zati ezezaguna\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1069,6 +936,11 @@ msgstr ""
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "Bideoa CD sarrera plugina"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1084,12 +956,20 @@ msgstr "iff-ilbm: konpresio ezezaguna: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: Zati ezezaguna: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1098,20 +978,20 @@ msgstr ""
"xine-lib:demux_mpeg_block: 0x%02x korronte_id-a. Mesedez berri eman xine "
"garatzaileei.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
"demux_mpeg_block: errorea! askatzen. Mesedez abisua eman xine garatzaileei.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: abisua: PES buarentzat gorderiko 10 bit ez dira aurkitu\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1120,7 +1000,11 @@ msgstr ""
"demux_mpeg_block: kontuz: PES goiburuak korrontea enkriptaturik dagoela "
"ezartzen du (enkriptazioa %d modua)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1129,19 +1013,19 @@ msgstr ""
"xine-lib:demux_mpeg_pes: 0x%02x korronte_id ezezaguna. MEsedez honen berri "
"eman xine garatzaileei.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
"demux_mpeg_pes: kontuz: PACK korronte -aid=0x%x dekodifikatzerakoan huts.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_pes: abisua: PES buruarentzat gorderiko 10 bit ez dira aurkitu\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1150,7 +1034,7 @@ msgstr ""
"demux_mpeg_pes: abisua: PES buruak korronte hau enkriptaturik dagoela "
"adierazten du (enkriptazio mota: %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1159,12 +1043,9 @@ msgstr ""
"demux_mpeg_pes:1 0x%02x korronte pribatu ezezaguna. Mesedez berri eman xine "
"garatzaileei.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
-"ogg: vorbis audio pista esan da baina ez da vorbis korronte bururik "
-"aurkitu.\n"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1176,11 +1057,20 @@ msgstr "demux_snd: okerreko goiburu parametroa\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: onartzen ez den audio mota: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "fitxategi sarrera plugina"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+msgid "True Audio demux plugin"
+msgstr ""
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1196,6 +1086,11 @@ msgstr ""
"VOC konpresio mota (0x%02X) ezezaguna; mesedez erreportea eman xine "
"garatzaileei\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "fitxategi sarrera plugina"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1206,38 +1101,42 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr "demux_wc3movie: Arazo bat dago paleta zatiak kargatzerakoan\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "DXR3 gailu zenbakia"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-"Zure ordenagailuan DXR3 gailu bat baino gehiago izan ezkero zein erabili "
-"nahi duzun ezarri dezakezu."
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: Huts %s (%s) spu gailua irekitzerakoan\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "eskatutako botoia ez da erabilgarri\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr "dxr3_decode_video: Huts %s (%s) kontrol gailua irekitzerakoan\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "\"Pan eta Scan\" informazioa erabili"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1265,11 +1164,11 @@ msgstr ""
"Gaitu \"Pan eta Scan\" SVB korronte argibideetan oinarriturik.Honek Europear "
"DVB kateek erabiltzen duten \"Active Format Descriptor\" erabiltzen du."
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "saiatu bideoa marko bakoitzean sinkronizatzen"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1281,19 +1180,19 @@ msgstr ""
"denbora-marka ipiniaz.\n"
"Hau bideo prograsiboetan (PAT filma gehienak) bakarrik behar da."
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "Erreprodukzio modu leuna erabili"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "Aukera hau gaituaz erreprodukzio modu leunago bat erabiliko da."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "konpondu marko iraupena apurturiko korronteetan"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1301,39 +1200,51 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Huts %s (%s) bideo gailua irekitzerakoan\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: gailuan idaztea blokeatuta egon liteke. garbitzen\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: huts (%s) bideo gailua idazterakoan\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: KONTUZ: %d marko abiadura kode ezezaguna\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
"dxr3_decode_video: ABISUA: marko abiaradura PAT-etik NTSC-ra biurtzen\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "DXR3 gailu zenbakia"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+"Zure ordenagailuan DXR3 gailu bat baino gehiago izan ezkero zein erabili "
+"nahi duzun ezarri dezakezu."
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: huts librte abiaraztean\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1342,21 +1253,21 @@ msgstr ""
"dxr3_mpeg_encoder: rte-ek 16-en multiploak diren bideo dimentsioak kudea "
"ditzake\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: huts rte contestua eskuratzerakoan.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: Ezin da kodeka sortu.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "rte mpeg irteera bit tasa (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
@@ -1364,26 +1275,26 @@ msgstr ""
"DXR3 kodeketa motarako mpeg kodeketa liburutegiak erabili behar dun bit "
"abiadura. Balio handiek CPU erabilera handiagoa egiten dute."
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: ezin da kontestua abiarazi: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: ezin kodifikazioa abiarazi: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: Ezin da FAME liburutegia abiarazi\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "mpeg kodifikazio kalitate famatua"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1405,11 +1316,15 @@ msgstr ""
"erabiliko dute. 5 baino balio handiagoek DXR3-arne barne erlojua erabiliko "
"dute sinkronia jatorri bezala."
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "aldatu lerro bakoiti eta bikoitiarrak"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1419,11 +1334,11 @@ msgstr ""
"Aukera hau ez-MPEG diren eta materialak pantailan \"jitter\" bertikal bat "
"sortzean."
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "Barra beltzak gehitu itxura proportzioa konpontzeko"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
@@ -1431,32 +1346,32 @@ msgstr ""
"Gehitu barra beltzak irudiari itxura biadura ezin denean behar bezala "
"kudeatu, Hau beharrezkoa da irudien proportzio zuzenak mantentzeko."
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr "erabili erreprodukzio modu leuna mpeg kodeketa erreproduzitzerakoan"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Aukera hau gaituaz erreprodukzio modu leuna erabiliko da ez-MPEG edukia "
"erreprduzitzeko"
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Huts %s (%s) kontrol gailua irekitzerakoan\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Huts %s (%s) bideo gailua irekitzerakoan\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "kodetzailea mpeg ez den edukientzat"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
#, fuzzy
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
@@ -1481,22 +1396,22 @@ msgstr ""
"\"fame\" eta \"rte\" aukerak daude baina xineren hauetariko onespena "
"zaharkiturik dago beraz exkeutatzean huts egin dezalekete."
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr "video_out_dxr3: Mpeg kodetzaile libavcodec huts abiaraztean.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: Mpeg kodetzaile rte huts abiaraztean.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: Mpeg kodetzaile fame huts abiaraztean.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1513,7 +1428,7 @@ msgstr ""
"video_out_dxr3: kontrolatzaile honekin.begiratu README.dxr3 kodeatzaile "
"konfigurazioa.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1530,11 +1445,11 @@ msgstr ""
"erabiliaz\n"
"video_out_dxr3: ikusteko gai izango. README.dxr3 begiratu xehetasunentzat.\n"
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "bideo irteera modua (Telebista edo Gainjarri)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
#, fuzzy
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
@@ -1573,22 +1488,22 @@ msgstr ""
"Bideoa telebista irteerara bakarrik bideali. Modu hau 4:3 estandar telebista "
"eza"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr "Gainjarri koloretekla balioa"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
"when using DXR3 overlay mode."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr "Gainjarri koloretekla tolerantzia"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1596,11 +1511,11 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "Txikitu gainjarpena area goi eta behetik"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1608,16 +1523,16 @@ msgstr ""
"Gainjarpenaren goi eta beheko aldetik pixel lerro bat ezabatzen du. Hau "
"gaitu gainjarpen goi eta beheko aldean lerro orlegiak ikusi ezkero."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: mesedez autocal abiarazi, gainjarpena ezgaiturik\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "gogoko telebista modua"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1633,12 +1548,12 @@ msgstr ""
"pal60: PAL - 60Hz\n"
"default: mantendu txartel ezarpenak"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: bideo modu ezarpenak huts egin du.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1648,37 +1563,37 @@ msgstr ""
"bistaratzeko\n"
"video_out_dxr3: README.dxr3 begiratu xehetasunentzat.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: ERROREA gainjarri abiarazte fitxategia irakurtzeab. Run "
"abiarazi!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: Ezin da %s-ra konektatu: %d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: arrakastatsuki konektaturik cddb zerbitzarira'%s:%d'.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: huts cddb zerbitzarira konektatzerakoan '%s:%d' (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "CD Audio Digitala (hemen. CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "CD audio-k erabiliko duen gailua"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1686,11 +1601,11 @@ msgstr ""
"Gailuaren bidea, arruntean audio CD erreproduzitzeko erabili nahi duzun CD "
"edo DVD gailua."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "CDDB galderak"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1703,11 +1618,11 @@ msgstr ""
"Izan kontutan zuk ez baduzu CDDB zerbitzari pribatu bat, informazio hau zure "
"ohiturak grabatuko dituen internet ostalari batetatik jasoko da."
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "CDDB zerbitzari izena"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1719,36 +1634,20 @@ msgstr ""
"entzuteko ohituraz informazioa jaso eta erantzun zitalekin erantzun bait "
"dezake. Ziurtatu konfidantza duzun zerbitzari bat izatea."
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "CDDB zerbitzari ataka"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
"Izenburu eta pista informazioa jasotzeko erabiliko den zerbitzari ataka."
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "CDDB katxe karpeta"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-"CDDB zarbitzariaren erantzunak karpeta honetan gordeko dira.\n"
-"Ezarpena segurtasun aldetik kritikoa da, kontrolatugabeko fitxategi izenak "
-"sortuko bait dira. Ziurtatu erabiliko den karpeta ez dela honetaz beste "
-"ezertarako erabiliko."
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "gutxitu diska gailua abiadura faktore honetara"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1762,71 +1661,71 @@ msgstr ""
"geldoarazteak ez du ezertan txikiagotzen erreprodukzio kalitatea.\n"
"Zero balioa poliagotzea ezgaitzen da."
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, fuzzy, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: huts '%s' dvb kanal fitxategia irekitzerakoan\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, fuzzy, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: huts '%s' dvb kanal fitxategia irekitzerakoan\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: irrati_ezarpen_kanalak huts egin du\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: ezin da dvb gailua ireki\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr "input_dvb: %d kanala eremutik kanpo, 0-ra lehenesten\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: %s kanala bilatzen\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
"input_dvb: ez da %s-ren parekatze zehatzik aurkitu: parekatze hurbilduak "
"saiatzen\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: %s kanal parekatzea aurkiturik\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, fuzzy, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr "input_dvb: %s kanala ez da kanaletan aurkitu, 0 kanalera lehenesten\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, fuzzy, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr "input_dvb: baliogabeko kanal ezarpena, 0 kanalera lehenesten\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr "input_dvb: baliogabeko kanal ezarpena, 0 kanalera lehenesten\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
@@ -1835,7 +1734,7 @@ msgstr ""
"input_dvb: dvbs mrl ezarririk baina sintonizatzailea ez dirudu QPSK (DVB-S) "
"dagoenik\n"
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1844,7 +1743,7 @@ msgstr ""
"input_dvb: dvbt mrl ezarririk baina sintonizatzailea ez dirudu OFDM (DVB-T) "
"dagoenik\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1853,7 +1752,7 @@ msgstr ""
"input_dvb: dvbc mrl ezarririk baina sintonizatzailea ez dirudu QAM (DVB-C) "
"dagoenik\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, fuzzy, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1862,21 +1761,21 @@ msgstr ""
"input_dvb: dvbc mrl ezarririk baina sintonizatzailea ez dirudu QAM (DVB-C) "
"dagoenik\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: ezin da '%s' dvr gailua ireki\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, fuzzy, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -1884,86 +1783,81 @@ msgstr ""
"Honek pantaila osoko erreprdukzioa 4:3 formatu edukiak 16:9 markotan "
"transmititzea gaitzen du."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "DVB (Telebista Digitala) sarrera plugina"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
#, fuzzy
msgid "Last DVB channel viewed"
msgstr "bistaratu DVB kanal izena"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-#, fuzzy
-msgid "Number of dvb card to use."
-msgstr "audio buffer kopurua"
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
+#: src/input/input_dvb.c:3313
+#, fuzzy
+msgid "Number of dvb card to use."
+msgstr "audio buffer kopurua"
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Errorea DVD-tik hurrengo blokea eskuratzerakoan (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Errorea DVD gailua irekitzerakoan\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "DVD-a erreproduzitzeko erabiliko den gailua"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -1971,11 +1865,11 @@ msgstr ""
"DVD-ak erreproduzitzeko erabli nahi duzun, arruntean DVD gailu bat, gaiuaren "
"bidea."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "DVD irakurleantzat gailu gordin (raw) ezarpenak"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1986,35 +1880,22 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "CSS desenkriptazio metodoa"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr ""
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "DVD erreproduktorean eskatzen duen erregioa (1 - 8)"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
@@ -2024,11 +1905,11 @@ msgstr ""
"bakarrik behar da hau. Honek ez du zerikusirik DVD gailuetan ezarritako "
"erregio kodearekin, hau software hutsa da."
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "DVD erreprodukzioaren lehenetsirako hizkuntza"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
@@ -2039,22 +1920,22 @@ msgstr ""
"hizkuntza honetan emango dira.\n"
"Balioak bi karaktereko ISO639 kode bat izan behar da."
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "irakuketa-goiburu gordetzea"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "Ekintza egingo ez den unitatea"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -2073,11 +1954,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "Bilatuko den untitatea"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -2091,11 +1972,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -2112,39 +1993,39 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: irakurketa errorea (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Baimena ukaturik: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Fitxategia ez da aurkitu: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, fuzzy, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Fitxategia ez da aurkitu: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "fitxategi sarrera plugina"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "fitxategi kudeatzailearen abiarazte kokalekua"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
"Erreproduzitzeko fitxategi kudeatzailea kokaleu horretan abiaraziko da."
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "bistaratu ezkutatuako fitxategiak"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
@@ -2152,92 +2033,92 @@ msgstr ""
"gaiturik dagoenean, fitxategi kudeatzaileak ezkutatutako fitxategia "
"bistaraziko ditu."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "gnome-vfs sarrera plugina, xinerekin banatzen dena"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s)-ek huts egin du: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: irekurketa errorea %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "HTTP zerbitzarira konektatzen..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: http erantzun baliogabea\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx birbideratzea: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: http egoera ez da 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, fuzzy, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: eduki luzera = %Ld bite\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, fuzzy, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: irekurketa errorea %d\n"
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "http sarrera plugina"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "HTTP proxy ostalaria"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "HTTP proxy-aren ostalari izena."
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "HTTP proxy ataka"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "HTTP proxy-aren ataka zenbakia."
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "HTTP proxy erabiltzailea"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "HTTP proxy-aren erabiltzaile izena"
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "HTTP proxy pasahitza"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "HRRP proxy-aren pasahitza."
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
#, fuzzy
msgid "Domains for which to ignore the HTTP proxy"
msgstr "Domeinuak, non ez den HTTP proxy-a erabiliko"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2245,15 +2126,15 @@ msgid ""
"(full match required)."
msgstr ""
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "mms korronte sarrera plugina"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "sare zabalera"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
@@ -2263,11 +2144,11 @@ msgstr ""
"korronte berdinaren konexio zabalera behar duten korronte bertsio ezberdinak "
"eskeintzean erabiliko da."
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "MMS protokoloa"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2275,76 +2156,76 @@ msgstr ""
"aukeratu MMS enkapsulatzeko metodoa.\n"
"TCP obea da baina suebaki baten atzean HTTP beharko duzu."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: ezin da '%s' ebatzi.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: ezin da '%s'-ra konektatzen.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "sare sarrera plugina, xinerekin anatzen dena"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "pnm korronte sarrera plugina"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: errorea¡pvr fitxategia (%s) sortzerakoan\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: errorea¡pvr fitxategia (%s) irekitzerakoan\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: irakurketa errorea (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: errorea %s gailua irekitzerakoan\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_G_CODEC-ak huts egin du, agian API-a aldatu da?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_S_CODEC-ak huts egin du, agian API-a aldatu da?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "WinTV-PVR 250/350 sarrera plugina"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "WinTV-PVR 250/350 (pvr plugin)-ek erabiliko duen gailua"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "WinTV txartelaren gailuaren bidea."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "WinTV-PVR 250/350 sarrera plugina"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2394,153 +2275,153 @@ msgstr "Ezin da '%s' lotu.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: geratu irakurketa haria...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: hari irakurketa amaiturik\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Opening >fitxategia:%s ataka:%d interfazea:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "RTP eta UDP sarrera plugina, xinerekin banatzen dena"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "rtsp korronte sarrera plugina"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr ""
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, fuzzy, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: ezin da atzera salto egin! (%lld > %lld)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: ezin da '%s' ireki\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "stdin korronte sarrera plugina"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Buffer gainditzea..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Buffer askieza..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Egokitzen..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "sintonizatzaile izena ez da aurkitu\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "v4l tv sarrera plugina"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "v4l irrati sarrera plugina"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "v4l bideo gailua"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "Video4Linux bideo gailuaren bidea."
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "v4l irrati gailua"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "Video4Linux bideo gailuaren bidea."
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "v4l irrati sarrera plugina"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "v4l irrati gailua"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "Video4Linux irrati gailuaren bidea."
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: gaikieraturiko MRL-a. vcdo:/<pista #> erbili\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: %d pista baliogabea (baliozko eremua: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "Bideoa CD sarrera plugina"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "Ezin da %s ireki: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: Ezin da %s ireki: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "Bideoa CD sarrera plugina"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "VCD erreproduzitzeko erabiliko den gailua"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr "BideoCD-ak erreproduzitzeko erabili nahi duzun gailuaren bidea."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: okerreko mrl-a: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: huts '%s'-ra konektatzerakoan\n"
@@ -2622,7 +2503,7 @@ msgstr "onartzen ez den protokoloa\n"
msgid "Buffering..."
msgstr "Bufferra betetzen..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2631,12 +2512,12 @@ msgstr ""
"input_pnm: zerbitzariritik mezua bat jaso da korrontea irakurtzerakoan:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: ezin da '%s' konektatu\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: huts korrotea ezartzerakoan\n"
@@ -2686,44 +2567,44 @@ msgstr "baliogabeko klase parametroa pasa zen"
msgid "Invalid current entry type"
msgstr "baliogabeko sarrera mota"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-"Bideo CD plugina PBC.rekin eta onarpen hauekin: (X)VCD, (X)SVCD, HQVCD, "
-"CVD ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "Aukerak ez du RETURN sarrerarik"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
#, fuzzy
msgid "DEFAULT selected, but PBC is not on."
msgstr "LEHENETSIRIKOA aukeraturik baina PBC ez dago gaiturik."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "Aukerak ez du HURRENGO sarrerarik"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "Aukerak ez du AURREKO sarrerarik"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "gertaera mota ezezaguna: "
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "Goiko mezuak vcdimager arazpen maila ezezagun bat du"
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+"Bideo CD plugina PBC.rekin eta onarpen hauekin: (X)VCD, (X)SVCD, HQVCD, "
+"CVD ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
#, fuzzy
msgid "VCD default type to use on autoplay"
msgstr "VCD auto-erreproduzitzea erabiltzeko lehenetsiriko mota"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
#, fuzzy
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
@@ -2732,12 +2613,12 @@ msgstr ""
"MRL-an ez ezarri ezkero erabiliko den erreprodukzio unitatea, adib. vcd:// "
"edo vcd:///dev/dvd:"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
#, fuzzy
msgid "CD-ROM drive used for VCD when none given"
msgstr "Lehenetsiriko CD gailya VCD-entzat ematen ez denean"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
@@ -2745,31 +2626,31 @@ msgstr ""
"Zein erabili gailurik ez ezartzean. Ezarpen hau hutsik utzi ezkero xinek "
"gailu guztietan bilatuko du."
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
#, fuzzy
msgid "VCD position slider range"
msgstr "posizio graduatzaile bitartea"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
#, fuzzy
msgid "VCD read-ahead caching?"
msgstr "irakuketa-goiburu gordetzea"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
#, fuzzy
msgid "automatically advance VCD track/entry"
msgstr "automatikoki aurrera pista/sarrera"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
@@ -2777,24 +2658,24 @@ msgstr ""
"Gaiturik dagoenean, hurrengo sarrera edo pista automatikoki erreproduzituko "
"du. Erreprodukzio kontrola (PBC) ezgaiturik dagoenean bakarrik erabiliko da."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
#, fuzzy
msgid "show 'rejected' VCD LIDs"
msgstr "bistaratu ukaturiko LID-ak"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
#, fuzzy
msgid "VCD format string for display banner"
msgstr "Bistaratze banerraren kate formatua"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2815,12 +2696,12 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
#, fuzzy
msgid "VCD format string for stream comment field"
msgstr "Korronte iruzkin eremuaren kate formatua"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
#, fuzzy
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
@@ -2832,12 +2713,12 @@ msgstr ""
"Formatu espezifikazioakehuneko ikur bates hasten dira. Ezpezifikazioak: %A, "
"%C, %c, %F, %I, %L, %N, %P, %p, %S, %T, %V, %v, eta %%."
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
#, fuzzy
msgid "VCD debug flag mask"
msgstr "arazpen bandera maskara"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2854,85 +2735,173 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "LAGUNTZA! mono bakarrik audio kontrolatzailea?\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: bufferra%d-ra handitzen askieza sahiesteko.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "A/52 bolumena"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: ezin da deskodetzailea ireki\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: ezin da deskodetzailea ireki\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: ezin da deskodetzailea ireki\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "dvaudio: bufeera %d -ra handitzen askieza sahiesteko.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "v4l irrati sarrera plugina"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "libavcodec mpeg irteera bit tasa (kbit/s)"
-#: src/liba52/xine_a52_decoder.c:821
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "A/52 bitarte dinamiko konpresioa"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "kalitate modu iraunkorra"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "konpresio txikiena"
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
msgstr ""
+"Kalitate iraunkorreko kalitate moduko ezarriko den gutxienezko konpresioa."
-#: src/liba52/xine_a52_decoder.c:838
-msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad faacDecOpen()-ek huts egin du.\n"
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+"Kalitate iraunkorreko kalitate moduko ezarriko den gehinezko konpresioa."
-#: src/libfaad/xine_faad_decoder.c:145
-#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad faacDecInit2-ek huts egin du.\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:179
+#, c-format
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: marko formatu onartezina, DR1 ezgaiturik.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad faacDecInit-ek huts egin du.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: marko formatu onartezina, DR1 ezgaiturik.\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr ""
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: ezin da deskodetzailea ireki\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:352
+#, fuzzy, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: ezin da deskodetzailea ireki\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr ""
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: direct reenderizazioa gaiturik\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_video_dec: bufferra %d -ra handitzen askieza saiesteko.\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "MPEG-4 postprozesatze kalitatea"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
#: src/libreal/real_common.c:139
@@ -2954,12 +2923,6 @@ msgstr ""
"dekodifikatzeko. Begiratu XINE FAQ dokumentua kodek horiek nola instalaturi "
"buruzko argibide gehiagorako."
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-"libreal: Errorea sinboloak ebazterakoan! (bertsio bateragarritasun eza?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2981,54 +2944,68 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+"libreal: Errorea sinboloak ebazterakoan! (bertsio bateragarritasun eza?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "bistaratu itxitako izenburuak MPEG-2 korronteetan"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
"Itxitako Tituluak (closed caption) normalean entzumen arazoak dituztenei "
"laguntzeko azpitituluak dira."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "Itxitako-tituluen atzealdeko eskema"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Aukeratu itxitako tituluentzat gustoko duzun errendarizatzailea."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "Lehenetsitako itxitako titulu letra-tipoa"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Aukeratu ixtitako titulu testuarentzat lehenetsitako letra-tipoa."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "etzandako itxitako izenburu letra-tipoa"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "Aukeratu etzandako itxitako tituluen letra-tipoa."
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "Itxitako izenburuen letra-tamaina"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr "Aukeratuko itxitako tituluen letra tamaina"
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "erdira-doitu itxitako tituluak"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
@@ -3036,23 +3013,36 @@ msgstr ""
"Gaiturik daudenean, itxitako titulu testua lerro bakoitzean erdiratu egingo "
"da."
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "Itxitako izenburuen letra-tamaina"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "Kanpo azpitituluen letra-tipoa"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr "azpititulu kokapen bertikala (panataila tamainaren arabera)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "Apititulu kodifikatzea"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+msgid "sputext demuxer plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "azpititulu bistaratze denbora segundutan"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -3062,11 +3052,15 @@ msgstr ""
"Hauentzat lehenetsitako iraupena ezarri dezakezu hemen. Zero bezala "
"ezartzean azpititulu bakoizta hurrengo azpititulu arte bistaraziko da."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "azpititulu tamaina"
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
@@ -3074,11 +3068,11 @@ msgstr ""
"Azpititulu tamaina ezarri dezakezi hemen. Ezarpenak panatailaren tamainaren "
"arabera ulertuko dira."
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "azpititulu mugimetu bertikala"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
@@ -3086,33 +3080,32 @@ msgstr ""
"Azpitituluen kokapen bertikala ezarri dezakezu hemen.Ezarpenak panatailaren "
"tamainaren arabera ulertuko dira."
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "Azpitituluen letra-tipoa"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
"Xine letra-tipo karpetako letra-tipo bat erabili daiteke azpititulu "
"testuetarako."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
#, fuzzy
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
"Xine letra-tipo karpetako letra-tipo bat erabili daiteke azpititulu "
"testuetarako."
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "azpitituluen kodifikazioa"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3124,11 +3117,11 @@ msgstr ""
"badira zuk espero bezala bistaratzen, galdetu azpititulu sortzaileari zein "
"kodeketa erabiltzen duen."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "erabili eskalagabeko OSD posible bada"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3219,31 +3212,141 @@ msgstr "w32codec: Errorea DirectShow Audio abiarazterakoan\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: Errorea DMO Audioa abiarazterakoan\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "xine fitxategi audio irteera plugina"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "LAGUNTZA! mono bakarrik audio kontrolatzailea?\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "A/52 bolumena"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "A/52 bitarte dinamiko konpresioa"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad faacDecOpen()-ek huts egin du.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad faacDecInit2-ek huts egin du.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad faacDecInit-ek huts egin du.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: errorea ByteRun1 dekonpresioa egiterakoan\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 ez da onartzen momentuz\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 ez da onartzen momentuz\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ ez da onartzen momentuz\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: Animazio-mota ahu ez da onartzen momentu honetan\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3251,6 +3354,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3269,6 +3376,10 @@ msgstr ""
"ezartzeko.\n"
"\n"
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3293,6 +3404,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3303,6 +3418,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3359,16 +3478,24 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: Ez dago elkargurutzatur modurik eskuragarri, irteten.\n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "sortuko diren segunduko marko kopurua"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3376,33 +3503,37 @@ msgstr ""
"Segunduko marko gehiagorekin, animazioa leun eta azkarragoa izango da, baina "
"CPU azkarragoa behar du."
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr ""
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "sortuko den irudian zabalera pixeletan."
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr ""
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "sortuko den irudian altuera pixeletan."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr ""
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3422,7 +3553,12 @@ msgstr ""
" w: irudiaren zabalera\n"
" h: irudairen altuera\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3445,6 +3581,10 @@ msgid ""
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3471,20 +3611,8 @@ msgstr ""
"\n"
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3511,7 +3639,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3526,7 +3683,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3544,7 +3701,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3556,7 +3717,7 @@ msgstr ""
"Parametroak\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3564,6 +3725,10 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3592,11 +3757,126 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_rip: bilaketak huts egin du: %s\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: geratu irakurketa haria...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, fuzzy, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "RTP: hari irakurketa amaiturik\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: geratu irakurketa haria...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "RTP: hari irakurketa amaiturik\n"
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "stdin: ezin da '%s' ireki\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "stdin: ezin da '%s' ireki\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: huts '%s'-ra konektatzerakoan\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: Ezin da %s-ra konektatu: %d\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "stdin: ezin da '%s' ireki\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: Ezin da hari berria sortu (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "xine bideo irteera plugina AsCii Arte liburutegia erabiliaz"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "xine bideo irteera plugina Kolore AsCii Arte liburutegia erabiliaz"
@@ -3635,8 +3915,8 @@ msgid "video colour key"
msgstr ""
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3708,32 +3988,32 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
#, fuzzy
msgid "video layer id (auto: -1)"
msgstr "bideo saturazioa"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, fuzzy, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_vidix: erabilitako kontrolatzailea: %s, %s-rena\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
#, fuzzy
msgid "xine video output plugin using DirectFB."
msgstr "xine bideo irteera plugina DirectFB liburutegia erabiliaz"
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
#, fuzzy
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "xine bideo irteera plugina DirectFB liburutegia erabiliaz"
@@ -3751,22 +4031,22 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "xine bideo irteera plugina win32-rentzat directx erabiliaz"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
" Check 'fbset -i' or try 'fbset -depth 16'.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "framebuffer gailu izena"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3778,53 +4058,52 @@ msgstr ""
"xinek fitxategia eduki arbitrario bat erabiliaz bete bait dezake. Beraz "
"balioaegiazko framebuffer gailu bat dela ziurtatu behar duzu."
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out_fb: Bideo modua ez da ezagutzen, barkatu.\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: %d bideo RAM buffer eskuragarri dira.\n"
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr "Xine bideo irteera plugina Linux framebuffer gailua erabiliaz"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "xine bideo irteera plugina ezer bistaratzeko"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr ""
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3853,29 +4132,29 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr ""
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "gaitu buffer bikoitza"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
#, fuzzy
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "xine bideo irteera OpenGL - TNG erabiliaz"
@@ -3895,6 +4174,12 @@ msgstr "video_out_pgx32: Error: ioctl hutsa, okerreko gailua (%s)\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr "video_out_pgx32: Errorea: '%s' ez da pgx32 framebuffer gailua\n"
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+"xine bideo irteera plugina libvidix Linux Frame buffer-arentzat erabiliaz"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3932,54 +4217,54 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr "video_out_pgx64: Errorea: ezin dira leiho propietateak ezarri\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Abisua: bideo memoria baxua, buffer-anitza ezgaiturik\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Errorea: Bideo memoria askieza\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Abisua: bideo memoria baxua, buffer-bikoitza ezgaiturik\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Errorea: ioctl hutsa (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "gaitu buffer-anitzak"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
@@ -3987,6 +4272,12 @@ msgstr ""
"Buffer anitzek performantzia betzen dute baina memoria grafiko gehiago "
"erabiliaz."
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+"xine bideo irteera plugina libvidix Linux Frame buffer-arentzat erabiliaz"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "Erabili hardware azelerazioa eskuragarri badago"
@@ -4012,202 +4303,123 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: pantaila osoko modua EZ da onartzen\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "xine video irteera plugina \"Simple Direct Media Layer\" erabiliaz"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr "xine video output plugina \"Libstk Surface Set-top Toolkit\" erabiliaz"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr "video_out_syncfb: errorea. (txartela grafikoak ez du YUY2 onartzen)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr "video_out_syncfb: errorea. (txartela grafikoak ez du YV12 onartzen)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: info. (SyncFB moduluak YUV 4:2:0 (3 plano) onartzen du)\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: info. (SyncFB moduluak YUV 4:2:0 (2 plano) onartzen du)\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr "video_out_syncfb: info. (SyncFB moduluak YUV 4:2:2 onartzen du)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: info. (SyncFB moduluak YUY2 onartzen du)\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: info. (SyncFB moduluak RGB565 onartzen du)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: uzten. (SyncFB moduluak ez du YV12, YUY2 edo RGB565 "
-"onartzen)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "marko errepikatze lehenetsiriko kopurua"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-"Bideo marko bat gelditu gabe zenbat aldiz errepikatu behar den ezartzen du."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"xine bideo irteera plugina Matrox G200/G400 txartelen SyncFB modulua "
-"erabiliaz"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "SyncFB gailu izena"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-"Erabiliko den SynFB (TeleTux) gailuarne fitxategi izena ezartzen du,\n"
-"Ezarpen hau seguratsun kritikokoa da, fitxategi ezberdin batetara aldatzean, "
-"xinek fitxategia eduki arbitrario bat erabiliaz bete bait dezake. Beraz "
-"balioaegiazko framebuffer gailu bat dela ziurtatu behar duzu."
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "intentsitate gorria"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr "Gorri koloreko osagaien intentsitatea."
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "intentsitate berdea"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr "Berde koloreko osagaien intentsitatea."
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "Intentsitate urdina"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr "Urdin koloreko osagaien intentsitatea."
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: egokigailuak yuy2 formatua onartzen du\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: egokigailuak yv12 formatua onartzen du\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: VIDIX liburutegiaren okerreko bertsio bat duzu\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: Ezin da dabilen VIDIX kontrolatzailerik\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: erabilitako kontrolatzailea: %s, %s-rena\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "bideo ingurune kolore teklaren gorri osagaia"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "bideo ingurune kolore teklaren berde osagaia"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "bideo ingurune kolore teklaren urdin osagaia"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "xine bideo irteera plugina libvidix X11-rentzat erabiliaz"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
"xine bideo irteera plugina libvidix Linux Frame buffer-arentzat erabiliaz"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4217,82 +4429,79 @@ msgid ""
"\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, fuzzy, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
"video_out_xshm: MIT partekatutako memoria luzapena ez dago pantailan.\n"
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, fuzzy, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: bideo modua ez da ezagutzen, barkatu :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "video_out_fb: Bideo modua ez da ezagutzen, barkatu.\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, fuzzy, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr "video_out_xv: Xv luzapena ez dago.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
"video_out_xv: Xv luzapena dago baina ez da yuv12 ataka "
"erabilgarririkaurkitu.\n"
" Dirudienez zure txartela grafikoak ez du Xv onartzen?!\n"
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -4300,331 +4509,136 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, fuzzy, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
+msgid "%s: this adaptor supports the %s format.\n"
msgstr "video_out_xv: adaptadoreak yv12 formatua onartzen du.\n"
-#: src/video_out/video_out_xcbxv.c:1592
-#, fuzzy, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: adaptadoreak yuy2 formatua onartzen du.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "ez-elkarlituriko metodoa (zaharkiturik)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "xine bideo irteera plugina MIT X bideo luzapena erabiltzen"
-#: src/video_out/video_out_xshm.c:194
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:210
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:220
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xshm: MIT partekatutako memoria luzapena ez dago pantailan.\n"
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: bideo modua ez da ezagutzen, barkatu :-(\n"
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:332
-#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: Xv luzapena ez dago.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: Xv luzapena dago baina ez da yuv12 ataka "
-"erabilgarririkaurkitu.\n"
-" Dirudienez zure txartela grafikoak ez du Xv onartzen?!\n"
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: adaptadoreak yv12 formatua onartzen du.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: adaptadoreak yuy2 formatua onartzen du.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "xineo bideo irteera plugina XvMC X bideo luzapena erabiltzen"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: XvMC luzapena ez dago.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
"port.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
" for hardware colour space conversion and scaling\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " ez da XvMC onartzen \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, fuzzy, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xvmc: XvMC luzapena ez dago.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, fuzzy, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: Xv luzapena dago baina ez da yuv12 ataka "
-"erabilgarririkaurkitu.\n"
-" Dirudienez zure txartela grafikoak ez du Xv onartzen?!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, fuzzy, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: adaptadoreak yv12 formatua onartzen du.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, fuzzy, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: adaptadoreak yuy2 formatua onartzen du.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "xineo bideo irteera plugina XvMC X bideo luzapena erabiltzen"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4732,60 +4746,60 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: ez dago plugin erabilgarririk '%s' kudeatzeko\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: errorea, buffer mota ezezaguna: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "audio buffer kopurua"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
"audio_out: atzerapena kalkulatzea ezinezko audio gailu eskuraezin batekin\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, fuzzy, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
"Hus soinu txartelan idazterakoan. Konektatu gabeko USB gailu bat ote?\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "kontrolatzaileak ez du 8bit onartzen, 16bit-era bihurtzen.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "kontrolatzaileak ez du mono onartzen, estereo-ra bihurtzen.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "kontrolatzaileak ez du estereo onartzen, mono-ra bihurtzen.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "audioa eta bideoa sinkronizatzeko metodoa"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4808,11 +4822,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr ""
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4820,33 +4834,33 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr ""
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr ""
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4854,80 +4868,80 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "abiarazterakoan audio bolumena"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "Xine abiaraztean ezarriko den audio bolumena."
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "berezarri tamaina maila abiaraztean"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"ezgaiturik badago, xine-k ez ditu nahasle ezarpenak aldatuko abiaraztean."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"audio_out: barkatu, hau ez zen gertatu beharko. mesedez xine berrabiarazi.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
"Konfigurazio fitxategia xine-ren bertsio berriagobategatik aldatua izan da."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: huts '%s' dvb kanal fitxategia irekitzerakoan\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
"configfile: ABISUA: %s-en konfigurazio fitxategia segurtasun kopia egiten\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: ABISUA: zure konfigurazioa ezin da gorde\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: ABISUA: huts %s konfigurazioa gordetzerakoan\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: ABISUA: agian apurturiko %s konfigurazio fitxategia ezabatzen\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr ""
"configfile: ABISUA: zuk segurtasun kopia %s fitxategia egiaztatu beharko "
"zenuke\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: ¡'%s' sarrera ezin MRL-tik aldatu\n"
@@ -4943,65 +4957,65 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr "osd: ez da moldatzea onartzen: %s -> %s, ez da moldatuko\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, fuzzy, c-format
msgid ": open() function should never be called\n"
msgstr "input_rip: open() funtzioa ez zen inoiz deitu beharko\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, fuzzy, c-format
msgid ": input plugin not defined!\n"
msgstr "input_rip: sarrera pluginia ez ezarririk!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: huts grabatutako datuak irakurtzerkaoan: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: huts sarrera pluginetik irakirtzerakoan\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, fuzzy, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: errorea %lld fitxategian idazterakoan, byte-ak: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: open() funtzioa ez zen inoiz deitu beharko\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: bilaketak huts egin du\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: bilaketak huts egin du: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, fuzzy, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %lld byte alde batetara utzirik\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: sarrera pluginia ez ezarririk!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
"'media.capture.save_dir'\n"
msgstr ""
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5009,12 +5023,12 @@ msgstr ""
"korreonte grabaketa aukera ezgaiturik dago konfigruaketan media.capture."
"save_dir ezarri arte."
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
@@ -5022,51 +5036,51 @@ msgstr ""
"xine ez dago jatorri horretatik grabatzeko gaiturik (kopia eskubidedun "
"materiala agian?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: ez da fitxategi izena eman!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: errorea %s fitxategia irekitzerakoan: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, fuzzy, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: Baimena ukaturik\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, fuzzy, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "input_rip: bilaketak huts egin du: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "huts soket egoera eskuratzerakoan"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Baimena ukaturik\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Fitxategia ez da aurkitu\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Konexioa Ukaturik\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -5074,68 +5088,68 @@ msgstr ""
"load_plugins: %s plugina alde batetara utzi, okerreko iface bertsioa %d (%d "
"espero zen)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "%s deskodetzailearen lehentasuna"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
"the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: %s plugin aurkitu dira\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, fuzzy, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: %s plugin aurkitu dira\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: plugin muga gainditu da, %s ezin da kargatu\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr "load_plugins: plugin muga gainditu da, %s ezin da kargatu\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: %d plugin mota ezezaguna %s-n\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, fuzzy, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: %d plugin mota ezezaguna %s-n\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: ezin da %s identifikatu\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5144,7 +5158,7 @@ msgstr ""
"load_plugins: ezin da %s plugin liburutegia ireki:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5153,54 +5167,59 @@ msgstr ""
"load_plugins: ezin da %s-eko plugin informazio eskuratu:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: alde batetara uzten %s plugin karpeta irakurtezina.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Ezin da %s ireki: %s.\n"
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: %d eduki atzemate estrategia ezezaguna\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: huts <%s> audio irteera plugina kargatzerakoan\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5209,7 +5228,7 @@ msgstr ""
"load_plugins: audio irteera auto-frogak ez du adio kontrolatzailerik "
"aurkitu.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, fuzzy, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5218,112 +5237,120 @@ msgstr ""
"load_plugins: ezin da %s plugin liburutegia ireki:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "'%s-%d' letra-tipoa dagoeneko kargaturik, bitxia.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "huts '%s' letra tipoa kargatzerakoan (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
"'%s' letra tipoaren okerreko bertsioa. %d espero zen baina %d aurkitu da.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: ezin da ft2 liburutegia abiarazi\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, fuzzy, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: errorea glyph %i kargatzerakoan\n"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
+msgstr "osd: errorea glyph %i kargatzerakoan\n"
+
+#: src/xine-engine/osd.c:1110
#, c-format
-msgid "osd: error loading font %s with ft2\n"
-msgstr ""
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: ezin da ft2 liburutegia abiarazi\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
"osd: errorea letra-tipo tamaina ezarpenean (letra-tipo ez eskalagarria?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
"skipping\n"
msgstr ""
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: ezin da irteera karaktere jokoa aurkitu\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: ez da moldatzea onartzen: %s -> %s, ez da moldatuko\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: letra-tipoa ez dago ezarririk\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: errorea glyph kargatzerkaoan\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: errorea glyph reenderizatzerakoan\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: errorea glyph %i kargatzerakoan\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: errorea reenderizatzerakoan\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr ""
"OSD eta azpitituluetan erabiliko den paleta (aurreko-ertza-atzeko koloreak)"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5338,49 +5365,49 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: ez dago pluginik '%s' kudeatzeko\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: errorea, buffer mota ezezaguna: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "bideo buffer kopurua"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr ""
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
"(diff : %<PRId64>).\n"
msgstr ""
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5396,48 +5423,48 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
#, fuzzy
msgid "default number of video frames"
msgstr "marko errepikatze lehenetsiriko kopurua"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "onartzen den alde batetara utziko marko kopuru ehunekoa"
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "onartzen den alde batetara utziko marko kopuru ehunekoa"
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: barkatu, hau ez zen gertatu beharko. mesedez xine berrabiarazi.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "irudi horizontal kokalekua irteera lehoan"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5445,11 +5472,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "irudi bertikal kokalekua irteera lehoan"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5457,11 +5484,11 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "bideo eskalatze guztiak ezgaitu"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5472,148 +5499,148 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: errorea mrl analizatzerakoan\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: input plugin-a aurkiturik : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: sarrera pluginak ezin du MRL-a [%s] ireki\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: ezin da [%s] MRL-aren plugina aurkitu\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr ""
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr ""
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "bidoa alde batetara uzten\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "audioa alde batetara uzten\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "azpi-irudia alde batetara uzten\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr ""
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "'%s' azpititulu mrl-a irekirik\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: errorea azpititulu mrl-a irekitzerakoan\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: errorea MRL-analizatzerakoan\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: MRL-ko '%s' aukera aldaketa ez da onartzen\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr ""
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr ""
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr ""
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
"xine: Ezarritako \"%s\" gordetze karpeta (save_dir) segurtasun arrisku bat "
"izan daiteke.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
"Ezarritako gordetze karpeta (save_dir) segurtasun arrisku bat izan daiteke."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: lokala ez du C liburutegiak onartzen\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "medio formatu atzemate modua"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5642,11 +5669,11 @@ msgstr ""
"extension\n"
"Izen luzapen bidez bakarrik atzemna.\n"
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "korronteak gordetzeko karpeta"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5656,11 +5683,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr "Onartu aldaketa inplizitoak konfiguraketan (adib. MRL bidez)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5670,99 +5697,99 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "mezuak"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "plugina"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "aztarna"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr ""
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
#, fuzzy
msgid "Unknown host:"
msgstr "ostalari ezezaguna"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
#, fuzzy
msgid "Unknown device:"
msgstr "gertaera mota ezezaguna: "
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr ""
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
#, fuzzy
msgid "Connection refused:"
msgstr "io_helper: Konexioa Ukaturik\n"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
#, fuzzy
msgid "File not found:"
msgstr "io_helper: Fitxategia ez da aurkitu\n"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr ""
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
#, fuzzy
msgid "Error loading library:"
msgstr "osd: errorea glyph kargatzerkaoan\n"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr ""
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr ""
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
#, fuzzy
msgid "Audio device unavailable"
msgstr "Sun audio gailu izena"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr ""
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr ""
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "xinek erabiltzen duen memoria kopia metodoa"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "memcpy metodoak frogatzen (txeikiena obea da)\n"
diff --git a/po/fr.po b/po/fr.po
index 6b96e428c..334f9a7fe 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.1.9\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2008-01-01 15:18+0100\n"
"Last-Translator: Christophe Giraud <chris256gnu@gmail.com>\n"
"Language-Team: french <fr@li.org>\n"
@@ -330,201 +330,197 @@ msgstr ""
"Voir la documentation alsa pour toutes informations complémentaires sur les "
"périphériques alsa."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
"plugin de sortie audio xine utilisant les pilotes/périphériques compatible "
"alsa "
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "plugin de sortie audio xine utilisant arts de kde"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "plugin de sortie audio xine pour Coreaudio/Mac OS X"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Erreur"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "succès"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "accès interdit"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "la ressource est déjà en cours d'utilisation"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "L'objet était déjà initialisé"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "Le format wave spécifié n'est pas supporté"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "le tampon mémoire a été perdu et doit être restauré"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "Le contrôle du buffer requis n'est pas disponible"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "Erreur interne indéterminée du sous-système DirectSound"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "Le périphérique matériel DirectSound est indisponible"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "La fonction n'est pas valide pour l'état actuel de l'objet"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "Un paramètre invalide a été passé"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "L'objet ne supporte pas l'agrégation"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "pas de pilote son disponible"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "L'interface COM requise n'est pas disponible"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "une autre application a un niveau de priorité plus élevé"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "mémoire insuffisante"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "Niveau de priorité bas pour cette fonction"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound n'était pas initialisé"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "cette fonction n'est pas supportée"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "erreur inconnue"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Impossible de créer l'objet direct sound."
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "Impossible de créer un second tampon pour direct sound "
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "Ne peut pas utiliser le buffer audio"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "Ne peut pas stopper le buffer audio"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "Ne peut pas obtenir la position du buffer"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "Ne peut pas ajuster la position du buffer"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "Impossible de régler le volume sonore"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": buffer perdu, tentative de restauration\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "Impossible de verrouiller le buffer de direct sound"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "Impossible de déverrouiller le buffer de direct sound"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "incapable d'allouer le buffer d'entré."
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": ne peux pas créer la condition pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": ne peut pas créer pthread mutex: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": ne peut pas créer le pthread du buffer: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": ne peut pas détruire le pthread du buffer: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ":ne peut pas détruire la condition pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": ne peut pas détruire pthread mutex: %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ": commande inconnu %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "second plugin de sortie audio xine utilisant directx"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "plugin de sortie audio xine pour win32 utilisant directx"
@@ -557,11 +553,11 @@ msgstr ""
"vidéo, Vous pouvez entrer une valeur de décalage fixe pour compenser.\n"
"L'unité de valeur est un PTS tick, ce qui représente 1/90000 de seconde."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "plugin de sortie audio xine utilisant esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "plugin de sortie audio xine utilisant un fichier "
@@ -596,7 +592,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "plugin de sortie audio xine pour JACK Audio Connection Kit"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "plugin de sortie audio xine utilisant dummy"
@@ -752,7 +748,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: l'ouverture() du mixeur %s a échouée: %s\n"
@@ -771,20 +767,20 @@ msgstr "périphérique utilisé pour pulseaudio"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "plugin de sortie audio xine utilisant le serveur de son pulseaudio"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: l'ouverture du périphérique audio %s a échouée : %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "Nom du périphérique audio Sun"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -792,179 +788,33 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: audio ioctl sur le périphérique %s a échoué: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"plugin de sortie audio xine utilisant les pilotes/périphériques compatible "
"sun"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"ffmpeg_audio_dec: augmentation du buffer à %d pour éviter sa saturation.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "dvaudio: augmentation du buffer à %d pour éviter sa saturation.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"ffmpeg_video_dec: augmentation du buffer à %d pour éviter sa saturation.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "Qualité du post-traitement MPEG-4"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-"Vous pouvez ajuster le niveau de post-traitement a appliqué au vidéo "
-"MPEG-4.\n"
-"De hautes valeurs donnent une meilleure qualité d'image mais sollicite "
-"davantage le processeur.De faibles valeurs peuvent provoquer une dégradation "
-"de l'image comme par exemple l'apparition d'artefacts. Dans le cas d'une "
-"vidéo de haute qualité, un post-traitement trop important peut actuellement "
-"dégrader l'image en la rendant plus floue . "
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
+"ogg: piste audio vorbis indiquée mais aucune entête de flux vorbis n'a été "
+"trouvée.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr ""
+#: src/combined/xine_ogg_demuxer.c:2173
+#, fuzzy
+msgid "Annodex demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
-msgstr ""
+#: src/combined/xine_ogg_demuxer.c:2197
+#, fuzzy
+msgid "OGG demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -984,6 +834,11 @@ msgstr "demux_asf: attention: Le flux id=%d est crypté.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Flux média brouillé/crypté"
+#: src/demuxers/demux_asf.c:2134
+#, fuzzy
+msgid "ASF demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Restauration de l'index..."
@@ -1003,16 +858,24 @@ msgstr "demux_avi: l'index avi est corrompu\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr ""
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr ""
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1028,6 +891,11 @@ msgstr "aucun flux audio ou vidéo n'est présent dans ce fichier.\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1043,30 +911,38 @@ msgstr "iff-ilbm: compression inconnue: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr ""
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1075,7 +951,11 @@ msgstr ""
"demux_mpeg_block: attention: l'entête PES indique que ce flux peut être "
"crypté (mode de cryptage %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1084,17 +964,17 @@ msgstr ""
"xine-lib:demux_mpeg_pes: stream_id 0x%02x non reconnu. Veuillez reporter "
"ceci aux développeurs xine.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1103,7 +983,7 @@ msgstr ""
"demux_mpeg_block: attention: l'entête PES indique que ce flux peut être "
"crypté (mode de cryptage %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1112,12 +992,10 @@ msgstr ""
"demux_mpeg_pes:Flux privé non reconnu 1 0x%02x. Veuillez reporter ceci aux "
"développeurs xine.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
-msgstr ""
-"ogg: piste audio vorbis indiquée mais aucune entête de flux vorbis n'a été "
-"trouvée.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+#, fuzzy
+msgid "mpeg pes demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1129,11 +1007,20 @@ msgstr ""
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: type audio non supporté: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+msgid "True Audio demux plugin"
+msgstr ""
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1145,6 +1032,11 @@ msgid ""
"unknown VOC compression type (0x%02X); please report to xine developers\n"
msgstr ""
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1155,36 +1047,42 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr ""
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1200,11 +1098,11 @@ msgid ""
"use of the Active Format Descriptor (AFD) used in some European DVB channels."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1212,19 +1110,19 @@ msgid ""
"This is relevant for progressive video only (most PAL films)."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1232,85 +1130,95 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr ""
"dxr3_decode_video: L'ouverture du périphérique vidéo a echouée %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr ""
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
"16\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: ne peut pas démarrer l'encodage: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1327,51 +1235,55 @@ msgid ""
"clock as sync source."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
"screen."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: L'ouverture du périphérique vidéo a échouée %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1385,22 +1297,22 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1411,7 +1323,7 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1422,11 +1334,11 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1458,22 +1370,22 @@ msgid ""
"of DXR3 overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
"when using DXR3 overlay mode."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1481,26 +1393,26 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1510,47 +1422,47 @@ msgid ""
"default: keep the card's setting"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
"video_out_dxr3: Read the README.dxr3 for details.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: ne peut pas se connecter à %s:%d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: serveur cddb '%s:%d' connecté avec succés.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: impossible de se connecter au serveur cddb '%s:%d' (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr ""
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "périphérique utilisé pour les cd audio"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1558,11 +1470,11 @@ msgstr ""
"Le chemin d'accès vers le périphérique, généralement un lecteur CD ou DVD, "
"choisissez celui que vous souhaitez utiliser pour lire vos CD audio."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1571,11 +1483,11 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "Nom du serveur CDDB"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1583,31 +1495,19 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "Port du serveur CDDB "
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr ""
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr ""
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1616,194 +1516,189 @@ msgid ""
"A value of zero here will disable the slowdown."
msgstr ""
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr ""
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr ""
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, fuzzy, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_cda: fopen(%s) à échoué: %s\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: ne peux pas ouvrir le périphérique dvb\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: recherche pour le canal %s\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr ""
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr ""
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
"T)\n"
msgstr ""
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
"C)\n"
msgstr ""
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
"A)\n"
msgstr ""
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: ne peut pas ouvrir le périhérique dvr '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr ""
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
msgstr ""
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr ""
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr ""
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr ""
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
msgstr ""
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr ""
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Erreur à l'ouverture du périphérique DVD\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "périphérique utilisé pour la lecture des DVD"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -1811,11 +1706,11 @@ msgstr ""
"Le chemin d'accès vers le périphérique, généralement un lecteur CD ou DVD, "
"choisissez celui que vous souhaitez utiliser pour lire vos DVD ."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr ""
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1826,68 +1721,55 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr ""
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr ""
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr ""
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "langue par défaut pour la lecture des DVD"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr ""
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr ""
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1906,11 +1788,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr ""
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1924,11 +1806,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1945,38 +1827,38 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: erreur de lecture (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Permission refusée: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Fichier non trouvé: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Fichier vide: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr ""
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr ""
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "lister les fichiers cachés"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
@@ -1984,91 +1866,91 @@ msgstr ""
"Si activé, le navigateur qui vous permet de sélectionner les fichiers à "
"jouer vous montrera également ceux qui sont cachés."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "plugin d'entré gnome-vfs fourni avec xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s) a echoué: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: erreur de lecture %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Connexion au serveur HTTP..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: réponse http invalide\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx redirection: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr ""
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr ""
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: buffer épuisé après %d bytes."
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "plugin d'entré http"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr ""
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "Le nom d'hôte pour le proxy HTTP."
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr ""
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr ""
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr ""
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2076,103 +1958,103 @@ msgid ""
"(full match required)."
msgstr ""
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr ""
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr ""
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "Protocole MMS"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
msgstr ""
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: impossible de résoudre '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: impossible de se connecter à '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "plugin d'entré réseau fournis avec xine"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr ""
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: erreur à la création du fichier pvr (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: erreur à l'ouverture du fichier pvr (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: erreur de lecture (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: erreur à l'ouverture du périphérique %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
"input_pvr: IVTV_IOC_G_CODEC a échoué, peut-être que l' API a changé ?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
"input_pvr: IVTV_IOC_S_CODEC a échoué, peut-être que l' API a changé ?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "plugin d'entré WinTV-PVR 250/350"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "périphérique utilisé pour WinTV-PVR 250/350 (pvr plugin)"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "Le chemin d'accès vers le périphérique de votre carte WinTV."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "plugin d'entré WinTV-PVR 250/350"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2222,142 +2104,142 @@ msgstr "incapable de se connecter à '%s'.\n"
msgid "recv(): %s.\n"
msgstr ""
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: arrêt de la lecture du thread...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr ""
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr ""
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: ne peux pas créer le nouveau thread (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "plugin d'entré RTP et UDP fournis avec xine"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr ""
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "plugin d'entré CIFS/SMB basé sur libsmbclient"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr ""
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: impossible d'ouvrir '%s'\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr ""
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr ""
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr ""
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr ""
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Tuner non trouvé\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "plugin d'entré tv V4l"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "plugin d'entré radio v4l"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "périphérique vidéo v4l"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "Le chemin d'accès vers votre périphérique vidéo Video4Linux"
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "périphérique radio v4l"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "Le chemin d'accès vers votre périphérique vidéo Video4Linux"
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "plugin d'entré radio v4l"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "périphérique radio v4l"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "Le chemin d'accès vers votre périphérique radio Video4Linux"
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: MRL mal formée. Utilisez vcdo:/<track #>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: piste %d invalide (limites correctes: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "plugin d'entré Video CD"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "incapable d'ouvrir %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: incapable d'ouvrir %s: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "plugin d'entré Video CD"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "périphérique utilisé pour la lecture des VCD"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
@@ -2365,12 +2247,12 @@ msgstr ""
"Le chemin d'accès vers le périphérique, généralement un lecteur CD ou DVD, "
"choisissez celui que vous souhaitez utiliser pour lire vos VideoCD ."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: mauvaise mrl: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: impossible de se connecter à '%s'\n"
@@ -2451,19 +2333,19 @@ msgstr ""
msgid "Buffering..."
msgstr ""
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
"%s\n"
msgstr ""
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: impossible de se connecter '%s'\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr ""
@@ -2512,98 +2394,98 @@ msgstr ""
msgid "Invalid current entry type"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "type d'évènement inconnu:"
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2624,11 +2506,11 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2636,11 +2518,11 @@ msgid ""
"See the help for the title_format for the meanings of these."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2657,85 +2539,180 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
msgstr ""
+"ffmpeg_audio_dec: augmentation du buffer à %d pour éviter sa saturation.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "dvaudio: augmentation du buffer à %d pour éviter sa saturation.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad NeAACDecOpen() a échoué.\n"
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit2 a échoué.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr ""
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit a échoué.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+"ffmpeg_video_dec: augmentation du buffer à %d pour éviter sa saturation.\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "Qualité du post-traitement MPEG-4"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"Vous pouvez ajuster le niveau de post-traitement a appliqué au vidéo "
+"MPEG-4.\n"
+"De hautes valeurs donnent une meilleure qualité d'image mais sollicite "
+"davantage le processeur.De faibles valeurs peuvent provoquer une dégradation "
+"de l'image comme par exemple l'apparition d'artefacts. Dans le cas d'une "
+"vidéo de haute qualité, un post-traitement trop important peut actuellement "
+"dégrader l'image en la rendant plus floue . "
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
#: src/libreal/real_common.c:139
@@ -2751,11 +2728,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2776,122 +2748,150 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+msgid "closed caption decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr ""
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+msgid "sputext demuxer plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr ""
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
"in the subtitle being shown until the next one takes over."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -2899,11 +2899,11 @@ msgid ""
"used."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -2982,31 +2982,141 @@ msgstr ""
msgid "w32codec: Error initializing DMO Audio\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "plugin de sortie audio de xine utilisant esd"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad NeAACDecOpen() a échoué.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit2 a échoué.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit a échoué.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr ""
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3014,6 +3124,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3025,6 +3139,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3049,6 +3167,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3059,6 +3181,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3115,48 +3241,60 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr ""
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr ""
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
msgstr ""
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr ""
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr ""
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr ""
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3168,7 +3306,12 @@ msgid ""
" h: the height of the picture\n"
msgstr ""
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3187,6 +3330,10 @@ msgid ""
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3202,20 +3349,8 @@ msgid ""
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
msgstr ""
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3242,7 +3377,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3257,7 +3421,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3275,7 +3439,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3283,12 +3451,16 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3317,11 +3489,126 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_cda: fopen(%s) à échoué: %s\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr "input_rtp: ne peux pas créer le nouveau thread (%s)\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "input_rtp: ne peux pas créer le nouveau thread (%s)\n"
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "input_rtp: ne peux pas créer le nouveau thread (%s)\n"
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "incapable de resoudre '%s'.\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "incapable de resoudre '%s'.\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "input_net: impossible de se connecter à '%s'.\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "input_net: impossible de se connecter à '%s'.\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "incapable de resoudre '%s'.\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: ne peux pas créer le nouveau thread (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "plugin de sortie video xine utilisant la bibliothèque ascii-art"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "plugin de sortie video xine utilisant la bibliothèque Color AsCii Art"
@@ -3360,8 +3647,8 @@ msgid "video colour key"
msgstr ""
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3433,30 +3720,30 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr ""
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "plugin de sortie vidéo xine utilisant DirectFB."
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "plugin de sortie vidéo xine utilisant DirectFB sous XDirectFB."
@@ -3473,22 +3760,22 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "plugin de sortie vidéo xine pour win32 utilisant directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
" Check 'fbset -i' or try 'fbset -depth 16'.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "Nom du périphérique framebuffer"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3496,54 +3783,53 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
+#: src/video_out/video_out_fb.c:876
#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:950
+#: src/video_out/video_out_fb.c:933
#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+msgid "%s: %d video RAM buffers are available.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
"plugin de sortie video xine utilisant le périphérique framebuffer de linux"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "plugin de sortie video xine qui n'affiche rien"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr ""
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3572,29 +3858,29 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr ""
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr ""
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "plugin de sortie vidéo xine utilisant l'API graphique 3D OpenGL"
@@ -3613,6 +3899,12 @@ msgstr "video_out_pgx32: Erreur: ioctl a échoué, mauvais périphérique (%s)\n
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+"plugin de sortie video de xine utilisant le périphérique framebuffer de linux"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3652,57 +3944,63 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Erreur: ioctl a échoué (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+"plugin de sortie video de xine utilisant le périphérique framebuffer de linux"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr ""
@@ -3724,192 +4022,124 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr ""
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "plugin de sortie video xine utilisant Simple Direct Media Layer"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
"plugin de sortie video xine utilisant le toolkit Libstk Surface Set-top"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "plugin de sortie vidéo xine utilisant libvidix pour x11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
"plugin de sortie video xine utilisant libvidix pour le framebuffer linux"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -3919,78 +4149,75 @@ msgid ""
"\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -3998,324 +4225,136 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1592
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
+msgid "%s: this adaptor supports the %s format.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "plugin de sortie video xine utilisant l'extension video MIT X"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:237
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:1170
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "plugin de sortie video xine utilisant l'extension video XvMC "
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
"port.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
" for hardware colour space conversion and scaling\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr ""
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "plugin de sortie video xine utilisant l'extension video XvMC "
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4421,58 +4460,58 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr ""
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr ""
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4495,11 +4534,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr ""
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4507,33 +4546,33 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr ""
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr ""
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4541,73 +4580,73 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr ""
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr ""
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr ""
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr ""
@@ -4623,193 +4662,193 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr ""
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": plugin d'entré non défini!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: la lecture des données sauvegardées a échouée: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: la lecture par le plugin d'entré a echoué\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: la recherche a échouée\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: la recherche a échouée: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr ""
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
"'media.capture.save_dir'\n"
msgstr ""
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
msgstr ""
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: erreur à l'ouverture du fichier %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr ""
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr ""
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr ""
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Permission refusée\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Fichier non trouvé\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Connexion refusée\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr ""
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
"the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -4818,68 +4857,73 @@ msgstr ""
"load_plugins: impossible d'ouvrir plugin lib %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Impossible de créer l'objet direct sound."
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: utilise le demuxer '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: impossible de charger le plugin de sortie audio <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
"driver.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -4888,109 +4932,117 @@ msgstr ""
"load_plugins: ne peut pas décharger plugin lib %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr ""
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr ""
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
#, c-format
-msgid "osd: error loading font %s with ft2\n"
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr ""
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
"skipping\n"
msgstr ""
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr ""
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: conversion non supportée %s -> %s, pas de conversion effectuée\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr ""
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr ""
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr ""
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr ""
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5005,49 +5057,49 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr ""
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr ""
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
"(diff : %<PRId64>).\n"
msgstr ""
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5063,46 +5115,46 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr ""
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5110,11 +5162,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5122,11 +5174,11 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr ""
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5137,145 +5189,145 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr ""
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: plugin d'entré trouvé : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: le plugin d'entré ne peut pas ouvrir la MRL [%s]\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr ""
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr ""
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr ""
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr ""
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr ""
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr ""
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr ""
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr ""
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: erreur à l'ouverture des sous-titres de la mrl\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr ""
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr ""
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr ""
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr ""
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr ""
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr ""
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr ""
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5293,11 +5345,11 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr ""
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5307,11 +5359,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5321,93 +5373,93 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "messages"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "plugin"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr ""
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Attention:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "Hôte inconnu:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Périphérique inconnu:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Réseau inaccessible"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Connexion refusée:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "Fichier non trouvé:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Erreur de lecture provenant de:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr ""
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "Flux média crypté détecté"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "Message de sécurité:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "Périphérique audio non disponible"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Erreur de permission"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "Le fichier est vide:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr ""
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr ""
diff --git a/po/it.po b/po/it.po
index 554fd5785..bd2c6e276 100644
--- a/po/it.po
+++ b/po/it.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: it\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2007-12-24 16:09+0100\n"
"Last-Translator: Diego 'Flameeyes' Pettenò <flameeyes@gentoo.org>\n"
"Language-Team: Italian\n"
@@ -323,202 +323,198 @@ msgstr ""
"volume.\n"
"Si veda la documentazione ALSA per informazioni sui dispositivi."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
"plugin output audio di xine che usa i dispositivi/driver audio compiacenti "
"di alsa"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "plugin output audio di xine che usa artsd di KDE"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "plugin di uscita audio per xine per Coreaudio/Max OS X"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Errore"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "successo"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "accesso negato"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "risorsa già in uso"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "oggetto già inizializzato"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "il formato d'onda specificato non è supportato"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "il buffer in memoria è stato perso e deve essere ripristinato"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "il controllo del buffer richiesto non è disponibile"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "errore non determinato nel sistema DirectSound"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "il dispositivo hardware DirectSound non è disponibile"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "la funzione non è valida per l'attuale stato dell'oggetto"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "parametro passato non valido"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "l'oggetto non supporta aggregazione"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "nessun driver sonoro disponibile all'uso"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "l'interfaccia COM richiesta non è disponibile"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "un'altra applicazione ha un livello di priorità maggiore"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "memoria insufficiente"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "basso livello di priorità per questa funzione"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound non inizializzato"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "la funzione non è supportata"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "errore sconosciuto"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Impossibile creare l'oggetto DirectSound."
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr "Impossibile impostare il livello cooperativo DirectSound."
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "Impossibile creare il buffer DirectSound secondario."
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "Impossibile riprodurre il buffer sonoro"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "Impossibile fermare il buffer sonoro"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "Impossibile leggere la posizione del buffer"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "Impossibile impostare la posizione del buffer"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "Impossibile impostare il volume sonoro"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": buffer perso, provando a recuperare\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "Impossibile bloccare il buffer DirectSound"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "Impossibile sbloccare il buffer DirectSound"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "Impossibile creare il buffer DirectSound primario."
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, fuzzy, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
": il cursore di riproduzione è uscito dai limiti, svuotamento dei buffer.\n"
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": impossibile creare la condizione pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": impossibile creare il mutex pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": impossibile creare il buffer pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": impossibile cancellare il buffer pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ": impossibile cancellare la condizione pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": impossibile cancellare il mutex pthread: %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr "; comando di controllo sconosciuto %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "secondo plugin di uscita audio per xine utilizzante directx"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "plugin output audio di xine che usa directx per win32"
@@ -551,11 +547,11 @@ msgstr ""
"fisso per compensarlo.\n"
"L'unità di valore è un \"PTS tick\" ovvero 1/90000 secondi."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "pluging output audio di xine che usa esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "plugin di uscita audio per xine su file"
@@ -593,7 +589,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "plugin di uscita audio per xine per JACK Audio Connection Kit"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "pluging output audio dummy di xine"
@@ -800,7 +796,7 @@ msgstr ""
"L'intervallo di questo valore è -1 o 0-15, questa impostazione è ignorata "
"quando il nome del dispositivo audio OSS è settato a \"auto\".s"
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: open() del mixer %s non riuscita: %s\n"
@@ -820,20 +816,20 @@ msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
"Si usi 'server[:sink]' per impostare il dispositivo sink di PulseAudio."
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "plugin di output audio di xine che usa il server sonoro PulseAudio"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: apertura dispositivo audio %s non riuscita: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "nome dispositivo audio Sun"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -846,198 +842,32 @@ msgstr ""
"quindi si deve essere attenti che il valore inserito sia davvero un "
"dispositivo audio Sun."
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: ioctl sul dispositivo %s non riuscita: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"plugin output audio di xine che usa i dispositivi/driver audio compiacenti "
"di sun"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: aumentando il buffer a %d per evitare overflow.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_audio_dec: impossibile trovare il decoder ffmpeg per il tipo di "
-"buffer 0x%X\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: provando ad aprire un codec nullo.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: impossibile aprire il decoder.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: impossibile aprire il decoder.\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "dvaudio: aumentando il buffer a %d per evitare overflow.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: formato frame non supportato, DR1 disabilitato.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-"ffmpeg_video_dec: dimensioni del frame non supportate. DR1 disabilitato.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-"ffmpeg_video_dec: impossibile trovare il decoder ffmpeg per il tipo di "
-"buffer 0x%X\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: impossibile aprire il decoder\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: impossibile aprire il decoder\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: visualizzazione diretta abilitata\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_video_dec: buffer aumentato a %d per evitare overflow.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "qualità di post-elaborazione MPEG-4"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-"Si può tarare la quantità di post elaborazione applicata ai video MPEG-4.\n"
-"Valori più alti risultano in qualità migliore ma richiedono più CPU. Valroi "
-"più bassi possono risultare in difetti dell'immagine come artefatti. Per unc "
-"otnenuto ad alta qualità, una post elaborazione troppo alta può in realtà "
-"rendere l'immagine peggiore sfocandola troppo."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr "Numero di thread di decodifica FFmpeg"
+"ogg: indicata traccia audio vorbis ma nessuno stream di intestazione vorbis "
+"trovato.\n"
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
+#: src/combined/xine_ogg_demuxer.c:2173
#, fuzzy
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"Puoi impostare il numero di thread di decodifica che FFMpeg può usare.\n"
-"Valori più alti dovrebbero renere più veloce la decodifica, ma il supporto "
-"alla decodifica parallela dipende dal codec utilizzato. Una buona regola "
-"pratica è di avere un thread di decodifica per ogni CPU virtuale "
-"(tipicamente da 1 a 4). La modifica avrà effetto alla riproduzione del "
-"prossimo flusso."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "bitrate MPEG di uscita per libavcodec (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-"La bitrate utilizzata dal codificatore MPEG libavcodec per la modalità di "
-"codifica DXR3. Valori più alti aumenteranno la qualità e l'uso di CPU.\n"
-"Questa impostazione è considerata solo quando è disabilitata la modalità a "
-"qualità costante. "
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "modalità a qualità costante"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-"Se abilitata libavcodec utilizzerà una modalità a qualità costante "
-"comprimendo le immagini a secodna della loro complessità. Quando "
-"disabilitata libavcodec utilizzerà una modalità a bitrate costante."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "compressione minima"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
-msgstr ""
-"La compressione minima da applicare ad un'immagine utilizzando una modalità "
-"a qualità costante."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr "quantizzatore massimo"
+msgid "Annodex demux plugin"
+msgstr "xine: trovato plugin demuxer: %s\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
-"La compressione massima da applicare ad un'immagine utilizzando una modalità "
-"a qualità costante."
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -1057,6 +887,10 @@ msgstr "demux_asf: attenzione: L'id dello stream =%d è cifrato.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Stream multimediale confuso/cifrato"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Ripristino indice..."
@@ -1078,16 +912,24 @@ msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
"demux_avi: riposizionamento alla successiva parte fallito (pos %<PRIdMAX>)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "dimensione di parte di FILM non valida\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "parte di FILM non roconosciuta\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1103,6 +945,11 @@ msgstr "Non ci sono flussi audio o video in questo file.\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "plugin di input per Video CD"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1118,12 +965,20 @@ msgstr "iff-ilbm: compressione sconosciuta: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: pezzo sconosciuto: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr "demux_mpc: frame troppo grande per il buffer"
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1132,7 +987,7 @@ msgstr ""
"xine-lib:demux_mpeg_block: stream_id 0x%02x sconosciuto. Segnala la cosa "
"agli sviluppatori di xine.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
@@ -1140,14 +995,14 @@ msgstr ""
"demux_mpeg_block: errore di deallocazione. Segnala la cosa agli sviluppatori "
"di xine.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: attenzione: l'intestazione PES ha riservato 10 bit non "
"trovati\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1156,7 +1011,11 @@ msgstr ""
"demux_mpeg_block: attenzione: l'intestazione PES indica che questo stream "
"può essere cifrato (modalità di cifratura %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1165,21 +1024,21 @@ msgstr ""
"xine-lib:demux_mpeg_pes: stream_id 0x%02x sconosciuto. Segnala la cosa agli "
"sviluppatori di.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
"demux_mpeg_pes: attenzione: lo stream PACK con id=0x%x non è riuscito nella "
"decodifica.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_pes: attenzione: l'intestazione PES ha riservato 10 bit non "
"trovati\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1188,7 +1047,7 @@ msgstr ""
"demux_mpeg_block: attenzione: l'intestazione PES indica che questo stream "
"può essere cifrato (modalità di cifratura %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1197,12 +1056,9 @@ msgstr ""
"demux_mpeg_pes: stream 1 0x%02x privato sconosciuto. Segnala la cosa agli "
"sviluppatori di xine.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
-"ogg: indicata traccia audio vorbis ma nessuno stream di intestazione vorbis "
-"trovato.\n"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1214,11 +1070,21 @@ msgstr "demux_snd: paramentri intestazione errati\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: tipo audio non supportato: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "plugin di input del file"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr "demux_tta: numero di frame totali troppo alto\n"
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: trovato plugin demuxer: %s\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1234,6 +1100,11 @@ msgstr ""
"tipo di compressione VOC sconosciuta (0x%02X); per favore riporta l'errore "
"ai sviluppatori di xine\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "plugin di input del file"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1248,39 +1119,43 @@ msgstr ""
"demux_wc3movie: Si è verificato un problema durante il caricamento di un "
"grossi pezzi di palette\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "Numero del dispositivo DXR3"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-"Se si ha più di un dispositivo DXR3 nel proprio computer si può specificare "
-"quale utilizzare."
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: apertura dispositivo SPU %s non riuscita (%s)\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "pulsante richiesto non disponibile\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
"dxr3_decode_video: apertura dispositivo di controllo %s non riuscita (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "usa informazioni Pan & Scan"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1311,11 +1186,11 @@ msgstr ""
"Questo utilizza il Descrittore di Formato Attivo (AFD) utilizzato in alcuni "
"canali DVB europei."
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "prova a sincronizzare il video ogni frame"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1327,20 +1202,20 @@ msgstr ""
"si inserisce un tempo una volta ogni tanto.\n"
"È relativo solamente ai video progressivi (la maggior parte dei film PAL)."
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "utilizza modalità di riproduzione liscia"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr ""
"Abilitando questa opzione si utilizzerà un modo di riproduzione più definito."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "correggi la durata dei frame su flussi rovinati"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1352,29 +1227,29 @@ msgstr ""
"correzione per i flussi NTSC erroneamente etichettati come flussi PAL. Si "
"abiliti solo quando si incontrano tali flussi."
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: apertura dispositivo video %s non riuscita (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr ""
"dxr3_decode_video: scrittura al dispositivo potrebbe bloccherebbe "
"svuotamento\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: scrittura sul dispositivo video non riuscita (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: ATTENZIONE: codice tasso frame sconosciuto %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
@@ -1382,12 +1257,24 @@ msgstr ""
"dxr3_decode_video: ATTENZIONE: si sta correggendo il codice tasso frame da "
"PAL a NTSC\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "Numero del dispositivo DXR3"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+"Se si ha più di un dispositivo DXR3 nel proprio computer si può specificare "
+"quale utilizzare."
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: inizializzazione librte non riuscita\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1396,21 +1283,21 @@ msgstr ""
"dxr3_mpeg_encoder: rte gestisce solo le dimensioni video che sono multiple "
"di 16\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: rilevazione contesto rte non riuscito.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: impossibile creare codec.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "bitrate dell'output MPEG rte (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
@@ -1419,26 +1306,26 @@ msgstr ""
"modalità di codifica DXR3. Valori più alti aumenteranno la qualità e "
"l'utilizzo di CPU."
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: impossibile inizializzare contesto: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: impossibile avviare codifica: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: impossibile avviare la libreria FAME\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "qualità della codifica MPEG di fame"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1460,11 +1347,15 @@ msgstr ""
"utilizzato il timer di sistema Unix, valori maggiori forzeranno l'uso "
"dell'orologio interno della DXR3 come sorgente di sincronia a/v."
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "scambio linee spaiate e piatte"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1474,11 +1365,11 @@ msgstr ""
"Abilitate questa opzione per materiale non-MPEG che produce sporcizia "
"verticale sullo schermo."
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "Aggiungi barre nere per correggere le proporzioni"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
@@ -1487,34 +1378,34 @@ msgstr ""
"non può gestire nativamente. Questo è necessario per mantenere le giuste "
"proporzioni dell'immagine."
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr ""
"usa modalità di riproduzione lisca per la riproduzione tramite encoder mpeg"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Abilitando questa opzione si utilizzerà una modalità di riproduzione più "
"liscia per contenuto non-MPEG."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr ""
"video_out_dxr3: apertura dispositivo di controllo %s non riuscita (%s)\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: apertura dispositivo video %s non riuscita (%s)\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "codificatore per contenuto non-MPEG"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1538,23 +1429,23 @@ msgstr ""
"\"fame\" e \"rte\" sono ancora lì, ma il loro supporto in xine è obsoleto, "
"quindi questi potrebbero non funzionare."
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
"video_out_dxr3: inizializzazione encoder MPEG libavcodec non riuscita.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: inizializzazione encoder MPEG rte non riuscita.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: inizializzazione encoder MPEG fame non riuscita.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1571,7 +1462,7 @@ msgstr ""
"video_out_dxr3: di uscita video. Si veda README.dxr3 per dettagli sulla "
"configurazione di un codificatore.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1588,11 +1479,11 @@ msgstr ""
"video_out_dxr3: di uscita video. Si veda README.dxr3 per dettagli sulla "
"configurazione di un codificatore.\n"
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "modalità di visualizzazione (TV oppure overlay)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1653,11 +1544,11 @@ msgstr ""
"all'uscita TV nascondendo la finestra video. Questa è la variante comune "
"dell'overlay DXR3."
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr "valore della chiave cromatica di sovraimpressione"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
@@ -1667,11 +1558,11 @@ msgstr ""
"Si possono provare provare valori diversi se si riscontrano finestre "
"trasparenti quando si utilizza la modalità overlay DXR3. "
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr "tolleranza della chiave cromatica di sovraimpressione"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1684,11 +1575,11 @@ msgstr ""
"quando si utilizza la modalità overlay DXR3, ma alcune parti dei bordi "
"dell'immagine potrebbero sparire se si utilizza un valore troppo basso."
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "taglia l'area overlay nelle parti superiore e inferiore"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1697,16 +1588,16 @@ msgstr ""
"dell'overlay. Si abiliti questo se si vedono linee verdi sopra o sotto "
"l'immagine."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: autocalibrazione necessaria, overlay disabilitato.\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "modalità TV preferita"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1722,12 +1613,12 @@ msgstr ""
"pal60: PAL a 60Hz\n"
"default: mantieni l'impostazione della scheda"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: impostazione della modalità video fallita.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1737,37 +1628,37 @@ msgstr ""
"MPEG su DXR3.\n"
"video_out_dxr3: Si legga README.dxr3 per dettagli.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: ERRORE leggendo il file di inizializzazione dell'overlay. Si "
"esegua l'autocalibrazione.\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: impossibile connettersi a %s: %d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: connesso al server CDDB %s:%d con successo.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: connessione al server CDDB '%s:%d' non riuscita (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "CD Audio (CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "dispositivo utilizzato per CD audio"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1775,11 +1666,11 @@ msgstr ""
"Il percorso al dispositivo, solitamente un lettore CD o DVD, che si intende "
"utilizzare per riprodurre CD audio."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "interroga CDDB"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1793,11 +1684,11 @@ msgstr ""
"informazioni sono ricercate su un server internet che può raccogliere un "
"profilo delle proprie abitudini d'ascolto."
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "nome del server CDDB"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1810,35 +1701,19 @@ msgstr ""
"risposte maliziose. Assicuratevi di inserire un server di cui ci si possa "
"fidare."
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "porta del server CDDB"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr "La porta del server utilizzato per recuperare titoli e tracce."
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "directory cache CDDB"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-"Le risposte dal server CDDB saranno salvate in questa directory.\n"
-"Questa impostazione è critica, perché in questa directory saranno creati "
-"file con nomi incontrollati. Assicurative di utilizzare una directory "
-"dedicata non utilizzata per altro oltre al caching CDDB. "
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "rallenta il lettore dischi a questa velocità"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1853,62 +1728,62 @@ msgstr ""
"dovrebbe influenzare le prestazioni di riproduzione.\n"
"Un valore pari a zero disabilita il rallentamento."
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: apertura file canali DVB non riuscita '%s': %s\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: il file canali '%s' non è un file di testo semplice\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: tuner_set_channel non riuscito\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: impossibile aprire dispositivo DVB\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
"input_dvb: canale %d fuori scala, sarà utilizzato il valore predefinito 0\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: ricerca del canale %s\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
"input_dvb: corrispondenza esatta per %s non trovata: saranno provate le "
"corrispondenze parziali.\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: trovato canale corrispondente %s\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
"input_dvb: canale %s non trovato in channels.conf, sarà utilizzata un "
"predefinito.\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
@@ -1917,14 +1792,14 @@ msgstr ""
"input_dvb: specifica del canale non valida, sarà utilizzato l'ultimo canale "
"visto.\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
"input_dvb: specifica del canale non valida, sarà utilizzato il canale "
"predefinito 0.\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
@@ -1933,7 +1808,7 @@ msgstr ""
"input_dvb: è stato specificato un MRL DVB-S, ma il sintonizzatore non pare "
"essere QPSK (DVB-S)\n"
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1942,7 +1817,7 @@ msgstr ""
"input_dvb: è stato specificato un MRL DVB-T ma il sintonizzatore non pare "
"essere OFDM (DVB-T)\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1951,7 +1826,7 @@ msgstr ""
"input_dvb: è stato specificato un MRL DVB-C ma il sintonizzatore non pare "
"essere QAM (DVB-C)\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1960,21 +1835,21 @@ msgstr ""
"input_dvb: è stato specificato un MRL DVB-A ma il sintonizzatore non pare "
"essere ATSC (DVB-C)\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: impossibile aprire dispositivo DVR '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_dvb: impossibile creare thread di aggiornamento EPG.\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr "usa il 'taglio centrale' DVB (zoom)"
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -1982,15 +1857,15 @@ msgstr ""
"Questo permetterà la riproduzione a pieno schermo di contenuto 4:3 trasmesso "
"in un frame 16:9."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "plugin di input per DVB (TV Digitale)"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr "Ricorda l'ultimo canale DVB visto."
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
@@ -1998,19 +1873,19 @@ msgstr ""
"Durante l'auto riproduzione xine ricorderà e scambierà al canale indicato in "
"media.dvb.last_channel ."
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr "Ultimo canale DVB visto"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr "Se abilitato xine ricorderà e scambierà a questo canale."
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr "Numero di secondi prima dell'interruzione della sintonizzazione."
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
@@ -2018,54 +1893,49 @@ msgstr ""
"Lasciandolo a 0 proverà all'infinito. Un valore maggiore a 0 significa "
"attendi quei secondi per ricevere il controllo. Il minimo è di 5 secondi."
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "Indice di scheda DVB da utilizzare."
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-"Lasciare questo a zero a meno che non si abbia davvero più di una scheda nel "
-"proprio sistema."
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "Indice di scheda DVB da utilizzare."
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
+"Lasciare questo a zero a meno che non si abbia davvero più di una scheda nel "
+"proprio sistema."
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr "input_dvd: values of \\beta will give rise to dom!\n"
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Errore nella lettura del prossimo blocco dal DVD (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Errore di apertura del dispositivo DVD\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "dispositivo utilizzato per la riproduzione DVD"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -2073,11 +1943,11 @@ msgstr ""
"Il percorso al dispositivo, solitamente un lettore DVD, che si intende usare "
"per riprodurre DVD."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "dispositivo diretto impostato per l'accesso DVD"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -2097,11 +1967,11 @@ msgstr ""
"Si veda la documentazione sull'impostazione dei dispositivi diretti (man "
"raw) per maggiori informazioni."
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "Metodo di decifratura CSS"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
@@ -2111,30 +1981,11 @@ msgstr ""
"DVD protetti da copia. Si provino i vari metodi se si hanno problemi nella "
"riproduzione di DVD cifrati."
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr "percorso alla cache delle chiavi dei titoli"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-"Poiché rompere la protezione da copia dei DVD cifrati può richiedere diverso "
-"tempo, libdvdcss memorizzerà le chiavi decifrate in questa directory.\n"
-"Questa impostazione è critica, poiché file con nomi incontrollabili saranno "
-"creati in questa directory. Assicuratevi di utilizzare una directory "
-"dedicata non utilizzata per altri scopi oltre alla memorizzazioni delle "
-"chiavi DVD."
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "regione a cui il lettore DVD dirà di appartenere (da 1 a 8)"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
@@ -2145,11 +1996,11 @@ msgstr ""
"nulla a che vedere con il codice regionale settato nei lettori DVD, è "
"interamente software."
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "lingua predefinita per la riproduzione DVD"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
@@ -2160,11 +2011,11 @@ msgstr ""
"questa lingua.\n"
"Questo valore deve essere un codice di lingua di due caratteri ISO639."
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "read-ahead caching"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
@@ -2174,11 +2025,11 @@ msgstr ""
"Questo può portare a cattiva riproduzione su lettori lenti, ma migliora "
"l'impatto con il cambio di strato nel DVD sui lettori più veloci."
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "unità per l'azione di salto"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -2212,11 +2063,11 @@ msgstr ""
"salterà un titolo DVD, un'unità strutturale che rappresenta intere "
"funzionalità sul DVD."
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "unità per la ricerca"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -2241,11 +2092,11 @@ msgstr ""
"la ricerca sarà effettuata su un programma DVD, che è un'unità di "
"navigazione che rappresenta un capitolo della corrente funzionalità."
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr "modalità di riproduzione quando si fornisce un titolo/capitolo"
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -2271,40 +2122,40 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: errore di lettura (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: Permesso negato: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: File non trovato: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: File vuoto: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "plugin di input del file"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "Posizione di partenza del navigatore di file"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
"Il navigatore per selezionare i file da riprodurre partirà da questa "
"posizione."
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "elenca i file nascosti"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
@@ -2312,91 +2163,91 @@ msgstr ""
"Se abilitato, il navigatore per selezionare i file da riprodurre mostrerà "
"anche i file nascosti."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "plugin di input gnome-vfs incluso con xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s) fallito: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: errore di lettura %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Connessione in corso al server HTTP..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: risposta http non valida\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx ridirezione: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: lo stato di http non è 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_httml: lunghezza del contenuto = %<PRIdMAX> byte\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: buffer esaurito dopo %d byte."
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "plugin di ingresso http"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "Server proxy HTTP"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "Nome del proxy HTTP"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "Porta proxy HTTP"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "Il numero di porta del proxy HTTP"
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "Nome utente proxy HTTP"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "Il nome utente per il proxy HTTP"
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "Password proxy HTTP"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "La password per il proxy HTTP"
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr "Domini per cui si vuole ignorare il proxy HTTP"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2408,15 +2259,15 @@ msgstr ""
"Se un nome di dominio è prefissato da =, allora è trattato come il nome di "
"un singolo host (e viene richiesta corrispondenza completa)."
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "plugin di ingresso per stream MMS"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "larghezza di banda"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
@@ -2426,11 +2277,11 @@ msgstr ""
"Questa sarà utilizzata quando i server di streaming offrano versioni diverse "
"con diversi requisiti di banda dello stesso flusso."
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "Protocollo MMS"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2438,76 +2289,76 @@ msgstr ""
"Seleziona il protocollo in cui incapsulare MMS.\n"
"TCP è migliore ma potrebbe essere necessario HTTP se si è dietro a firewall."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: impossibile risolvere '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: impossibile connettesi a '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "plugin di input della rete trasportato così con xine"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "plugin di input per lo stream pnm"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: errore creando il file pvr (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: errore aprendo il file pvr (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: errore di lettura (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: errore aprendo il dispotivo %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_G_CODEC fallito, forse l'interfaccia è cambiata?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_S_CODEC fallito, forse l'interfaccia è cambiata?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "WinTV-PVR 250/350 input plugin"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "dispositivo utilizzato per WinTV-PVR 250/350 (pvr plugin)"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "Il percorso al dispositivo della propria scheda WinTV."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "WinTV-PVR 250/350 input plugin"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2558,142 +2409,142 @@ msgstr "impossibile fare il bind a '%s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: interruzione di lettura di thread...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: lettura thread terminata\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Apertura in corso > nome del file: %s porta: %d interfaccia: %s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: impossibile creare nuova thread (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "plugin input RTP e UDP tarsportati così con xine"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "plugin di input per lo stream rtsp"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "Plugin di ingresso CIFS/SMB basato su libsmbclient"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: impossibile tornare indietro! (%<PRIdMAX> %<PRIdMAX>)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: apertura non riuscita '%s'\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "plugin di input per lo stream di stdin"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Buffer underrun..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Buffer overrun..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Calibrando..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Nome del sintonizzatore non trovato.\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "plugin di ingresso TV V4L"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "plugin di ingresso radio V4L"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "dispositivo video v4l"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "Il percorso al proprio dispositivo video Video4Linux."
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "dispositivo radio v4l"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "Il percorso al proprio dispositivo video Video4Linux."
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "plugin di ingresso radio V4L"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "dispositivo radio v4l"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "Il percorso al proprio dispositivo radio Video4Linux,"
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: MRL malformata. Utilizzare vcdo://<track #>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: traccia %d non valida (intervallo valido: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "plugin di input per Video CD"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "impossibile aprire %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: impossibile aprire %s: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "plugin di input per Video CD"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "dispositivo utilizzato per la riproduzione VCD"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
@@ -2701,12 +2552,12 @@ msgstr ""
"Il percorso al dispositivo, solitamente un lettore CD o DVD, che si intende "
"utilizzare per riprodurre VideoCD."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: MRL errata: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: connessione a '%s' fallita.\n"
@@ -2786,7 +2637,7 @@ msgstr "protocollo non supportato\n"
msgid "Buffering..."
msgstr "Bufferizzando..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2795,12 +2646,12 @@ msgstr ""
"input_pnm: ricevuto messaggio dal server durante la lettura dello stream:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: connessione fallita '%s'\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: impostazione dello stream fallita.\n"
@@ -2849,41 +2700,41 @@ msgstr "è stato passato un parametro classe nullo."
msgid "Invalid current entry type"
msgstr "Tipo di inserimento attuale non valido."
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-"Plugin Video CD con PBC e supporto per: (X)VCD, (X)SVCD, HQVCD, CVD ..."
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "la selezione non ha un elemento RETURN"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr "selezionato DEFAULT, ma PBC non è abilitato."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "la selezione non ha un elemento NEXT"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "la selezione non ha un elemento PREVIOUS"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Tipo di evento sconosciuto: "
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "Il messaggio precedente ha un livello di log di vcdimager sconosciuto."
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+"Plugin Video CD con PBC e supporto per: (X)VCD, (X)SVCD, HQVCD, CVD ..."
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr "Tipo predefinito di VCD da usare in riproduzione automatica."
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
@@ -2891,11 +2742,11 @@ msgstr ""
"L'unità di riproduzione VCD da utilizzare quando non è specificata in un "
"MRL, per esempio vcd:// o vcd://dev/dvd:"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr "Lettore CD-ROM utilizzato per i VCD quando non è specificato."
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
@@ -2903,30 +2754,30 @@ msgstr ""
"Cosa usare se non è specificato nessun drive. Se l'impostazione è vuota xine "
"scandirà per lettori CD. "
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr "intervallo della slitta di posizione VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
"intervallo che la slitta di posizione nel flusso riprodotto rappresenta "
"quando si riproduce un VCD."
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr "VCD read-ahead caching?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr "La classe può portare a riproduzione a singhiozzo su macchine lente."
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr "avanza automaticamente di traccia/elemento VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
@@ -2934,11 +2785,11 @@ msgstr ""
"Se abilitato si passerà automaticamente al successivo elemento o traccia. "
"Utilizzato solo quando il controllo di riproduzione (PBC) è disabilitato."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr "mostra LID \"rifiutati\" dei VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
@@ -2948,11 +2799,11 @@ msgstr ""
"possono vedere nella lista MRL se questa opzione è abilitata. Gli elementi "
"rifiutati sono segnati con un asterisco (*) alla fine del MRL."
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr "Stringa di formato VCD per il banner da visualizzare."
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2991,11 +2842,11 @@ msgstr ""
" %v : l'ID del volume (un numero tra 1 e il totale di volumi).\n"
" %% : un simbolo %\n"
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr "Stringa di formato utilizzata per il campo di commento del flusso"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -3008,11 +2859,11 @@ msgstr ""
"%T e %%.\n"
"Si veda la descrizione di title_format per il loro significato."
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr "Flag di debug per VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -3042,99 +2893,200 @@ msgstr ""
"1024: Still-frame\n"
"2048: Debugging from VCDINFO\n"
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "AIUTO! un driver audio solo mono?\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: aumentando il buffer a %d per evitare overflow.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "volume A/52"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_audio_dec: impossibile trovare il decoder ffmpeg per il tipo di "
+"buffer 0x%X\n"
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: provando ad aprire un codec nullo.\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: impossibile aprire il decoder.\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: impossibile aprire il decoder.\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-"Con l'audio A/52 si può modificare il volume a livello di decoder. Questo ha "
-"il vantaggio che l'audio è già decodificato al volume specificato quindi le "
-"successive operazioni come il mixaggio dei canali funzioneranno su uno "
-"stream al volume richiesto."
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "usa la compressione dinamica A/52"
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "dvaudio: aumentando il buffer a %d per evitare overflow.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "plugin di ingresso radio V4L"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "bitrate MPEG di uscita per libavcodec (kbit/s)"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-"La compressione dinamica limita l'intervallo dell'audio. Questo singifica "
-"che rende i suoni forti morbidi e i suoni morbidi forti, in modo che si "
-"possa ascoltare più facilmente l'audio in un ambiente rumoroso senza "
-"disturbare."
+"La bitrate utilizzata dal codificatore MPEG libavcodec per la modalità di "
+"codifica DXR3. Valori più alti aumenteranno la qualità e l'uso di CPU.\n"
+"Questa impostazione è considerata solo quando è disabilitata la modalità a "
+"qualità costante. "
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "declassa l'audio a due canali stereo surround"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "modalità a qualità costante"
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-"Quando si vuole ascoltare un suono surround multicanale ma si hanno solo due "
-"speaker o un decodificatore o amplificatore surround che effettua una "
-"decodifica della matrice surround come prologic, si dovrebbe abilitare "
-"questa opzione in modo che i canali aggiuntivi sono mixati nel segnale "
-"stereo."
+"Se abilitata libavcodec utilizzerà una modalità a qualità costante "
+"comprimendo le immagini a secodna della loro complessità. Quando "
+"disabilitata libavcodec utilizzerà una modalità a bitrate costante."
+
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "compressione minima"
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+"La compressione minima da applicare ad un'immagine utilizzando una modalità "
+"a qualità costante."
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr "quantizzatore massimo"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+"La compressione massima da applicare ad un'immagine utilizzando una modalità "
+"a qualità costante."
-#: src/libfaad/xine_faad_decoder.c:136
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad NeAACDecOpen() fallita.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: formato frame non supportato, DR1 disabilitato.\n"
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit2 fallita.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr ""
+"ffmpeg_video_dec: dimensioni del frame non supportate. DR1 disabilitato.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit fallita.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+"ffmpeg_video_dec: impossibile trovare il decoder ffmpeg per il tipo di "
+"buffer 0x%X\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: impossibile aprire il decoder\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, fuzzy, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr "libmusepack: mpc_decoder_initialise fallita\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: impossibile aprire il decoder\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr "libmusepack: mpc_streaminfo_read fallita: %d\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: visualizzazione diretta abilitata\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr "libmusepack: dati dopo l'ultimo frame ignorati.\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_video_dec: buffer aumentato a %d per evitare overflow.\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr "libmusepack: mpc_decoder_initialise fallita\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr "libmusepack: mpc_decoder_decode fallita: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "qualità di post-elaborazione MPEG-4"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"Si può tarare la quantità di post elaborazione applicata ai video MPEG-4.\n"
+"Valori più alti risultano in qualità migliore ma richiedono più CPU. Valroi "
+"più bassi possono risultare in difetti dell'immagine come artefatti. Per unc "
+"otnenuto ad alta qualità, una post elaborazione troppo alta può in realtà "
+"rendere l'immagine peggiore sfocandola troppo."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr "Numero di thread di decodifica FFmpeg"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+#, fuzzy
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"Puoi impostare il numero di thread di decodifica che FFMpeg può usare.\n"
+"Valori più alti dovrebbero renere più veloce la decodifica, ma il supporto "
+"alla decodifica parallela dipende dal codec utilizzato. Una buona regola "
+"pratica è di avere un thread di decodifica per ogni CPU virtuale "
+"(tipicamente da 1 a 4). La modifica avrà effetto alla riproduzione del "
+"prossimo flusso."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
#: src/libreal/real_common.c:139
msgid "path to RealPlayer codecs"
@@ -3154,13 +3106,6 @@ msgstr ""
"contenuto RealPlayer. Si consultino le FAQ per maggiori informazioni su come "
"installare i codec."
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-"libreal: Errore nella risoluzione dei simboli (incompatibilità di "
-"versione?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -3183,54 +3128,69 @@ msgstr "libareal: setup del tipo di decoder fallito, codice di errore: 0x%x\n"
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: ops, real può usare più di 2 canali?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+"libreal: Errore nella risoluzione dei simboli (incompatibilità di "
+"versione?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "visualizza sottotitoli CC (closed captions) negli stream MPEG-2"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
"I sottotitoli CC sono sottotitoli perlopiù utilizzati per aiutare i non "
"udenti."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "schema colori primo piano/sfondo per sottotitoli CC"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Si scelga la visualizzazione preferita per i sottotitoli CC."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "carattere standard per i sottitotoli CC"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Si scelga il carattere per il testo standard dei sottotitoli CC."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "carattere corsivo per i sottotitoli CC"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "Si scelga il carattere per il testo corsivo dei sottotitoli CC"
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "dimensione del carattere per sottotitoli CC"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr "Si celga la dimensione del carattere per i sottotitoli CC."
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "allinea al centro i sottititoli CC"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
@@ -3238,23 +3198,37 @@ msgstr ""
"Se abilitato i sottotitoli CC saranno posizionati al centro delle rispettive "
"righe."
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "dimensione del carattere per sottotitoli CC"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "Carattere per sottotitoli esterni"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr "Spostamento verticale sottotitolo"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "Codifica dei sottotitoli"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: trovato plugin demuxer: %s\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "durata predefinita dei sottotitoli in secondi"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -3265,11 +3239,15 @@ msgstr ""
"qui. Utilizzando zero il sottotitolo sarà visualizzato finché il successivo "
"non ne prende il posto."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "dimensione del sottotitolo"
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
@@ -3277,11 +3255,11 @@ msgstr ""
"Potete qui impostare la dimensione del sottotitolo, l'impostazione sarà "
"valutata relativamente alla dimensione della finestra."
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "Spostamento verticale sottotitolo"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
@@ -3289,31 +3267,30 @@ msgstr ""
"Si può calibrare la posizione verticale del sottotitolo, l'impostazione sarà "
"valutata relativamente alla dimensione della finestra."
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "Carattere per sottotitoli"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
"Un carattere della directory di caratteri di xine da utilizzare per il testo "
"del sottotitolo."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
"Un font grafico (es. un .ttf) da utilizzare per il testo dei sottotitoli."
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr "se utilizzare un font FreeType"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "Codifica dei sottotitoli"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3325,11 +3302,11 @@ msgstr ""
"caratteri non-ASCII non sono visualizzati correttamente, chiedere al "
"creatore dei sottotitoli quale codifica è stata usata."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "utilizza OSD non ridimensionato se possibile"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3423,31 +3400,154 @@ msgstr "w32codec: errore inizializzando l'audio DirectShow\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: errore inizializzando l'audio DMO\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "plugin di uscita audio per xine su file"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "AIUTO! un driver audio solo mono?\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "volume A/52"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+"Con l'audio A/52 si può modificare il volume a livello di decoder. Questo ha "
+"il vantaggio che l'audio è già decodificato al volume specificato quindi le "
+"successive operazioni come il mixaggio dei canali funzioneranno su uno "
+"stream al volume richiesto."
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "usa la compressione dinamica A/52"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+"La compressione dinamica limita l'intervallo dell'audio. Questo singifica "
+"che rende i suoni forti morbidi e i suoni morbidi forti, in modo che si "
+"possa ascoltare più facilmente l'audio in un ambiente rumoroso senza "
+"disturbare."
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "declassa l'audio a due canali stereo surround"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+"Quando si vuole ascoltare un suono surround multicanale ma si hanno solo due "
+"speaker o un decodificatore o amplificatore surround che effettua una "
+"decodifica della matrice surround come prologic, si dovrebbe abilitare "
+"questa opzione in modo che i canali aggiuntivi sono mixati nel segnale "
+"stereo."
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad NeAACDecOpen() fallita.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit2 fallita.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit fallita.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, fuzzy, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr "libmusepack: mpc_decoder_initialise fallita\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr "libmusepack: mpc_streaminfo_read fallita: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr "libmusepack: dati dopo l'ultimo frame ignorati.\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr "libmusepack: mpc_decoder_initialise fallita\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr "libmusepack: mpc_decoder_decode fallita: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: errore durante la decompressione ByteRun1\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 non supportata al momento\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 non supportata al momento\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ non supportata al momento\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: questo tipo di Anim non è supportato al momento\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3459,6 +3559,10 @@ msgstr ""
"preservato quindi è possibile per esempio per guardare un film in meno tempo "
"di quanto fosse stato originariamente registrato.\n"
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3478,6 +3582,10 @@ msgstr ""
"impostare questi parametri.\n"
"\n"
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3505,6 +3613,11 @@ msgstr[1] ": mixando un singolo canale da un flusso originale a %d canali.\n"
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ": dispositivo audio incapace di usare AO_CAP_MODE_STEREO.\n"
+#: src/post/audio/upmix_mono.c:346
+#, fuzzy
+msgid "converts Mono into Stereo"
+msgstr ": mixando da Mono a Stereo.\n"
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3522,6 +3635,10 @@ msgstr ""
"utilizza diversi campioni per assottigliare le variazioni attraverso la "
"media standard pesata sui campioni precedenti.\n"
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3578,16 +3695,24 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: Nessun metodo di deinterlacciamento disponibile. uscita.\n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "frame per secondo da generare"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3595,27 +3720,27 @@ msgstr ""
"Con più frame per secondo l'animazione diventerà più fluida e veloce, ma "
"richiederà anche più potenza CPU."
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr "larghezza dell'immagine goom"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "La larghezza in pixel dell'immagine da generare."
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr "altezza dell'immagine goom"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "L'altezza in pixel dell'immagine da generare."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr "metodo di conversione dello spazio di colore"
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
@@ -3623,7 +3748,11 @@ msgstr ""
"Si scelga il metodo di conversione dei colori utilizzato da goom.\n"
"Le selezioni disponibili dovrebbero spiegarsi da sole."
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3643,7 +3772,12 @@ msgstr ""
" w: la larghezza dell'immagine\n"
" h: l'altezza dell'immagine\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3674,6 +3808,10 @@ msgstr ""
"\n"
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3700,32 +3838,9 @@ msgstr ""
"\n"
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
-"Equalizzatore software con controlli interattivi come l'equalizzatore "
-"hardware, per driver e schede che non supportano i controlli di luminosità e "
-"contrasto in hardware.\n"
-"\n"
-"Parametri: luminosità\n"
-" contrasto\n"
-"\n"
-"Nota: è possibile utilizzare la finestra di controllo del frontend per "
-"impostare questi parametri\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
#: src/post/planar/eq2.c:361
msgid ""
@@ -3771,7 +3886,47 @@ msgstr ""
"\n"
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+"Equalizzatore software con controlli interattivi come l'equalizzatore "
+"hardware, per driver e schede che non supportano i controlli di luminosità e "
+"contrasto in hardware.\n"
+"\n"
+"Parametri: luminosità\n"
+" contrasto\n"
+"\n"
+"Nota: è possibile utilizzare la finestra di controllo del frontend per "
+"impostare questi parametri\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3798,7 +3953,7 @@ msgstr ""
" Centre_cut_out_mode: estrae l'immagine 4:3 contenuta in un frame 16:9\n"
"\n"
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3831,7 +3986,11 @@ msgstr ""
"\n"
"* mplayer's noise (C) Michael Niedermayer\n"
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3843,7 +4002,7 @@ msgstr ""
"Parametri\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3851,6 +4010,10 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3903,11 +4066,126 @@ msgstr ""
"\n"
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_rip: posizionamento fallito: %s.\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ": impossibile creare la condizione pthread: %s\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: interruzione di lettura di thread...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, fuzzy, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "RTP: lettura thread terminata\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: interruzione di lettura di thread...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "RTP: lettura thread terminata\n"
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "stdin: apertura non riuscita '%s'\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "stdin: apertura non riuscita '%s'\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: connessione a '%s' fallita.\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: impossibile connettersi a %s: %d\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "stdin: apertura non riuscita '%s'\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: impossibile creare nuova thread (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "plugin di uscita video per xine usante la libreria art ascii"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr ""
"plugin di uscita video per xine utilizzante la libreria Color AsCii Art"
@@ -3953,8 +4231,8 @@ msgid "video colour key"
msgstr "chiave cromatica video"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -4039,31 +4317,31 @@ msgstr ""
"video_out_directfb: il ridimensionamento dell'immagine con "
"deinterlacciamento è accelerato hardware.\n"
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr "id dello strato video (auto: -1)"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr "Selezionate lo strato di uscita video tramite id."
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_directfb: si utilizza lo strato di visualizzazione #%d.\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "plugin di output video per xine utilizzante DirectFB"
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
"video_out_directfb: nessuno strato di visualizzazione utilizzabile trovato!\n"
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "plugin di output video per xine utilizzante DirectFB sotto XDirectFB"
@@ -4080,11 +4358,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "plugin di output video per xine per win32 che usa directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -4093,11 +4371,11 @@ msgstr ""
"video_out_fb: è supportato solo truecolor/directcolor impacchettato (%d).\n"
" Si controlli 'fbset -i' o si provi 'fbset -depth 16'.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "nome del dispositivo framebuffer"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -4110,21 +4388,20 @@ msgstr ""
"arbitrario, si deve quindi essere attenti che il valore inserito sia "
"veramente un dispositivo framebuffer valido."
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out-fb: la modalità video non è stata riconosciuta.\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: sono disponibili %d buffer in RAM video.\n"
-#: src/video_out/video_out_fb.c:956
-#, c-format
+#: src/video_out/video_out_fb.c:939
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
@@ -4133,10 +4410,10 @@ msgstr ""
" sono disponibili, meno dei %d buffer raccomandati.\n"
" Abbassare la risoluzione del frame buffer può aiutare.\n"
-#: src/video_out/video_out_fb.c:967
-#, c-format
+#: src/video_out/video_out_fb.c:950
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
"ATTENZIONE: video_out_fb: i buffer a copia zero sono DISABILITATI perché i "
@@ -4144,31 +4421,33 @@ msgstr ""
" del kernel non supportano lo spostamento dello schermo (utilizzati per "
"l'inversione dei frame)\n"
-#: src/video_out/video_out_fb.c:1036
-#, c-format
+#: src/video_out/video_out_fb.c:1019
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"ATTENZIONE: video_out_fb: la profondità di colore corrente è %d.\n"
-" per prestazioni migliori è raccomandata una profondità di 16bpp.\n"
+"\n"
+"\n"
+"ATTENZIONE: la profondità corrente è %d. Per migliori prestazioni\n"
+"è raccomandata una profondità di 16bpp.\n"
"\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
"plugin di uscita video per xine usante il dispositivo Framebuffer di Linux"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "plugin di uscita video per xine che non visualizza nulla"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr "Visualizzatore OpenGL"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -4222,11 +4501,11 @@ msgstr ""
"Environment_Mapped_Torus\n"
"Mostra le immagini su un torroide che ruota. Beeello =)"
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr "framerate OpenGL minima"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
@@ -4234,12 +4513,12 @@ msgstr ""
"Minima framerate per le routine di visualizzazione animata.\n"
"Ignorato per le routine statiche.\n"
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "abilita doppio buffering"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
@@ -4249,7 +4528,7 @@ msgstr ""
"anche di molto lo sfarfallio.\n"
"Non dovrebbe avere alcun impatto sulle prestazioni."
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr ""
"plugin di output video per xine utilizzante l'interfaccia grafica 3D OpenGL"
@@ -4271,6 +4550,12 @@ msgstr "video_out_pgx32: Errore: ioctl fallita, dispositivo non valido (%s)\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr "video_out_pgx32: Errore: '%s' non`e un dispositivo framebuffer pgx32\n"
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+"plugin di output video di xine che usa libvidix per il frame buffer Linux"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -4311,35 +4596,35 @@ msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
"video_out_pgx64: Error: impossibile impostare le priorità della finestra.\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Attenzione: poca memoria video, buffer multiplo "
"disabilitato.\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Error: memoria video insufficiente.\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Attenzione: poca memoria video, doppio buffer "
"disabilitato.\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Errore: ioctl fallita (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr "chiave cromatica per l'overlay video"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
@@ -4349,11 +4634,11 @@ msgstr ""
"sovrapporre l'immagine video. Si provino diversi valori se si notano le "
"finestre diventare trasparenti."
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr "abilita chiave cromatica"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
@@ -4361,11 +4646,11 @@ msgstr ""
"Disegna la grafica OSD sopra alla chiave cromatica anziché mescolarlo di "
"volta in volta nei frame."
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "abilita buffer multiplo"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
@@ -4373,6 +4658,12 @@ msgstr ""
"Il buffer multiplo migliora le prestazioni al costo di usare più memoria "
"video."
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+"plugin di output video di xine che usa libvidix per il frame buffer Linux"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "utilizza accelerazione hardware se disponibile"
@@ -4397,135 +4688,39 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: la modalità a pieno schermo NON è supportata.\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "plugin di uscita video di xine utilizzante SDL"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr "plugin di output video di xine che usa Libstk Surface Set-top Toolkit"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr "video_out_syncfb: errore. (YUV2 non supportato dalla scheda grafica)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr "video_out_syncfb: errore. (YV12 non supportato dalla scheda grafica)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: informazione. (il modulo SyncFB supporta YUV 4:2:0 (3 "
-"piani))\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: informazione. (il modulo SyncFB supporta YUV 4:2:0 (2 "
-"piani))\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-"video_out_syncfb: informazione. (il modulo SyncFB supporta YUV 4:2:2)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: informazione. (il modulo SyncFB supporta YUY2)\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: informazione. (il modulo SyncFB supporta RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: annullamento. (il modulo non supporta YV12, YUY2 o "
-"RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, fuzzy, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: informazione. (il controllo luminosità/contrasto non sarà "
-"disponibile perché il modulo SyncFB sembra obsoleto. Riferirsi a README."
-"syncfb per informazioni su come aggiornarlo.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "numero predefinito di ripetizioni dei frame"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-"Specifica quante volte un singolo frame video sarà visualizzato "
-"consecutivamente."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"plugin di uscita video per xine utilizzante il modulo SyncFB per schede "
-"Matrox G200/G400"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "nome del dispositivo SyncFB"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-"Specifica il nome del file per il dispositivo SyncFB (TeleTux) da "
-"utilizzare.\n"
-"Questa impostazione è critica perché quando cambiato ad un file diverso xine "
-"può essere utilizzato per riempire questo file con contenuto arbitrario. Ci "
-"si accerti che il valore inserito sia veramente un dispositivo framebuffer."
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "intensità del colore rosso"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr "L'intensità dei componenti di colore rosso."
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "intensità del colore verde"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr "L'intensità dei componenti di colore verde."
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "intensità del colore blu"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr "L'intensità dei componenti di colore blu."
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
@@ -4535,83 +4730,88 @@ msgstr ""
"ridisegnod ell'intero schermo (ritracciamento verticale). Questo eliminerà "
"gli sfarfallii e gli artifatti, ma utilizzerà più memoria video."
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: il dispositivo supporta il formato yuv2\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: il dispositivo supporta il formato yv12\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: la versione della libreria VIDIX è errata\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: impossibile trovare un driver VIDIX funzionante\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: utilizzando il driver %s di %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "componente rossa della chiave cromatica di sovraimpressione"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "componente verde della chiave cromatica di sovraimpressione"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "componente blu della chiave cromatica di sovraimpressione"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "plugin di output video di xine che usa libvidix per x11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
"plugin di output video di xine che usa libvidix per il frame buffer Linux"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-"video_out_xcbshm: %s: riservando l'immagine\n"
-"video_out_xcbshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-#: src/video_out/video_out_xcbshm.c:159
-#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
+#, fuzzy, c-format
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr ""
+"plugin di output video per xine utilizzante l'estensione MIT X Shared Memory"
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, fuzzy, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-"video_out_xcbshm: errore nella memoria condivisa (errore d'indirizzo) "
+"video_out_xshm: errore nella memoria condivisa (errore d'indirizzo) "
"riservando l'immagine \n"
-"video_out_xcbshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
+"video_out_xshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-"video_out_xcbshm: errore X11 durante la creazione dell'oggetto XImage "
-"condiviso\n"
-"video_out_xcbshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4626,92 +4826,82 @@ msgstr ""
"è raccomandata una profondità di 16bpp.\n"
"\n"
-#: src/video_out/video_out_xcbshm.c:1114
-#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
+#, fuzzy, c-format
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-"video_out_xcbshm: l'estensione MIT Shared Meory non è presente sul display.\n"
+"video_out_xshm: l'estensione MIT Shared Meory non è presente sul display.\n"
-#: src/video_out/video_out_xcbshm.c:1213
-#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xcbshm: modalità video non riconosciuta.\n"
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
+#, fuzzy, c-format
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "video_out-fb: la modalità video non è stata riconosciuta.\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
"plugin di output video per xine utilizzante l'estensione MIT X Shared Memory"
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-"video_out_xcbxv: XvShmCreateImage ha restituito una dimensione pari a zero.\n"
-"video_out_xcbxv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-"video_out_xcbxv: errore nella memoria condivisa in shmget: %s\n"
-"video_out_xcbxv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-"video_out_xcbxv: errore X11 durante la creazione dell'oggetto XImage in "
-"memoria condivisa.\n"
-"video_out_xcbxv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-#: src/video_out/video_out_xcbxv.c:1358
-#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
-msgstr "video_out_xcbxv: estensione Xv non presente.\n"
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
+#, fuzzy, c-format
+msgid "%s: Xv extension not present.\n"
+msgstr "video_out_xv: estensione Xv non presente.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
-"video_out_xcbxv: estensione XV presente ma non è stato possibile trovare una "
-"porta yuv12 utilizzabile.\n"
-" sembrerebbe che l'hardware grafico non supporti Xv.\n"
+"video_out_xv: estensione XV presente ma non è stato possibile trovare una "
+"porta yuv12 utilizzabile. sembrerebbe che l'hardware grafico "
+"non supporti Xv.\n"
-#: src/video_out/video_out_xcbxv.c:1417
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1254
+#, fuzzy, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xcbxv: utilizzando la porta Xv %d del dispositivo %s per la "
+"video_out_xv: utilizzando la porta Xv %ld dal dispositivo %s per la "
"conversione di colori e il ridimensionamento hardware.\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
#, fuzzy
msgid ""
"This option will synchronize the update of the video image to the repainting "
@@ -4723,236 +4913,44 @@ msgstr ""
"ridisegnod ell'intero schermo (ritracciamento verticale). Questo eliminerà "
"gli sfarfallii e gli artifatti, ma utilizzerà più memoria video."
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xcbxv: questo dispositivo supporta il formato yv12\n"
-
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xcbxv: questo dispositivo supporta il formato yuv2.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "metodo di deinterlacciamento (deprecato)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-"Questa impostazione è deprecata, si dovrebbe utilizzare la nuova "
-"impostazione per il deinterlacciamento in post elaborazione invece. \n"
-"\n"
-"Dai vecchi giorni della TV analogica, dove le linee pari e dispari del frame "
-"erano visualizzate in momenti diversi proviene l'idea di migliorare la "
-"scioltezza dei movimenti anche registrando le linee in momenti diversi, e "
-"praticando il cosiddetto \"interlacciamento\". Sfortunatamente i video "
-"moderni visualizzano le linee pari e dispari come un solo frame (display "
-"progrssivo), portando alla visualizzazione di brutti errori conosciuti come "
-"artefatti di comb. Il deinterlacciamento software è un approccio alla "
-"riduzione di tali artefatti. I singoli valori sono:\n"
-"\n"
-"none\n"
-"Disabilita il deinterlacciamento software.\n"
-"\n"
-"bob\n"
-"Interpola le linee tra le parti in movimenti dell'immagine.\n"
-"\n"
-"weave\n"
-"Simile a bob, ma con la tendenza di preservare la risoluzione completa, "
-"migliore per un maggior dettaglio su scene dal movimento lento.\n"
-"\n"
-"greedy\n"
-"Deinterlacciatore adattante molto buono, ma che richiede molta potenza di "
-"CPU.\n"
-"\n"
-"onefield\n"
-"Interopola e riduce sempre la risoluzione verticale.\n"
-"\n"
-"onefieldxv\n"
-"Come onefield, ma effettua l'interpolazione in hardware.\n"
-"\n"
-"linearblend\n"
-"Applica un leggero sfocamento verticale per rimuovere gli artefatti di comb. "
-"Buoni risultati con un uso di CPU medio."
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
+#, fuzzy, c-format
+msgid "%s: this adaptor supports the %s format.\n"
+msgstr "video_out_xv: questo dispositivo supporta il formato yv12\n"
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "plugin di output video di xine che usa l'estensione video MIT X"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: errore nella memoria condivisa riservando l'immagine:\n"
-"video_out_xshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: %s: riservando l'immagine\n"
-"video_out_xshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: errore nella memoria condivisa (errore d'indirizzo) "
-"riservando l'immagine \n"
-"video_out_xshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_Out_xshm: errore X11 durante la creazione dell'oggetto XImage "
-"condiviso\n"
-"video_out_xshm: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: l'estensione MIT Shared Meory non è presente sul display.\n"
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: modalità video non riconosciuta.\n"
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage fallita.\n"
-"video_out_xv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage ha restituito una dimensione pari a zero.\n"
-"video_out_xv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xv.c:332
-#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: errore nella memoria condivisa in shmget: %s\n"
-"video_out_xv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: errore X11 durante la creazione dell'oggetto XImage in memoria "
-"condivisa.\n"
-"video_out_xv: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: estensione Xv non presente.\n"
-
-#: src/video_out/video_out_xv.c:1432
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xv.c:1451
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"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"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-"video_out_xv: estensione XV presente ma non è stato possibile trovare una "
-"porta yuv12 utilizzabile. sembrerebbe che l'hardware grafico "
-"non supporti Xv.\n"
-#: src/video_out/video_out_xv.c:1460
-#, c-format
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
+#, fuzzy, c-format
msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xv: utilizzando la porta Xv %ld dal dispositivo %s per la "
"conversione di colori e il ridimensionamento hardware.\n"
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: questo dispositivo supporta il formato yv12\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: questo dispositivo supporta il formato yuv2.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "plugin di output video per xine utilizzante l'estensione X video XvMC"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: estensione XvMC non presente.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -4961,7 +4959,7 @@ msgstr ""
"video_out_xvmc: estensione XV presente ma non è stato possibile trovare una "
"porta yuv12 utilizzabile.\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -4970,103 +4968,35 @@ msgstr ""
"video_out_xxmc: utilizzando la porta Xv %ld dal dispositivo %s\n"
" per la conversione di colori e il ridimensionamento hardware.\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " accelerazione idct e compensazione del movimento \n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " solo accelerazione della compensazione di movimento\n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " nessun supporto XvMC \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " Con overlay = %d; UnsignedIntra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage fallita.\n"
-"video_out_xxmc: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage ha restituito una dimensione pari a zero.\n"
-"video_out_xxmc: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: errore nella memoria condivisa in shmget: %s\n"
-"video_out_xxmc: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: errore X11 durante la creazione dell'oggetto XImage in "
-"memoria condivisa.\n"
-"video_out_xxmc: => l'estensione MIT Shared Memory non sarà utilizzata.\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xxmc: estensione Xv non presente.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xmmc: estensione XV presente ma non è stato possibile trovare una "
-"porta yuv12 utilizzabile. sembrerebbe che l'hardware grafico "
-"non supporti Xv.\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xxmc: utilizzando la porta Xv %ld dal dispositivo %s per la "
-"conversione di colori e il ridimensionamento hardware.\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xxmc: questo dispositivo supporta il formato yv12\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xxmc: questo dispositivo supporta il formato yuv2.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "plugin di output video per xine utilizzante l'estensione X video XvMC"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr "Fa sì che XvMC riservi più frame per un miglior buffer."
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
@@ -5076,11 +5006,11 @@ msgstr ""
"Questa opzione, quando abilitata, fa sì che il drive tenti\n"
"di riservare 15 frame. Necessario per unichrom e VDR istantanei.\n"
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr "Risparmio CPU Unichrome"
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
@@ -5090,11 +5020,11 @@ msgstr ""
"Solo per kernel Linux 2.6 o 2.4 con patch multimediale.\n"
"Sperimentale.\n"
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr "Correggi i colori dei sottotitoli difettosi su NVIDIA XvMC"
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
@@ -5102,11 +5032,11 @@ msgstr ""
"C'è un errore nella libreria XvMC NVIDIA che rende i colori rossi dell'OSD "
"blu e viceversa. Questa opzione fornisce un workaround.\n"
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr "Utilizza bob come metodo di deinterlacciamento accelerato."
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
@@ -5114,11 +5044,11 @@ msgstr ""
"Quando l'interlacciamento è abilitato per i frame accelerati hardware, "
"alterna i campi superiore e inferiori al doppio del frame rate.\n"
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr "Non utilizzare il deinterlacciamento bob per frame progressivi."
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
@@ -5126,13 +5056,13 @@ msgstr ""
"I frame progressivi non devono essere deinterlacciati, quindi disabilitarlo\n"
"a richiesta dovrebbe fornire una migliore immagine.\n"
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
"Non utilizzare il deinterlacciamento bob quando è attivo un OSD "
"ridimensionato."
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -5263,21 +5193,21 @@ msgstr ""
"Il risultato è che la trasparenza degli overlay è meno accurata che in "
"precedenza, ma questo fa anche diminuire l'utilizzo del processore."
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: nessun plugin disponibile per gestire '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: errore, tipo di buffer %08x sconosciuto\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "numero di buffer audio"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5287,7 +5217,7 @@ msgstr ""
"interna. Valori alti significano una riproduzione più liscia per ingressi "
"inaffidabili, ma aumenta la latenza e il consumo di memoria."
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
@@ -5295,33 +5225,33 @@ msgstr ""
"audio_out: calcolo del ritardo impossibile con un dispositivo audio non "
"disponibile.\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
"scrittura sulla scheda audio fallita. Si suppone il dispositivo sia stato "
"scollegato.\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "8 bit non supportati dal driver, conversione a 16 bit.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "mono non supportato dal driver, conversione a stereo.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "stereo non supportato dal driver, conversione a mono.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "metodo di sincronia audio/video"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -5365,11 +5295,11 @@ msgstr ""
"dove i dati audio sono passati ad un decodificatore esterno in forma "
"digitale."
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr "abilita ricampionamento"
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -5382,11 +5312,11 @@ msgstr ""
"disabilitare o utilizzare automaticamente quando necessario il "
"ricampionamento."
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr "ricampiona sempre a questa frequenza (0 per disabilitare)"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
@@ -5396,11 +5326,11 @@ msgstr ""
"sonoro. Impostando un valore diverso da zero qui si può forzare il "
"ricampionamento del flusso audio alla frequenza data."
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr "offset per il passaggio diretto digitale"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
@@ -5411,11 +5341,11 @@ msgstr ""
"compensare.\n"
"L'unità di misura è un \"PTS tick\" ovvero 1/90000 secondi."
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr "riproduci audio anche a velocità basse/elevate"
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -5427,84 +5357,84 @@ msgstr ""
"basso o più alto). Se si vuole sperimentare preservando il tono, è possibile "
"provare il plugin di post-elaborazione audio 'stretch'."
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "volume audio di partenza"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "Il volume audio generale da impostare all'avvio di xine.partenza"
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "ripristina il volume all'avvio"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"Se disabilitato, xine non modificherà alcuna impostazione del mixer "
"all'avvio."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"audio_out: spiacente, non sarebbe dovuto succedere. Per favore riavvia "
"xine.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr "xine-lib: buffer.c: C'è stato un errore fatale: TROPPI FREE\n"
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
"L'attuale file di configurazione è stato modificato da una nuova versione di "
"xine."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: apertura file canali DVB non riuscita '%s': %s\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
"configfile: ATTENZIONE: copia di backup del file di configurazione in %s "
"fallita.\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: ATTENZIONE: la propria configurazione non sarà salvata.\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr ""
"configfile: ATTENZIONE: scrittura della configurazione in %s fallita.\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: ATTENZIONE: rimozione del file di configurazione %s "
"possibilmente rovinato.\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: ATTENZIONE: si controlli il file di backup %s.\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: la voce '%s' non deve essere modificata da MRL\n"
@@ -5523,58 +5453,58 @@ msgstr ""
"info_helper: conversione %s -> UTF-8 non supportata, nessuna conversione "
"eseguita\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ": la funzione open() non dovrebbe mai essere chiamata.\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": plugin di ingresso non definito!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: la lettura di dati salvati non è riuscita: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: la lettura tramite plugin di ingresso è fallita.\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: errore scrivendo su file %<PRIdMAX> byte: %s.\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: la funzione open() non dovrebbe essere mai chiamata\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: posizionamento fallito.\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: posizionamento fallito: %s.\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %<PRIdMAX> byte rimossi.\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: plugin di ingresso non definito!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -5583,7 +5513,7 @@ msgstr ""
"input_rip: la directory di destinazione non è stata specificata, si imposti "
"l'opzione 'media.capture.save_dir'\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5591,12 +5521,12 @@ msgstr ""
"La funzione di salvataggio dello stream sarà disabilitata finché non si "
"imposta media.capture.save_dir nella configurazione. "
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: l'estrazione/cache di questa sorgente non è permessa.\n"
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
@@ -5604,51 +5534,51 @@ msgstr ""
"A xine non è possibile salvare da questa sorgente. (possibile materiale "
"protetto da copyright?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: nome del file non fornito!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: errore aprendo il file %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: attesa annullata\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "io_helper: attesa fallita: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "impossibile recuperare lo stato del socket"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: Permesso negato\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: File non trovato\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Connessionr rifiutata\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr "map_decoder_list: niente spazio per il decoder, ignorato.\n"
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -5656,12 +5586,12 @@ msgstr ""
"load_plugins: plugin %s ignorato, versione di interfaccia %d errata "
"(dovrebbe essere %d)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "priorità per il decoder %s"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
@@ -5671,7 +5601,7 @@ msgstr ""
"contenuto possa essere gestito da più di un decoder.\n"
"Una priorità pari a 0 abilita la priorità predefinita del decoder."
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
@@ -5680,7 +5610,7 @@ msgstr ""
"load_plugins: il plugin demuxer %s non fornisce una priorità, xine-lib "
"utilizzerà la priorità predefinita.\n"
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -5689,46 +5619,46 @@ msgstr ""
"load_plugins: il plugin di ingresso %s non fornisce una priorità, xine-lib "
"utilizzerà la priorità predefinita.\n"
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: trovato plugin %s\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: trovato plugin statico\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr ""
"load_plugins: raggiunto il limite di plugin, non è stato possibile caricare "
"%s.\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
"load_plugins: raggiunto il limite di plugin, non è stato possibile caricare "
"il plugin statico.\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: tipo del plugin sconosciuto %d in %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: tipo del plugin statico sconosciuto %d\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: impossibile individuare %s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5737,7 +5667,7 @@ msgstr ""
"load_plugins: impossibile aprire la libreria plugin %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5746,12 +5676,12 @@ msgstr ""
"load_plugins: non ottengo informazioni del plugin da %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: directory %s illeggibile ignorata.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5760,42 +5690,47 @@ msgstr ""
"load_plugins: impossibile aprire la libreria plugin %s (stadio 2):\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: Argh! %s non contiene informazioni plugin.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Impossibile creare l'oggetto DirectSound."
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: strategia di riconoscimento contenuto sconosciuta %d\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: utilizzo del demuxer '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: caricamento del plugin output audio fallito <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5804,7 +5739,7 @@ msgstr ""
"load_plugins: il riconoscimento automatico dell'output audio non ha trovato "
"alcun driver audio utilizzabile.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5813,54 +5748,54 @@ msgstr ""
"load_plugins: impossibile rimuovere la libreria plugin %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "il carattere '%s-%d' è già caricato, strano.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "caricamento del carattere '%s' fallito (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr "versione del font '%s' errata. Richiesto %d trovato %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: impossibile inizializzare la libreria ft2\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: errore nel trovare il caratter carattere %s con FontConfig"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: errore nel caricamento del carattere %s con FontConfig"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: errore nella ricerca del carattere %s con FontConfig"
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr "osd: errore nel caricamento del carattere %s con ft2\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: impossibile inizializzare la libreria ft2\n"
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
"osd: errore impostando la dimensione del carattere (nessun carattere "
"scalabile?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5869,48 +5804,48 @@ msgstr ""
"osd: sequenza sconosciuta cominciante con byte 0x%02X nella codifica \"%s\", "
"ignorata.\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: impossibile individuare il set di caratteri locale corrente.\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr ""
"osd: conversione %s -> %s non supportata, nessuna conversione eseguita\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: carattere non definito.\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: errore nel caricamento del glifo.\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: errore nella visualizzazione del glifo.\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: errore nel caricamento del glifo %i.\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: errore nella visualizzazione.\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr ""
"palette (primo piano-bordo-sfondo) da utilizzare per i sottotitoli e OSD"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
@@ -5920,11 +5855,19 @@ msgstr ""
"sottotitolo ceh non specificano nessuna colorazione. Le palette sono "
"elencate nella forma: primo piano - bordo - sfondo."
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5939,21 +5882,21 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: nessun plugin disponibile per gestire '%s'\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: errore, tipo di buffer sconosciuto: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "numero di buffer video"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5963,12 +5906,12 @@ msgstr ""
"interna. Valori alti significano una riproduzione più liscia per ingressi "
"inaffidabili, ma aumenta la latenza e il consumo di memoria."
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d frame consegnati, %d frame saltati, %d frame scartati\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -5977,16 +5920,16 @@ msgstr ""
"video_out: immagine con %<PRId64> pts scartata perché troppo vecchia (diff : "
"%<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -6002,11 +5945,11 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr "numero predefinito di frame video"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
@@ -6014,11 +5957,11 @@ msgstr ""
"Il numero predefinito di frame video da richiedere dal driver di uscita "
"video. Alcuni driver rimpiazzeranno questa impostazione con il loro valore."
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "percentuale di frame saltati da tollerare."
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
@@ -6026,11 +5969,11 @@ msgstr ""
"Quando non è mostrata una percentuale di frame superiore a questa, perché "
"non decodificati in tempo, xine invia una notifica."
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "percentuale di frame scartati da tollerare."
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
@@ -6038,18 +5981,18 @@ msgstr ""
"Quando non è mostrata una percentuale di frame superiore a questa, perché "
"non disposti alla visualizzazione in tempo, xine invia una notifica."
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: spiacente, non sarebbe dovuto succedere. Per favore riavvia "
"xine.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "posizione orizzontale dell'immagine nella finestra di visualizzazione"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -6062,11 +6005,11 @@ msgstr ""
"La posizione è fornita come percentuale, quindi un valore di 50 indica \"al "
"centro\" mentre 0 significa \"tutto a sinistra\" e 100 \"tutto a destra\"."
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "posizione vergicale dell'immagine nella finestra di visualizzazione"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -6079,11 +6022,11 @@ msgstr ""
"La posizione è fornita come percentuale, quindi un valore di 50 indica \"al "
"centro\" mentre 0 significa \"tutto in alto\" e 100 \"tutto in basso\"."
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "disabilita il ridimensionamento video"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -6101,149 +6044,149 @@ msgstr ""
"driver di uscita video come XShm, dove il ridimensionamento non è accelerato "
"in hardware, questo può ridurre drasticamente l'uso di CPU."
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: errore durante l'interpretazione del MRL\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: plugin di ingresso trovato : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: il plugin di ingresso non può aprire il MRL [%s]\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: impossibile trovare il plugin di ingresso per il MRL [%s]\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: l'avvio del demuxer %s specificato è fallito.\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: avvio del plugin di estrazione.\n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: errore nell'avvio del plugin di estrazione.\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: l'avvio dell'ultimo demuxer provato %s è fallito.\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "video ignorato\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "audio ignorato\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "sottotitoli ignorati\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr "plugin cache d'ingresso disattivato.\n"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "aperto il MRL sottotitoli '%s'\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: errore nell'apertura del MRL dei sottotitoli.\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: errore nell'interpretazione del MRL.\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: modificare l'opzione '%s' da MRL non è consentito.\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: impossibile trovare il demuxer per >%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: impossibile trovare il demuxer per >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: trovato plugin demuxer: %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: avvio del demuxer completo. veloce!\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: avvio del demuxer fallito.\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: nessun demux disponibile\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine: avvio del demuxer fallito.\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
"xine: La directory di salvataggio specificata \"%s\" potrebbe essere un "
"rischio per la sicurezza.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
"La directory di salvataggio specificata potrebbe essere un rischio per la "
"sicurezza."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: locale non supportarto dalla liberaria C\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "Strategia di riconoscimento del formato di contenuto"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -6277,11 +6220,11 @@ msgstr ""
"extension\n"
"Riconosce solo tramite estensione del file.\n"
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "Cartella di salvataggio degli stream"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -6297,12 +6240,12 @@ msgstr ""
"arbitrario. Per questo si deve essere attenti che la directory che si "
"specifica sia robusta per qualsiasi contenuto di ogni file."
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
"permetti modifiche implicite alla configurazione (per esmepio tramite MRL)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -6319,11 +6262,11 @@ msgstr ""
"arbitrariamente la propria configurazione si può finire con uno xine "
"completamente caotico."
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr "Timeout per la lettura dei flussi via rete (in secondi)"
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
@@ -6334,75 +6277,75 @@ msgstr ""
"lenta o la banda è occupata, valori troppo alti congeleranno il player se la "
"connessione viene persa."
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "messaggi"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "plugin"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "traccia"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Attenzione:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "Host sconosciuto:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Dispositivo sconosciuto:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Rete irraggiungibile"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Connessione rifiutata:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "File non trovato:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Errore leggendo da:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "Errore nel caricamento della libreria:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "Individuato flusso multimediale cifrato"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "Messaggio di sicurezza:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "Dispositivo audio non disponibile"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Errore di permessi"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "Il file è vuoto:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "metodo di copia di memoria usato da xine"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
@@ -6412,7 +6355,7 @@ msgstr ""
"computer moderni. Per questo xine fornisce diversi metodi raffinati per fare "
"tale copia. Solitamente il metodo migliore è riconosciuto automaticamente."
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Test di velocità dei metodi memcpy (più piccolo è migliore):\n"
diff --git a/po/ja.po b/po/ja.po
index df6a9181b..78001c364 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.1.19\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2010-07-31 01:14+0700\n"
"Last-Translator: Takeshi Hamasaki <hmatrjp@users.sourceforge.jp>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -279,212 +279,208 @@ msgid ""
"See the alsa documentation for information on alsa devices."
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr ""
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "エラー"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "æˆåŠŸ"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "ã‚¢ã‚¯ã‚»ã‚¹ãŒæ‹’å¦ã•れã¾ã—ãŸ"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
#, fuzzy
msgid "resource is already in use"
msgstr "æ—¢ã«ã‚«ãƒ¡ãƒ©ã¯ä½¿ç”¨ä¸­ã§ã™ã€‚"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
#, fuzzy
msgid "object was already initialized"
msgstr "ã‚«ãƒ¡ãƒ©ã¯æ—¢ã«ã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã§ã™"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "指定ã•ã‚ŒãŸæ³¢å½¢å½¢å¼ã¯ã‚µãƒãƒ¼ãƒˆã•れã¦ã„ã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
#, fuzzy
msgid "invalid parameter was passed"
msgstr "-s オプションã®å€¤ãŒä¸æ­£ã§ã™\n"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
#, fuzzy
msgid "object doesn't support aggregation"
msgstr "プリンタãŒãƒ“ットマップをサãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
#, fuzzy
msgid "no sound driver available for use"
msgstr "有効ãªãƒ–ラシãŒã‚りã¾ã›ã‚“。"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
#, fuzzy
msgid "insufficient memory"
msgstr "ãƒ¡ãƒ¢ãƒªã‚’ä½¿ã„æžœãŸã—ã¾ã—ãŸ"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
#, fuzzy
msgid "DirectSound wasn't initialized"
msgstr "仮引数 `%s' ãŒåˆæœŸåŒ–ã•れã¾ã—ãŸ"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
#, fuzzy
msgid "function is not supported"
msgstr "-Pオプションã¯ã‚µãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "䏿˜Žãªã‚¨ãƒ©ãƒ¼"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
#, fuzzy
msgid "Couldn't play sound buffer"
msgstr "サウンドカードを使用ã—ã¦éŸ³ã‚’出ã™"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
#, fuzzy
msgid "Couldn't stop sound buffer"
msgstr "コンテキスト・ãƒãƒƒãƒ•ァ用ã®ãƒ¡ãƒ¢ãƒªã‚’確ä¿ã§ãã¾ã›ã‚“ã§ã—ãŸ"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
#, fuzzy
msgid "Can't get buffer position"
msgstr "%s: シャドウをロックã§ãã¾ã›ã‚“\n"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
#, fuzzy
msgid "Can't set buffer position"
msgstr "ファイル '%s' 中ã«ä½ç½®ãƒã‚¤ãƒ³ã‚¿ã‚’設定ã§ãã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
#, fuzzy
msgid "Can't set sound volume"
msgstr "有効㪠UID を設定ã§ãã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, fuzzy, c-format
msgid ": can't create pthread condition: %s\n"
msgstr "%s: %d行: グループIDãŒä½œæˆã§ãã¾ã›ã‚“\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, fuzzy, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr "FSFS 相互排除ロックを作æˆã§ãã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, fuzzy, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr "%s: %d行: グループIDãŒä½œæˆã§ãã¾ã›ã‚“\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, fuzzy, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr "サイレンス用ã®ãƒãƒƒãƒ•ã‚¡ã®å–å¾—ã«å¤±æ•—ã—ã¾ã—ãŸ"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, fuzzy, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr "ファイルシステム相互排除ロックを割り当ã¦ã‚‰ã‚Œã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, fuzzy, c-format
msgid ": unknown control command %d\n"
msgstr "切り分られãŸã‚‚ã®ã‚’å…ƒã«æˆ»ã™ã‚³ãƒžãƒ³ãƒ‰ %s ãŒåˆ†ã‹ã‚Šã¾ã›ã‚“"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr ""
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr ""
@@ -514,11 +510,11 @@ msgid ""
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr ""
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
#, fuzzy
msgid "xine file audio output plugin"
msgstr "main: 音声出力プラグイン<%s> を探索中\n"
@@ -553,7 +549,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr ""
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
#, fuzzy
msgid "xine dummy audio output plugin"
msgstr "main: 音声出力プラグイン<%s> を探索中\n"
@@ -702,7 +698,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr ""
@@ -720,21 +716,21 @@ msgstr "DVD ドライブã¨ã—ã¦ä½¿ç”¨ã™ã‚‹ãƒ‡ãƒã‚¤ã‚¹"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr ""
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr ""
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
#, fuzzy
msgid "Sun audio device name"
msgstr "Sun mu-law オーディオ"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -742,172 +738,27 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr ""
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-#, fuzzy
-msgid "MPEG-4 postprocessing quality"
-msgstr "高 (普通ã®å“質)"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-#, fuzzy
-msgid "Skip loop filter"
-msgstr "高域通éŽãƒ•ィルタ"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-#, fuzzy
-msgid "constant quality mode"
-msgstr "サイズã¨å“質モード"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-#, fuzzy
-msgid "minimum compression"
-msgstr "圧縮ã®è¨­å®š"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
+#: src/combined/xine_ogg_demuxer.c:2173
#, fuzzy
-msgid "maximum quantizer"
-msgstr "最大帯域幅:"
+msgid "Annodex demux plugin"
+msgstr "ã¿ã¤ã‹ã£ãŸ xine ライブラリãƒãƒ¼ã‚¸ãƒ§ãƒ³: %d.%d.%d (%s).\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
#: src/demuxers/demux_asf.c:450
@@ -929,6 +780,10 @@ msgstr ""
msgid "Media stream scrambled/encrypted"
msgstr ""
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
#, fuzzy
msgid "Restoring index..."
@@ -949,16 +804,24 @@ msgstr ""
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, fuzzy, c-format
msgid "invalid FILM chunk size\n"
msgstr "record_size ãŒç„¡åйãªå€¤ã§ã™"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, fuzzy, c-format
msgid "unrecognized FILM chunk\n"
msgstr "ãƒ•ã‚£ãƒ«ãƒ è‰²ã‚’é¸æŠž"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, fuzzy, c-format
msgid "unsupported FLV version (%d).\n"
@@ -974,6 +837,11 @@ msgstr ""
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -989,70 +857,81 @@ msgstr ""
msgid "iff: unknown Chunk: %s\n"
msgstr "未知ã®ã‚·ã‚¹ãƒ†ãƒ ã‚¨ãƒ©ãƒ¼"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
"encrypted (encryption mode %d)\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
"encrypted (encryption mode %d)\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
"xine developers.\n"
msgstr ""
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
#: src/demuxers/demux_snd.c:100
@@ -1065,11 +944,21 @@ msgstr ""
msgid "demux_snd: unsupported audio type: %d\n"
msgstr ""
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "入力ファイルãŒç¸®ã‚“ã "
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "ã¿ã¤ã‹ã£ãŸ xine ライブラリãƒãƒ¼ã‚¸ãƒ§ãƒ³: %d.%d.%d (%s).\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1081,6 +970,11 @@ msgid ""
"unknown VOC compression type (0x%02X); please report to xine developers\n"
msgstr ""
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "入力ファイルãŒç¸®ã‚“ã "
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1091,38 +985,43 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr ""
-#: src/dxr3/dxr3.h:30
-#, fuzzy
-msgid "DXR3 device number"
-msgstr "デãƒã‚¤ã‚¹ç•ªå·ãŒé•ã„ã¾ã™"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, fuzzy, c-format
msgid "requested button not available\n"
msgstr "iconv é–¢æ•°ãŒæœ‰åйã§ã¯ã‚りã¾ã›ã‚“"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
#, fuzzy
msgid "use Pan & Scan info"
msgstr "フォント情報モードã§ãƒ©ãƒ™ãƒ«ã«ãƒ•ォントを使用ã™ã‚‹"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1138,11 +1037,11 @@ msgid ""
"use of the Active Format Descriptor (AFD) used in some European DVB channels."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1150,20 +1049,20 @@ msgid ""
"This is relevant for progressive video only (most PAL films)."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
#, fuzzy
msgid "use smooth play mode"
msgstr "正準テキスト・モードを使用"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1171,84 +1070,95 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+#, fuzzy
+msgid "DXR3 device number"
+msgstr "デãƒã‚¤ã‚¹ç•ªå·ãŒé•ã„ã¾ã™"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
"16\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1266,51 +1176,55 @@ msgid ""
"clock as sync source."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
"screen."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1324,22 +1238,22 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1350,7 +1264,7 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1361,11 +1275,11 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1397,23 +1311,23 @@ msgid ""
"of DXR3 overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
#, fuzzy
msgid "overlay colour key value"
msgstr "警告: キー/値ã®çµ„ã«çµ‚端ãŒã‚りã¾ã›ã‚“"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
"when using DXR3 overlay mode."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1421,27 +1335,27 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
#, fuzzy
msgid "preferred tv mode"
msgstr "主æ“作モード:"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1451,59 +1365,59 @@ msgid ""
"default: keep the card's setting"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
"video_out_dxr3: Read the README.dxr3 for details.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, fuzzy, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "「%sã€ã¸æŽ¥ç¶šã§ãã¾ã›ã‚“: %s\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr ""
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr ""
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr ""
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
#, fuzzy
msgid "device used for CD audio"
msgstr "CD-ROM ドライブã¨ã—ã¦ä½¿ç”¨ã™ã‚‹ãƒ‡ãƒã‚¤ã‚¹"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
#, fuzzy
msgid "query CDDB"
msgstr "Query status=%d\n"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1512,11 +1426,11 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "CDDBサーãƒå"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1524,31 +1438,19 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "CDDBサーãƒã®ãƒãƒ¼ãƒˆç•ªå·"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "CDDBキャッシュディレクトリ"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr ""
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1557,207 +1459,201 @@ msgid ""
"A value of zero here will disable the slowdown."
msgstr ""
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr ""
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr ""
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr ""
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, fuzzy, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr "Bonobo GUI サãƒãƒ¼ãƒˆ"
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, fuzzy, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "ゼロã§åŸ‹ã‚られãŸãƒ‡ãƒã‚¤ã‚¹ã‚’é–‹ã‘ã¾ã›ã‚“"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr ""
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr ""
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr ""
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
"T)\n"
msgstr ""
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
"C)\n"
msgstr ""
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
"A)\n"
msgstr ""
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr ""
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr ""
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
msgstr ""
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr ""
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
#, fuzzy
msgid "Last DVB channel viewed"
msgstr "æœ€çµ‚å€¤ã§æ–°è¦ãƒãƒ£ãƒ³ãƒãƒ«"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "使用ã™ã‚‹DVBã‚«ãƒ¼ãƒ‰ã®æ•°"
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
#, fuzzy
msgid "Enable the DVB GUI"
msgstr "Bonobo GUI サãƒãƒ¼ãƒˆ"
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-#, fuzzy
-msgid "DVB Channels config file"
-msgstr "設定ファイル '%s' ã¯ç©ºã§ã™"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "使用ã™ã‚‹DVBã‚«ãƒ¼ãƒ‰ã®æ•°"
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr ""
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr ""
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "DVD ドライブã¨ã—ã¦ä½¿ç”¨ã™ã‚‹ãƒ‡ãƒã‚¤ã‚¹"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
msgstr ""
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr ""
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1768,74 +1664,60 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
#, fuzzy
msgid "CSS decryption method"
msgstr "未知ã®ãƒ‡ãƒã‚¤ã‚¹æ“作ã§ã™"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-#, fuzzy
-msgid "path to the title key cache"
-msgstr "ã‚­ãƒ£ãƒƒã‚·ãƒ¥ç”Ÿæˆæ™‚ã«ç›¸å¯¾ãƒ‘ス `%s' ãŒä½¿ç”¨ã•れã¾ã—ãŸ"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr ""
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
#, fuzzy
msgid "read-ahead caching"
msgstr ""
"\n"
"ç¶šã‘ã¾ã™ã‹? (y ã¾ãŸã¯ n) "
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
#, fuzzy
msgid "unit for the skip action"
msgstr "アクション・グループã®åå‰ã§ã™"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1854,12 +1736,12 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
#, fuzzy
msgid "unit for seeking"
msgstr "å˜ä½ã®çœç•¥å½¢ (例 \"cm\" ãªã‚‰ã°ã‚»ãƒ³ãƒãƒ¡ãƒ¼ãƒˆãƒ«)。"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1873,11 +1755,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1894,139 +1776,139 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "ファイル '%s' 上ã«ã‚¨ãƒ©ãƒ¼ãŒã‚りã¾ã™: %s\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, fuzzy, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "%s: 入力ファイルãŒå‡ºåŠ›ãƒ•ã‚¡ã‚¤ãƒ«ãŒåŒã˜ãƒ•ァイルã§ã™"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, fuzzy, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "入力ファイル %s ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“.\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, fuzzy, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "通常ã®ç©ºãƒ•ァイル"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
#, fuzzy
msgid "file input plugin"
msgstr "入力ファイルãŒç¸®ã‚“ã "
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
#, fuzzy
msgid "file browsing start location"
msgstr " --sort-by-file ファイルã§å‡ºåŠ›ã‚’ã‚½ãƒ¼ãƒˆ\n"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "éš ã—ファイルを表示ã™ã‚‹"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr ""
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr ""
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, fuzzy, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "HTTP ã«ã‚ˆã‚‹æŽ¥ç¶šè¦æ±‚ã®é€ä¿¡ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, fuzzy, c-format
msgid "input_http: read error %d\n"
msgstr "標準入力上ã®èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã§ã™"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "HTTP サーãƒã¸æŽ¥ç¶šä¸­..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, fuzzy, c-format
msgid "input_http: invalid http answer\n"
msgstr "HTTP プロキシã®ãƒ›ã‚¹ãƒˆåãŒç„¡åйã§ã™ã€‚"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, fuzzy, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "HTTP リダイレクションã¯å®Ÿè£…ã•れã¦ã„ã¾ã›ã‚“"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr ""
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr ""
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr ""
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
#, fuzzy
msgid "http input plugin"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
#, fuzzy
msgid "HTTP proxy host"
msgstr "HTTP プロキシã®ãƒ›ã‚¹ãƒˆå"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
#, fuzzy
msgid "The hostname of the HTTP proxy."
msgstr "HTTP プロキシã®ãƒ›ã‚¹ãƒˆåãŒç„¡åйã§ã™ã€‚"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
#, fuzzy
msgid "HTTP proxy port"
msgstr "HTTP プロキシã®ãƒãƒ¼ãƒˆç•ªå·"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
#, fuzzy
msgid "The port number of the HTTP proxy."
msgstr "セキュア HTTP プロキシã®ãƒãƒ¼ãƒˆç•ªå·"
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
#, fuzzy
msgid "HTTP proxy username"
msgstr "HTTP プロキシã®ãƒ¦ãƒ¼ã‚¶å"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
#, fuzzy
msgid "The user name for the HTTP proxy."
msgstr "HTTP プロキシã®ãƒ›ã‚¹ãƒˆåãŒç„¡åйã§ã™ã€‚"
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
#, fuzzy
msgid "HTTP proxy password"
msgstr "HTTP プロキシã®ãƒ‘スワード"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
#, fuzzy
msgid "The password for the HTTP proxy."
msgstr "HTTP プロキシã®ãƒ›ã‚¹ãƒˆåãŒç„¡åйã§ã™ã€‚"
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr ""
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2034,105 +1916,105 @@ msgid ""
"(full match required)."
msgstr ""
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
#, fuzzy
msgid "mms streaming input plugin"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "ãƒãƒƒãƒˆãƒ¯ãƒ¼ã‚¯ã®å¸¯åŸŸå¹…"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "MMSプロトコル"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
msgstr ""
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, fuzzy, c-format
msgid "input_net: socket(): %s\n"
msgstr "Query status=2 (SOCKET)\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, fuzzy, c-format
msgid "input_net: connect(): %s\n"
msgstr "デジタル交差接続"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, fuzzy, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr ""
"%s: ãƒã‚¤ãƒ³ãƒ‰ã—よã†ã¨ã—ãŸã‚¢ãƒ‰ãƒ¬ã‚¹ `%s' を解決ã§ãã¾ã›ã‚“ã§ã—ãŸ; ãƒã‚¤ãƒ³ãƒ‰ã‚’ç¦æ­¢"
"ã—ã¾ã™ã€‚\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, fuzzy, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "lpadmin: サーãƒã«æŽ¥ç¶šã§ãã¾ã›ã‚“: %s\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr ""
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
#, fuzzy
msgid "pnm streaming input plugin"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, fuzzy, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "%s エラー: é©åˆ‡ãªå…¥åŠ›ãƒ•ã‚¡ã‚¤ãƒ« %s ãŒå¿…è¦ã§ã™\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, fuzzy, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "ファイルをオープンã™ã‚‹éš›ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, fuzzy, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "標準入力上ã®èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã§ã™"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr ""
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr ""
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr ""
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr ""
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr ""
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2182,161 +2064,161 @@ msgstr "'%s' ã«æŽ¥ç¶šã§ãã¾ã›ã‚“\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr ""
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr ""
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr ""
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr ""
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr ""
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
#, fuzzy
msgid "rtsp streaming input plugin"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr ""
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr ""
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, fuzzy, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "ファイル '%s' ã®ã‚ªãƒ¼ãƒ—ンã«å¤±æ•—ã—ã¾ã—ãŸ: %s"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
#, fuzzy
msgid "stdin streaming input plugin"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
#, fuzzy
msgid "Buffer underrun..."
msgstr "シンプル・ãƒãƒƒãƒ•ã‚¡"
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
#, fuzzy
msgid "Buffer overrun..."
msgstr "シンプル・ãƒãƒƒãƒ•ã‚¡"
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "調整ã—ã¦ã„ã¾ã™..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "ãƒãƒ¥ãƒ¼ãƒŠãƒ¼ã®åå‰ãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
#, fuzzy
msgid "v4l tv input plugin"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/input/input_v4l.c:1874
-#, fuzzy
-msgid "v4l radio input plugin"
-msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
#, fuzzy
msgid "v4l video device"
msgstr "デãƒã‚¤ã‚¹ç•ªå·ãŒé•ã„ã¾ã™"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr ""
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
msgid "v4l ALSA audio input device"
msgstr ""
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr ""
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
#, fuzzy
msgid "v4l TV standard"
msgstr "標準モニカã®ãƒ•ァクトリ"
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+#, fuzzy
+msgid "v4l radio input plugin"
+msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
+
+#: src/input/input_v4l.c:1954
#, fuzzy
msgid "v4l radio device"
msgstr "デãƒã‚¤ã‚¹ç•ªå·ãŒé•ã„ã¾ã™"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr ""
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr ""
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr ""
-#: src/input/input_vcd.c:925
-#, fuzzy
-msgid "Video CD input plugin"
-msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, fuzzy, c-format
msgid "unable to open %s: %s.\n"
msgstr "'%s' をオープンã§ãã¾ã›ã‚“"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, fuzzy, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "標準入力をå†ã‚ªãƒ¼ãƒ—ンã§ãã¾ã›ã‚“: %s"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+#, fuzzy
+msgid "Video CD input plugin"
+msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "VCD ドライブã¨ã—ã¦ä½¿ç”¨ã™ã‚‹ãƒ‡ãƒã‚¤ã‚¹"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr ""
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, fuzzy, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "MRL ãŒç•°å¸¸ã§ã™"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, fuzzy, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "%cMTP ã«ã‚ˆã‚‹ %s ã¸ã®æŽ¥ç¶šã«å¤±æ•—ã—ã¾ã—ãŸã€‚\n"
@@ -2415,19 +2297,19 @@ msgstr "対応ã—ã¦ã„ãªã„プロトコル\n"
msgid "Buffering..."
msgstr "ãƒãƒƒãƒ•ァリング..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
"%s\n"
msgstr ""
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, fuzzy, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "Service Control Manager ã«æŽ¥ç¶šã§ãã¾ã›ã‚“ã§ã—ãŸ"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr ""
@@ -2482,103 +2364,103 @@ msgstr ""
msgid "Invalid current entry type"
msgstr "エントリã¨ãƒ†ãƒ¼ãƒ–ルã®åž‹ãŒä¸€è‡´ã—ã¾ã›ã‚“"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
#, fuzzy
msgid "selection has no RETURN entry"
msgstr "'%s' ã«å¯¾ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã« URL ã¯ã‚りã¾ã›ã‚“"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
#, fuzzy
msgid "selection has no NEXT entry"
msgstr "'%s' ã«å¯¾ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã« URL ã¯ã‚りã¾ã›ã‚“"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
#, fuzzy
msgid "selection has no PREVIOUS entry"
msgstr "'%s' ã«å¯¾ã™ã‚‹ã‚¨ãƒ³ãƒˆãƒªã« URL ã¯ã‚りã¾ã›ã‚“"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
#, fuzzy
msgid "Unknown event type: "
msgstr "`%s' ã¯ä¸æ˜Žãªåœ§ç¸®å½¢å¼ã§ã™!"
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
#, fuzzy
msgid "VCD position slider range"
msgstr "ストリームå†ç”Ÿä½ç½®ã‚¹ãƒ©ã‚¤ãƒ€"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2599,11 +2481,11 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2611,11 +2493,11 @@ msgid ""
"See the help for the title_format for the meanings of these."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2632,86 +2514,176 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:820
-#, fuzzy
-msgid "A/52 volume"
-msgstr "--ボリュームヘッダ--\n"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:830
-msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:838
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "æ–‡å­—åˆ—ã®æ¯”較ã«å¤±æ•—"
+#: src/dxr3/ffmpeg_encoder.c:178
+#, fuzzy
+msgid "constant quality mode"
+msgstr "サイズã¨å“質モード"
-#: src/libfaad/xine_faad_decoder.c:145
-#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "æ–‡å­—åˆ—ã®æ¯”較ã«å¤±æ•—"
+#: src/dxr3/ffmpeg_encoder.c:179
+msgid ""
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
+msgstr ""
-#: src/libfaad/xine_faad_decoder.c:156
-#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "æ–‡å­—åˆ—ã®æ¯”較ã«å¤±æ•—"
+#: src/dxr3/ffmpeg_encoder.c:186
+#, fuzzy
+msgid "minimum compression"
+msgstr "圧縮ã®è¨­å®š"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:192
+#, fuzzy
+msgid "maximum quantizer"
+msgstr "最大帯域幅:"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:400
+#, c-format
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:841
+#, c-format
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+#, fuzzy
+msgid "MPEG-4 postprocessing quality"
+msgstr "高 (普通ã®å“質)"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+#, fuzzy
+msgid "Skip loop filter"
+msgstr "高域通éŽãƒ•ィルタ"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
#: src/libreal/real_common.c:139
@@ -2728,11 +2700,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2753,130 +2720,160 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
#, fuzzy
msgid "standard closed captioning font"
msgstr "標準入力ãŒé–‰ã˜ã‚‰ã‚Œã¦ã„ã¾ã™"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
#, fuzzy
msgid "italic closed captioning font"
msgstr "PangoStyle ã«ã‚ˆã‚‹ãƒ•ォント記述 (例: PANGO_STYLE_ITALIC)"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
#, fuzzy
msgid "closed captioning font size"
msgstr "ãƒã‚¤ãƒ³ãƒˆå˜ä½ã§ã®ãƒ•ォントã®å¤§ãã•"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "ãƒã‚¤ãƒ³ãƒˆå˜ä½ã§ã®ãƒ•ォントã®å¤§ãã•"
+
+#: src/spu_dec/cmml_decoder.c:468
#, fuzzy
msgid "font for external subtitles"
msgstr "ラベルã®ãƒ•ォント・サイズ"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
#, fuzzy
msgid "encoding of subtitles"
msgstr "サブタイトルを表示"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "ã¿ã¤ã‹ã£ãŸ xine ライブラリãƒãƒ¼ã‚¸ãƒ§ãƒ³: %d.%d.%d (%s).\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr ""
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
"in the subtitle being shown until the next one takes over."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "字幕ã®ã‚µã‚¤ã‚º"
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
#, fuzzy
msgid "subtitle vertical offset"
msgstr "検索オフセットエラー"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "字幕ã«ä½¿ç”¨ã™ã‚‹ãƒ•ォント"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
#, fuzzy
msgid "whether to use a freetype font"
msgstr "使用ã™ã‚‹ãƒ‡ãƒ•ォルトã®ãƒ•ォントå"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
#, fuzzy
msgid "encoding of the subtitles"
msgstr "サブタイトルを表示"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -2884,11 +2881,11 @@ msgid ""
"used."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -2968,31 +2965,142 @@ msgstr ""
msgid "w32codec: Error initializing DMO Audio\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "main: 音声出力プラグイン<%s> を探索中\n"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+#, fuzzy
+msgid "A/52 volume"
+msgstr "--ボリュームヘッダ--\n"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "æ–‡å­—åˆ—ã®æ¯”較ã«å¤±æ•—"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "æ–‡å­—åˆ—ã®æ¯”較ã«å¤±æ•—"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "æ–‡å­—åˆ—ã®æ¯”較ã«å¤±æ•—"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr ""
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3000,6 +3108,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3011,6 +3123,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3035,6 +3151,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3045,6 +3165,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3101,50 +3225,62 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr ""
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr ""
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
msgstr ""
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
#, fuzzy
msgid "goom image width"
msgstr "ç”»åƒã®å¹…㌠0 ã§ã™"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
#, fuzzy
msgid "goom image height"
msgstr "ç”»åƒã®é«˜ã•㌠0 ã§ã™"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr ""
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3156,7 +3292,12 @@ msgid ""
" h: the height of the picture\n"
msgstr ""
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3175,6 +3316,10 @@ msgid ""
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3190,20 +3335,8 @@ msgid ""
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
msgstr ""
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3230,7 +3363,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3245,7 +3407,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3263,7 +3425,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3271,12 +3437,16 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3305,11 +3475,126 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1798
+#, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "ファイル '%s' ã®ã‚ªãƒ¼ãƒ—ンã«å¤±æ•—ã—ã¾ã—ãŸ: %s"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "%cMTP ã«ã‚ˆã‚‹ %s ã¸ã®æŽ¥ç¶šã«å¤±æ•—ã—ã¾ã—ãŸã€‚\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "「%sã€ã¸æŽ¥ç¶šã§ãã¾ã›ã‚“: %s\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "ファイル '%s' ã®ã‚ªãƒ¼ãƒ—ンã«å¤±æ•—ã—ã¾ã—ãŸ: %s"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "%s: %d行: グループIDãŒä½œæˆã§ãã¾ã›ã‚“\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr ""
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr ""
@@ -3351,8 +3636,8 @@ msgid "video colour key"
msgstr "Session key ãŒç¢ºç«‹ã—ã¾ã—ãŸ:\n"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3426,31 +3711,31 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
#, fuzzy
msgid "video layer id (auto: -1)"
msgstr "-V オプションã«ã¯å‹•画ドライãƒãƒ¼ ID ãŒå¿…è¦ã§ã™\n"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr ""
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr ""
@@ -3467,23 +3752,23 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr ""
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
" Check 'fbset -i' or try 'fbset -depth 16'.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
#, fuzzy
msgid "framebuffer device name"
msgstr "%s: デãƒã‚¤ã‚¹å㯠`%s' ã§ã™\n"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3491,54 +3776,53 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
+#: src/video_out/video_out_fb.c:876
#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:950
+#: src/video_out/video_out_fb.c:933
#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+msgid "%s: %d video RAM buffers are available.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr ""
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
#, fuzzy
msgid "OpenGL renderer"
msgstr "レンダラ㮠GdkScreen ã§ã™"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3567,31 +3851,31 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
#, fuzzy
msgid "OpenGL minimum framerate"
msgstr "æ–‡å­—åˆ—é•·ã®æœ€å°å€¤"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
#, fuzzy
msgid "enable double buffering"
msgstr "\"三角形二㤠(塗りã¤ã¶ã—)\""
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr ""
@@ -3610,6 +3894,10 @@ msgstr ""
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
+#: src/video_out/video_out_pgx32.c:864
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3643,59 +3931,63 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
#, fuzzy
msgid "enable chroma keying"
msgstr "デフォルトルートを有効ã«ã™ã‚‹"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
#, fuzzy
msgid "enable multi-buffering"
msgstr " `multi-drop' モード: "
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+#: src/video_out/video_out_pgx64.c:1486
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr ""
@@ -3717,198 +4009,128 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr ""
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr ""
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-#, fuzzy
-msgid "default number of frame repetitions"
-msgstr "デフォルトã®ã‚¨ãƒ³ãƒˆãƒªã«ãƒªãƒ“ジョン番å·ãŒã‚りã¾ã›ã‚“"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1088
-#, fuzzy
-msgid "SyncFB device name"
-msgstr "%s: デãƒã‚¤ã‚¹å㯠`%s' ã§ã™\n"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
#, fuzzy
msgid "red intensity"
msgstr "赤ãƒãƒ£ãƒ³ãƒãƒ«ã®å¼·åº¦ã‚’変ãˆã‚‹"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
#, fuzzy
msgid "The intensity of the red colour components."
msgstr "赤ãƒãƒ£ãƒ³ãƒãƒ«ã®å¼·åº¦ã‚’変ãˆã‚‹"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
#, fuzzy
msgid "green intensity"
msgstr "ç·‘ãƒãƒ£ãƒ³ãƒãƒ«ã®å¼·åº¦ã‚’変ãˆã‚‹"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
#, fuzzy
msgid "The intensity of the green colour components."
msgstr "ç·‘ãƒãƒ£ãƒ³ãƒãƒ«ã®å¼·åº¦ã‚’変ãˆã‚‹"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
#, fuzzy
msgid "blue intensity"
msgstr "é’ãƒãƒ£ãƒ³ãƒãƒ«ã®å¼·åº¦ã‚’変ãˆã‚‹"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
#, fuzzy
msgid "The intensity of the blue colour components."
msgstr "é’ãƒãƒ£ãƒ³ãƒãƒ«ã®å¼·åº¦ã‚’変ãˆã‚‹"
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr ""
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -3918,79 +4140,76 @@ msgid ""
"\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, fuzzy, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr "Gaim ã¯ç›£è¦–ã™ã‚‹ãƒãƒ¼ãƒˆã‚’é–‹ã‘ã¾ã›ã‚“ã§ã—ãŸã€‚"
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, fuzzy, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr "タイプ %s ã«ã¤ã„ã¦åˆ©ç”¨å¯èƒ½ãªãƒ—ラグインãŒã‚りã¾ã›ã‚“!\n"
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
#, fuzzy
msgid "enable vblank sync"
msgstr "信用データベース: åŒæœŸã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n"
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -3998,326 +4217,137 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
+msgid "%s: this adaptor supports the %s format.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-#, fuzzy
-msgid "deinterlace method (deprecated)"
-msgstr "廃止予定ã®é–¢æ•°å‘¼ã³å‡ºã—ã§ã™"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr ""
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xv.c:1432
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-#: src/video_out/video_out_xv.c:1451
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"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: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
"port.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
" for hardware colour space conversion and scaling\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, fuzzy, c-format
msgid " no XvMC support \n"
msgstr " -L, --no-lirc LIRC サãƒãƒ¼ãƒˆã‚’無効ã«ã™ã‚‹\n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, fuzzy, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr "パターンをオーãƒãƒ¼ãƒ¬ã‚¤ã§ä½¿ã†"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
#, fuzzy
msgid "Unichrome cpu save"
msgstr "/ファイル/別åã§ä¿å­˜(_A)..."
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4425,59 +4455,59 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
#, fuzzy
msgid "number of audio buffers"
msgstr "CD ディジタル・オーディオ"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr ""
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4500,12 +4530,12 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
#, fuzzy
msgid "enable resampling"
msgstr "TurboPlay を有効ã«ã™ã‚‹"
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4513,34 +4543,34 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr ""
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
#, fuzzy
msgid "offset for digital passthrough"
msgstr "%s: ä¸é©åˆ‡ãªæ–‡å­—列オフセット %u >= %lu (セクション `%s' 用)"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4548,73 +4578,73 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "起動時ã®éŸ³é‡"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr ""
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, fuzzy, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr "設定ファイルã‹ã‚‰å‰Šé™¤ã™ã‚‹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒª"
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "'%s' ã‹ã‚‰è¨­å®šãƒ•ァイルã®ãƒ‘スをå–å¾—ã§ãã¾ã›ã‚“ã§ã—ãŸ"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr ""
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr ""
@@ -4630,374 +4660,387 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr ""
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, fuzzy, c-format
msgid ": input plugin not defined!\n"
msgstr "ã“ã®ãƒ—ラグイン㯠ID を定義ã—ã¦ã„ã¾ã›ã‚“。"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr ""
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, fuzzy, c-format
msgid "input_rip: seeking failed\n"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, fuzzy, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr ""
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, fuzzy, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "ã“ã®ãƒ—ラグイン㯠ID を定義ã—ã¦ã„ã¾ã›ã‚“。"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
"'media.capture.save_dir'\n"
msgstr ""
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
msgstr ""
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, fuzzy, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "ファイルをオープンã™ã‚‹éš›ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸã€‚"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr ""
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, fuzzy, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "å­ãƒ—ロセス/ファイルã¸ã® IO ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
#, fuzzy
msgid "failed to get status of socket"
msgstr "クラスã®çŠ¶æ…‹ã‚’å–å¾—ã§ãã¾ã›ã‚“:"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr ""
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, fuzzy, c-format
msgid "io_helper: File not found\n"
msgstr "日付サンプルファイルãŒè¦‹ã¤ã‹ã‚Šã¾ã›ã‚“"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, fuzzy, c-format
msgid "io_helper: Connection Refused\n"
msgstr "サーãƒã‹ã‚‰æŽ¥ç¶šã‚’æ‹’çµ¶ã•れã¾ã—ãŸã€‚応答: %s"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, fuzzy, c-format
msgid "priority for %s decoder"
msgstr "`%2$s' ã«å¯¾ã™ã‚‹å¼•æ•° %1$s ãŒæ›–昧ã§ã™"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
"the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, fuzzy, c-format
msgid "load_plugins: plugin %s found\n"
msgstr ""
"プラグイン '%s' を読ã¿è¾¼ã‚ã¾ã›ã‚“ã§ã—ãŸ\n"
"%s"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, fuzzy, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "vsnprintf 内ã§çŠ¶æ…‹ã‚’å¾—ã‚‰ã‚Œã¾ã›ã‚“"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "'%s' をオープンã§ãã¾ã›ã‚“"
+
+#: src/xine-engine/load_plugins.c:1217
#, fuzzy, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr "éµè¼ªã‚­ãƒ£ãƒƒã‚·ãƒ¥ã®å†æ§‹ç¯‰ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n"
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, fuzzy, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr "éµè¼ªã‚­ãƒ£ãƒƒã‚·ãƒ¥ã®å†æ§‹ç¯‰ã«å¤±æ•—ã—ã¾ã—ãŸ: %s\n"
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
"driver.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
"%s\n"
msgstr ""
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr ""
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, fuzzy, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "ç”»åƒã®èª­ã¿è¾¼ã¿ã«å¤±æ•—ã—ã¾ã—ãŸ..."
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, fuzzy, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
"'%s' 用 RA ã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ãŒä¸€è‡´ã—ã¾ã›ã‚“: 実際 %d.%d.%d%s, 予想 %d.%d.%d%s"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
#, c-format
-msgid "osd: error loading font %s with ft2\n"
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr ""
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
"skipping\n"
msgstr ""
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr ""
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr ""
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr ""
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, fuzzy, c-format
msgid "osd: error loading glyph\n"
msgstr "共有ライブラリã®ãƒ­ãƒ¼ãƒ‰ä¸­ã«ã‚¨ãƒ©ãƒ¼"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, fuzzy, c-format
msgid "osd: error loading glyph %i\n"
msgstr "共有ライブラリã®ãƒ­ãƒ¼ãƒ‰ä¸­ã«ã‚¨ãƒ©ãƒ¼"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, fuzzy, c-format
msgid "osd: error in rendering\n"
msgstr "%.250s ã§èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼ã§ã™"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr ""
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5012,50 +5055,50 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
#, fuzzy
msgid "number of video buffers"
msgstr "ビデオ形å¼ã‚’サãƒãƒ¼ãƒˆã—ã¦ã„ã¾ã™ã€‚\n"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr ""
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
"(diff : %<PRId64>).\n"
msgstr ""
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5071,47 +5114,47 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
#, fuzzy
msgid "default number of video frames"
msgstr "デフォルトã®ã‚¨ãƒ³ãƒˆãƒªã«ãƒªãƒ“ジョン番å·ãŒã‚りã¾ã›ã‚“"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5119,11 +5162,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5131,12 +5174,12 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
#, fuzzy
msgid "disable all video scaling"
msgstr "サムãƒã‚¤ãƒ«è¡¨ç¤ºã™ã‚‹å¤–部ã®ãƒ—ログラムを全ã¦ç„¡åйã«ã™ã‚‹"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5147,145 +5190,145 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: MRLã®æ§‹æ–‡è§£æžä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: 入力プラグインãŒè¦‹ã¤ã‹ã‚Šã¾ã—㟠: %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr ""
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr ""
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr ""
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr ""
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "ç”»åƒã‚’無視\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "音声を無視\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "副映åƒã‚’無視\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, fuzzy, c-format
msgid "input cache plugin disabled\n"
msgstr "自動å†ç”Ÿå…¥åŠ›ãƒ—ãƒ©ã‚°ã‚¤ãƒ³ '%s' ãŒå¤±æ•—ã—ã¾ã—ãŸ"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, fuzzy, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "é–‹ã„ã¦ã„るコンテンツをシャッフルå†ç”Ÿã—ã¾ã™"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr ""
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: MRLã®æ§‹æ–‡è§£æžä¸­ã«ã‚¨ãƒ©ãƒ¼ãŒç™ºç”Ÿã—ã¾ã—ãŸ\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr ""
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr ""
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, fuzzy, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "%s ã«ã‚ã‚‹ã¹ã HESIOD pobox ãŒã‚りã¾ã›ã‚“。\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, fuzzy, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "ã¿ã¤ã‹ã£ãŸ xine ライブラリãƒãƒ¼ã‚¸ãƒ§ãƒ³: %d.%d.%d (%s).\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr ""
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, fuzzy, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine エンジンãŒèµ·å‹•ã«å¤±æ•—ã—ã¾ã—ãŸ"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr ""
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr ""
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr ""
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr ""
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5303,12 +5346,12 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
#, fuzzy
msgid "directory for saving streams"
msgstr "ディレクトリã«å¯¾ã™ã‚‹å®Œå…¨å†syncãŒè¦æ±‚ã•れã¾ã—ãŸ"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5318,11 +5361,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5332,94 +5375,117 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "メッセージ"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "plugin"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "トレース"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Warning:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "䏿˜Žãªãƒ›ã‚¹ãƒˆ:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "䏿˜Žãªãƒ‡ãƒã‚¤ã‚¹:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "Network unreachable"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "接続を拒å¦ã•れã¾ã—ãŸ:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "ファイルãŒã¿ã¤ã‹ã‚Šã¾ã›ã‚“:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "ライブラリã®èª­ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr ""
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "セキュリティメッセージ:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "音声デãƒã‚¤ã‚¹ãŒåˆ©ç”¨ã§ãã¾ã›ã‚“"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
#, fuzzy
msgid "Permission error"
msgstr "%s: 読ã¿è¾¼ã¿ã‚¨ãƒ©ãƒ¼"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "空ã®ãƒ•ァイル:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr ""
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr ""
+
+#~ msgid "CDDB cache directory"
+#~ msgstr "CDDBキャッシュディレクトリ"
+
+#, fuzzy
+#~ msgid "DVB Channels config file"
+#~ msgstr "設定ファイル '%s' ã¯ç©ºã§ã™"
+
+#, fuzzy
+#~ msgid "path to the title key cache"
+#~ msgstr "ã‚­ãƒ£ãƒƒã‚·ãƒ¥ç”Ÿæˆæ™‚ã«ç›¸å¯¾ãƒ‘ス `%s' ãŒä½¿ç”¨ã•れã¾ã—ãŸ"
+
+#, fuzzy
+#~ msgid "default number of frame repetitions"
+#~ msgstr "デフォルトã®ã‚¨ãƒ³ãƒˆãƒªã«ãƒªãƒ“ジョン番å·ãŒã‚りã¾ã›ã‚“"
+
+#, fuzzy
+#~ msgid "SyncFB device name"
+#~ msgstr "%s: デãƒã‚¤ã‚¹å㯠`%s' ã§ã™\n"
+
+#, fuzzy
+#~ msgid "deinterlace method (deprecated)"
+#~ msgstr "廃止予定ã®é–¢æ•°å‘¼ã³å‡ºã—ã§ã™"
diff --git a/po/libxine1.pot b/po/libxine1.pot
deleted file mode 100644
index 38042100f..000000000
--- a/po/libxine1.pot
+++ /dev/null
@@ -1,5280 +0,0 @@
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR Copyright (C) 2000-2006 the xine project
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-#, fuzzy
-msgid ""
-msgstr ""
-"Project-Id-Version: xine-lib 1.1.20\n"
-"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
-"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=CHARSET\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
-
-#: lib/hstrerror.c:17
-msgid "No error"
-msgstr ""
-
-#: lib/hstrerror.c:18
-msgid "Unknown host"
-msgstr ""
-
-#: lib/hstrerror.c:19
-msgid "No address associated with name"
-msgstr ""
-
-#: lib/hstrerror.c:20
-msgid "Unknown server error"
-msgstr ""
-
-#: lib/hstrerror.c:21
-msgid "Host name lookup failure"
-msgstr ""
-
-#: lib/hstrerror.c:22
-msgid "Unknown error"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:350
-#, c-format
-msgid "audio_alsa_out:Already open...WHY!"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:378
-#, c-format
-msgid "audio_alsa_out: snd_pcm_open() of %s failed: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:380
-#, c-format
-msgid "audio_alsa_out: >>> check if another program already uses PCM <<<\n"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:393
-#, c-format
-msgid ""
-"audio_alsa_out: broken configuration for this PCM: no configurations "
-"available: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1323
-msgid "notify changes to the hardware mixer"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1324
-msgid ""
-"When the hardware mixer changes, your application will receive a "
-"notification so that it can update its graphical representation of the mixer "
-"settings on the fly."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1389
-#, c-format
-msgid "snd_lib_error_set_handler() failed: %d"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1396
-msgid "sound card can do mmap"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1397
-msgid ""
-"Enable this, if your sound card and alsa driver support memory mapped IO.\n"
-"You can try enabling it and check, if everything works. If it does, this "
-"will increase performance."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1406
-msgid "device used for mono output"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1407
-msgid ""
-"xine will use this alsa device to output mono sound.\n"
-"See the alsa documentation for information on alsa devices."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1415
-msgid "device used for stereo output"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1416
-msgid ""
-"xine will use this alsa device to output stereo sound.\n"
-"See the alsa documentation for information on alsa devices."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1424
-msgid "device used for 4-channel output"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1425
-msgid ""
-"xine will use this alsa device to output 4 channel (4.0) surround sound.\n"
-"See the alsa documentation for information on alsa devices."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1434 src/audio_out/audio_alsa_out.c:1444
-msgid "device used for 5.1-channel output"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1435
-msgid ""
-"xine will use this alsa device to output 5 channel plus LFE (5.1) surround "
-"sound.\n"
-"See the alsa documentation for information on alsa devices."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1445
-msgid ""
-"xine will use this alsa device to output undecoded digital surround sound. "
-"This can be used be external surround decoders.\n"
-"See the alsa documentation for information on alsa devices."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1465
-#, c-format
-msgid "snd_pcm_open() failed:%d:%s\n"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1467
-#, c-format
-msgid ">>> Check if another program already uses PCM <<<\n"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1498 src/audio_out/audio_jack_out.c:742
-#: src/audio_out/audio_oss_out.c:925
-msgid "speaker arrangement"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1499 src/audio_out/audio_jack_out.c:743
-#: src/audio_out/audio_oss_out.c:926
-msgid ""
-"Select how your speakers are arranged, this determines which speakers xine "
-"uses for sound output. The individual values are:\n"
-"\n"
-"Mono 1.0: You have only one speaker.\n"
-"Stereo 2.0: You have two speakers for left and right channel.\n"
-"Headphones 2.0: You use headphones.\n"
-"Stereo 2.1: You have two speakers for left and right channel, and one "
-"subwoofer for the low frequencies.\n"
-"Surround 3.0: You have three speakers for left, right and rear channel.\n"
-"Surround 4.0: You have four speakers for front left and right and rear left "
-"and right channels.\n"
-"Surround 4.1: You have four speakers for front left and right and rear left "
-"and right channels, and one subwoofer for the low frequencies.\n"
-"Surround 5.0: You have five speakers for front left, center and right and "
-"rear left and right channels.\n"
-"Surround 5.1: You have five speakers for front left, center and right and "
-"rear left and right channels, and one subwoofer for the low frequencies.\n"
-"Surround 6.0: You have six speakers for front left, center and right and "
-"rear left, center and right channels.\n"
-"Surround 6.1: You have six speakers for front left, center and right and "
-"rear left, center and right channels, and one subwoofer for the low "
-"frequencies.\n"
-"Surround 7.1: You have seven speakers for front left, center and right, left "
-"and right and rear left and right channels, and one subwoofer for the low "
-"frequencies.\n"
-"Pass Through: Your sound system will receive undecoded digital sound from "
-"xine. You need to connect a digital surround decoder capable of decoding the "
-"formats you want to play to your sound card's digital output."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1528
-msgid "audio_alsa_out : supported modes are"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1532
-msgid " 8bit"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1537
-msgid " 16bit"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1541
-msgid " 24bit"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1545
-msgid " 32bit"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:961
-msgid " mono"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1562 src/audio_out/audio_oss_out.c:967
-msgid " stereo"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1567 src/audio_out/audio_oss_out.c:974
-msgid " 4-channel"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1570 src/audio_out/audio_oss_out.c:977
-msgid " (4-channel not enabled in xine config)"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1575
-msgid " 4.1-channel"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1578
-msgid " (4.1-channel not enabled in xine config)"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1583 src/audio_out/audio_oss_out.c:984
-msgid " 5-channel"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1586 src/audio_out/audio_oss_out.c:987
-msgid " (5-channel not enabled in xine config)"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1591 src/audio_out/audio_oss_out.c:994
-msgid " 5.1-channel"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1594 src/audio_out/audio_oss_out.c:997
-msgid " (5.1-channel not enabled in xine config)"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1617
-msgid " a/52 and DTS pass-through"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1620
-msgid " (a/52 and DTS pass-through not enabled in xine config)"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1630
-msgid "alsa mixer device"
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1631
-msgid ""
-"xine will use this alsa mixer device to change the volume.\n"
-"See the alsa documentation for information on alsa devices."
-msgstr ""
-
-#: src/audio_out/audio_alsa_out.c:1705
-msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
-msgstr ""
-
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr ""
-
-#: src/audio_out/audio_coreaudio_out.c:569
-msgid "xine output plugin for Coreaudio/Mac OS X"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:166
-msgid "Error"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:173
-msgid "success"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:175
-msgid "access denied"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:177
-msgid "resource is already in use"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:178
-msgid "object was already initialized"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:179
-msgid "specified wave format is not supported"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:180
-msgid "memory buffer has been lost and must be restored"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:181
-msgid "requested buffer control is not available"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:182
-msgid "undetermined error inside DirectSound subsystem"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:184
-msgid "DirectSound hardware device is unavailable"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:186
-msgid "function is not valid for the current state of the object"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:187
-msgid "invalid parameter was passed"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:188
-msgid "object doesn't support aggregation"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:189
-msgid "no sound driver available for use"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:190
-msgid "requested COM interface not available"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:191
-msgid "another application has a higher priority level"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:192
-msgid "insufficient memory"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:193
-msgid "low priority level for this function"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:194
-msgid "DirectSound wasn't initialized"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:195
-msgid "function is not supported"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:196
-msgid "unknown error"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:206
-#, c-format
-msgid "Unable to create direct sound object."
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:212
-#, c-format
-msgid "Could not set direct sound cooperative level."
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:284
-msgid "Unable to create secondary direct sound buffer"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:304
-msgid "Couldn't play sound buffer"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:316
-msgid "Couldn't stop sound buffer"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:329
-msgid "Can't get buffer position"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:343
-msgid "Can't set buffer position"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:374
-msgid "Can't set sound volume"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:392
-#, c-format
-msgid ": buffer lost, trying to restore\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:396
-msgid "Couldn't lock direct sound buffer"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:409
-msgid "Couldn't unlock direct sound buffer"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:500
-#, c-format
-msgid "Unable to create primary direct sound buffer."
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:596
-#, c-format
-msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:699
-#, c-format
-msgid ": can't create pthread condition: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:703
-#, c-format
-msgid ": can't create pthread mutex: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:710
-#, c-format
-msgid ": can't create buffer pthread: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:825
-#, c-format
-msgid ": can't destroy buffer pthread: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:832
-#, c-format
-msgid ": can't destroy pthread condition: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:835
-#, c-format
-msgid ": can't destroy pthread mutex: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:890
-#, c-format
-msgid ": unknown control command %d\n"
-msgstr ""
-
-#: src/audio_out/audio_directx2_out.c:946
-msgid "second xine audio output plugin using directx"
-msgstr ""
-
-#: src/audio_out/audio_directx_out.c:831
-msgid "xine audio output plugin for win32 using directx"
-msgstr ""
-
-#: src/audio_out/audio_esd_out.c:165
-#, c-format
-msgid "audio_esd_out: connecting to ESD server %s: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_esd_out.c:497
-#, c-format
-msgid "audio_esd_out: connecting to esd server...\n"
-msgstr ""
-
-#: src/audio_out/audio_esd_out.c:509
-#, c-format
-msgid "audio_esd_out: can't connect to %s ESD server: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_esd_out.c:539
-msgid "esd audio output latency (adjust a/v sync)"
-msgstr ""
-
-#: src/audio_out/audio_esd_out.c:540 src/audio_out/audio_oss_out.c:867
-msgid ""
-"If you experience audio being not in sync with the video, you can enter a "
-"fixed offset here to compensate.\n"
-"The unit of the value is one PTS tick, which is the 90000th part of a second."
-msgstr ""
-
-#: src/audio_out/audio_esd_out.c:572
-msgid "xine audio output plugin using esound"
-msgstr ""
-
-#: src/audio_out/audio_file_out.c:362
-msgid "xine file audio output plugin"
-msgstr ""
-
-#: src/audio_out/audio_irixal_out.c:385
-msgid "irixal audio output maximum gap length"
-msgstr ""
-
-#: src/audio_out/audio_irixal_out.c:386
-msgid ""
-"You can specify the maximum offset between audio and video xine will "
-"tolerate before trying to resync them.\n"
-"The unit of this value is one PTS tick, which is the 90000th part of a "
-"second."
-msgstr ""
-
-#: src/audio_out/audio_irixal_out.c:415
-msgid "xine audio output plugin using IRIX libaudio"
-msgstr ""
-
-#: src/audio_out/audio_jack_out.c:730
-msgid "JACK audio device name"
-msgstr ""
-
-#: src/audio_out/audio_jack_out.c:731
-msgid ""
-"Specifies the jack audio device name, leave blank for the default physical "
-"output port."
-msgstr ""
-
-#: src/audio_out/audio_jack_out.c:908
-msgid "xine output plugin for JACK Audio Connection Kit"
-msgstr ""
-
-#: src/audio_out/audio_none_out.c:223
-msgid "xine dummy audio output plugin"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:195
-#, c-format
-msgid "audio_oss_out: Opening audio device %s: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:217
-#, c-format
-msgid ""
-"audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:229
-#, c-format
-msgid "audio_oss_out: audio rate : %d requested, %d provided by device\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:743
-msgid "OSS audio device name"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:744
-msgid ""
-"Specifies the base part of the audio device name, to which the OSS device "
-"number is appended to get the full device name.\n"
-"Select \"auto\" if you want xine to auto detect the corret setting."
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:751
-msgid "OSS audio device number, -1 for none"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:752
-msgid ""
-"The full audio device name is created by concatenating the OSS device name "
-"and the audio device number.\n"
-"If you do not need a number because you are happy with your system's default "
-"audio device, set this to -1.\n"
-"The range of this value is -1 or 0-15. This setting is ignored, when the OSS "
-"audio device name is set to \"auto\"."
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:761
-#, c-format
-msgid "audio_oss_out: audio.device.oss_device_name = auto, probing devs\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:764
-#, c-format
-msgid "audio_oss_out: Auto probe for audio device failed\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:780
-#, c-format
-msgid "audio_oss_out: using device >%s<\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:786 src/audio_out/audio_oss_out.c:900
-#, c-format
-msgid ""
-"audio_oss_out: opening audio device %s failed:\n"
-"%s\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:807
-msgid "a/v sync method to use by OSS"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:808
-msgid ""
-"xine can use different methods to keep audio and video synchronized. Which "
-"setting works best depends on the OSS driver and sound hardware you are "
-"using. Try the various methods, if you experience sync problems.\n"
-"\n"
-"The meaning of the values is as follows:\n"
-"\n"
-"auto\n"
-"xine attempts to automatically detect the optimal setting\n"
-"\n"
-"getodelay\n"
-"uses the SNDCTL_DSP_GETODELAY ioctl to achieve true a/v sync even if the "
-"driver claims not to support realtime playback\n"
-"\n"
-"getoptr\n"
-"uses the SNDCTL_DSP_GETOPTR ioctl to achieve true a/v sync even if the "
-"driver supports the preferred SNDCTL_DSP_GETODELAY ioctl\n"
-"\n"
-"softsync\n"
-"uses software synchronization with the system clock; audio and video can get "
-"severely out of sync if the system clock speed does not precisely match your "
-"sound card's playback speed\n"
-"\n"
-"probebuffer\n"
-"probes the sound card buffer size on initialization to calculate the latency "
-"for a/v sync; try this if your system does not support any of the realtime "
-"ioctls and you experience sync errors after long playback"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:859
-#, c-format
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...will use system real-time clock for soft-sync instead\n"
-"audio_oss_out: ...there may be audio/video synchronization issues\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:866
-msgid "OSS audio output latency (adjust a/v sync)"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:892
-#, c-format
-msgid ""
-"audio_oss_out: Audio driver realtime sync disabled...\n"
-"audio_oss_out: ...probing output buffer size: %d bytes\n"
-"audio_oss_out: ...there may be audio/video synchronization issues\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:956
-msgid "audio_oss_out: supported modes are"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:1007
-msgid " a/52 pass-through"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:1010
-msgid " (a/52 pass-through not enabled in xine config)"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:1026
-msgid "OSS audio mixer number, -1 for none"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:1027
-msgid ""
-"The full mixer device name is created by taking the OSS device name, "
-"replacing \"dsp\" with \"mixer\" and adding the mixer number.\n"
-"If you do not need a number because you are happy with your system's default "
-"mixer device, set this to -1.\n"
-"The range of this value is -1 or 0-15. This setting is ignored, when the OSS "
-"audio device name is set to \"auto\"."
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:1081
-#, c-format
-msgid "audio_oss_out: open() mixer %s failed: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_oss_out.c:1154
-msgid "xine audio output plugin using oss-compliant audio devices/drivers"
-msgstr ""
-
-#: src/audio_out/audio_pulse_out.c:879
-msgid "device used for pulseaudio"
-msgstr ""
-
-#: src/audio_out/audio_pulse_out.c:880
-msgid "use 'server[:sink]' for setting the pulseaudio sink device."
-msgstr ""
-
-#: src/audio_out/audio_pulse_out.c:963
-msgid "xine audio output plugin using pulseaudio sound server"
-msgstr ""
-
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
-#, c-format
-msgid "audio_sun_out: opening audio device %s failed: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_sun_out.c:925
-msgid "Sun audio device name"
-msgstr ""
-
-#: src/audio_out/audio_sun_out.c:926
-msgid ""
-"Specifies the file name for the Sun audio device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper Sun audio device."
-msgstr ""
-
-#: src/audio_out/audio_sun_out.c:968
-#, c-format
-msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
-msgstr ""
-
-#: src/audio_out/audio_sun_out.c:1022
-msgid "xine audio output plugin using sun-compliant audio devices/drivers"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
-msgstr ""
-
-#: src/demuxers/demux_asf.c:450
-#, c-format
-msgid "demux_asf: warning: A stream appears to be missing.\n"
-msgstr ""
-
-#: src/demuxers/demux_asf.c:452
-msgid "Media stream missing?"
-msgstr ""
-
-#: src/demuxers/demux_asf.c:461
-#, c-format
-msgid "demux_asf: warning: The stream id=%d is encrypted.\n"
-msgstr ""
-
-#: src/demuxers/demux_asf.c:463
-msgid "Media stream scrambled/encrypted"
-msgstr ""
-
-#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
-msgid "Restoring index..."
-msgstr ""
-
-#: src/demuxers/demux_avi.c:630 src/demuxers/demux_avi.c:1697
-#, c-format
-msgid "demux_avi: invalid avi chunk \"%c%c%c%c\" at pos %<PRIdMAX>\n"
-msgstr ""
-
-#: src/demuxers/demux_avi.c:824
-#, c-format
-msgid "demux_avi: avi index is broken\n"
-msgstr ""
-
-#: src/demuxers/demux_avi.c:832
-#, c-format
-msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
-msgstr ""
-
-#: src/demuxers/demux_film.c:186
-#, c-format
-msgid "invalid FILM chunk size\n"
-msgstr ""
-
-#: src/demuxers/demux_film.c:342
-#, c-format
-msgid "unrecognized FILM chunk\n"
-msgstr ""
-
-#: src/demuxers/demux_flv.c:184
-#, c-format
-msgid "unsupported FLV version (%d).\n"
-msgstr ""
-
-#: src/demuxers/demux_flv.c:191
-#, c-format
-msgid "neither video nor audio stream in this file.\n"
-msgstr ""
-
-#: src/demuxers/demux_flv.c:559 src/demuxers/demux_flv.c:701
-#, c-format
-msgid "sequence header too big (%u bytes)!\n"
-msgstr ""
-
-#: src/demuxers/demux_iff.c:233
-#, c-format
-msgid "iff-8svx/16sv: unknown compression: %d\n"
-msgstr ""
-
-#: src/demuxers/demux_iff.c:367
-#, c-format
-msgid "iff-ilbm: unknown compression: %d\n"
-msgstr ""
-
-#: src/demuxers/demux_iff.c:568
-#, c-format
-msgid "iff: unknown Chunk: %s\n"
-msgstr ""
-
-#: src/demuxers/demux_mpc.c:205
-#, c-format
-msgid "demux_mpc: frame too big for buffer"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_block.c:291
-#, c-format
-msgid ""
-"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
-"to xine developers.\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_block.c:302
-#, c-format
-msgid ""
-"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_block.c:634
-#, c-format
-msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_block.c:644
-#, c-format
-msgid ""
-"demux_mpeg_block: warning: PES header indicates that this stream may be "
-"encrypted (encryption mode %d)\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_pes.c:413
-#, c-format
-msgid ""
-"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
-"to xine developers.\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_pes.c:422
-#, c-format
-msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_pes.c:804
-#, c-format
-msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_pes.c:814
-#, c-format
-msgid ""
-"demux_mpeg_pes: warning: PES header indicates that this stream may be "
-"encrypted (encryption mode %d)\n"
-msgstr ""
-
-#: src/demuxers/demux_mpeg_pes.c:1116
-#, c-format
-msgid ""
-"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
-"xine developers.\n"
-msgstr ""
-
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
-msgstr ""
-
-#: src/demuxers/demux_snd.c:100
-#, c-format
-msgid "demux_snd: bad header parameters\n"
-msgstr ""
-
-#: src/demuxers/demux_snd.c:145
-#, c-format
-msgid "demux_snd: unsupported audio type: %d\n"
-msgstr ""
-
-#: src/demuxers/demux_tta.c:98
-#, c-format
-msgid "demux_tta: total frames count too high\n"
-msgstr ""
-
-#: src/demuxers/demux_voc.c:103
-#, c-format
-msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
-msgstr ""
-
-#: src/demuxers/demux_voc.c:118
-#, c-format
-msgid ""
-"unknown VOC compression type (0x%02X); please report to xine developers\n"
-msgstr ""
-
-#: src/demuxers/demux_wc3movie.c:190
-#, c-format
-msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
-msgstr ""
-
-#: src/demuxers/demux_wc3movie.c:408
-#, c-format
-msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
-msgstr ""
-
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr ""
-
-#: src/dxr3/dxr3.h:31
-msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
-msgstr ""
-
-#: src/dxr3/dxr3_decode_spu.c:262
-#, c-format
-msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_spu.c:672
-#, c-format
-msgid "requested button not available\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:254
-#, c-format
-msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:260
-msgid "use Pan & Scan info"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:261
-msgid ""
-"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
-"encoded material. You can specify here, how to handle such content.\n"
-"\n"
-"only when forced\n"
-"Use Pan & Scan only, when the content you are playing enforces it.\n"
-"\n"
-"use MPEG hint\n"
-"Enable Pan & Scan based on information embedded in the MPEG video stream.\n"
-"\n"
-"use DVB hint\n"
-"Enable Pan & Scan based on information embedded in DVB streams. This makes "
-"use of the Active Format Descriptor (AFD) used in some European DVB channels."
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:280
-msgid "try to sync video every frame"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:281
-msgid ""
-"Tries to set a synchronization timestamp for every frame. Normally this is "
-"not necessary, because sync is sufficent even when the timestamp is set only "
-"every now and then.\n"
-"This is relevant for progressive video only (most PAL films)."
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:287
-msgid "use smooth play mode"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:288
-msgid "Enabling this option will utilise a smoother play mode."
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:291
-msgid "correct frame durations in broken streams"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:292
-msgid ""
-"Enables a small logic that corrects the frame durations of some mpeg streams "
-"with wrong framerate codes. Currently a correction for NTSC streams "
-"erroneously labeled as PAL streams is implemented. Enable only, when you "
-"encounter such streams."
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:551
-#, c-format
-msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:619
-#, c-format
-msgid "dxr3_decode_video: write to device would block. flushing\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:623
-#, c-format
-msgid "dxr3_decode_video: video device write failed (%s)\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:738
-#, c-format
-msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
-msgstr ""
-
-#: src/dxr3/dxr3_decode_video.c:766
-#, c-format
-msgid ""
-"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:123
-#, c-format
-msgid "dxr3_mpeg_encoder: failed to init librte\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:158
-#, c-format
-msgid ""
-"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
-"16\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:168
-#, c-format
-msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:179
-#, c-format
-msgid "dxr3_mpeg_encoder: could not create codec.\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:187
-msgid "rte mpeg output bitrate (kbit/s)"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:188
-msgid ""
-"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
-"mode. Higher values will increase quality and CPU usage."
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:232
-#, c-format
-msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:240
-#, c-format
-msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:370
-#, c-format
-msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:385
-msgid "fame mpeg encoding quality"
-msgstr ""
-
-#: src/dxr3/dxr3_mpeg_encoders.c:386
-msgid ""
-"The encoding quality of the libfame mpeg encoder library. Lower is faster "
-"but gives noticeable artifacts. Higher is better but slower."
-msgstr ""
-
-#: src/dxr3/dxr3_scr.c:96
-msgid "SCR plugin priority"
-msgstr ""
-
-#: src/dxr3/dxr3_scr.c:97
-msgid ""
-"Priority of the DXR3 SCR plugin. Values less than 5 mean that the unix "
-"system timer will be used. Values greater 5 force to use DXR3's internal "
-"clock as sync source."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:262
-msgid "swap odd and even lines"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:263
-msgid ""
-"Swaps the even and odd field of the image.\n"
-"Enable this option for non-MPEG material which produces a vertical jitter on "
-"screen."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:267
-msgid "add black bars to correct aspect ratio"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:268
-msgid ""
-"Adds black bars when the image has an aspect ratio the card cannot handle "
-"natively. This is needed to maintain proper image proportions."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:273
-msgid "use smooth play mode for mpeg encoder playback"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:274
-msgid ""
-"Enabling this option will utilise a smoother play mode for non-MPEG content."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:282
-#, c-format
-msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:290
-#, c-format
-msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:336
-msgid "encoder for non mpeg content"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:337
-msgid ""
-"Content other than MPEG has to pass an additional reencoding stage, because "
-"the dxr3 handles only MPEG.\n"
-"Depending on what is supported by your xine, this setting can be \"fame\", "
-"\"rte\", \"libavcodec\" or \"none\".\n"
-"The \"libavcodec\" encoder makes use of the ffmpeg plugin that already ships "
-"with xine, so you do not need to install any additional library for that. "
-"Even better is that libavcodec also provides high quality with low CPU "
-"usage. Using \"libavcodec\" is therefore strongly suggested.\n"
-"\"fame\" and \"rte\" are still there, but xine support for them is outdated, "
-"so these might fail to work."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:348
-#, c-format
-msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:354
-#, c-format
-msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:361
-#, c-format
-msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:367
-#, c-format
-msgid ""
-"video_out_dxr3: Mpeg encoding disabled.\n"
-"video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n"
-"video_out_dxr3: you will not be able to play non-mpeg content using this "
-"video out\n"
-"video_out_dxr3: driver. See the README.dxr3 for details on configuring an "
-"encoder.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:373
-#, c-format
-msgid ""
-"video_out_dxr3: No mpeg encoder compiled in.\n"
-"video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n"
-"video_out_dxr3: you will not be able to play non-mpeg content using this "
-"video out\n"
-"video_out_dxr3: driver. See the README.dxr3 for details on configuring an "
-"encoder.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:388
-msgid "video output mode (TV or overlay)"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:389
-msgid ""
-"The way the DXR3 outputs the final video can be set here. The individual "
-"values are:\n"
-"\n"
-"letterboxed tv\n"
-"Send video to the TV out connector only. This is the mode used for the "
-"standard 4:3 television set. Anamorphic (16:9) video will be displayed "
-"letterboxed, pan&scan material will have the image cropped at the left and "
-"right side. This is the common setting for TV viewing and acts like a "
-"standalone DVD player.\n"
-"\n"
-"widescreen tv\n"
-"Send video to the tv out connector only. This mode is intended for 16:9 "
-"widescreen TV sets. Anamorphic and pan&scan content will fill the entire "
-"screen, but you have to set the TV's aspect ratio manually to 16:9 using "
-"your.\n"
-"\n"
-"letterboxed overlay\n"
-"Overlay Video output on the computer screen with the option of on-the-fly "
-"switching to TV out by hiding the video window. The overlay will be "
-"displayed with black borders if it is anamorphic (16:9).\n"
-"This setting is only useful in the rare case of a DVD subtitle channel that "
-"would only display properly in letterbox mode. A good example for that are "
-"the animated commentator's silhouettes on \"Ghostbusters\".\n"
-"\n"
-"widescreen overlay\n"
-"Overlay Video output on the computer screen with the option of on-the-fly "
-"switching to TV out by hiding the video window. This is the common variant "
-"of DXR3 overlay."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:436
-msgid "overlay colour key value"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:436
-msgid ""
-"Hexadecimal RGB value of the key colour.\n"
-"You can try different values, if you experience windows becoming transparent "
-"when using DXR3 overlay mode."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:441
-msgid "overlay colour key tolerance"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:441
-msgid ""
-"A greater value widens the tolerance for the overlay key colour.\n"
-"You can try lower values, if you experience windows becoming transparent "
-"when using DXR3 overlay mode, but parts of the image borders may disappear "
-"when using a too low setting."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:447
-msgid "crop the overlay area at top and bottom"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:448
-msgid ""
-"Removes one pixel line from the top and bottom of the overlay. Enable this, "
-"if you see green lines at the top or bottom of the overlay."
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:452
-#, c-format
-msgid "video_out_dxr3: please run autocal, overlay disabled\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:462
-msgid "preferred tv mode"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:462
-msgid ""
-"Selects the TV mode to be used by the DXR3. The values mean:\n"
-"\n"
-"ntsc: NTSC at 60Hz\n"
-"pal: PAL at 50Hz\n"
-"pal60: PAL at 60Hz\n"
-"default: keep the card's setting"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:484
-#, c-format
-msgid "video_out_dxr3: setting video mode failed.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:714
-#, c-format
-msgid ""
-"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
-"video_out_dxr3: Read the README.dxr3 for details.\n"
-msgstr ""
-
-#: src/dxr3/video_out_dxr3.c:1369
-#, c-format
-msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
-msgstr ""
-
-#: src/input/input_cdda.c:1605
-#, c-format
-msgid "%s: can't connect to %s:%d\n"
-msgstr ""
-
-#: src/input/input_cdda.c:1652
-#, c-format
-msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
-msgstr ""
-
-#: src/input/input_cdda.c:1657
-#, c-format
-msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
-msgstr ""
-
-#: src/input/input_cdda.c:2766
-msgid "CD Digital Audio (aka. CDDA)"
-msgstr ""
-
-#: src/input/input_cdda.c:2818
-msgid "device used for CD audio"
-msgstr ""
-
-#: src/input/input_cdda.c:2819
-msgid ""
-"The path to the device, usually a CD or DVD drive, which you intend to use "
-"for playing audio CDs."
-msgstr ""
-
-#: src/input/input_cdda.c:2825
-msgid "query CDDB"
-msgstr ""
-
-#: src/input/input_cdda.c:2825
-msgid ""
-"Enables CDDB queries, which will give you convenient title and track names "
-"for your audio CDs.\n"
-"Keep in mind that, unless you use your own private CDDB, this information is "
-"retrieved from an internet server which might collect a profile of your "
-"listening habits."
-msgstr ""
-
-#: src/input/input_cdda.c:2833
-msgid "CDDB server name"
-msgstr ""
-
-#: src/input/input_cdda.c:2833
-msgid ""
-"The CDDB server used to retrieve the title and track information from.\n"
-"This setting is security critical, because the sever will receive "
-"information about your listening habits and could answer the queries with "
-"malicious replies. Be sure to enter a server you can trust."
-msgstr ""
-
-#: src/input/input_cdda.c:2841
-msgid "CDDB server port"
-msgstr ""
-
-#: src/input/input_cdda.c:2841
-msgid "The server port used to retrieve the title and track information from."
-msgstr ""
-
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr ""
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
-msgid "slow down disc drive to this speed factor"
-msgstr ""
-
-#: src/input/input_cdda.c:2856
-msgid ""
-"Since some CD or DVD drives make some really loud noises because of the fast "
-"disc rotation, xine will try to slow them down. With standard CD or DVD "
-"playback, the high datarates that require the fast rotation are not needed, "
-"so the slowdown should not affect playback performance.\n"
-"A value of zero here will disable the slowdown."
-msgstr ""
-
-#: src/input/input_dvb.c:904
-#, c-format
-msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
-msgstr ""
-
-#: src/input/input_dvb.c:910
-#, c-format
-msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
-#, c-format
-msgid "input_dvb: tuner_set_channel failed\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2788
-#, c-format
-msgid "input_dvb: DVB GUI %s\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
-#, c-format
-msgid "input_dvb: cannot open dvb device\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2817
-#, c-format
-msgid "input_dvb: channel %d out of range, defaulting to 0\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2828
-#, c-format
-msgid "input_dvb: searching for channel %s\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2851
-#, c-format
-msgid "input_dvb: exact match for %s not found: trying partial matches\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2858
-#, c-format
-msgid "input_dvb: found matching channel %s\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2871
-#, c-format
-msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2877
-#, c-format
-msgid ""
-"input_dvb: invalid channel specification, defaulting to last viewed "
-"channel.\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2885
-#, c-format
-msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2897
-#, c-format
-msgid ""
-"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
-"S)\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2917
-#, c-format
-msgid ""
-"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
-"T)\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2940
-#, c-format
-msgid ""
-"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
-"C)\n"
-msgstr ""
-
-#: src/input/input_dvb.c:2966
-#, c-format
-msgid ""
-"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
-"A)\n"
-msgstr ""
-
-#: src/input/input_dvb.c:3001
-#, c-format
-msgid "input_dvb: cannot open dvr device '%s'\n"
-msgstr ""
-
-#: src/input/input_dvb.c:3024
-#, c-format
-msgid "input_dvb: cannot create EPG updater thread\n"
-msgstr ""
-
-#: src/input/input_dvb.c:3086
-msgid "use DVB 'center cutout' (zoom)"
-msgstr ""
-
-#: src/input/input_dvb.c:3087
-msgid ""
-"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
-"frame."
-msgstr ""
-
-#: src/input/input_dvb.c:3180
-msgid "DVB (Digital TV) input plugin"
-msgstr ""
-
-#: src/input/input_dvb.c:3311
-msgid "Remember last DVB channel watched"
-msgstr ""
-
-#: src/input/input_dvb.c:3312
-msgid ""
-"On autoplay, xine will remember and switch to the channel indicated in media."
-"dvb.last_channel. "
-msgstr ""
-
-#: src/input/input_dvb.c:3319
-msgid "Last DVB channel viewed"
-msgstr ""
-
-#: src/input/input_dvb.c:3320
-msgid "If enabled xine will remember and switch to this channel. "
-msgstr ""
-
-#: src/input/input_dvb.c:3325
-msgid "Number of seconds until tuning times out."
-msgstr ""
-
-#: src/input/input_dvb.c:3326
-msgid ""
-"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
-"get a lock. Minimum is 5 seconds."
-msgstr ""
-
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr ""
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
-msgid "Enable the DVB GUI"
-msgstr ""
-
-#: src/input/input_dvb.c:3342
-msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
-msgstr ""
-
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
-
-#: src/input/input_dvb.c:3349
-msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
-msgstr ""
-
-#: src/input/input_dvd.c:596
-#, c-format
-msgid "input_dvd: values of \\beta will give rise to dom!\n"
-msgstr ""
-
-#: src/input/input_dvd.c:615
-#, c-format
-msgid "input_dvd: Error getting next block from DVD (%s)\n"
-msgstr ""
-
-#: src/input/input_dvd.c:1505
-#, c-format
-msgid "input_dvd: Error opening DVD device\n"
-msgstr ""
-
-#: src/input/input_dvd.c:1792
-msgid "device used for DVD playback"
-msgstr ""
-
-#: src/input/input_dvd.c:1793
-msgid ""
-"The path to the device, usually a DVD drive, which you intend to use for "
-"playing DVDs."
-msgstr ""
-
-#: src/input/input_dvd.c:1811
-msgid "raw device set up for DVD access"
-msgstr ""
-
-#: src/input/input_dvd.c:1812
-msgid ""
-"If this points to a raw device connected to your DVD device, xine will use "
-"the raw device for playback. This has the advantage of being slightly faster "
-"and of bypassing the block device cache, which avoids throwing away "
-"important cache content by keeping DVD data cached. Using the block device "
-"cache for DVDs is useless, because almost all DVD data will be used only "
-"once.\n"
-"See the documentation on raw device setup (man raw) for further information."
-msgstr ""
-
-#: src/input/input_dvd.c:1825
-msgid "CSS decryption method"
-msgstr ""
-
-#: src/input/input_dvd.c:1826
-msgid ""
-"Selects the decryption method libdvdcss will use to descramble copy "
-"protected DVDs. Try the various methods, if you have problems playing "
-"scrambled DVDs."
-msgstr ""
-
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr ""
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
-msgid "region the DVD player claims to be in (1 to 8)"
-msgstr ""
-
-#: src/input/input_dvd.c:1857
-msgid ""
-"This only needs to be changed if your DVD jumps to a screen complaining "
-"about a wrong region code. It has nothing to do with the region code set in "
-"DVD drives, this is purely software."
-msgstr ""
-
-#: src/input/input_dvd.c:1863
-msgid "default language for DVD playback"
-msgstr ""
-
-#: src/input/input_dvd.c:1864
-msgid ""
-"xine tries to use this language as a default for DVD playback. As far as the "
-"DVD supports it, menus and audio tracks will be presented in this language.\n"
-"The value must be a two character ISO639 language code."
-msgstr ""
-
-#: src/input/input_dvd.c:1870
-msgid "read-ahead caching"
-msgstr ""
-
-#: src/input/input_dvd.c:1871
-msgid ""
-"xine can use a read ahead cache for DVD drive access.\n"
-"This may lead to jerky playback on slow drives, but it improves the impact "
-"of the DVD layer change on faster drives."
-msgstr ""
-
-#: src/input/input_dvd.c:1877
-msgid "unit for the skip action"
-msgstr ""
-
-#: src/input/input_dvd.c:1878
-msgid ""
-"You can configure the behaviour when issuing a skip command (using the skip "
-"buttons for example). The individual values mean:\n"
-"\n"
-"skip program\n"
-"will skip a DVD program, which is a navigational unit similar to the index "
-"marks on an audio CD; this is the normal behaviour for DVD players\n"
-"\n"
-"skip part\n"
-"will skip a DVD part, which is a structural unit similar to the track marks "
-"on an audio CD; parts usually coincide with programs, but parts can be "
-"larger than programs\n"
-"\n"
-"skip title\n"
-"will skip a DVD title, which is a structural unit representing entire "
-"features on the DVD"
-msgstr ""
-
-#: src/input/input_dvd.c:1893
-msgid "unit for seeking"
-msgstr ""
-
-#: src/input/input_dvd.c:1894
-msgid ""
-"You can configure the domain spanned by the seek slider. The individual "
-"values mean:\n"
-"\n"
-"seek in program chain\n"
-"seeking will span an entire DVD program chain, which is a navigational unit "
-"representing the entire video stream of the current feature\n"
-"\n"
-"seek in program\n"
-"seeking will span a DVD program, which is a navigational unit representing a "
-"chapter of the current feature"
-msgstr ""
-
-#: src/input/input_dvd.c:1905
-msgid "play mode when title/chapter is given"
-msgstr ""
-
-#: src/input/input_dvd.c:1906
-msgid ""
-"You can configure the behaviour when playing a dvd from a given title/"
-"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
-"\n"
-"entire dvd\n"
-"play the entire dvd starting on the specified position.\n"
-"\n"
-"one chapter\n"
-"play just the specified title/chapter and then stop"
-msgstr ""
-
-#: src/input/input_file.c:211
-#, c-format
-msgid "input_file: read error (%s)\n"
-msgstr ""
-
-#: src/input/input_file.c:371
-#, c-format
-msgid "input_file: Permission denied: >%s<\n"
-msgstr ""
-
-#: src/input/input_file.c:375
-#, c-format
-msgid "input_file: File not found: >%s<\n"
-msgstr ""
-
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
-#, c-format
-msgid "input_file: File empty: >%s<\n"
-msgstr ""
-
-#: src/input/input_file.c:635
-msgid "file input plugin"
-msgstr ""
-
-#: src/input/input_file.c:991
-msgid "file browsing start location"
-msgstr ""
-
-#: src/input/input_file.c:992
-msgid "The browser to select the file to play will start at this location."
-msgstr ""
-
-#: src/input/input_file.c:999
-msgid "list hidden files"
-msgstr ""
-
-#: src/input/input_file.c:1000
-msgid ""
-"If enabled, the browser to select the file to play will also show hidden "
-"files."
-msgstr ""
-
-#: src/input/input_gnome_vfs.c:223
-msgid "gnome-vfs input plugin as shipped with xine"
-msgstr ""
-
-#: src/input/input_http.c:180
-#, c-format
-msgid "input_http: gethostbyname(%s) failed: %s\n"
-msgstr ""
-
-#: src/input/input_http.c:415 src/input/input_http.c:1015
-#, c-format
-msgid "input_http: read error %d\n"
-msgstr ""
-
-#: src/input/input_http.c:656
-msgid "Connecting HTTP server..."
-msgstr ""
-
-#: src/input/input_http.c:848
-#, c-format
-msgid "input_http: invalid http answer\n"
-msgstr ""
-
-#: src/input/input_http.c:854
-#, c-format
-msgid "input_http: 3xx redirection: >%d %s<\n"
-msgstr ""
-
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
-#, c-format
-msgid "input_http: http status not 2xx: >%d %s<\n"
-msgstr ""
-
-#: src/input/input_http.c:882
-#, c-format
-msgid "input_http: content length = %<PRIdMAX> bytes\n"
-msgstr ""
-
-#: src/input/input_http.c:969
-#, c-format
-msgid "input_http: buffer exhausted after %d bytes."
-msgstr ""
-
-#: src/input/input_http.c:1070
-msgid "http input plugin"
-msgstr ""
-
-#: src/input/input_http.c:1132
-msgid "HTTP proxy host"
-msgstr ""
-
-#: src/input/input_http.c:1132
-msgid "The hostname of the HTTP proxy."
-msgstr ""
-
-#: src/input/input_http.c:1136
-msgid "HTTP proxy port"
-msgstr ""
-
-#: src/input/input_http.c:1136
-msgid "The port number of the HTTP proxy."
-msgstr ""
-
-#: src/input/input_http.c:1146
-msgid "HTTP proxy username"
-msgstr ""
-
-#: src/input/input_http.c:1147
-msgid "The user name for the HTTP proxy."
-msgstr ""
-
-#: src/input/input_http.c:1150
-msgid "HTTP proxy password"
-msgstr ""
-
-#: src/input/input_http.c:1151
-msgid "The password for the HTTP proxy."
-msgstr ""
-
-#: src/input/input_http.c:1154
-msgid "Domains for which to ignore the HTTP proxy"
-msgstr ""
-
-#: src/input/input_http.c:1155
-msgid ""
-"A comma-separated list of domain names for which the proxy is to be "
-"ignored.\n"
-"If a domain name is prefixed with '=' then it is treated as a host name only "
-"(full match required)."
-msgstr ""
-
-#: src/input/input_mms.c:448
-msgid "mms streaming input plugin"
-msgstr ""
-
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
-msgid "network bandwidth"
-msgstr ""
-
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
-msgid ""
-"Specify the bandwidth of your internet connection here. This will be used "
-"when streaming servers offer different versions with different bandwidth "
-"requirements of the same stream."
-msgstr ""
-
-#: src/input/input_mms.c:494
-msgid "MMS protocol"
-msgstr ""
-
-#: src/input/input_mms.c:495
-msgid ""
-"Select the protocol to encapsulate MMS.\n"
-"TCP is better but you may need HTTP behind a firewall."
-msgstr ""
-
-#: src/input/input_net.c:121 src/input/input_net.c:150
-#, c-format
-msgid "input_net: socket(): %s\n"
-msgstr ""
-
-#: src/input/input_net.c:136 src/input/input_net.c:161
-#, c-format
-msgid "input_net: connect(): %s\n"
-msgstr ""
-
-#: src/input/input_net.c:179 src/input/input_net.c:221
-#, c-format
-msgid "input_net: unable to resolve '%s'.\n"
-msgstr ""
-
-#: src/input/input_net.c:192 src/input/input_net.c:238
-#, c-format
-msgid "input_net: unable to connect to '%s'.\n"
-msgstr ""
-
-#: src/input/input_net.c:523
-msgid "net input plugin as shipped with xine"
-msgstr ""
-
-#: src/input/input_pnm.c:274
-msgid "pnm streaming input plugin"
-msgstr ""
-
-#: src/input/input_pvr.c:581
-#, c-format
-msgid "input_pvr: error creating pvr file (%s)\n"
-msgstr ""
-
-#: src/input/input_pvr.c:738
-#, c-format
-msgid "input_pvr: error opening pvr file (%s)\n"
-msgstr ""
-
-#: src/input/input_pvr.c:814
-#, c-format
-msgid "input_pvr: read error (%s)\n"
-msgstr ""
-
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
-#, c-format
-msgid "input_pvr: error opening device %s\n"
-msgstr ""
-
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
-#, c-format
-msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
-msgstr ""
-
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
-#, c-format
-msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
-msgstr ""
-
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr ""
-
-#: src/input/input_pvr.c:1562
-msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
-msgstr ""
-
-#: src/input/input_pvr.c:1563
-msgid "The path to the device of your WinTV card."
-msgstr ""
-
-#: src/input/input_rtp.c:183
-#, c-format
-msgid "xine_socket_cloexec(): %s.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:193
-msgid "IP address specified is multicast\n"
-msgstr ""
-
-#: src/input/input_rtp.c:202
-#, c-format
-msgid "setsockopt(SO_RCVBUF): %s.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:210
-#, c-format
-msgid "setsockopt(SO_REUSEADDR): %s.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:217
-#, c-format
-msgid "bind(): %s.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:237
-#, c-format
-msgid "Can't find address for iface %s:%s\n"
-msgstr ""
-
-#: src/input/input_rtp.c:255
-#, c-format
-msgid "setsockopt(IP_ADD_MEMBERSHIP) failed (multicast kernel?): %s.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:277
-#, c-format
-msgid "unable to resolve '%s'.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:287
-#, c-format
-msgid "unable to bind to '%s'.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:336
-#, c-format
-msgid "recv(): %s.\n"
-msgstr ""
-
-#: src/input/input_rtp.c:642
-msgid "RTP: stopping reading thread...\n"
-msgstr ""
-
-#: src/input/input_rtp.c:645
-msgid "RTP: reading thread terminated\n"
-msgstr ""
-
-#: src/input/input_rtp.c:660
-#, c-format
-msgid "Opening >filename:%s port:%d interface:%s<\n"
-msgstr ""
-
-#: src/input/input_rtp.c:677
-#, c-format
-msgid "input_rtp: can't create new thread (%s)\n"
-msgstr ""
-
-#: src/input/input_rtp.c:781
-msgid "RTP and UDP input plugin as shipped with xine"
-msgstr ""
-
-#: src/input/input_rtsp.c:295
-msgid "rtsp streaming input plugin"
-msgstr ""
-
-#: src/input/input_smb.c:165
-msgid "CIFS/SMB input plugin based on libsmbclient"
-msgstr ""
-
-#: src/input/input_stdin_fifo.c:173
-#, c-format
-msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
-msgstr ""
-
-#: src/input/input_stdin_fifo.c:261
-#, c-format
-msgid "stdin: failed to open '%s'\n"
-msgstr ""
-
-#: src/input/input_stdin_fifo.c:359
-msgid "stdin streaming input plugin"
-msgstr ""
-
-#: src/input/input_v4l.c:385
-msgid "Buffer underrun..."
-msgstr ""
-
-#: src/input/input_v4l.c:389
-msgid "Buffer overrun..."
-msgstr ""
-
-#: src/input/input_v4l.c:392
-msgid "Adjusting..."
-msgstr ""
-
-#: src/input/input_v4l.c:671
-#, c-format
-msgid "Tuner name not found\n"
-msgstr ""
-
-#: src/input/input_v4l.c:1870
-msgid "v4l tv input plugin"
-msgstr ""
-
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr ""
-
-#: src/input/input_v4l.c:1906
-msgid "v4l video device"
-msgstr ""
-
-#: src/input/input_v4l.c:1907
-msgid "The path to your Video4Linux video device."
-msgstr ""
-
-#: src/input/input_v4l.c:1912
-msgid "v4l ALSA audio input device"
-msgstr ""
-
-#: src/input/input_v4l.c:1913
-msgid ""
-"The name of the audio device which corresponds to your Video4Linux video "
-"device."
-msgstr ""
-
-#: src/input/input_v4l.c:1918
-msgid "v4l TV standard"
-msgstr ""
-
-#: src/input/input_v4l.c:1919
-msgid ""
-"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
-"SECAM. "
-msgstr ""
-
-#: src/input/input_v4l.c:1944
-msgid "v4l radio device"
-msgstr ""
-
-#: src/input/input_v4l.c:1945
-msgid "The path to your Video4Linux radio device."
-msgstr ""
-
-#: src/input/input_vcd.c:848
-#, c-format
-msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
-msgstr ""
-
-#: src/input/input_vcd.c:854
-#, c-format
-msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
-msgstr ""
-
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr ""
-
-#: src/input/input_vcd.c:979
-#, c-format
-msgid "unable to open %s: %s.\n"
-msgstr ""
-
-#: src/input/input_vcd.c:1040
-#, c-format
-msgid "input_vcd: unable to open %s: %s.\n"
-msgstr ""
-
-#: src/input/input_vcd.c:1088
-msgid "device used for VCD playback"
-msgstr ""
-
-#: src/input/input_vcd.c:1089
-msgid ""
-"The path to the device, usually a CD or DVD drive, you intend to play your "
-"VideoCDs with."
-msgstr ""
-
-#: src/input/librtsp/rtsp.c:438
-#, c-format
-msgid "rtsp: bad mrl: %s\n"
-msgstr ""
-
-#: src/input/librtsp/rtsp.c:496
-#, c-format
-msgid "rtsp: failed to connect to '%s'\n"
-msgstr ""
-
-#: src/input/librtsp/rtsp_session.c:111
-#, c-format
-msgid "rtsp_session: failed to connect to server %s\n"
-msgstr ""
-
-#: src/input/librtsp/rtsp_session.c:145
-#, c-format
-msgid "rtsp_session: session can not be established.\n"
-msgstr ""
-
-#: src/input/librtsp/rtsp_session.c:157
-#, c-format
-msgid ""
-"rtsp_session: rtsp server returned overly-large headers, session can not be "
-"established.\n"
-msgstr ""
-
-#: src/input/librtsp/rtsp_session.c:168
-#, c-format
-msgid "rtsp_session: rtsp server type '%s' not supported yet. sorry.\n"
-msgstr ""
-
-#: src/input/media_helper.c:148
-#, c-format
-msgid "input_dvd: Device %s failed to open during eject calls\n"
-msgstr ""
-
-#: src/input/mms.c:561
-msgid "Connecting MMS server (over tcp)..."
-msgstr ""
-
-#: src/input/mmsh.c:197
-#, c-format
-msgid "libmmsh: send error\n"
-msgstr ""
-
-#: src/input/mmsh.c:242
-#, c-format
-msgid "libmmsh: bad response format\n"
-msgstr ""
-
-#: src/input/mmsh.c:248
-#, c-format
-msgid "libmmsh: 3xx redirection not implemented: >%d %s<\n"
-msgstr ""
-
-#: src/input/mmsh.c:255
-#, c-format
-msgid "libmmsh: http status not 2xx: >%d %s<\n"
-msgstr ""
-
-#: src/input/mmsh.c:263
-#, c-format
-msgid "libmmsh: Location redirection not implemented\n"
-msgstr ""
-
-#: src/input/mmsh.c:472
-msgid "Connecting MMS server (over http)..."
-msgstr ""
-
-#: src/input/mmsh.c:653
-#, c-format
-msgid "invalid url\n"
-msgstr ""
-
-#: src/input/mmsh.c:658
-#, c-format
-msgid "unsupported protocol\n"
-msgstr ""
-
-#: src/input/net_buf_ctrl.c:103
-msgid "Buffering..."
-msgstr ""
-
-#: src/input/pnm.c:619
-#, c-format
-msgid ""
-"input_pnm: got message from server while reading stream:\n"
-"%s\n"
-msgstr ""
-
-#: src/input/pnm.c:753
-#, c-format
-msgid "input_pnm: failed to connect '%s'\n"
-msgstr ""
-
-#: src/input/pnm.c:764
-#, c-format
-msgid "input_pnm: failed to set up stream\n"
-msgstr ""
-
-#: src/input/vcd/vcdio.c:222
-msgid "SEEK_CUR not implemented for non-zero offset"
-msgstr ""
-
-#: src/input/vcd/vcdio.c:250
-msgid "SEEK_END not implemented yet."
-msgstr ""
-
-#: src/input/vcd/vcdio.c:253
-msgid "seek not implemented yet for"
-msgstr ""
-
-#: src/input/vcd/vcdplayer.c:94
-msgid "bad item type"
-msgstr ""
-
-#: src/input/vcd/vcdplayer.c:458
-msgid "bad entry number"
-msgstr ""
-
-#: src/input/vcd/vcdplayer.c:491
-msgid "bad segment number"
-msgstr ""
-
-#: src/input/vcd/vcdplayer.c:501
-msgid "Error in getting current segment number"
-msgstr ""
-
-#: src/input/vcd/vcdplayer.c:589
-msgid "Should have converted this above"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:191
-msgid "failed to find a device with a VCD"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:326
-msgid "was passed a null class parameter"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:988
-msgid "Invalid current entry type"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
-msgid "selection has no RETURN entry"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1142
-msgid "DEFAULT selected, but PBC is not on."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1147
-msgid "selection has no NEXT entry"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1155
-msgid "selection has no PREVIOUS entry"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1162
-msgid "Unknown event type: "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
-msgid "The above message had unknown vcdimager log level"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1840
-msgid "VCD default type to use on autoplay"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1841
-msgid ""
-"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
-"vcd:///dev/dvd:"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1851
-msgid "CD-ROM drive used for VCD when none given"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1852
-msgid ""
-"What to use if no drive specified. If the setting is empty, xine will scan "
-"for CD drives."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1862
-msgid "VCD position slider range"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1863
-msgid ""
-"range that the stream playback position slider represents playing a VCD."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1871
-msgid "VCD read-ahead caching?"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1872
-msgid "Class may lead to jerky playback on low-end machines."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1882
-msgid "automatically advance VCD track/entry"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1883
-msgid ""
-"If enabled, we should automatically advance to the next entry or track. Used "
-"only when playback control (PBC) is disabled."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1892
-msgid "show 'rejected' VCD LIDs"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1893
-msgid ""
-"Some playback list IDs (LIDs) are marked not showable, but you can see them "
-"in the MRL list if this is set. Rejected entries are marked with an asterisk "
-"(*) appended to the MRL."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1904
-msgid "VCD format string for display banner"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1905
-msgid ""
-"VCD format used in the GUI Title. Similar to the Unix date command. Format "
-"specifiers start with a percent sign. Specifiers are:\n"
-" %A : The album information\n"
-" %C : The VCD volume count - the number of CD's in the collection.\n"
-" %c : The VCD volume num - the number of the CD in the collection.\n"
-" %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n"
-" %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, ...\n"
-" %L : The playlist ID prefixed with \" LID\" if it exists\n"
-" %N : The current number of the above - a decimal number\n"
-" %P : The publisher ID\n"
-" %p : The preparer ID\n"
-" %S : If we are in a segment (menu), the kind of segment\n"
-" %T : The track number\n"
-" %V : The volume set ID\n"
-" %v : The volume ID\n"
-" A number between 1 and the volume count.\n"
-" %% : a %\n"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1930
-msgid "VCD format string for stream comment field"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1931
-msgid ""
-"VCD format used in the GUI Title. Similar to the Unix date command. Format "
-"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
-"%N, %P, %p, %S, %T, %V, %v, and %%.\n"
-"See the help for the title_format for the meanings of these."
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1943
-msgid "VCD debug flag mask"
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1944
-msgid ""
-"For tracking down bugs in the VCD plugin. Mask values are:\n"
-" 1: Meta information\n"
-" 2: input (keyboard/mouse) events\n"
-" 4: MRL parsing\n"
-" 8: Calls from external routines\n"
-" 16: routine calls\n"
-" 32: LSN changes\n"
-" 64: Playback control\n"
-" 128: Debugging from CDIO\n"
-" 256: Seeks to set location\n"
-" 512: Seeks to find current location\n"
-"1024: Still-frame\n"
-"2048: Debugging from VCDINFO\n"
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
-#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:830
-msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr ""
-
-#: src/liba52/xine_a52_decoder.c:838
-msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
-msgstr ""
-
-#: src/libfaad/xine_faad_decoder.c:136
-#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr ""
-
-#: src/libfaad/xine_faad_decoder.c:145
-#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr ""
-
-#: src/libfaad/xine_faad_decoder.c:156
-#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr ""
-
-#: src/libmusepack/xine_musepack_decoder.c:287
-#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr ""
-
-#: src/libmusepack/xine_musepack_decoder.c:298
-#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr ""
-
-#: src/libmusepack/xine_musepack_decoder.c:379
-#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr ""
-
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr ""
-
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr ""
-
-#: src/libreal/real_common.c:139
-msgid "path to RealPlayer codecs"
-msgstr ""
-
-#: src/libreal/real_common.c:140
-msgid ""
-"If you have RealPlayer installed, specify the path to its codec directory "
-"here. You can easily find the codec directory by looking for a file named "
-"\"drvc.so\" in it. If xine can find the RealPlayer codecs, it will use them "
-"to decode RealPlayer content for you. Consult the xine FAQ for more "
-"information on how to install the codecs."
-msgstr ""
-
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-
-#: src/libreal/xine_real_audio_decoder.c:134
-#, c-format
-msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
-msgstr ""
-
-#: src/libreal/xine_real_audio_decoder.c:292
-#, c-format
-msgid "libareal: decoder init failed, error code: 0x%x\n"
-msgstr ""
-
-#: src/libreal/xine_real_audio_decoder.c:306
-#, c-format
-msgid "libareal: decoder flavor setup failed, error code: 0x%x\n"
-msgstr ""
-
-#: src/libreal/xine_real_audio_decoder.c:343
-#, c-format
-msgid "libareal: oups, real can do more than 2 channels ?\n"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:199
-msgid "display closed captions in MPEG-2 streams"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:200
-msgid ""
-"Closed Captions are subtitles mostly meant to help the hearing impaired."
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:207
-msgid "closed-captioning foreground/background scheme"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:208
-msgid "Choose your favourite rendering of the closed captions."
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:214
-msgid "standard closed captioning font"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:215
-msgid "Choose the font for standard closed captions text."
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:221
-msgid "italic closed captioning font"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:222
-msgid "Choose the font for italic closed captions text."
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:228
-msgid "closed captioning font size"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:229
-msgid "Choose the font size for closed captions text."
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:233
-msgid "center-adjust closed captions"
-msgstr ""
-
-#: src/libspucc/xine_cc_decoder.c:234
-msgid ""
-"When enabled, closed captions will be positioned by the center of the "
-"individual lines."
-msgstr ""
-
-#: src/libspucmml/xine_cmml_decoder.c:468
-msgid "font for external subtitles"
-msgstr ""
-
-#: src/libspucmml/xine_cmml_decoder.c:474
-msgid "subtitle vertical offset (relative window size)"
-msgstr ""
-
-#: src/libspucmml/xine_cmml_decoder.c:517
-msgid "encoding of subtitles"
-msgstr ""
-
-#: src/libsputext/demux_sputext.c:1480
-msgid "default duration of subtitle display in seconds"
-msgstr ""
-
-#: src/libsputext/demux_sputext.c:1481
-msgid ""
-"Some subtitle formats do not explicitly give a duration for each subtitle. "
-"For these, you can set a default duration here. Setting to zero will result "
-"in the subtitle being shown until the next one takes over."
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1144
-msgid "subtitle size"
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1145
-msgid ""
-"You can adjust the subtitle size here. The setting will be evaluated "
-"relative to the window size."
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1151
-msgid "subtitle vertical offset"
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1152
-msgid ""
-"You can adjust the vertical position of the subtitle. The setting will be "
-"evaluated relative to the window size."
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
-msgid "font for subtitles"
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1159
-msgid "A font from the xine font directory to be used for the subtitle text."
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1168
-msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1174
-msgid "whether to use a freetype font"
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1181
-msgid "encoding of the subtitles"
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1182
-msgid ""
-"The encoding of the subtitle text in the stream. This setting is used to "
-"render non-ASCII characters correctly. If non-ASCII characters are not "
-"displayed as you expect, ask the creator of the subtitles what encoding was "
-"used."
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1190
-msgid "use unscaled OSD if possible"
-msgstr ""
-
-#: src/libsputext/xine_sputext_decoder.c:1191
-msgid ""
-"The unscaled OSD will be rendered independently of the video frame and will "
-"always be sharp, even if the video is magnified. This will look better, but "
-"does not work with all graphics hardware. The alternative is the scaled OSD, "
-"which will become blurry, if you enlarge a low resolution video to "
-"fullscreen, but it works with all graphics cards."
-msgstr ""
-
-#: src/libw32dll/common.c:17
-msgid "path to Win32 codecs"
-msgstr ""
-
-#: src/libw32dll/common.c:18
-msgid ""
-"If you have the Windows or Apple Quicktime codec packs installed, specify "
-"the path the codec directory here. If xine can find the Windows or Apple "
-"Quicktime codecs, it will use them to decode various Windows Media and "
-"Quicktime streams for you. Consult the xine FAQ for more information on how "
-"to install the codecs."
-msgstr ""
-
-#: src/libw32dll/w32codec.c:589
-#, c-format
-msgid "w32codec: ICOpen failed! unknown codec %08lx / wrong parameters?\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:598
-#, c-format
-msgid "w32codec: ICDecompressGetFormat (%.4s %08lx/%d) failed: Error %ld\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:631
-#, c-format
-msgid "w32codec: ICDecompressQuery failed: Error %ld\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:642
-#, c-format
-msgid "w32codec: ICDecompressBegin failed: Error %ld\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:688
-#, c-format
-msgid ""
-"w32codec: DS_VideoDecoder failed! unknown codec %08lx / wrong parameters?\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:699
-#, c-format
-msgid ""
-"w32codec: DMO_VideoDecoder failed! unknown codec %08lx / wrong parameters?\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:819 src/libw32dll/w32codec.c:1488
-#, c-format
-msgid "w32codec: decoder failed to start. Is '%s' installed?\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:1222
-#, c-format
-msgid "w32codec: (ACM_Decoder) Unappropriate audio format\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:1225
-#, c-format
-msgid "w32codec: (ACM_Decoder) acmStreamOpen error %d\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:1244
-#, c-format
-msgid "w32codec: Error initializing DirectShow Audio\n"
-msgstr ""
-
-#: src/libw32dll/w32codec.c:1262
-#, c-format
-msgid "w32codec: Error initializing DMO Audio\n"
-msgstr ""
-
-#: src/libxinevdec/bitplane.c:1274
-#, c-format
-msgid "bitplane: error doing ByteRun1 decompression\n"
-msgstr ""
-
-#: src/libxinevdec/bitplane.c:1325
-#, c-format
-msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
-msgstr ""
-
-#: src/libxinevdec/bitplane.c:1332
-#, c-format
-msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
-msgstr ""
-
-#: src/libxinevdec/bitplane.c:1382
-#, c-format
-msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
-msgstr ""
-
-#: src/libxinevdec/bitplane.c:1388
-#, c-format
-msgid "bitplane: This anim-type is not supported at the moment\n"
-msgstr ""
-
-#: src/post/audio/stretch.c:267
-msgid ""
-"This filter will perform a time stretch, playing the stream faster or slower "
-"by a factor. Pitch is optionally preserved, so it is possible, for example, "
-"to use it to watch a movie in less time than it was originally shot.\n"
-msgstr ""
-
-#: src/post/audio/upmix.c:138
-msgid ""
-"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
-"Parameters\n"
-" cut_off_freq\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-msgstr ""
-
-#: src/post/audio/upmix_mono.c:110
-msgid ""
-"This filter will upmix a mono stream to stereo, by duplicating channels. "
-"Alternatively, one may use this plugin to listen just one channel of a given "
-"stream.\n"
-msgstr ""
-
-#: src/post/audio/upmix_mono.c:148
-#, c-format
-msgid ": upmixing Mono to Stereo.\n"
-msgstr ""
-
-#: src/post/audio/upmix_mono.c:153
-#, c-format
-msgid ": upmixing a single channel from original %d channel stream.\n"
-msgid_plural ": upmixing a single channel from original %d channels stream.\n"
-msgstr[0] ""
-msgstr[1] ""
-
-#: src/post/audio/upmix_mono.c:158
-#, c-format
-msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
-msgstr ""
-
-#: src/post/audio/volnorm.c:151
-msgid ""
-"Normalizes audio by maximizing the volume without distorting the sound.\n"
-"\n"
-"Parameters:\n"
-" method: 1: use a single sample to smooth the variations via the standard "
-"weighted mean over past samples (default); 2: use several samples to smooth "
-"the variations via the standard weighted mean over past samples.\n"
-msgstr ""
-
-#: src/post/deinterlace/xine_plugin.c:211
-msgid ""
-"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
-"This plugin aims to provide deinterlacing mechanisms comparable to high "
-"quality progressive DVD players and so called line-doublers, for use with "
-"computer monitors, projectors and other progressive display devices.\n"
-"\n"
-"Parameters\n"
-"\n"
-" Method: Select deinterlacing method/algorithm to use, see below for "
-"explanation of each method.\n"
-"\n"
-" Enabled: Enable/disable the plugin.\n"
-"\n"
-" Pulldown_error_wait: Ensures that the telecine pattern has been locked for "
-"this many frames before changing to filmmode.\n"
-"\n"
-" Pulldown: Choose the 2-3 pulldown detection algorithm. 24 FPS films that "
-"have being converted to NTSC can be detected and intelligently reconstructed "
-"to their original (non-interlaced) frames.\n"
-"\n"
-" Framerate_mode: Selecting 'full' will deinterlace every field to an unique "
-"frame for television quality and beyond. This feature will effetively double "
-"the frame rate, improving smoothness. Note, however, that full 59.94 FPS is "
-"not possible with plain 2.4 Linux kernel (that use a timer interrupt "
-"frequency of 100Hz). Newer RedHat and 2.6 kernels use higher HZ settings "
-"(512 and 1000, respectively) and should work fine.\n"
-"\n"
-" Judder_correction: Once 2-3 pulldown is enabled and a film material is "
-"detected, it is possible to reduce the frame rate to original rate used (24 "
-"FPS). This will make the frames evenly spaced in time, matching the speed "
-"they were shot and eliminating the judder effect.\n"
-"\n"
-" Use_progressive_frame_flag: Well mastered MPEG2 streams uses a flag to "
-"indicate progressive material. This setting control whether we trust this "
-"flag or not (some rare and buggy mpeg2 streams set it wrong).\n"
-"\n"
-" Chroma_filter: DVD/MPEG2 use an interlaced image format that has a very "
-"poor vertical chroma resolution. Upsampling the chroma for purposes of "
-"deinterlacing may cause some artifacts to occur (eg. colour stripes). Use "
-"this option to blur the chroma vertically after deinterlacing to remove the "
-"artifacts. Warning: cpu intensive.\n"
-"\n"
-" Cheap_mode: This will skip the expensive YV12->YUY2 image conversion, "
-"tricking tvtime/dscaler routines like if they were still handling YUY2 "
-"images. Of course, this is not correct, not all pixels will be evaluated by "
-"the algorithms to decide the regions to deinterlace and chroma will be "
-"processed separately. Nevertheless, it allows people with not so fast "
-"systems to try deinterlace algorithms, in a tradeoff between quality and cpu "
-"usage.\n"
-"\n"
-"* Uses several algorithms from tvtime and dscaler projects.\n"
-"Deinterlacing methods: (Not all methods are available for all platforms)\n"
-"\n"
-msgstr ""
-
-#: src/post/deinterlace/xine_plugin.c:335
-#, c-format
-msgid "tvtime: No deinterlacing methods available, exiting.\n"
-msgstr ""
-
-#: src/post/goom/xine_goom.c:206
-msgid "frames per second to generate"
-msgstr ""
-
-#: src/post/goom/xine_goom.c:207
-msgid ""
-"With more frames per second, the animation will get smoother and faster, but "
-"will also require more CPU power."
-msgstr ""
-
-#: src/post/goom/xine_goom.c:212
-msgid "goom image width"
-msgstr ""
-
-#: src/post/goom/xine_goom.c:213
-msgid "The width in pixels of the image to be generated."
-msgstr ""
-
-#: src/post/goom/xine_goom.c:217
-msgid "goom image height"
-msgstr ""
-
-#: src/post/goom/xine_goom.c:218
-msgid "The height in pixels of the image to be generated."
-msgstr ""
-
-#: src/post/goom/xine_goom.c:224
-msgid "colour space conversion method"
-msgstr ""
-
-#: src/post/goom/xine_goom.c:225
-msgid ""
-"You can choose the colour space conversion method used by goom.\n"
-"The available selections should be self-explaining."
-msgstr ""
-
-#: src/post/mosaico/mosaico.c:274
-msgid ""
-"Mosaico does simple picture in picture effects.\n"
-"\n"
-"Parameters\n"
-" pip_num: the number of the picture slot the following settings apply to\n"
-" x: the x coordinate of the left upper corner of the picture\n"
-" y: the y coordinate of the left upper corner of the picture\n"
-" w: the width of the picture\n"
-" h: the height of the picture\n"
-msgstr ""
-
-#: src/post/mosaico/switch.c:228
-msgid ""
-"Switch can be used for fast switching between multiple inputs.\n"
-"\n"
-"Parameters\n"
-" select: the number of the input which will be passed to the output\n"
-msgstr ""
-
-#: src/post/planar/boxblur.c:105
-msgid ""
-"Box blur does a simple blurring of the image.\n"
-"\n"
-"Parameters\n"
-" Radius: size of the filter\n"
-" Power: how often the filter should be applied\n"
-"\n"
-"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
-msgstr ""
-
-#: src/post/planar/denoise3d.c:138
-msgid ""
-"This filter aims to reduce image noise producing smooth images and making "
-"still images really still (This should enhance compressibility.). It can be "
-"given from 0 to 3 parameters. If you omit a parameter, a reasonable value "
-"will be inferred.\n"
-"\n"
-"Parameters\n"
-" Luma: Spatial luma strength (default = 4)\n"
-" Chroma: Spatial chroma strength (default = 3)\n"
-" Time: Temporal strength (default = 6)\n"
-"\n"
-"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-msgstr ""
-
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
-msgstr ""
-
-#: src/post/planar/eq2.c:361
-msgid ""
-"Alternative software equalizer that uses lookup tables (very slow), allowing "
-"gamma correction in addition to simple brightness, contrast and saturation "
-"adjustment.\n"
-"Note that it uses the same MMX optimized code as 'eq' if all gamma values "
-"are 1.0.\n"
-"\n"
-"Parameters\n"
-" gamma\n"
-" brightness\n"
-" contrast\n"
-" saturation\n"
-" rgamma (gamma for the red component)\n"
-" ggamma (gamma for the green component)\n"
-" bgamma (gamma for the blue component)\n"
-"\n"
-"Value ranges are 0.1 - 10 for gammas, -2 - 2 for contrast (negative values "
-"result in a negative image), -1 - 1 for brightness and 0 - 3 for "
-"saturation.\n"
-"\n"
-"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-msgstr ""
-
-#: src/post/planar/expand.c:251
-msgid ""
-"The expand plugin is meant to take frames of arbitrary aspect ratio and "
-"converts them to a different aspect (4:3 by default) by adding black bars on "
-"the top and bottom of the frame. This allows us to shift overlays down into "
-"the black area so they don't cover the image.\n"
-"\n"
-"Parameters (FIXME: better help)\n"
-" Enable_automatic_shift: Enable automatic overlay shifting\n"
-" Overlay_y_offset: Manually shift the overlay vertically\n"
-" aspect: The target aspect ratio (default 4:3)\n"
-" Centre_cut_out_mode: extracts 4:3 image contained in 16:9 frame\n"
-"\n"
-msgstr ""
-
-#: src/post/planar/noise.c:406
-msgid ""
-"Adds random noise to the video.\n"
-"\n"
-"Parameters:\n"
-" luma_strength: strength of noise added to luma channel (0-100, default: "
-"8)\n"
-" chroma_strength: strength of noise added to chroma channel (0-100, "
-"default: 5)\n"
-" quality: quality level of the noise. fixed: constant noise pattern; "
-"temporal: noise pattern changes between frames; averaged temporal: smoother "
-"noise pattern that changes between frames. (default: averaged temporal)\n"
-" type: Type of noise: uniform or gaussian. (default: gaussian)\n"
-" pattern: Mix random noise with a (semi)regular pattern. (default: False)\n"
-"\n"
-"* mplayer's noise (C) Michael Niedermayer\n"
-msgstr ""
-
-#: src/post/planar/pp.c:123
-msgid ""
-"FFmpeg libpostprocess plugin.\n"
-"\n"
-"Parameters\n"
-"\n"
-msgstr ""
-
-#: src/post/planar/pp.c:129
-msgid ""
-"\n"
-"* libpostprocess (C) Michael Niedermayer\n"
-msgstr ""
-
-#: src/post/planar/unsharp.c:215
-msgid ""
-"Unsharp mask / gaussian blur\n"
-"It is possible to set the width and height of the matrix, odd sized in both "
-"directions (min = 3x3, max = 13x11 or 11x13, usually something between 3x3 "
-"and 7x7) and the relative amount of sharpness/blur to add to the image (a "
-"sane range should be -1.5 - 1.5).\n"
-"\n"
-"Parameters\n"
-"\n"
-" Luma_matrix_width: Width of the matrix (must be odd)\n"
-"\n"
-" Luma_matrix_height: Height of the matrix (must be odd)\n"
-"\n"
-" Luma_amount: Relative amount of sharpness/blur (=0 disable, <0 blur, >0 "
-"sharpen)\n"
-"\n"
-" Chroma_matrix_width: Width of the matrix (must be odd)\n"
-"\n"
-" Chroma_matrix_height: Height of the matrix (must be odd)\n"
-"\n"
-" Chroma_amount: Relative amount of sharpness/blur (=0 disable, <0 blur, >0 "
-"sharpen)\n"
-"\n"
-"\n"
-"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
-msgstr ""
-
-#: src/video_out/video_out_aa.c:308
-msgid "xine video output plugin using the ascii-art library"
-msgstr ""
-
-#: src/video_out/video_out_caca.c:321
-msgid "xine video output plugin using the Color AsCii Art library"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1341
-msgid "video layer buffering mode"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1342
-msgid ""
-"Select the buffering mode of the output layer. Double or triple buffering "
-"give a smoother playback, but consume more video memory."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1349
-msgid "wait for vertical retrace"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1350
-msgid ""
-"Enable synchronizing the update of the video image to the repainting of the "
-"entire screen (\"vertical retrace\")."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1357
-msgid "enable video colour key"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1358
-msgid ""
-"Enable using a colour key to tell the graphics card where to overlay the "
-"video image."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1364
-msgid "video colour key"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
-msgid ""
-"The colour key is used to tell the graphics card where to overlay the video "
-"image. Try different values, if you experience windows becoming transparent."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1374
-msgid "flicker filtering"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1375
-msgid "Enable Flicker Filetring for a smooth output on an interlaced display."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1382
-msgid "field parity"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1383
-msgid ""
-"For an interlaced display, enable controlling the field parity (\"none"
-"\"=disabled)."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1516
-#, c-format
-msgid "video_out_directfb: using hardware subpicture acceleration.\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1530
-#, c-format
-msgid "video_out_directfb: layer supports video output.\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1539
-#, c-format
-msgid "video_out_directfb: layer doesn't support YV12!\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1546
-#, c-format
-msgid "video_out_directfb: layer doesn't support YUY2!\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1557
-#, c-format
-msgid ""
-"video_out_directfb:need at least DirectFB 0.9.25 to play on this layer!\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1592
-#, c-format
-msgid "video_out_directfb: layer doesn't support buffermode %d!\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1598
-#, c-format
-msgid "video_out_directfb: layer doesn't support options 0x%08x!\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1692
-#, c-format
-msgid "video_out_directfb: using hardware accelerated image scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1704
-#, c-format
-msgid ""
-"video_out_directfb: image scaling with deinterlacing is hardware "
-"accelerated.\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1782
-msgid "video layer id (auto: -1)"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1783
-msgid "Select the video output layer by its id."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
-#, c-format
-msgid "video_out_directfb: using display layer #%d.\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:1888
-msgid "xine video output plugin using DirectFB."
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:2007
-#, c-format
-msgid "video_out_directfb: no usable display layer was found!\n"
-msgstr ""
-
-#: src/video_out/video_out_directfb.c:2096
-msgid "xine video output plugin using DirectFB under XDirectFB."
-msgstr ""
-
-#: src/video_out/video_out_directx.c:1288
-msgid "HW acceleration level"
-msgstr ""
-
-#: src/video_out/video_out_directx.c:1289
-msgid ""
-"Possible values (default full):\n"
-"\n"
-"full: full acceleration\n"
-"scale: disable colorspace conversion (HW scaling only)\n"
-"none: disable all acceleration"
-msgstr ""
-
-#: src/video_out/video_out_directx.c:1322
-msgid "xine video output plugin for win32 using directx"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:758
-#, c-format
-msgid ""
-"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
-" Check 'fbset -i' or try 'fbset -depth 16'.\n"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
-msgid "framebuffer device name"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
-msgid ""
-"Specifies the file name for the framebuffer device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:956
-#, c-format
-msgid ""
-"WARNING: video_out_fb: 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"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:967
-#, c-format
-msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
-" do not support screen panning (used for frame flips).\n"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:1036
-#, c-format
-msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
-" a depth of 16 bpp is recommended!\n"
-"\n"
-msgstr ""
-
-#: src/video_out/video_out_fb.c:1067
-msgid "Xine video output plugin using the Linux frame buffer device"
-msgstr ""
-
-#: src/video_out/video_out_none.c:277
-msgid "xine video output plugin which displays nothing"
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:1889
-msgid "OpenGL renderer"
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:1890
-msgid ""
-"The OpenGL plugin provides several render modules:\n"
-"\n"
-"2D_Tex_Fragprog\n"
-"This module downloads the images as YUV 2D textures and renders a textured "
-"slice\n"
-"using fragment programs for reconstructing RGB.\n"
-"This is the best and fastest method on modern graphics cards.\n"
-"\n"
-"2D_Tex\n"
-"This module downloads the images as 2D textures and renders a textured "
-"slice.\n"
-"2D_Tex_Tiled\n"
-"This module downloads the images as multiple 2D textures and renders a "
-"textured\n"
-"slice. Thus this works with smaller maximum texture sizes as well.\n"
-"Image_Pipeline\n"
-"This module uses glDraw() to render the images.\n"
-"Only accelerated on few drivers.\n"
-"Does not interpolate on scaling.\n"
-"\n"
-"Cylinder\n"
-"Shows images on a rotating cylinder. Nice effect :)\n"
-"\n"
-"Environment_Mapped_Torus\n"
-"Show images reflected in a spinning torus. Way cool =)"
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:1912
-msgid "OpenGL minimum framerate"
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:1913
-msgid ""
-"Minimum framerate for animated render routines.\n"
-"Ignored for static render routines.\n"
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
-#: src/video_out/xv_common.h:46
-msgid "enable double buffering"
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:1919
-msgid ""
-"For OpenGL double buffering does not only remove tearing artifacts,\n"
-"it also reduces flickering a lot.\n"
-"It should not have any performance impact."
-msgstr ""
-
-#: src/video_out/video_out_opengl.c:2012
-msgid "xine video output plugin using the OpenGL 3D graphics API"
-msgstr ""
-
-#: src/video_out/video_out_pgx32.c:187
-#, c-format
-msgid "video_out_pgx32: Error: can't grab DGA drawable for video window\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx32.c:206 src/video_out/video_out_pgx32.c:220
-#, c-format
-msgid "video_out_pgx32: Error: ioctl failed, bad device (%s)\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx32.c:213
-#, c-format
-msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:278
-#, c-format
-msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:296
-#, c-format
-msgid "video_out_pgx64: Error: can't open framebuffer device '%s'\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:303
-#, c-format
-msgid ""
-"video_out_pgx64: Error: ioctl failed (VIS_GETIDENTIFIER), bad device (%s)\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:316
-#, c-format
-msgid ""
-"video_out_pgx64: Error: '%s' is not a xvr100/pgx64/pgx24 framebuffer device\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:337
-#, c-format
-msgid ""
-"video_out_pgx64: Error: video overlay on this screen is already in use\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:352
-#, c-format
-msgid "video_out_pgx64: Error: unable to set window properties\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:808
-#, c-format
-msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:840
-#, c-format
-msgid "video_out_pgx64: Error: insuffucient video memory\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:856
-#, c-format
-msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1394
-#, c-format
-msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
-msgid "video overlay colour key"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1462
-msgid ""
-"The colour key is used to tell the graphics card where it can overlay the "
-"video image. Try using different values if you see the video showing through "
-"other windows."
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1469
-msgid "enable chroma keying"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1470
-msgid ""
-"Draw OSD graphics on top of the overlay colour key rather than blend them "
-"into each frame."
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1473
-msgid "enable multi-buffering"
-msgstr ""
-
-#: src/video_out/video_out_pgx64.c:1474
-msgid ""
-"Multi buffering increases performance at the expense of using more graphics "
-"memory."
-msgstr ""
-
-#: src/video_out/video_out_sdl.c:490
-msgid "use hardware acceleration if available"
-msgstr ""
-
-#: src/video_out/video_out_sdl.c:491
-msgid ""
-"When your system supports it, hardware acceleration provided by your "
-"graphics hardware will be used. This might not work, so you can disable it, "
-"if things go wrong."
-msgstr ""
-
-#: src/video_out/video_out_sdl.c:537
-#, c-format
-msgid "sdl has to emulate a 16 bit surfaces, that will slow things down.\n"
-msgstr ""
-
-#: src/video_out/video_out_sdl.c:574
-#, c-format
-msgid "video_out_sdl: fullscreen mode is NOT supported\n"
-msgstr ""
-
-#: src/video_out/video_out_sdl.c:585
-msgid "xine video output plugin using the Simple Direct Media Layer"
-msgstr ""
-
-#: src/video_out/video_out_stk.c:452
-msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
-msgid "red intensity"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
-msgid "The intensity of the red colour components."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1011
-msgid "green intensity"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1011
-msgid "The intensity of the green colour components."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1016
-msgid "blue intensity"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1016
-msgid "The intensity of the blue colour components."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
-msgid ""
-"Double buffering will synchronize the update of the video image to the "
-"repainting of the entire screen (\"vertical retrace\"). This eliminates "
-"flickering and tearing artifacts, but will use more graphics memory."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1076
-#, c-format
-msgid "video_out_vidix: adaptor supports the yuy2 format\n"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1087
-#, c-format
-msgid "video_out_vidix: adaptor supports the yv12 format\n"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1103
-#, c-format
-msgid "video_out_vidix: You have wrong version of VIDIX library\n"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1111
-#, c-format
-msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1124
-#, c-format
-msgid "video_out_vidix: using driver: %s by %s\n"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1171
-msgid "video overlay colour key red component"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1178
-msgid "video overlay colour key green component"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1185
-msgid "video overlay colour key blue component"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1217
-msgid "xine video output plugin using libvidix for x11"
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1299
-msgid "xine video output plugin using libvidix for linux frame buffer"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:150
-#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:159
-#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:170
-#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
-#, c-format
-msgid ""
-"\n"
-"\n"
-"WARNING: current display depth is %d. For better performance\n"
-"a depth of 16 bpp is recommended!\n"
-"\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:1114
-#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:1213
-#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
-msgid "xine video output plugin using the MIT X shared memory extension"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:270
-#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:279
-#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:298
-#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1358
-#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
-#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
-#, c-format
-msgid "%s: no available ports of type \"%s\", defaulting...\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1409
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1417
-#, c-format
-msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
-msgid "enable vblank sync"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
-msgid ""
-"This option will synchronize the update of the video image to the repainting "
-"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
-"tearing artifacts. On nvidia cards one may also need to run \"nvidia-settings"
-"\" and choose which display device to sync to under the XVideo Settings tab"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
-msgid "xine video output plugin using the MIT X video extension"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:332
-#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1650
-#, c-format
-msgid "video_out_xvmc: XvMC extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1748
-#, c-format
-msgid ""
-"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
-"port.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1757
-#, c-format
-msgid ""
-"video_out_xvmc: using Xv port %ld from adaptor %s\n"
-" for hardware colour space conversion and scaling\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1762
-#, c-format
-msgid " idct and motion compensation acceleration \n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1764
-#, c-format
-msgid " motion compensation acceleration only\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1766
-#, c-format
-msgid " no XvMC support \n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1767
-#, c-format
-msgid " With Overlay = %d; UnsignedIntra = %d.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2691
-msgid "Make XvMC allocate more frames for better buffering."
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2692
-msgid ""
-"Some XvMC implementations allow more than 8 frames.\n"
-"This option, when turned on, makes the driver try to\n"
-"allocate 15 frames. A must for unichrome and live VDR.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2698
-msgid "Unichrome cpu save"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2699
-msgid ""
-"Saves CPU time by sleeping while decoder works.\n"
-"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
-"Experimental.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2705
-msgid "Fix buggy NVIDIA XvMC subpicture colours"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2706
-msgid ""
-"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
-"look blue and vice versa. This option provides a workaround.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2711
-msgid "Use bob as accelerated deinterlace method."
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2712
-msgid ""
-"When interlacing is enabled for hardware accelerated frames,\n"
-"alternate between top and bottom field at double the frame rate.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2718
-msgid "Don't use bob deinterlacing for progressive frames."
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2719
-msgid ""
-"Progressive frames don't need deinterlacing, so disabling it on\n"
-"demand should result in a better picture.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2725
-msgid "Don't use bob deinterlacing while a scaled OSD is active."
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2726
-msgid ""
-"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
-"on demand should result in a better OSD picture.\n"
-msgstr ""
-
-#: src/video_out/x11osd.c:274 src/video_out/xcbosd.c:268
-#, c-format
-msgid "x11osd: XShape extension not available. unscaled overlay disabled.\n"
-msgstr ""
-
-#: src/video_out/x11osd.c:287 src/video_out/xcbosd.c:281
-#, c-format
-msgid "x11osd: error creating window. unscaled overlay disabled.\n"
-msgstr ""
-
-#: src/video_out/x11osd.c:295 src/video_out/x11osd.c:336
-#: src/video_out/xcbosd.c:291
-#, c-format
-msgid "x11osd: error creating pixmap. unscaled overlay disabled.\n"
-msgstr ""
-
-#: src/video_out/x11osd.c:346 src/video_out/xcbosd.c:330
-#, c-format
-msgid "x11osd: unscaled overlay created (%s mode).\n"
-msgstr ""
-
-#: src/video_out/xv_common.h:30
-msgid "autopaint colour key"
-msgstr ""
-
-#: src/video_out/xv_common.h:31
-msgid "Make Xv autopaint its colour key."
-msgstr ""
-
-#: src/video_out/xv_common.h:34
-msgid "bilinear scaling mode"
-msgstr ""
-
-#: src/video_out/xv_common.h:35
-msgid ""
-"Selects the bilinear scaling mode for Permedia cards. The individual values "
-"are:\n"
-"\n"
-"Permedia 2\n"
-"0 - disable bilinear filtering\n"
-"1 - enable bilinear filtering\n"
-"\n"
-"Permedia 3\n"
-"0 - disable bilinear filtering\n"
-"1 - horizontal linear filtering\n"
-"2 - enable full bilinear filtering"
-msgstr ""
-
-#: src/video_out/xv_common.h:53
-msgid "Xv port number"
-msgstr ""
-
-#: src/video_out/xv_common.h:54
-msgid "Selects the Xv port number to use (0 to autodetect)."
-msgstr ""
-
-#: src/video_out/xv_common.h:57
-msgid "pitch alignment workaround"
-msgstr ""
-
-#: src/video_out/xv_common.h:58
-msgid "Some buggy video drivers need a workaround to function properly."
-msgstr ""
-
-#: src/video_out/xv_common.h:73
-msgid "video display method preference"
-msgstr ""
-
-#: src/video_out/xv_common.h:74
-msgid ""
-"Selects which video output method is preferred. Detection is done using the "
-"reported Xv adaptor names.\n"
-"(Only applies when auto-detecting which Xv port to use.)"
-msgstr ""
-
-#: src/video_out/xv_common.h:81
-msgid "bicubic filtering"
-msgstr ""
-
-#: src/video_out/xv_common.h:82
-msgid ""
-"This option controls bicubic filtering of the video image. It may be used "
-"instead of, or as well as, xine's deinterlacers."
-msgstr ""
-
-#: src/xine-engine/alphablend.c:2150
-msgid "disable exact alpha blending of overlays"
-msgstr ""
-
-#: src/xine-engine/alphablend.c:2151
-msgid ""
-"If you experience a performance impact when an On Screen Display or other "
-"overlays like DVD subtitles are active, then you might want to enable this "
-"option.\n"
-"The result is that alpha blending of overlays is less accurate than before, "
-"but the CPU usage will be decreased as well."
-msgstr ""
-
-#: src/xine-engine/audio_decoder.c:370
-#, c-format
-msgid "audio_decoder: no plugin available to handle '%s'\n"
-msgstr ""
-
-#: src/xine-engine/audio_decoder.c:387
-#, c-format
-msgid "audio_decoder: error, unknown buffer type: %08x\n"
-msgstr ""
-
-#: src/xine-engine/audio_decoder.c:491
-msgid "number of audio buffers"
-msgstr ""
-
-#: src/xine-engine/audio_decoder.c:492
-msgid ""
-"The number of audio buffers (each is 8k in size) xine uses in its internal "
-"queue. Higher values mean smoother playback for unreliable inputs, but also "
-"increased latency and memory consumption."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:1115
-#, c-format
-msgid ""
-"audio_out: delay calculation impossible with an unavailable audio device\n"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:1254
-#, c-format
-msgid "write to sound card failed. Assuming the device was unplugged.\n"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:1434
-#, c-format
-msgid "8 bits not supported by driver, converting to 16 bits.\n"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:1442
-#, c-format
-msgid "mono not supported by driver, converting to stereo.\n"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:1448
-#, c-format
-msgid "stereo not supported by driver, converting to mono.\n"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2130
-msgid "method to sync audio and video"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2131
-msgid ""
-"When playing audio and video, there are at least two clocks involved: The "
-"system clock, to which video frames are synchronized and the clock in your "
-"sound hardware, which determines the speed of the audio playback. These "
-"clocks are never ticking at the same speed except for some rare cases where "
-"they are physically identical. In general, the two clocks will run drift "
-"after some time, for which xine offers two ways to keep audio and video "
-"synchronized:\n"
-"\n"
-"metronom feedback\n"
-"This is the standard method, which applies a countereffecting video drift, "
-"as soon as the audio drift has accumulated over a threshold.\n"
-"\n"
-"resample\n"
-"For some video hardware, which is limited to a fixed frame rate (like the "
-"DXR3 or other decoder cards) the above does not work, because the video "
-"cannot drift. Therefore we resample the audio stream to make it longer or "
-"shorter to compensate the audio drift error. This does not work for digital "
-"passthrough, where audio data is passed to an external decoder in digital "
-"form."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2159
-msgid "enable resampling"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2160
-msgid ""
-"When the sample rate of the decoded audio does not match the capabilities of "
-"your sound hardware, an adaptation called \"resampling\" is required. Here "
-"you can select, whether resampling is enabled, disabled or used "
-"automatically when necessary."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2167
-msgid "always resample to this rate (0 to disable)"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2168
-msgid ""
-"Some audio drivers do not correctly announce the capabilities of the audio "
-"hardware. By setting a value other than zero here, you can force the audio "
-"stream to be resampled to the given rate."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2177
-msgid "offset for digital passthrough"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2178
-msgid ""
-"If you use an external surround decoder and audio is ahead or behind video, "
-"you can enter a fixed offset here to compensate.\n"
-"The unit of the value is one PTS tick, which is the 90000th part of a second."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2187
-msgid "play audio even on slow/fast speeds"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2188
-msgid ""
-"If you enable this option, the audio will be heard even when playback speed "
-"is different than 1X. Of course, it will sound distorted (lower/higher "
-"pitch). If want to experiment preserving the pitch you may try the 'stretch' "
-"audio post plugin instead."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2261
-msgid "startup audio volume"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2262
-msgid "The overall audio volume set at xine startup."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2265
-msgid "restore volume level at startup"
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2266
-msgid "If disabled, xine will not modify any mixer settings at startup."
-msgstr ""
-
-#: src/xine-engine/audio_out.c:2298
-#, c-format
-msgid "audio_out: sorry, this should not happen. please restart xine.\n"
-msgstr ""
-
-#: src/xine-engine/buffer.c:64
-#, c-format
-msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:939
-#, c-format
-msgid "The current config file has been modified by a newer version of xine."
-msgstr ""
-
-#: src/xine-engine/configfile.c:992
-#, c-format
-msgid "Loaded configuration from file '%s'\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:997
-#, c-format
-msgid "Failed to load configuration from file '%s': %s\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:1052
-#, c-format
-msgid "configfile: WARNING: backing up configfile to %s failed\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:1053
-#, c-format
-msgid "configfile: WARNING: your configuration will not be saved\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:1153
-#, c-format
-msgid "configfile: WARNING: writing configuration to %s failed\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:1154
-#, c-format
-msgid "configfile: WARNING: removing possibly broken config file %s\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:1155
-#, c-format
-msgid "configfile: WARNING: you should check the backup file %s\n"
-msgstr ""
-
-#: src/xine-engine/configfile.c:1290
-#, c-format
-msgid "configfile: entry '%s' mustn't be modified from MRL\n"
-msgstr ""
-
-#: src/xine-engine/info_helper.c:228
-#, c-format
-msgid "info_helper: can't find out current locale character set\n"
-msgstr ""
-
-#: src/xine-engine/info_helper.c:242
-#, c-format
-msgid ""
-"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
-msgstr ""
-
-#: src/xine-engine/input_cache.c:170
-#, c-format
-msgid ": open() function should never be called\n"
-msgstr ""
-
-#: src/xine-engine/input_cache.c:353
-#, c-format
-msgid ": input plugin not defined!\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
-#, c-format
-msgid "input_rip: reading of saved data failed: %s\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:153
-#, c-format
-msgid "input_rip: reading by input plugin failed\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
-#, c-format
-msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:182
-#, c-format
-msgid "input_rip: open() function should never be called\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
-#, c-format
-msgid "input_rip: seeking failed\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
-#, c-format
-msgid "input_rip: seeking failed: %s\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:396
-#, c-format
-msgid "input_rip: %<PRIdMAX> bytes dropped\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:560
-#, c-format
-msgid "input_rip: input plugin not defined!\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:566
-#, c-format
-msgid ""
-"input_rip: target directory wasn't specified, please fill out the option "
-"'media.capture.save_dir'\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:568
-msgid ""
-"The stream save feature is disabled until you set media.capture.save_dir in "
-"the configuration."
-msgstr ""
-
-#: src/xine-engine/input_rip.c:575
-#, c-format
-msgid "input_rip: ripping/caching of this source is not permitted!\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:577
-msgid ""
-"xine is not allowed to save from this source. (possibly copyrighted "
-"material?)"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:583
-#, c-format
-msgid "input_rip: file name not given!\n"
-msgstr ""
-
-#: src/xine-engine/input_rip.c:625
-#, c-format
-msgid "input_rip: error opening file %s: %s\n"
-msgstr ""
-
-#: src/xine-engine/io_helper.c:252
-#, c-format
-msgid "io_helper: waiting abandoned\n"
-msgstr ""
-
-#: src/xine-engine/io_helper.c:259
-#, c-format
-msgid "io_helper: waiting failed: %s\n"
-msgstr ""
-
-#: src/xine-engine/io_helper.c:314
-msgid "failed to get status of socket"
-msgstr ""
-
-#: src/xine-engine/io_helper.c:388
-#, c-format
-msgid "io_helper: Permission denied\n"
-msgstr ""
-
-#: src/xine-engine/io_helper.c:392
-#, c-format
-msgid "io_helper: File not found\n"
-msgstr ""
-
-#: src/xine-engine/io_helper.c:396
-#, c-format
-msgid "io_helper: Connection Refused\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:208
-#, c-format
-msgid "map_decoder_list: no space for decoder, skipped.\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:322
-#, c-format
-msgid ""
-"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:384
-#, c-format
-msgid "priority for %s decoder"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:389
-msgid ""
-"The priority provides a ranking in case some media can be handled by more "
-"than one decoder.\n"
-"A priority of 0 enables the decoder's default priority."
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:417
-#, c-format
-msgid ""
-"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
-"use the default priority.\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:434
-#, c-format
-msgid ""
-"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
-"the default priority.\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:490
-#, c-format
-msgid "load_plugins: plugin %s found\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:493
-#, c-format
-msgid "load_plugins: static plugin found\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:500
-#, c-format
-msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:503
-#, c-format
-msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:520
-#, c-format
-msgid "load_plugins: unknown plugin type %d in %s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:524
-#, c-format
-msgid "load_plugins: unknown statically linked plugin type %d\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:579
-#, c-format
-msgid "load_plugins: unable to stat %s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:620
-#, c-format
-msgid ""
-"load_plugins: cannot open plugin lib %s:\n"
-"%s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:635
-#, c-format
-msgid ""
-"load_plugins: can't get plugin info from %s:\n"
-"%s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:653
-#, c-format
-msgid "load_plugins: skipping unreadable plugin directory %s.\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:702
-#, c-format
-msgid ""
-"load_plugins: cannot (stage 2) open plugin lib %s:\n"
-"%s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:728
-#, c-format
-msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1092
-#, c-format
-msgid "failed to save catalogue cache: %s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1099
-#, c-format
-msgid "failed to replace catalogue cache: %s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1105
-#, c-format
-msgid "failed to remove new catalogue cache: %s\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1362
-#, c-format
-msgid "load_plugins: unknown content detection strategy %d\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1472
-#, c-format
-msgid "load_plugins: using demuxer '%s'\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
-#, c-format
-msgid "load_plugins: failed to load audio output plugin <%s>\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:1848
-#, c-format
-msgid ""
-"load_plugins: audio output auto-probing didn't find any usable audio "
-"driver.\n"
-msgstr ""
-
-#: src/xine-engine/load_plugins.c:2152
-#, c-format
-msgid ""
-"load_plugins: cannot unload plugin lib %s:\n"
-"%s\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:738
-#, c-format
-msgid "font '%s-%d' already loaded, weird.\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:750
-#, c-format
-msgid "font '%s' loading failed (%d < %d)\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:760
-#, c-format
-msgid "wrong version for font '%s'. expected %d found %d.\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:855
-#, c-format
-msgid "osd: error matching font %s with FontConfig"
-msgstr ""
-
-#: src/xine-engine/osd.c:869
-#, c-format
-msgid "osd: error loading font %s with FontConfig"
-msgstr ""
-
-#: src/xine-engine/osd.c:872
-#, c-format
-msgid "osd: error looking up font %s with FontConfig"
-msgstr ""
-
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:902
-#, c-format
-msgid "osd: error setting font size (no scalable font?)\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1017
-#, c-format
-msgid ""
-"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
-"skipping\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1073
-#, c-format
-msgid "osd: can't find out current locale character set\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1083
-#, c-format
-msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
-#, c-format
-msgid "osd: font isn't defined\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1177
-#, c-format
-msgid "osd: error loading glyph\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1183
-#, c-format
-msgid "osd: error in rendering glyph\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1343
-#, c-format
-msgid "osd: error loading glyph %i\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1350
-#, c-format
-msgid "osd: error in rendering\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:1596
-msgid "palette (foreground-border-background) to use for subtitles and OSD"
-msgstr ""
-
-#: src/xine-engine/osd.c:1597
-msgid ""
-"The palette for on-screen-display and some subtitle formats that do not "
-"specify any colouring themselves. The palettes are listed in the form: "
-"foreground-border-background."
-msgstr ""
-
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
-msgstr ""
-
-#: src/xine-engine/video_decoder.c:136
-msgid ""
-"when watching live tv a discontinuity happens for example about every 26.5 "
-"hours due to a pts wrap.\n"
-"flushing the decoder at that time causes decoding errors for images after "
-"the pts wrap.\n"
-"to avoid the decoding errors, decoder flush at discontinuity should be "
-"disabled.\n"
-"\n"
-"WARNING: as the flush was introduced to fix some issues when playing DVD "
-"still images, it is\n"
-"likely that these issues may reappear in case they haven't been fixed "
-"differently meanwhile.\n"
-msgstr ""
-
-#: src/xine-engine/video_decoder.c:419
-#, c-format
-msgid "video_decoder: no plugin available to handle '%s'\n"
-msgstr ""
-
-#: src/xine-engine/video_decoder.c:498
-#, c-format
-msgid "video_decoder: error, unknown buffer type: %08x\n"
-msgstr ""
-
-#: src/xine-engine/video_decoder.c:536
-msgid "number of video buffers"
-msgstr ""
-
-#: src/xine-engine/video_decoder.c:537
-msgid ""
-"The number of video buffers (each is 8k in size) xine uses in its internal "
-"queue. Higher values mean smoother playback for unreliable inputs, but also "
-"increased latency and memory consumption."
-msgstr ""
-
-#: src/xine-engine/video_out.c:670
-#, c-format
-msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
-msgstr ""
-
-#: src/xine-engine/video_out.c:845
-#, c-format
-msgid ""
-"video_out: throwing away image with pts %<PRId64> because it's too old "
-"(diff : %<PRId64>).\n"
-msgstr ""
-
-#: src/xine-engine/video_out.c:872
-#, c-format
-msgid "video_out: just discarded first frame after seek\n"
-msgstr ""
-
-#: src/xine-engine/video_out.c:1172
-msgid "disable decoder flush from video out"
-msgstr ""
-
-#: src/xine-engine/video_out.c:1173
-msgid ""
-"video out causes a decoder flush when video out runs out of frames for "
-"displaying,\n"
-"because the decoder hasn't deliverd new frames for quite a while.\n"
-"flushing the decoder causes decoding errors for images decoded after the "
-"flush.\n"
-"to avoid the decoding errors, decoder flush at video out should be "
-"disabled.\n"
-"\n"
-"WARNING: as the flush was introduced to fix some issues when playing DVD "
-"still images, it is\n"
-"likely that these issues may reappear in case they haven't been fixed "
-"differently meanwhile.\n"
-msgstr ""
-
-#: src/xine-engine/video_out.c:1860
-msgid "default number of video frames"
-msgstr ""
-
-#: src/xine-engine/video_out.c:1861
-msgid ""
-"The default number of video frames to request from xine video out driver. "
-"Some drivers will override this setting with their own values."
-msgstr ""
-
-#: src/xine-engine/video_out.c:1918
-msgid "percentage of skipped frames to tolerate"
-msgstr ""
-
-#: src/xine-engine/video_out.c:1919
-msgid ""
-"When more than this percentage of frames are not shown, because they were "
-"not decoded in time, xine sends a notification."
-msgstr ""
-
-#: src/xine-engine/video_out.c:1924
-msgid "percentage of discarded frames to tolerate"
-msgstr ""
-
-#: src/xine-engine/video_out.c:1925
-msgid ""
-"When more than this percentage of frames are not shown, because they were "
-"not scheduled for display in time, xine sends a notification."
-msgstr ""
-
-#: src/xine-engine/video_out.c:1961
-#, c-format
-msgid "video_out: sorry, this should not happen. please restart xine.\n"
-msgstr ""
-
-#: src/xine-engine/vo_scale.c:391
-msgid "horizontal image position in the output window"
-msgstr ""
-
-#: src/xine-engine/vo_scale.c:392
-msgid ""
-"If the video window's horizontal size is bigger than the actual image to "
-"show, you can adjust the position where the image will be placed.\n"
-"The position is given as a percentage, so a value of 50 means \"in the middle"
-"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
-msgstr ""
-
-#: src/xine-engine/vo_scale.c:399
-msgid "vertical image position in the output window"
-msgstr ""
-
-#: src/xine-engine/vo_scale.c:400
-msgid ""
-"If the video window's vertical size is bigger than the actual image to show, "
-"you can adjust the position where the image will be placed.\n"
-"The position is given as a percentage, so a value of 50 means \"in the middle"
-"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
-msgstr ""
-
-#: src/xine-engine/vo_scale.c:407
-msgid "disable all video scaling"
-msgstr ""
-
-#: src/xine-engine/vo_scale.c:408
-msgid ""
-"If you want the video image to be always shown at its original resolution, "
-"you can disable all image scaling here.\n"
-"This of course means that the image will no longer adapt to the size of the "
-"video window and that videos with a pixel aspect ratio other than 1:1, like "
-"anamorphic DVDs, will be shown distorted. But on the other hand, with some "
-"video output drivers like XShm, where the image scaling is not hardware "
-"accelerated, this can dramatically reduce CPU usage."
-msgstr ""
-
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
-#, c-format
-msgid "xine: error while parsing mrl\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:875
-#, c-format
-msgid "xine: found input plugin : %s\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:891
-#, c-format
-msgid "xine: input plugin cannot open MRL [%s]\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:900
-#, c-format
-msgid "xine: cannot find input plugin for MRL [%s]\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:926
-#, c-format
-msgid "xine: specified demuxer %s failed to start\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:963
-#, c-format
-msgid "xine: join rip input plugin\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:970
-#, c-format
-msgid "xine: error opening rip input plugin instance\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1001
-#, c-format
-msgid "xine: last_probed demuxer %s failed to start\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1030
-#, c-format
-msgid "ignoring video\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1043
-#, c-format
-msgid "ignoring audio\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1056
-#, c-format
-msgid "ignoring subpicture\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1069
-#, c-format
-msgid "input cache plugin disabled\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1142
-#, c-format
-msgid "subtitle mrl opened '%s'\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1146
-#, c-format
-msgid "xine: error opening subtitle mrl\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1178
-#, c-format
-msgid "xine: error while parsing MRL\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1185
-#, c-format
-msgid "xine: changing option '%s' from MRL isn't permitted\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1216
-#, c-format
-msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1226
-#, c-format
-msgid "xine: couldn't find demux for >%s<\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1242
-#, c-format
-msgid "xine: found demuxer plugin: %s\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1263
-#, c-format
-msgid "xine: demuxer is already done. that was fast!\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1265
-#, c-format
-msgid "xine: demuxer failed to start\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1331
-#, c-format
-msgid "xine_play: no demux available\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1402
-#, c-format
-msgid "xine_play: demux failed to start\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1684
-#, c-format
-msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1689
-msgid "The specified save_dir might be a security risk."
-msgstr ""
-
-#: src/xine-engine/xine.c:1720
-#, c-format
-msgid "xine: locale not supported by C library\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1729
-msgid "media format detection strategy"
-msgstr ""
-
-#: src/xine-engine/xine.c:1730
-msgid ""
-"xine offers various methods to detect the media format of input to play. The "
-"individual values are:\n"
-"\n"
-"default\n"
-"First try to detect by content, then by file name extension.\n"
-"\n"
-"reverse\n"
-"First try to detect by file name extension, then by content.\n"
-"\n"
-"content\n"
-"Detect by content only.\n"
-"\n"
-"extension\n"
-"Detect by file name extension only.\n"
-msgstr ""
-
-#: src/xine-engine/xine.c:1748
-msgid "directory for saving streams"
-msgstr ""
-
-#: src/xine-engine/xine.c:1749
-msgid ""
-"When using the stream save feature, files will be written only into this "
-"directory.\n"
-"This setting is security critical, because when changed to a different "
-"directory, xine can be used to fill files in it with arbitrary content. So "
-"you should be careful that the directory you specify is robust against any "
-"content in any file."
-msgstr ""
-
-#: src/xine-engine/xine.c:1760
-msgid "allow implicit changes to the configuration (e.g. by MRL)"
-msgstr ""
-
-#: src/xine-engine/xine.c:1761
-msgid ""
-"If enabled, you allow xine to change your configuration without explicit "
-"actions from your side. For example configuration changes demanded by MRLs "
-"or embedded into playlist will be executed.\n"
-"This setting is security critcal, because xine can receive MRLs or playlists "
-"from untrusted remote sources. If you allow them to arbitrarily change your "
-"configuration, you might end with a totally messed up xine."
-msgstr ""
-
-#: src/xine-engine/xine.c:1775
-msgid "Timeout for network stream reading (in seconds)"
-msgstr ""
-
-#: src/xine-engine/xine.c:1776
-msgid ""
-"Specifies the timeout when reading from network streams, in seconds. Too low "
-"values might stop streaming when the source is slow or the bandwidth is "
-"occupied, too high values will freeze the player if the connection is lost."
-msgstr ""
-
-#: src/xine-engine/xine.c:2233
-msgid "messages"
-msgstr ""
-
-#: src/xine-engine/xine.c:2234
-msgid "plugin"
-msgstr ""
-
-#: src/xine-engine/xine.c:2235
-msgid "trace"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:962
-msgid "Warning:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:963
-msgid "Unknown host:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:964
-msgid "Unknown device:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:965
-msgid "Network unreachable"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:966
-msgid "Connection refused:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:967
-msgid "File not found:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:968
-msgid "Read error from:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:969
-msgid "Error loading library:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:970
-msgid "Encrypted media stream detected"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:971
-msgid "Security message:"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:972
-msgid "Audio device unavailable"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:973
-msgid "Permission error"
-msgstr ""
-
-#: src/xine-engine/xine_interface.c:974
-msgid "File is empty:"
-msgstr ""
-
-#: src/xine-utils/memcpy.c:481
-msgid "memcopy method used by xine"
-msgstr ""
-
-#: src/xine-utils/memcpy.c:482
-msgid ""
-"The copying of large memory blocks is one of the most expensive operations "
-"on todays computers. Therefore xine provides various tuned methods to do "
-"this copying. Usually, the best method is detected automatically."
-msgstr ""
-
-#: src/xine-utils/memcpy.c:509
-#, c-format
-msgid "Benchmarking memcpy methods (smaller is better):\n"
-msgstr ""
diff --git a/po/libxine2.pot b/po/libxine2.pot
new file mode 100644
index 000000000..406b7b87b
--- /dev/null
+++ b/po/libxine2.pot
@@ -0,0 +1,5319 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Copyright (C) 2000-2006 the xine project
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: xine-lib 1.2.0\n"
+"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+
+#: lib/hstrerror.c:17
+msgid "No error"
+msgstr ""
+
+#: lib/hstrerror.c:18
+msgid "Unknown host"
+msgstr ""
+
+#: lib/hstrerror.c:19
+msgid "No address associated with name"
+msgstr ""
+
+#: lib/hstrerror.c:20
+msgid "Unknown server error"
+msgstr ""
+
+#: lib/hstrerror.c:21
+msgid "Host name lookup failure"
+msgstr ""
+
+#: lib/hstrerror.c:22
+msgid "Unknown error"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:350
+#, c-format
+msgid "audio_alsa_out:Already open...WHY!"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:378
+#, c-format
+msgid "audio_alsa_out: snd_pcm_open() of %s failed: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:380
+#, c-format
+msgid "audio_alsa_out: >>> check if another program already uses PCM <<<\n"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:393
+#, c-format
+msgid ""
+"audio_alsa_out: broken configuration for this PCM: no configurations "
+"available: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1323
+msgid "notify changes to the hardware mixer"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1324
+msgid ""
+"When the hardware mixer changes, your application will receive a "
+"notification so that it can update its graphical representation of the mixer "
+"settings on the fly."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1389
+#, c-format
+msgid "snd_lib_error_set_handler() failed: %d"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1396
+msgid "sound card can do mmap"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1397
+msgid ""
+"Enable this, if your sound card and alsa driver support memory mapped IO.\n"
+"You can try enabling it and check, if everything works. If it does, this "
+"will increase performance."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1406
+msgid "device used for mono output"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1407
+msgid ""
+"xine will use this alsa device to output mono sound.\n"
+"See the alsa documentation for information on alsa devices."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1415
+msgid "device used for stereo output"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1416
+msgid ""
+"xine will use this alsa device to output stereo sound.\n"
+"See the alsa documentation for information on alsa devices."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1424
+msgid "device used for 4-channel output"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1425
+msgid ""
+"xine will use this alsa device to output 4 channel (4.0) surround sound.\n"
+"See the alsa documentation for information on alsa devices."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1434 src/audio_out/audio_alsa_out.c:1444
+msgid "device used for 5.1-channel output"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1435
+msgid ""
+"xine will use this alsa device to output 5 channel plus LFE (5.1) surround "
+"sound.\n"
+"See the alsa documentation for information on alsa devices."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1445
+msgid ""
+"xine will use this alsa device to output undecoded digital surround sound. "
+"This can be used be external surround decoders.\n"
+"See the alsa documentation for information on alsa devices."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1465
+#, c-format
+msgid "snd_pcm_open() failed:%d:%s\n"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1467
+#, c-format
+msgid ">>> Check if another program already uses PCM <<<\n"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1498 src/audio_out/audio_jack_out.c:742
+#: src/audio_out/audio_oss_out.c:925
+msgid "speaker arrangement"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1499 src/audio_out/audio_jack_out.c:743
+#: src/audio_out/audio_oss_out.c:926
+msgid ""
+"Select how your speakers are arranged, this determines which speakers xine "
+"uses for sound output. The individual values are:\n"
+"\n"
+"Mono 1.0: You have only one speaker.\n"
+"Stereo 2.0: You have two speakers for left and right channel.\n"
+"Headphones 2.0: You use headphones.\n"
+"Stereo 2.1: You have two speakers for left and right channel, and one "
+"subwoofer for the low frequencies.\n"
+"Surround 3.0: You have three speakers for left, right and rear channel.\n"
+"Surround 4.0: You have four speakers for front left and right and rear left "
+"and right channels.\n"
+"Surround 4.1: You have four speakers for front left and right and rear left "
+"and right channels, and one subwoofer for the low frequencies.\n"
+"Surround 5.0: You have five speakers for front left, center and right and "
+"rear left and right channels.\n"
+"Surround 5.1: You have five speakers for front left, center and right and "
+"rear left and right channels, and one subwoofer for the low frequencies.\n"
+"Surround 6.0: You have six speakers for front left, center and right and "
+"rear left, center and right channels.\n"
+"Surround 6.1: You have six speakers for front left, center and right and "
+"rear left, center and right channels, and one subwoofer for the low "
+"frequencies.\n"
+"Surround 7.1: You have seven speakers for front left, center and right, left "
+"and right and rear left and right channels, and one subwoofer for the low "
+"frequencies.\n"
+"Pass Through: Your sound system will receive undecoded digital sound from "
+"xine. You need to connect a digital surround decoder capable of decoding the "
+"formats you want to play to your sound card's digital output."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1528
+msgid "audio_alsa_out : supported modes are"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1532
+msgid " 8bit"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1537
+msgid " 16bit"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1541
+msgid " 24bit"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1545
+msgid " 32bit"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1558 src/audio_out/audio_oss_out.c:961
+msgid " mono"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1562 src/audio_out/audio_oss_out.c:967
+msgid " stereo"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1567 src/audio_out/audio_oss_out.c:974
+msgid " 4-channel"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1570 src/audio_out/audio_oss_out.c:977
+msgid " (4-channel not enabled in xine config)"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1575
+msgid " 4.1-channel"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1578
+msgid " (4.1-channel not enabled in xine config)"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1583 src/audio_out/audio_oss_out.c:984
+msgid " 5-channel"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1586 src/audio_out/audio_oss_out.c:987
+msgid " (5-channel not enabled in xine config)"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1591 src/audio_out/audio_oss_out.c:994
+msgid " 5.1-channel"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1594 src/audio_out/audio_oss_out.c:997
+msgid " (5.1-channel not enabled in xine config)"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1617
+msgid " a/52 and DTS pass-through"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1620
+msgid " (a/52 and DTS pass-through not enabled in xine config)"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1630
+msgid "alsa mixer device"
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1631
+msgid ""
+"xine will use this alsa mixer device to change the volume.\n"
+"See the alsa documentation for information on alsa devices."
+msgstr ""
+
+#: src/audio_out/audio_alsa_out.c:1709
+msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
+msgstr ""
+
+#: src/audio_out/audio_coreaudio_out.c:575
+msgid "xine output plugin for Coreaudio/Mac OS X"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:165
+msgid "Error"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:172
+msgid "success"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:174
+msgid "access denied"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:176
+msgid "resource is already in use"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:177
+msgid "object was already initialized"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:178
+msgid "specified wave format is not supported"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:179
+msgid "memory buffer has been lost and must be restored"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:180
+msgid "requested buffer control is not available"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:181
+msgid "undetermined error inside DirectSound subsystem"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:183
+msgid "DirectSound hardware device is unavailable"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:185
+msgid "function is not valid for the current state of the object"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:186
+msgid "invalid parameter was passed"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:187
+msgid "object doesn't support aggregation"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:188
+msgid "no sound driver available for use"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:189
+msgid "requested COM interface not available"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:190
+msgid "another application has a higher priority level"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:191
+msgid "insufficient memory"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:192
+msgid "low priority level for this function"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:193
+msgid "DirectSound wasn't initialized"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:194
+msgid "function is not supported"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:195
+msgid "unknown error"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:205
+#, c-format
+msgid "Unable to create direct sound object."
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:211
+#, c-format
+msgid "Could not set direct sound cooperative level."
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:283
+msgid "Unable to create secondary direct sound buffer"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:303
+msgid "Couldn't play sound buffer"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:315
+msgid "Couldn't stop sound buffer"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:328
+msgid "Can't get buffer position"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:342
+msgid "Can't set buffer position"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:373
+msgid "Can't set sound volume"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:391
+#, c-format
+msgid ": buffer lost, trying to restore\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:395
+msgid "Couldn't lock direct sound buffer"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:408
+msgid "Couldn't unlock direct sound buffer"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:499
+#, c-format
+msgid "Unable to create primary direct sound buffer."
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:595
+#, c-format
+msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:698
+#, c-format
+msgid ": can't create pthread condition: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:702
+#, c-format
+msgid ": can't create pthread mutex: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:709
+#, c-format
+msgid ": can't create buffer pthread: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:824
+#, c-format
+msgid ": can't destroy buffer pthread: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:831
+#, c-format
+msgid ": can't destroy pthread condition: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:834
+#, c-format
+msgid ": can't destroy pthread mutex: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:889
+#, c-format
+msgid ": unknown control command %d\n"
+msgstr ""
+
+#: src/audio_out/audio_directx2_out.c:949
+msgid "second xine audio output plugin using directx"
+msgstr ""
+
+#: src/audio_out/audio_directx_out.c:840
+msgid "xine audio output plugin for win32 using directx"
+msgstr ""
+
+#: src/audio_out/audio_esd_out.c:165
+#, c-format
+msgid "audio_esd_out: connecting to ESD server %s: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_esd_out.c:497
+#, c-format
+msgid "audio_esd_out: connecting to esd server...\n"
+msgstr ""
+
+#: src/audio_out/audio_esd_out.c:509
+#, c-format
+msgid "audio_esd_out: can't connect to %s ESD server: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_esd_out.c:539
+msgid "esd audio output latency (adjust a/v sync)"
+msgstr ""
+
+#: src/audio_out/audio_esd_out.c:540 src/audio_out/audio_oss_out.c:867
+msgid ""
+"If you experience audio being not in sync with the video, you can enter a "
+"fixed offset here to compensate.\n"
+"The unit of the value is one PTS tick, which is the 90000th part of a second."
+msgstr ""
+
+#: src/audio_out/audio_esd_out.c:576
+msgid "xine audio output plugin using esound"
+msgstr ""
+
+#: src/audio_out/audio_file_out.c:381
+msgid "xine file audio output plugin"
+msgstr ""
+
+#: src/audio_out/audio_irixal_out.c:385
+msgid "irixal audio output maximum gap length"
+msgstr ""
+
+#: src/audio_out/audio_irixal_out.c:386
+msgid ""
+"You can specify the maximum offset between audio and video xine will "
+"tolerate before trying to resync them.\n"
+"The unit of this value is one PTS tick, which is the 90000th part of a "
+"second."
+msgstr ""
+
+#: src/audio_out/audio_irixal_out.c:415
+msgid "xine audio output plugin using IRIX libaudio"
+msgstr ""
+
+#: src/audio_out/audio_jack_out.c:730
+msgid "JACK audio device name"
+msgstr ""
+
+#: src/audio_out/audio_jack_out.c:731
+msgid ""
+"Specifies the jack audio device name, leave blank for the default physical "
+"output port."
+msgstr ""
+
+#: src/audio_out/audio_jack_out.c:908
+msgid "xine output plugin for JACK Audio Connection Kit"
+msgstr ""
+
+#: src/audio_out/audio_none_out.c:229
+msgid "xine dummy audio output plugin"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:195
+#, c-format
+msgid "audio_oss_out: Opening audio device %s: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:217
+#, c-format
+msgid ""
+"audio_oss_out: warning: sampling rate %d Hz not supported, trying 44100 Hz\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:229
+#, c-format
+msgid "audio_oss_out: audio rate : %d requested, %d provided by device\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:743
+msgid "OSS audio device name"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:744
+msgid ""
+"Specifies the base part of the audio device name, to which the OSS device "
+"number is appended to get the full device name.\n"
+"Select \"auto\" if you want xine to auto detect the corret setting."
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:751
+msgid "OSS audio device number, -1 for none"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:752
+msgid ""
+"The full audio device name is created by concatenating the OSS device name "
+"and the audio device number.\n"
+"If you do not need a number because you are happy with your system's default "
+"audio device, set this to -1.\n"
+"The range of this value is -1 or 0-15. This setting is ignored, when the OSS "
+"audio device name is set to \"auto\"."
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:761
+#, c-format
+msgid "audio_oss_out: audio.device.oss_device_name = auto, probing devs\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:764
+#, c-format
+msgid "audio_oss_out: Auto probe for audio device failed\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:780
+#, c-format
+msgid "audio_oss_out: using device >%s<\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:786 src/audio_out/audio_oss_out.c:900
+#, c-format
+msgid ""
+"audio_oss_out: opening audio device %s failed:\n"
+"%s\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:807
+msgid "a/v sync method to use by OSS"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:808
+msgid ""
+"xine can use different methods to keep audio and video synchronized. Which "
+"setting works best depends on the OSS driver and sound hardware you are "
+"using. Try the various methods, if you experience sync problems.\n"
+"\n"
+"The meaning of the values is as follows:\n"
+"\n"
+"auto\n"
+"xine attempts to automatically detect the optimal setting\n"
+"\n"
+"getodelay\n"
+"uses the SNDCTL_DSP_GETODELAY ioctl to achieve true a/v sync even if the "
+"driver claims not to support realtime playback\n"
+"\n"
+"getoptr\n"
+"uses the SNDCTL_DSP_GETOPTR ioctl to achieve true a/v sync even if the "
+"driver supports the preferred SNDCTL_DSP_GETODELAY ioctl\n"
+"\n"
+"softsync\n"
+"uses software synchronization with the system clock; audio and video can get "
+"severely out of sync if the system clock speed does not precisely match your "
+"sound card's playback speed\n"
+"\n"
+"probebuffer\n"
+"probes the sound card buffer size on initialization to calculate the latency "
+"for a/v sync; try this if your system does not support any of the realtime "
+"ioctls and you experience sync errors after long playback"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:859
+#, c-format
+msgid ""
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...will use system real-time clock for soft-sync instead\n"
+"audio_oss_out: ...there may be audio/video synchronization issues\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:866
+msgid "OSS audio output latency (adjust a/v sync)"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:892
+#, c-format
+msgid ""
+"audio_oss_out: Audio driver realtime sync disabled...\n"
+"audio_oss_out: ...probing output buffer size: %d bytes\n"
+"audio_oss_out: ...there may be audio/video synchronization issues\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:956
+msgid "audio_oss_out: supported modes are"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1007
+msgid " a/52 pass-through"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1010
+msgid " (a/52 pass-through not enabled in xine config)"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1026
+msgid "OSS audio mixer number, -1 for none"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1027
+msgid ""
+"The full mixer device name is created by taking the OSS device name, "
+"replacing \"dsp\" with \"mixer\" and adding the mixer number.\n"
+"If you do not need a number because you are happy with your system's default "
+"mixer device, set this to -1.\n"
+"The range of this value is -1 or 0-15. This setting is ignored, when the OSS "
+"audio device name is set to \"auto\"."
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1077
+#, c-format
+msgid "audio_oss_out: open() mixer %s failed: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_oss_out.c:1154
+msgid "xine audio output plugin using oss-compliant audio devices/drivers"
+msgstr ""
+
+#: src/audio_out/audio_pulse_out.c:879
+msgid "device used for pulseaudio"
+msgstr ""
+
+#: src/audio_out/audio_pulse_out.c:880
+msgid "use 'server[:sink]' for setting the pulseaudio sink device."
+msgstr ""
+
+#: src/audio_out/audio_pulse_out.c:979
+msgid "xine audio output plugin using pulseaudio sound server"
+msgstr ""
+
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
+#, c-format
+msgid "audio_sun_out: opening audio device %s failed: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_sun_out.c:923
+msgid "Sun audio device name"
+msgstr ""
+
+#: src/audio_out/audio_sun_out.c:924
+msgid ""
+"Specifies the file name for the Sun audio device to be used.\n"
+"This setting is security critical, because when changed to a different file, "
+"xine can be used to fill this file with arbitrary content. So you should be "
+"careful that the value you enter really is a proper Sun audio device."
+msgstr ""
+
+#: src/audio_out/audio_sun_out.c:966
+#, c-format
+msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
+msgstr ""
+
+#: src/audio_out/audio_sun_out.c:1023
+msgid "xine audio output plugin using sun-compliant audio devices/drivers"
+msgstr ""
+
+#: src/combined/xine_ogg_demuxer.c:888
+#, c-format
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+msgstr ""
+
+#: src/combined/xine_ogg_demuxer.c:2173
+msgid "Annodex demux plugin"
+msgstr ""
+
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_asf.c:450
+#, c-format
+msgid "demux_asf: warning: A stream appears to be missing.\n"
+msgstr ""
+
+#: src/demuxers/demux_asf.c:452
+msgid "Media stream missing?"
+msgstr ""
+
+#: src/demuxers/demux_asf.c:461
+#, c-format
+msgid "demux_asf: warning: The stream id=%d is encrypted.\n"
+msgstr ""
+
+#: src/demuxers/demux_asf.c:463
+msgid "Media stream scrambled/encrypted"
+msgstr ""
+
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
+msgid "Restoring index..."
+msgstr ""
+
+#: src/demuxers/demux_avi.c:630 src/demuxers/demux_avi.c:1697
+#, c-format
+msgid "demux_avi: invalid avi chunk \"%c%c%c%c\" at pos %<PRIdMAX>\n"
+msgstr ""
+
+#: src/demuxers/demux_avi.c:824
+#, c-format
+msgid "demux_avi: avi index is broken\n"
+msgstr ""
+
+#: src/demuxers/demux_avi.c:832
+#, c-format
+msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
+msgstr ""
+
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_film.c:186
+#, c-format
+msgid "invalid FILM chunk size\n"
+msgstr ""
+
+#: src/demuxers/demux_film.c:345
+#, c-format
+msgid "unrecognized FILM chunk\n"
+msgstr ""
+
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_flv.c:184
+#, c-format
+msgid "unsupported FLV version (%d).\n"
+msgstr ""
+
+#: src/demuxers/demux_flv.c:191
+#, c-format
+msgid "neither video nor audio stream in this file.\n"
+msgstr ""
+
+#: src/demuxers/demux_flv.c:559 src/demuxers/demux_flv.c:701
+#, c-format
+msgid "sequence header too big (%u bytes)!\n"
+msgstr ""
+
+#: src/demuxers/demux_flv.c:1000
+msgid "Flash Video file demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_iff.c:233
+#, c-format
+msgid "iff-8svx/16sv: unknown compression: %d\n"
+msgstr ""
+
+#: src/demuxers/demux_iff.c:367
+#, c-format
+msgid "iff-ilbm: unknown compression: %d\n"
+msgstr ""
+
+#: src/demuxers/demux_iff.c:568
+#, c-format
+msgid "iff: unknown Chunk: %s\n"
+msgstr ""
+
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpc.c:205
+#, c-format
+msgid "demux_mpc: frame too big for buffer"
+msgstr ""
+
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
+#, c-format
+msgid ""
+"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
+"to xine developers.\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:308
+#, c-format
+msgid ""
+"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:640
+#, c-format
+msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:650
+#, c-format
+msgid ""
+"demux_mpeg_block: warning: PES header indicates that this stream may be "
+"encrypted (encryption mode %d)\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
+#, c-format
+msgid ""
+"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
+"to xine developers.\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:427
+#, c-format
+msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:809
+#, c-format
+msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:819
+#, c-format
+msgid ""
+"demux_mpeg_pes: warning: PES header indicates that this stream may be "
+"encrypted (encryption mode %d)\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:1121
+#, c-format
+msgid ""
+"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
+"xine developers.\n"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_snd.c:100
+#, c-format
+msgid "demux_snd: bad header parameters\n"
+msgstr ""
+
+#: src/demuxers/demux_snd.c:145
+#, c-format
+msgid "demux_snd: unsupported audio type: %d\n"
+msgstr ""
+
+#: src/demuxers/demux_snd.c:356
+msgid "SND/AU file demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_tta.c:97
+#, c-format
+msgid "demux_tta: total frames count too high\n"
+msgstr ""
+
+#: src/demuxers/demux_tta.c:326
+msgid "True Audio demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_voc.c:103
+#, c-format
+msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
+msgstr ""
+
+#: src/demuxers/demux_voc.c:118
+#, c-format
+msgid ""
+"unknown VOC compression type (0x%02X); please report to xine developers\n"
+msgstr ""
+
+#: src/demuxers/demux_voc.c:336
+msgid "VOC file demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_wc3movie.c:190
+#, c-format
+msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
+msgstr ""
+
+#: src/demuxers/demux_wc3movie.c:408
+#, c-format
+msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
+msgstr ""
+
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_spu.c:196
+msgid ""
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_spu.c:241
+#, c-format
+msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_spu.c:635
+#, c-format
+msgid "requested button not available\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
+#, c-format
+msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:238
+msgid "use Pan & Scan info"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:239
+msgid ""
+"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
+"encoded material. You can specify here, how to handle such content.\n"
+"\n"
+"only when forced\n"
+"Use Pan & Scan only, when the content you are playing enforces it.\n"
+"\n"
+"use MPEG hint\n"
+"Enable Pan & Scan based on information embedded in the MPEG video stream.\n"
+"\n"
+"use DVB hint\n"
+"Enable Pan & Scan based on information embedded in DVB streams. This makes "
+"use of the Active Format Descriptor (AFD) used in some European DVB channels."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:258
+msgid "try to sync video every frame"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:259
+msgid ""
+"Tries to set a synchronization timestamp for every frame. Normally this is "
+"not necessary, because sync is sufficent even when the timestamp is set only "
+"every now and then.\n"
+"This is relevant for progressive video only (most PAL films)."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:265
+msgid "use smooth play mode"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:266
+msgid "Enabling this option will utilise a smoother play mode."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:269
+msgid "correct frame durations in broken streams"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:270
+msgid ""
+"Enables a small logic that corrects the frame durations of some mpeg streams "
+"with wrong framerate codes. Currently a correction for NTSC streams "
+"erroneously labeled as PAL streams is implemented. Enable only, when you "
+"encounter such streams."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:513
+#, c-format
+msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:581
+#, c-format
+msgid "dxr3_decode_video: write to device would block. flushing\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:585
+#, c-format
+msgid "dxr3_decode_video: video device write failed (%s)\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:700
+#, c-format
+msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:728
+#, c-format
+msgid ""
+"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
+msgstr ""
+
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr ""
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
+#, c-format
+msgid "dxr3_mpeg_encoder: failed to init librte\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:157
+#, c-format
+msgid ""
+"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
+"16\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:167
+#, c-format
+msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:178
+#, c-format
+msgid "dxr3_mpeg_encoder: could not create codec.\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:186
+msgid "rte mpeg output bitrate (kbit/s)"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:187
+msgid ""
+"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
+"mode. Higher values will increase quality and CPU usage."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:231
+#, c-format
+msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:239
+#, c-format
+msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:367
+#, c-format
+msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:382
+msgid "fame mpeg encoding quality"
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:383
+msgid ""
+"The encoding quality of the libfame mpeg encoder library. Lower is faster "
+"but gives noticeable artifacts. Higher is better but slower."
+msgstr ""
+
+#: src/dxr3/dxr3_scr.c:96
+msgid "SCR plugin priority"
+msgstr ""
+
+#: src/dxr3/dxr3_scr.c:97
+msgid ""
+"Priority of the DXR3 SCR plugin. Values less than 5 mean that the unix "
+"system timer will be used. Values greater 5 force to use DXR3's internal "
+"clock as sync source."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
+msgid "swap odd and even lines"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:258
+msgid ""
+"Swaps the even and odd field of the image.\n"
+"Enable this option for non-MPEG material which produces a vertical jitter on "
+"screen."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:262
+msgid "add black bars to correct aspect ratio"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:263
+msgid ""
+"Adds black bars when the image has an aspect ratio the card cannot handle "
+"natively. This is needed to maintain proper image proportions."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:268
+msgid "use smooth play mode for mpeg encoder playback"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:269
+msgid ""
+"Enabling this option will utilise a smoother play mode for non-MPEG content."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:277
+#, c-format
+msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:285
+#, c-format
+msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:318
+msgid "encoder for non mpeg content"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:319
+msgid ""
+"Content other than MPEG has to pass an additional reencoding stage, because "
+"the dxr3 handles only MPEG.\n"
+"Depending on what is supported by your xine, this setting can be \"fame\", "
+"\"rte\", \"libavcodec\" or \"none\".\n"
+"The \"libavcodec\" encoder makes use of the ffmpeg plugin that already ships "
+"with xine, so you do not need to install any additional library for that. "
+"Even better is that libavcodec also provides high quality with low CPU "
+"usage. Using \"libavcodec\" is therefore strongly suggested.\n"
+"\"fame\" and \"rte\" are still there, but xine support for them is outdated, "
+"so these might fail to work."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:330
+#, c-format
+msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:336
+#, c-format
+msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:343
+#, c-format
+msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:349
+#, c-format
+msgid ""
+"video_out_dxr3: Mpeg encoding disabled.\n"
+"video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n"
+"video_out_dxr3: you will not be able to play non-mpeg content using this "
+"video out\n"
+"video_out_dxr3: driver. See the README.dxr3 for details on configuring an "
+"encoder.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:355
+#, c-format
+msgid ""
+"video_out_dxr3: No mpeg encoder compiled in.\n"
+"video_out_dxr3: that's ok, you don't need it for mpeg video like DVDs, but\n"
+"video_out_dxr3: you will not be able to play non-mpeg content using this "
+"video out\n"
+"video_out_dxr3: driver. See the README.dxr3 for details on configuring an "
+"encoder.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:370
+msgid "video output mode (TV or overlay)"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:371
+msgid ""
+"The way the DXR3 outputs the final video can be set here. The individual "
+"values are:\n"
+"\n"
+"letterboxed tv\n"
+"Send video to the TV out connector only. This is the mode used for the "
+"standard 4:3 television set. Anamorphic (16:9) video will be displayed "
+"letterboxed, pan&scan material will have the image cropped at the left and "
+"right side. This is the common setting for TV viewing and acts like a "
+"standalone DVD player.\n"
+"\n"
+"widescreen tv\n"
+"Send video to the tv out connector only. This mode is intended for 16:9 "
+"widescreen TV sets. Anamorphic and pan&scan content will fill the entire "
+"screen, but you have to set the TV's aspect ratio manually to 16:9 using "
+"your.\n"
+"\n"
+"letterboxed overlay\n"
+"Overlay Video output on the computer screen with the option of on-the-fly "
+"switching to TV out by hiding the video window. The overlay will be "
+"displayed with black borders if it is anamorphic (16:9).\n"
+"This setting is only useful in the rare case of a DVD subtitle channel that "
+"would only display properly in letterbox mode. A good example for that are "
+"the animated commentator's silhouettes on \"Ghostbusters\".\n"
+"\n"
+"widescreen overlay\n"
+"Overlay Video output on the computer screen with the option of on-the-fly "
+"switching to TV out by hiding the video window. This is the common variant "
+"of DXR3 overlay."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:418
+msgid "overlay colour key value"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:418
+msgid ""
+"Hexadecimal RGB value of the key colour.\n"
+"You can try different values, if you experience windows becoming transparent "
+"when using DXR3 overlay mode."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:423
+msgid "overlay colour key tolerance"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:423
+msgid ""
+"A greater value widens the tolerance for the overlay key colour.\n"
+"You can try lower values, if you experience windows becoming transparent "
+"when using DXR3 overlay mode, but parts of the image borders may disappear "
+"when using a too low setting."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:429
+msgid "crop the overlay area at top and bottom"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:430
+msgid ""
+"Removes one pixel line from the top and bottom of the overlay. Enable this, "
+"if you see green lines at the top or bottom of the overlay."
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:434
+#, c-format
+msgid "video_out_dxr3: please run autocal, overlay disabled\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:444
+msgid "preferred tv mode"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:444
+msgid ""
+"Selects the TV mode to be used by the DXR3. The values mean:\n"
+"\n"
+"ntsc: NTSC at 60Hz\n"
+"pal: PAL at 50Hz\n"
+"pal60: PAL at 60Hz\n"
+"default: keep the card's setting"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:466
+#, c-format
+msgid "video_out_dxr3: setting video mode failed.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:693
+#, c-format
+msgid ""
+"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
+"video_out_dxr3: Read the README.dxr3 for details.\n"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:1344
+#, c-format
+msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
+msgstr ""
+
+#: src/input/input_cdda.c:1600
+#, c-format
+msgid "%s: can't connect to %s:%d\n"
+msgstr ""
+
+#: src/input/input_cdda.c:1647
+#, c-format
+msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
+msgstr ""
+
+#: src/input/input_cdda.c:1652
+#, c-format
+msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
+msgstr ""
+
+#: src/input/input_cdda.c:2671
+msgid "CD Digital Audio (aka. CDDA)"
+msgstr ""
+
+#: src/input/input_cdda.c:2684
+msgid "device used for CD audio"
+msgstr ""
+
+#: src/input/input_cdda.c:2685
+msgid ""
+"The path to the device, usually a CD or DVD drive, which you intend to use "
+"for playing audio CDs."
+msgstr ""
+
+#: src/input/input_cdda.c:2691
+msgid "query CDDB"
+msgstr ""
+
+#: src/input/input_cdda.c:2691
+msgid ""
+"Enables CDDB queries, which will give you convenient title and track names "
+"for your audio CDs.\n"
+"Keep in mind that, unless you use your own private CDDB, this information is "
+"retrieved from an internet server which might collect a profile of your "
+"listening habits."
+msgstr ""
+
+#: src/input/input_cdda.c:2699
+msgid "CDDB server name"
+msgstr ""
+
+#: src/input/input_cdda.c:2699
+msgid ""
+"The CDDB server used to retrieve the title and track information from.\n"
+"This setting is security critical, because the sever will receive "
+"information about your listening habits and could answer the queries with "
+"malicious replies. Be sure to enter a server you can trust."
+msgstr ""
+
+#: src/input/input_cdda.c:2707
+msgid "CDDB server port"
+msgstr ""
+
+#: src/input/input_cdda.c:2707
+msgid "The server port used to retrieve the title and track information from."
+msgstr ""
+
+#: src/input/input_cdda.c:2713
+msgid "slow down disc drive to this speed factor"
+msgstr ""
+
+#: src/input/input_cdda.c:2714
+msgid ""
+"Since some CD or DVD drives make some really loud noises because of the fast "
+"disc rotation, xine will try to slow them down. With standard CD or DVD "
+"playback, the high datarates that require the fast rotation are not needed, "
+"so the slowdown should not affect playback performance.\n"
+"A value of zero here will disable the slowdown."
+msgstr ""
+
+#: src/input/input_dvb.c:894
+#, c-format
+msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
+msgstr ""
+
+#: src/input/input_dvb.c:900
+#, c-format
+msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
+#, c-format
+msgid "input_dvb: tuner_set_channel failed\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2776
+#, c-format
+msgid "input_dvb: DVB GUI %s\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
+#, c-format
+msgid "input_dvb: cannot open dvb device\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2805
+#, c-format
+msgid "input_dvb: channel %d out of range, defaulting to 0\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2816
+#, c-format
+msgid "input_dvb: searching for channel %s\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2839
+#, c-format
+msgid "input_dvb: exact match for %s not found: trying partial matches\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2846
+#, c-format
+msgid "input_dvb: found matching channel %s\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2859
+#, c-format
+msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2865
+#, c-format
+msgid ""
+"input_dvb: invalid channel specification, defaulting to last viewed "
+"channel.\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2873
+#, c-format
+msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2885
+#, c-format
+msgid ""
+"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
+"S)\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2905
+#, c-format
+msgid ""
+"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
+"T)\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2928
+#, c-format
+msgid ""
+"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
+"C)\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2954
+#, c-format
+msgid ""
+"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
+"A)\n"
+msgstr ""
+
+#: src/input/input_dvb.c:2989
+#, c-format
+msgid "input_dvb: cannot open dvr device '%s'\n"
+msgstr ""
+
+#: src/input/input_dvb.c:3012
+#, c-format
+msgid "input_dvb: cannot create EPG updater thread\n"
+msgstr ""
+
+#: src/input/input_dvb.c:3074
+msgid "use DVB 'center cutout' (zoom)"
+msgstr ""
+
+#: src/input/input_dvb.c:3075
+msgid ""
+"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
+"frame."
+msgstr ""
+
+#: src/input/input_dvb.c:3265
+msgid "DVB (Digital TV) input plugin"
+msgstr ""
+
+#: src/input/input_dvb.c:3285
+msgid "Remember last DVB channel watched"
+msgstr ""
+
+#: src/input/input_dvb.c:3286
+msgid ""
+"On autoplay, xine will remember and switch to the channel indicated in media."
+"dvb.last_channel. "
+msgstr ""
+
+#: src/input/input_dvb.c:3293
+msgid "Last DVB channel viewed"
+msgstr ""
+
+#: src/input/input_dvb.c:3294
+msgid "If enabled xine will remember and switch to this channel. "
+msgstr ""
+
+#: src/input/input_dvb.c:3299
+msgid "Number of seconds until tuning times out."
+msgstr ""
+
+#: src/input/input_dvb.c:3300
+msgid ""
+"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
+"get a lock. Minimum is 5 seconds."
+msgstr ""
+
+#: src/input/input_dvb.c:3307
+msgid "Enable the DVB GUI"
+msgstr ""
+
+#: src/input/input_dvb.c:3308
+msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
+msgstr ""
+
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr ""
+
+#: src/input/input_dvb.c:3314
+msgid ""
+"Leave this at zero unless you really have more than 1 card in your system."
+msgstr ""
+
+#: src/input/input_dvd.c:589
+#, c-format
+msgid "input_dvd: values of \\beta will give rise to dom!\n"
+msgstr ""
+
+#: src/input/input_dvd.c:608
+#, c-format
+msgid "input_dvd: Error getting next block from DVD (%s)\n"
+msgstr ""
+
+#: src/input/input_dvd.c:1499
+#, c-format
+msgid "input_dvd: Error opening DVD device\n"
+msgstr ""
+
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
+msgid "device used for DVD playback"
+msgstr ""
+
+#: src/input/input_dvd.c:1777
+msgid ""
+"The path to the device, usually a DVD drive, which you intend to use for "
+"playing DVDs."
+msgstr ""
+
+#: src/input/input_dvd.c:1794
+msgid "raw device set up for DVD access"
+msgstr ""
+
+#: src/input/input_dvd.c:1795
+msgid ""
+"If this points to a raw device connected to your DVD device, xine will use "
+"the raw device for playback. This has the advantage of being slightly faster "
+"and of bypassing the block device cache, which avoids throwing away "
+"important cache content by keeping DVD data cached. Using the block device "
+"cache for DVDs is useless, because almost all DVD data will be used only "
+"once.\n"
+"See the documentation on raw device setup (man raw) for further information."
+msgstr ""
+
+#: src/input/input_dvd.c:1808
+msgid "CSS decryption method"
+msgstr ""
+
+#: src/input/input_dvd.c:1809
+msgid ""
+"Selects the decryption method libdvdcss will use to descramble copy "
+"protected DVDs. Try the various methods, if you have problems playing "
+"scrambled DVDs."
+msgstr ""
+
+#: src/input/input_dvd.c:1824
+msgid "region the DVD player claims to be in (1 to 8)"
+msgstr ""
+
+#: src/input/input_dvd.c:1825
+msgid ""
+"This only needs to be changed if your DVD jumps to a screen complaining "
+"about a wrong region code. It has nothing to do with the region code set in "
+"DVD drives, this is purely software."
+msgstr ""
+
+#: src/input/input_dvd.c:1831
+msgid "default language for DVD playback"
+msgstr ""
+
+#: src/input/input_dvd.c:1832
+msgid ""
+"xine tries to use this language as a default for DVD playback. As far as the "
+"DVD supports it, menus and audio tracks will be presented in this language.\n"
+"The value must be a two character ISO639 language code."
+msgstr ""
+
+#: src/input/input_dvd.c:1838
+msgid "read-ahead caching"
+msgstr ""
+
+#: src/input/input_dvd.c:1839
+msgid ""
+"xine can use a read ahead cache for DVD drive access.\n"
+"This may lead to jerky playback on slow drives, but it improves the impact "
+"of the DVD layer change on faster drives."
+msgstr ""
+
+#: src/input/input_dvd.c:1845
+msgid "unit for the skip action"
+msgstr ""
+
+#: src/input/input_dvd.c:1846
+msgid ""
+"You can configure the behaviour when issuing a skip command (using the skip "
+"buttons for example). The individual values mean:\n"
+"\n"
+"skip program\n"
+"will skip a DVD program, which is a navigational unit similar to the index "
+"marks on an audio CD; this is the normal behaviour for DVD players\n"
+"\n"
+"skip part\n"
+"will skip a DVD part, which is a structural unit similar to the track marks "
+"on an audio CD; parts usually coincide with programs, but parts can be "
+"larger than programs\n"
+"\n"
+"skip title\n"
+"will skip a DVD title, which is a structural unit representing entire "
+"features on the DVD"
+msgstr ""
+
+#: src/input/input_dvd.c:1861
+msgid "unit for seeking"
+msgstr ""
+
+#: src/input/input_dvd.c:1862
+msgid ""
+"You can configure the domain spanned by the seek slider. The individual "
+"values mean:\n"
+"\n"
+"seek in program chain\n"
+"seeking will span an entire DVD program chain, which is a navigational unit "
+"representing the entire video stream of the current feature\n"
+"\n"
+"seek in program\n"
+"seeking will span a DVD program, which is a navigational unit representing a "
+"chapter of the current feature"
+msgstr ""
+
+#: src/input/input_dvd.c:1873
+msgid "play mode when title/chapter is given"
+msgstr ""
+
+#: src/input/input_dvd.c:1874
+msgid ""
+"You can configure the behaviour when playing a dvd from a given title/"
+"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
+"\n"
+"entire dvd\n"
+"play the entire dvd starting on the specified position.\n"
+"\n"
+"one chapter\n"
+"play just the specified title/chapter and then stop"
+msgstr ""
+
+#: src/input/input_file.c:211
+#, c-format
+msgid "input_file: read error (%s)\n"
+msgstr ""
+
+#: src/input/input_file.c:368
+#, c-format
+msgid "input_file: Permission denied: >%s<\n"
+msgstr ""
+
+#: src/input/input_file.c:372
+#, c-format
+msgid "input_file: File not found: >%s<\n"
+msgstr ""
+
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
+#, c-format
+msgid "input_file: File empty: >%s<\n"
+msgstr ""
+
+#: src/input/input_file.c:970
+msgid "file input plugin"
+msgstr ""
+
+#: src/input/input_file.c:987
+msgid "file browsing start location"
+msgstr ""
+
+#: src/input/input_file.c:988
+msgid "The browser to select the file to play will start at this location."
+msgstr ""
+
+#: src/input/input_file.c:995
+msgid "list hidden files"
+msgstr ""
+
+#: src/input/input_file.c:996
+msgid ""
+"If enabled, the browser to select the file to play will also show hidden "
+"files."
+msgstr ""
+
+#: src/input/input_gnome_vfs.c:374
+msgid "gnome-vfs input plugin as shipped with xine"
+msgstr ""
+
+#: src/input/input_http.c:181
+#, c-format
+msgid "input_http: gethostbyname(%s) failed: %s\n"
+msgstr ""
+
+#: src/input/input_http.c:380 src/input/input_http.c:987
+#, c-format
+msgid "input_http: read error %d\n"
+msgstr ""
+
+#: src/input/input_http.c:621
+msgid "Connecting HTTP server..."
+msgstr ""
+
+#: src/input/input_http.c:808
+#, c-format
+msgid "input_http: invalid http answer\n"
+msgstr ""
+
+#: src/input/input_http.c:814
+#, c-format
+msgid "input_http: 3xx redirection: >%d %s<\n"
+msgstr ""
+
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
+#, c-format
+msgid "input_http: http status not 2xx: >%d %s<\n"
+msgstr ""
+
+#: src/input/input_http.c:847
+#, c-format
+msgid "input_http: content length = %<PRIdMAX> bytes\n"
+msgstr ""
+
+#: src/input/input_http.c:937
+#, c-format
+msgid "input_http: buffer exhausted after %d bytes."
+msgstr ""
+
+#: src/input/input_http.c:1062
+msgid "http input plugin"
+msgstr ""
+
+#: src/input/input_http.c:1095
+msgid "HTTP proxy host"
+msgstr ""
+
+#: src/input/input_http.c:1095
+msgid "The hostname of the HTTP proxy."
+msgstr ""
+
+#: src/input/input_http.c:1099
+msgid "HTTP proxy port"
+msgstr ""
+
+#: src/input/input_http.c:1099
+msgid "The port number of the HTTP proxy."
+msgstr ""
+
+#: src/input/input_http.c:1109
+msgid "HTTP proxy username"
+msgstr ""
+
+#: src/input/input_http.c:1110
+msgid "The user name for the HTTP proxy."
+msgstr ""
+
+#: src/input/input_http.c:1113
+msgid "HTTP proxy password"
+msgstr ""
+
+#: src/input/input_http.c:1114
+msgid "The password for the HTTP proxy."
+msgstr ""
+
+#: src/input/input_http.c:1117
+msgid "Domains for which to ignore the HTTP proxy"
+msgstr ""
+
+#: src/input/input_http.c:1118
+msgid ""
+"A comma-separated list of domain names for which the proxy is to be "
+"ignored.\n"
+"If a domain name is prefixed with '=' then it is treated as a host name only "
+"(full match required)."
+msgstr ""
+
+#: src/input/input_mms.c:467
+msgid "mms streaming input plugin"
+msgstr ""
+
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
+msgid "network bandwidth"
+msgstr ""
+
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
+msgid ""
+"Specify the bandwidth of your internet connection here. This will be used "
+"when streaming servers offer different versions with different bandwidth "
+"requirements of the same stream."
+msgstr ""
+
+#: src/input/input_mms.c:485
+msgid "MMS protocol"
+msgstr ""
+
+#: src/input/input_mms.c:486
+msgid ""
+"Select the protocol to encapsulate MMS.\n"
+"TCP is better but you may need HTTP behind a firewall."
+msgstr ""
+
+#: src/input/input_net.c:124 src/input/input_net.c:153
+#, c-format
+msgid "input_net: socket(): %s\n"
+msgstr ""
+
+#: src/input/input_net.c:139 src/input/input_net.c:164
+#, c-format
+msgid "input_net: connect(): %s\n"
+msgstr ""
+
+#: src/input/input_net.c:182 src/input/input_net.c:224
+#, c-format
+msgid "input_net: unable to resolve '%s'.\n"
+msgstr ""
+
+#: src/input/input_net.c:195 src/input/input_net.c:241
+#, c-format
+msgid "input_net: unable to connect to '%s'.\n"
+msgstr ""
+
+#: src/input/input_net.c:535
+msgid "net input plugin as shipped with xine"
+msgstr ""
+
+#: src/input/input_pnm.c:284
+msgid "pnm streaming input plugin"
+msgstr ""
+
+#: src/input/input_pvr.c:588
+#, c-format
+msgid "input_pvr: error creating pvr file (%s)\n"
+msgstr ""
+
+#: src/input/input_pvr.c:745
+#, c-format
+msgid "input_pvr: error opening pvr file (%s)\n"
+msgstr ""
+
+#: src/input/input_pvr.c:821
+#, c-format
+msgid "input_pvr: read error (%s)\n"
+msgstr ""
+
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
+#, c-format
+msgid "input_pvr: error opening device %s\n"
+msgstr ""
+
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
+#, c-format
+msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
+msgstr ""
+
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
+#, c-format
+msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
+msgstr ""
+
+#: src/input/input_pvr.c:1553
+msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
+msgstr ""
+
+#: src/input/input_pvr.c:1554
+msgid "The path to the device of your WinTV card."
+msgstr ""
+
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr ""
+
+#: src/input/input_rtp.c:183
+#, c-format
+msgid "xine_socket_cloexec(): %s.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:193
+msgid "IP address specified is multicast\n"
+msgstr ""
+
+#: src/input/input_rtp.c:202
+#, c-format
+msgid "setsockopt(SO_RCVBUF): %s.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:210
+#, c-format
+msgid "setsockopt(SO_REUSEADDR): %s.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:217
+#, c-format
+msgid "bind(): %s.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:237
+#, c-format
+msgid "Can't find address for iface %s:%s\n"
+msgstr ""
+
+#: src/input/input_rtp.c:255
+#, c-format
+msgid "setsockopt(IP_ADD_MEMBERSHIP) failed (multicast kernel?): %s.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:277
+#, c-format
+msgid "unable to resolve '%s'.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:287
+#, c-format
+msgid "unable to bind to '%s'.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:336
+#, c-format
+msgid "recv(): %s.\n"
+msgstr ""
+
+#: src/input/input_rtp.c:643
+msgid "RTP: stopping reading thread...\n"
+msgstr ""
+
+#: src/input/input_rtp.c:646
+msgid "RTP: reading thread terminated\n"
+msgstr ""
+
+#: src/input/input_rtp.c:661
+#, c-format
+msgid "Opening >filename:%s port:%d interface:%s<\n"
+msgstr ""
+
+#: src/input/input_rtp.c:678
+#, c-format
+msgid "input_rtp: can't create new thread (%s)\n"
+msgstr ""
+
+#: src/input/input_rtp.c:790
+msgid "RTP and UDP input plugin as shipped with xine"
+msgstr ""
+
+#: src/input/input_rtsp.c:303
+msgid "rtsp streaming input plugin"
+msgstr ""
+
+#: src/input/input_smb.c:512
+msgid "CIFS/SMB input plugin based on libsmbclient"
+msgstr ""
+
+#: src/input/input_stdin_fifo.c:174
+#, c-format
+msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
+msgstr ""
+
+#: src/input/input_stdin_fifo.c:262
+#, c-format
+msgid "stdin: failed to open '%s'\n"
+msgstr ""
+
+#: src/input/input_stdin_fifo.c:368
+msgid "stdin streaming input plugin"
+msgstr ""
+
+#: src/input/input_v4l.c:409
+msgid "Buffer underrun..."
+msgstr ""
+
+#: src/input/input_v4l.c:413
+msgid "Buffer overrun..."
+msgstr ""
+
+#: src/input/input_v4l.c:416
+msgid "Adjusting..."
+msgstr ""
+
+#: src/input/input_v4l.c:696
+#, c-format
+msgid "Tuner name not found\n"
+msgstr ""
+
+#: src/input/input_v4l.c:1908
+msgid "v4l tv input plugin"
+msgstr ""
+
+#: src/input/input_v4l.c:1916
+msgid "v4l video device"
+msgstr ""
+
+#: src/input/input_v4l.c:1917
+msgid "The path to your Video4Linux video device."
+msgstr ""
+
+#: src/input/input_v4l.c:1922
+msgid "v4l ALSA audio input device"
+msgstr ""
+
+#: src/input/input_v4l.c:1923
+msgid ""
+"The name of the audio device which corresponds to your Video4Linux video "
+"device."
+msgstr ""
+
+#: src/input/input_v4l.c:1928
+msgid "v4l TV standard"
+msgstr ""
+
+#: src/input/input_v4l.c:1929
+msgid ""
+"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
+"SECAM. "
+msgstr ""
+
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr ""
+
+#: src/input/input_v4l.c:1954
+msgid "v4l radio device"
+msgstr ""
+
+#: src/input/input_v4l.c:1955
+msgid "The path to your Video4Linux radio device."
+msgstr ""
+
+#: src/input/input_vcd.c:851
+#, c-format
+msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
+msgstr ""
+
+#: src/input/input_vcd.c:857
+#, c-format
+msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
+msgstr ""
+
+#: src/input/input_vcd.c:973
+#, c-format
+msgid "unable to open %s: %s.\n"
+msgstr ""
+
+#: src/input/input_vcd.c:1034
+#, c-format
+msgid "input_vcd: unable to open %s: %s.\n"
+msgstr ""
+
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr ""
+
+#: src/input/input_vcd.c:1082
+msgid "device used for VCD playback"
+msgstr ""
+
+#: src/input/input_vcd.c:1083
+msgid ""
+"The path to the device, usually a CD or DVD drive, you intend to play your "
+"VideoCDs with."
+msgstr ""
+
+#: src/input/librtsp/rtsp.c:437
+#, c-format
+msgid "rtsp: bad mrl: %s\n"
+msgstr ""
+
+#: src/input/librtsp/rtsp.c:495
+#, c-format
+msgid "rtsp: failed to connect to '%s'\n"
+msgstr ""
+
+#: src/input/librtsp/rtsp_session.c:111
+#, c-format
+msgid "rtsp_session: failed to connect to server %s\n"
+msgstr ""
+
+#: src/input/librtsp/rtsp_session.c:145
+#, c-format
+msgid "rtsp_session: session can not be established.\n"
+msgstr ""
+
+#: src/input/librtsp/rtsp_session.c:157
+#, c-format
+msgid ""
+"rtsp_session: rtsp server returned overly-large headers, session can not be "
+"established.\n"
+msgstr ""
+
+#: src/input/librtsp/rtsp_session.c:168
+#, c-format
+msgid "rtsp_session: rtsp server type '%s' not supported yet. sorry.\n"
+msgstr ""
+
+#: src/input/media_helper.c:148
+#, c-format
+msgid "input_dvd: Device %s failed to open during eject calls\n"
+msgstr ""
+
+#: src/input/mms.c:561
+msgid "Connecting MMS server (over tcp)..."
+msgstr ""
+
+#: src/input/mmsh.c:197
+#, c-format
+msgid "libmmsh: send error\n"
+msgstr ""
+
+#: src/input/mmsh.c:242
+#, c-format
+msgid "libmmsh: bad response format\n"
+msgstr ""
+
+#: src/input/mmsh.c:248
+#, c-format
+msgid "libmmsh: 3xx redirection not implemented: >%d %s<\n"
+msgstr ""
+
+#: src/input/mmsh.c:255
+#, c-format
+msgid "libmmsh: http status not 2xx: >%d %s<\n"
+msgstr ""
+
+#: src/input/mmsh.c:263
+#, c-format
+msgid "libmmsh: Location redirection not implemented\n"
+msgstr ""
+
+#: src/input/mmsh.c:472
+msgid "Connecting MMS server (over http)..."
+msgstr ""
+
+#: src/input/mmsh.c:653
+#, c-format
+msgid "invalid url\n"
+msgstr ""
+
+#: src/input/mmsh.c:658
+#, c-format
+msgid "unsupported protocol\n"
+msgstr ""
+
+#: src/input/net_buf_ctrl.c:103
+msgid "Buffering..."
+msgstr ""
+
+#: src/input/pnm.c:621
+#, c-format
+msgid ""
+"input_pnm: got message from server while reading stream:\n"
+"%s\n"
+msgstr ""
+
+#: src/input/pnm.c:755
+#, c-format
+msgid "input_pnm: failed to connect '%s'\n"
+msgstr ""
+
+#: src/input/pnm.c:766
+#, c-format
+msgid "input_pnm: failed to set up stream\n"
+msgstr ""
+
+#: src/input/vcd/vcdio.c:222
+msgid "SEEK_CUR not implemented for non-zero offset"
+msgstr ""
+
+#: src/input/vcd/vcdio.c:250
+msgid "SEEK_END not implemented yet."
+msgstr ""
+
+#: src/input/vcd/vcdio.c:253
+msgid "seek not implemented yet for"
+msgstr ""
+
+#: src/input/vcd/vcdplayer.c:94
+msgid "bad item type"
+msgstr ""
+
+#: src/input/vcd/vcdplayer.c:458
+msgid "bad entry number"
+msgstr ""
+
+#: src/input/vcd/vcdplayer.c:491
+msgid "bad segment number"
+msgstr ""
+
+#: src/input/vcd/vcdplayer.c:501
+msgid "Error in getting current segment number"
+msgstr ""
+
+#: src/input/vcd/vcdplayer.c:589
+msgid "Should have converted this above"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:191
+msgid "failed to find a device with a VCD"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:326
+msgid "was passed a null class parameter"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:988
+msgid "Invalid current entry type"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1088
+msgid "selection has no RETURN entry"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1117
+msgid "DEFAULT selected, but PBC is not on."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1122
+msgid "selection has no NEXT entry"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1130
+msgid "selection has no PREVIOUS entry"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1137
+msgid "Unknown event type: "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
+msgid "The above message had unknown vcdimager log level"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
+msgid "VCD default type to use on autoplay"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1816
+msgid ""
+"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
+"vcd:///dev/dvd:"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1826
+msgid "CD-ROM drive used for VCD when none given"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1827
+msgid ""
+"What to use if no drive specified. If the setting is empty, xine will scan "
+"for CD drives."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1837
+msgid "VCD position slider range"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1838
+msgid ""
+"range that the stream playback position slider represents playing a VCD."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1846
+msgid "VCD read-ahead caching?"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1847
+msgid "Class may lead to jerky playback on low-end machines."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1857
+msgid "automatically advance VCD track/entry"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1858
+msgid ""
+"If enabled, we should automatically advance to the next entry or track. Used "
+"only when playback control (PBC) is disabled."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1867
+msgid "show 'rejected' VCD LIDs"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1868
+msgid ""
+"Some playback list IDs (LIDs) are marked not showable, but you can see them "
+"in the MRL list if this is set. Rejected entries are marked with an asterisk "
+"(*) appended to the MRL."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1879
+msgid "VCD format string for display banner"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1880
+msgid ""
+"VCD format used in the GUI Title. Similar to the Unix date command. Format "
+"specifiers start with a percent sign. Specifiers are:\n"
+" %A : The album information\n"
+" %C : The VCD volume count - the number of CD's in the collection.\n"
+" %c : The VCD volume num - the number of the CD in the collection.\n"
+" %F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD\n"
+" %I : The current entry/segment/playback type, e.g. ENTRY, TRACK, ...\n"
+" %L : The playlist ID prefixed with \" LID\" if it exists\n"
+" %N : The current number of the above - a decimal number\n"
+" %P : The publisher ID\n"
+" %p : The preparer ID\n"
+" %S : If we are in a segment (menu), the kind of segment\n"
+" %T : The track number\n"
+" %V : The volume set ID\n"
+" %v : The volume ID\n"
+" A number between 1 and the volume count.\n"
+" %% : a %\n"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1905
+msgid "VCD format string for stream comment field"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1906
+msgid ""
+"VCD format used in the GUI Title. Similar to the Unix date command. Format "
+"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
+"%N, %P, %p, %S, %T, %V, %v, and %%.\n"
+"See the help for the title_format for the meanings of these."
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1918
+msgid "VCD debug flag mask"
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1919
+msgid ""
+"For tracking down bugs in the VCD plugin. Mask values are:\n"
+" 1: Meta information\n"
+" 2: input (keyboard/mouse) events\n"
+" 4: MRL parsing\n"
+" 8: Calls from external routines\n"
+" 16: routine calls\n"
+" 32: LSN changes\n"
+" 64: Playback control\n"
+" 128: Debugging from CDIO\n"
+" 256: Seeks to set location\n"
+" 512: Seeks to find current location\n"
+"1024: Still-frame\n"
+"2048: Debugging from VCDINFO\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
+#, c-format
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+msgid "dv audio decoder plugin"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:171
+msgid ""
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:179
+msgid ""
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
+#, c-format
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:197
+#, c-format
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:306
+#, c-format
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:352
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:400
+#, c-format
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:841
+#, c-format
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/libreal/real_common.c:139
+msgid "path to RealPlayer codecs"
+msgstr ""
+
+#: src/libreal/real_common.c:140
+msgid ""
+"If you have RealPlayer installed, specify the path to its codec directory "
+"here. You can easily find the codec directory by looking for a file named "
+"\"drvc.so\" in it. If xine can find the RealPlayer codecs, it will use them "
+"to decode RealPlayer content for you. Consult the xine FAQ for more "
+"information on how to install the codecs."
+msgstr ""
+
+#: src/libreal/xine_real_audio_decoder.c:134
+#, c-format
+msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
+msgstr ""
+
+#: src/libreal/xine_real_audio_decoder.c:292
+#, c-format
+msgid "libareal: decoder init failed, error code: 0x%x\n"
+msgstr ""
+
+#: src/libreal/xine_real_audio_decoder.c:306
+#, c-format
+msgid "libareal: decoder flavor setup failed, error code: 0x%x\n"
+msgstr ""
+
+#: src/libreal/xine_real_audio_decoder.c:343
+#, c-format
+msgid "libareal: oups, real can do more than 2 channels ?\n"
+msgstr ""
+
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
+msgid "display closed captions in MPEG-2 streams"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:200
+msgid ""
+"Closed Captions are subtitles mostly meant to help the hearing impaired."
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:207
+msgid "closed-captioning foreground/background scheme"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:208
+msgid "Choose your favourite rendering of the closed captions."
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:214
+msgid "standard closed captioning font"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:215
+msgid "Choose the font for standard closed captions text."
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:221
+msgid "italic closed captioning font"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:222
+msgid "Choose the font for italic closed captions text."
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:228
+msgid "closed captioning font size"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:229
+msgid "Choose the font size for closed captions text."
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:233
+msgid "center-adjust closed captions"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:234
+msgid ""
+"When enabled, closed captions will be positioned by the center of the "
+"individual lines."
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:340
+msgid "closed caption decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:468
+msgid "font for external subtitles"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:474
+msgid "subtitle vertical offset (relative window size)"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
+msgid "encoding of subtitles"
+msgstr ""
+
+#: src/spu_dec/sputext_demuxer.c:1430
+msgid "sputext demuxer plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_demuxer.c:1445
+msgid "default duration of subtitle display in seconds"
+msgstr ""
+
+#: src/spu_dec/sputext_demuxer.c:1446
+msgid ""
+"Some subtitle formats do not explicitly give a duration for each subtitle. "
+"For these, you can set a default duration here. Setting to zero will result "
+"in the subtitle being shown until the next one takes over."
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
+msgid "subtitle size"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1138
+msgid ""
+"You can adjust the subtitle size here. The setting will be evaluated "
+"relative to the window size."
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1144
+msgid "subtitle vertical offset"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1145
+msgid ""
+"You can adjust the vertical position of the subtitle. The setting will be "
+"evaluated relative to the window size."
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
+msgid "font for subtitles"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1152
+msgid "A font from the xine font directory to be used for the subtitle text."
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1161
+msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1167
+msgid "whether to use a freetype font"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1174
+msgid "encoding of the subtitles"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1175
+msgid ""
+"The encoding of the subtitle text in the stream. This setting is used to "
+"render non-ASCII characters correctly. If non-ASCII characters are not "
+"displayed as you expect, ask the creator of the subtitles what encoding was "
+"used."
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1183
+msgid "use unscaled OSD if possible"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1184
+msgid ""
+"The unscaled OSD will be rendered independently of the video frame and will "
+"always be sharp, even if the video is magnified. This will look better, but "
+"does not work with all graphics hardware. The alternative is the scaled OSD, "
+"which will become blurry, if you enlarge a low resolution video to "
+"fullscreen, but it works with all graphics cards."
+msgstr ""
+
+#: src/libw32dll/common.c:17
+msgid "path to Win32 codecs"
+msgstr ""
+
+#: src/libw32dll/common.c:18
+msgid ""
+"If you have the Windows or Apple Quicktime codec packs installed, specify "
+"the path the codec directory here. If xine can find the Windows or Apple "
+"Quicktime codecs, it will use them to decode various Windows Media and "
+"Quicktime streams for you. Consult the xine FAQ for more information on how "
+"to install the codecs."
+msgstr ""
+
+#: src/libw32dll/w32codec.c:589
+#, c-format
+msgid "w32codec: ICOpen failed! unknown codec %08lx / wrong parameters?\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:598
+#, c-format
+msgid "w32codec: ICDecompressGetFormat (%.4s %08lx/%d) failed: Error %ld\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:631
+#, c-format
+msgid "w32codec: ICDecompressQuery failed: Error %ld\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:642
+#, c-format
+msgid "w32codec: ICDecompressBegin failed: Error %ld\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:688
+#, c-format
+msgid ""
+"w32codec: DS_VideoDecoder failed! unknown codec %08lx / wrong parameters?\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:699
+#, c-format
+msgid ""
+"w32codec: DMO_VideoDecoder failed! unknown codec %08lx / wrong parameters?\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:819 src/libw32dll/w32codec.c:1488
+#, c-format
+msgid "w32codec: decoder failed to start. Is '%s' installed?\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1222
+#, c-format
+msgid "w32codec: (ACM_Decoder) Unappropriate audio format\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1225
+#, c-format
+msgid "w32codec: (ACM_Decoder) acmStreamOpen error %d\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1244
+#, c-format
+msgid "w32codec: Error initializing DirectShow Audio\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1262
+#, c-format
+msgid "w32codec: Error initializing DMO Audio\n"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+msgid "win32 binary audio codec plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
+#, c-format
+msgid "bitplane: error doing ByteRun1 decompression\n"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1324
+#, c-format
+msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1331
+#, c-format
+msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1381
+#, c-format
+msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1387
+#, c-format
+msgid "bitplane: This anim-type is not supported at the moment\n"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
+#: src/post/audio/stretch.c:267
+msgid ""
+"This filter will perform a time stretch, playing the stream faster or slower "
+"by a factor. Pitch is optionally preserved, so it is possible, for example, "
+"to use it to watch a movie in less time than it was originally shot.\n"
+msgstr ""
+
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
+#: src/post/audio/upmix.c:138
+msgid ""
+"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
+"Parameters\n"
+" cut_off_freq\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+msgstr ""
+
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
+#: src/post/audio/upmix_mono.c:110
+msgid ""
+"This filter will upmix a mono stream to stereo, by duplicating channels. "
+"Alternatively, one may use this plugin to listen just one channel of a given "
+"stream.\n"
+msgstr ""
+
+#: src/post/audio/upmix_mono.c:148
+#, c-format
+msgid ": upmixing Mono to Stereo.\n"
+msgstr ""
+
+#: src/post/audio/upmix_mono.c:153
+#, c-format
+msgid ": upmixing a single channel from original %d channel stream.\n"
+msgid_plural ": upmixing a single channel from original %d channels stream.\n"
+msgstr[0] ""
+msgstr[1] ""
+
+#: src/post/audio/upmix_mono.c:158
+#, c-format
+msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
+msgstr ""
+
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
+#: src/post/audio/volnorm.c:151
+msgid ""
+"Normalizes audio by maximizing the volume without distorting the sound.\n"
+"\n"
+"Parameters:\n"
+" method: 1: use a single sample to smooth the variations via the standard "
+"weighted mean over past samples (default); 2: use several samples to smooth "
+"the variations via the standard weighted mean over past samples.\n"
+msgstr ""
+
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:211
+msgid ""
+"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
+"This plugin aims to provide deinterlacing mechanisms comparable to high "
+"quality progressive DVD players and so called line-doublers, for use with "
+"computer monitors, projectors and other progressive display devices.\n"
+"\n"
+"Parameters\n"
+"\n"
+" Method: Select deinterlacing method/algorithm to use, see below for "
+"explanation of each method.\n"
+"\n"
+" Enabled: Enable/disable the plugin.\n"
+"\n"
+" Pulldown_error_wait: Ensures that the telecine pattern has been locked for "
+"this many frames before changing to filmmode.\n"
+"\n"
+" Pulldown: Choose the 2-3 pulldown detection algorithm. 24 FPS films that "
+"have being converted to NTSC can be detected and intelligently reconstructed "
+"to their original (non-interlaced) frames.\n"
+"\n"
+" Framerate_mode: Selecting 'full' will deinterlace every field to an unique "
+"frame for television quality and beyond. This feature will effetively double "
+"the frame rate, improving smoothness. Note, however, that full 59.94 FPS is "
+"not possible with plain 2.4 Linux kernel (that use a timer interrupt "
+"frequency of 100Hz). Newer RedHat and 2.6 kernels use higher HZ settings "
+"(512 and 1000, respectively) and should work fine.\n"
+"\n"
+" Judder_correction: Once 2-3 pulldown is enabled and a film material is "
+"detected, it is possible to reduce the frame rate to original rate used (24 "
+"FPS). This will make the frames evenly spaced in time, matching the speed "
+"they were shot and eliminating the judder effect.\n"
+"\n"
+" Use_progressive_frame_flag: Well mastered MPEG2 streams uses a flag to "
+"indicate progressive material. This setting control whether we trust this "
+"flag or not (some rare and buggy mpeg2 streams set it wrong).\n"
+"\n"
+" Chroma_filter: DVD/MPEG2 use an interlaced image format that has a very "
+"poor vertical chroma resolution. Upsampling the chroma for purposes of "
+"deinterlacing may cause some artifacts to occur (eg. colour stripes). Use "
+"this option to blur the chroma vertically after deinterlacing to remove the "
+"artifacts. Warning: cpu intensive.\n"
+"\n"
+" Cheap_mode: This will skip the expensive YV12->YUY2 image conversion, "
+"tricking tvtime/dscaler routines like if they were still handling YUY2 "
+"images. Of course, this is not correct, not all pixels will be evaluated by "
+"the algorithms to decide the regions to deinterlace and chroma will be "
+"processed separately. Nevertheless, it allows people with not so fast "
+"systems to try deinterlace algorithms, in a tradeoff between quality and cpu "
+"usage.\n"
+"\n"
+"* Uses several algorithms from tvtime and dscaler projects.\n"
+"Deinterlacing methods: (Not all methods are available for all platforms)\n"
+"\n"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
+#, c-format
+msgid "tvtime: No deinterlacing methods available, exiting.\n"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
+msgid "frames per second to generate"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:205
+msgid ""
+"With more frames per second, the animation will get smoother and faster, but "
+"will also require more CPU power."
+msgstr ""
+
+#: src/post/goom/xine_goom.c:210
+msgid "goom image width"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:211
+msgid "The width in pixels of the image to be generated."
+msgstr ""
+
+#: src/post/goom/xine_goom.c:215
+msgid "goom image height"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:216
+msgid "The height in pixels of the image to be generated."
+msgstr ""
+
+#: src/post/goom/xine_goom.c:222
+msgid "colour space conversion method"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:223
+msgid ""
+"You can choose the colour space conversion method used by goom.\n"
+"The available selections should be self-explaining."
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
+msgid ""
+"Mosaico does simple picture in picture effects.\n"
+"\n"
+"Parameters\n"
+" pip_num: the number of the picture slot the following settings apply to\n"
+" x: the x coordinate of the left upper corner of the picture\n"
+" y: the y coordinate of the left upper corner of the picture\n"
+" w: the width of the picture\n"
+" h: the height of the picture\n"
+msgstr ""
+
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
+msgid ""
+"Switch can be used for fast switching between multiple inputs.\n"
+"\n"
+"Parameters\n"
+" select: the number of the input which will be passed to the output\n"
+msgstr ""
+
+#: src/post/planar/boxblur.c:105
+msgid ""
+"Box blur does a simple blurring of the image.\n"
+"\n"
+"Parameters\n"
+" Radius: size of the filter\n"
+" Power: how often the filter should be applied\n"
+"\n"
+"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+msgstr ""
+
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
+#: src/post/planar/denoise3d.c:138
+msgid ""
+"This filter aims to reduce image noise producing smooth images and making "
+"still images really still (This should enhance compressibility.). It can be "
+"given from 0 to 3 parameters. If you omit a parameter, a reasonable value "
+"will be inferred.\n"
+"\n"
+"Parameters\n"
+" Luma: Spatial luma strength (default = 4)\n"
+" Chroma: Spatial chroma strength (default = 3)\n"
+" Time: Temporal strength (default = 6)\n"
+"\n"
+"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
+msgstr ""
+
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
+msgstr ""
+
+#: src/post/planar/eq2.c:361
+msgid ""
+"Alternative software equalizer that uses lookup tables (very slow), allowing "
+"gamma correction in addition to simple brightness, contrast and saturation "
+"adjustment.\n"
+"Note that it uses the same MMX optimized code as 'eq' if all gamma values "
+"are 1.0.\n"
+"\n"
+"Parameters\n"
+" gamma\n"
+" brightness\n"
+" contrast\n"
+" saturation\n"
+" rgamma (gamma for the red component)\n"
+" ggamma (gamma for the green component)\n"
+" bgamma (gamma for the blue component)\n"
+"\n"
+"Value ranges are 0.1 - 10 for gammas, -2 - 2 for contrast (negative values "
+"result in a negative image), -1 - 1 for brightness and 0 - 3 for "
+"saturation.\n"
+"\n"
+"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
+msgid ""
+"The expand plugin is meant to take frames of arbitrary aspect ratio and "
+"converts them to a different aspect (4:3 by default) by adding black bars on "
+"the top and bottom of the frame. This allows us to shift overlays down into "
+"the black area so they don't cover the image.\n"
+"\n"
+"Parameters (FIXME: better help)\n"
+" Enable_automatic_shift: Enable automatic overlay shifting\n"
+" Overlay_y_offset: Manually shift the overlay vertically\n"
+" aspect: The target aspect ratio (default 4:3)\n"
+" Centre_cut_out_mode: extracts 4:3 image contained in 16:9 frame\n"
+"\n"
+msgstr ""
+
+#: src/post/planar/noise.c:408
+msgid ""
+"Adds random noise to the video.\n"
+"\n"
+"Parameters:\n"
+" luma_strength: strength of noise added to luma channel (0-100, default: "
+"8)\n"
+" chroma_strength: strength of noise added to chroma channel (0-100, "
+"default: 5)\n"
+" quality: quality level of the noise. fixed: constant noise pattern; "
+"temporal: noise pattern changes between frames; averaged temporal: smoother "
+"noise pattern that changes between frames. (default: averaged temporal)\n"
+" type: Type of noise: uniform or gaussian. (default: gaussian)\n"
+" pattern: Mix random noise with a (semi)regular pattern. (default: False)\n"
+"\n"
+"* mplayer's noise (C) Michael Niedermayer\n"
+msgstr ""
+
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
+msgid ""
+"FFmpeg libpostprocess plugin.\n"
+"\n"
+"Parameters\n"
+"\n"
+msgstr ""
+
+#: src/post/planar/pp.c:132
+msgid ""
+"\n"
+"* libpostprocess (C) Michael Niedermayer\n"
+msgstr ""
+
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
+#: src/post/planar/unsharp.c:215
+msgid ""
+"Unsharp mask / gaussian blur\n"
+"It is possible to set the width and height of the matrix, odd sized in both "
+"directions (min = 3x3, max = 13x11 or 11x13, usually something between 3x3 "
+"and 7x7) and the relative amount of sharpness/blur to add to the image (a "
+"sane range should be -1.5 - 1.5).\n"
+"\n"
+"Parameters\n"
+"\n"
+" Luma_matrix_width: Width of the matrix (must be odd)\n"
+"\n"
+" Luma_matrix_height: Height of the matrix (must be odd)\n"
+"\n"
+" Luma_amount: Relative amount of sharpness/blur (=0 disable, <0 blur, >0 "
+"sharpen)\n"
+"\n"
+" Chroma_matrix_width: Width of the matrix (must be odd)\n"
+"\n"
+" Chroma_matrix_height: Height of the matrix (must be odd)\n"
+"\n"
+" Chroma_amount: Relative amount of sharpness/blur (=0 disable, <0 blur, >0 "
+"sharpen)\n"
+"\n"
+"\n"
+"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
+msgstr ""
+
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1798
+#, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2049
+#, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2089
+#, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
+msgid "xine video output plugin using the ascii-art library"
+msgstr ""
+
+#: src/video_out/video_out_caca.c:309
+msgid "xine video output plugin using the Color AsCii Art library"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1341
+msgid "video layer buffering mode"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1342
+msgid ""
+"Select the buffering mode of the output layer. Double or triple buffering "
+"give a smoother playback, but consume more video memory."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1349
+msgid "wait for vertical retrace"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1350
+msgid ""
+"Enable synchronizing the update of the video image to the repainting of the "
+"entire screen (\"vertical retrace\")."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1357
+msgid "enable video colour key"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1358
+msgid ""
+"Enable using a colour key to tell the graphics card where to overlay the "
+"video image."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1364
+msgid "video colour key"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1365
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
+msgid ""
+"The colour key is used to tell the graphics card where to overlay the video "
+"image. Try different values, if you experience windows becoming transparent."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1374
+msgid "flicker filtering"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1375
+msgid "Enable Flicker Filetring for a smooth output on an interlaced display."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1382
+msgid "field parity"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1383
+msgid ""
+"For an interlaced display, enable controlling the field parity (\"none"
+"\"=disabled)."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1516
+#, c-format
+msgid "video_out_directfb: using hardware subpicture acceleration.\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1530
+#, c-format
+msgid "video_out_directfb: layer supports video output.\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1539
+#, c-format
+msgid "video_out_directfb: layer doesn't support YV12!\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1546
+#, c-format
+msgid "video_out_directfb: layer doesn't support YUY2!\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1557
+#, c-format
+msgid ""
+"video_out_directfb:need at least DirectFB 0.9.25 to play on this layer!\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1592
+#, c-format
+msgid "video_out_directfb: layer doesn't support buffermode %d!\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1598
+#, c-format
+msgid "video_out_directfb: layer doesn't support options 0x%08x!\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1692
+#, c-format
+msgid "video_out_directfb: using hardware accelerated image scaling.\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1704
+#, c-format
+msgid ""
+"video_out_directfb: image scaling with deinterlacing is hardware "
+"accelerated.\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1796
+msgid "video layer id (auto: -1)"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1797
+msgid "Select the video output layer by its id."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
+#, c-format
+msgid "video_out_directfb: using display layer #%d.\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:1915
+msgid "xine video output plugin using DirectFB."
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:2008
+#, c-format
+msgid "video_out_directfb: no usable display layer was found!\n"
+msgstr ""
+
+#: src/video_out/video_out_directfb.c:2120
+msgid "xine video output plugin using DirectFB under XDirectFB."
+msgstr ""
+
+#: src/video_out/video_out_directx.c:1288
+msgid "HW acceleration level"
+msgstr ""
+
+#: src/video_out/video_out_directx.c:1289
+msgid ""
+"Possible values (default full):\n"
+"\n"
+"full: full acceleration\n"
+"scale: disable colorspace conversion (HW scaling only)\n"
+"none: disable all acceleration"
+msgstr ""
+
+#: src/video_out/video_out_directx.c:1327
+msgid "xine video output plugin for win32 using directx"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:741
+#, c-format
+msgid ""
+"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
+" Check 'fbset -i' or try 'fbset -depth 16'.\n"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
+msgid "framebuffer device name"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
+msgid ""
+"Specifies the file name for the framebuffer device to be used.\n"
+"This setting is security critical, because when changed to a different file, "
+"xine can be used to fill this file with arbitrary content. So you should be "
+"careful that the value you enter really is a proper framebuffer device."
+msgstr ""
+
+#: src/video_out/video_out_fb.c:876
+#, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:933
+#, c-format
+msgid "%s: %d video RAM buffers are available.\n"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:939
+#, c-format
+msgid ""
+"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"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:950
+#, c-format
+msgid ""
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
+" do not support screen panning (used for frame flips).\n"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:1019
+#, c-format
+msgid ""
+"WARNING: %s: current display depth is %d. For better performance\n"
+" a depth of 16 bpp is recommended!\n"
+"\n"
+msgstr ""
+
+#: src/video_out/video_out_fb.c:1050
+msgid "Xine video output plugin using the Linux frame buffer device"
+msgstr ""
+
+#: src/video_out/video_out_none.c:279
+msgid "xine video output plugin which displays nothing"
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:1891
+msgid "OpenGL renderer"
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:1892
+msgid ""
+"The OpenGL plugin provides several render modules:\n"
+"\n"
+"2D_Tex_Fragprog\n"
+"This module downloads the images as YUV 2D textures and renders a textured "
+"slice\n"
+"using fragment programs for reconstructing RGB.\n"
+"This is the best and fastest method on modern graphics cards.\n"
+"\n"
+"2D_Tex\n"
+"This module downloads the images as 2D textures and renders a textured "
+"slice.\n"
+"2D_Tex_Tiled\n"
+"This module downloads the images as multiple 2D textures and renders a "
+"textured\n"
+"slice. Thus this works with smaller maximum texture sizes as well.\n"
+"Image_Pipeline\n"
+"This module uses glDraw() to render the images.\n"
+"Only accelerated on few drivers.\n"
+"Does not interpolate on scaling.\n"
+"\n"
+"Cylinder\n"
+"Shows images on a rotating cylinder. Nice effect :)\n"
+"\n"
+"Environment_Mapped_Torus\n"
+"Show images reflected in a spinning torus. Way cool =)"
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:1914
+msgid "OpenGL minimum framerate"
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:1915
+msgid ""
+"Minimum framerate for animated render routines.\n"
+"Ignored for static render routines.\n"
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
+#: src/video_out/xv_common.h:46
+msgid "enable double buffering"
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:1921
+msgid ""
+"For OpenGL double buffering does not only remove tearing artifacts,\n"
+"it also reduces flickering a lot.\n"
+"It should not have any performance impact."
+msgstr ""
+
+#: src/video_out/video_out_opengl.c:2025
+msgid "xine video output plugin using the OpenGL 3D graphics API"
+msgstr ""
+
+#: src/video_out/video_out_pgx32.c:187
+#, c-format
+msgid "video_out_pgx32: Error: can't grab DGA drawable for video window\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx32.c:206 src/video_out/video_out_pgx32.c:220
+#, c-format
+msgid "video_out_pgx32: Error: ioctl failed, bad device (%s)\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx32.c:213
+#, c-format
+msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx32.c:864
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:278
+#, c-format
+msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:296
+#, c-format
+msgid "video_out_pgx64: Error: can't open framebuffer device '%s'\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:303
+#, c-format
+msgid ""
+"video_out_pgx64: Error: ioctl failed (VIS_GETIDENTIFIER), bad device (%s)\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:316
+#, c-format
+msgid ""
+"video_out_pgx64: Error: '%s' is not a xvr100/pgx64/pgx24 framebuffer device\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:337
+#, c-format
+msgid ""
+"video_out_pgx64: Error: video overlay on this screen is already in use\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:352
+#, c-format
+msgid "video_out_pgx64: Error: unable to set window properties\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:807
+#, c-format
+msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:839
+#, c-format
+msgid "video_out_pgx64: Error: insuffucient video memory\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:855
+#, c-format
+msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1385
+#, c-format
+msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
+msgid "video overlay colour key"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1453
+msgid ""
+"The colour key is used to tell the graphics card where it can overlay the "
+"video image. Try using different values if you see the video showing through "
+"other windows."
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1460
+msgid "enable chroma keying"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1461
+msgid ""
+"Draw OSD graphics on top of the overlay colour key rather than blend them "
+"into each frame."
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1464
+msgid "enable multi-buffering"
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1465
+msgid ""
+"Multi buffering increases performance at the expense of using more graphics "
+"memory."
+msgstr ""
+
+#: src/video_out/video_out_pgx64.c:1486
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+
+#: src/video_out/video_out_sdl.c:490
+msgid "use hardware acceleration if available"
+msgstr ""
+
+#: src/video_out/video_out_sdl.c:491
+msgid ""
+"When your system supports it, hardware acceleration provided by your "
+"graphics hardware will be used. This might not work, so you can disable it, "
+"if things go wrong."
+msgstr ""
+
+#: src/video_out/video_out_sdl.c:537
+#, c-format
+msgid "sdl has to emulate a 16 bit surfaces, that will slow things down.\n"
+msgstr ""
+
+#: src/video_out/video_out_sdl.c:574
+#, c-format
+msgid "video_out_sdl: fullscreen mode is NOT supported\n"
+msgstr ""
+
+#: src/video_out/video_out_sdl.c:596
+msgid "xine video output plugin using the Simple Direct Media Layer"
+msgstr ""
+
+#: src/video_out/video_out_stk.c:454
+msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1010
+msgid "red intensity"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1010
+msgid "The intensity of the red colour components."
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1015
+msgid "green intensity"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1015
+msgid "The intensity of the green colour components."
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1020
+msgid "blue intensity"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1020
+msgid "The intensity of the blue colour components."
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
+msgid ""
+"Double buffering will synchronize the update of the video image to the "
+"repainting of the entire screen (\"vertical retrace\"). This eliminates "
+"flickering and tearing artifacts, but will use more graphics memory."
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1080
+#, c-format
+msgid "video_out_vidix: adaptor supports the yuy2 format\n"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1091
+#, c-format
+msgid "video_out_vidix: adaptor supports the yv12 format\n"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1107
+#, c-format
+msgid "video_out_vidix: You have wrong version of VIDIX library\n"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1115
+#, c-format
+msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1128
+#, c-format
+msgid "video_out_vidix: using driver: %s by %s\n"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1167
+msgid "video overlay colour key red component"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1174
+msgid "video overlay colour key green component"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1181
+msgid "video overlay colour key blue component"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1215
+msgid "xine video output plugin using libvidix for x11"
+msgstr ""
+
+#: src/video_out/video_out_vidix.c:1289
+msgid "xine video output plugin using libvidix for linux frame buffer"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
+#, c-format
+msgid "%s: %s: allocating image\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
+#, c-format
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
+#, c-format
+msgid ""
+"\n"
+"\n"
+"WARNING: current display depth is %d. For better performance\n"
+"a depth of 16 bpp is recommended!\n"
+"\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
+#, c-format
+msgid "%s: MIT shared memory extension not present on display.\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
+#, c-format
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
+msgid "xine video output plugin using the MIT X shared memory extension"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
+#, c-format
+msgid "%s: XvShmCreateImage returned a zero size\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
+#, c-format
+msgid "%s: shared memory error in shmget: %s\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:285
+#, c-format
+msgid "%s: shared memory error (address error)\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
+#, c-format
+msgid "%s: Xv extension not present.\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
+#, c-format
+msgid "%s: could not open Xv port %d - autodetecting\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
+#, c-format
+msgid "%s: no available ports of type \"%s\", defaulting...\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
+#, c-format
+msgid ""
+"%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"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1254
+#, c-format
+msgid ""
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
+msgid "enable vblank sync"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
+msgid ""
+"This option will synchronize the update of the video image to the repainting "
+"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
+"tearing artifacts. On nvidia cards one may also need to run \"nvidia-settings"
+"\" and choose which display device to sync to under the XVideo Settings tab"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
+#, c-format
+msgid "%s: this adaptor supports the %s format.\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
+msgid "xine video output plugin using the MIT X video extension"
+msgstr ""
+
+#: src/video_out/video_out_xshm.c:198
+#, c-format
+msgid "%s: shared memory error when allocating image\n"
+msgstr ""
+
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
+#, c-format
+msgid "%s: XvShmCreateImage failed\n"
+msgstr ""
+
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
+#, c-format
+msgid ""
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1566
+#, c-format
+msgid "video_out_xvmc: XvMC extension not present.\n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1664
+#, c-format
+msgid ""
+"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
+"port.\n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1673
+#, c-format
+msgid ""
+"video_out_xvmc: using Xv port %ld from adaptor %s\n"
+" for hardware colour space conversion and scaling\n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1678
+#, c-format
+msgid " idct and motion compensation acceleration \n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1680
+#, c-format
+msgid " motion compensation acceleration only\n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1682
+#, c-format
+msgid " no XvMC support \n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1683
+#, c-format
+msgid " With Overlay = %d; UnsignedIntra = %d.\n"
+msgstr ""
+
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2738
+msgid "Make XvMC allocate more frames for better buffering."
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2739
+msgid ""
+"Some XvMC implementations allow more than 8 frames.\n"
+"This option, when turned on, makes the driver try to\n"
+"allocate 15 frames. A must for unichrome and live VDR.\n"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2745
+msgid "Unichrome cpu save"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2746
+msgid ""
+"Saves CPU time by sleeping while decoder works.\n"
+"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
+"Experimental.\n"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2752
+msgid "Fix buggy NVIDIA XvMC subpicture colours"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2753
+msgid ""
+"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
+"look blue and vice versa. This option provides a workaround.\n"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2758
+msgid "Use bob as accelerated deinterlace method."
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2759
+msgid ""
+"When interlacing is enabled for hardware accelerated frames,\n"
+"alternate between top and bottom field at double the frame rate.\n"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2765
+msgid "Don't use bob deinterlacing for progressive frames."
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2766
+msgid ""
+"Progressive frames don't need deinterlacing, so disabling it on\n"
+"demand should result in a better picture.\n"
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2772
+msgid "Don't use bob deinterlacing while a scaled OSD is active."
+msgstr ""
+
+#: src/video_out/video_out_xxmc.c:2773
+msgid ""
+"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
+"on demand should result in a better OSD picture.\n"
+msgstr ""
+
+#: src/video_out/x11osd.c:274 src/video_out/xcbosd.c:268
+#, c-format
+msgid "x11osd: XShape extension not available. unscaled overlay disabled.\n"
+msgstr ""
+
+#: src/video_out/x11osd.c:287 src/video_out/xcbosd.c:281
+#, c-format
+msgid "x11osd: error creating window. unscaled overlay disabled.\n"
+msgstr ""
+
+#: src/video_out/x11osd.c:295 src/video_out/x11osd.c:336
+#: src/video_out/xcbosd.c:291
+#, c-format
+msgid "x11osd: error creating pixmap. unscaled overlay disabled.\n"
+msgstr ""
+
+#: src/video_out/x11osd.c:346 src/video_out/xcbosd.c:330
+#, c-format
+msgid "x11osd: unscaled overlay created (%s mode).\n"
+msgstr ""
+
+#: src/video_out/xv_common.h:30
+msgid "autopaint colour key"
+msgstr ""
+
+#: src/video_out/xv_common.h:31
+msgid "Make Xv autopaint its colour key."
+msgstr ""
+
+#: src/video_out/xv_common.h:34
+msgid "bilinear scaling mode"
+msgstr ""
+
+#: src/video_out/xv_common.h:35
+msgid ""
+"Selects the bilinear scaling mode for Permedia cards. The individual values "
+"are:\n"
+"\n"
+"Permedia 2\n"
+"0 - disable bilinear filtering\n"
+"1 - enable bilinear filtering\n"
+"\n"
+"Permedia 3\n"
+"0 - disable bilinear filtering\n"
+"1 - horizontal linear filtering\n"
+"2 - enable full bilinear filtering"
+msgstr ""
+
+#: src/video_out/xv_common.h:53
+msgid "Xv port number"
+msgstr ""
+
+#: src/video_out/xv_common.h:54
+msgid "Selects the Xv port number to use (0 to autodetect)."
+msgstr ""
+
+#: src/video_out/xv_common.h:57
+msgid "pitch alignment workaround"
+msgstr ""
+
+#: src/video_out/xv_common.h:58
+msgid "Some buggy video drivers need a workaround to function properly."
+msgstr ""
+
+#: src/video_out/xv_common.h:73
+msgid "video display method preference"
+msgstr ""
+
+#: src/video_out/xv_common.h:74
+msgid ""
+"Selects which video output method is preferred. Detection is done using the "
+"reported Xv adaptor names.\n"
+"(Only applies when auto-detecting which Xv port to use.)"
+msgstr ""
+
+#: src/video_out/xv_common.h:81
+msgid "bicubic filtering"
+msgstr ""
+
+#: src/video_out/xv_common.h:82
+msgid ""
+"This option controls bicubic filtering of the video image. It may be used "
+"instead of, or as well as, xine's deinterlacers."
+msgstr ""
+
+#: src/xine-engine/alphablend.c:2150
+msgid "disable exact alpha blending of overlays"
+msgstr ""
+
+#: src/xine-engine/alphablend.c:2151
+msgid ""
+"If you experience a performance impact when an On Screen Display or other "
+"overlays like DVD subtitles are active, then you might want to enable this "
+"option.\n"
+"The result is that alpha blending of overlays is less accurate than before, "
+"but the CPU usage will be decreased as well."
+msgstr ""
+
+#: src/xine-engine/audio_decoder.c:371
+#, c-format
+msgid "audio_decoder: no plugin available to handle '%s'\n"
+msgstr ""
+
+#: src/xine-engine/audio_decoder.c:388
+#, c-format
+msgid "audio_decoder: error, unknown buffer type: %08x\n"
+msgstr ""
+
+#: src/xine-engine/audio_decoder.c:492
+msgid "number of audio buffers"
+msgstr ""
+
+#: src/xine-engine/audio_decoder.c:493
+msgid ""
+"The number of audio buffers (each is 8k in size) xine uses in its internal "
+"queue. Higher values mean smoother playback for unreliable inputs, but also "
+"increased latency and memory consumption."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:1123
+#, c-format
+msgid ""
+"audio_out: delay calculation impossible with an unavailable audio device\n"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:1262
+#, c-format
+msgid "write to sound card failed. Assuming the device was unplugged.\n"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:1442
+#, c-format
+msgid "8 bits not supported by driver, converting to 16 bits.\n"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:1450
+#, c-format
+msgid "mono not supported by driver, converting to stereo.\n"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:1456
+#, c-format
+msgid "stereo not supported by driver, converting to mono.\n"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2146
+msgid "method to sync audio and video"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2147
+msgid ""
+"When playing audio and video, there are at least two clocks involved: The "
+"system clock, to which video frames are synchronized and the clock in your "
+"sound hardware, which determines the speed of the audio playback. These "
+"clocks are never ticking at the same speed except for some rare cases where "
+"they are physically identical. In general, the two clocks will run drift "
+"after some time, for which xine offers two ways to keep audio and video "
+"synchronized:\n"
+"\n"
+"metronom feedback\n"
+"This is the standard method, which applies a countereffecting video drift, "
+"as soon as the audio drift has accumulated over a threshold.\n"
+"\n"
+"resample\n"
+"For some video hardware, which is limited to a fixed frame rate (like the "
+"DXR3 or other decoder cards) the above does not work, because the video "
+"cannot drift. Therefore we resample the audio stream to make it longer or "
+"shorter to compensate the audio drift error. This does not work for digital "
+"passthrough, where audio data is passed to an external decoder in digital "
+"form."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2175
+msgid "enable resampling"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2176
+msgid ""
+"When the sample rate of the decoded audio does not match the capabilities of "
+"your sound hardware, an adaptation called \"resampling\" is required. Here "
+"you can select, whether resampling is enabled, disabled or used "
+"automatically when necessary."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2183
+msgid "always resample to this rate (0 to disable)"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2184
+msgid ""
+"Some audio drivers do not correctly announce the capabilities of the audio "
+"hardware. By setting a value other than zero here, you can force the audio "
+"stream to be resampled to the given rate."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2193
+msgid "offset for digital passthrough"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2194
+msgid ""
+"If you use an external surround decoder and audio is ahead or behind video, "
+"you can enter a fixed offset here to compensate.\n"
+"The unit of the value is one PTS tick, which is the 90000th part of a second."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2203
+msgid "play audio even on slow/fast speeds"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2204
+msgid ""
+"If you enable this option, the audio will be heard even when playback speed "
+"is different than 1X. Of course, it will sound distorted (lower/higher "
+"pitch). If want to experiment preserving the pitch you may try the 'stretch' "
+"audio post plugin instead."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2277
+msgid "startup audio volume"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2278
+msgid "The overall audio volume set at xine startup."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2281
+msgid "restore volume level at startup"
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2282
+msgid "If disabled, xine will not modify any mixer settings at startup."
+msgstr ""
+
+#: src/xine-engine/audio_out.c:2314
+#, c-format
+msgid "audio_out: sorry, this should not happen. please restart xine.\n"
+msgstr ""
+
+#: src/xine-engine/buffer.c:70
+#, c-format
+msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:953
+#, c-format
+msgid "The current config file has been modified by a newer version of xine."
+msgstr ""
+
+#: src/xine-engine/configfile.c:1006
+#, c-format
+msgid "Loaded configuration from file '%s'\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1011
+#, c-format
+msgid "Failed to load configuration from file '%s': %s\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1068
+#, c-format
+msgid "configfile: WARNING: backing up configfile to %s failed\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1069
+#, c-format
+msgid "configfile: WARNING: your configuration will not be saved\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1169
+#, c-format
+msgid "configfile: WARNING: writing configuration to %s failed\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1170
+#, c-format
+msgid "configfile: WARNING: removing possibly broken config file %s\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1171
+#, c-format
+msgid "configfile: WARNING: you should check the backup file %s\n"
+msgstr ""
+
+#: src/xine-engine/configfile.c:1633
+#, c-format
+msgid "configfile: entry '%s' mustn't be modified from MRL\n"
+msgstr ""
+
+#: src/xine-engine/info_helper.c:228
+#, c-format
+msgid "info_helper: can't find out current locale character set\n"
+msgstr ""
+
+#: src/xine-engine/info_helper.c:242
+#, c-format
+msgid ""
+"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
+msgstr ""
+
+#: src/xine-engine/input_cache.c:172
+#, c-format
+msgid ": open() function should never be called\n"
+msgstr ""
+
+#: src/xine-engine/input_cache.c:355
+#, c-format
+msgid ": input plugin not defined!\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
+#, c-format
+msgid "input_rip: reading of saved data failed: %s\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:155
+#, c-format
+msgid "input_rip: reading by input plugin failed\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
+#, c-format
+msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:184
+#, c-format
+msgid "input_rip: open() function should never be called\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
+#, c-format
+msgid "input_rip: seeking failed\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
+#, c-format
+msgid "input_rip: seeking failed: %s\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:398
+#, c-format
+msgid "input_rip: %<PRIdMAX> bytes dropped\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:562
+#, c-format
+msgid "input_rip: input plugin not defined!\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:568
+#, c-format
+msgid ""
+"input_rip: target directory wasn't specified, please fill out the option "
+"'media.capture.save_dir'\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:570
+msgid ""
+"The stream save feature is disabled until you set media.capture.save_dir in "
+"the configuration."
+msgstr ""
+
+#: src/xine-engine/input_rip.c:577
+#, c-format
+msgid "input_rip: ripping/caching of this source is not permitted!\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:579
+msgid ""
+"xine is not allowed to save from this source. (possibly copyrighted "
+"material?)"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:585
+#, c-format
+msgid "input_rip: file name not given!\n"
+msgstr ""
+
+#: src/xine-engine/input_rip.c:627
+#, c-format
+msgid "input_rip: error opening file %s: %s\n"
+msgstr ""
+
+#: src/xine-engine/io_helper.c:254
+#, c-format
+msgid "io_helper: waiting abandoned\n"
+msgstr ""
+
+#: src/xine-engine/io_helper.c:261
+#, c-format
+msgid "io_helper: waiting failed: %s\n"
+msgstr ""
+
+#: src/xine-engine/io_helper.c:316
+msgid "failed to get status of socket"
+msgstr ""
+
+#: src/xine-engine/io_helper.c:391
+#, c-format
+msgid "io_helper: Permission denied\n"
+msgstr ""
+
+#: src/xine-engine/io_helper.c:395
+#, c-format
+msgid "io_helper: File not found\n"
+msgstr ""
+
+#: src/xine-engine/io_helper.c:399
+#, c-format
+msgid "io_helper: Connection Refused\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:216
+#, c-format
+msgid "map_decoder_list: no space for decoder, skipped.\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:331
+#, c-format
+msgid ""
+"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:391
+#, c-format
+msgid "priority for %s decoder"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:396
+msgid ""
+"The priority provides a ranking in case some media can be handled by more "
+"than one decoder.\n"
+"A priority of 0 enables the decoder's default priority."
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:424
+#, c-format
+msgid ""
+"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
+"use the default priority.\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:441
+#, c-format
+msgid ""
+"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
+"the default priority.\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:498
+#, c-format
+msgid "load_plugins: plugin %s found\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:501
+#, c-format
+msgid "load_plugins: static plugin found\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:508
+#, c-format
+msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:511
+#, c-format
+msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:528
+#, c-format
+msgid "load_plugins: unknown plugin type %d in %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:532
+#, c-format
+msgid "load_plugins: unknown statically linked plugin type %d\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:589
+#, c-format
+msgid "load_plugins: unable to stat %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:631
+#, c-format
+msgid ""
+"load_plugins: cannot open plugin lib %s:\n"
+"%s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:646
+#, c-format
+msgid ""
+"load_plugins: can't get plugin info from %s:\n"
+"%s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:664
+#, c-format
+msgid "load_plugins: skipping unreadable plugin directory %s.\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:732
+#, c-format
+msgid ""
+"load_plugins: cannot (stage 2) open plugin lib %s:\n"
+"%s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:766
+#, c-format
+msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1217
+#, c-format
+msgid "failed to save catalogue cache: %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1224
+#, c-format
+msgid "failed to replace catalogue cache: %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1230
+#, c-format
+msgid "failed to remove new catalogue cache: %s\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1492
+#, c-format
+msgid "load_plugins: unknown content detection strategy %d\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1617
+#, c-format
+msgid "load_plugins: using demuxer '%s'\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
+#, c-format
+msgid "load_plugins: failed to load audio output plugin <%s>\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:1989
+#, c-format
+msgid ""
+"load_plugins: audio output auto-probing didn't find any usable audio "
+"driver.\n"
+msgstr ""
+
+#: src/xine-engine/load_plugins.c:2299
+#, c-format
+msgid ""
+"load_plugins: cannot unload plugin lib %s:\n"
+"%s\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:934
+#, c-format
+msgid "font '%s-%d' already loaded, weird.\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:946
+#, c-format
+msgid "font '%s' loading failed (%d < %d)\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:956
+#, c-format
+msgid "wrong version for font '%s'. expected %d found %d.\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1043
+#, c-format
+msgid "osd: error matching font %s with FontConfig"
+msgstr ""
+
+#: src/xine-engine/osd.c:1057
+#, c-format
+msgid "osd: error loading font %s with FontConfig"
+msgstr ""
+
+#: src/xine-engine/osd.c:1061
+#, c-format
+msgid "osd: error looking up font %s with FontConfig"
+msgstr ""
+
+#: src/xine-engine/osd.c:1101
+#, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1136
+#, c-format
+msgid "osd: error setting font size (no scalable font?)\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1251
+#, c-format
+msgid ""
+"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
+"skipping\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1307
+#, c-format
+msgid "osd: can't find out current locale character set\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1317
+#, c-format
+msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
+#, c-format
+msgid "osd: font isn't defined\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1412
+#, c-format
+msgid "osd: error loading glyph\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1418
+#, c-format
+msgid "osd: error in rendering glyph\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1578
+#, c-format
+msgid "osd: error loading glyph %i\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1585
+#, c-format
+msgid "osd: error in rendering\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1890
+msgid "palette (foreground-border-background) to use for subtitles and OSD"
+msgstr ""
+
+#: src/xine-engine/osd.c:1891
+msgid ""
+"The palette for on-screen-display and some subtitle formats that do not "
+"specify any colouring themselves. The palettes are listed in the form: "
+"foreground-border-background."
+msgstr ""
+
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
+msgid ""
+"when watching live tv a discontinuity happens for example about every 26.5 "
+"hours due to a pts wrap.\n"
+"flushing the decoder at that time causes decoding errors for images after "
+"the pts wrap.\n"
+"to avoid the decoding errors, decoder flush at discontinuity should be "
+"disabled.\n"
+"\n"
+"WARNING: as the flush was introduced to fix some issues when playing DVD "
+"still images, it is\n"
+"likely that these issues may reappear in case they haven't been fixed "
+"differently meanwhile.\n"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:420
+#, c-format
+msgid "video_decoder: no plugin available to handle '%s'\n"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:499
+#, c-format
+msgid "video_decoder: error, unknown buffer type: %08x\n"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:537
+msgid "number of video buffers"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:538
+msgid ""
+"The number of video buffers (each is 8k in size) xine uses in its internal "
+"queue. Higher values mean smoother playback for unreliable inputs, but also "
+"increased latency and memory consumption."
+msgstr ""
+
+#: src/xine-engine/video_out.c:978
+#, c-format
+msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
+msgstr ""
+
+#: src/xine-engine/video_out.c:1153
+#, c-format
+msgid ""
+"video_out: throwing away image with pts %<PRId64> because it's too old "
+"(diff : %<PRId64>).\n"
+msgstr ""
+
+#: src/xine-engine/video_out.c:1180
+#, c-format
+msgid "video_out: just discarded first frame after seek\n"
+msgstr ""
+
+#: src/xine-engine/video_out.c:1508
+msgid "disable decoder flush from video out"
+msgstr ""
+
+#: src/xine-engine/video_out.c:1509
+msgid ""
+"video out causes a decoder flush when video out runs out of frames for "
+"displaying,\n"
+"because the decoder hasn't deliverd new frames for quite a while.\n"
+"flushing the decoder causes decoding errors for images decoded after the "
+"flush.\n"
+"to avoid the decoding errors, decoder flush at video out should be "
+"disabled.\n"
+"\n"
+"WARNING: as the flush was introduced to fix some issues when playing DVD "
+"still images, it is\n"
+"likely that these issues may reappear in case they haven't been fixed "
+"differently meanwhile.\n"
+msgstr ""
+
+#: src/xine-engine/video_out.c:2246
+msgid "default number of video frames"
+msgstr ""
+
+#: src/xine-engine/video_out.c:2247
+msgid ""
+"The default number of video frames to request from xine video out driver. "
+"Some drivers will override this setting with their own values."
+msgstr ""
+
+#: src/xine-engine/video_out.c:2304
+msgid "percentage of skipped frames to tolerate"
+msgstr ""
+
+#: src/xine-engine/video_out.c:2305
+msgid ""
+"When more than this percentage of frames are not shown, because they were "
+"not decoded in time, xine sends a notification."
+msgstr ""
+
+#: src/xine-engine/video_out.c:2310
+msgid "percentage of discarded frames to tolerate"
+msgstr ""
+
+#: src/xine-engine/video_out.c:2311
+msgid ""
+"When more than this percentage of frames are not shown, because they were "
+"not scheduled for display in time, xine sends a notification."
+msgstr ""
+
+#: src/xine-engine/video_out.c:2350
+#, c-format
+msgid "video_out: sorry, this should not happen. please restart xine.\n"
+msgstr ""
+
+#: src/xine-engine/vo_scale.c:384
+msgid "horizontal image position in the output window"
+msgstr ""
+
+#: src/xine-engine/vo_scale.c:385
+msgid ""
+"If the video window's horizontal size is bigger than the actual image to "
+"show, you can adjust the position where the image will be placed.\n"
+"The position is given as a percentage, so a value of 50 means \"in the middle"
+"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
+msgstr ""
+
+#: src/xine-engine/vo_scale.c:392
+msgid "vertical image position in the output window"
+msgstr ""
+
+#: src/xine-engine/vo_scale.c:393
+msgid ""
+"If the video window's vertical size is bigger than the actual image to show, "
+"you can adjust the position where the image will be placed.\n"
+"The position is given as a percentage, so a value of 50 means \"in the middle"
+"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
+msgstr ""
+
+#: src/xine-engine/vo_scale.c:400
+msgid "disable all video scaling"
+msgstr ""
+
+#: src/xine-engine/vo_scale.c:401
+msgid ""
+"If you want the video image to be always shown at its original resolution, "
+"you can disable all image scaling here.\n"
+"This of course means that the image will no longer adapt to the size of the "
+"video window and that videos with a pixel aspect ratio other than 1:1, like "
+"anamorphic DVDs, will be shown distorted. But on the other hand, with some "
+"video output drivers like XShm, where the image scaling is not hardware "
+"accelerated, this can dramatically reduce CPU usage."
+msgstr ""
+
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
+#, c-format
+msgid "xine: error while parsing mrl\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:918
+#, c-format
+msgid "xine: found input plugin : %s\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:935
+#, c-format
+msgid "xine: input plugin cannot open MRL [%s]\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:944
+#, c-format
+msgid "xine: cannot find input plugin for MRL [%s]\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:970
+#, c-format
+msgid "xine: specified demuxer %s failed to start\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1007
+#, c-format
+msgid "xine: join rip input plugin\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1014
+#, c-format
+msgid "xine: error opening rip input plugin instance\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1045
+#, c-format
+msgid "xine: last_probed demuxer %s failed to start\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1074
+#, c-format
+msgid "ignoring video\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1087
+#, c-format
+msgid "ignoring audio\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1100
+#, c-format
+msgid "ignoring subpicture\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1113
+#, c-format
+msgid "input cache plugin disabled\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1186
+#, c-format
+msgid "subtitle mrl opened '%s'\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1190
+#, c-format
+msgid "xine: error opening subtitle mrl\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1222
+#, c-format
+msgid "xine: error while parsing MRL\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1229
+#, c-format
+msgid "xine: changing option '%s' from MRL isn't permitted\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1260
+#, c-format
+msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1270
+#, c-format
+msgid "xine: couldn't find demux for >%s<\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1286
+#, c-format
+msgid "xine: found demuxer plugin: %s\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1308
+#, c-format
+msgid "xine: demuxer is already done. that was fast!\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1310
+#, c-format
+msgid "xine: demuxer failed to start\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1376
+#, c-format
+msgid "xine_play: no demux available\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1447
+#, c-format
+msgid "xine_play: demux failed to start\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1732
+#, c-format
+msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1737
+msgid "The specified save_dir might be a security risk."
+msgstr ""
+
+#: src/xine-engine/xine.c:1771
+#, c-format
+msgid "xine: locale not supported by C library\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1780
+msgid "media format detection strategy"
+msgstr ""
+
+#: src/xine-engine/xine.c:1781
+msgid ""
+"xine offers various methods to detect the media format of input to play. The "
+"individual values are:\n"
+"\n"
+"default\n"
+"First try to detect by content, then by file name extension.\n"
+"\n"
+"reverse\n"
+"First try to detect by file name extension, then by content.\n"
+"\n"
+"content\n"
+"Detect by content only.\n"
+"\n"
+"extension\n"
+"Detect by file name extension only.\n"
+msgstr ""
+
+#: src/xine-engine/xine.c:1799
+msgid "directory for saving streams"
+msgstr ""
+
+#: src/xine-engine/xine.c:1800
+msgid ""
+"When using the stream save feature, files will be written only into this "
+"directory.\n"
+"This setting is security critical, because when changed to a different "
+"directory, xine can be used to fill files in it with arbitrary content. So "
+"you should be careful that the directory you specify is robust against any "
+"content in any file."
+msgstr ""
+
+#: src/xine-engine/xine.c:1811
+msgid "allow implicit changes to the configuration (e.g. by MRL)"
+msgstr ""
+
+#: src/xine-engine/xine.c:1812
+msgid ""
+"If enabled, you allow xine to change your configuration without explicit "
+"actions from your side. For example configuration changes demanded by MRLs "
+"or embedded into playlist will be executed.\n"
+"This setting is security critcal, because xine can receive MRLs or playlists "
+"from untrusted remote sources. If you allow them to arbitrarily change your "
+"configuration, you might end with a totally messed up xine."
+msgstr ""
+
+#: src/xine-engine/xine.c:1826
+msgid "Timeout for network stream reading (in seconds)"
+msgstr ""
+
+#: src/xine-engine/xine.c:1827
+msgid ""
+"Specifies the timeout when reading from network streams, in seconds. Too low "
+"values might stop streaming when the source is slow or the bandwidth is "
+"occupied, too high values will freeze the player if the connection is lost."
+msgstr ""
+
+#: src/xine-engine/xine.c:2305
+msgid "messages"
+msgstr ""
+
+#: src/xine-engine/xine.c:2306
+msgid "plugin"
+msgstr ""
+
+#: src/xine-engine/xine.c:2307
+msgid "trace"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:971
+msgid "Warning:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:972
+msgid "Unknown host:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:973
+msgid "Unknown device:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:974
+msgid "Network unreachable"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:975
+msgid "Connection refused:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:976
+msgid "File not found:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:977
+msgid "Read error from:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:978
+msgid "Error loading library:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:979
+msgid "Encrypted media stream detected"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:980
+msgid "Security message:"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:981
+msgid "Audio device unavailable"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:982
+msgid "Permission error"
+msgstr ""
+
+#: src/xine-engine/xine_interface.c:983
+msgid "File is empty:"
+msgstr ""
+
+#: src/xine-utils/memcpy.c:492
+msgid "memcopy method used by xine"
+msgstr ""
+
+#: src/xine-utils/memcpy.c:493
+msgid ""
+"The copying of large memory blocks is one of the most expensive operations "
+"on todays computers. Therefore xine provides various tuned methods to do "
+"this copying. Usually, the best method is detected automatically."
+msgstr ""
+
+#: src/xine-utils/memcpy.c:520
+#, c-format
+msgid "Benchmarking memcpy methods (smaller is better):\n"
+msgstr ""
diff --git a/po/pl.po b/po/pl.po
index 7bb78102f..58b70e8f6 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pl_PL\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2003-05-24 12:36+0200\n"
"Last-Translator: Bartłomiej Muryn <_4ever_@irc.pl>\n"
"Language-Team: Polish <pl@li.org>\n"
@@ -274,212 +274,207 @@ msgid ""
msgstr ""
# src/audio_out/audio_alsa_out.c:1105
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
"wtyczka wyjścia dźwięku xine używająca sprzętu/sterowników kompatybilnych z "
"systemem alsa"
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "wtyczka wyjścia dźwięku używająca kde artsd"
-
-# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
#, fuzzy
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "wtyczka wyjścia dźwięku używająca kde artsd"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
# src/xine-engine/video_out.c:890
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, fuzzy, c-format
msgid ": can't create pthread condition: %s\n"
msgstr "video_out: nie mogę utworzyć wątku (%s)\n"
# src/xine-engine/video_out.c:890
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, fuzzy, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr "video_out: nie mogę utworzyć wątku (%s)\n"
# src/input/input_rtp.c:339
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, fuzzy, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
# src/xine-engine/video_out.c:890
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, fuzzy, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr "video_out: nie mogę utworzyć wątku (%s)\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ""
# src/xine-engine/video_out.c:890
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, fuzzy, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr "video_out: nie mogę utworzyć wątku (%s)\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ""
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
#, fuzzy
msgid "second xine audio output plugin using directx"
msgstr "wtyczka wyjścia dźwięku używająca kde artsd"
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
#, fuzzy
msgid "xine audio output plugin for win32 using directx"
msgstr "wtyczka wyjścia dźwięku używająca kde artsd"
@@ -512,12 +507,12 @@ msgid ""
msgstr ""
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "wtyczka wyjścia dźwięku używająca esound"
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
#, fuzzy
msgid "xine file audio output plugin"
msgstr "wtyczka wyjścia dźwięku używająca esound"
@@ -560,7 +555,7 @@ msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "wtyczka wyjścia dźwięku używająca kde artsd"
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
#, fuzzy
msgid "xine dummy audio output plugin"
msgstr "wtyczka wyjścia dźwięku używająca esound"
@@ -713,7 +708,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr ""
@@ -737,21 +732,21 @@ msgstr ""
# src/audio_out/audio_alsa_out.c:201 src/audio_out/audio_alsa_out.c:927
# src/audio_out/audio_esd_out.c:441
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
#, fuzzy
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "wtyczka wyjścia dźwięku używająca esound"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr ""
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr ""
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -759,172 +754,32 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr ""
# src/audio_out/audio_sun_out.c:748
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"wtyczka wyjścia dźwięku xine kompatybilna z urządzeniami/sterownikami sun"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-#, fuzzy
-msgid "MPEG-4 postprocessing quality"
-msgstr "jakość post-przetwarzania ffmpeg mpeg-4"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
+"ogg: ścieżka oznaczona jako vorbis ale nie znaleziono nagłówka strumienia "
+"vorbis.\n"
-# src/dxr3/dxr3_mpeg_encoders.c:182
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
+# src/xine-engine/xine.c:436
+#: src/combined/xine_ogg_demuxer.c:2173
#, fuzzy
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "dxr3enc: częstotliwość wyjśćia rte mpeg (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr ""
+msgid "Annodex demux plugin"
+msgstr "xine: nie mogę znaleźć demultiplexera dla >%s<\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
#: src/demuxers/demux_asf.c:450
@@ -945,6 +800,10 @@ msgstr ""
msgid "Media stream scrambled/encrypted"
msgstr ""
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Odtwarzanie indeksu..."
@@ -965,6 +824,10 @@ msgstr "demux_avi: index pliku avi uszkodzony\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr ""
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
# src/demuxers/demux_film.c:176
#: src/demuxers/demux_film.c:186
#, c-format
@@ -972,11 +835,15 @@ msgid "invalid FILM chunk size\n"
msgstr "nieprawidłowy rozmiar fragmentu filmu\n"
# src/demuxers/demux_film.c:254
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "nie rozpoznany fragment filmu\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -992,6 +859,12 @@ msgstr ""
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+# src/input/input_http.c:640
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "wtyczka wejścia VCD"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1007,19 +880,27 @@ msgstr ""
msgid "iff: unknown Chunk: %s\n"
msgstr ""
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, fuzzy, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
@@ -1027,13 +908,13 @@ msgstr ""
"nieznany typ bloku VOC (0x%02X); proszę skontaktować się z programistami "
"xine\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
# src/demuxers/demux_mpeg_block.c:456
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, fuzzy, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1042,25 +923,29 @@ msgstr ""
"demux_mpeg_block: uwaga: nagłówek pes wskazuje na to ze strumień może być "
"zaszyfrowany (tryb szyfrowania %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
# src/demuxers/demux_mpeg_block.c:456
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, fuzzy, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1069,7 +954,7 @@ msgstr ""
"demux_mpeg_block: uwaga: nagłówek pes wskazuje na to ze strumień może być "
"zaszyfrowany (tryb szyfrowania %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, fuzzy, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1078,12 +963,9 @@ msgstr ""
"nieznany typ kompresji VOC (0x%02X); proszę skontaktować się z programistami "
"xine\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
-"ogg: ścieżka oznaczona jako vorbis ale nie znaleziono nagłówka strumienia "
-"vorbis.\n"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1096,11 +978,22 @@ msgstr "demux_snd: błędne parametry nagłówka\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: niewspierany typ dźwięku %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "wtyczka wejścia pliku"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+# src/xine-engine/xine.c:436
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: nie mogę znaleźć demultiplexera dla >%s<\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1116,6 +1009,11 @@ msgstr ""
"nieznany typ kompresji VOC (0x%02X); proszę skontaktować się z programistami "
"xine\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "wtyczka wejścia pliku"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1127,38 +1025,42 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr "demux_wc3movie: Wystąpił problem przy ładowaniu fragmentów palety\n"
-# src/dxr3/dxr3.h:33
-#: src/dxr3/dxr3.h:30
-#, fuzzy
-msgid "DXR3 device number"
-msgstr "dxr3: nazwa urzÄ…dzenia"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1175,12 +1077,12 @@ msgid ""
msgstr ""
# src/dxr3/dxr3_decode_video.c:176
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
#, fuzzy
msgid "try to sync video every frame"
msgstr "próbuj synchronizować każdą ramkę"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1189,23 +1091,23 @@ msgid ""
msgstr ""
# src/dxr3/dxr3_decode_video.c:180
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
#, fuzzy
msgid "use smooth play mode"
msgstr "użyj alternatywnego trybu odtwarzania"
# src/dxr3/dxr3_decode_video.c:181 src/dxr3/video_out_dxr3.c:161
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "włączenie tej opcji użyje wygładzonego trybu odtwarzania"
# src/dxr3/dxr3_decode_video.c:184
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
#, fuzzy
msgid "correct frame durations in broken streams"
msgstr "korekta czasu trwania ramki w zepsutych strumieniach"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1213,62 +1115,74 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+# src/dxr3/dxr3.h:33
+#: src/dxr3/dxr3.h:34
+#, fuzzy
+msgid "DXR3 device number"
+msgstr "dxr3: nazwa urzÄ…dzenia"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
"16\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr ""
# src/dxr3/dxr3_mpeg_encoders.c:182
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
#, fuzzy
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "dxr3enc: częstotliwość wyjśćia rte mpeg (kbit/s)"
# src/dxr3/dxr3_mpeg_encoders.c:183
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
#, fuzzy
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
@@ -1276,28 +1190,28 @@ msgid ""
msgstr ""
"częstotliwość jaką biblioteka librte powinna użyć dla trybu kodowania dxr3"
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr ""
# src/dxr3/dxr3_mpeg_encoders.c:389
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
#, fuzzy
msgid "fame mpeg encoding quality"
msgstr "dxr3enc: jakość kodowania fame"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1316,12 +1230,16 @@ msgid ""
"clock as sync source."
msgstr ""
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
# src/dxr3/video_out_dxr3.c:153
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "zamiana lini parzystych i nieparzystych"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1329,47 +1247,47 @@ msgid ""
msgstr ""
# src/dxr3/video_out_dxr3.c:156
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
#, fuzzy
msgid "add black bars to correct aspect ratio"
msgstr "dodanie czarnch pasków w celu skorygowania proporcji"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
# src/dxr3/video_out_dxr3.c:160
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
#, fuzzy
msgid "use smooth play mode for mpeg encoder playback"
msgstr "dxr3: użyj alternatywnego trybu odtwarzania dla kodera mpeg"
# src/dxr3/dxr3_decode_video.c:181 src/dxr3/video_out_dxr3.c:161
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
#, fuzzy
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr "włączenie tej opcji użyje wygładzonego trybu odtwarzania"
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr ""
# src/dxr3/video_out_dxr3.c:221
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
#, fuzzy
msgid "encoder for non mpeg content"
msgstr "koder do zawartości nie-mpeg"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1383,22 +1301,22 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1409,7 +1327,7 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1421,12 +1339,12 @@ msgid ""
msgstr ""
# src/dxr3/video_out_dxr3.c:260
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
#, fuzzy
msgid "video output mode (TV or overlay)"
msgstr "dxr3: tryb wyjścia tv (tv lub overlay)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1459,12 +1377,12 @@ msgid ""
msgstr ""
# src/dxr3/video_out_dxr3.c:287
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
#, fuzzy
msgid "overlay colour key value"
msgstr "dxr3: wartość koloru kluczowego dla overlay"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
@@ -1472,12 +1390,12 @@ msgid ""
msgstr ""
# src/dxr3/video_out_dxr3.c:290
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
#, fuzzy
msgid "overlay colour key tolerance"
msgstr "dxr3: zakres koloru kluczowego"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1485,31 +1403,31 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
#, fuzzy
msgid "crop the overlay area at top and bottom"
msgstr ""
"Obcięcie obszaru overlay z góry i z dołu aby uniknąć wyświetlania zielonych "
"linii"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr ""
# src/dxr3/video_out_dxr3.c:303
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
#, fuzzy
msgid "preferred tv mode"
msgstr "dxr3: wybór trybu tv"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1519,61 +1437,61 @@ msgid ""
"default: keep the card's setting"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
"video_out_dxr3: Read the README.dxr3 for details.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
# src/input/input_http.c:134
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, fuzzy, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "http: nie mogę się podłączyć do >%s<\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr ""
# src/input/input_net.c:138
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, fuzzy, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_net: nie mogę podłączyć się do '%s'.\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr ""
# src/audio_out/audio_alsa_out.c:201 src/audio_out/audio_alsa_out.c:927
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
#, fuzzy
msgid "device used for CD audio"
msgstr "urządzenie użyte do wyjścia 4-kanałowego"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1582,11 +1500,11 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1594,31 +1512,19 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr ""
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr ""
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1628,212 +1534,207 @@ msgid ""
msgstr ""
# src/input/input_http.c:98
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, fuzzy, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
# src/input/input_http.c:98
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, fuzzy, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr ""
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr ""
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
# src/input/input_http.c:98
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, fuzzy, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
# src/input/input_http.c:98
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, fuzzy, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr ""
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
"T)\n"
msgstr ""
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
"C)\n"
msgstr ""
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
"A)\n"
msgstr ""
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr ""
# src/input/input_rtp.c:339
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, fuzzy, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
msgstr ""
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
#, fuzzy
msgid "DVB (Digital TV) input plugin"
msgstr "wtyczka wejścia pliku"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr ""
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr ""
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
msgstr ""
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr ""
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr ""
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
# src/audio_out/audio_alsa_out.c:181 src/audio_out/audio_alsa_out.c:728
# src/audio_out/audio_alsa_out.c:913 src/audio_out/audio_alsa_out.c:957
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1776
#, fuzzy
msgid "device used for DVD playback"
msgstr "urządzenie użyte w trybie mono"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
msgstr ""
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr ""
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1844,70 +1745,55 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr ""
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-# src/input/input_vcd.c:1184
-#: src/input/input_dvd.c:1833
-#, fuzzy
-msgid "path to the title key cache"
-msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr ""
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr ""
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr ""
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1926,11 +1812,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr ""
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1944,11 +1830,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1966,140 +1852,140 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: błąd odczytu (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr ""
# src/input/input_file.c:353
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, fuzzy, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: błąd odczytu (%s)\n"
# src/input/input_file.c:353
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, fuzzy, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: błąd odczytu (%s)\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "wtyczka wejścia pliku"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "miejsce startu nawigatora plików"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "listowanie ukrytych plików"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr ""
# src/input/input_net.c:302
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
#, fuzzy
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "wtyczka wejścia net dostarczana z xine"
# src/input/input_rtp.c:339
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, fuzzy, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
# src/input/input_http.c:416 src/input/input_http.c:537
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: błąd odczytu %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr ""
# src/input/input_http.c:445
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: błędna odpowiedź http\n"
# src/input/input_http.c:450
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: przekierowanie 3xx: >%d %s<\n"
# src/input/input_http.c:455
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: status http nie jest 2xx: >%d %s<\n"
# src/input/input_http.c:464
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, fuzzy, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: długość zawartości = %Ld bytes\n"
# src/input/input_http.c:416 src/input/input_http.c:537
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, fuzzy, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: błąd odczytu %d\n"
# src/input/input_http.c:640
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "wtyczka wejścia http"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr ""
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr ""
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr ""
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr ""
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2108,111 +1994,111 @@ msgid ""
msgstr ""
# src/input/input_http.c:640
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
#, fuzzy
msgid "mms streaming input plugin"
msgstr "wtyczka strumienia standardowego wejścia"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr ""
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr ""
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
msgstr ""
# src/input/input_net.c:102
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
# src/input/input_net.c:111
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
# src/input/input_net.c:126
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: nie mogę znaleźć IP dla '%s'.\n"
# src/input/input_net.c:138
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: nie mogę podłączyć się do '%s'.\n"
# src/input/input_net.c:302
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "wtyczka wejścia net dostarczana z xine"
# src/input/input_http.c:640
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
#, fuzzy
msgid "pnm streaming input plugin"
msgstr "wtyczka strumienia standardowego wejścia"
# src/input/input_rtp.c:339
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, fuzzy, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr ""
# src/input/input_file.c:353
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, fuzzy, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_file: błąd odczytu (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr ""
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr ""
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr ""
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr ""
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr ""
+
# src/input/input_rtp.c:157
#: src/input/input_rtp.c:183
#, fuzzy, c-format
@@ -2270,182 +2156,182 @@ msgstr "nie da się dowiązać do '%s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: zatrzymuje odczyt wÄ…tku...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: odczyt wątku zakończony\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr ""
# src/input/input_rtp.c:339
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
# src/input/input_net.c:302
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "wtyczka wejścia RTP i UDP dostarczana z xine"
# src/input/input_http.c:640
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
#, fuzzy
msgid "rtsp streaming input plugin"
msgstr "wtyczka strumienia standardowego wejścia"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr ""
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr ""
# src/input/input_http.c:98
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, fuzzy, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
# src/input/input_http.c:640
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "wtyczka strumienia standardowego wejścia"
# src/input/net_buf_ctrl.c:67
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
#, fuzzy
msgid "Buffer underrun..."
msgstr "Buforowanie..."
# src/input/net_buf_ctrl.c:67
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
#, fuzzy
msgid "Buffer overrun..."
msgstr "Buforowanie..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr ""
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr ""
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
#, fuzzy
msgid "v4l tv input plugin"
msgstr "wtyczka wejścia pliku"
-#: src/input/input_v4l.c:1874
-#, fuzzy
-msgid "v4l radio input plugin"
-msgstr "wtyczka wejścia pliku"
-
# src/input/input_vcd.c:1184
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
#, fuzzy
msgid "v4l video device"
msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
# src/input/input_vcd.c:1184
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
#, fuzzy
msgid "The path to your Video4Linux video device."
msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
# src/input/input_vcd.c:1184
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
# src/input/input_vcd.c:1184
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
+#: src/input/input_v4l.c:1946
+#, fuzzy
+msgid "v4l radio input plugin"
+msgstr "wtyczka wejścia pliku"
+
# src/input/input_vcd.c:1184
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1954
#, fuzzy
msgid "v4l radio device"
msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
# src/input/input_vcd.c:1184
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
#, fuzzy
msgid "The path to your Video4Linux radio device."
msgstr "ścieżka dostępu do pliku lokalnego urządzenia vcd"
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr ""
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr ""
-# src/input/input_http.c:640
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "wtyczka wejścia VCD"
-
# src/input/input_rtp.c:205
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, fuzzy, c-format
msgid "unable to open %s: %s.\n"
msgstr "nie mogę znaleźć IP dla '%s'.\n"
# src/input/input_net.c:126
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, fuzzy, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_net: nie mogę znaleźć IP dla '%s'.\n"
+# src/input/input_http.c:640
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "wtyczka wejścia VCD"
+
# src/audio_out/audio_alsa_out.c:181 src/audio_out/audio_alsa_out.c:728
# src/audio_out/audio_alsa_out.c:913 src/audio_out/audio_alsa_out.c:957
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1082
#, fuzzy
msgid "device used for VCD playback"
msgstr "urządzenie użyte w trybie mono"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr ""
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr ""
# src/input/input_http.c:134
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, fuzzy, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "http: nie mogę się podłączyć do >%s<\n"
@@ -2529,7 +2415,7 @@ msgstr ""
msgid "Buffering..."
msgstr "Buforowanie..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2537,13 +2423,13 @@ msgid ""
msgstr ""
# src/input/input_net.c:138
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, fuzzy, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_net: nie mogę podłączyć się do '%s'.\n"
# src/input/input_http.c:98
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, fuzzy, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
@@ -2592,98 +2478,98 @@ msgstr ""
msgid "Invalid current entry type"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2704,11 +2590,11 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2716,11 +2602,11 @@ msgid ""
"See the help for the title_format for the meanings of these."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2737,91 +2623,174 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
msgstr ""
-# src/xine-engine/audio_out.c:868
-#: src/liba52/xine_a52_decoder.c:820
-#, fuzzy
-msgid "A/52 volume"
-msgstr "głośność dźwięku"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr ""
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
msgstr ""
-# src/liba52/xine_decoder.c:577
-#: src/liba52/xine_a52_decoder.c:829
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
#, fuzzy
-msgid "use A/52 dynamic range compression"
-msgstr "włączanie dynamicznego zakresu kompensacji a/52"
+msgid "dv audio decoder plugin"
+msgstr "wtyczka wejścia pliku"
-#: src/liba52/xine_a52_decoder.c:830
+# src/dxr3/dxr3_mpeg_encoders.c:182
+#: src/dxr3/ffmpeg_encoder.c:170
+#, fuzzy
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "dxr3enc: częstotliwość wyjśćia rte mpeg (kbit/s)"
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-# src/liba52/xine_decoder.c:580
-#: src/liba52/xine_a52_decoder.c:837
-#, fuzzy
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "włącz redukcję dźwięku do 2.0 surround stereo"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr ""
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+#, fuzzy
+msgid "MPEG-4 postprocessing quality"
+msgstr "jakość post-przetwarzania ffmpeg mpeg-4"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
# src/libw32dll/w32codec.c:1404 src/libw32dll/w32codec.c:1453
@@ -2839,11 +2808,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2864,146 +2828,178 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr ""
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
# src/libspucc/xine_decoder.c:220
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/spu_dec/xine_cc_decoder.c:199
#, fuzzy
msgid "display closed captions in MPEG-2 streams"
msgstr "włącz closed-caption w strumieniach mpeg-2"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
# src/libspucc/xine_decoder.c:227
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
#, fuzzy
msgid "closed-captioning foreground/background scheme"
msgstr "schemat (tło/napisy) dla closed-caption"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr ""
# src/libspucc/xine_decoder.c:233
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
#, fuzzy
msgid "standard closed captioning font"
msgstr "standardowa czcionka dla closed-caption"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr ""
# src/libspucc/xine_decoder.c:239
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
#, fuzzy
msgid "italic closed captioning font"
msgstr "czcionka italic dla closed-caption"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr ""
# src/libspucc/xine_decoder.c:245
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
#, fuzzy
msgid "closed captioning font size"
msgstr "rozmiar czcionki closed-caption"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
# src/libspucc/xine_decoder.c:250
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
#, fuzzy
msgid "center-adjust closed captions"
msgstr "centrowanie closed-caption"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
+# src/libspucc/xine_decoder.c:245
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "rozmiar czcionki closed-caption"
+
# src/libsputext/xine_decoder.c:1078
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/cmml_decoder.c:468
#, fuzzy
msgid "font for external subtitles"
msgstr "fonty dla zewnętrznych napisów"
# src/libsputext/xine_decoder.c:1084
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
#, fuzzy
msgid "subtitle vertical offset (relative window size)"
msgstr "pionowe wyrównanie napisów (względny rozmiar okna)"
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
# src/libsputext/xine_decoder.c:1078
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:505
#, fuzzy
msgid "encoding of subtitles"
msgstr "kodowanie napisów"
-#: src/libsputext/demux_sputext.c:1480
+# src/xine-engine/xine.c:436
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: nie mogę znaleźć demultiplexera dla >%s<\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr ""
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
"in the subtitle being shown until the next one takes over."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
# src/libsputext/xine_decoder.c:1084
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
#, fuzzy
msgid "subtitle vertical offset"
msgstr "pionowe wyrównanie napisów (względny rozmiar okna)"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
# src/libsputext/xine_decoder.c:1078
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
#, fuzzy
msgid "font for subtitles"
msgstr "fonty dla zewnętrznych napisów"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr ""
# src/libsputext/xine_decoder.c:1078
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
#, fuzzy
msgid "encoding of the subtitles"
msgstr "kodowanie napisów"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3011,11 +3007,11 @@ msgid ""
"used."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3096,31 +3092,148 @@ msgstr ""
msgid "w32codec: Error initializing DMO Audio\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+# src/audio_out/audio_esd_out.c:441
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "wtyczka wyjścia dźwięku używająca esound"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+# src/xine-engine/audio_out.c:868
+#: src/audio_dec/xine_a52_decoder.c:803
+#, fuzzy
+msgid "A/52 volume"
+msgstr "głośność dźwięku"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+# src/liba52/xine_decoder.c:577
+#: src/audio_dec/xine_a52_decoder.c:812
+#, fuzzy
+msgid "use A/52 dynamic range compression"
+msgstr "włączanie dynamicznego zakresu kompensacji a/52"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+# src/liba52/xine_decoder.c:580
+#: src/audio_dec/xine_a52_decoder.c:820
+#, fuzzy
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "włącz redukcję dźwięku do 2.0 surround stereo"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr ""
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3128,6 +3241,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3139,6 +3256,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3163,6 +3284,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3173,6 +3298,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3229,48 +3358,60 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr ""
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr ""
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
msgstr ""
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr ""
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr ""
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr ""
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3282,7 +3423,12 @@ msgid ""
" h: the height of the picture\n"
msgstr ""
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3301,6 +3447,10 @@ msgid ""
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3316,20 +3466,8 @@ msgid ""
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
msgstr ""
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3356,7 +3494,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3371,7 +3538,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3389,7 +3556,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3397,12 +3568,18 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
msgstr ""
+# src/libdivx4/xine_decoder.c:602
+#: src/post/planar/pp.c:172
+#, fuzzy
+msgid "plugin for ffmpeg libpostprocess"
+msgstr "użyj wtyczki divx4 dla strumieni msmpeg4v3"
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3431,13 +3608,135 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+# src/xine-engine/video_out.c:890
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr "video_out: nie mogę utworzyć wątku (%s)\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: zatrzymuje odczyt wÄ…tku...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, fuzzy, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "RTP: odczyt wątku zakończony\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: zatrzymuje odczyt wÄ…tku...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "RTP: odczyt wątku zakończony\n"
+
+# src/input/input_http.c:98
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "input_http: otwarcie gniazda zawiodło\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+# src/input/input_http.c:98
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "input_http: otwarcie gniazda zawiodło\n"
+
+# src/input/input_http.c:134
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "http: nie mogę się podłączyć do >%s<\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+# src/input/input_http.c:134
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "http: nie mogę się podłączyć do >%s<\n"
+
+# src/input/input_http.c:98
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "input_http: otwarcie gniazda zawiodło\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+# src/input/input_rtp.c:339
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
# src/video_out/video_out_aa.c:307
-#: src/video_out/video_out_aa.c:308
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "wtyczka wyjścia obrazu xine używająca biblioteki ascii-art"
# src/video_out/video_out_aa.c:307
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
#, fuzzy
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "wtyczka wyjścia obrazu xine używająca biblioteki ascii-art"
@@ -3481,8 +3780,8 @@ msgid "video colour key"
msgstr "dxr3: wartość koloru kluczowego dla overlay"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3554,33 +3853,33 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr ""
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr ""
# src/video_out/video_out_directfb.c:569
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
#, fuzzy
msgid "xine video output plugin using DirectFB."
msgstr "wtyczka wyjścia obrazu xine używająca biblioteki DirectFB"
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
# src/video_out/video_out_directfb.c:569
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
#, fuzzy
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "wtyczka wyjścia obrazu xine używająca biblioteki DirectFB"
@@ -3599,12 +3898,12 @@ msgid ""
msgstr ""
# src/video_out/video_out_vidix.c:869
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
#, fuzzy
msgid "xine video output plugin for win32 using directx"
msgstr "wtyczka wyjścia obrazu xine używająca libvidix dla X11"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -3612,12 +3911,12 @@ msgid ""
msgstr ""
# src/video_out/video_out_fb.c:721
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
#, fuzzy
msgid "framebuffer device name"
msgstr "urzÄ…dzenie buforu ramki"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3625,57 +3924,56 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
+#: src/video_out/video_out_fb.c:876
#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:950
+#: src/video_out/video_out_fb.c:933
#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+msgid "%s: %d video RAM buffers are available.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
# src/video_out/video_out_fb.c:885
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
"xtyczka wyjścia obrazu xine używająca linuxowego urządzenia buforu ramki"
# src/video_out/video_out_vidix.c:869
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
#, fuzzy
msgid "xine video output plugin which displays nothing"
msgstr "wtyczka wyjścia obrazu xine używająca libvidix dla X11"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr ""
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3704,22 +4002,22 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr ""
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr ""
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
@@ -3727,7 +4025,7 @@ msgid ""
msgstr ""
# src/video_out/video_out_opengl.c:1124
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
#, fuzzy
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "wtyczka wyjścia obrazu xine używająca OpenGL - TNG"
@@ -3747,6 +4045,14 @@ msgstr ""
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
+# src/video_out/video_out_fb.c:885
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+"wtyczka wyjścia obrazu xine używająca libvidix dla linuxowego urządzenia "
+"buforu ramki"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3780,59 +4086,67 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr ""
# src/dxr3/video_out_dxr3.c:287
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
#, fuzzy
msgid "video overlay colour key"
msgstr "dxr3: wartość koloru kluczowego dla overlay"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+# src/video_out/video_out_fb.c:885
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+"wtyczka wyjścia obrazu xine używająca libvidix dla linuxowego urządzenia "
+"buforu ramki"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr ""
@@ -3855,204 +4169,136 @@ msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr ""
# src/video_out/video_out_sdl.c:696
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "wtyczka wyjścia obrazu xine używająca Simple Direct Media Layer"
# src/video_out/video_out_aa.c:307
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
#, fuzzy
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr "wtyczka wyjścia obrazu xine używająca biblioteki ascii-art"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-# src/video_out/video_out_syncfb.c:1170
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"wtyczka wyjścia obrazu xine używająca modułu SyncFB dla kart Matrox G200/G400"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr ""
# src/dxr3/video_out_dxr3.c:290
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
#, fuzzy
msgid "video overlay colour key red component"
msgstr "dxr3: zakres koloru kluczowego"
# src/dxr3/video_out_dxr3.c:290
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
#, fuzzy
msgid "video overlay colour key green component"
msgstr "dxr3: zakres koloru kluczowego"
# src/dxr3/video_out_dxr3.c:287
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
#, fuzzy
msgid "video overlay colour key blue component"
msgstr "dxr3: wartość koloru kluczowego dla overlay"
# src/video_out/video_out_vidix.c:869
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "wtyczka wyjścia obrazu xine używająca libvidix dla X11"
# src/video_out/video_out_fb.c:885
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
"wtyczka wyjścia obrazu xine używająca libvidix dla linuxowego urządzenia "
"buforu ramki"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
+msgstr ""
+
+# src/video_out/video_out_xshm.c:1445
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
+#, fuzzy, c-format
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
+"wtyczka wyjścia obrazu xine używajaca rozszerzenie dzielonej pamięci MIT X"
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4062,80 +4308,77 @@ msgid ""
"\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
msgstr ""
# src/video_out/video_out_xshm.c:1445
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
"wtyczka wyjścia obrazu xine używajaca rozszerzenie dzielonej pamięci MIT X"
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -4143,327 +4386,139 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1592
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
+msgid "%s: this adaptor supports the %s format.\n"
msgstr ""
# src/video_out/video_out_xv.c:1479
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "wtyczka wyjścia obrazu xine używająca rozszerzenia obrazu MIT X"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:210
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:220
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-# src/video_out/video_out_xv.c:1479
-#: src/video_out/video_out_xvmc.c:1608
-#, fuzzy
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "wtyczka wyjścia obrazu xine używająca rozszerzenia obrazu MIT X"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
"port.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
" for hardware colour space conversion and scaling\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr ""
+# src/video_out/video_out_xv.c:1479
+#: src/video_out/video_out_xvmc.c:1696
+#, fuzzy
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "wtyczka wyjścia obrazu xine używająca rozszerzenia obrazu MIT X"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4571,59 +4626,59 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr ""
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
#, fuzzy
msgid "method to sync audio and video"
msgstr "wybierz metodę synchronizacji dźwięku z obrazem"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4646,11 +4701,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr ""
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4659,34 +4714,34 @@ msgid ""
msgstr ""
# src/xine-engine/audio_out.c:828
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
#, fuzzy
msgid "always resample to this rate (0 to disable)"
msgstr "jeśli !=0 zawsze ponowne próbkowanie do podanej częstotliwości"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr ""
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4695,24 +4750,24 @@ msgid ""
msgstr ""
# src/xine-engine/audio_out.c:868
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
#, fuzzy
msgid "startup audio volume"
msgstr "głośność dźwięku"
# src/xine-engine/audio_out.c:872
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
#, fuzzy
msgid "The overall audio volume set at xine startup."
msgstr "przywracanie głośności przy starcie"
# src/xine-engine/audio_out.c:872
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "przywracanie głośności przy starcie"
# src/xine-engine/audio_out.c:873
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
#, fuzzy
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
@@ -4720,60 +4775,60 @@ msgstr ""
"starcie"
# src/xine-engine/video_out.c:893
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, fuzzy, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: przykro mi, to nie powinno sie zdarzyć.\n"
"Proszę ponownie uruchomić xine.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
# src/input/input_http.c:98
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_http: otwarcie gniazda zawiodło\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr ""
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr ""
@@ -4789,153 +4844,153 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr "osd: niewspierana konwersja %s -> UCS-2\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, fuzzy, c-format
msgid ": input plugin not defined!\n"
msgstr "osd: nie został zdefiniowany font\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr ""
# src/input/input_http.c:640
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, fuzzy, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "wtyczka strumienia standardowego wejścia"
# src/input/input_rtp.c:339
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, fuzzy, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rtp: nie mogę utworzyć nowego wątku (%s)\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr ""
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr ""
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr ""
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
"'media.capture.save_dir'\n"
msgstr ""
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
msgstr ""
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr ""
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr ""
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr ""
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr ""
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr ""
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr ""
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr ""
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -4943,49 +4998,49 @@ msgid ""
msgstr ""
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: wtyczka %s znaleziona\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, fuzzy, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: wtyczka %s znaleziona\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: wtyczka %s znaleziona\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr "load_plugins: wtyczka %s znaleziona\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: nieznany typ wtyczki %d w %s\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, fuzzy, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: nieznany typ wtyczki %d w %s\n"
# src/xine-engine/load_plugins.c:520
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: nie udał się start %s\n"
# src/xine-engine/load_plugins.c:138
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, fuzzy, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -4995,7 +5050,7 @@ msgstr ""
"%s\n"
# src/xine-engine/load_plugins.c:300
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5005,13 +5060,13 @@ msgstr ""
"%s\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: pomijanie katalogu wtyczek nie do odczytu %s.\n"
# src/xine-engine/load_plugins.c:138
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5021,47 +5076,53 @@ msgstr ""
"%s\n"
# src/xine-engine/load_plugins.c:300
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, fuzzy, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr ""
"load_plugins: nie mogę pobrać informacji z %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:1092
+# src/input/input_rtp.c:205
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "nie mogę znaleźć IP dla '%s'.\n"
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, fuzzy, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: nieznany typ wtyczki %d w %s\n"
# src/xine-engine/load_plugins.c:153
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, fuzzy, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: wtyczka %s znaleziona\n"
# src/xine-engine/load_plugins.c:520
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, fuzzy, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: nie udał się start %s\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5069,7 +5130,7 @@ msgid ""
msgstr ""
# src/xine-engine/load_plugins.c:138
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, fuzzy, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5078,52 +5139,52 @@ msgstr ""
"load_plugins: nie mogę (etap 2) otworzyć biblioteki wtyczki %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr ""
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr ""
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
#, c-format
-msgid "osd: error loading font %s with ft2\n"
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr ""
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5132,59 +5193,67 @@ msgstr ""
"osd: nieznana sekwencja zaczynajÄ…ca siÄ™ od bajtu 0x%02X w kodowaniu \"%s\", "
"pomijanie\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: nie można znaleźć zestawu znaków dla aktualnej lokalizacji\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, fuzzy, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: niewspierana konwersja %s -> UCS-2\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: nie został zdefiniowany font\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr ""
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, fuzzy, c-format
msgid "osd: error in rendering\n"
msgstr "osd: nie został zdefiniowany font\n"
# src/xine-engine/osd.c:863
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
#, fuzzy
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "paleta użyta przy napisach (tło-napisy-kontur)"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5199,21 +5268,21 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr ""
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5221,29 +5290,29 @@ msgid ""
msgstr ""
# src/xine-engine/video_out.c:308
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d ramek dostarczonych, %d ramek pominiętych, %d ramek porzuconych\n"
# src/xine-engine/video_out.c:351
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, fuzzy, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
"(diff : %<PRId64>).\n"
msgstr "video_out: odrzucam obraz o pts %lld bo jest za stary (diff : %lld).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5259,49 +5328,49 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr ""
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
# src/xine-engine/video_out.c:893
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: przykro mi, to nie powinno sie zdarzyć.\n"
"Proszę ponownie uruchomić xine.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5309,11 +5378,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5322,12 +5391,12 @@ msgid ""
msgstr ""
# src/video_out/video_out_fb.c:705 src/video_out/video_out_xshm.c:1283
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
#, fuzzy
msgid "disable all video scaling"
msgstr "wyłącz skalowanie obrazu (szybsze!)"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5338,159 +5407,159 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr ""
# src/xine-engine/xine.c:415
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, fuzzy, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: nie mogę znaleźć wtyczki wejścia dla tego MRL\n"
# src/xine-engine/xine.c:415
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, fuzzy, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: nie mogę znaleźć wtyczki wejścia dla tego MRL\n"
# src/xine-engine/xine.c:415
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, fuzzy, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: nie mogę znaleźć wtyczki wejścia dla tego MRL\n"
# src/xine-engine/xine.c:471
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: zawiódł start wybranego demultiplexera %s\n"
# src/input/input_http.c:640
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, fuzzy, c-format
msgid "xine: join rip input plugin\n"
msgstr "wtyczka wejścia VCD"
# src/input/input_http.c:640
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, fuzzy, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "wtyczka wejścia VCD"
# src/xine-engine/xine.c:471
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: zawiódł start ostatnio próbowanego demultiplexera %s\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr ""
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr ""
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr ""
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr ""
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr ""
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr ""
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr ""
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr ""
# src/xine-engine/xine.c:436
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: nie mogę znaleźć demultiplexera dla >%s<\n"
# src/xine-engine/xine.c:436
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: nie mogę znaleźć demultiplexera dla >%s<\n"
# src/xine-engine/xine.c:436
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, fuzzy, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: nie mogę znaleźć demultiplexera dla >%s<\n"
# src/xine-engine/xine.c:471
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, fuzzy, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: zawiódł start demultiplexera\n"
# src/xine-engine/xine.c:471
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: zawiódł start demultiplexera\n"
# src/xine-engine/xine.c:471
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: brak dostępnego demultiplexera\n"
# src/xine-engine/xine.c:471
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: zawiódł start demultiplexera\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr ""
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr ""
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5508,11 +5577,11 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr ""
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5522,11 +5591,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5536,11 +5605,11 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
@@ -5548,85 +5617,85 @@ msgid ""
msgstr ""
# src/xine-engine/xine.c:1025
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "wiadomości"
# src/xine-engine/xine.c:1026
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "wtyczka"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr ""
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr ""
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr ""
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr ""
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr ""
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr ""
# src/input/input_file.c:353
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
#, fuzzy
msgid "File not found:"
msgstr "input_file: błąd odczytu (%s)\n"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr ""
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr ""
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr ""
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr ""
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr ""
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr ""
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr ""
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr ""
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 262946b27..0b8376291 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 0.9.13\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2002-01-22 18:31GMT-3\n"
"Last-Translator: Marcelo Roberto Jimenez <mroberto@cetuc.puc-rio.br>\n"
"Language-Team: Portuguese (Brazilian) <pt_BR@li.org>\n"
@@ -265,200 +265,196 @@ msgid ""
"See the alsa documentation for information on alsa devices."
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr ""
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, fuzzy, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "incapaz de alocar buffer de entrada.\n"
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, fuzzy, c-format
msgid ": can't create pthread condition: %s\n"
msgstr "video_out : não consigo criar thread (%s)\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, fuzzy, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr "video_out : não consigo criar thread (%s)\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, fuzzy, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr "demux_qt: não consigo criar um novo thread (%s)\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, fuzzy, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr "demux_qt: não consigo criar um novo thread (%s)\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, fuzzy, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr "video_out : não consigo criar thread (%s)\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
#, fuzzy
msgid "second xine audio output plugin using directx"
msgstr "http network stream input plugin"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr ""
@@ -488,11 +484,11 @@ msgid ""
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr ""
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
#, fuzzy
msgid "xine file audio output plugin"
msgstr "http network stream input plugin"
@@ -528,7 +524,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr ""
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr ""
@@ -676,7 +672,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, fuzzy, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "input_cda: open(%s) failed: %s.\n"
@@ -693,21 +689,21 @@ msgstr ""
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
#, fuzzy
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "http network stream input plugin"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, fuzzy, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "input_cda: opening server '%s:%d' failed: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr ""
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -715,167 +711,27 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, fuzzy, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "input_cda: opening server '%s:%d' failed: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr ""
+#: src/combined/xine_ogg_demuxer.c:2173
+#, fuzzy
+msgid "Annodex demux plugin"
+msgstr "xine: usando o plugin de demuxer >%s< para este MRL.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
#: src/demuxers/demux_asf.c:450
@@ -896,6 +752,10 @@ msgstr ""
msgid "Media stream scrambled/encrypted"
msgstr ""
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr ""
@@ -915,16 +775,24 @@ msgstr "demux_avi: o índice do avi está quebrado\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr "demux_avi: ir para o início do vídeo falhou\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr ""
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr ""
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -940,6 +808,11 @@ msgstr "metronom: audio stream end ignorado\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "http network stream input plugin"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -955,30 +828,38 @@ msgstr ""
msgid "iff: unknown Chunk: %s\n"
msgstr ""
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, fuzzy, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -987,24 +868,28 @@ msgstr ""
"demux_mpeg_block: aviso: o cabeçalho de pes inidca que este stream pode "
"estar encriptado (encryption mode %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
"to xine developers.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, fuzzy, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1013,16 +898,15 @@ msgstr ""
"demux_mpeg_block: aviso: o cabeçalho de pes inidca que este stream pode "
"estar encriptado (encryption mode %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
"xine developers.\n"
msgstr ""
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
#: src/demuxers/demux_snd.c:100
@@ -1035,11 +919,20 @@ msgstr ""
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_asf: tipo de audio desconhecido 0x%x\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+msgid "SND/AU file demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: usando o plugin de demuxer >%s< para este MRL.\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1051,6 +944,11 @@ msgid ""
"unknown VOC compression type (0x%02X); please report to xine developers\n"
msgstr ""
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "http network stream input plugin"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1061,36 +959,42 @@ msgstr ""
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr ""
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1106,11 +1010,11 @@ msgid ""
"use of the Active Format Descriptor (AFD) used in some European DVB channels."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1118,19 +1022,19 @@ msgid ""
"This is relevant for progressive video only (most PAL films)."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1138,84 +1042,94 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, fuzzy, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "input_dvd: incapaz de abrir o acionador de dvd (%s): %s\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr ""
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
"16\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr ""
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1232,51 +1146,55 @@ msgid ""
"clock as sync source."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
"screen."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, fuzzy, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "input_dvd: incapaz de abrir o acionador de dvd (%s): %s\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, fuzzy, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "input_dvd: incapaz de abrir o acionador de dvd (%s): %s\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1290,22 +1208,22 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1316,7 +1234,7 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1327,11 +1245,11 @@ msgid ""
"encoder.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1363,22 +1281,22 @@ msgid ""
"of DXR3 overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid "overlay colour key value"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
"when using DXR3 overlay mode."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid "overlay colour key tolerance"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1386,26 +1304,26 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1415,57 +1333,57 @@ msgid ""
"default: keep the card's setting"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, fuzzy, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out: sigprocmask failed.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
"video_out_dxr3: Read the README.dxr3 for details.\n"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, fuzzy, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "http: unable to connect to >%s<\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, fuzzy, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cda: server '%s:%d' successfully connected.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, fuzzy, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_net: incapaz de conectar em '%s'.\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr ""
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr ""
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1474,11 +1392,11 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1486,31 +1404,19 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr ""
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr ""
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1519,205 +1425,200 @@ msgid ""
"A value of zero here will disable the slowdown."
msgstr ""
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, fuzzy, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_file: tentando abrir o arquivo de subtítulos '%s'\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, fuzzy, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_file: tentando abrir o arquivo de subtítulos '%s'\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, fuzzy, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_vcd: read data failed\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, fuzzy, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvd: não consigo abrir o acionador de dvd >%s<\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, fuzzy, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_file: tentando abrir o arquivo de subtítulos '%s'\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, fuzzy, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_file: tentando abrir o arquivo de subtítulos '%s'\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr ""
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
"T)\n"
msgstr ""
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
"C)\n"
msgstr ""
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
"A)\n"
msgstr ""
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, fuzzy, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvd: não consigo abrir o acionador de dvd >%s<\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, fuzzy, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_rtp: não consigo criar um novo thread (%s)\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
msgstr ""
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
#, fuzzy
msgid "DVB (Digital TV) input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr ""
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr ""
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
msgstr ""
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr ""
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, fuzzy, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
msgstr ""
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr ""
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1728,68 +1629,55 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr ""
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr ""
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr ""
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr ""
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr ""
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1808,11 +1696,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr ""
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1826,11 +1714,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1847,130 +1735,130 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: erro de leitura (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, fuzzy, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_cda: fopen(%s) failed: %s\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, fuzzy, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: erro de leitura (%s)\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, fuzzy, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: erro de leitura (%s)\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr ""
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr ""
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr ""
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr ""
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
#, fuzzy
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "net input plugin tal como enviado com xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, fuzzy, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_cda: fopen(%s) failed: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, fuzzy, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: read error\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr ""
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: invalid http answer\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, fuzzy, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx redirection not implemented: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: http status not 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, fuzzy, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: content length = %Ld bytes\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, fuzzy, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: read error\n"
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
#, fuzzy
msgid "http input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr ""
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr ""
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr ""
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr ""
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -1978,103 +1866,103 @@ msgid ""
"(full match required)."
msgstr ""
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
#, fuzzy
msgid "mms streaming input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr ""
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr ""
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
msgstr ""
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: incapaz de resolver '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: incapaz de conectar em '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "net input plugin tal como enviado com xine"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
#, fuzzy
msgid "pnm streaming input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, fuzzy, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, fuzzy, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, fuzzy, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_http: read error (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, fuzzy, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr ""
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr ""
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr ""
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr ""
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2124,158 +2012,158 @@ msgstr "incapaz de conectar com '%s'.\n"
msgid "recv(): %s.\n"
msgstr "socket(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr ""
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr ""
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr ""
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: não consigo criar um novo thread (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
#, fuzzy
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "net input plugin tal como enviado com xine"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
#, fuzzy
msgid "rtsp streaming input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr ""
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr ""
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, fuzzy, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "input_http: failed to open socket\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
#, fuzzy
msgid "stdin streaming input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr ""
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr ""
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr ""
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr ""
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
#, fuzzy
msgid "v4l tv input plugin"
msgstr "http network stream input plugin"
-#: src/input/input_v4l.c:1874
-#, fuzzy
-msgid "v4l radio input plugin"
-msgstr "http network stream input plugin"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr ""
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr ""
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "http network stream input plugin"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr ""
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+#, fuzzy
+msgid "v4l radio input plugin"
+msgstr "http network stream input plugin"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr ""
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr ""
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, fuzzy, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: MRL mal formada. Use vcd://<track #>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: trilha invalida %d (faixa valida: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-#, fuzzy
-msgid "Video CD input plugin"
-msgstr "http network stream input plugin"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "incapaz de abrir %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, fuzzy, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_dvd: incapaz de abrir o acionador de dvd (%s): %s\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+#, fuzzy
+msgid "Video CD input plugin"
+msgstr "http network stream input plugin"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr ""
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr ""
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr ""
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, fuzzy, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "http: unable to connect to >%s<\n"
@@ -2354,19 +2242,19 @@ msgstr ""
msgid "Buffering..."
msgstr ""
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
"%s\n"
msgstr ""
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, fuzzy, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_net: incapaz de conectar em '%s'.\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, fuzzy, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_http: failed to open socket\n"
@@ -2416,98 +2304,98 @@ msgstr ""
msgid "Invalid current entry type"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2528,11 +2416,11 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2540,11 +2428,11 @@ msgid ""
"See the help for the title_format for the meanings of these."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2561,85 +2449,171 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:830
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "http network stream input plugin"
+
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:337
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:394
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
#: src/libreal/real_common.c:139
@@ -2655,11 +2629,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr ""
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2680,122 +2649,151 @@ msgstr ""
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+msgid "closed caption decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr ""
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: usando o plugin de demuxer >%s< para este MRL.\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr ""
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
"in the subtitle being shown until the next one takes over."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -2803,11 +2801,11 @@ msgid ""
"used."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -2886,31 +2884,141 @@ msgstr ""
msgid "w32codec: Error initializing DMO Audio\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "http network stream input plugin"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr ""
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr ""
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -2918,6 +3026,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -2929,6 +3041,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -2953,6 +3069,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -2963,6 +3083,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
msgid ""
"Advanced tvtime/deinterlacer plugin with pulldown detection\n"
@@ -3019,48 +3143,60 @@ msgid ""
"\n"
msgstr ""
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr ""
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr ""
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
msgstr ""
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr ""
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr ""
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
msgid "colour space conversion method"
msgstr ""
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3072,7 +3208,12 @@ msgid ""
" h: the height of the picture\n"
msgstr ""
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3091,6 +3232,10 @@ msgid ""
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3106,20 +3251,8 @@ msgid ""
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
msgstr ""
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
#: src/post/planar/eq2.c:361
@@ -3146,7 +3279,36 @@ msgid ""
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
msgstr ""
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3161,7 +3323,7 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3179,7 +3341,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3187,12 +3353,16 @@ msgid ""
"\n"
msgstr ""
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
msgstr ""
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3221,11 +3391,126 @@ msgid ""
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
msgstr ""
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_cda: fopen(%s) failed: %s\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr "video_out : não consigo criar thread (%s)\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "video_out : não consigo criar thread (%s)\n"
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "video_out : não consigo criar thread (%s)\n"
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "input_http: failed to open socket\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "input_http: failed to open socket\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "http: unable to connect to >%s<\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "http: unable to connect to >%s<\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "input_http: failed to open socket\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "demux_ts: não consigo criar novo thread (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr ""
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr ""
@@ -3264,8 +3549,8 @@ msgid "video colour key"
msgstr ""
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3337,31 +3622,31 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr ""
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
#, fuzzy
msgid "xine video output plugin using DirectFB."
msgstr "http network stream input plugin"
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
#, fuzzy
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "http network stream input plugin"
@@ -3379,22 +3664,22 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr ""
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
" Check 'fbset -i' or try 'fbset -depth 16'.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr ""
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3402,53 +3687,52 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
+#: src/video_out/video_out_fb.c:876
#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:950
+#: src/video_out/video_out_fb.c:933
#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+msgid "%s: %d video RAM buffers are available.\n"
msgstr ""
-#: src/video_out/video_out_fb.c:956
+#: src/video_out/video_out_fb.c:939
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_fb.c:967
+#: src/video_out/video_out_fb.c:950
#, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1036
+#: src/video_out/video_out_fb.c:1019
#, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr ""
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr ""
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3477,29 +3761,29 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr ""
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr ""
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr ""
@@ -3518,6 +3802,11 @@ msgstr "input_dvd: incapaz de abrir o acionador de dvd (%s): %s\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr "http network stream input plugin"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3551,57 +3840,61 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+#: src/video_out/video_out_pgx64.c:1486
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr ""
@@ -3623,190 +3916,122 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr ""
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr ""
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:997
-#, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr ""
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr ""
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr ""
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
+msgstr ""
+
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -3816,78 +4041,75 @@ msgid ""
"\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
msgstr ""
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, c-format
msgid ""
-"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"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -3895,324 +4117,136 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1592
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
+msgid "%s: this adaptor supports the %s format.\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr ""
-#: src/video_out/video_out_xshm.c:194
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:210
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:220
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, c-format
msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:332
-#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
-msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr ""
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
"port.\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
" for hardware colour space conversion and scaling\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr ""
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2489
-#, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr ""
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4316,58 +4350,58 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, fuzzy, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio decoder plugin achado : %s\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr ""
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr ""
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr ""
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4390,11 +4424,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr ""
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4402,33 +4436,33 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr ""
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr ""
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4436,75 +4470,75 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr ""
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr ""
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, fuzzy, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out : desculpe, isto não deveria acontecer, reinicie o xine por "
"favor.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_file: tentando abrir o arquivo de subtítulos '%s'\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr ""
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr ""
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr ""
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr ""
@@ -4520,195 +4554,195 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr ""
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, fuzzy, c-format
msgid ": input plugin not defined!\n"
msgstr "xine: usando plugin de entrada >%s< para este MRL (%s).\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, fuzzy, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_vcd: read data failed\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, fuzzy, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_dvd: erro de leitura no input_dvd plugin\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, fuzzy, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr ""
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, fuzzy, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_vcd: read data failed\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, fuzzy, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_cda: fopen(%s) failed: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr ""
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
"'media.capture.save_dir'\n"
msgstr ""
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
msgstr ""
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr ""
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, fuzzy, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr ""
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, fuzzy, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "input_cda: fopen(%s) failed: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr ""
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr ""
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr ""
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr ""
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
"the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, fuzzy, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, fuzzy, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, fuzzy, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, fuzzy, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, fuzzy, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr ""
"load_plugins: carga do plugin %s falhou:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, fuzzy, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -4717,7 +4751,7 @@ msgstr ""
"load_plugins: não consigo abrir o plugin de demux %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, fuzzy, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -4726,12 +4760,12 @@ msgstr ""
"load_plugins: não consigo abrir o plugin de entrada %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, fuzzy, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, fuzzy, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -4740,53 +4774,58 @@ msgstr ""
"load_plugins: não consigo abrir o plugin de demux %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, fuzzy, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr ""
"load_plugins: não consigo abrir o plugin de entrada %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "incapaz de alocar buffer de entrada.\n"
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, fuzzy, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, fuzzy, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: achado o plugin de entrada: %s\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, fuzzy, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr ""
"load_plugins: carga do plugin %s falhou:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
"driver.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, fuzzy, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -4795,109 +4834,117 @@ msgstr ""
"load_plugins: não consigo abrir o plugin de demux %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr ""
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr ""
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr ""
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr ""
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr ""
-#: src/xine-engine/osd.c:893
+#: src/xine-engine/osd.c:1101
+#, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
+msgstr ""
+
+#: src/xine-engine/osd.c:1110
#, c-format
-msgid "osd: error loading font %s with ft2\n"
+msgid "osd: cannot initialize ft2 library\n"
msgstr ""
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
"skipping\n"
msgstr ""
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr ""
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr ""
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr ""
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr ""
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr ""
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr ""
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr ""
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -4912,33 +4959,33 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, fuzzy, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video decoder plugin achado : %s\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr ""
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d quadros enviados, %d quadros pulados, %d quadros descartados\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, fuzzy, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -4947,16 +4994,16 @@ msgstr ""
"video_out : descartando imagem com pts %d porque é muito velha (diff : %d > "
"%d).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -4972,48 +5019,48 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr ""
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, fuzzy, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out : desculpe, isto não deveria acontecer, reinicie o xine por "
"favor.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5021,11 +5068,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr ""
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5033,11 +5080,11 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr ""
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5048,145 +5095,145 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr ""
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, fuzzy, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: não consigo achar um plugin para este MRL\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, fuzzy, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: usando plugin de entrada >%s< para este MRL (%s).\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, fuzzy, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: não consigo achar um plugin para este MRL\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, fuzzy, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine_play: demuxer falhou em começar\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, fuzzy, c-format
msgid "xine: join rip input plugin\n"
msgstr "http network stream input plugin"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, fuzzy, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "http network stream input plugin"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, fuzzy, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine_play: demuxer falhou em começar\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr ""
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr ""
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr ""
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr ""
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr ""
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, fuzzy, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "input_dvd: não consigo abrir o arquivo >%s<\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr ""
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr ""
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: não conseguí achar o demuxer para >%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, fuzzy, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: não conseguí achar o demuxer para >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, fuzzy, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: usando o plugin de demuxer >%s< para este MRL.\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, fuzzy, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine_play: demuxer falhou em começar\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, fuzzy, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine_play: demuxer falhou em começar\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, fuzzy, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: demuxer falhou em começar\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, fuzzy, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: demuxer falhou em começar\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr ""
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr ""
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr ""
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr ""
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5204,11 +5251,11 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr ""
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5218,11 +5265,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5232,96 +5279,96 @@ msgid ""
"configuration, you might end with a totally messed up xine."
msgstr ""
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "menssagens"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "plugin"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr ""
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr ""
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr ""
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr ""
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr ""
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr ""
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
#, fuzzy
msgid "File not found:"
msgstr "input_file: erro de leitura (%s)\n"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr ""
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr ""
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
#, fuzzy
msgid "Encrypted media stream detected"
msgstr "metronom: audio stream end\n"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr ""
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
#, fuzzy
msgid "Audio device unavailable"
msgstr "fifo não disponível (%d)\n"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr ""
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr ""
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr ""
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr ""
diff --git a/po/sk.po b/po/sk.po
index 26289d5c2..6d9b11b01 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: xine-lib 1.0\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2004-09-15 13:53+0100\n"
"Last-Translator: \n"
"Language-Team: Slovak <ski18n@lists.isternet.sk>\n"
@@ -274,205 +274,201 @@ msgid ""
"See the alsa documentation for information on alsa devices."
msgstr ""
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr ""
"výstupný xine audio plugin používa alsa-compliant audio zariadenia/ovládaÄe"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "výstupný xine audio plugin používa kde artsd"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
#, fuzzy
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "výstupný xine audio plugin pre win32 používa directx"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
#, fuzzy
msgid "requested buffer control is not available"
msgstr "požadované tlaÄidlo nedostupné\n"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
#, fuzzy
msgid "requested COM interface not available"
msgstr "požadované tlaÄidlo nedostupné\n"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
#, fuzzy
msgid "unknown error"
msgstr "Udalosť neznámeho typu: "
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr ""
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, fuzzy, c-format
msgid ": can't create pthread condition: %s\n"
msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, fuzzy, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, fuzzy, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, fuzzy, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ""
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, fuzzy, c-format
msgid ": unknown control command %d\n"
msgstr "iff-ilbm: neznáma kompresia: %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
#, fuzzy
msgid "second xine audio output plugin using directx"
msgstr "výstupný xine audio plugin pre win32 používa directx"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "výstupný xine audio plugin pre win32 používa directx"
@@ -502,11 +498,11 @@ msgid ""
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "výstupný xine audio plugin používa esound"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "xine file audio output plugin"
@@ -543,7 +539,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "výstupný xine audio plugin pre win32 používa directx"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "mĺkvy výstupný xine audio plugin"
@@ -712,7 +708,7 @@ msgid ""
"audio device name is set to \"auto\"."
msgstr ""
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: open() mixer %s zlyhal: %s\n"
@@ -731,22 +727,22 @@ msgstr "zariadenie pre cdda mechaniku"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr ""
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
#, fuzzy
msgid "xine audio output plugin using pulseaudio sound server"
msgstr "výstupný xine audio plugin používa esound"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: otvorenie audio zariadenia %s zlyhalo: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
#, fuzzy
msgid "Sun audio device name"
msgstr "názov OSS audio zariadenia"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -754,172 +750,29 @@ msgid ""
"careful that the value you enter really is a proper Sun audio device."
msgstr ""
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, fuzzy, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr "audio_sun_out: otvorenie audio zariadenia %s zlyhalo: %s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr ""
"výstupný xine audio plugin používa sun-compliant audio zariadenia/ovládaÄe"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
-#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: zväÄÅ¡ujem buffer na %d aby sa prediÅ¡lo preteÄeniu.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr "ffmpeg_audio_dec: nenašiel ffmpeg dekóder pre buf typu 0x%X\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: nemôžem otvoriť dekóder\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: nemôžem otvoriť dekóder\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: nemôžem otvoriť dekóder\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, fuzzy, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_audio_dec: zväÄÅ¡ujem buffer na %d aby sa prediÅ¡lo preteÄeniu.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: nepodporovaný formát snímku, DR1 nepovolený.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: nepodporovaný formát snímku, DR1 nepovolený.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr "ffmpeg_video_dec: nenájdený ffmpeg dekóder pre buf typu 0x%X\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: nedá sa otvoriť dekóder\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: nedá sa otvoriť dekóder\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: priame vykreslovanie zapnuté\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr "ffmpeg_video_dec: zväÄÅ¡ujem buffer na %d aby sa prediÅ¡lo preteÄeniu.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-#, fuzzy
-msgid "MPEG-4 postprocessing quality"
-msgstr "kvalita ffmpeg mpeg-4 postspracovania"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-#, fuzzy
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "Dxr3enc: výstupná rýchlosť libavcodec mpeg (kbit/s)"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-#, fuzzy
-msgid "minimum compression"
-msgstr "iff-ilbm: neznáma kompresia: %d\n"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
msgstr ""
+"stopa ogg: vorbis audio indikovaná, ale hlaviÄka vorbis prúdu nenájdená.\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
+#: src/combined/xine_ogg_demuxer.c:2173
#, fuzzy
-msgid "maximum quantizer"
-msgstr "Dxr3enc: Maximálny kvantizér"
+msgid "Annodex demux plugin"
+msgstr "xine: nájdený modul demultiplexora %s\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
#: src/demuxers/demux_asf.c:450
@@ -940,6 +793,10 @@ msgstr "demux_asf: varovanie: Prúd id=%d je kryptovaný.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Media stream scrambled/encrypted"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "Obnovujem index..."
@@ -959,16 +816,24 @@ msgstr "demux_avi: index avi súboru je poškodený\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr "demux_avi: zlyhalo preskoÄenie videa na nasl. blok (poz. %lld)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "neplatná veľkosť FILM bloku\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "nerozoznaný FILM blok\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -984,6 +849,11 @@ msgstr ""
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "modul vstupu z Video CD"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -999,12 +869,20 @@ msgstr "iff-ilbm: neznáma kompresia: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: neznámy blok: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr ""
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1013,19 +891,19 @@ msgstr ""
"xine-lib:demux_mpeg_block: Nerozoznaný stream_id 0x%02x. Prosím nahláste to "
"tvorcom xine.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
msgstr "demux_mpeg_block: chyba! uvoľňujem. Prosím nahláste to tvorcom xine.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: varovanie: rezervovaných 10 bit hlaviÄky PES nenajdené\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1034,7 +912,11 @@ msgstr ""
"demux_mpeg_block: varovanie: hlaviÄka PES indikuje, že tento prúd môže byÅ¥ "
"zašifrovaný (režim šifrovania %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1043,18 +925,18 @@ msgstr ""
"xine-lib:demux_mpeg_pes: Nerozoznaný stream_id 0x%02x. Prosím nahláste to "
"tvorcom xine.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr "demux_mpeg_pes: varovanie: dekódovanie PACK prúdu id=0x%x zlyhalo.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_pes: varovanie: rezervovaných 10 bit hlaviÄky PES nenajdené\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1063,7 +945,7 @@ msgstr ""
"demux_mpeg_pes: varovanie: hlaviÄka PES indikuje, že tento prúd môže byÅ¥ "
"zašifrovaný (režim šifrovania %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1072,11 +954,9 @@ msgstr ""
"demux_mpeg_pes:Nerozoznaný súkr. prúd 1 0x%02x. Prosím nahláste to tvorcom "
"xine.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
msgstr ""
-"stopa ogg: vorbis audio indikovaná, ale hlaviÄka vorbis prúdu nenájdená.\n"
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1088,11 +968,21 @@ msgstr "demux_snd: zlé parametre hlaviÄky\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: nepodporovaný typ zvuku: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "modul vstupu zo súboru"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr ""
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: nájdený modul demultiplexora %s\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1104,6 +994,11 @@ msgid ""
"unknown VOC compression type (0x%02X); please report to xine developers\n"
msgstr "neznáma VOC kompresia typu (0x%02X); prosím nahlásiť tvorcom xine\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "modul vstupu zo súboru"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1114,37 +1009,42 @@ msgstr "demux_wc3movie: SHOT blok refercoval neznámu paletu (%d >= %d)\n"
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr "demux_wc3movie: Bol problém pri nahrávaní blokov palety\n"
-#: src/dxr3/dxr3.h:30
-#, fuzzy
-msgid "DXR3 device number"
-msgstr "Dxr3: Názov zariadenia"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: Zlyhalo otvorenie zariadenia titulkov %s (%s)\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "požadované tlaÄidlo nedostupné\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr "dxr3_decode_video: Zlyhalo otvorenie riadiaceho zariadenia %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1160,12 +1060,12 @@ msgid ""
"use of the Active Format Descriptor (AFD) used in some European DVB channels."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
#, fuzzy
msgid "try to sync video every frame"
msgstr "Skúsiť zosynchronizovať každý snímok"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1173,21 +1073,21 @@ msgid ""
"This is relevant for progressive video only (most PAL films)."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
#, fuzzy
msgid "use smooth play mode"
msgstr "Použiť alternatívny Play mód"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr "Povolením tejto voľby sa použije hladšie prehrávanie."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
#, fuzzy
msgid "correct frame durations in broken streams"
msgstr "Opraviť trvanie snímku v poškodených prúdoch"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1195,39 +1095,50 @@ msgid ""
"encounter such streams."
msgstr ""
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Zlyhalo otvorenie video zariadenia %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: zápis na zariadenie by blokoval. vyprázdňujem\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: zápis na video zariadenie zlyhal (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: WARNING: neznámy kód rýchlosti snímkov %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
"dxr3_decode_video: VAROVANIE: korigujem snímk. rýchlosť z PAL na NTSC\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+#, fuzzy
+msgid "DXR3 device number"
+msgstr "Dxr3: Názov zariadenia"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: init librte zlyhal\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1235,22 +1146,22 @@ msgid ""
msgstr ""
"dxr3_mpeg_encoder: rte pracuje iba s rozmermi videa, ktoré sú násobkami 16\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: zlyhalo získanie rte kontextu.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: nemohol vytvoriť kodec.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
#, fuzzy
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "Dxr3enc: rte mpeg výstupná rýchlosť (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
#, fuzzy
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
@@ -1259,27 +1170,27 @@ msgstr ""
"Bitová rýchlosť, ktorú má mpeg kód. knižnica librte použiť pre dxr3 kódovací "
"mód"
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: nedá sa inicializovat kontext: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: nemožno zaÄaÅ¥ kódovanie: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: Nešlo naštartovať FAME knižnicu\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
#, fuzzy
msgid "fame mpeg encoding quality"
msgstr "Dxr3enc: kvalita mpeg kódovania snímku"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1297,55 +1208,59 @@ msgid ""
"clock as sync source."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "prehodiť párne a nepárne riadky"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
"screen."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
#, fuzzy
msgid "add black bars to correct aspect ratio"
msgstr "PridaÅ¥ Äierne pruhy na korekciu pomeru obrazu"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
#, fuzzy
msgid "use smooth play mode for mpeg encoder playback"
msgstr "dxr3: použije alternatívny mód pre prehratie mpeg kódovania"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
#, fuzzy
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr "Povolením tejto voľby sa použije hladšie prehrávanie."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Zlyhalo otvorenie ovládacieho zariadenia %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Zlyhalo otvorenie video zariadenia %s (%s)\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
#, fuzzy
msgid "encoder for non mpeg content"
msgstr "kóder pre nie mpeg obsah"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1359,22 +1274,22 @@ msgid ""
"so these might fail to work."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr "video_out_dxr3: Mpeg kóder libavcodec nešiel spustiť.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: Mpeg kóder rte nešiel spustiť.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: Mpeg kóder fame nešiel spustiť.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1392,7 +1307,7 @@ msgstr ""
"video_out_dxr3: ovládaÄa. Pozrite README.dxr3 pre detaily konfigurácie "
"kódera.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1410,12 +1325,12 @@ msgstr ""
"video_out_dxr3: ovládaÄa. Pozrite README.dxr3 pre detaily konfigurácie "
"kódera.\n"
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
#, fuzzy
msgid "video output mode (TV or overlay)"
msgstr "Dxr3: video výst. mód (tv alebo overlay)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1447,24 +1362,24 @@ msgid ""
"of DXR3 overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
#, fuzzy
msgid "overlay colour key value"
msgstr "Dx3: hodnota kľúÄovej farby prekrývánia"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
msgid ""
"Hexadecimal RGB value of the key colour.\n"
"You can try different values, if you experience windows becoming transparent "
"when using DXR3 overlay mode."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
#, fuzzy
msgid "overlay colour key tolerance"
msgstr "rozsah kľúÄovej farby prekrývánia"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
"You can try lower values, if you experience windows becoming transparent "
@@ -1472,28 +1387,28 @@ msgid ""
"when using a too low setting."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
#, fuzzy
msgid "crop the overlay area at top and bottom"
msgstr "Orezať prekrývanú oblasť zhora a zdola na zamedzenie zelených riadkov"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
msgstr ""
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: prosím spustite autocal, prekrývanie zakázané\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
#, fuzzy
msgid "preferred tv mode"
msgstr "dxr3 preferovaný tv mód"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1503,12 +1418,12 @@ msgid ""
"default: keep the card's setting"
msgstr ""
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: nastavenie video módu zlyhalo.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1517,47 +1432,47 @@ msgstr ""
"video_out_dxr3: Potrebujete mpeg kóder na prehratie nie-mpeg videa na dxr3\n"
"video_out_dxr3: Čítajte README.dxr3 kôli detailom.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: CHYBA Čítania init súboru prekrývania. Spustite autocal!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, fuzzy, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "rtsp: nemožno sa pripojiť k '%s'\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: úspešne pripojenie na cddb server '%s:%d'.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr "input_cdda: nemožno sa pripojiť na cddb server '%s:%d' (%s).\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "CD Digital Audio (aka. CDDA)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
#, fuzzy
msgid "device used for CD audio"
msgstr "zariadenie pre cdda mechaniku"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr ""
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1566,12 +1481,12 @@ msgid ""
"listening habits."
msgstr ""
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
#, fuzzy
msgid "CDDB server name"
msgstr "cddbp meno servera"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1579,33 +1494,20 @@ msgid ""
"malicious replies. Be sure to enter a server you can trust."
msgstr ""
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
#, fuzzy
msgid "CDDB server port"
msgstr "cddbp port servra"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr ""
-#: src/input/input_cdda.c:2847
-#, fuzzy
-msgid "CDDB cache directory"
-msgstr "cddbp cache adresár"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr ""
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1614,205 +1516,200 @@ msgid ""
"A value of zero here will disable the slowdown."
msgstr ""
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, fuzzy, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: zlyhalo otvorenie súboru dvb kanála '%s'\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, fuzzy, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: zlyhalo otvorenie súboru dvb kanála '%s'\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: tuner_set_channel zlyhal\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: nemožno otvoriť dvb zariadenie\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr ""
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, fuzzy, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: zlyhalo otvorenie súboru dvb kanála '%s'\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, fuzzy, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: zlyhalo otvorenie súboru dvb kanála '%s'\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
"channel.\n"
msgstr ""
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr ""
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
"S)\n"
msgstr ""
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
"T)\n"
msgstr ""
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
"C)\n"
msgstr ""
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
"A)\n"
msgstr ""
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: nemožno otvoriť dvr zariadenie '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, fuzzy, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr ""
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
msgstr ""
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "DVB (Digital TV) vstupný modul"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr ""
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
msgstr ""
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr ""
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr ""
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr ""
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
msgstr ""
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr ""
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr ""
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
msgstr ""
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
+"Leave this at zero unless you really have more than 1 card in your system."
msgstr ""
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr ""
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: Chyba pri získavaní Äaľšieho bloku z DVD (%s)\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: Nemožno otvoriť DVD zariadenie\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
#, fuzzy
msgid "device used for DVD playback"
msgstr "zariadenie pre mono výstup"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
msgstr ""
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr ""
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -1823,70 +1720,56 @@ msgid ""
"See the documentation on raw device setup (man raw) for further information."
msgstr ""
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr ""
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
"scrambled DVDs."
msgstr ""
-#: src/input/input_dvd.c:1833
-#, fuzzy
-msgid "path to the title key cache"
-msgstr "cesta k video zariadeniu v4l"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr ""
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
"DVD drives, this is purely software."
msgstr ""
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr ""
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
"The value must be a two character ISO639 language code."
msgstr ""
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
#, fuzzy
msgid "read-ahead caching"
msgstr "Použijeme keÅ¡ovanie predÄítaním?"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
"of the DVD layer change on faster drives."
msgstr ""
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr ""
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -1905,11 +1788,11 @@ msgid ""
"features on the DVD"
msgstr ""
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr ""
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -1923,11 +1806,11 @@ msgid ""
"chapter of the current feature"
msgstr ""
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr ""
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -1944,132 +1827,132 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: chyba pri Äítaní (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, fuzzy, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_rip: skok zlyhal: %s\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, fuzzy, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: chyba pri Äítaní (%s)\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, fuzzy, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: chyba pri Äítaní (%s)\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "modul vstupu zo súboru"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "zaÄiatoÄné miesto prehliadania súborov"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr ""
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "zobraziť skryté súbory"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
msgstr ""
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "modul vstupu gnome-vfs dodávaný so xine"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, fuzzy, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_rip: skok zlyhal: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: chyba pri Äítaní %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "Pripájam sa na HTTP server..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: neplatná odpoveÄ http\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: presmerovanie 3xx: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: stav http nie je 2xx: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, fuzzy, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: dĺžka obsahu = %Ld bajtov\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, fuzzy, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: chyba pri Äítaní %d\n"
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "modul vstupu zo siete protokolom http"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
#, fuzzy
msgid "HTTP proxy host"
msgstr "adresa http proxy"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
#, fuzzy
msgid "HTTP proxy port"
msgstr "port http proxy"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
#, fuzzy
msgid "HTTP proxy username"
msgstr "meno používateľa pre http proxy"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
#, fuzzy
msgid "HTTP proxy password"
msgstr "heslo pre http proxy"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr ""
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr ""
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2077,27 +1960,27 @@ msgid ""
"(full match required)."
msgstr ""
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "modul vstupu zo siete protokolom mms"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
#, fuzzy
msgid "network bandwidth"
msgstr "Sieťové prenosové pásmo"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
"requirements of the same stream."
msgstr ""
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "MMS protokol"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
#, fuzzy
msgid ""
"Select the protocol to encapsulate MMS.\n"
@@ -2106,76 +1989,76 @@ msgstr ""
"Vyberte protokol nad MMS. TCP je lepšie, ale možno budete potrebovať HTTP za "
"firewall-om."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: nemožno zistiť adresu '%s'.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: nemožno sa pripojiť k '%s'.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "modul vstupu zo siete dodávaný so xine"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "modul vstupu z prúdu pnm"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: nedá sa vytvoriť pvr súbor (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: nedá sa otvoriť pvr súbor (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: chyba pri Äítaní (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: nemožno otvoriť zariadenie %s\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_G_CODEC zlyhal, možno sa API zmenilo?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr "input_pvr: IVTV_IOC_S_CODEC zlyhal, možno sa API zmenilo?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "modul vstupu z WinTV-PVR 250/350"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "zariadenie použité pre WinTV-PVR 250/350 (pvr modul)"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr ""
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "modul vstupu z WinTV-PVR 250/350"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2227,158 +2110,158 @@ msgstr "nemožno sa naviazať k '%s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: zastavujem Äítacie vlákno...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: Äítacie vlákno ukonÄené\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Otváranie >súbor:%s port:%d rozhranie:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "modul vstupu zo siete protokolom RTP a UDP dodávaný s xine"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "modul vstupu zo siete protokolom rtsp"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr ""
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, fuzzy, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: nemôžem skoÄiÅ¥ späť! (%lld > %lld)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: nemožno otvoriť '%s'\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "modul vstupu zo štandard. vstupu"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Buffer dáta odtiekli..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Buffer pretiekol..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Prispôsobovanie sa..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Meno tuneru nenájdené\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "modul vstupu z tv v4l"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "modul vstupu z rádia v4l"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
#, fuzzy
msgid "v4l video device"
msgstr "cesta k video zariadeniu v4l"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
#, fuzzy
msgid "The path to your Video4Linux video device."
msgstr "cesta k video zariadeniu v4l"
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "cesta k rádio zariadeniu v4l"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "cesta k video zariadeniu v4l"
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "modul vstupu z rádia v4l"
+
+#: src/input/input_v4l.c:1954
#, fuzzy
msgid "v4l radio device"
msgstr "cesta k rádio zariadeniu v4l"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
#, fuzzy
msgid "The path to your Video4Linux radio device."
msgstr "cesta k rádio zariadeniu v4l"
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: neplatné MRL. Použite vcdo:/<Äíslo stopy>\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: neplatná stopa %d (platný rozsah: 0..%d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "modul vstupu z Video CD"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "nemožno otvoriť %s: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: nemožno otvoriť %s: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "modul vstupu z Video CD"
+
+#: src/input/input_vcd.c:1082
#, fuzzy
msgid "device used for VCD playback"
msgstr "zariadenie pre mono výstup"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
msgstr ""
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: zlé mrl: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: nemožno sa pripojiť k '%s'\n"
@@ -2458,7 +2341,7 @@ msgstr "nepodporovaný protokol\n"
msgid "Buffering..."
msgstr "Buffering..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2467,12 +2350,12 @@ msgstr ""
"input_pnm: získaná spáva od servra poÄas Äítania prúdu:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: nemožno sa pripojiť k '%s'\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: zlyhalo nastavenie prúdu dát\n"
@@ -2522,44 +2405,44 @@ msgstr "bol poslaný parameter neznámej triedy"
msgid "Invalid current entry type"
msgstr "Neplatný typ aktuálnej položky"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr "Video CD modul s PBC a podporou pre: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
#, fuzzy
msgid "selection has no RETURN entry"
msgstr "výber nemá Äaľšiu položku"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
#, fuzzy
msgid "selection has no NEXT entry"
msgstr "výber nemá Äaľšiu položku"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
#, fuzzy
msgid "selection has no PREVIOUS entry"
msgstr "výber nemá Äaľšiu položku"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Udalosť neznámeho typu: "
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "Vyššie uvedená správa má neznámu log. úroveň vcdimageru"
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr "Video CD modul s PBC a podporou pre: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
#, fuzzy
msgid "VCD default type to use on autoplay"
msgstr "predvolený typ, ktorý sa použije na automat. prehratie VCD"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
#, fuzzy
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
@@ -2568,12 +2451,12 @@ msgstr ""
"Jednotka prehrávania, ktorú použiÅ¥, keÄ nie je uvedená v MRL, napr. vcd:// "
"alebo vcd:///dev/dvd:"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
#, fuzzy
msgid "CD-ROM drive used for VCD when none given"
msgstr "predvolené CD zariadenie použité pre VCD, pokiaľ nie je žiadne zadané"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
#, fuzzy
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
@@ -2582,32 +2465,32 @@ msgstr ""
"ÄŒo použiÅ¥ ak nie je mechanika zadaná. Ak je zadané niÄ, xine preskenuje CD "
"mechaniky."
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
#, fuzzy
msgid "VCD position slider range"
msgstr "rozsah ukazovateľa pozície"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
#, fuzzy
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr "Rozsah ukazovateľa pozície prehrávania použitého pri prehrávaní."
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
#, fuzzy
msgid "VCD read-ahead caching?"
msgstr "Použijeme keÅ¡ovanie predÄítaním?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr "Na slabších strojoch by mohlo viesť k trhanému prehrávaniu"
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
#, fuzzy
msgid "automatically advance VCD track/entry"
msgstr "Automaticky postupovať po stopách/položkách?"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
#, fuzzy
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
@@ -2616,24 +2499,24 @@ msgstr ""
"Ak je povolené, mali by sme automaticky postúpiÅ¥ na Äaľšiu položku alebo "
"stopu. Použité iba ak nie je zapnutá kontola prehrávania (PBC)."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
#, fuzzy
msgid "show 'rejected' VCD LIDs"
msgstr "Zobraziť 'odmietnuté' LID?"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
"(*) appended to the MRL."
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
#, fuzzy
msgid "VCD format string for display banner"
msgstr "formát reťazca pre nápis na obrazovke"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2654,12 +2537,12 @@ msgid ""
" %% : a %\n"
msgstr ""
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
#, fuzzy
msgid "VCD format string for stream comment field"
msgstr "formátovací reťazec pre pole komentáru prúdu dát"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
#, fuzzy
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
@@ -2671,12 +2554,12 @@ msgstr ""
"Å pecifikátory formátu zaÄínaju znakom percento. Å pecifikátory sú %A, %C, %c, "
"%F, %I, %L, %N, %P, %p, %S, %T, %V, %v, and %%."
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
#, fuzzy
msgid "VCD debug flag mask"
msgstr "debugovacia maska príznakov"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2693,88 +2576,175 @@ msgid ""
"2048: Debugging from VCDINFO\n"
msgstr ""
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "POMOC! iba mono audio ovládaÄ?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: zväÄÅ¡ujem buffer na %d aby sa prediÅ¡lo preteÄeniu.\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr "ffmpeg_audio_dec: nenašiel ffmpeg dekóder pre buf typu 0x%X\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: nemôžem otvoriť dekóder\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: nemôžem otvoriť dekóder\n"
-#: src/liba52/xine_a52_decoder.c:820
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: nemôžem otvoriť dekóder\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, fuzzy, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_audio_dec: zväÄÅ¡ujem buffer na %d aby sa prediÅ¡lo preteÄeniu.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
#, fuzzy
-msgid "A/52 volume"
-msgstr "Hlasitosť"
+msgid "dv audio decoder plugin"
+msgstr "modul vstupu z rádia v4l"
-#: src/liba52/xine_a52_decoder.c:821
+#: src/dxr3/ffmpeg_encoder.c:170
+#, fuzzy
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "Dxr3enc: výstupná rýchlosť libavcodec mpeg (kbit/s)"
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:829
-#, fuzzy
-msgid "use A/52 dynamic range compression"
-msgstr "povoliť a/52 dynamickú úpravu rozsahu"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr ""
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-#: src/liba52/xine_a52_decoder.c:837
+#: src/dxr3/ffmpeg_encoder.c:186
#, fuzzy
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "povoliť audio zmiešanie na 2.0 priestorové stereo"
+msgid "minimum compression"
+msgstr "iff-ilbm: neznáma kompresia: %d\n"
-#: src/liba52/xine_a52_decoder.c:838
-msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
msgstr ""
-#: src/libfaad/xine_faad_decoder.c:136
-#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad faacDecOpen() zlyhal.\n"
+#: src/dxr3/ffmpeg_encoder.c:192
+#, fuzzy
+msgid "maximum quantizer"
+msgstr "Dxr3enc: Maximálny kvantizér"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
+#, c-format
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: nepodporovaný formát snímku, DR1 nepovolený.\n"
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad faacDecInit2() zlyhal.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: nepodporovaný formát snímku, DR1 nepovolený.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:306
+#, c-format
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr "ffmpeg_video_dec: nenájdený ffmpeg dekóder pre buf typu 0x%X\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: nedá sa otvoriť dekóder\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, fuzzy, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad faacDecInit() zlyhal.\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: nedá sa otvoriť dekóder\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr ""
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: priame vykreslovanie zapnuté\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr "ffmpeg_video_dec: zväÄÅ¡ujem buffer na %d aby sa prediÅ¡lo preteÄeniu.\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:379
-#, c-format
-msgid "libmusepack: data after last frame ignored\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+#, fuzzy
+msgid "MPEG-4 postprocessing quality"
+msgstr "kvalita ffmpeg mpeg-4 postspracovania"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
msgstr ""
#: src/libreal/real_common.c:139
@@ -2791,11 +2761,6 @@ msgid ""
"information on how to install the codecs."
msgstr ""
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr "libreal: Chyba hľadania symbolov! (nekompatibilita verzii?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -2816,135 +2781,165 @@ msgstr "libareal: chutné nastavenie dekódera zlyhalo, kód chyby: 0x%x\n"
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: ach, real môže mať viac ako 2 kanály ?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr "libreal: Chyba hľadania symbolov! (nekompatibilita verzii?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
#, fuzzy
msgid "display closed captions in MPEG-2 streams"
msgstr "Povoliť skyté titulky v MPEG-2 prúdoch"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
#, fuzzy
msgid "closed-captioning foreground/background scheme"
msgstr "Schéma skrytých titulkov popredie/pozadie"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
#, fuzzy
msgid "standard closed captioning font"
msgstr "Štandardný font skrytých titulkov"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
#, fuzzy
msgid "italic closed captioning font"
msgstr "Font kurzívy skrytých titulkov"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
#, fuzzy
msgid "closed captioning font size"
msgstr "Veľkosť fontu skrytých titulkov"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr ""
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
#, fuzzy
msgid "center-adjust closed captions"
msgstr "Prispôsobenie centrovania skrytých titulkov"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr ""
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "Veľkosť fontu skrytých titulkov"
+
+#: src/spu_dec/cmml_decoder.c:468
#, fuzzy
msgid "font for external subtitles"
msgstr "Font pre externé titulky"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
#, fuzzy
msgid "subtitle vertical offset (relative window size)"
msgstr "Vertikálny posun titulkov (vzhľadom k velkosti okna)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
#, fuzzy
msgid "encoding of subtitles"
msgstr "Kódovanie titulkov"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: nájdený modul demultiplexora %s\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
#, fuzzy
msgid "default duration of subtitle display in seconds"
msgstr "Predvolený Äas na skrytie titulkov v sekundách"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
"in the subtitle being shown until the next one takes over."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
#, fuzzy
msgid "subtitle vertical offset"
msgstr "Vertikálny posun titulkov (vzhľadom k velkosti okna)"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
#, fuzzy
msgid "font for subtitles"
msgstr "Font pre externé titulky"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
#, fuzzy
msgid "encoding of the subtitles"
msgstr "Kódovanie titulkov"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -2952,12 +2947,12 @@ msgid ""
"used."
msgstr ""
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
#, fuzzy
msgid "use unscaled OSD if possible"
msgstr "Použiť OSD bez zmeny mierky, ak je možné"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3039,31 +3034,144 @@ msgstr "w32codec: Chyba inicializácie DirectShow zvuku\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: Chyba inicializácie DMO zvuku\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "xine file audio output plugin"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "POMOC! iba mono audio ovládaÄ?!\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+#, fuzzy
+msgid "A/52 volume"
+msgstr "Hlasitosť"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:812
+#, fuzzy
+msgid "use A/52 dynamic range compression"
+msgstr "povoliť a/52 dynamickú úpravu rozsahu"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:820
+#, fuzzy
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "povoliť audio zmiešanie na 2.0 priestorové stereo"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad faacDecOpen() zlyhal.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad faacDecInit2() zlyhal.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, fuzzy, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad faacDecInit() zlyhal.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: chyba pri ByteRun1 dekomprimácii\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 nie je podporovaný momentálne\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 nie je podporovaný momentálne\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ nie je podporovaný momentálne\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: Tento anim-typ nie je podporovaný momentálne\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3071,6 +3179,10 @@ msgid ""
"to use it to watch a movie in less time than it was originally shot.\n"
msgstr ""
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3082,6 +3194,10 @@ msgid ""
"\n"
msgstr ""
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3106,6 +3222,10 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ""
+#: src/post/audio/upmix_mono.c:346
+msgid "converts Mono into Stereo"
+msgstr ""
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3116,6 +3236,10 @@ msgid ""
"the variations via the standard weighted mean over past samples.\n"
msgstr ""
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
#, fuzzy
msgid ""
@@ -3227,52 +3351,64 @@ msgstr ""
"\n"
"* Používa niektoré algoritmy z tvtime a dscaler projektu.\n"
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: Žiadna metóda odprekladania nie je dostupná, konÄím.\n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
#, fuzzy
msgid "frames per second to generate"
msgstr "Snímkov za sekundu generovaných Goom-om"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
msgstr ""
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
#, fuzzy
msgid "goom image width"
msgstr "Šírka obrazu Goom v pixeloch"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
#, fuzzy
msgid "goom image height"
msgstr "Výška obrazu Goom v pixeloch"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr ""
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
#, fuzzy
msgid "colour space conversion method"
msgstr "Metóda konverzie priestoru farieb použitá Goom-om"
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
msgid ""
"You can choose the colour space conversion method used by goom.\n"
"The available selections should be self-explaining."
msgstr ""
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3292,7 +3428,12 @@ msgstr ""
" w: šírka obrazu\n"
" h: výška obrazu\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3322,6 +3463,10 @@ msgstr ""
"\n"
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3348,32 +3493,9 @@ msgstr ""
"\n"
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
-"Softvétový ekvalizér s interaktívným ovládaním tak ako pri hardvérovom "
-"ekvalizéri pre karty, ktoré nepodporujú riadenie jasu a kontrastu "
-"harvérovo.\n"
-"\n"
-"Parametre\n"
-" jas\n"
-" kontrast\n"
-"\n"
-"Poznámka: K ich nastaveniu je možne použiť ovládacie okno frontendu.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
#: src/post/planar/eq2.c:361
msgid ""
@@ -3419,7 +3541,47 @@ msgstr ""
"\n"
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+"Softvétový ekvalizér s interaktívným ovládaním tak ako pri hardvérovom "
+"ekvalizéri pre karty, ktoré nepodporujú riadenie jasu a kontrastu "
+"harvérovo.\n"
+"\n"
+"Parametre\n"
+" jas\n"
+" kontrast\n"
+"\n"
+"Poznámka: K ich nastaveniu je možne použiť ovládacie okno frontendu.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
#, fuzzy
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
@@ -3444,7 +3606,7 @@ msgstr ""
" Overlay_y_offset: Manuálne zvislé posunutie\n"
"\n"
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3462,7 +3624,11 @@ msgid ""
"* mplayer's noise (C) Michael Niedermayer\n"
msgstr ""
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3474,7 +3640,7 @@ msgstr ""
"Parametre\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3482,6 +3648,11 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+#, fuzzy
+msgid "plugin for ffmpeg libpostprocess"
+msgstr "použiť modul divx4 pre msmpeg4v3 prúdy"
+
#: src/post/planar/unsharp.c:215
#, fuzzy
msgid ""
@@ -3535,11 +3706,126 @@ msgstr ""
"\n"
"* mplayer's unsharp (C) 2002 Rémi Guyomarch\n"
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, fuzzy, c-format
+msgid "%s: input event write: %s.\n"
+msgstr "input_rip: skok zlyhal: %s\n"
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, fuzzy, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: zastavujem Äítacie vlákno...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, fuzzy, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr "RTP: Äítacie vlákno ukonÄené\n"
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: zastavujem Äítacie vlákno...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, fuzzy, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr "RTP: Äítacie vlákno ukonÄené\n"
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "stdin: nemožno otvoriť '%s'\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, fuzzy, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr "stdin: nemožno otvoriť '%s'\n"
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: nemožno sa pripojiť k '%s'\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "rtsp: nemožno sa pripojiť k '%s'\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "stdin: nemožno otvoriť '%s'\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: nemožno vytvoriť nové vlákno (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "výstupný modul xine s použitím ascii-art knižnice"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "výstupný video modul použitím Color AsCii Art knižnice"
@@ -3580,8 +3866,8 @@ msgid "video colour key"
msgstr "Dx3: hodnota kľúÄovej farby prekrývánia"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -3653,31 +3939,31 @@ msgid ""
"accelerated.\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr ""
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr ""
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, fuzzy, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_vidix: používam ovládaÄ: %s od %s\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
#, fuzzy
msgid "xine video output plugin using DirectFB."
msgstr "výstupný modul xine s použitím DirectFB knižnice."
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr ""
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
#, fuzzy
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr "výstupný modul xine s použitím DirectFB knižnice."
@@ -3695,11 +3981,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "výstupný video modul pre win32 použitím directx"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -3708,12 +3994,12 @@ msgstr ""
"video_out_fb: sú podporované iba pravé farby truecolor/directcolor (%d).\n"
" Zkontrolujte 'fbset -i' alebo skúste 'fbset -depth 16'.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
#, fuzzy
msgid "framebuffer device name"
msgstr "zariadenie framebufferu"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -3721,21 +4007,20 @@ msgid ""
"careful that the value you enter really is a proper framebuffer device."
msgstr ""
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out_fb: Váš video mód nebol rozpoznaný, prepáÄte.\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: %d video RAM buffere dostupné.\n"
-#: src/video_out/video_out_fb.c:956
-#, c-format
+#: src/video_out/video_out_fb.c:939
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
@@ -3743,42 +4028,44 @@ msgstr ""
" k dispozícii, Äo je menej neždoporuÄených %d buffrov. Zníženie\n"
" rozlíšenia bufferu snímkov môže pomôcť.\n"
-#: src/video_out/video_out_fb.c:967
-#, c-format
+#: src/video_out/video_out_fb.c:950
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
"WARNING: video_out_fb: Buffere s nulami sú ZAKÃZANÉ lebo lebo kernel "
"ovládaÄ\n"
" nepodporuje screen panning (používaný pre prepínanie snímkov).\n"
-#: src/video_out/video_out_fb.c:1036
-#, c-format
+#: src/video_out/video_out_fb.c:1019
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"WARNING: video_out_fb: terajšia hĺbka zobrazenia je %d. Pre lepší výkon\n"
-" hĺbka 16 bit/bod je doporuÄená!\n"
+"\n"
+"\n"
+"VAROVANIE: aktuálna hĺbka zobrazenia je %d. Pre lepší výkon\n"
+"je doporuÄená hĺbka 16 bit/bod!\n"
"\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr ""
"výstupný xine video modul s použitím Linux kernelového frame buffer "
"zariadenia"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "výstupný xine video modul, ktorý niÄ nezobrazuje"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr ""
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -3807,29 +4094,29 @@ msgid ""
"Show images reflected in a spinning torus. Way cool =)"
msgstr ""
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr ""
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
msgstr ""
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr ""
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
"It should not have any performance impact."
msgstr ""
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
#, fuzzy
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "výstupný xine video modul, ktorý používa OpenGL - TNG"
@@ -3849,6 +4136,11 @@ msgstr "video_out_dxr3: Zlyhalo otvorenie video zariadenia %s (%s)\n"
msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr "výstupný video modul xine použitím libvidix pre linux frame buffer"
+
#: src/video_out/video_out_pgx64.c:278
#, fuzzy, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -3883,60 +4175,65 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr "video_out_pgx64: Chyba: nedostatoÄná veľkosÅ¥ video pamäte\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Varovanie: málo video pamäte, multi-buffering zakázaný\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Chyba: nedostatoÄná veľkosÅ¥ video pamäte\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Varovanie: málo video pamäte, dvoj-buffering zakázaný\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, fuzzy, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Chyba: nedostatoÄná veľkosÅ¥ video pamäte\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
#, fuzzy
msgid "video overlay colour key"
msgstr "Dx3: hodnota kľúÄovej farby prekrývánia"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
"other windows."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
msgstr ""
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr ""
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr ""
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr "výstupný video modul xine použitím libvidix pre linux frame buffer"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr ""
@@ -3958,207 +4255,127 @@ msgstr "sdl musí emulovať 16 bitové povrchy, to všetko spomalí.\n"
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: plnoobrazovkový mód NIE JE podporovaný\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr "výstupný xine video modul používajúci Simple Direct Media Layer"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr "výstupný video modul použitím Libstk Surface Set-top Toolkit"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr "video_out_syncfb: chyba. (YUY2 nepodporovaný vašou video kartou)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr "video_out_syncfb: chyba. (YV12 nepodporované vašou graf. kartou)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: info. (SyncFB modul podporuje YUV 4:2:0 (3 roviny))\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: info. (SyncFB modul podporuje YUV 4:2:0 (2 roviny))\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr "video_out_syncfb: info. (SyncFB modul podporuje YUV 4:2:2)\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr "video_out_syncfb: info. (SyncFB modul podporuje YUY2)\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr "video_out_syncfb: info. (SyncFB modul podporuje RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: ruší sa. (SyncFB modul nepodporuje YV12, YUY2 ani RGB565)\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, fuzzy, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: info. (ovládanie jasu/kontrastu nebude dostupné lebo váš "
-"SyncFB kernel modul vyzerá veľmi zastaraný. Prosím pozrite README.syncfb "
-"kôli Äalším informáciam ako ho aktualizovaÅ¥.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"výstupný video modul xine použitím SyncFB modulu pre Matrox G200/G400 karty"
-
-#: src/video_out/video_out_syncfb.c:1088
-#, fuzzy
-msgid "SyncFB device name"
-msgstr "názov OSS audio zariadenia"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr ""
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr ""
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
"flickering and tearing artifacts, but will use more graphics memory."
msgstr ""
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: karta podporuje yuy2 formát\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: karta podporuje yv12 formát\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: Máte zlú verziu knižnice VIDIX\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: Nemôžem nájsÅ¥ funkÄný VIDIX ovládaÄ\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: používam ovládaÄ: %s od %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
#, fuzzy
msgid "video overlay colour key red component"
msgstr "rozsah kľúÄovej farby prekrývánia"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
#, fuzzy
msgid "video overlay colour key green component"
msgstr "rozsah kľúÄovej farby prekrývánia"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
#, fuzzy
msgid "video overlay colour key blue component"
msgstr "Dx3: hodnota kľúÄovej farby prekrývánia"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "výstupný video modul xine použitím libvidix pre x11"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr "výstupný video modul xine použitím libvidix pre linux frame buffer"
-#: src/video_out/video_out_xcbshm.c:150
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
+#, c-format
+msgid "%s: %s: allocating image\n"
msgstr ""
-"video_out_xshm: %s: alokácia obrazu\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbshm.c:159
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
#, fuzzy, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr "výstupný video xine modul použitím rozšírenia zdielanej pamäte MIT X"
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, fuzzy, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
"video_out_xshm: chyba dielanej pamäte (chyba adresy) pri alokácii obrazu\n"
"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbshm.c:170
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
+#, c-format
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-"video_out_xshm: x11 chyba pri vytváraní zdielanej pamäte XImage\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4173,90 +4390,81 @@ msgstr ""
"je doporuÄená hĺbka 16 bit/bod!\n"
"\n"
-#: src/video_out/video_out_xcbshm.c:1114
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
#, fuzzy, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
"video_out_xshm: rozšírenie zdielanej pamäte MIT neprítomné na obrazovke.\n"
-#: src/video_out/video_out_xcbshm.c:1213
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
#, fuzzy, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: váš video mód nebol rozoznaný, prepáÄte :-(\n"
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "video_out_fb: Váš video mód nebol rozpoznaný, prepáÄte.\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr "výstupný video xine modul použitím rozšírenia zdielanej pamäte MIT X"
-#: src/video_out/video_out_xcbxv.c:270
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
+#, c-format
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-"video_out_xv: XvShmCreateImage vrátila nulovú veľkosť\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbxv.c:279
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
+#, c-format
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-"video_out_xv: chyba zdielanej pamäte v shmget: %s\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbxv.c:298
-#, fuzzy, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbxv.c:285
+#, c-format
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-"video_out_xv: x11 chyba pri vytváraní zdielanej pamäte XImage\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xcbxv.c:1358
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
#, fuzzy, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
+msgid "%s: Xv extension not present.\n"
msgstr "video_out_xv: Xv rozšírenie neprítomné.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
"video_out_xv: rozšírenie Xv je prítomné, ale nenašiel som použiteľný yuv12 "
"port.\n"
" Vyzerá to tak, že vaša grafická karta nepodoruje Xv?!\n"
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, fuzzy, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xv: používam Xv port %ld z adaptéru %s pre hardvérovú konverziu "
"farebného priestoru a škálovania.\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
msgid ""
"This option will synchronize the update of the video image to the repainting "
"of the entire screen (\"vertical retrace\"). This eliminates flickering and "
@@ -4264,198 +4472,44 @@ msgid ""
"\" and choose which display device to sync to under the XVideo Settings tab"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1587
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
#, fuzzy, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
+msgid "%s: this adaptor supports the %s format.\n"
msgstr "video_out_xv: tento adaptér podporuje yv12 formát.\n"
-#: src/video_out/video_out_xcbxv.c:1592
-#, fuzzy, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje yuy2 formát.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "výstupný video xine modul použitím MIT X video rozšírenia"
-#: src/video_out/video_out_xshm.c:194
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: chyba dielanej pamäte pri alokácii obrazu\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:210
-#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: %s: alokácia obrazu\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: chyba dielanej pamäte (chyba adresy) pri alokácii obrazu\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: x11 chyba pri vytváraní zdielanej pamäte XImage\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: rozšírenie zdielanej pamäte MIT neprítomné na obrazovke.\n"
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: váš video mód nebol rozoznaný, prepáÄte :-(\n"
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage zlyhala\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage vrátila nulovú veľkosť\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xv.c:332
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-"video_out_xv: chyba zdielanej pamäte v shmget: %s\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xv.c:364
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-"video_out_xv: x11 chyba pri vytváraní zdielanej pamäte XImage\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: Xv rozšírenie neprítomné.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: rozšírenie Xv je prítomné, ale nenašiel som použiteľný yuv12 "
-"port.\n"
-" Vyzerá to tak, že vaša grafická karta nepodoruje Xv?!\n"
-
-#: src/video_out/video_out_xv.c:1460
-#, c-format
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
+#, fuzzy, c-format
msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xv: používam Xv port %ld z adaptéru %s pre hardvérovú konverziu "
"farebného priestoru a škálovania.\n"
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje yv12 formát.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje yuy2 formát.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "výstupný video xine modul použitím XvMC X video rozšírenia"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: XvMC rozšírenie neprítomné.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -4464,7 +4518,7 @@ msgstr ""
"video_out_xvmc: Xv rozšírenie je prítomné, ale nenašiel som použiteľný yuv12 "
"port.\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -4473,154 +4527,87 @@ msgstr ""
"video_out_xvmc: používam Xv port %ld z adaptéru %s\n"
" pre hardvérovú konverziu farebného priestoru a škálovania\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " idct a akcelerácia kompenzácie pohybu \n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " iba akcelerácia kompenzácie pohybu\n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " žiadna XvMC podpora \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " S Prekrývaním = %d; UnsignedIntra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, fuzzy, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage zlyhala\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, fuzzy, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage vrátila nulovú veľkosť\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, fuzzy, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: chyba zdielanej pamäte v shmget: %s\n"
-"video_out_xv: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, fuzzy, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: x11 chyba pri vytváraní zdielanej pamäte XImage\n"
-"video_out_xshm: => nepoužívam rozšírenie MIT Shared Memory.\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, fuzzy, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xvmc: XvMC rozšírenie neprítomné.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, fuzzy, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: rozšírenie Xv je prítomné, ale nenašiel som použiteľný yuv12 "
-"port.\n"
-" Vyzerá to tak, že vaša grafická karta nepodoruje Xv?!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, fuzzy, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xv: používam Xv port %ld z adaptéru %s pre hardvérovú konverziu "
-"farebného priestoru a škálovania.\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, fuzzy, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje yv12 formát.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, fuzzy, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: tento adaptér podporuje yuy2 formát.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "výstupný video xine modul použitím XvMC X video rozšírenia"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
"allocate 15 frames. A must for unichrome and live VDR.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
"Experimental.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
"look blue and vice versa. This option provides a workaround.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
msgstr ""
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr ""
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -4733,59 +4720,59 @@ msgid ""
"but the CPU usage will be decreased as well."
msgstr ""
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: žiaden modul nedostupný na spracovanie '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: chyba, neznámy typ bufferu: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr ""
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, fuzzy, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr "zápis na zvukovú kartu zlyhal. Bolo odpojené USB zariadenie ?\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "8 bitov nepodporované ovládaÄom, konvertujem na 16bitov.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "mono nepodporované ovládaÄom, konvertujem na stereo.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "stereo nepodporované ovládaÄom, konvertujem na mono.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
#, fuzzy
msgid "method to sync audio and video"
msgstr "zvolte metódu synchronizácie audia a videa"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -4808,11 +4795,11 @@ msgid ""
"form."
msgstr ""
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr ""
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -4820,34 +4807,34 @@ msgid ""
"automatically when necessary."
msgstr ""
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
#, fuzzy
msgid "always resample to this rate (0 to disable)"
msgstr "ak !=0 vždy prevzorkovať na zvolenú frekv."
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
"stream to be resampled to the given rate."
msgstr ""
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr ""
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
"The unit of the value is one PTS tick, which is the 90000th part of a second."
msgstr ""
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr ""
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -4855,77 +4842,77 @@ msgid ""
"audio post plugin instead."
msgstr ""
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
#, fuzzy
msgid "startup audio volume"
msgstr "Hlasitosť"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
#, fuzzy
msgid "The overall audio volume set at xine startup."
msgstr "obnoviť úroveň hlasitosti pri štarte"
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "obnoviť úroveň hlasitosti pri štarte"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
#, fuzzy
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"ak toto nie je nastavené, xine sa nedotkne pri štarte nastavenia mixéru"
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr "audio_out: prepáÄ, toto sa nemalo staÅ¥, prosím reÅ¡tartuj xine.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr ""
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr "Aktuálny konfiguraÄný súbor bol modifikovaný novou verziou xine."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: zlyhalo otvorenie súboru dvb kanála '%s'\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr "configfile: VAROVANIE: záloha konf.súboru do %s zlyhala\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: VAROVANIE: vaša konfigurácia nebude uložená\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: VAROVANIE: zápis konfigurácie %s zlyhal\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr "configfile: VAROVANIE: odstraňujem možno poškodený konf. súbor %s\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: VAROVANIE: mali by ste skontrolovať záložný súbor %s\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: položka '%s' nesmie byť modifikovaná z MRL\n"
@@ -4941,58 +4928,58 @@ msgid ""
"info_helper: unsupported conversion %s -> UTF-8, no conversion performed\n"
msgstr "osd: nepodporovaná konverzia %s -> %s, nebude vykonaná žiadna\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, fuzzy, c-format
msgid ": open() function should never be called\n"
msgstr "input_rip: funkcia open() by nikdy nemala byť volaná\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, fuzzy, c-format
msgid ": input plugin not defined!\n"
msgstr "input_rip: vstupný modul nedefinovaný!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: zlyhalo Äítanie zapísaných dát: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: zlyhalo Äítanie vo vstupnom module\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, fuzzy, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: chyba pri zápise do súboru %lld bytov: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: funkcia open() by nikdy nemala byť volaná\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: skok zlyhal\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: skok zlyhal: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, fuzzy, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %lld bytov zahodených\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: vstupný modul nedefinovaný!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -5001,7 +4988,7 @@ msgstr ""
"input_rip: cieľový adresár nebol špecifikovaný, prosím vyplnte voľbu 'media."
"capture.save_dir'\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5009,131 +4996,131 @@ msgstr ""
"Schopnosť ukladania je zakázaná dovtedy kým nenastavíte media.capture."
"save_dir v konfigurácii."
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: ukladanie/kešovanie z tohto zdroja nedovolené!\n"
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
msgstr ""
"xine nemá povolené ukladať z tohto zdroja. (možno autorsky chránenýmateriál?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: nezadané meno súboru!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: nemožno otvoriť súbor %s: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, fuzzy, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "Meno tuneru nenájdené\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, fuzzy, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "input_rip: skok zlyhal: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr ""
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr ""
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, fuzzy, c-format
msgid "io_helper: File not found\n"
msgstr "Meno tuneru nenájdené\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
msgstr ""
"load_plugins: ignorujem modul %s, zlá verzia rozhrania %d (má byť %d)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr ""
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
"A priority of 0 enables the decoder's default priority."
msgstr ""
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
"use the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
"the default priority.\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: nájdený modul: %s\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, fuzzy, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: nájdený modul: %s\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: nájdený modul: %s\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, fuzzy, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr "load_plugins: nájdený modul: %s\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: neznámy typ modulu %d v %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, fuzzy, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: neznámy typ modulu %d v %s\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: nemôžem naštartovať %s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5142,7 +5129,7 @@ msgstr ""
"load_plugins: nemožno otvoriť knižnicu modulov %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5151,12 +5138,12 @@ msgstr ""
"load_plugins: nemožno získať info modulu z %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: preskakujem neÄitateľný adresár modulov: %s\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5165,42 +5152,47 @@ msgstr ""
"load_plugins: nemožno (fáza 2) otvoriť knižnicu modulov %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: Čo! %s neobsahuje informácie modulu.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "nemožno otvoriť %s: %s.\n"
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: neznáma stratégia %d zisťovánia obsahu\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: nájdený demultiplexor '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: zlyhalo naÄítanie výstupného audio modulu <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5209,7 +5201,7 @@ msgstr ""
"load_plugins: auto-detekcia audio výstupu nenašla žiadne použiteľné audio "
"ovládaÄe.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, fuzzy, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5218,52 +5210,52 @@ msgstr ""
"load_plugins: nemožno otvoriť knižnicu modulov %s:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "font '%s-%d' už naÄítaný, divné.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "naÄítanie fontu '%s' zlyhalo (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr "zlá verzia fontu '%s'. oÄakávaná %d nájdená %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: nemôžem inicializovať ft2 knižnicu\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, fuzzy, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: chyba naÄítania fontu %s s ft2\n"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, fuzzy, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: chyba naÄítania fontu %s s ft2\n"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, fuzzy, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: chyba naÄítania fontu %s s ft2\n"
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr "osd: chyba naÄítania fontu %s s ft2\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: nemôžem inicializovať ft2 knižnicu\n"
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr "osd: chyba pri nastavení veľkosti fontu (neškálovateľný font?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5272,58 +5264,66 @@ msgstr ""
"osd: neznáma sekvencia zaÄínajúca s bytom 0x%02X v kódovaní \"%s\", "
"preskakujem\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: nemôžem zistiť aktuálnu kódovú stánku\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: nepodporovaná konverzia %s -> %s, nebude vykonaná žiadna\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: font nie je definovaný\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: chyba zavedenia glyph\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: chyba pri vykreslovaní glyph\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: chyba zavedenia glyph %i\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: chyba pri vykreslovaní\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
#, fuzzy
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "Paleta (popredie-okraj-pozadie) použitá na titulky"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
"foreground-border-background."
msgstr ""
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5338,33 +5338,33 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: nedostupný modul na spracovanie '%s'\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: chyba, neznámy typ bufferu: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr ""
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
"increased latency and memory consumption."
msgstr ""
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "doruÄených %d rámcov, preskoÄených %d rámcov, zahodených %d rámcov\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -5373,16 +5373,16 @@ msgstr ""
"video_out: zahadzuje sa obraz s pts %<PRId64>, pretože už je príliš starý "
"(rozdiel: %<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5398,46 +5398,46 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr ""
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
msgstr ""
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr ""
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
msgstr ""
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr "video_out: prepáÄ, toto sa nemalo staÅ¥, reÅ¡tartuj xine.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "horizontálna pozícia obrazu vo výstupnom okne"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -5445,11 +5445,11 @@ msgid ""
"\", while 0 means \"at the very left\" and 100 \"at the very right\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "vertikálna pozícia obrazu vo výstupnom okne"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -5457,12 +5457,12 @@ msgid ""
"\", while 0 means \"at the top\" and 100 \"at the bottom\"."
msgstr ""
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
#, fuzzy
msgid "disable all video scaling"
msgstr "vypnúť všetky zmeny merítka (rýchle!)"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -5473,146 +5473,146 @@ msgid ""
"accelerated, this can dramatically reduce CPU usage."
msgstr ""
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: chyba pri spracovaní mrl\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: nájdený vstupný modul : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: vstupný modul nemôže otvoriť MRL [%s]\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: nemožno nájsť vstupný modul pre MRL [%s]\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: špecifikovaný demultiplexor %s nenaštartoval\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: pripojený rip vstupný modul\n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: chyba otvorenia modulu vstupu rip\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: last_probed demultiplexor %s nenaštartoval\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "ignorujem video\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "ignorujem audio\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "ignorujem titulky\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr ""
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "mrl titulkov otvorené '%s'\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: nemožno otvoriť mrl titulkov\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: chyba pri spracovaní MRL\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr "xine: zmeniť voľbu '%s' z MRL nie je dovolené\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: nemožno nájsť demultiplexor pre >%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: nemožno nájsť demultiplexor pre >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: nájdený modul demultiplexora %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, fuzzy, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: demultiplexor nenaštartoval\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: demultiplexor nenaštartoval\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: demultiplexor nedostupný\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: demultiplexor nenaštartoval\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr "xine: Å pecifikovaný save_dir \"%s\" môže byÅ¥ bezpeÄnostným rizikom.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr "Å pecifikovaný save_dir môže byÅ¥ bezpeÄnostným rizikom."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: locale nepodporované vašou C knižnicou\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
#, fuzzy
msgid "media format detection strategy"
msgstr "Stratégia detekcie formátu médii"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -5630,12 +5630,12 @@ msgid ""
"Detect by file name extension only.\n"
msgstr ""
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
#, fuzzy
msgid "directory for saving streams"
msgstr "Cesta pre ukladanie prúdov"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -5645,11 +5645,11 @@ msgid ""
"content in any file."
msgstr ""
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr "dovoliť implicitné zmeny v konfigurácii (napr. cez MRL)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -5665,98 +5665,98 @@ msgstr ""
"MRL alebo playlisty z nedôverihodných vzdialených zdrojov. Ak im dovolíte "
"ľubovoľne meniÅ¥ vaÅ¡u konfiguráciu, môžete skonÄiÅ¥ s úplne rozhodeným xine."
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr ""
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
"occupied, too high values will freeze the player if the connection is lost."
msgstr ""
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "správy"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "modul"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "trace"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr ""
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
#, fuzzy
msgid "Unknown host:"
msgstr "Udalosť neznámeho typu: "
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
#, fuzzy
msgid "Unknown device:"
msgstr "Udalosť neznámeho typu: "
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr ""
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr ""
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
#, fuzzy
msgid "File not found:"
msgstr "Meno tuneru nenájdené\n"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr ""
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
#, fuzzy
msgid "Error loading library:"
msgstr "osd: chyba zavedenia glyph\n"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr ""
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr ""
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
#, fuzzy
msgid "Audio device unavailable"
msgstr "názov OSS audio zariadenia"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr ""
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr ""
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr ""
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
"this copying. Usually, the best method is detected automatically."
msgstr ""
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Testovanie výkonnosti memcpy metód (menej je lepšie):\n"
diff --git a/po/tr.po b/po/tr.po
index 1f70dce98..7c7f6741f 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -10,7 +10,7 @@ msgid ""
msgstr ""
"Project-Id-Version: libxine1\n"
"Report-Msgid-Bugs-To: xine-devel@lists.sourceforge.net\n"
-"POT-Creation-Date: 2011-11-13 01:50+0000\n"
+"POT-Creation-Date: 2012-01-01 20:50+0000\n"
"PO-Revision-Date: 2008-01-05 18:22+0200\n"
"Last-Translator: Server Acim <sacim@kde.org.tr>\n"
"Language-Team: Türkçe <yerellestirme@kde.org.tr>\n"
@@ -299,199 +299,195 @@ msgstr ""
"xine ses gürlüğünü değiştirmek bu alsa karıştırıcısını kullanacaktır.\n"
"Alsa aygıtları hakkında daha fazla bilgi için alsa belgesine bakınız."
-#: src/audio_out/audio_alsa_out.c:1705
+#: src/audio_out/audio_alsa_out.c:1709
msgid "xine audio output plugin using alsa-compliant audio devices/drivers"
msgstr "xine ses çıkışı eklentisi alsa uyumlu aygıtları/sürücüleri kullanıyor"
-#: src/audio_out/audio_arts_out.c:371
-msgid "xine audio output plugin using kde artsd"
-msgstr "Kde arts kullanan xine ses çıktısı eklentisi"
-
-#: src/audio_out/audio_coreaudio_out.c:569
+#: src/audio_out/audio_coreaudio_out.c:575
msgid "xine output plugin for Coreaudio/Mac OS X"
msgstr "Coreaudio/Mac OS X için xine ses çıktısı eklentisi"
-#: src/audio_out/audio_directx2_out.c:166
+#: src/audio_out/audio_directx2_out.c:165
msgid "Error"
msgstr "Hata"
-#: src/audio_out/audio_directx2_out.c:173
+#: src/audio_out/audio_directx2_out.c:172
msgid "success"
msgstr "başarılı"
-#: src/audio_out/audio_directx2_out.c:175
+#: src/audio_out/audio_directx2_out.c:174
msgid "access denied"
msgstr "eriÅŸim engellendi"
-#: src/audio_out/audio_directx2_out.c:177
+#: src/audio_out/audio_directx2_out.c:176
msgid "resource is already in use"
msgstr "kaynak zaten kullanımda"
-#: src/audio_out/audio_directx2_out.c:178
+#: src/audio_out/audio_directx2_out.c:177
msgid "object was already initialized"
msgstr "nesne zaten algılanmıştı"
-#: src/audio_out/audio_directx2_out.c:179
+#: src/audio_out/audio_directx2_out.c:178
msgid "specified wave format is not supported"
msgstr "belirtilen dalga biçimi desteklenmiyor"
-#: src/audio_out/audio_directx2_out.c:180
+#: src/audio_out/audio_directx2_out.c:179
msgid "memory buffer has been lost and must be restored"
msgstr "hafıza arabelleği kayıp ve onarılması gerekiyor"
-#: src/audio_out/audio_directx2_out.c:181
+#: src/audio_out/audio_directx2_out.c:180
msgid "requested buffer control is not available"
msgstr "istenen ara bellek kontrolü uygun değil"
-#: src/audio_out/audio_directx2_out.c:182
+#: src/audio_out/audio_directx2_out.c:181
msgid "undetermined error inside DirectSound subsystem"
msgstr "DirectSound alt sistemi içinde belirlenemeyen hata"
-#: src/audio_out/audio_directx2_out.c:184
+#: src/audio_out/audio_directx2_out.c:183
msgid "DirectSound hardware device is unavailable"
msgstr "DirectSound donanım aygıtı geçerli değil"
-#: src/audio_out/audio_directx2_out.c:186
+#: src/audio_out/audio_directx2_out.c:185
msgid "function is not valid for the current state of the object"
msgstr "uygulamanın geçerli durumu için işlev uygun değil"
-#: src/audio_out/audio_directx2_out.c:187
+#: src/audio_out/audio_directx2_out.c:186
msgid "invalid parameter was passed"
msgstr "geçersiz parametre geçirildi"
-#: src/audio_out/audio_directx2_out.c:188
+#: src/audio_out/audio_directx2_out.c:187
msgid "object doesn't support aggregation"
msgstr "nesne kümeyi desteklemiyor"
-#: src/audio_out/audio_directx2_out.c:189
+#: src/audio_out/audio_directx2_out.c:188
msgid "no sound driver available for use"
msgstr "kullanılabilecek bir ses sürücüsü yok"
-#: src/audio_out/audio_directx2_out.c:190
+#: src/audio_out/audio_directx2_out.c:189
msgid "requested COM interface not available"
msgstr "istenilen COM arayüzü kullanılabilir değil"
-#: src/audio_out/audio_directx2_out.c:191
+#: src/audio_out/audio_directx2_out.c:190
msgid "another application has a higher priority level"
msgstr "başka bir uygulamanın daha yüksek öncelik düzeyi var"
-#: src/audio_out/audio_directx2_out.c:192
+#: src/audio_out/audio_directx2_out.c:191
msgid "insufficient memory"
msgstr "yetersiz bellek"
-#: src/audio_out/audio_directx2_out.c:193
+#: src/audio_out/audio_directx2_out.c:192
msgid "low priority level for this function"
msgstr "bu fonksiyon için düşük öncelik düzeyi"
-#: src/audio_out/audio_directx2_out.c:194
+#: src/audio_out/audio_directx2_out.c:193
msgid "DirectSound wasn't initialized"
msgstr "DirectSound başlatılamadı"
-#: src/audio_out/audio_directx2_out.c:195
+#: src/audio_out/audio_directx2_out.c:194
msgid "function is not supported"
msgstr "fonksiyon desteklenmiyor"
-#: src/audio_out/audio_directx2_out.c:196
+#: src/audio_out/audio_directx2_out.c:195
msgid "unknown error"
msgstr "bilinmeyen hata"
-#: src/audio_out/audio_directx2_out.c:206
+#: src/audio_out/audio_directx2_out.c:205
#, c-format
msgid "Unable to create direct sound object."
msgstr "Doğrudan ses nesnesi oluşturulamadı."
-#: src/audio_out/audio_directx2_out.c:212
+#: src/audio_out/audio_directx2_out.c:211
#, c-format
msgid "Could not set direct sound cooperative level."
msgstr "Doğrudan ses işbirliği düzeyi ayarlanamadı."
-#: src/audio_out/audio_directx2_out.c:284
+#: src/audio_out/audio_directx2_out.c:283
msgid "Unable to create secondary direct sound buffer"
msgstr "İkincil doğrudan ses önbelleği oluşturulamadı"
-#: src/audio_out/audio_directx2_out.c:304
+#: src/audio_out/audio_directx2_out.c:303
msgid "Couldn't play sound buffer"
msgstr "Ses önbelleği çalınamadı"
-#: src/audio_out/audio_directx2_out.c:316
+#: src/audio_out/audio_directx2_out.c:315
msgid "Couldn't stop sound buffer"
msgstr "Ses önbelleği durdurulamadı"
-#: src/audio_out/audio_directx2_out.c:329
+#: src/audio_out/audio_directx2_out.c:328
msgid "Can't get buffer position"
msgstr "Önbellek konumu alınamadı"
-#: src/audio_out/audio_directx2_out.c:343
+#: src/audio_out/audio_directx2_out.c:342
msgid "Can't set buffer position"
msgstr "Önbellek konumu ayarlanamadı"
-#: src/audio_out/audio_directx2_out.c:374
+#: src/audio_out/audio_directx2_out.c:373
msgid "Can't set sound volume"
msgstr "Ses düzeyi ayarlanamadı"
-#: src/audio_out/audio_directx2_out.c:392
+#: src/audio_out/audio_directx2_out.c:391
#, c-format
msgid ": buffer lost, trying to restore\n"
msgstr ": önbellek kayıp, geri yüklenmeye çalışılıyor\n"
-#: src/audio_out/audio_directx2_out.c:396
+#: src/audio_out/audio_directx2_out.c:395
msgid "Couldn't lock direct sound buffer"
msgstr "Doğrudan ses önbelleğinin kilitlenemedi"
-#: src/audio_out/audio_directx2_out.c:409
+#: src/audio_out/audio_directx2_out.c:408
msgid "Couldn't unlock direct sound buffer"
msgstr "Doğrudan ses önbelleğinin kilidi açılamadı"
-#: src/audio_out/audio_directx2_out.c:500
+#: src/audio_out/audio_directx2_out.c:499
#, c-format
msgid "Unable to create primary direct sound buffer."
msgstr "Birincil doğrudan ses önbelleği oluşturulamadı."
-#: src/audio_out/audio_directx2_out.c:596
+#: src/audio_out/audio_directx2_out.c:595
#, fuzzy, c-format
msgid ": play cursor overran (data %u, min %u), flushing buffers\n"
msgstr ": ara belleği dolduran imleç geçişini çal, \n"
-#: src/audio_out/audio_directx2_out.c:699
+#: src/audio_out/audio_directx2_out.c:698
#, c-format
msgid ": can't create pthread condition: %s\n"
msgstr ": iş parçacığı durumu yaratamaz: %s\n"
-#: src/audio_out/audio_directx2_out.c:703
+#: src/audio_out/audio_directx2_out.c:702
#, c-format
msgid ": can't create pthread mutex: %s\n"
msgstr ": mutex iş parçacığı oluşturamaz: %s\n"
-#: src/audio_out/audio_directx2_out.c:710
+#: src/audio_out/audio_directx2_out.c:709
#, c-format
msgid ": can't create buffer pthread: %s\n"
msgstr ": tampon bellek iş parçacığı oluşturamaz: %s\n"
-#: src/audio_out/audio_directx2_out.c:825
+#: src/audio_out/audio_directx2_out.c:824
#, c-format
msgid ": can't destroy buffer pthread: %s\n"
msgstr ": tampon bellek iş parçacığını yok edemez: %s\n"
-#: src/audio_out/audio_directx2_out.c:832
+#: src/audio_out/audio_directx2_out.c:831
#, c-format
msgid ": can't destroy pthread condition: %s\n"
msgstr ": iş parçacığı şartını yok edemez : %s\n"
-#: src/audio_out/audio_directx2_out.c:835
+#: src/audio_out/audio_directx2_out.c:834
#, c-format
msgid ": can't destroy pthread mutex: %s\n"
msgstr ": mutex iş parçacığını yok edemez : %s\n"
-#: src/audio_out/audio_directx2_out.c:890
+#: src/audio_out/audio_directx2_out.c:889
#, c-format
msgid ": unknown control command %d\n"
msgstr ": bilinmeyen denetim komutu %d\n"
-#: src/audio_out/audio_directx2_out.c:946
+#: src/audio_out/audio_directx2_out.c:949
msgid "second xine audio output plugin using directx"
msgstr "directx kullanan ikinci xine ses çıktısı eklentisi"
-#: src/audio_out/audio_directx_out.c:831
+#: src/audio_out/audio_directx_out.c:840
msgid "xine audio output plugin for win32 using directx"
msgstr "win32 için directx kullanan xine ses çıktısı eklentisi"
@@ -524,11 +520,11 @@ msgstr ""
"buraya sabitlenmiş göreli konum girebilirsiniz.\n"
"Değerin birimi saniyenin 90000de bir olan bir PTS tıklamasıdır."
-#: src/audio_out/audio_esd_out.c:572
+#: src/audio_out/audio_esd_out.c:576
msgid "xine audio output plugin using esound"
msgstr "esound kullanan xine ses çıktısı eklentisi"
-#: src/audio_out/audio_file_out.c:362
+#: src/audio_out/audio_file_out.c:381
msgid "xine file audio output plugin"
msgstr "xine dosyası ses çıkışı eklentisi"
@@ -566,7 +562,7 @@ msgstr ""
msgid "xine output plugin for JACK Audio Connection Kit"
msgstr "JACK Audio Connection Kit kullanan xine ses çıktısı eklentisi"
-#: src/audio_out/audio_none_out.c:223
+#: src/audio_out/audio_none_out.c:229
msgid "xine dummy audio output plugin"
msgstr "xine sahte ses çıktısı eklentisi"
@@ -770,7 +766,7 @@ msgstr ""
"Bu değerin oranı -1 veya 0-15 arasındadır. Bu ayar OSS ses aygıt numarası "
"\"auto\" olarak ayarlandığında göz ardı edilir."
-#: src/audio_out/audio_oss_out.c:1081
+#: src/audio_out/audio_oss_out.c:1077
#, c-format
msgid "audio_oss_out: open() mixer %s failed: %s\n"
msgstr "audio_oss_out: karıştırıcı() açılması %s başarılamadı: %s\n"
@@ -787,21 +783,21 @@ msgstr "pulseaudio için kullanılan aygıt"
msgid "use 'server[:sink]' for setting the pulseaudio sink device."
msgstr "sesatımı kısma aygıtını ayarlamak için sunucuyu [:kısma] kullanın."
-#: src/audio_out/audio_pulse_out.c:963
+#: src/audio_out/audio_pulse_out.c:979
msgid "xine audio output plugin using pulseaudio sound server"
msgstr ""
"xine ses çıkışı eklentisi sesatımı uyumlu aygıtları/sürücüleri kullanıyor"
-#: src/audio_out/audio_sun_out.c:457 src/audio_out/audio_sun_out.c:950
+#: src/audio_out/audio_sun_out.c:455 src/audio_out/audio_sun_out.c:948
#, c-format
msgid "audio_sun_out: opening audio device %s failed: %s\n"
msgstr "audio_sun_out: ses aygıtı açılması başarılamadı %s failed: %s\n"
-#: src/audio_out/audio_sun_out.c:925
+#: src/audio_out/audio_sun_out.c:923
msgid "Sun audio device name"
msgstr "Sun ses aygıtı adı"
-#: src/audio_out/audio_sun_out.c:926
+#: src/audio_out/audio_sun_out.c:924
msgid ""
"Specifies the file name for the Sun audio device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -813,192 +809,30 @@ msgstr ""
"değiştirilirse, xine bu dosyayı keyfi bir içerikle doldurabilir. Bu nedenle, "
"girdiğiniz değerin Sun ses aygıtına uyması konusunda dikkatli olmalısınız."
-#: src/audio_out/audio_sun_out.c:968
+#: src/audio_out/audio_sun_out.c:966
#, c-format
msgid "audio_sun_out: audio ioctl on device %s failed: %s\n"
msgstr ""
"audio_sun_out: %s aygıtının ses ioctl (Giriş/Çıkış Denetimi) başarılamadı: "
"%s\n"
-#: src/audio_out/audio_sun_out.c:1022
+#: src/audio_out/audio_sun_out.c:1023
msgid "xine audio output plugin using sun-compliant audio devices/drivers"
msgstr "xine ses çıkışı eklentisi sun uyumlu aygıtları/sürücüleri kullanıyor"
-#: src/combined/ffmpeg/ff_audio_decoder.c:118
+#: src/combined/xine_ogg_demuxer.c:888
#, c-format
-msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"ffmpeg_audio_dec: tampon belleği %d seviyesine taşmayı önlemek için "
-"arttırıyor.\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:153
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr "ffmpeg_audio_dec: 0x%X türü dışında ffmpeg kod çözücü bulamıyor\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:198
-#, c-format
-msgid "ffmpeg_audio_dec: trying to open null codec\n"
-msgstr "ffmpeg_audio_dec: boş kodu açmaya çalışıyor\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:207
-#, c-format
-msgid "ffmpeg_audio_dec: couldn't open decoder\n"
-msgstr "ffmpeg_audio_dec: kod çözücüyü açamıyor\n"
-
-#: src/combined/ffmpeg/ff_audio_decoder.c:479
-#, fuzzy, c-format
-msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
-msgstr "ffmpeg_audio_dec: kod çözücüyü açamıyor\n"
-
-#: src/combined/ffmpeg/ff_dvaudio_decoder.c:285
-#, c-format
-msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"dvaudio: taşmayı önlemek için tampon belleği %d seviyesine çıkartıyor.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:187
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: desteklenmeyen çerçeve kipi, DR1 devre dışı.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:205
-#, c-format
-msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
-msgstr "ffmpeg_video_dec: desteklenmeyen çerçeve boyutları, DR1 devre dışı.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:316
-#, c-format
-msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
-msgstr "ffmpeg_video_dec: 0x%Xtürü için ffmpeg kod çözücüyü bulamıyor\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:347
-#, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder\n"
-msgstr "ffmpeg_video_dec: kod çözücüyü açamıyor\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:362
-#, fuzzy, c-format
-msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
-msgstr "ffmpeg_video_dec: kod çözücüyü açamıyor\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:410
-#, c-format
-msgid "ffmpeg_video_dec: direct rendering enabled\n"
-msgstr "ffmpeg_video_dec: doÄŸrudan iÅŸleme etkin\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:848
-#, c-format
-msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
-msgstr ""
-"ffmpeg_video_dec: taşmayı önlemek için tampon belleği %d seviyesine "
-"yükseltiyor.\n"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1835
-msgid "MPEG-4 postprocessing quality"
-msgstr "MPEG 4 iÅŸleme kalitesi"
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1836
-msgid ""
-"You can adjust the amount of post processing applied to MPEG-4 video.\n"
-"Higher values result in better quality, but need more CPU. Lower values may "
-"result in image defects like block artifacts. For high quality content, too "
-"heavy post processing can actually make the image worse by blurring it too "
-"much."
-msgstr ""
-"MPEG 4 görüntüye uygulanan işlemenin oranını ayarlayabilirsiniz.\n"
-"Yüksek değerler daha iyi sonuç verir, fakat daha çok işlemci gücü "
-"gerektirir. Düşük değerler görüntü bozulmalarınına sebebiyet verir. Yüksek "
-"kalite içeriği için, ağır işleme işlemleri doğal olarak onun netliğinin "
-"bozulmasına neden olabilir ve görüntünün kötüleşmesi sonucunu doğurabilir."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1844
-msgid "FFmpeg video decoding thread count"
-msgstr "FFmpeg görüntü kodlaması iş sayısı"
+msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
+msgstr "ogg: vorbis ses izi bulundu ama hiç vorbis akış başlığı bulunamadı.\n"
-#: src/combined/ffmpeg/ff_video_decoder.c:1845
+#: src/combined/xine_ogg_demuxer.c:2173
#, fuzzy
-msgid ""
-"You can adjust the number of video decoding threads which FFmpeg may use.\n"
-"Higher values should speed up decoding but it depends on the codec used "
-"whether parallel decoding is supported. A rule of thumb is to have one "
-"decoding thread per logical CPU (typically 1 to 4).\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-"FFmpeg'nin kullanabileceği görüntü kodlama işlerinin sayılarını "
-"ayarlayabilirsiniz.\n"
-"Yüksek değerler kodlama işleminin hızını yükseltir fakat bu kodlamada "
-"paralel kodlamanın yapılıp yapılmadığıyla da bağlantılıdır. Mimari kuralına "
-"göre mantıksal işlemci başına bir adet kodlama işlemi yapılmalıdır (tipik "
-"olarak 1den14'e kadar). Bu değişim sonraki yayın akışında etkili olacaktır."
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1854
-msgid "Skip loop filter"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1855
-msgid ""
-"You can control for which frames the loop filter shall be skipped after "
-"decoding.\n"
-"Skipping the loop filter will speedup decoding but may lead to artefacts. "
-"The number of frames for which it is skipped increases from 'none' to 'all'. "
-"The default value leaves the decision up to the implementation.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1864
-msgid "Choose speed over specification compliance"
-msgstr ""
-
-#: src/combined/ffmpeg/ff_video_decoder.c:1865
-msgid ""
-"You may want to allow speed cheats which violate codec specification.\n"
-"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
-"A change of this setting will take effect with playing the next stream."
-msgstr ""
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:167
-msgid "libavcodec mpeg output bitrate (kbit/s)"
-msgstr "libavcodec mpeg çıkış bit oranı (kbit/s)"
+msgid "Annodex demux plugin"
+msgstr "xine: demuxer eklentisi bulundu: %s\n"
-#: src/combined/ffmpeg/ffmpeg_encoder.c:168
-msgid ""
-"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
-"Higher values will increase quality and CPU usage.\n"
-"This setting is only considered, when constant quality mode is disabled."
+#: src/combined/xine_ogg_demuxer.c:2197
+msgid "OGG demux plugin"
msgstr ""
-"libavcodec mpeg çıkış bit oranı, DXR3 kodlama kipini kullanmalıdır. Yüksek "
-"değerler kaliteyi ve işlemci kullanımını yükseltir.\n"
-"Bu ayar sadece sabit kalite kipi devre dışı ise etkilidir."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:175
-msgid "constant quality mode"
-msgstr "sabit kalite kipi"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:176
-msgid ""
-"When enabled, libavcodec will use a constant quality mode by dynamically "
-"compressing the images based on their complexity. When disabled, libavcodec "
-"will use constant bitrate mode."
-msgstr ""
-"Etkinleştirildiğinde libavcodec, görüntünün karmaşık yapısına göre dinamik "
-"olarak sıkıştırılmış sabit kalite kipini kullanacaktır "
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:183
-msgid "minimum compression"
-msgstr "en düşük sıkıştırma"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:184
-msgid "The minimum compression to apply to an image in constant quality mode."
-msgstr "Sabit kalite kipindeki bir resme uygulanacak ola en düşük sıkıştırma."
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:189
-msgid "maximum quantizer"
-msgstr "en yüksek nicelikler"
-
-#: src/combined/ffmpeg/ffmpeg_encoder.c:190
-msgid "The maximum compression to apply to an image in constant quality mode."
-msgstr "Sabit kalite kipindeki bir resme uygulanacak ola en yüksek sıkıştırma."
#: src/demuxers/demux_asf.c:450
#, fuzzy, c-format
@@ -1018,6 +852,10 @@ msgstr "demux_asf: uyarı: Akış kimliği=%d şifrelidir.\n"
msgid "Media stream scrambled/encrypted"
msgstr "Ortam akışı şifrelidir"
+#: src/demuxers/demux_asf.c:2134
+msgid "ASF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_avi.c:530 src/demuxers/demux_avi.c:644
msgid "Restoring index..."
msgstr "İndeks Yeniden Yükleniyor..."
@@ -1037,16 +875,24 @@ msgstr "demux_avi: avi indeksi bozuk\n"
msgid "demux_avi: failed to seek to the next chunk (pos %<PRIdMAX>)\n"
msgstr "demux_avi: sonraki yığın bulunamadı (konum %<PRIdMAX>)\n"
+#: src/demuxers/demux_avi.c:2330
+msgid "AVI/RIFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_film.c:186
#, c-format
msgid "invalid FILM chunk size\n"
msgstr "geçersiz FILM yığını\n"
-#: src/demuxers/demux_film.c:342
+#: src/demuxers/demux_film.c:345
#, c-format
msgid "unrecognized FILM chunk\n"
msgstr "tanınmayan FILM yığını\n"
+#: src/demuxers/demux_film.c:904
+msgid "FILM (CPK) demux plugin"
+msgstr ""
+
#: src/demuxers/demux_flv.c:184
#, c-format
msgid "unsupported FLV version (%d).\n"
@@ -1062,6 +908,11 @@ msgstr "bu dosya içerisinde ses ya da görüntü akışı yok.\n"
msgid "sequence header too big (%u bytes)!\n"
msgstr ""
+#: src/demuxers/demux_flv.c:1000
+#, fuzzy
+msgid "Flash Video file demux plugin"
+msgstr "Video CD girdi eklentisi"
+
#: src/demuxers/demux_iff.c:233
#, c-format
msgid "iff-8svx/16sv: unknown compression: %d\n"
@@ -1077,12 +928,20 @@ msgstr "iff-ilbm: bilinmeyen sıkıştırma: %d\n"
msgid "iff: unknown Chunk: %s\n"
msgstr "iff: bilinmeyen Yığın: %s\n"
+#: src/demuxers/demux_iff.c:1225
+msgid "IFF demux plugin"
+msgstr ""
+
#: src/demuxers/demux_mpc.c:205
#, c-format
msgid "demux_mpc: frame too big for buffer"
msgstr "demux_mpc: çerçeve önbellek için çok büyük"
-#: src/demuxers/demux_mpeg_block.c:291
+#: src/demuxers/demux_mpc.c:358
+msgid "Musepack demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_block.c:297
#, c-format
msgid ""
"xine-lib:demux_mpeg_block: Unrecognised stream_id 0x%02x. Please report this "
@@ -1091,7 +950,7 @@ msgstr ""
"xine-lib:demux_mpeg_block: Tanınmayan akış_kimliği 0x%02x. Lütfen bunu xine "
"geliÅŸtiricilerine bildirin.\n"
-#: src/demuxers/demux_mpeg_block.c:302
+#: src/demuxers/demux_mpeg_block.c:308
#, c-format
msgid ""
"demux_mpeg_block: error! freeing. Please report this to xine developers.\n"
@@ -1099,13 +958,13 @@ msgstr ""
"demux_mpeg_block: hata! boşaltılıyor.Lütfen bunu xine geliştiricilerine "
"bildirin.\n"
-#: src/demuxers/demux_mpeg_block.c:634
+#: src/demuxers/demux_mpeg_block.c:640
#, c-format
msgid "demux_mpeg_block: warning: PES header reserved 10 bits not found\n"
msgstr ""
"demux_mpeg_block: uyarı: 10 bit olarak saklanan PES başlığı bulunamadı\n"
-#: src/demuxers/demux_mpeg_block.c:644
+#: src/demuxers/demux_mpeg_block.c:650
#, c-format
msgid ""
"demux_mpeg_block: warning: PES header indicates that this stream may be "
@@ -1114,7 +973,11 @@ msgstr ""
"demux_mpeg_block: uyarı: PES başlığı bu akışın şifrelenmiş olabileceğini "
"bildiriyor (ÅŸifrelenmiÅŸ kip %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:413
+#: src/demuxers/demux_mpeg_block.c:1490
+msgid "DVD/VOB demux plugin"
+msgstr ""
+
+#: src/demuxers/demux_mpeg_pes.c:418
#, c-format
msgid ""
"xine-lib:demux_mpeg_pes: Unrecognised stream_id 0x%02x. Please report this "
@@ -1123,19 +986,19 @@ msgstr ""
"xine-lib:demux_mpeg_pes: Tanınmayan akış_kimliği 0x%02x. Lütfen bunu xine "
"geliÅŸtiricilerine bildirin.\n"
-#: src/demuxers/demux_mpeg_pes.c:422
+#: src/demuxers/demux_mpeg_pes.c:427
#, c-format
msgid "demux_mpeg_pes: warning: PACK stream id=0x%x decode failed.\n"
msgstr ""
"demux_mpeg_pes: uyarı: PACK akış kimliği=0x%x kodlamasının açılması işlemi "
"başarısız oldu.\n"
-#: src/demuxers/demux_mpeg_pes.c:804
+#: src/demuxers/demux_mpeg_pes.c:809
#, c-format
msgid "demux_mpeg_pes: warning: PES header reserved 10 bits not found\n"
msgstr "demux_mpeg_pes: uyarı: 10 bit olarak saklanan PES başlığı bulunamadı\n"
-#: src/demuxers/demux_mpeg_pes.c:814
+#: src/demuxers/demux_mpeg_pes.c:819
#, c-format
msgid ""
"demux_mpeg_pes: warning: PES header indicates that this stream may be "
@@ -1144,7 +1007,7 @@ msgstr ""
"demux_mpeg_pes: uyarı: PES başlığı bu akışın şifrelenmiş olabileceğini "
"bildiriyor (ÅŸifrelenmiÅŸ kip %d)\n"
-#: src/demuxers/demux_mpeg_pes.c:1116
+#: src/demuxers/demux_mpeg_pes.c:1121
#, c-format
msgid ""
"demux_mpeg_pes:Unrecognised private stream 1 0x%02x. Please report this to "
@@ -1153,10 +1016,9 @@ msgstr ""
"demux_mpeg_pes:Tanınmayan gizli akış 1 0x%02x. Lütfen bunu xine "
"geliÅŸtiricilerine bildirin.\n"
-#: src/demuxers/demux_ogg.c:880
-#, c-format
-msgid "ogg: vorbis audio track indicated but no vorbis stream header found.\n"
-msgstr "ogg: vorbis ses izi bulundu ama hiç vorbis akış başlığı bulunamadı.\n"
+#: src/demuxers/demux_mpeg_pes.c:1785
+msgid "mpeg pes demux plugin"
+msgstr ""
#: src/demuxers/demux_snd.c:100
#, c-format
@@ -1168,11 +1030,21 @@ msgstr "demux_snd: kötü başlık parametreleri\n"
msgid "demux_snd: unsupported audio type: %d\n"
msgstr "demux_snd: desteklenmeyen ses tipi: %d\n"
-#: src/demuxers/demux_tta.c:98
+#: src/demuxers/demux_snd.c:356
+#, fuzzy
+msgid "SND/AU file demux plugin"
+msgstr "dosya girdi eklentisi"
+
+#: src/demuxers/demux_tta.c:97
#, c-format
msgid "demux_tta: total frames count too high\n"
msgstr "demux_tta: toplam çerçeve sayısı çok yüksek\n"
+#: src/demuxers/demux_tta.c:326
+#, fuzzy
+msgid "True Audio demux plugin"
+msgstr "xine: demuxer eklentisi bulundu: %s\n"
+
#: src/demuxers/demux_voc.c:103
#, c-format
msgid "unknown VOC block type (0x%02X); please report to xine developers\n"
@@ -1188,6 +1060,11 @@ msgstr ""
"bilinmeyen VOC sıkıştırma tipi (0x%02X); lütfen bunu xine geliştiricilerine "
"bildirin.\n"
+#: src/demuxers/demux_voc.c:336
+#, fuzzy
+msgid "VOC file demux plugin"
+msgstr "dosya girdi eklentisi"
+
#: src/demuxers/demux_wc3movie.c:190
#, c-format
msgid "demux_wc3movie: SHOT chunk referenced invalid palette (%d >= %d)\n"
@@ -1198,38 +1075,42 @@ msgstr "demux_wc3movie: SHOT yığını geçersiz paleti gösterdi (%d >= %d)\n"
msgid "demux_wc3movie: There was a problem while loading palette chunks\n"
msgstr "demux_wc3movie: Palet yığınlarını yüklerken bir sorunla karşılaştı\n"
-#: src/dxr3/dxr3.h:30
-msgid "DXR3 device number"
-msgstr "DXR3 aygıt numarası"
+#: src/demuxers/demux_wc3movie.c:718
+msgid "Wing Commander III Movie (MVE) demux plugin"
+msgstr ""
-#: src/dxr3/dxr3.h:31
+#: src/dxr3/dxr3_decode_spu.c:196
msgid ""
-"If you have more than one DXR3 in your computer, you can specify which one "
-"to use here."
+"subtitle decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card"
msgstr ""
-"Eğer bilgisayarınızda birden fazla DXR3 varsa, burada hangisini "
-"kullanacağınızı belirlemelisiniz."
-#: src/dxr3/dxr3_decode_spu.c:262
+#: src/dxr3/dxr3_decode_spu.c:241
#, c-format
msgid "dxr3_decode_spu: Failed to open spu device %s (%s)\n"
msgstr "dxr3_decode_spu: spu device %s (%s) yüklenemedi\n"
-#: src/dxr3/dxr3_decode_spu.c:672
+#: src/dxr3/dxr3_decode_spu.c:635
#, c-format
msgid "requested button not available\n"
msgstr "istenilen düğme kullanılabilir değil\n"
-#: src/dxr3/dxr3_decode_video.c:254
+#: src/dxr3/dxr3_decode_video.c:185
+msgid ""
+"MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 "
+"decoder card."
+msgstr ""
+
+#: src/dxr3/dxr3_decode_video.c:232
#, c-format
msgid "dxr3_decode_video: Failed to open control device %s (%s)\n"
msgstr "dxr3_decode_video: Denetim aygıtı %s (%s) açılamadı\n"
-#: src/dxr3/dxr3_decode_video.c:260
+#: src/dxr3/dxr3_decode_video.c:238
msgid "use Pan & Scan info"
msgstr "Panla & Tara bilgisini kullanın"
-#: src/dxr3/dxr3_decode_video.c:261
+#: src/dxr3/dxr3_decode_video.c:239
msgid ""
"\"Pan & Scan\" is a special display mode which is sometimes used in MPEG "
"encoded material. You can specify here, how to handle such content.\n"
@@ -1261,11 +1142,11 @@ msgstr ""
"etkinleştiriniz. Bu bazı Avrupa DVB kanallarında kullanılan Etkin Kip "
"Tanımlayıcısı'nın (AFD) kullanımını sağlar."
-#: src/dxr3/dxr3_decode_video.c:280
+#: src/dxr3/dxr3_decode_video.c:258
msgid "try to sync video every frame"
msgstr "her çerçevede görüntüyü eşzamanlamayı dene"
-#: src/dxr3/dxr3_decode_video.c:281
+#: src/dxr3/dxr3_decode_video.c:259
msgid ""
"Tries to set a synchronization timestamp for every frame. Normally this is "
"not necessary, because sync is sufficent even when the timestamp is set only "
@@ -1277,21 +1158,21 @@ msgstr ""
"uygundur.\n"
"Bu sadece yürüyen görüntü için geçerlidir (çoğu PAL görüntüde oluğu gibi)."
-#: src/dxr3/dxr3_decode_video.c:287
+#: src/dxr3/dxr3_decode_video.c:265
msgid "use smooth play mode"
msgstr "düz oynatma kipini kullan"
-#: src/dxr3/dxr3_decode_video.c:288
+#: src/dxr3/dxr3_decode_video.c:266
msgid "Enabling this option will utilise a smoother play mode."
msgstr ""
"Bu seçeneği etkinleştirmek daha yumuşak bir çalma kipine geçişi "
"sağlayacaktır."
-#: src/dxr3/dxr3_decode_video.c:291
+#: src/dxr3/dxr3_decode_video.c:269
msgid "correct frame durations in broken streams"
msgstr "kırık akışlarda çerçeve sürelerini düzelt"
-#: src/dxr3/dxr3_decode_video.c:292
+#: src/dxr3/dxr3_decode_video.c:270
msgid ""
"Enables a small logic that corrects the frame durations of some mpeg streams "
"with wrong framerate codes. Currently a correction for NTSC streams "
@@ -1303,39 +1184,51 @@ msgstr ""
"çok yanlışlıkla PAL akışı olarak etiketlenmiş NTSC akışlarında karşımıza "
"çıkar. Bu özelliği böylesi akışlarla karşılaştığınızda etkinleştirin."
-#: src/dxr3/dxr3_decode_video.c:551
+#: src/dxr3/dxr3_decode_video.c:513
#, c-format
msgid "dxr3_decode_video: Failed to open video device %s (%s)\n"
msgstr "dxr3_decode_video: Aygıt açılamadı %s (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:619
+#: src/dxr3/dxr3_decode_video.c:581
#, c-format
msgid "dxr3_decode_video: write to device would block. flushing\n"
msgstr "dxr3_decode_video: kızarmayı önlemesi için aygıta yazar\n"
-#: src/dxr3/dxr3_decode_video.c:623
+#: src/dxr3/dxr3_decode_video.c:585
#, c-format
msgid "dxr3_decode_video: video device write failed (%s)\n"
msgstr "dxr3_decode_video: görüntü aygıtına yazılamadı (%s)\n"
-#: src/dxr3/dxr3_decode_video.c:738
+#: src/dxr3/dxr3_decode_video.c:700
#, c-format
msgid "dxr3_decode_video: WARNING: unknown frame rate code %d\n"
msgstr "dxr3_decode_video: UYARI: bilinmeyen çerçevesi oranı kodu %d\n"
-#: src/dxr3/dxr3_decode_video.c:766
+#: src/dxr3/dxr3_decode_video.c:728
#, c-format
msgid ""
"dxr3_decode_video: WARNING: correcting frame rate code from PAL to NTSC\n"
msgstr ""
"dxr3_decode_video: UYARI: çerçeve oranı kodu PAL'den NTSC'ye çevriliyor\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:123
+#: src/dxr3/dxr3.h:34
+msgid "DXR3 device number"
+msgstr "DXR3 aygıt numarası"
+
+#: src/dxr3/dxr3.h:35
+msgid ""
+"If you have more than one DXR3 in your computer, you can specify which one "
+"to use here."
+msgstr ""
+"Eğer bilgisayarınızda birden fazla DXR3 varsa, burada hangisini "
+"kullanacağınızı belirlemelisiniz."
+
+#: src/dxr3/dxr3_mpeg_encoders.c:122
#, c-format
msgid "dxr3_mpeg_encoder: failed to init librte\n"
msgstr "dxr3_mpeg_encoder: librte başlatılamadı\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:158
+#: src/dxr3/dxr3_mpeg_encoders.c:157
#, c-format
msgid ""
"dxr3_mpeg_encoder: rte only handles video dimensions which are multiples of "
@@ -1343,21 +1236,21 @@ msgid ""
msgstr ""
"dxr3_mpeg_encoder: 16 çoklamasına sahip görüntü boyutlarında sadece rte \n"
-#: src/dxr3/dxr3_mpeg_encoders.c:168
+#: src/dxr3/dxr3_mpeg_encoders.c:167
#, c-format
msgid "dxr3_mpeg_encoder: failed to get rte context.\n"
msgstr "dxr3_mpeg_encoder: rte bağlamı alınamadı.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:179
+#: src/dxr3/dxr3_mpeg_encoders.c:178
#, c-format
msgid "dxr3_mpeg_encoder: could not create codec.\n"
msgstr "dxr3_mpeg_encoder: kodlayıcı oluşturulamadı.\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:187
+#: src/dxr3/dxr3_mpeg_encoders.c:186
msgid "rte mpeg output bitrate (kbit/s)"
msgstr "rte mpeg çıktısı bit oranı (kbit/s)"
-#: src/dxr3/dxr3_mpeg_encoders.c:188
+#: src/dxr3/dxr3_mpeg_encoders.c:187
msgid ""
"The bitrate the mpeg encoder library librte should use for DXR3's encoding "
"mode. Higher values will increase quality and CPU usage."
@@ -1366,26 +1259,26 @@ msgstr ""
"kullanmalı. Daha yüksek değerle kaliteyi ve işlemci kullanımını "
"arttıracaktır."
-#: src/dxr3/dxr3_mpeg_encoders.c:232
+#: src/dxr3/dxr3_mpeg_encoders.c:231
#, c-format
msgid "dxr3_mpeg_encoder: cannot init the context: %s\n"
msgstr "dxr3_mpeg_encoder: bağlam başlatılamadı: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:240
+#: src/dxr3/dxr3_mpeg_encoders.c:239
#, c-format
msgid "dxr3_mpeg_encoder: cannot start encoding: %s\n"
msgstr "dxr3_mpeg_encoder: kodlamaya başlanamadı: %s\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:370
+#: src/dxr3/dxr3_mpeg_encoders.c:367
#, c-format
msgid "dxr3_mpeg_encoder: Couldn't start the FAME library\n"
msgstr "dxr3_mpeg_encoder: FAME kütüphanesi başlatılamadı\n"
-#: src/dxr3/dxr3_mpeg_encoders.c:385
+#: src/dxr3/dxr3_mpeg_encoders.c:382
msgid "fame mpeg encoding quality"
msgstr "fame mpeg kodlama kalitesi"
-#: src/dxr3/dxr3_mpeg_encoders.c:386
+#: src/dxr3/dxr3_mpeg_encoders.c:383
msgid ""
"The encoding quality of the libfame mpeg encoder library. Lower is faster "
"but gives noticeable artifacts. Higher is better but slower."
@@ -1408,11 +1301,15 @@ msgstr ""
"zamanlayıcısının kullanılacağı anlamına gelir. 5'den daha büyük değerler "
"DXR3'ü senkron kaynağı olarak dahili saati kullanması için zorlarlar."
-#: src/dxr3/video_out_dxr3.c:262
+#: src/dxr3/video_out_dxr3.c:186
+msgid "video output plugin displaying images through your DXR3 decoder card"
+msgstr ""
+
+#: src/dxr3/video_out_dxr3.c:257
msgid "swap odd and even lines"
msgstr "tek ve çift satırları değiştir"
-#: src/dxr3/video_out_dxr3.c:263
+#: src/dxr3/video_out_dxr3.c:258
msgid ""
"Swaps the even and odd field of the image.\n"
"Enable this option for non-MPEG material which produces a vertical jitter on "
@@ -1422,11 +1319,11 @@ msgstr ""
"Bu seçeneği MPEG malzemesi dışında ekranda dikey oynamalar üretmek için "
"etkinleÅŸtirin."
-#: src/dxr3/video_out_dxr3.c:267
+#: src/dxr3/video_out_dxr3.c:262
msgid "add black bars to correct aspect ratio"
msgstr "görünüm oranını düzeltmek için siyah çubuklar ekle"
-#: src/dxr3/video_out_dxr3.c:268
+#: src/dxr3/video_out_dxr3.c:263
msgid ""
"Adds black bars when the image has an aspect ratio the card cannot handle "
"natively. This is needed to maintain proper image proportions."
@@ -1434,32 +1331,32 @@ msgstr ""
"Resim görüntü oranı kartı ile başa çıkamadığında siyah çizgiler ekler. Bu "
"uygun görüntü kesitleri oluşturulmak isteniğinde gereklidir."
-#: src/dxr3/video_out_dxr3.c:273
+#: src/dxr3/video_out_dxr3.c:268
msgid "use smooth play mode for mpeg encoder playback"
msgstr "mpeg kodlayıcı oynatması için pürüzsüz oynatmayı kullan"
-#: src/dxr3/video_out_dxr3.c:274
+#: src/dxr3/video_out_dxr3.c:269
msgid ""
"Enabling this option will utilise a smoother play mode for non-MPEG content."
msgstr ""
"Bu seçeneği etkinleştirmek MPEG içeriği dışındaki kaynaklar için daha "
"yumuşak oynatma kipine geçişi sağlayacaktır."
-#: src/dxr3/video_out_dxr3.c:282
+#: src/dxr3/video_out_dxr3.c:277
#, c-format
msgid "video_out_dxr3: Failed to open control device %s (%s)\n"
msgstr "video_out_dxr3: Denetim aygıtı %s (%s) açılamadı\n"
-#: src/dxr3/video_out_dxr3.c:290
+#: src/dxr3/video_out_dxr3.c:285
#, c-format
msgid "video_out_dxr3: Failed to open video device %s (%s)\n"
msgstr "video_out_dxr3: Görüntü aygıtı %s (%s) açılamadı\n"
-#: src/dxr3/video_out_dxr3.c:336
+#: src/dxr3/video_out_dxr3.c:318
msgid "encoder for non mpeg content"
msgstr "mpeg olmayan içerik için kodlayıcı"
-#: src/dxr3/video_out_dxr3.c:337
+#: src/dxr3/video_out_dxr3.c:319
msgid ""
"Content other than MPEG has to pass an additional reencoding stage, because "
"the dxr3 handles only MPEG.\n"
@@ -1484,22 +1381,22 @@ msgstr ""
"\"fame\" ve \"rtre\" hala oradadırlar, fakat xine onları güncel olarak "
"desteklemezler, bu yüzden çalışmazlar."
-#: src/dxr3/video_out_dxr3.c:348
+#: src/dxr3/video_out_dxr3.c:330
#, c-format
msgid "video_out_dxr3: Mpeg encoder libavcodec failed to init.\n"
msgstr "video_out_dxr3: Mpeg kodlayıcı libavcodec başlatılamadı.\n"
-#: src/dxr3/video_out_dxr3.c:354
+#: src/dxr3/video_out_dxr3.c:336
#, c-format
msgid "video_out_dxr3: Mpeg encoder rte failed to init.\n"
msgstr "video_out_dxr3: Mpeg kodlayıcı rte başlatılamadı.\n"
-#: src/dxr3/video_out_dxr3.c:361
+#: src/dxr3/video_out_dxr3.c:343
#, c-format
msgid "video_out_dxr3: Mpeg encoder fame failed to init.\n"
msgstr "video_out_dxr3: Mpeg kodlayıcı fame başlatılamadı.\n"
-#: src/dxr3/video_out_dxr3.c:367
+#: src/dxr3/video_out_dxr3.c:349
#, c-format
msgid ""
"video_out_dxr3: Mpeg encoding disabled.\n"
@@ -1517,7 +1414,7 @@ msgstr ""
"video_out_dxr3: sürücü. kodlayıcıyı yapılandırmak hakkında daha detaylı "
"bilgiler için README.dxr3 dosyasını okuyunuz.\n"
-#: src/dxr3/video_out_dxr3.c:373
+#: src/dxr3/video_out_dxr3.c:355
#, c-format
msgid ""
"video_out_dxr3: No mpeg encoder compiled in.\n"
@@ -1535,11 +1432,11 @@ msgstr ""
"video_out_dxr3: sürücü. kodlayıcıyı yapılandırmak hakkında daha detaylı "
"bilgiler için README.dxr3 dosyasını okuyunuz.\n"
-#: src/dxr3/video_out_dxr3.c:388
+#: src/dxr3/video_out_dxr3.c:370
msgid "video output mode (TV or overlay)"
msgstr "görüntü çıktı kipi (TV ya da üstyazım)"
-#: src/dxr3/video_out_dxr3.c:389
+#: src/dxr3/video_out_dxr3.c:371
msgid ""
"The way the DXR3 outputs the final video can be set here. The individual "
"values are:\n"
@@ -1599,12 +1496,12 @@ msgstr ""
"gizlenmesi suretiyle TV çıkışına geçirilmesidir. Bu DXR3 kaplamasının ortak "
"deÄŸiÅŸkenidir."
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
#, fuzzy
msgid "overlay colour key value"
msgstr "katman renk deÄŸeri"
-#: src/dxr3/video_out_dxr3.c:436
+#: src/dxr3/video_out_dxr3.c:418
#, fuzzy
msgid ""
"Hexadecimal RGB value of the key colour.\n"
@@ -1615,12 +1512,12 @@ msgstr ""
"Eğer DXR3 katman kipini kullandığınızda pencereler şeffaflaşırsa değişik "
"deÄŸerler deneyebilirsiniz."
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
#, fuzzy
msgid "overlay colour key tolerance"
msgstr "katman renk toleransı"
-#: src/dxr3/video_out_dxr3.c:441
+#: src/dxr3/video_out_dxr3.c:423
#, fuzzy
msgid ""
"A greater value widens the tolerance for the overlay key colour.\n"
@@ -1633,11 +1530,11 @@ msgstr ""
"değerler deneyebilirsiniz, fakat çok daha düşük bir değer denediğinizde "
"görüntü sınırlarının bazı kısımları kaybolabilir."
-#: src/dxr3/video_out_dxr3.c:447
+#: src/dxr3/video_out_dxr3.c:429
msgid "crop the overlay area at top and bottom"
msgstr "Üst ve altın katman bölgesini kesin"
-#: src/dxr3/video_out_dxr3.c:448
+#: src/dxr3/video_out_dxr3.c:430
msgid ""
"Removes one pixel line from the top and bottom of the overlay. Enable this, "
"if you see green lines at the top or bottom of the overlay."
@@ -1645,16 +1542,16 @@ msgstr ""
"Katmanın üst ve altından bir piksel satırını çıkarır. Katmanın üst ve "
"altındaki yeşil satırı görmek isterseniz bunu etkinleştirin."
-#: src/dxr3/video_out_dxr3.c:452
+#: src/dxr3/video_out_dxr3.c:434
#, c-format
msgid "video_out_dxr3: please run autocal, overlay disabled\n"
msgstr "video_out_dxr3: lütfen otomatik ayarı çalıştırın, katman kayboldu\n"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid "preferred tv mode"
msgstr "tercih edilen tv kipi"
-#: src/dxr3/video_out_dxr3.c:462
+#: src/dxr3/video_out_dxr3.c:444
msgid ""
"Selects the TV mode to be used by the DXR3. The values mean:\n"
"\n"
@@ -1670,12 +1567,12 @@ msgstr ""
"pal60: saniyede 60Hz hızındaki PAL\n"
"varsayılan: ekran kartının ayarlarını korur"
-#: src/dxr3/video_out_dxr3.c:484
+#: src/dxr3/video_out_dxr3.c:466
#, c-format
msgid "video_out_dxr3: setting video mode failed.\n"
msgstr "video_out_dxr3: görüntü kipi ayarlanamadı.\n"
-#: src/dxr3/video_out_dxr3.c:714
+#: src/dxr3/video_out_dxr3.c:693
#, c-format
msgid ""
"video_out_dxr3: Need an mpeg encoder to play non-mpeg videos on dxr3\n"
@@ -1685,38 +1582,38 @@ msgstr ""
"kodlayıcısına ihtiyaç duyar\n"
"video_out_dxr3: Detaylar için README.dxr3 dosyasını okuyun.\n"
-#: src/dxr3/video_out_dxr3.c:1369
+#: src/dxr3/video_out_dxr3.c:1344
#, c-format
msgid "video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"
msgstr ""
"video_out_dxr3: HATA Katman init dosyasını okuyor. Otomatik kullanımı "
"çalıştırın!\n"
-#: src/input/input_cdda.c:1605
+#: src/input/input_cdda.c:1600
#, c-format
msgid "%s: can't connect to %s:%d\n"
msgstr "%s: %s konumuna bağlanılamadı:%d\n"
-#: src/input/input_cdda.c:1652
+#: src/input/input_cdda.c:1647
#, fuzzy, c-format
msgid "input_cdda: successfully connected to cddb server '%s:%d'.\n"
msgstr "input_cdda: cddb sunucusuna başarılı bir şekilde bağlandı '%s:%d'.\n"
-#: src/input/input_cdda.c:1657
+#: src/input/input_cdda.c:1652
#, c-format
msgid "input_cdda: failed to connect to cddb server '%s:%d' (%s).\n"
msgstr ""
"input_cdda: cddb sunucusuna '%s:%d' (%s) bağlanma işlemi başarısız oldu.\n"
-#: src/input/input_cdda.c:2766
+#: src/input/input_cdda.c:2671
msgid "CD Digital Audio (aka. CDDA)"
msgstr "CD Dijital Ses (CDDA olarak da bilinir)"
-#: src/input/input_cdda.c:2818
+#: src/input/input_cdda.c:2684
msgid "device used for CD audio"
msgstr "CD sesi için kullanılan aygıt"
-#: src/input/input_cdda.c:2819
+#: src/input/input_cdda.c:2685
msgid ""
"The path to the device, usually a CD or DVD drive, which you intend to use "
"for playing audio CDs."
@@ -1724,11 +1621,11 @@ msgstr ""
"Aygıta giden yol, ses CDlerini çalmak amacıyla kullandığınız CD yada DVD "
"sürücüsü."
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid "query CDDB"
msgstr "CDDB sorgusu"
-#: src/input/input_cdda.c:2825
+#: src/input/input_cdda.c:2691
msgid ""
"Enables CDDB queries, which will give you convenient title and track names "
"for your audio CDs.\n"
@@ -1743,11 +1640,11 @@ msgstr ""
"paralelinde bir ağ sunucusundan ilgili bilgilerin toplandığını aklınızdan "
"çıkarmayınız."
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid "CDDB server name"
msgstr "CDDB sunucu adı"
-#: src/input/input_cdda.c:2833
+#: src/input/input_cdda.c:2699
msgid ""
"The CDDB server used to retrieve the title and track information from.\n"
"This setting is security critical, because the sever will receive "
@@ -1759,35 +1656,19 @@ msgstr ""
"alışkanlıklarınız hakkında bilgiler toplayacak ve kötü niyetli sorguları "
"cevaplandıracaktır. Güvenilir sunucuları kullanmayı deneyin."
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "CDDB server port"
msgstr "CDDB sunucu portu"
-#: src/input/input_cdda.c:2841
+#: src/input/input_cdda.c:2707
msgid "The server port used to retrieve the title and track information from."
msgstr "Sunucu portu başlık ve iz bilgisini almak için kullanıldı."
-#: src/input/input_cdda.c:2847
-msgid "CDDB cache directory"
-msgstr "CDDB önbellek dizini"
-
-#: src/input/input_cdda.c:2847
-msgid ""
-"The replies from the CDDB server will be cached in this directory.\n"
-"This 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."
-msgstr ""
-"CDDB sunucusundan gelen cevaplar bu dizinde saklanacaktır.\n"
-"Bu ayar güvenlik açısından kritiktir, çünkü bu dizinde dosyalara verilen "
-"isimler denetlenemeyecektir. Bu dizini CDDB depolanması dışında başka amaçla "
-"kullanmamaya özen gösterin."
-
-#: src/input/input_cdda.c:2855
+#: src/input/input_cdda.c:2713
msgid "slow down disc drive to this speed factor"
msgstr "disk sürücüsünün hızını seviyesine düşür"
-#: src/input/input_cdda.c:2856
+#: src/input/input_cdda.c:2714
msgid ""
"Since some CD or DVD drives make some really loud noises because of the fast "
"disc rotation, xine will try to slow them down. With standard CD or DVD "
@@ -1801,60 +1682,60 @@ msgstr ""
"böylece yavaşlama, çalma performansını etkilemez.\n"
"Buradaki sıfır değeri yavaşlamayı devre dışı bırakacaktır."
-#: src/input/input_dvb.c:904
+#: src/input/input_dvb.c:894
#, c-format
msgid "input_dvb: failed to open dvb channel file '%s': %s\n"
msgstr "input_dvb: dvb kanal dosyası açılamadı '%s': %s\n"
-#: src/input/input_dvb.c:910
+#: src/input/input_dvb.c:900
#, c-format
msgid "input_dvb: dvb channel file '%s' is not a plain file\n"
msgstr "input_dvb: dvb kanal dosyası '%s' düz bir dosya değil\n"
-#: src/input/input_dvb.c:2148 src/input/input_dvb.c:2995
+#: src/input/input_dvb.c:2134 src/input/input_dvb.c:2983
#, c-format
msgid "input_dvb: tuner_set_channel failed\n"
msgstr "input_dvb: tuner_set_channel başarısız oldu\n"
-#: src/input/input_dvb.c:2788
+#: src/input/input_dvb.c:2776
#, c-format
msgid "input_dvb: DVB GUI %s\n"
msgstr ""
-#: src/input/input_dvb.c:2793 src/input/input_dvb.c:3223
+#: src/input/input_dvb.c:2781 src/input/input_dvb.c:3198
#, c-format
msgid "input_dvb: cannot open dvb device\n"
msgstr "input_dvb: dvb aygıtı açılamadı\n"
-#: src/input/input_dvb.c:2817
+#: src/input/input_dvb.c:2805
#, c-format
msgid "input_dvb: channel %d out of range, defaulting to 0\n"
msgstr "input_dvb: kanal %d sınırların dışında, Sıfırlanıyor\n"
-#: src/input/input_dvb.c:2828
+#: src/input/input_dvb.c:2816
#, c-format
msgid "input_dvb: searching for channel %s\n"
msgstr "input_dvb: %s kanalını arıyor\n"
-#: src/input/input_dvb.c:2851
+#: src/input/input_dvb.c:2839
#, c-format
msgid "input_dvb: exact match for %s not found: trying partial matches\n"
msgstr ""
"input_dvb: %s için tam eşleşme bulunamadı: kısmi eşleşmeler deneniyor\n"
-#: src/input/input_dvb.c:2858
+#: src/input/input_dvb.c:2846
#, c-format
msgid "input_dvb: found matching channel %s\n"
msgstr "input_dvb: %s eÅŸleÅŸen kanal bulundu\n"
-#: src/input/input_dvb.c:2871
+#: src/input/input_dvb.c:2859
#, c-format
msgid "input_dvb: channel %s not found in channels.conf, defaulting.\n"
msgstr ""
"input_dvb: %s kanalı channels.conf dosyasında bulunamadı, öntanımlı "
"değerlere dönülüyor.\n"
-#: src/input/input_dvb.c:2877
+#: src/input/input_dvb.c:2865
#, c-format
msgid ""
"input_dvb: invalid channel specification, defaulting to last viewed "
@@ -1862,12 +1743,12 @@ msgid ""
msgstr ""
"input_dvb: geçersiz kanal belirtimi, son görüntülenen kanala dönülüyor.\n"
-#: src/input/input_dvb.c:2885
+#: src/input/input_dvb.c:2873
#, c-format
msgid "input_dvb: invalid channel specification, defaulting to channel 0\n"
msgstr "input_dvb: geçersiz kanal belirtimi, kanal 0(sıfır)'a dönülüyor.\n"
-#: src/input/input_dvb.c:2897
+#: src/input/input_dvb.c:2885
#, c-format
msgid ""
"input_dvb: dvbs mrl specified but the tuner doesn't appear to be QPSK (DVB-"
@@ -1876,7 +1757,7 @@ msgstr ""
"input_dvb: dvb'nin mrl değeri belirtilmiş fakat alıcı QPSK (DVB-S) gibi "
"gözükmemekte.\n"
-#: src/input/input_dvb.c:2917
+#: src/input/input_dvb.c:2905
#, c-format
msgid ""
"input_dvb: dvbt mrl specified but the tuner doesn't appear to be OFDM (DVB-"
@@ -1885,7 +1766,7 @@ msgstr ""
"input_dvb: dvbt'nin mrl değeri belirtilmiş fakat alıcı OFDM (DVB-T) gibi "
"gözükmemekte.\n"
-#: src/input/input_dvb.c:2940
+#: src/input/input_dvb.c:2928
#, c-format
msgid ""
"input_dvb: dvbc mrl specified but the tuner doesn't appear to be QAM (DVB-"
@@ -1894,7 +1775,7 @@ msgstr ""
"input_dvb: dvbc'nin mrl değeri belirtilmiş fakat alıcı QAM (DVB-C) gibi "
"gözükmemekte.\n"
-#: src/input/input_dvb.c:2966
+#: src/input/input_dvb.c:2954
#, c-format
msgid ""
"input_dvb: dvba mrl specified but the tuner doesn't appear to be ATSC (DVB-"
@@ -1903,21 +1784,21 @@ msgstr ""
"input_dvb: dvba'nın mrl değeri belirtilmiş fakat alıcı ATSC (DVB-A) gibi "
"gözükmemekte.\n"
-#: src/input/input_dvb.c:3001
+#: src/input/input_dvb.c:2989
#, c-format
msgid "input_dvb: cannot open dvr device '%s'\n"
msgstr "input_dvb: dvr aygıtını açamıyor '%s'\n"
-#: src/input/input_dvb.c:3024
+#: src/input/input_dvb.c:3012
#, c-format
msgid "input_dvb: cannot create EPG updater thread\n"
msgstr "input_dvb: EPG güncelleyici bağı yaratamıyor\n"
-#: src/input/input_dvb.c:3086
+#: src/input/input_dvb.c:3074
msgid "use DVB 'center cutout' (zoom)"
msgstr "DVB merkez kesmesini kullan (yakınlaştır)"
-#: src/input/input_dvb.c:3087
+#: src/input/input_dvb.c:3075
msgid ""
"This will allow fullscreen playback of 4:3 content transmitted in a 16:9 "
"frame."
@@ -1925,15 +1806,15 @@ msgstr ""
"Bu, 4:3 tam ekran oynatımı içeriğinin 16:9 çerçevesinde gösterilmesine izin "
"verecektır."
-#: src/input/input_dvb.c:3180
+#: src/input/input_dvb.c:3265
msgid "DVB (Digital TV) input plugin"
msgstr "DVB (Dijital TV) girdi eklentisi"
-#: src/input/input_dvb.c:3311
+#: src/input/input_dvb.c:3285
msgid "Remember last DVB channel watched"
msgstr "Son izlenen DVB kanalını hatırla"
-#: src/input/input_dvb.c:3312
+#: src/input/input_dvb.c:3286
msgid ""
"On autoplay, xine will remember and switch to the channel indicated in media."
"dvb.last_channel. "
@@ -1941,19 +1822,19 @@ msgstr ""
"Otomatik çalmada, xine hatırlayacak ve ortamdaki ilgili kanala geçecektir. "
"dvb.son_kanal."
-#: src/input/input_dvb.c:3319
+#: src/input/input_dvb.c:3293
msgid "Last DVB channel viewed"
msgstr "Görüntülenen son DVB kanalı"
-#: src/input/input_dvb.c:3320
+#: src/input/input_dvb.c:3294
msgid "If enabled xine will remember and switch to this channel. "
msgstr "Eğer etkinleştirilmişse, xine hatırlayacak ve bu kanala geçecektir."
-#: src/input/input_dvb.c:3325
+#: src/input/input_dvb.c:3299
msgid "Number of seconds until tuning times out."
msgstr "Ayarın süresinin dolmasına kalan saniyelerin sayısı"
-#: src/input/input_dvb.c:3326
+#: src/input/input_dvb.c:3300
msgid ""
"Leave at 0 means try forever. Greater than 0 means wait that many seconds to "
"get a lock. Minimum is 5 seconds."
@@ -1961,52 +1842,47 @@ msgstr ""
"0'da bırakmak, sürekli dene anlamına gelir. 0'dan büyükler kilitlenmeye "
"kadar bekleyin anlamına gelir. En az olanı 5 saniyedir."
-#: src/input/input_dvb.c:3332
-msgid "Number of dvb card to use."
-msgstr "Kullanılacak dvb kartların sayısı."
-
-#: src/input/input_dvb.c:3333
-msgid ""
-"Leave this at zero unless you really have more than 1 card in your system."
-msgstr "Eğer sisteminizde birden fazla kart yoksa bunu sıfırda bırakın."
-
-#: src/input/input_dvb.c:3341
+#: src/input/input_dvb.c:3307
msgid "Enable the DVB GUI"
msgstr ""
-#: src/input/input_dvb.c:3342
+#: src/input/input_dvb.c:3308
msgid "Enable the DVB GUI, mouse controlled recording and channel switching."
msgstr ""
-#: src/input/input_dvb.c:3348
-msgid "DVB Channels config file"
-msgstr ""
+#: src/input/input_dvb.c:3313
+msgid "Number of dvb card to use."
+msgstr "Kullanılacak dvb kartların sayısı."
-#: src/input/input_dvb.c:3349
+#: src/input/input_dvb.c:3314
msgid ""
-"DVB Channels config file to use instead of the ~/.xine/channels.conf file."
-msgstr ""
+"Leave this at zero unless you really have more than 1 card in your system."
+msgstr "Eğer sisteminizde birden fazla kart yoksa bunu sıfırda bırakın."
-#: src/input/input_dvd.c:596
+#: src/input/input_dvd.c:589
#, c-format
msgid "input_dvd: values of \\beta will give rise to dom!\n"
msgstr "input_dvd: values of \\beta will give rise to dom!\n"
-#: src/input/input_dvd.c:615
+#: src/input/input_dvd.c:608
#, c-format
msgid "input_dvd: Error getting next block from DVD (%s)\n"
msgstr "input_dvd: DVD (%s) ortamından sonraki blok alınamadı\n"
-#: src/input/input_dvd.c:1505
+#: src/input/input_dvd.c:1499
#, c-format
msgid "input_dvd: Error opening DVD device\n"
msgstr "input_dvd: DVD aygıtı açılırken hata oluştu\n"
-#: src/input/input_dvd.c:1792
+#: src/input/input_dvd.c:1759
+msgid "DVD Navigator"
+msgstr ""
+
+#: src/input/input_dvd.c:1776
msgid "device used for DVD playback"
msgstr "DVD oynatmak için kullanılacak aygıt"
-#: src/input/input_dvd.c:1793
+#: src/input/input_dvd.c:1777
msgid ""
"The path to the device, usually a DVD drive, which you intend to use for "
"playing DVDs."
@@ -2014,11 +1890,11 @@ msgstr ""
"Aygıta giden yol, genellikle DVDleri oynatmak amacıyla kullanılan DVD "
"sürücüsü."
-#: src/input/input_dvd.c:1811
+#: src/input/input_dvd.c:1794
msgid "raw device set up for DVD access"
msgstr "DVD girişi için yeni aygıt ayarı"
-#: src/input/input_dvd.c:1812
+#: src/input/input_dvd.c:1795
msgid ""
"If this points to a raw device connected to your DVD device, xine will use "
"the raw device for playback. This has the advantage of being slightly faster "
@@ -2036,11 +1912,11 @@ msgstr ""
"kullanılacaktır.\n"
"Daha fazla bilgi için yeni aygıt ayarı (man raw) belgesine bakınız."
-#: src/input/input_dvd.c:1825
+#: src/input/input_dvd.c:1808
msgid "CSS decryption method"
msgstr "CSS şifre çözme yöntemi"
-#: src/input/input_dvd.c:1826
+#: src/input/input_dvd.c:1809
msgid ""
"Selects the decryption method libdvdcss will use to descramble copy "
"protected DVDs. Try the various methods, if you have problems playing "
@@ -2050,29 +1926,11 @@ msgstr ""
"çözmekte kullanılacaktır. Eğer şifreli DVD'leri çalmakta problemler "
"yaşarsanzı değişik yöntemler deneyin."
-#: src/input/input_dvd.c:1833
-msgid "path to the title key cache"
-msgstr "anahtar bellek başlığı yolu"
-
-#: src/input/input_dvd.c:1834
-msgid ""
-"Since cracking the copy protection of scrambled DVDs can be quite time "
-"consuming, libdvdcss will cache the cracked keys in this directory.\n"
-"This 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."
-msgstr ""
-"Şifre korumalı DVDlerin çözümlenmesi zaman alacağından, libdvdcss kırılmış "
-"anahtarların bu dizinde saklayacaktır.\n"
-"Bu ayar güvenlik açısından kritiktir, çünkü bu dizinde denetlenemeyen adlara "
-"sahip dosyalar oluşturulabilir. Bu önemli dizini DVD anahtar saklamanın "
-"dışında başka amaçlarla kullanmamaya özen gösterin."
-
-#: src/input/input_dvd.c:1856
+#: src/input/input_dvd.c:1824
msgid "region the DVD player claims to be in (1 to 8)"
msgstr "DVD çaların kapsadığı bölge (1 ile 8 arası)"
-#: src/input/input_dvd.c:1857
+#: src/input/input_dvd.c:1825
msgid ""
"This only needs to be changed if your DVD jumps to a screen complaining "
"about a wrong region code. It has nothing to do with the region code set in "
@@ -2082,11 +1940,11 @@ msgstr ""
"gereklidir. Yazılımın özelliğinden dolayı, DVD sürücülerine ayarlanan bölge "
"kodları ile ilgili bir değişikli yapılamaz."
-#: src/input/input_dvd.c:1863
+#: src/input/input_dvd.c:1831
msgid "default language for DVD playback"
msgstr "DVD oynatmak için öntanımlı dil"
-#: src/input/input_dvd.c:1864
+#: src/input/input_dvd.c:1832
msgid ""
"xine tries to use this language as a default for DVD playback. As far as the "
"DVD supports it, menus and audio tracks will be presented in this language.\n"
@@ -2096,11 +1954,11 @@ msgstr ""
"desteklediği ölçüde, menüler ve ses izleri bu dilde sunulacaktır.\n"
"Dil kodu değerinin iki karakterli ISO639 dil kodu olması gereklidir."
-#: src/input/input_dvd.c:1870
+#: src/input/input_dvd.c:1838
msgid "read-ahead caching"
msgstr "tamponlama boyunca oku"
-#: src/input/input_dvd.c:1871
+#: src/input/input_dvd.c:1839
msgid ""
"xine can use a read ahead cache for DVD drive access.\n"
"This may lead to jerky playback on slow drives, but it improves the impact "
@@ -2110,11 +1968,11 @@ msgstr ""
"Bu özellik, yavaş çalışan sürücülerde kötü çalmalara sebebiyet verebilir, "
"fakat o daha hızlı sürücülerde DVD katman değişiminin etkisini güçlendirir."
-#: src/input/input_dvd.c:1877
+#: src/input/input_dvd.c:1845
msgid "unit for the skip action"
msgstr "atlama eylemi için birim"
-#: src/input/input_dvd.c:1878
+#: src/input/input_dvd.c:1846
msgid ""
"You can configure the behaviour when issuing a skip command (using the skip "
"buttons for example). The individual values mean:\n"
@@ -2148,11 +2006,11 @@ msgstr ""
"DVD'deki tüm özellikleri gösteren yapısal bir birim olan DVD başılığını "
"atlayacaktır"
-#: src/input/input_dvd.c:1893
+#: src/input/input_dvd.c:1861
msgid "unit for seeking"
msgstr "arama birimi"
-#: src/input/input_dvd.c:1894
+#: src/input/input_dvd.c:1862
msgid ""
"You can configure the domain spanned by the seek slider. The individual "
"values mean:\n"
@@ -2175,11 +2033,11 @@ msgstr ""
"arama tüm DVD program zincirini bağlayacaktır, geçerli özelliğin bölümlerini "
"gösteren gözlemsel bir birimdir bu"
-#: src/input/input_dvd.c:1905
+#: src/input/input_dvd.c:1873
msgid "play mode when title/chapter is given"
msgstr "başlık/bölüm verildiğindeki çalma kipi"
-#: src/input/input_dvd.c:1906
+#: src/input/input_dvd.c:1874
msgid ""
"You can configure the behaviour when playing a dvd from a given title/"
"chapter (eg. using MRL 'dvd:/1.2'). The individual values mean:\n"
@@ -2204,38 +2062,38 @@ msgstr ""
msgid "input_file: read error (%s)\n"
msgstr "input_file: okuma hatası (%s)\n"
-#: src/input/input_file.c:371
+#: src/input/input_file.c:368
#, c-format
msgid "input_file: Permission denied: >%s<\n"
msgstr "input_file: İzin verilmedi: >%s<\n"
-#: src/input/input_file.c:375
+#: src/input/input_file.c:372
#, c-format
msgid "input_file: File not found: >%s<\n"
msgstr "input_file: Dosya bulunamadı: >%s<\n"
-#: src/input/input_file.c:414 src/input/input_gnome_vfs.c:297
+#: src/input/input_file.c:413 src/input/input_gnome_vfs.c:286
#, c-format
msgid "input_file: File empty: >%s<\n"
msgstr "input_file: Dosya boÅŸ: >%s<\n"
-#: src/input/input_file.c:635
+#: src/input/input_file.c:970
msgid "file input plugin"
msgstr "dosya girdi eklentisi"
-#: src/input/input_file.c:991
+#: src/input/input_file.c:987
msgid "file browsing start location"
msgstr "dosya açma başlangıç konumu"
-#: src/input/input_file.c:992
+#: src/input/input_file.c:988
msgid "The browser to select the file to play will start at this location."
msgstr "Çalınması istenen dosyanın bu konumdan bağlayacağını seçen tarayıcı."
-#: src/input/input_file.c:999
+#: src/input/input_file.c:995
msgid "list hidden files"
msgstr "gizli dosyaları listele"
-#: src/input/input_file.c:1000
+#: src/input/input_file.c:996
msgid ""
"If enabled, the browser to select the file to play will also show hidden "
"files."
@@ -2243,91 +2101,91 @@ msgstr ""
"Eğer etkinleştirilmişse, çalınacak dosyayı seçen tarayıcı aynı zamanda gizli "
"dosyaları da gösterebilir."
-#: src/input/input_gnome_vfs.c:223
+#: src/input/input_gnome_vfs.c:374
msgid "gnome-vfs input plugin as shipped with xine"
msgstr "xine ile birlikte gelen gnome vfs giriÅŸi"
-#: src/input/input_http.c:180
+#: src/input/input_http.c:181
#, c-format
msgid "input_http: gethostbyname(%s) failed: %s\n"
msgstr "input_http: gethostbyname(%s) başarısız oldu: %s\n"
-#: src/input/input_http.c:415 src/input/input_http.c:1015
+#: src/input/input_http.c:380 src/input/input_http.c:987
#, c-format
msgid "input_http: read error %d\n"
msgstr "input_http: okuma hatası %d\n"
-#: src/input/input_http.c:656
+#: src/input/input_http.c:621
msgid "Connecting HTTP server..."
msgstr "HTTP sunucusuna bağlanılıyor..."
-#: src/input/input_http.c:848
+#: src/input/input_http.c:808
#, c-format
msgid "input_http: invalid http answer\n"
msgstr "input_http: geçersiz http yanıtı\n"
-#: src/input/input_http.c:854
+#: src/input/input_http.c:814
#, c-format
msgid "input_http: 3xx redirection: >%d %s<\n"
msgstr "input_http: 3xx yeniden yönlendirme: >%d %s<\n"
-#: src/input/input_http.c:859 src/input/input_http.c:865
-#: src/input/input_http.c:872
+#: src/input/input_http.c:819 src/input/input_http.c:824
+#: src/input/input_http.c:830 src/input/input_http.c:837
#, c-format
msgid "input_http: http status not 2xx: >%d %s<\n"
msgstr "input_http: http durumu 2xx deÄŸil: >%d %s<\n"
-#: src/input/input_http.c:882
+#: src/input/input_http.c:847
#, c-format
msgid "input_http: content length = %<PRIdMAX> bytes\n"
msgstr "input_http: içerik büyüklüğü = %<PRIdMAX> byte\n"
-#: src/input/input_http.c:969
+#: src/input/input_http.c:937
#, c-format
msgid "input_http: buffer exhausted after %d bytes."
msgstr "input_http: %d byte ardından önbellek boşaltıldı."
-#: src/input/input_http.c:1070
+#: src/input/input_http.c:1062
msgid "http input plugin"
msgstr "http girdi eklentisi"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "HTTP proxy host"
msgstr "HTTP vekil sunucu makinesi"
-#: src/input/input_http.c:1132
+#: src/input/input_http.c:1095
msgid "The hostname of the HTTP proxy."
msgstr "HTTP vekil sunucusu için makine adı."
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "HTTP proxy port"
msgstr "HTTP vekil sunucu portu"
-#: src/input/input_http.c:1136
+#: src/input/input_http.c:1099
msgid "The port number of the HTTP proxy."
msgstr "HTTP vekil sunucusu için port numarası."
-#: src/input/input_http.c:1146
+#: src/input/input_http.c:1109
msgid "HTTP proxy username"
msgstr "HTTP vekil sunucu kullanıcı adı"
-#: src/input/input_http.c:1147
+#: src/input/input_http.c:1110
msgid "The user name for the HTTP proxy."
msgstr "HTTP vekil sunucusu için kullanıcı adı."
-#: src/input/input_http.c:1150
+#: src/input/input_http.c:1113
msgid "HTTP proxy password"
msgstr "HTTP vekil sunucu parolası"
-#: src/input/input_http.c:1151
+#: src/input/input_http.c:1114
msgid "The password for the HTTP proxy."
msgstr "HTTP vekil sunucusu için parola."
-#: src/input/input_http.c:1154
+#: src/input/input_http.c:1117
msgid "Domains for which to ignore the HTTP proxy"
msgstr "HTTP vekilini göz ardı etmek için alanlar"
-#: src/input/input_http.c:1155
+#: src/input/input_http.c:1118
msgid ""
"A comma-separated list of domain names for which the proxy is to be "
"ignored.\n"
@@ -2339,15 +2197,15 @@ msgstr ""
"Eğer bir alan adı '=' ile ön ek almışsa, o zaman ona sadece ana makina adı "
"olarak bakmak gerekir (tam uyuÅŸum gereklidir)."
-#: src/input/input_mms.c:448
+#: src/input/input_mms.c:467
msgid "mms streaming input plugin"
msgstr "mms yayın girdi eklentisi"
-#: src/input/input_mms.c:484 src/input/librtsp/rtsp_session.c:95
+#: src/input/input_mms.c:475 src/input/librtsp/rtsp_session.c:95
msgid "network bandwidth"
msgstr "aÄŸ bant geniÅŸliÄŸi"
-#: src/input/input_mms.c:485 src/input/librtsp/rtsp_session.c:96
+#: src/input/input_mms.c:476 src/input/librtsp/rtsp_session.c:96
msgid ""
"Specify the bandwidth of your internet connection here. This will be used "
"when streaming servers offer different versions with different bandwidth "
@@ -2357,11 +2215,11 @@ msgstr ""
"sunucularının aynı yayın akışını farklı bant genişliği gereksinimleriyle "
"önerdiklerinde kullanılacaktır."
-#: src/input/input_mms.c:494
+#: src/input/input_mms.c:485
msgid "MMS protocol"
msgstr "MMS protokolü"
-#: src/input/input_mms.c:495
+#: src/input/input_mms.c:486
msgid ""
"Select the protocol to encapsulate MMS.\n"
"TCP is better but you may need HTTP behind a firewall."
@@ -2370,78 +2228,78 @@ msgstr ""
"TCP daha iyidir ancak bir güvenlik duvarı kullanıyorsanız HTTP seçmeniz "
"gerekir."
-#: src/input/input_net.c:121 src/input/input_net.c:150
+#: src/input/input_net.c:124 src/input/input_net.c:153
#, c-format
msgid "input_net: socket(): %s\n"
msgstr "input_net: socket(): %s\n"
-#: src/input/input_net.c:136 src/input/input_net.c:161
+#: src/input/input_net.c:139 src/input/input_net.c:164
#, c-format
msgid "input_net: connect(): %s\n"
msgstr "input_net: connect(): %s\n"
-#: src/input/input_net.c:179 src/input/input_net.c:221
+#: src/input/input_net.c:182 src/input/input_net.c:224
#, c-format
msgid "input_net: unable to resolve '%s'.\n"
msgstr "input_net: '%s' çözümlenemedi.\n"
-#: src/input/input_net.c:192 src/input/input_net.c:238
+#: src/input/input_net.c:195 src/input/input_net.c:241
#, c-format
msgid "input_net: unable to connect to '%s'.\n"
msgstr "input_net: '%s' konumuna bağlanılamadı.\n"
-#: src/input/input_net.c:523
+#: src/input/input_net.c:535
msgid "net input plugin as shipped with xine"
msgstr "xine ile birlikte gelen aÄŸ giriÅŸi eklentisi"
-#: src/input/input_pnm.c:274
+#: src/input/input_pnm.c:284
msgid "pnm streaming input plugin"
msgstr "pnm yayın girdi eklentisi"
-#: src/input/input_pvr.c:581
+#: src/input/input_pvr.c:588
#, c-format
msgid "input_pvr: error creating pvr file (%s)\n"
msgstr "input_pvr: pvr dosyası oluşturma hatası (%s)\n"
-#: src/input/input_pvr.c:738
+#: src/input/input_pvr.c:745
#, c-format
msgid "input_pvr: error opening pvr file (%s)\n"
msgstr "input_pvr: pvr dosyası açma hatası (%s)\n"
-#: src/input/input_pvr.c:814
+#: src/input/input_pvr.c:821
#, c-format
msgid "input_pvr: read error (%s)\n"
msgstr "input_pvr: okuma hatası (%s)\n"
-#: src/input/input_pvr.c:1153 src/input/input_pvr.c:1413
+#: src/input/input_pvr.c:1160 src/input/input_pvr.c:1420
#, c-format
msgid "input_pvr: error opening device %s\n"
msgstr "input_pvr: %s aygıtı açılamadı\n"
-#: src/input/input_pvr.c:1159 src/input/input_pvr.c:1419
+#: src/input/input_pvr.c:1166 src/input/input_pvr.c:1426
#, c-format
msgid "input_pvr: IVTV_IOC_G_CODEC failed, maybe API changed?\n"
msgstr ""
"input_pvr: IVTV_IOC_G_CODEC başarısız oldu, API değişmiş olabilir mi?\n"
-#: src/input/input_pvr.c:1167 src/input/input_pvr.c:1428
+#: src/input/input_pvr.c:1174 src/input/input_pvr.c:1435
#, c-format
msgid "input_pvr: IVTV_IOC_S_CODEC failed, maybe API changed?\n"
msgstr ""
"input_pvr: IVTV_IOC_S_CODEC başarısız oldu, API değişmiş olabilir mi?\n"
-#: src/input/input_pvr.c:1536
-msgid "WinTV-PVR 250/350 input plugin"
-msgstr "WinTV-PVR 250/350 girdi eklentisi"
-
-#: src/input/input_pvr.c:1562
+#: src/input/input_pvr.c:1553
msgid "device used for WinTV-PVR 250/350 (pvr plugin)"
msgstr "WinTV-PVR 250/350 (pvr eklentisi) için kullanılan aygıt"
-#: src/input/input_pvr.c:1563
+#: src/input/input_pvr.c:1554
msgid "The path to the device of your WinTV card."
msgstr "WinTV kartınızın aygıt yolu."
+#: src/input/input_pvr.c:1560
+msgid "WinTV-PVR 250/350 input plugin"
+msgstr "WinTV-PVR 250/350 girdi eklentisi"
+
#: src/input/input_rtp.c:183
#, fuzzy, c-format
msgid "xine_socket_cloexec(): %s.\n"
@@ -2492,142 +2350,142 @@ msgstr "Buraya bağlanamadı %s'.\n"
msgid "recv(): %s.\n"
msgstr "recv(): %s.\n"
-#: src/input/input_rtp.c:642
+#: src/input/input_rtp.c:643
msgid "RTP: stopping reading thread...\n"
msgstr "RTP: okuma iÅŸini durduruyor...\n"
-#: src/input/input_rtp.c:645
+#: src/input/input_rtp.c:646
msgid "RTP: reading thread terminated\n"
msgstr "RTP: okuma işi kapatıldı\n"
-#: src/input/input_rtp.c:660
+#: src/input/input_rtp.c:661
#, c-format
msgid "Opening >filename:%s port:%d interface:%s<\n"
msgstr "Dosya adını >açıyor:%s bağlantı noktası:%d arabirim:%s<\n"
-#: src/input/input_rtp.c:677
+#: src/input/input_rtp.c:678
#, c-format
msgid "input_rtp: can't create new thread (%s)\n"
msgstr "input_rtp: yeni iş üretemez (%s)\n"
-#: src/input/input_rtp.c:781
+#: src/input/input_rtp.c:790
msgid "RTP and UDP input plugin as shipped with xine"
msgstr "xine ile birlikte gelen RTP ve UDP giriÅŸ eklentisi"
-#: src/input/input_rtsp.c:295
+#: src/input/input_rtsp.c:303
msgid "rtsp streaming input plugin"
msgstr "rtsp yayın girdi eklentisi"
-#: src/input/input_smb.c:165
+#: src/input/input_smb.c:512
msgid "CIFS/SMB input plugin based on libsmbclient"
msgstr "libsmbclient temelli CIFS/SMB girdi eklentisi"
-#: src/input/input_stdin_fifo.c:173
+#: src/input/input_stdin_fifo.c:174
#, c-format
msgid "stdin: cannot seek back! (%<PRIdMAX> > %<PRIdMAX>)\n"
msgstr "stdin: geri arama yapamaz! (%<PRIdMAX> > %<PRIdMAX>)\n"
-#: src/input/input_stdin_fifo.c:261
+#: src/input/input_stdin_fifo.c:262
#, c-format
msgid "stdin: failed to open '%s'\n"
msgstr "stdin: '%s' açılamadı\n"
-#: src/input/input_stdin_fifo.c:359
+#: src/input/input_stdin_fifo.c:368
msgid "stdin streaming input plugin"
msgstr "stdin yayın girdi eklentisi"
-#: src/input/input_v4l.c:385
+#: src/input/input_v4l.c:409
msgid "Buffer underrun..."
msgstr "Tampon bellek zayıfladı..."
-#: src/input/input_v4l.c:389
+#: src/input/input_v4l.c:413
msgid "Buffer overrun..."
msgstr "Tampon bellek aşımı..."
-#: src/input/input_v4l.c:392
+#: src/input/input_v4l.c:416
msgid "Adjusting..."
msgstr "Ayarlanıyor..."
-#: src/input/input_v4l.c:671
+#: src/input/input_v4l.c:696
#, c-format
msgid "Tuner name not found\n"
msgstr "Tuner adı bulunamadı\n"
-#: src/input/input_v4l.c:1870
+#: src/input/input_v4l.c:1908
msgid "v4l tv input plugin"
msgstr "v4l tv girdi eklentisi"
-#: src/input/input_v4l.c:1874
-msgid "v4l radio input plugin"
-msgstr "v4l radyo girdi eklentisi"
-
-#: src/input/input_v4l.c:1906
+#: src/input/input_v4l.c:1916
msgid "v4l video device"
msgstr "v4l görüntü aygıtı"
-#: src/input/input_v4l.c:1907
+#: src/input/input_v4l.c:1917
msgid "The path to your Video4Linux video device."
msgstr "Video4Linux görüntü aygıtının yolu."
-#: src/input/input_v4l.c:1912
+#: src/input/input_v4l.c:1922
#, fuzzy
msgid "v4l ALSA audio input device"
msgstr "v4l radyo aygıtı"
-#: src/input/input_v4l.c:1913
+#: src/input/input_v4l.c:1923
#, fuzzy
msgid ""
"The name of the audio device which corresponds to your Video4Linux video "
"device."
msgstr "Video4Linux görüntü aygıtının yolu."
-#: src/input/input_v4l.c:1918
+#: src/input/input_v4l.c:1928
msgid "v4l TV standard"
msgstr ""
-#: src/input/input_v4l.c:1919
+#: src/input/input_v4l.c:1929
msgid ""
"Selects the TV standard of the input signals. Either: AUTO, PAL, NTSC or "
"SECAM. "
msgstr ""
-#: src/input/input_v4l.c:1944
+#: src/input/input_v4l.c:1946
+msgid "v4l radio input plugin"
+msgstr "v4l radyo girdi eklentisi"
+
+#: src/input/input_v4l.c:1954
msgid "v4l radio device"
msgstr "v4l radyo aygıtı"
-#: src/input/input_v4l.c:1945
+#: src/input/input_v4l.c:1955
msgid "The path to your Video4Linux radio device."
msgstr "Video4Linux radyo aygıtının yolu."
-#: src/input/input_vcd.c:848
+#: src/input/input_vcd.c:851
#, c-format
msgid "input_vcd: malformed MRL. Use vcdo:/<track #>\n"
msgstr "input_vcd: bozuk MRL. vcdo:/<track #> kullanın\n"
-#: src/input/input_vcd.c:854
+#: src/input/input_vcd.c:857
#, c-format
msgid "input_vcd: invalid track %d (valid range: 0 .. %d)\n"
msgstr "input_vcd: geçersiz iz %d (geçerli oran: 0 .. %d)\n"
-#: src/input/input_vcd.c:925
-msgid "Video CD input plugin"
-msgstr "Video CD girdi eklentisi"
-
-#: src/input/input_vcd.c:979
+#: src/input/input_vcd.c:973
#, c-format
msgid "unable to open %s: %s.\n"
msgstr "%s açılamadı: %s.\n"
-#: src/input/input_vcd.c:1040
+#: src/input/input_vcd.c:1034
#, c-format
msgid "input_vcd: unable to open %s: %s.\n"
msgstr "input_vcd: %s açılamadı: %s.\n"
-#: src/input/input_vcd.c:1088
+#: src/input/input_vcd.c:1075
+msgid "Video CD input plugin"
+msgstr "Video CD girdi eklentisi"
+
+#: src/input/input_vcd.c:1082
msgid "device used for VCD playback"
msgstr "VCD oynatmak için kullanılan aygıt"
-#: src/input/input_vcd.c:1089
+#: src/input/input_vcd.c:1083
msgid ""
"The path to the device, usually a CD or DVD drive, you intend to play your "
"VideoCDs with."
@@ -2635,12 +2493,12 @@ msgstr ""
"Video CD'lerinizi çalmak istediğiniz ve genellikle CD veya DVD sürücü "
"olarak bilinen aygıta giden yol."
-#: src/input/librtsp/rtsp.c:438
+#: src/input/librtsp/rtsp.c:437
#, c-format
msgid "rtsp: bad mrl: %s\n"
msgstr "rtsp: bozuk mrl: %s\n"
-#: src/input/librtsp/rtsp.c:496
+#: src/input/librtsp/rtsp.c:495
#, c-format
msgid "rtsp: failed to connect to '%s'\n"
msgstr "rtsp: '%s' konumuna bağlanılamadı\n"
@@ -2719,7 +2577,7 @@ msgstr "desteklenmeyen protokol\n"
msgid "Buffering..."
msgstr "Önbelleğe alınıyor..."
-#: src/input/pnm.c:619
+#: src/input/pnm.c:621
#, c-format
msgid ""
"input_pnm: got message from server while reading stream:\n"
@@ -2728,12 +2586,12 @@ msgstr ""
"input_pnm: yayın akışıniı okurken sunucdan mesaj geldi:\n"
"%s\n"
-#: src/input/pnm.c:753
+#: src/input/pnm.c:755
#, c-format
msgid "input_pnm: failed to connect '%s'\n"
msgstr "input_pnm: '%s' konumuna bağlanılamadı\n"
-#: src/input/pnm.c:764
+#: src/input/pnm.c:766
#, c-format
msgid "input_pnm: failed to set up stream\n"
msgstr "input_pnm: akış ayarlaması başarısız oldu\n"
@@ -2782,42 +2640,42 @@ msgstr "geçersiz sınıf parametresi atlandı"
msgid "Invalid current entry type"
msgstr "Geçersiz güncel girdi tipi"
-#: src/input/vcd/xineplug_inp_vcd.c:1012
-msgid ""
-"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
-msgstr ""
-"Şunlar için PBC ile Video CD eklentisi ve desteği: (X)VCD, (X)SVCD, HQVCD, "
-"CVD ... "
-
-#: src/input/vcd/xineplug_inp_vcd.c:1113
+#: src/input/vcd/xineplug_inp_vcd.c:1088
msgid "selection has no RETURN entry"
msgstr "seçim hiç RETURN girişe sahip değil"
-#: src/input/vcd/xineplug_inp_vcd.c:1142
+#: src/input/vcd/xineplug_inp_vcd.c:1117
msgid "DEFAULT selected, but PBC is not on."
msgstr "DEFAULT seçili, fakat PBC açık değil."
-#: src/input/vcd/xineplug_inp_vcd.c:1147
+#: src/input/vcd/xineplug_inp_vcd.c:1122
msgid "selection has no NEXT entry"
msgstr "seçim hiç NEXT girişe sahip değil"
-#: src/input/vcd/xineplug_inp_vcd.c:1155
+#: src/input/vcd/xineplug_inp_vcd.c:1130
msgid "selection has no PREVIOUS entry"
msgstr "seçim hiç PREVIOUS girişe sahip değil"
-#: src/input/vcd/xineplug_inp_vcd.c:1162
+#: src/input/vcd/xineplug_inp_vcd.c:1137
msgid "Unknown event type: "
msgstr "Bilinmeyen olay tipi: "
-#: src/input/vcd/xineplug_inp_vcd.c:1458 src/input/vcd/xineplug_inp_vcd.c:1505
+#: src/input/vcd/xineplug_inp_vcd.c:1433 src/input/vcd/xineplug_inp_vcd.c:1480
msgid "The above message had unknown vcdimager log level"
msgstr "Yukarıdaki ileti bilinmeyen vcdimager günlük seviyesine sahip"
-#: src/input/vcd/xineplug_inp_vcd.c:1840
+#: src/input/vcd/xineplug_inp_vcd.c:1757
+msgid ""
+"Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... "
+msgstr ""
+"Şunlar için PBC ile Video CD eklentisi ve desteği: (X)VCD, (X)SVCD, HQVCD, "
+"CVD ... "
+
+#: src/input/vcd/xineplug_inp_vcd.c:1815
msgid "VCD default type to use on autoplay"
msgstr "Otomatik çalmayı kullanmak için VCD öntanımlı türü"
-#: src/input/vcd/xineplug_inp_vcd.c:1841
+#: src/input/vcd/xineplug_inp_vcd.c:1816
msgid ""
"The VCD play unit to use when none is specified in an MRL, e.g. vcd:// or "
"vcd:///dev/dvd:"
@@ -2825,11 +2683,11 @@ msgstr ""
"Bir MRL'de hiçbirinin belirtilmediği konumu kullanan VCD çalma birimi, örn. "
"vcd:// veya vcd:///dev/dvd:"
-#: src/input/vcd/xineplug_inp_vcd.c:1851
+#: src/input/vcd/xineplug_inp_vcd.c:1826
msgid "CD-ROM drive used for VCD when none given"
msgstr "Aksi belirtilmedikçe CD-ROM sürücüsü VCD için kullanılanacak"
-#: src/input/vcd/xineplug_inp_vcd.c:1852
+#: src/input/vcd/xineplug_inp_vcd.c:1827
msgid ""
"What to use if no drive specified. If the setting is empty, xine will scan "
"for CD drives."
@@ -2837,29 +2695,29 @@ msgstr ""
"Eğer hiç sürücü belirtilmemişse ne kullanmalı. Eğer ayarlar boş ise, xine CD "
"sürücülerini bulmak üzere taramaya başlayacak."
-#: src/input/vcd/xineplug_inp_vcd.c:1862
+#: src/input/vcd/xineplug_inp_vcd.c:1837
msgid "VCD position slider range"
msgstr "VCD konumu kaydırma alanı"
-#: src/input/vcd/xineplug_inp_vcd.c:1863
+#: src/input/vcd/xineplug_inp_vcd.c:1838
msgid ""
"range that the stream playback position slider represents playing a VCD."
msgstr ""
"akış çalma konumu kaydırma alanının bir VCD çalmakta olduğunu belirten bölge."
-#: src/input/vcd/xineplug_inp_vcd.c:1871
+#: src/input/vcd/xineplug_inp_vcd.c:1846
msgid "VCD read-ahead caching?"
msgstr "Bellekleme yerine doÄŸrudan VCD'yi okusun mu?"
-#: src/input/vcd/xineplug_inp_vcd.c:1872
+#: src/input/vcd/xineplug_inp_vcd.c:1847
msgid "Class may lead to jerky playback on low-end machines."
msgstr "Son-kullanıcı cihazlarında sınıf, kötü çalma sonuçlarına sebep olur."
-#: src/input/vcd/xineplug_inp_vcd.c:1882
+#: src/input/vcd/xineplug_inp_vcd.c:1857
msgid "automatically advance VCD track/entry"
msgstr "VCD iz/giriş yapılarında otomatik ilerleme"
-#: src/input/vcd/xineplug_inp_vcd.c:1883
+#: src/input/vcd/xineplug_inp_vcd.c:1858
msgid ""
"If enabled, we should automatically advance to the next entry or track. Used "
"only when playback control (PBC) is disabled."
@@ -2867,11 +2725,11 @@ msgstr ""
"Eğer etkinleştirilmişse, otomatik olarak sonraki giriş veya ize geçebiliriz. "
"Bu özellik, sadece eğer çalma denetimi (PBC) devre dışı ise kullanılır."
-#: src/input/vcd/xineplug_inp_vcd.c:1892
+#: src/input/vcd/xineplug_inp_vcd.c:1867
msgid "show 'rejected' VCD LIDs"
msgstr "reddedilen VCD'leri göster"
-#: src/input/vcd/xineplug_inp_vcd.c:1893
+#: src/input/vcd/xineplug_inp_vcd.c:1868
msgid ""
"Some playback list IDs (LIDs) are marked not showable, but you can see them "
"in the MRL list if this is set. Rejected entries are marked with an asterisk "
@@ -2881,11 +2739,11 @@ msgstr ""
"ayarlanmışsa MRL listesinde görebilirsiniz. Reddedilen girdiler yıldız (*) "
"ile iÅŸaretlenmiÅŸ olup MRL'ye eklenmiÅŸtir."
-#: src/input/vcd/xineplug_inp_vcd.c:1904
+#: src/input/vcd/xineplug_inp_vcd.c:1879
msgid "VCD format string for display banner"
msgstr "Başlığı görüntülemen için VCD kipi dizgesi"
-#: src/input/vcd/xineplug_inp_vcd.c:1905
+#: src/input/vcd/xineplug_inp_vcd.c:1880
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are:\n"
@@ -2921,11 +2779,11 @@ msgstr ""
".......Ses ayarı sayısı ile 1 arası bir sayı.\n"
" %% : a %\n"
-#: src/input/vcd/xineplug_inp_vcd.c:1930
+#: src/input/vcd/xineplug_inp_vcd.c:1905
msgid "VCD format string for stream comment field"
msgstr "Yayın akışı yorum alanı için VCD kipi dizgesi"
-#: src/input/vcd/xineplug_inp_vcd.c:1931
+#: src/input/vcd/xineplug_inp_vcd.c:1906
msgid ""
"VCD format used in the GUI Title. Similar to the Unix date command. Format "
"specifiers start with a percent sign. Specifiers are %A, %C, %c, %F, %I, %L, "
@@ -2937,11 +2795,11 @@ msgstr ""
"%L, %N, %P, %p, %S, %T, %V, %v, and %%.\n"
"Bunların anlamları için başlık_kipi yardım dosyasına bakınız."
-#: src/input/vcd/xineplug_inp_vcd.c:1943
+#: src/input/vcd/xineplug_inp_vcd.c:1918
msgid "VCD debug flag mask"
msgstr "VCD hata ayıklaması bayrak maskesi"
-#: src/input/vcd/xineplug_inp_vcd.c:1944
+#: src/input/vcd/xineplug_inp_vcd.c:1919
msgid ""
"For tracking down bugs in the VCD plugin. Mask values are:\n"
" 1: Meta information\n"
@@ -2972,97 +2830,194 @@ msgstr ""
"1024: DonmuÅŸ kare\n"
"2048: VCDINFO'dan hata ayıklama\n"
-#: src/liba52/xine_a52_decoder.c:757 src/libdts/xine_dts_decoder.c:560
+#: src/combined/ffmpeg/ff_audio_decoder.c:117
#, c-format
-msgid "HELP! a mono-only audio driver?!\n"
-msgstr "YARDIM! sadece mono olan bir ses sürücüsü mü?!\n"
+msgid "ffmpeg_audio_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+"ffmpeg_audio_dec: tampon belleği %d seviyesine taşmayı önlemek için "
+"arttırıyor.\n"
-#: src/liba52/xine_a52_decoder.c:820
-msgid "A/52 volume"
-msgstr "A/52 sesi"
+#: src/combined/ffmpeg/ff_audio_decoder.c:152
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr "ffmpeg_audio_dec: 0x%X türü dışında ffmpeg kod çözücü bulamıyor\n"
-#: src/liba52/xine_a52_decoder.c:821
-msgid ""
-"With A/52 audio, you can modify the volume at the decoder level. This has "
-"the advantage of the audio being already decoded for the specified volume, "
-"so later operations like channel downmixing will work on an audio stream of "
-"the given volume."
+#: src/combined/ffmpeg/ff_audio_decoder.c:199
+#, c-format
+msgid "ffmpeg_audio_dec: trying to open null codec\n"
+msgstr "ffmpeg_audio_dec: boş kodu açmaya çalışıyor\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:208
+#, c-format
+msgid "ffmpeg_audio_dec: couldn't open decoder\n"
+msgstr "ffmpeg_audio_dec: kod çözücüyü açamıyor\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:482
+#, fuzzy, c-format
+msgid "ffmpeg_audio_dec: cannot read codec parameters from packet\n"
+msgstr "ffmpeg_audio_dec: kod çözücüyü açamıyor\n"
+
+#: src/combined/ffmpeg/ff_audio_decoder.c:663
+msgid "ffmpeg based audio decoder plugin"
msgstr ""
-"A/52 ses ile, sesi kodlama seviyesinde değiştirebilirsiniz. Bu özel bir ses "
-"şiddeti için ayarlanmış olan ses kaynakları açısından bir avantajdır, "
-"böylece daha sonra yapacağınız kanalın ses yayın akışlarının ses "
-"dengelerinin ayarlanması sırasında bu işinize yarayacaktır."
-#: src/liba52/xine_a52_decoder.c:829
-msgid "use A/52 dynamic range compression"
-msgstr "dinamik alan sıkıştırılması için A/52 kullan"
+#: src/audio_dec/ff_dvaudio_decoder.c:258
+#, c-format
+msgid "dvaudio: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+"dvaudio: taşmayı önlemek için tampon belleği %d seviyesine çıkartıyor.\n"
+
+#: src/audio_dec/ff_dvaudio_decoder.c:369
+#, fuzzy
+msgid "dv audio decoder plugin"
+msgstr "v4l radyo girdi eklentisi"
-#: src/liba52/xine_a52_decoder.c:830
+#: src/dxr3/ffmpeg_encoder.c:170
+msgid "libavcodec mpeg output bitrate (kbit/s)"
+msgstr "libavcodec mpeg çıkış bit oranı (kbit/s)"
+
+#: src/dxr3/ffmpeg_encoder.c:171
msgid ""
-"Dynamic range compression limits the dynamic range of the audio. This means "
-"making the loud sounds softer, and the soft sounds louder, so you can more "
-"easily listen to the audio in a noisy environment without disturbing anyone."
+"The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+"Higher values will increase quality and CPU usage.\n"
+"This setting is only considered, when constant quality mode is disabled."
msgstr ""
-"Dinamik alan sıkıştırma sesin dinamik boyunu sınırlar. Bu yüksek seslerin "
-"yumuşak ve yumuşak seslerin yüksek olması demektir ki, bu sayede müziği "
-"kimseyi rahatsız etmeden gürültülü bir ortamda rahatlıkla dinleyebilirsiniz."
+"libavcodec mpeg çıkış bit oranı, DXR3 kodlama kipini kullanmalıdır. Yüksek "
+"değerler kaliteyi ve işlemci kullanımını yükseltir.\n"
+"Bu ayar sadece sabit kalite kipi devre dışı ise etkilidir."
-#: src/liba52/xine_a52_decoder.c:837
-msgid "downmix audio to 2 channel surround stereo"
-msgstr "sesi 2 kanal surround stereo'ya indirge"
+#: src/dxr3/ffmpeg_encoder.c:178
+msgid "constant quality mode"
+msgstr "sabit kalite kipi"
-#: src/liba52/xine_a52_decoder.c:838
+#: src/dxr3/ffmpeg_encoder.c:179
msgid ""
-"When you want to listen to multichannel surround sound, but you have only "
-"two speakers or a surround decoder or amplifier which does some sort of "
-"matrix surround decoding like prologic, you should enable this option so "
-"that the additional channels are mixed into the stereo signal."
+"When enabled, libavcodec will use a constant quality mode by dynamically "
+"compressing the images based on their complexity. When disabled, libavcodec "
+"will use constant bitrate mode."
msgstr ""
-"Çokkanallı surround bir ses dinlemek isteyip de, sadece iki hoparlörünüz "
-"veya surround kod çözücünüz veya prologic gibi bir matrix surround kod "
-"çözümleme imkanınız varsa, bu ek kanalların stereo sinyale çevrilebilmesi "
-"için bu seçeneği etkin hale getirmelisiniz"
+"Etkinleştirildiğinde libavcodec, görüntünün karmaşık yapısına göre dinamik "
+"olarak sıkıştırılmış sabit kalite kipini kullanacaktır "
+
+#: src/dxr3/ffmpeg_encoder.c:186
+msgid "minimum compression"
+msgstr "en düşük sıkıştırma"
+
+#: src/dxr3/ffmpeg_encoder.c:187
+msgid "The minimum compression to apply to an image in constant quality mode."
+msgstr "Sabit kalite kipindeki bir resme uygulanacak ola en düşük sıkıştırma."
-#: src/libfaad/xine_faad_decoder.c:136
+#: src/dxr3/ffmpeg_encoder.c:192
+msgid "maximum quantizer"
+msgstr "en yüksek nicelikler"
+
+#: src/dxr3/ffmpeg_encoder.c:193
+msgid "The maximum compression to apply to an image in constant quality mode."
+msgstr "Sabit kalite kipindeki bir resme uygulanacak ola en yüksek sıkıştırma."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:179
#, c-format
-msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
-msgstr "libfaad: libfaad NeAACDecOpen() başarılamadı.\n"
+msgid "ffmpeg_video_dec: unsupported frame format, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: desteklenmeyen çerçeve kipi, DR1 devre dışı.\n"
-#: src/libfaad/xine_faad_decoder.c:145
+#: src/combined/ffmpeg/ff_video_decoder.c:197
#, c-format
-msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit2 başarılamadı.\n"
+msgid "ffmpeg_video_dec: unsupported frame dimensions, DR1 disabled.\n"
+msgstr "ffmpeg_video_dec: desteklenmeyen çerçeve boyutları, DR1 devre dışı.\n"
-#: src/libfaad/xine_faad_decoder.c:156
+#: src/combined/ffmpeg/ff_video_decoder.c:306
#, c-format
-msgid "libfaad: libfaad NeAACDecInit failed.\n"
-msgstr "libfaad: libfaad NeAACDecInit başarılamadı.\n"
+msgid "ffmpeg_video_dec: couldn't find ffmpeg decoder for buf type 0x%X\n"
+msgstr "ffmpeg_video_dec: 0x%Xtürü için ffmpeg kod çözücüyü bulamıyor\n"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:337
+#, c-format
+msgid "ffmpeg_video_dec: couldn't open decoder\n"
+msgstr "ffmpeg_video_dec: kod çözücüyü açamıyor\n"
-#: src/libmusepack/xine_musepack_decoder.c:287
+#: src/combined/ffmpeg/ff_video_decoder.c:352
#, fuzzy, c-format
-msgid "libmusepack: mpc_demux_init failed.\n"
-msgstr "libmusepack: mpc_decoder_initialise başarılamadı\n"
+msgid "ffmpeg_video_dec: couldn't open decoder (pass 2)\n"
+msgstr "ffmpeg_video_dec: kod çözücüyü açamıyor\n"
-#: src/libmusepack/xine_musepack_decoder.c:298
+#: src/combined/ffmpeg/ff_video_decoder.c:400
#, c-format
-msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
-msgstr "libmusepack: mpc_streaminfo_read başarılamadı: %d\n"
+msgid "ffmpeg_video_dec: direct rendering enabled\n"
+msgstr "ffmpeg_video_dec: doÄŸrudan iÅŸleme etkin\n"
-#: src/libmusepack/xine_musepack_decoder.c:379
+#: src/combined/ffmpeg/ff_video_decoder.c:841
#, c-format
-msgid "libmusepack: data after last frame ignored\n"
-msgstr "libmusepack: son çerçeveden sonraki veri görmezden gelindi\n"
+msgid "ffmpeg_video_dec: increasing buffer to %d to avoid overflow.\n"
+msgstr ""
+"ffmpeg_video_dec: taşmayı önlemek için tampon belleği %d seviyesine "
+"yükseltiyor.\n"
-#: src/libmusepack/xine_musepack_decoder.c:394
-#, c-format
-msgid "libmusepack: mpc_decoder_initialise failed\n"
-msgstr "libmusepack: mpc_decoder_initialise başarılamadı\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1791
+msgid "ffmpeg based video decoder plugin"
+msgstr ""
-#: src/libmusepack/xine_musepack_decoder.c:414
-#: src/libmusepack/xine_musepack_decoder.c:433
-#, c-format
-msgid "libmusepack: mpc_decoder_decode failed: %d\n"
-msgstr "libmusepack: mpc_decoder_decode başarılamadı: %d\n"
+#: src/combined/ffmpeg/ff_video_decoder.c:1803
+msgid "MPEG-4 postprocessing quality"
+msgstr "MPEG 4 iÅŸleme kalitesi"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1804
+msgid ""
+"You can adjust the amount of post processing applied to MPEG-4 video.\n"
+"Higher values result in better quality, but need more CPU. Lower values may "
+"result in image defects like block artifacts. For high quality content, too "
+"heavy post processing can actually make the image worse by blurring it too "
+"much."
+msgstr ""
+"MPEG 4 görüntüye uygulanan işlemenin oranını ayarlayabilirsiniz.\n"
+"Yüksek değerler daha iyi sonuç verir, fakat daha çok işlemci gücü "
+"gerektirir. Düşük değerler görüntü bozulmalarınına sebebiyet verir. Yüksek "
+"kalite içeriği için, ağır işleme işlemleri doğal olarak onun netliğinin "
+"bozulmasına neden olabilir ve görüntünün kötüleşmesi sonucunu doğurabilir."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1812
+msgid "FFmpeg video decoding thread count"
+msgstr "FFmpeg görüntü kodlaması iş sayısı"
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1813
+#, fuzzy
+msgid ""
+"You can adjust the number of video decoding threads which FFmpeg may use.\n"
+"Higher values should speed up decoding but it depends on the codec used "
+"whether parallel decoding is supported. A rule of thumb is to have one "
+"decoding thread per logical CPU (typically 1 to 4).\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+"FFmpeg'nin kullanabileceği görüntü kodlama işlerinin sayılarını "
+"ayarlayabilirsiniz.\n"
+"Yüksek değerler kodlama işleminin hızını yükseltir fakat bu kodlamada "
+"paralel kodlamanın yapılıp yapılmadığıyla da bağlantılıdır. Mimari kuralına "
+"göre mantıksal işlemci başına bir adet kodlama işlemi yapılmalıdır (tipik "
+"olarak 1den14'e kadar). Bu değişim sonraki yayın akışında etkili olacaktır."
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1822
+msgid "Skip loop filter"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1823
+msgid ""
+"You can control for which frames the loop filter shall be skipped after "
+"decoding.\n"
+"Skipping the loop filter will speedup decoding but may lead to artefacts. "
+"The number of frames for which it is skipped increases from 'none' to 'all'. "
+"The default value leaves the decision up to the implementation.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1832
+msgid "Choose speed over specification compliance"
+msgstr ""
+
+#: src/combined/ffmpeg/ff_video_decoder.c:1833
+msgid ""
+"You may want to allow speed cheats which violate codec specification.\n"
+"Cheating may speed up decoding but can also lead to decoding artefacts.\n"
+"A change of this setting will take effect with playing the next stream."
+msgstr ""
#: src/libreal/real_common.c:139
msgid "path to RealPlayer codecs"
@@ -3082,11 +3037,6 @@ msgstr ""
"üzere kullanacaktır. Kodların yüklenmesi hakkında daha fazla bilgi için SSS "
"baÅŸvrunuz."
-#: src/libreal/xine_real_video_decoder.c:174
-#, c-format
-msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
-msgstr "libreal: Simgeleri çözmede hata! (sürüm uyumu?)\n"
-
#: src/libreal/xine_real_audio_decoder.c:134
#, c-format
msgid "libareal: (audio) Cannot resolve symbols - incompatible dll: %s\n"
@@ -3107,76 +3057,103 @@ msgstr "libareal: kod çözücü yapısal ayarı başarılamadı, hata kodu: 0x%
msgid "libareal: oups, real can do more than 2 channels ?\n"
msgstr "libareal: ops, real 2 kanaldan daha fazlasıyla baş edebilir ?\n"
-#: src/libspucc/xine_cc_decoder.c:199
+#: src/libreal/xine_real_audio_decoder.c:509
+msgid "real binary-only codec based audio decoder plugin"
+msgstr ""
+
+#: src/libreal/xine_real_video_decoder.c:174
+#, c-format
+msgid "libreal: Error resolving symbols! (version incompatibility?)\n"
+msgstr "libreal: Simgeleri çözmede hata! (sürüm uyumu?)\n"
+
+#: src/libreal/xine_real_video_decoder.c:532
+msgid "real binary-only codec based video decoder plugin"
+msgstr ""
+
+#: src/spu_dec/xine_cc_decoder.c:199
msgid "display closed captions in MPEG-2 streams"
msgstr "MPEG yayın akışlarında kapalı başlıkları görüntüle"
-#: src/libspucc/xine_cc_decoder.c:200
+#: src/spu_dec/xine_cc_decoder.c:200
msgid ""
"Closed Captions are subtitles mostly meant to help the hearing impaired."
msgstr ""
"Kapalı Başlıklar daha çok duyma özürlülere yardımcı olmayı amaçlayan "
"altyazılardır."
-#: src/libspucc/xine_cc_decoder.c:207
+#: src/spu_dec/xine_cc_decoder.c:207
msgid "closed-captioning foreground/background scheme"
msgstr "kapalı başlık ön/arka şeması"
-#: src/libspucc/xine_cc_decoder.c:208
+#: src/spu_dec/xine_cc_decoder.c:208
msgid "Choose your favourite rendering of the closed captions."
msgstr "Sık kullandığınız kapalı başlık işlemini seçin."
-#: src/libspucc/xine_cc_decoder.c:214
+#: src/spu_dec/xine_cc_decoder.c:214
msgid "standard closed captioning font"
msgstr "standart kapalı başlık yazı tipi"
-#: src/libspucc/xine_cc_decoder.c:215
+#: src/spu_dec/xine_cc_decoder.c:215
msgid "Choose the font for standard closed captions text."
msgstr "Standart kapalı başlık metni için yazı tipini seçin."
-#: src/libspucc/xine_cc_decoder.c:221
+#: src/spu_dec/xine_cc_decoder.c:221
msgid "italic closed captioning font"
msgstr "italik kapalı başlık yazı tipi"
-#: src/libspucc/xine_cc_decoder.c:222
+#: src/spu_dec/xine_cc_decoder.c:222
msgid "Choose the font for italic closed captions text."
msgstr "İtalik kapalı başlık metni için yazı tipini seçin."
-#: src/libspucc/xine_cc_decoder.c:228
+#: src/spu_dec/xine_cc_decoder.c:228
msgid "closed captioning font size"
msgstr "Kapalı başlık yazı tipi boyutu"
-#: src/libspucc/xine_cc_decoder.c:229
+#: src/spu_dec/xine_cc_decoder.c:229
msgid "Choose the font size for closed captions text."
msgstr "Kapalı başlık metni için yazı tipini boyutunu seçin."
-#: src/libspucc/xine_cc_decoder.c:233
+#: src/spu_dec/xine_cc_decoder.c:233
msgid "center-adjust closed captions"
msgstr "Ortalanmış kapalı başlıklar"
-#: src/libspucc/xine_cc_decoder.c:234
+#: src/spu_dec/xine_cc_decoder.c:234
msgid ""
"When enabled, closed captions will be positioned by the center of the "
"individual lines."
msgstr "Etkinleştirildiğinde, bireysel satırlar ortalanacaktır."
-#: src/libspucmml/xine_cmml_decoder.c:468
+#: src/spu_dec/xine_cc_decoder.c:340
+#, fuzzy
+msgid "closed caption decoder plugin"
+msgstr "Kapalı başlık yazı tipi boyutu"
+
+#: src/spu_dec/cmml_decoder.c:468
msgid "font for external subtitles"
msgstr "dış altyazılar için yazı tipi"
-#: src/libspucmml/xine_cmml_decoder.c:474
+#: src/spu_dec/cmml_decoder.c:474
msgid "subtitle vertical offset (relative window size)"
msgstr "altyazı dikey konumu (pencere boyutuna göre değişir)"
-#: src/libspucmml/xine_cmml_decoder.c:517
+#: src/spu_dec/cmml_decoder.c:497
+msgid "CMML subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/cmml_decoder.c:505
msgid "encoding of subtitles"
msgstr "altyazıların kodlanması"
-#: src/libsputext/demux_sputext.c:1480
+#: src/spu_dec/sputext_demuxer.c:1430
+#, fuzzy
+msgid "sputext demuxer plugin"
+msgstr "xine: demuxer eklentisi bulundu: %s\n"
+
+#: src/spu_dec/sputext_demuxer.c:1445
msgid "default duration of subtitle display in seconds"
msgstr "altyazı görünümünün saniye bazında ön tanımlı süresi"
-#: src/libsputext/demux_sputext.c:1481
+#: src/spu_dec/sputext_demuxer.c:1446
msgid ""
"Some subtitle formats do not explicitly give a duration for each subtitle. "
"For these, you can set a default duration here. Setting to zero will result "
@@ -3186,11 +3163,15 @@ msgstr ""
"kesin bir süre ayarlayabilirsiniz. Ayarı sıfır yapmak bir sonraki altyazı "
"gelene kadar altyazının gösterilmesi sonucunu doğurur."
-#: src/libsputext/xine_sputext_decoder.c:1144
+#: src/spu_dec/sputext_decoder.c:1128
+msgid "external subtitle decoder plugin"
+msgstr ""
+
+#: src/spu_dec/sputext_decoder.c:1137
msgid "subtitle size"
msgstr "altyazı büyüklüğü"
-#: src/libsputext/xine_sputext_decoder.c:1145
+#: src/spu_dec/sputext_decoder.c:1138
msgid ""
"You can adjust the subtitle size here. The setting will be evaluated "
"relative to the window size."
@@ -3198,11 +3179,11 @@ msgstr ""
"Altyazı büyüklüğünü buradan ayarlayabilirsiniz. Bu ayar pencere boyutunuza "
"göre yeniden değerlendirilecektir."
-#: src/libsputext/xine_sputext_decoder.c:1151
+#: src/spu_dec/sputext_decoder.c:1144
msgid "subtitle vertical offset"
msgstr "altyazı dikey konumu"
-#: src/libsputext/xine_sputext_decoder.c:1152
+#: src/spu_dec/sputext_decoder.c:1145
msgid ""
"You can adjust the vertical position of the subtitle. The setting will be "
"evaluated relative to the window size."
@@ -3210,31 +3191,30 @@ msgstr ""
"Altyazı dikey konumunu buradan ayarlayabilirsiniz. Bu ayar pencere "
"boyutunuza göre yeniden değerlendirilecektir."
-#: src/libsputext/xine_sputext_decoder.c:1158
-#: src/libsputext/xine_sputext_decoder.c:1167
+#: src/spu_dec/sputext_decoder.c:1151 src/spu_dec/sputext_decoder.c:1160
msgid "font for subtitles"
msgstr "altyazılar için yazı tipi"
-#: src/libsputext/xine_sputext_decoder.c:1159
+#: src/spu_dec/sputext_decoder.c:1152
msgid "A font from the xine font directory to be used for the subtitle text."
msgstr ""
"Altyazı metni olarak xine yazı tipi dizininden bir yazı tipi kullanılacaktır."
-#: src/libsputext/xine_sputext_decoder.c:1168
+#: src/spu_dec/sputext_decoder.c:1161
msgid "An outline font file (e.g. a .ttf) to be used for the subtitle text."
msgstr ""
"Altyazı metni olarak kullanılacak olan bir çerçeve yazı tipi dosyası (örn. "
"bir .ttf)"
-#: src/libsputext/xine_sputext_decoder.c:1174
+#: src/spu_dec/sputext_decoder.c:1167
msgid "whether to use a freetype font"
msgstr "bir freetype yazı tipinin kullanılıp kullanılmayacağı"
-#: src/libsputext/xine_sputext_decoder.c:1181
+#: src/spu_dec/sputext_decoder.c:1174
msgid "encoding of the subtitles"
msgstr "alt yazılar kodlanıyor"
-#: src/libsputext/xine_sputext_decoder.c:1182
+#: src/spu_dec/sputext_decoder.c:1175
msgid ""
"The encoding of the subtitle text in the stream. This setting is used to "
"render non-ASCII characters correctly. If non-ASCII characters are not "
@@ -3246,11 +3226,11 @@ msgstr ""
"karakterler beklediğiniz gibi görüntülenmezse, bunu oluşturan kişiye "
"altyazılarda kullanılan kodlamanın ne olduğunu sormalısınız."
-#: src/libsputext/xine_sputext_decoder.c:1190
+#: src/spu_dec/sputext_decoder.c:1183
msgid "use unscaled OSD if possible"
msgstr "eğer mümkünse hesaplanmamış OSD kullanın"
-#: src/libsputext/xine_sputext_decoder.c:1191
+#: src/spu_dec/sputext_decoder.c:1184
msgid ""
"The unscaled OSD will be rendered independently of the video frame and will "
"always be sharp, even if the video is magnified. This will look better, but "
@@ -3345,31 +3325,152 @@ msgstr "w32codec: DirectShow Audio sıfırlamada hata\n"
msgid "w32codec: Error initializing DMO Audio\n"
msgstr "w32codec: DMO Audio sıfırlamada hata\n"
-#: src/libxinevdec/bitplane.c:1274
+#: src/libw32dll/w32codec.c:1592
+msgid "win32 binary video codec plugin"
+msgstr ""
+
+#: src/libw32dll/w32codec.c:1641
+#, fuzzy
+msgid "win32 binary audio codec plugin"
+msgstr "xine dosyası ses çıkışı eklentisi"
+
+#: src/audio_dec/xine_a52_decoder.c:753 src/audio_dec/xine_dts_decoder.c:536
+#, c-format
+msgid "HELP! a mono-only audio driver?!\n"
+msgstr "YARDIM! sadece mono olan bir ses sürücüsü mü?!\n"
+
+#: src/audio_dec/xine_a52_decoder.c:794
+msgid "liba52 based a52 audio decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_a52_decoder.c:803
+msgid "A/52 volume"
+msgstr "A/52 sesi"
+
+#: src/audio_dec/xine_a52_decoder.c:804
+msgid ""
+"With A/52 audio, you can modify the volume at the decoder level. This has "
+"the advantage of the audio being already decoded for the specified volume, "
+"so later operations like channel downmixing will work on an audio stream of "
+"the given volume."
+msgstr ""
+"A/52 ses ile, sesi kodlama seviyesinde değiştirebilirsiniz. Bu özel bir ses "
+"şiddeti için ayarlanmış olan ses kaynakları açısından bir avantajdır, "
+"böylece daha sonra yapacağınız kanalın ses yayın akışlarının ses "
+"dengelerinin ayarlanması sırasında bu işinize yarayacaktır."
+
+#: src/audio_dec/xine_a52_decoder.c:812
+msgid "use A/52 dynamic range compression"
+msgstr "dinamik alan sıkıştırılması için A/52 kullan"
+
+#: src/audio_dec/xine_a52_decoder.c:813
+msgid ""
+"Dynamic range compression limits the dynamic range of the audio. This means "
+"making the loud sounds softer, and the soft sounds louder, so you can more "
+"easily listen to the audio in a noisy environment without disturbing anyone."
+msgstr ""
+"Dinamik alan sıkıştırma sesin dinamik boyunu sınırlar. Bu yüksek seslerin "
+"yumuşak ve yumuşak seslerin yüksek olması demektir ki, bu sayede müziği "
+"kimseyi rahatsız etmeden gürültülü bir ortamda rahatlıkla dinleyebilirsiniz."
+
+#: src/audio_dec/xine_a52_decoder.c:820
+msgid "downmix audio to 2 channel surround stereo"
+msgstr "sesi 2 kanal surround stereo'ya indirge"
+
+#: src/audio_dec/xine_a52_decoder.c:821
+msgid ""
+"When you want to listen to multichannel surround sound, but you have only "
+"two speakers or a surround decoder or amplifier which does some sort of "
+"matrix surround decoding like prologic, you should enable this option so "
+"that the additional channels are mixed into the stereo signal."
+msgstr ""
+"Çokkanallı surround bir ses dinlemek isteyip de, sadece iki hoparlörünüz "
+"veya surround kod çözücünüz veya prologic gibi bir matrix surround kod "
+"çözümleme imkanınız varsa, bu ek kanalların stereo sinyale çevrilebilmesi "
+"için bu seçeneği etkin hale getirmelisiniz"
+
+#: src/audio_dec/xine_dts_decoder.c:571
+msgid "DTS passthru audio format decoder plugin"
+msgstr ""
+
+#: src/audio_dec/xine_faad_decoder.c:135
+#, c-format
+msgid "libfaad: libfaad NeAACDecOpen() failed.\n"
+msgstr "libfaad: libfaad NeAACDecOpen() başarılamadı.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:144
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit2 failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit2 başarılamadı.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:155
+#, c-format
+msgid "libfaad: libfaad NeAACDecInit failed.\n"
+msgstr "libfaad: libfaad NeAACDecInit başarılamadı.\n"
+
+#: src/audio_dec/xine_faad_decoder.c:487
+msgid "Freeware Advanced Audio Decoder"
+msgstr ""
+
+#: src/audio_dec/xine_musepack_decoder.c:296
+#, fuzzy, c-format
+msgid "libmusepack: mpc_demux_init failed.\n"
+msgstr "libmusepack: mpc_decoder_initialise başarılamadı\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:307
+#, c-format
+msgid "libmusepack: mpc_streaminfo_read failed: %d\n"
+msgstr "libmusepack: mpc_streaminfo_read başarılamadı: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:388
+#, c-format
+msgid "libmusepack: data after last frame ignored\n"
+msgstr "libmusepack: son çerçeveden sonraki veri görmezden gelindi\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:403
+#, c-format
+msgid "libmusepack: mpc_decoder_initialise failed\n"
+msgstr "libmusepack: mpc_decoder_initialise başarılamadı\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:423
+#: src/audio_dec/xine_musepack_decoder.c:442
+#, c-format
+msgid "libmusepack: mpc_decoder_decode failed: %d\n"
+msgstr "libmusepack: mpc_decoder_decode başarılamadı: %d\n"
+
+#: src/audio_dec/xine_musepack_decoder.c:519
+msgid "mpc: musepack audio decoder plugin"
+msgstr ""
+
+#: src/video_dec/bitplane.c:1273
#, c-format
msgid "bitplane: error doing ByteRun1 decompression\n"
msgstr "bitplane: ByteRun1 sıkıştırmasında hata\n"
-#: src/libxinevdec/bitplane.c:1325
+#: src/video_dec/bitplane.c:1324
#, c-format
msgid "bitplane: Anim Opt 1 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 1 ÅŸu anda desteklenmiyor\n"
-#: src/libxinevdec/bitplane.c:1332
+#: src/video_dec/bitplane.c:1331
#, c-format
msgid "bitplane: Anim Opt 2 is not supported at the moment\n"
msgstr "bitplane: Anim Opt 2 ÅŸu anda desteklenmiyor\n"
-#: src/libxinevdec/bitplane.c:1382
+#: src/video_dec/bitplane.c:1381
#, c-format
msgid "bitplane: Anim ASCIIJ is not supported at the moment\n"
msgstr "bitplane: Anim ASCIIJ ÅŸu anda desteklenmiyor\n"
-#: src/libxinevdec/bitplane.c:1388
+#: src/video_dec/bitplane.c:1387
#, c-format
msgid "bitplane: This anim-type is not supported at the moment\n"
msgstr "bitplane: Bu hareket türü şu anda desteklenmiyor\n"
+#: src/video_dec/bitplane.c:1525
+msgid "Raw bitplane video decoder plugin"
+msgstr ""
+
#: src/post/audio/stretch.c:267
msgid ""
"This filter will perform a time stretch, playing the stream faster or slower "
@@ -3381,6 +3482,10 @@ msgstr ""
"korunacaktır, böylece bir filmi gerçek süresine göre daha az zamanda izlemek "
"için kullanılabilir.\n"
+#: src/post/audio/stretch.c:676
+msgid "Time stretch by a given factor, optionally preserving pitch"
+msgstr ""
+
#: src/post/audio/upmix.c:138
msgid ""
"Upmix functions. e.g. Take stereo input and produce Surround 5.1 output.\n"
@@ -3398,6 +3503,10 @@ msgstr ""
"\n"
"Dikkat: Bu parametreleri öndeki denetim penceresinden ayarlamak mümkündür.\n"
+#: src/post/audio/upmix.c:433
+msgid "upmix"
+msgstr ""
+
#: src/post/audio/upmix_mono.c:110
msgid ""
"This filter will upmix a mono stream to stereo, by duplicating channels. "
@@ -3425,6 +3534,11 @@ msgstr[1] ""
msgid ": audio device not capable of AO_CAP_MODE_STEREO.\n"
msgstr ": ses aygıtının AO_CAP_MODE_STEREO özelliği yok.\n"
+#: src/post/audio/upmix_mono.c:346
+#, fuzzy
+msgid "converts Mono into Stereo"
+msgstr ": Mono'dan Stereo'ya dönüştürme.\n"
+
#: src/post/audio/volnorm.c:151
msgid ""
"Normalizes audio by maximizing the volume without distorting the sound.\n"
@@ -3441,6 +3555,10 @@ msgstr ""
"alarak tek bir örnek kullanınız (varsayılan); 2: çeşitlemeleri yumuşatmak "
"ya da eski ses örneklerini temel alarak farklı örnekler kullanınız.\n"
+#: src/post/audio/volnorm.c:462
+msgid "Normalize volume"
+msgstr ""
+
#: src/post/deinterlace/xine_plugin.c:211
#, fuzzy
msgid ""
@@ -3549,16 +3667,24 @@ msgstr ""
"olmayabilir)\n"
"\n"
-#: src/post/deinterlace/xine_plugin.c:335
+#: src/post/deinterlace/xine_plugin.c:313
+msgid "advanced deinterlacer plugin with pulldown detection"
+msgstr ""
+
+#: src/post/deinterlace/xine_plugin.c:333
#, c-format
msgid "tvtime: No deinterlacing methods available, exiting.\n"
msgstr "tvtime: Hiç bir dönüştürme yöntemi uygun değil. Kapatılıyor. \n"
-#: src/post/goom/xine_goom.c:206
+#: src/post/goom/xine_goom.c:196
+msgid "What a GOOM"
+msgstr ""
+
+#: src/post/goom/xine_goom.c:204
msgid "frames per second to generate"
msgstr "oluşturulmak üzere saniye başına kareler"
-#: src/post/goom/xine_goom.c:207
+#: src/post/goom/xine_goom.c:205
msgid ""
"With more frames per second, the animation will get smoother and faster, but "
"will also require more CPU power."
@@ -3566,28 +3692,28 @@ msgstr ""
"Saniye başına daha çok kareler için, hareket daha yumuşayacak ve hızlanacak, "
"fakat aynı zamanda daha çok işlemci gücü gerektirecek."
-#: src/post/goom/xine_goom.c:212
+#: src/post/goom/xine_goom.c:210
msgid "goom image width"
msgstr "goom resim geniÅŸliÄŸi"
-#: src/post/goom/xine_goom.c:213
+#: src/post/goom/xine_goom.c:211
msgid "The width in pixels of the image to be generated."
msgstr "İşlenecek olan resmin piksel olarak genişliği."
-#: src/post/goom/xine_goom.c:217
+#: src/post/goom/xine_goom.c:215
msgid "goom image height"
msgstr "goom resim yüksekliği"
-#: src/post/goom/xine_goom.c:218
+#: src/post/goom/xine_goom.c:216
msgid "The height in pixels of the image to be generated."
msgstr "İşlenecek olan resmin piksel olarak yüksekliği."
-#: src/post/goom/xine_goom.c:224
+#: src/post/goom/xine_goom.c:222
#, fuzzy
msgid "colour space conversion method"
msgstr "renk dizgesi dönüştürme yöntemi "
-#: src/post/goom/xine_goom.c:225
+#: src/post/goom/xine_goom.c:223
#, fuzzy
msgid ""
"You can choose the colour space conversion method used by goom.\n"
@@ -3597,7 +3723,11 @@ msgstr ""
"seçebilirsiniz.\n"
"Uygun seçimler açıklamalılar olabilir. "
-#: src/post/mosaico/mosaico.c:274
+#: src/post/mosaico/mosaico.c:133
+msgid "Mosaico is a picture in picture (pip) post plugin"
+msgstr ""
+
+#: src/post/mosaico/mosaico.c:255
msgid ""
"Mosaico does simple picture in picture effects.\n"
"\n"
@@ -3617,7 +3747,12 @@ msgstr ""
" w: w resmin geniÅŸliÄŸidir\n"
" h: h resmin yüksekliğidir\n"
-#: src/post/mosaico/switch.c:228
+#: src/post/mosaico/switch.c:108
+msgid ""
+"Switch is a post plugin able to switch at any time between different streams"
+msgstr ""
+
+#: src/post/mosaico/switch.c:209
msgid ""
"Switch can be used for fast switching between multiple inputs.\n"
"\n"
@@ -3647,6 +3782,10 @@ msgstr ""
"\n"
"* mplayer's boxblur (C) 2002 Michael Niedermayer\n"
+#: src/post/planar/boxblur.c:147
+msgid "box blur filter from mplayer"
+msgstr ""
+
#: src/post/planar/denoise3d.c:138
msgid ""
"This filter aims to reduce image noise producing smooth images and making "
@@ -3672,33 +3811,9 @@ msgstr ""
"\n"
"* mplayer's denoise3d (C) 2003 Daniel Moreno\n"
-#: src/post/planar/eq.c:188
-msgid ""
-"Software equalizer with interactive controls just like the hardware "
-"equalizer, for cards/drivers that do not support brightness and contrast "
-"controls in hardware.\n"
-"\n"
-"Parameters\n"
-" brightness\n"
-" contrast\n"
-"\n"
-"Note: It is possible to use frontend's control window to set these "
-"parameters.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
+#: src/post/planar/denoise3d.c:187
+msgid "3D Denoiser (variable lowpass filter)"
msgstr ""
-"Aynen donanım eşitleyicisi gibi olan etkileşimli denetimlere sahip yazılım "
-"eşitleyicisi, bu, kartlar/sürücüler için donanımdaki parlaklık ve zıtlığı "
-"desteklemez.\n"
-"\n"
-"Parametreler\n"
-" parlaklık\n"
-" zıtlık\n"
-"\n"
-"Dikkat: Bu parametreleri kullanmak için ön pencere denetimleri "
-"kullanabilir.\n"
-"\n"
-"* mplayer's eq (C) Richard Felker\n"
#: src/post/planar/eq2.c:361
msgid ""
@@ -3744,7 +3859,48 @@ msgstr ""
"\n"
"* mplayer's eq2 (C) Hampa Hug, Daniel Moreno, Richard Felker\n"
-#: src/post/planar/expand.c:251
+#: src/post/planar/eq2.c:420
+msgid "Software video equalizer"
+msgstr ""
+
+#: src/post/planar/eq.c:188
+msgid ""
+"Software equalizer with interactive controls just like the hardware "
+"equalizer, for cards/drivers that do not support brightness and contrast "
+"controls in hardware.\n"
+"\n"
+"Parameters\n"
+" brightness\n"
+" contrast\n"
+"\n"
+"Note: It is possible to use frontend's control window to set these "
+"parameters.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+msgstr ""
+"Aynen donanım eşitleyicisi gibi olan etkileşimli denetimlere sahip yazılım "
+"eşitleyicisi, bu, kartlar/sürücüler için donanımdaki parlaklık ve zıtlığı "
+"desteklemez.\n"
+"\n"
+"Parametreler\n"
+" parlaklık\n"
+" zıtlık\n"
+"\n"
+"Dikkat: Bu parametreleri kullanmak için ön pencere denetimleri "
+"kullanabilir.\n"
+"\n"
+"* mplayer's eq (C) Richard Felker\n"
+
+#: src/post/planar/eq.c:239
+msgid "soft video equalizer"
+msgstr ""
+
+#: src/post/planar/expand.c:137
+msgid ""
+"add black borders to top and bottom of video to expand it to 4:3 aspect ratio"
+msgstr ""
+
+#: src/post/planar/expand.c:232
msgid ""
"The expand plugin is meant to take frames of arbitrary aspect ratio and "
"converts them to a different aspect (4:3 by default) by adding black bars on "
@@ -3770,7 +3926,7 @@ msgstr ""
" Centre_cut_out_mode: 16:9 çerçevesindekileri 4:3 oranına çıkarır\n"
"\n"
-#: src/post/planar/noise.c:406
+#: src/post/planar/noise.c:408
msgid ""
"Adds random noise to the video.\n"
"\n"
@@ -3803,7 +3959,11 @@ msgstr ""
"\n"
"* mplayer's noise (C) Michael Niedermayer\n"
-#: src/post/planar/pp.c:123
+#: src/post/planar/noise.c:460
+msgid "Adds noise"
+msgstr ""
+
+#: src/post/planar/pp.c:127
msgid ""
"FFmpeg libpostprocess plugin.\n"
"\n"
@@ -3815,7 +3975,7 @@ msgstr ""
"Parametreler\n"
"\n"
-#: src/post/planar/pp.c:129
+#: src/post/planar/pp.c:132
msgid ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
@@ -3823,6 +3983,10 @@ msgstr ""
"\n"
"* libpostprocess (C) Michael Niedermayer\n"
+#: src/post/planar/pp.c:172
+msgid "plugin for ffmpeg libpostprocess"
+msgstr ""
+
#: src/post/planar/unsharp.c:215
msgid ""
"Unsharp mask / gaussian blur\n"
@@ -3876,11 +4040,126 @@ msgstr ""
"\n"
"* mplayer's unsharp (C) 2002 Remi Guyomarch\n"
-#: src/video_out/video_out_aa.c:308
+#: src/post/planar/unsharp.c:273
+msgid "unsharp mask & gaussian blur"
+msgstr ""
+
+#: src/vdr/input_vdr.c:240 src/vdr/input_vdr.c:280 src/vdr/input_vdr.c:2240
+#: src/vdr/input_vdr.c:2250 src/vdr/input_vdr.c:2351
+#, c-format
+msgid "%s: input event write: %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:874 src/vdr/input_vdr.c:1341
+#, c-format
+msgid "%s: buffer_pool_alloc() failed!\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:943
+#, c-format
+msgid "%s: flush buffers (vb: %d, ab: %d, vf: %d, af: %d) %s.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1767
+#, c-format
+msgid "%s: shutting down rpc thread (timeout: %d ms) ...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1791
+#, c-format
+msgid "%s: cancelling rpc thread in function %d...\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1798
+#, fuzzy, c-format
+msgid "%s: joining rpc thread ...\n"
+msgstr "RTP: okuma iÅŸini durduruyor...\n"
+
+#: src/vdr/input_vdr.c:1800
+#, c-format
+msgid "%s: rpc thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1808
+#, fuzzy, c-format
+msgid "%s: joining metronom thread ...\n"
+msgstr "RTP: okuma iÅŸini durduruyor...\n"
+
+#: src/vdr/input_vdr.c:1828
+#, c-format
+msgid "%s: metronom thread joined.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:1928 src/vdr/input_vdr.c:1942 src/vdr/input_vdr.c:1966
+#: src/vdr/input_vdr.c:1988 src/vdr/input_vdr.c:2010
+#, fuzzy, c-format
+msgid "%s: failed to open '%s' (%s)\n"
+msgstr "stdin: '%s' açılamadı\n"
+
+#: src/vdr/input_vdr.c:1944
+msgid "timeout expired during setup phase"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2035
+#, c-format
+msgid "%s: failed to create socket for port %d (%s)\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2049
+#, fuzzy, c-format
+msgid "%s: failed to connect to port %d (%s)\n"
+msgstr "rtsp: '%s' konumuna bağlanılamadı\n"
+
+#: src/vdr/input_vdr.c:2056
+#, c-format
+msgid "%s: socket opening (port %d) successful, fd = %d\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2084
+#, fuzzy, c-format
+msgid "%s: connecting to vdr.\n"
+msgstr "%s: %s konumuna bağlanılamadı:%d\n"
+
+#: src/vdr/input_vdr.c:2089
+#, fuzzy, c-format
+msgid "%s: failed to resolve hostname '%s' (%s)\n"
+msgstr "stdin: '%s' açılamadı\n"
+
+#: src/vdr/input_vdr.c:2112
+#, c-format
+msgid "%s: connecting to all sockets (port %d .. %d) was successful.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2181
+#, c-format
+msgid ""
+"%s: MRL (%s) invalid! MRL should start with vdr://path/to/fifo/stream or "
+"netvdr://host:port where ':port' is optional.\n"
+msgstr ""
+
+#: src/vdr/input_vdr.c:2190 src/vdr/input_vdr.c:2207
+#, fuzzy, c-format
+msgid "%s: can't create new thread (%s)\n"
+msgstr "input_rtp: yeni iş üretemez (%s)\n"
+
+#: src/vdr/input_vdr.c:2763
+msgid "VDR display device plugin"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:104
+msgid "modifies every video frame as requested by VDR"
+msgstr ""
+
+#: src/vdr/post_vdr_video.c:415
+#, c-format
+msgid ": osd: (%d, %d)-(%d, %d)@%lg\n"
+msgstr ""
+
+#: src/video_out/video_out_aa.c:303
msgid "xine video output plugin using the ascii-art library"
msgstr "ascii-art kütüphanesinin kullanan xine görüntü çıkış eklentisi"
-#: src/video_out/video_out_caca.c:321
+#: src/video_out/video_out_caca.c:309
msgid "xine video output plugin using the Color AsCii Art library"
msgstr "Color AsCii Art kütüphanesinin kullanan xine görüntü çıkış eklentisi"
@@ -3928,8 +4207,8 @@ msgid "video colour key"
msgstr "görüntü renk anahtarı"
#: src/video_out/video_out_directfb.c:1365
-#: src/video_out/video_out_vidix.c:1172 src/video_out/video_out_vidix.c:1179
-#: src/video_out/video_out_vidix.c:1186 src/video_out/xv_common.h:25
+#: src/video_out/video_out_vidix.c:1168 src/video_out/video_out_vidix.c:1175
+#: src/video_out/video_out_vidix.c:1182 src/video_out/xv_common.h:25
msgid ""
"The colour key is used to tell the graphics card where to overlay the video "
"image. Try different values, if you experience windows becoming transparent."
@@ -4014,30 +4293,30 @@ msgstr ""
"video_out_directfb: dönüştürme destekli resim ölçekleme donanım "
"hızlandırmalıdır.\n"
-#: src/video_out/video_out_directfb.c:1782
+#: src/video_out/video_out_directfb.c:1796
msgid "video layer id (auto: -1)"
msgstr "görüntü katman kimliği (otomatik: -1)"
-#: src/video_out/video_out_directfb.c:1783
+#: src/video_out/video_out_directfb.c:1797
msgid "Select the video output layer by its id."
msgstr "Görüntü çıkış katmanını kendi kimliğiyle birlikte seçiniz."
-#: src/video_out/video_out_directfb.c:1804
-#: src/video_out/video_out_directfb.c:2014
+#: src/video_out/video_out_directfb.c:1818
+#: src/video_out/video_out_directfb.c:2015
#, c-format
msgid "video_out_directfb: using display layer #%d.\n"
msgstr "video_out_directfb: kullanılan görüntü katmanı #%d.\n"
-#: src/video_out/video_out_directfb.c:1888
+#: src/video_out/video_out_directfb.c:1915
msgid "xine video output plugin using DirectFB."
msgstr "xine görüntü çıkış eklentisi DirectFB kullanıyor."
-#: src/video_out/video_out_directfb.c:2007
+#: src/video_out/video_out_directfb.c:2008
#, c-format
msgid "video_out_directfb: no usable display layer was found!\n"
msgstr "video_out_directfb: kullanılabilecek görüntü katmanı bulunamadı!\n"
-#: src/video_out/video_out_directfb.c:2096
+#: src/video_out/video_out_directfb.c:2120
msgid "xine video output plugin using DirectFB under XDirectFB."
msgstr ""
"xine video çıkış eklentisi XDirectFB altında yer alan DirectFB kullanıyor."
@@ -4055,11 +4334,11 @@ msgid ""
"none: disable all acceleration"
msgstr ""
-#: src/video_out/video_out_directx.c:1322
+#: src/video_out/video_out_directx.c:1327
msgid "xine video output plugin for win32 using directx"
msgstr "directx kullanan win32 için xine video çıkış eklentisi"
-#: src/video_out/video_out_fb.c:758
+#: src/video_out/video_out_fb.c:741
#, fuzzy, c-format
msgid ""
"video_out_fb: only packed truecolour/directcolour is supported (%d).\n"
@@ -4069,11 +4348,11 @@ msgstr ""
"(%d).\n"
" Şu komutu 'fbset -i' veya 'fbset -depth 16' seçeneğini deneyin.\n"
-#: src/video_out/video_out_fb.c:818 src/video_out/video_out_vidix.c:1252
+#: src/video_out/video_out_fb.c:801 src/video_out/video_out_vidix.c:1240
msgid "framebuffer device name"
msgstr "çerçevearabellek aygıtı ismi"
-#: src/video_out/video_out_fb.c:819 src/video_out/video_out_vidix.c:1253
+#: src/video_out/video_out_fb.c:802 src/video_out/video_out_vidix.c:1241
msgid ""
"Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, "
@@ -4086,21 +4365,20 @@ msgstr ""
"yüzden girdiğiniz değerin çerçevearabellek aygıtı için uygun olmasına özen "
"göstermelisiniz."
-#: src/video_out/video_out_fb.c:893
-#, c-format
-msgid "video_out_fb: Your video mode was not recognized, sorry.\n"
+#: src/video_out/video_out_fb.c:876
+#, fuzzy, c-format
+msgid "%s: Your video mode was not recognized, sorry.\n"
msgstr "video_out_fb: Video kipiniz tanınamadı, üzgünüm.\n"
-#: src/video_out/video_out_fb.c:950
-#, c-format
-msgid "video_out_fb: %d video RAM buffers are available.\n"
+#: src/video_out/video_out_fb.c:933
+#, fuzzy, c-format
+msgid "%s: %d video RAM buffers are available.\n"
msgstr "video_out_fb: %d video RAM ara belleği kullanılabilir.\n"
-#: src/video_out/video_out_fb.c:956
-#, c-format
+#: src/video_out/video_out_fb.c:939
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
@@ -4109,40 +4387,42 @@ msgstr ""
" önerilen %d tampon belleğe göre daha düşük seviyededir. Düşürüyor\n"
" çerçeve tampon bellek çözünürlüğü yardımcı olabilir.\n"
-#: src/video_out/video_out_fb.c:967
-#, c-format
+#: src/video_out/video_out_fb.c:950
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: Zero copy buffers are DISABLED because kernel driver\n"
+"WARNING: %s: Zero copy buffers are DISABLED because kernel driver\n"
" do not support screen panning (used for frame flips).\n"
msgstr ""
"UYARI: video_out_fb: Tampon belleğin sıfır kopyası DEVRE DIŞI sorun çekirdek "
"sürücüsündedir\n"
" ekran panlamasını desteklemez (çerçeve hareketleri için kullanılır.).\n"
-#: src/video_out/video_out_fb.c:1036
-#, c-format
+#: src/video_out/video_out_fb.c:1019
+#, fuzzy, c-format
msgid ""
-"WARNING: video_out_fb: current display depth is %d. For better performance\n"
+"WARNING: %s: current display depth is %d. For better performance\n"
" a depth of 16 bpp is recommended!\n"
"\n"
msgstr ""
-"UYARI: video_out_fb: şu anki görüntü derinliği %d. Daha iyi sonuç için\n"
-" 16 bpp'nin derinliği önerilir!\n"
+"\n"
+"\n"
+"UYARI: şu anki görüntü derinliği %d. Ama, daha iyi performanstır\n"
+"16 bpp derinliği önerilir!\n"
"\n"
-#: src/video_out/video_out_fb.c:1067
+#: src/video_out/video_out_fb.c:1050
msgid "Xine video output plugin using the Linux frame buffer device"
msgstr "Linux çerçeve ara bellek aygıtı için Xine video çıkış eklentisi"
-#: src/video_out/video_out_none.c:277
+#: src/video_out/video_out_none.c:279
msgid "xine video output plugin which displays nothing"
msgstr "hiçbir şey göstermeyen xine video çıkış eklentisi"
-#: src/video_out/video_out_opengl.c:1889
+#: src/video_out/video_out_opengl.c:1891
msgid "OpenGL renderer"
msgstr "OpenGL uygulayıcısı"
-#: src/video_out/video_out_opengl.c:1890
+#: src/video_out/video_out_opengl.c:1892
msgid ""
"The OpenGL plugin provides several render modules:\n"
"\n"
@@ -4196,11 +4476,11 @@ msgstr ""
"Environment_Mapped_Torus\n"
"Resimleri eğilip bükülen halkada yansıtarak gösterir. Harika =)"
-#: src/video_out/video_out_opengl.c:1912
+#: src/video_out/video_out_opengl.c:1914
msgid "OpenGL minimum framerate"
msgstr "OpenGL en az çerçeve oranı"
-#: src/video_out/video_out_opengl.c:1913
+#: src/video_out/video_out_opengl.c:1915
msgid ""
"Minimum framerate for animated render routines.\n"
"Ignored for static render routines.\n"
@@ -4208,12 +4488,12 @@ msgstr ""
"Hareketli işleme yolları için en az çerçeve oranı\n"
"Durağan işleme yolları göz ardı edilmiştir.\n"
-#: src/video_out/video_out_opengl.c:1918 src/video_out/video_out_vidix.c:1028
+#: src/video_out/video_out_opengl.c:1920 src/video_out/video_out_vidix.c:1032
#: src/video_out/xv_common.h:46
msgid "enable double buffering"
msgstr "çift ara belleğe almayı etkinleştir"
-#: src/video_out/video_out_opengl.c:1919
+#: src/video_out/video_out_opengl.c:1921
msgid ""
"For OpenGL double buffering does not only remove tearing artifacts,\n"
"it also reduces flickering a lot.\n"
@@ -4224,7 +4504,7 @@ msgstr ""
"aynı zamanda titremeyi de oldukça azaltır.\n"
"Bunun performansa herhangi bir etkisi olmaz."
-#: src/video_out/video_out_opengl.c:2012
+#: src/video_out/video_out_opengl.c:2025
msgid "xine video output plugin using the OpenGL 3D graphics API"
msgstr "OpenGL 3D grafikleri API'sini kullanan xine video çıkış eklentisi"
@@ -4244,6 +4524,13 @@ msgid "video_out_pgx32: Error: '%s' is not a pgx32 framebuffer device\n"
msgstr ""
"video_out_pgx32: Hata: '%s' bir pgx32 çerçeve ara belleği aygıtı değildir\n"
+#: src/video_out/video_out_pgx32.c:864
+#, fuzzy
+msgid "xine video output plugin for Sun PGX32 framebuffers"
+msgstr ""
+"linux çerçeve ara belleği için libvidix kullanan xine görüntü çıkışı "
+"eklentisi"
+
#: src/video_out/video_out_pgx64.c:278
#, c-format
msgid "video_out_pgx64: Error: can't grab DGA drawable for video window\n"
@@ -4282,35 +4569,35 @@ msgstr ""
msgid "video_out_pgx64: Error: unable to set window properties\n"
msgstr "video_out_pgx64: Hata: pencere özellikleri ayarlanamıyor\n"
-#: src/video_out/video_out_pgx64.c:808
+#: src/video_out/video_out_pgx64.c:807
#, c-format
msgid "video_out_pgx64: Warning: low video memory, multi-buffering disabled\n"
msgstr ""
"video_out_pgx64: Uyarı: düşük görüntü hafızası, çift-ara bellekleme devre "
"dışı\n"
-#: src/video_out/video_out_pgx64.c:840
+#: src/video_out/video_out_pgx64.c:839
#, c-format
msgid "video_out_pgx64: Error: insuffucient video memory\n"
msgstr "video_out_pgx64: Hata: yetersiz video hafızası\n"
-#: src/video_out/video_out_pgx64.c:856
+#: src/video_out/video_out_pgx64.c:855
#, c-format
msgid "video_out_pgx64: Warning: low video memory, double-buffering disabled\n"
msgstr ""
"video_out_pgx64: Uyarı: düşük video hafızası, çift-ara bellekleme devre "
"dışı\n"
-#: src/video_out/video_out_pgx64.c:1394
+#: src/video_out/video_out_pgx64.c:1385
#, c-format
msgid "video_out_pgx64: Error: ioctl failed (FBIOGATTR)\n"
msgstr "video_out_pgx64: Hata: ioctl başarılamadı (FBIOGATTR)\n"
-#: src/video_out/video_out_pgx64.c:1461 src/video_out/xv_common.h:24
+#: src/video_out/video_out_pgx64.c:1452 src/video_out/xv_common.h:24
msgid "video overlay colour key"
msgstr "görüntü üstyazım renk anahtarı"
-#: src/video_out/video_out_pgx64.c:1462
+#: src/video_out/video_out_pgx64.c:1453
msgid ""
"The colour key is used to tell the graphics card where it can overlay the "
"video image. Try using different values if you see the video showing through "
@@ -4320,11 +4607,11 @@ msgstr ""
"bildirmek için kullanılır. Eğer videonun farklı pencerelerde gösterdiğini "
"saptarsanız değişik değerler deneyin."
-#: src/video_out/video_out_pgx64.c:1469
+#: src/video_out/video_out_pgx64.c:1460
msgid "enable chroma keying"
msgstr "renk berraklığı anahtarlamayı etkinleştir"
-#: src/video_out/video_out_pgx64.c:1470
+#: src/video_out/video_out_pgx64.c:1461
msgid ""
"Draw OSD graphics on top of the overlay colour key rather than blend them "
"into each frame."
@@ -4332,16 +4619,23 @@ msgstr ""
"OSD grafiklerini her çerçevede harmanlamak yerine üstyazım renk anahtarının "
"üzerine çizin."
-#: src/video_out/video_out_pgx64.c:1473
+#: src/video_out/video_out_pgx64.c:1464
msgid "enable multi-buffering"
msgstr "çoklu-tamponlamayı etkinleştir"
-#: src/video_out/video_out_pgx64.c:1474
+#: src/video_out/video_out_pgx64.c:1465
msgid ""
"Multi buffering increases performance at the expense of using more graphics "
"memory."
msgstr "Çoklu Tamponlama, daha fazla görüntü hafızası kullanılmasına yol açar."
+#: src/video_out/video_out_pgx64.c:1486
+#, fuzzy
+msgid "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers"
+msgstr ""
+"linux çerçeve ara belleği için libvidix kullanan xine görüntü çıkışı "
+"eklentisi"
+
#: src/video_out/video_out_sdl.c:490
msgid "use hardware acceleration if available"
msgstr "olanaklı ise donanım hızlandırması kullan"
@@ -4367,142 +4661,42 @@ msgstr ""
msgid "video_out_sdl: fullscreen mode is NOT supported\n"
msgstr "video_out_sdl: tam ekran kipi desteklenmiyor\n"
-#: src/video_out/video_out_sdl.c:585
+#: src/video_out/video_out_sdl.c:596
msgid "xine video output plugin using the Simple Direct Media Layer"
msgstr ""
"Simple Direct Media Layer özelliğini kullanan xine görüntü çıkışı eklentisi"
-#: src/video_out/video_out_stk.c:452
+#: src/video_out/video_out_stk.c:454
msgid "xine video output plugin using the Libstk Surface Set-top Toolkit"
msgstr ""
"Libstk Surface Set-top Toolkit özelliğini kullanan xine görüntü çıkışı "
"eklentisi"
-#: src/video_out/video_out_syncfb.c:280
-#, c-format
-msgid "video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: hata. (YUY2 ekran kartını tarafından desteklenmiyor)\n"
-
-#: src/video_out/video_out_syncfb.c:296
-#, c-format
-msgid "video_out_syncfb: error. (YV12 not supported by your graphic card)\n"
-msgstr ""
-"video_out_syncfb: hata. (YV12 ekran kartınız tarafından desteklenmiyor)\n"
-
-#: src/video_out/video_out_syncfb.c:950
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"
-msgstr ""
-"video_out_syncfb: bilgi. (SyncFB modülü YUV 4:2:0 (3 plane)) parametresini "
-"destekler\n"
-
-#: src/video_out/video_out_syncfb.c:955
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"
-msgstr ""
-"video_out_syncfb: bilgi. (SyncFB modülü YUV 4:2:0 (2 plane)) parametresini "
-"destekler\n"
-
-#: src/video_out/video_out_syncfb.c:960
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"
-msgstr ""
-"video_out_syncfb: bilgi. (SyncFB modülü YUV 4:2:2) parametresini destekler\n"
-
-#: src/video_out/video_out_syncfb.c:966
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports YUY2)\n"
-msgstr ""
-"video_out_syncfb: bilgi. (SyncFB modülü YUY2) parametresini destekler\n"
-
-#: src/video_out/video_out_syncfb.c:973
-#, c-format
-msgid "video_out_syncfb: info. (SyncFB module supports RGB565)\n"
-msgstr ""
-"video_out_syncfb: bilgi. (SyncFB modülü RGB565) parametresini destekler\n"
-
-#: src/video_out/video_out_syncfb.c:978
-#, c-format
-msgid ""
-"video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor "
-"RGB565)\n"
-msgstr ""
-"video_out_syncfb: durduruyor. (SyncFB modülü, ne YV12 ve YUY2 "
-"parametrelerini, ne de RGB565) parametresini destekler\n"
-
-#: src/video_out/video_out_syncfb.c:997
-#, fuzzy, c-format
-msgid ""
-"video_out_syncfb: info. (brightness/contrast control won't be available "
-"because your SyncFB kernel module seems to be outdated. Please refer to "
-"README.syncfb for information on how to update it.)\n"
-msgstr ""
-"video_out_syncfb: bilgi. (parlaklık/zıtlık denetimi uygun olmayacak çünkü "
-"SyncFB çekirdek modülünüz güncelliğini yitirmiş gözüküyor. Onu nasıl "
-"güncelleyeceğinizi öğrenmek için README.syncfb belgesine bakınız.)\n"
-
-#: src/video_out/video_out_syncfb.c:1021
-msgid "default number of frame repetitions"
-msgstr "çerçeve tekrarlarının öntanımlı numarası"
-
-#: src/video_out/video_out_syncfb.c:1022
-msgid ""
-"This specifies how many times a single video frame will be displayed "
-"consecutively."
-msgstr ""
-"Bu, tek video çerçevenizin ardışık olarak kaç defa görüntülenebileceğini "
-"belirler."
-
-#: src/video_out/video_out_syncfb.c:1070
-msgid ""
-"xine video output plugin using the SyncFB module for Matrox G200/G400 cards"
-msgstr ""
-"Matrox G200/G400 kartları için SyncFB modülünü kullanan xine görüntü çıkışı "
-"eklentisi"
-
-#: src/video_out/video_out_syncfb.c:1088
-msgid "SyncFB device name"
-msgstr "SyncFB aygıt ismi"
-
-#: src/video_out/video_out_syncfb.c:1089
-msgid ""
-"Specifies the file name for the SyncFB (TeleTux) device to be used.\n"
-"This setting is security critical, because when changed to a different file, "
-"xine can be used to fill this file with arbitrary content. So you should be "
-"careful that the value you enter really is a proper framebuffer device."
-msgstr ""
-"Kullanılacak olan SyncFB (TeleTux) aygıtı için dosya ismini belirler.\n"
-"Bu güvenlik açısından kritiktir, çünkü dosya adı değiştirildiğinde, xine bu "
-"dosyanın içini ilgisiz içerikle doldurması için kullanılabilir.bu yüzden "
-"çerçeve belleği aygıtı için gerçekten uygun bir değer girmeye dikkat "
-"etmelisiniz."
-
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "red intensity"
msgstr "kırmızı yoğunluğu"
-#: src/video_out/video_out_vidix.c:1006
+#: src/video_out/video_out_vidix.c:1010
msgid "The intensity of the red colour components."
msgstr "Kırmızı renk bileşenlerinin yoğunluğu."
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "green intensity"
msgstr "yeÅŸil yoÄŸunluÄŸu"
-#: src/video_out/video_out_vidix.c:1011
+#: src/video_out/video_out_vidix.c:1015
msgid "The intensity of the green colour components."
msgstr "YeÅŸil renk bileÅŸenlerinin yoÄŸunluÄŸu."
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "blue intensity"
msgstr "mavi yoÄŸunluÄŸu"
-#: src/video_out/video_out_vidix.c:1016
+#: src/video_out/video_out_vidix.c:1020
msgid "The intensity of the blue colour components."
msgstr "Mavi renk bileÅŸenlerinin yoÄŸunluÄŸu."
-#: src/video_out/video_out_vidix.c:1029 src/video_out/xv_common.h:47
+#: src/video_out/video_out_vidix.c:1033 src/video_out/xv_common.h:47
msgid ""
"Double buffering will synchronize the update of the video image to the "
"repainting of the entire screen (\"vertical retrace\"). This eliminates "
@@ -4513,83 +4707,88 @@ msgstr ""
"parçalanmayı önler, fakat bu işlem daha çok ekran kartı hafızası kullanımına "
"sebebiyet verecektr."
-#: src/video_out/video_out_vidix.c:1076
+#: src/video_out/video_out_vidix.c:1080
#, c-format
msgid "video_out_vidix: adaptor supports the yuy2 format\n"
msgstr "video_out_vidix: çevirici yuy2 kipini destekler\n"
-#: src/video_out/video_out_vidix.c:1087
+#: src/video_out/video_out_vidix.c:1091
#, c-format
msgid "video_out_vidix: adaptor supports the yv12 format\n"
msgstr "video_out_vidix: paralel bilgisayar yv12 kipini destekler\n"
-#: src/video_out/video_out_vidix.c:1103
+#: src/video_out/video_out_vidix.c:1107
#, c-format
msgid "video_out_vidix: You have wrong version of VIDIX library\n"
msgstr "video_out_vidix: VIDIX kütüphanesinin hatalı sürümüne sahipsiniz\n"
-#: src/video_out/video_out_vidix.c:1111
+#: src/video_out/video_out_vidix.c:1115
#, c-format
msgid "video_out_vidix: Couldn't find working VIDIX driver\n"
msgstr "video_out_vidix: Çalışan VIDIX sürücünü bulamıyor\n"
-#: src/video_out/video_out_vidix.c:1124
+#: src/video_out/video_out_vidix.c:1128
#, c-format
msgid "video_out_vidix: using driver: %s by %s\n"
msgstr "video_out_vidix: kullanılan sürücü: %s by %s\n"
-#: src/video_out/video_out_vidix.c:1171
+#: src/video_out/video_out_vidix.c:1167
msgid "video overlay colour key red component"
msgstr "görüntü üstyazım renk anahtarı kırmızı bileşeni"
-#: src/video_out/video_out_vidix.c:1178
+#: src/video_out/video_out_vidix.c:1174
msgid "video overlay colour key green component"
msgstr "görüntü üstyazım renk anahtarı yeşil bileşeni"
-#: src/video_out/video_out_vidix.c:1185
+#: src/video_out/video_out_vidix.c:1181
msgid "video overlay colour key blue component"
msgstr "görüntü üstyazım renk anahtarı mavi bileşeni"
-#: src/video_out/video_out_vidix.c:1217
+#: src/video_out/video_out_vidix.c:1215
msgid "xine video output plugin using libvidix for x11"
msgstr "x11 için libvidix kullanan xine görüntü çıkışı eklentisi"
-#: src/video_out/video_out_vidix.c:1299
+#: src/video_out/video_out_vidix.c:1289
msgid "xine video output plugin using libvidix for linux frame buffer"
msgstr ""
"linux çerçeve ara belleği için libvidix kullanan xine görüntü çıkışı "
"eklentisi"
-#: src/video_out/video_out_xcbshm.c:150
+#: src/video_out/video_out_xcbshm.c:154 src/video_out/video_out_xshm.c:215
#, c-format
-msgid ""
-"video_out_xcbshm: %s: allocating image\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: %s: allocating image\n"
msgstr ""
-"video_out_xcbshm: %s: resmin yerini alıyor\n"
-"video_out_xcbshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xcbshm.c:159
-#, c-format
-msgid ""
-"video_out_xcbshm: shared memory error (address error) when allocating "
-"image \n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+#: src/video_out/video_out_xcbshm.c:156 src/video_out/video_out_xcbshm.c:166
+#: src/video_out/video_out_xcbshm.c:178 src/video_out/video_out_xcbxv.c:267
+#: src/video_out/video_out_xcbxv.c:277 src/video_out/video_out_xcbxv.c:287
+#: src/video_out/video_out_xcbxv.c:299 src/video_out/video_out_xshm.c:200
+#: src/video_out/video_out_xshm.c:217 src/video_out/video_out_xshm.c:228
+#: src/video_out/video_out_xshm.c:247 src/video_out/video_out_xv.c:295
+#: src/video_out/video_out_xv.c:322 src/video_out/video_out_xv.c:331
+#: src/video_out/video_out_xv.c:367 src/video_out/video_out_xxmc.c:643
+#: src/video_out/video_out_xxmc.c:654 src/video_out/video_out_xxmc.c:663
+#: src/video_out/video_out_xxmc.c:699
+#, fuzzy, c-format
+msgid "%s: => not using MIT Shared Memory extension.\n"
+msgstr "MIT X paylaşılan bellek uzantısını kullanan xine görüntü eklentisi"
+
+#: src/video_out/video_out_xcbshm.c:164 src/video_out/video_out_xshm.c:226
+#, fuzzy, c-format
+msgid "%s: shared memory error (address error) when allocating image \n"
msgstr ""
-"video_out_xcbshm: resmin yerini geçerken paylaşılan bellek hatası (adres "
+"video_out_xshm: resmin yerini geçerken paylaşılan bellek hatası (adres "
"hatası ) \n"
-"video_out_xcbshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
+"video_out_xshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xcbshm.c:170
+#: src/video_out/video_out_xcbshm.c:176 src/video_out/video_out_xcbxv.c:297
+#: src/video_out/video_out_xshm.c:245 src/video_out/video_out_xv.c:365
+#: src/video_out/video_out_xxmc.c:697
#, c-format
-msgid ""
-"video_out_xcbshm: x11 error during shared memory XImage creation\n"
-"video_out_xcbshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: x11 error during shared memory XImage creation\n"
msgstr ""
-"video_out_xcbshm: paylaşılan bellek XImage oluşturma boyunca x11 hatası\n"
-"video_out_xcbshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xcbshm.c:1101 src/video_out/video_out_xshm.c:1157
+#: src/video_out/video_out_xcbshm.c:1095 src/video_out/video_out_xshm.c:1152
#, c-format
msgid ""
"\n"
@@ -4604,91 +4803,81 @@ msgstr ""
"16 bpp derinliği önerilir!\n"
"\n"
-#: src/video_out/video_out_xcbshm.c:1114
-#, c-format
-msgid "video_out_xcbshm: MIT shared memory extension not present on display.\n"
+#: src/video_out/video_out_xcbshm.c:1108 src/video_out/video_out_xshm.c:1165
+#, fuzzy, c-format
+msgid "%s: MIT shared memory extension not present on display.\n"
msgstr ""
-"video_out_xcbshm: MIT Paylaşılan Bellek uzantısı şu and ekranda değildir.\n"
+"video_out_xshm: MIT Paylaşılan Bellek uzantısı şu and ekranda değildir.\n"
-#: src/video_out/video_out_xcbshm.c:1213
-#, c-format
-msgid "video_out_xcbshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xcbshm: görüntü kipiniz algılanamadı, üzgünüm :-(\n"
+#: src/video_out/video_out_xcbshm.c:1207 src/video_out/video_out_xshm.c:1249
+#, fuzzy, c-format
+msgid "%s: your video mode was not recognized, sorry :-(\n"
+msgstr "video_out_xshm: görüntü kipiniz algılanamadı, üzgünüm :-(\n"
-#: src/video_out/video_out_xcbshm.c:1243 src/video_out/video_out_xshm.c:1303
+#: src/video_out/video_out_xcbshm.c:1236 src/video_out/video_out_xshm.c:1297
msgid "xine video output plugin using the MIT X shared memory extension"
msgstr "MIT X paylaşılan bellek uzantısını kullanan xine görüntü eklentisi"
-#: src/video_out/video_out_xcbxv.c:270
+#: src/video_out/video_out_xcbxv.c:265 src/video_out/video_out_xv.c:320
+#: src/video_out/video_out_xxmc.c:652
#, c-format
-msgid ""
-"video_out_xcbxv: XvShmCreateImage returned a zero size\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage returned a zero size\n"
msgstr ""
-"video_out_xcbxv: XvShmCreateImage sıfır boyutuna dönüştü\n"
-"video_out_xcbxv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xcbxv.c:279
+#: src/video_out/video_out_xcbxv.c:275 src/video_out/video_out_xv.c:329
+#: src/video_out/video_out_xxmc.c:661
#, c-format
-msgid ""
-"video_out_xcbxv: shared memory error in shmget: %s\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error in shmget: %s\n"
msgstr ""
-"video_out_xcbxv: shmget'de paylaşılan bellek hatası: %s\n"
-"video_out_xcbxv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xcbxv.c:298
+#: src/video_out/video_out_xcbxv.c:285
#, c-format
-msgid ""
-"video_out_xcbxv: x11 error during shared memory XImage creation\n"
-"video_out_xcbxv: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error (address error)\n"
msgstr ""
-"video_out_xcbxv: XImage oluşturması boyunca x11 hatası\n"
-"video_out_xcbxv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xcbxv.c:1358
-#, c-format
-msgid "video_out_xcbxv: Xv extension not present.\n"
-msgstr "video_out_xcbxv: Xv uzantısı şu anda hazır değil.\n"
+#: src/video_out/video_out_xcbxv.c:1194 src/video_out/video_out_xv.c:1240
+#: src/video_out/video_out_xxmc.c:2472
+#, fuzzy, c-format
+msgid "%s: Xv extension not present.\n"
+msgstr "video_out_xv: Xv uzantısı hazır değil.\n"
-#: src/video_out/video_out_xcbxv.c:1385 src/video_out/video_out_xxmc.c:2461
+#: src/video_out/video_out_xcbxv.c:1221 src/video_out/video_out_xv.c:1265
+#: src/video_out/video_out_xxmc.c:2497
#, c-format
-msgid "%s: could not open Xv port %d - autodetecting\n"
+msgid "%s: could not open Xv port %lu - autodetecting\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1401 src/video_out/video_out_xv.c:1444
-#: src/video_out/video_out_xxmc.c:2473
+#: src/video_out/video_out_xcbxv.c:1237 src/video_out/video_out_xv.c:1277
+#: src/video_out/video_out_xxmc.c:2509
#, c-format
msgid "%s: no available ports of type \"%s\", defaulting...\n"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1409
-#, c-format
+#: src/video_out/video_out_xcbxv.c:1245 src/video_out/video_out_xv.c:1284
+#: src/video_out/video_out_xxmc.c:2516
+#, fuzzy, c-format
msgid ""
-"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"
msgstr ""
-"video_out_xcbxv: Xv extension şu anda hazır fakat kullanılabilir yuv12 "
-"portunu bulamıyorum.\n"
-" Ekran donanım sürücünüz Xv desteği vermiyor gibi "
-"gözüküyor?!\n"
+"video_out_xv: Xv extension şu anda hazır fakat kullanılabilir yuv12 portunu "
+"bulamıyorum.\n"
+" Ekran donanım sürücünüz Xv desteği vermiyor gibi gözüküyor?!\n"
-#: src/video_out/video_out_xcbxv.c:1417
+#: src/video_out/video_out_xcbxv.c:1254
#, fuzzy, c-format
msgid ""
-"video_out_xcbxv: using Xv port %d from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %d from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
-"video_out_xcbxv: Xv portunu %d çeviriciden %s for donanım renk modeli "
-"çevrimi ve yükseltmesi için kullanıyor.\n"
+"video_out_xv: Xv portunu %ld çeviriciden %s donanım renk modeli çevrimi ve "
+"yükseltmesi için kullanıyor.\n"
-#: src/video_out/video_out_xcbxv.c:1542 src/video_out/video_out_xv.c:1595
+#: src/video_out/video_out_xcbxv.c:1383 src/video_out/video_out_xv.c:1433
msgid "enable vblank sync"
msgstr ""
-#: src/video_out/video_out_xcbxv.c:1543 src/video_out/video_out_xv.c:1596
+#: src/video_out/video_out_xcbxv.c:1384 src/video_out/video_out_xv.c:1434
#, fuzzy
msgid ""
"This option will synchronize the update of the video image to the repainting "
@@ -4701,235 +4890,44 @@ msgstr ""
"parçalanmayı önler, fakat bu işlem daha çok ekran kartı hafızası kullanımına "
"sebebiyet verecektr."
-#: src/video_out/video_out_xcbxv.c:1587
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xcbxv: bu çevirici yv12 kipini destekler.\n"
-
-#: src/video_out/video_out_xcbxv.c:1592
-#, c-format
-msgid "video_out_xcbxv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xcbxv: bu çevirici yuy2 kipini destekler.\n"
-
-#: src/video_out/video_out_xcbxv.c:1606 src/video_out/video_out_xv.c:1670
-#: src/video_out/video_out_xvmc.c:1539
-msgid "deinterlace method (deprecated)"
-msgstr "dönüştürme yöntemi (arındırılmış)"
-
-#: src/video_out/video_out_xcbxv.c:1607 src/video_out/video_out_xv.c:1671
-#: src/video_out/video_out_xvmc.c:1540
-msgid ""
-"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."
-msgstr ""
-"Bu yapılandırma ayarı arındırılmıştır. Bunun yerine yeni bir son işleme "
-"dönümünü kullanabilirsiniz.\n"
-"\n"
-"Eski analog televizyon günlerinde, tek ve çift sayılı video çerçeveleri "
-"çizgileri farklı zamanlarda görüntülenebilirdi. Bir fikir olarak bu "
-"çizgileri hareket düzlüğünü arttırmak için farklı zamanlarda kaydetme "
-"düşüncesi ortaya çıktı. Buna \"dönüştürme\" denildi. Fakat ne yazık ki, "
-"bugün ekranlar, tek ve çift sayılara sahip olan çizgileri tek bir zamanda, "
-"tek bir çerçeve olarak gösterebilmektedirler (buna da \"gelişmiş ekran \" "
-"denilmektedir), fakat bunlar tepe sonuçları olarak bilinen çirkin çerçeve "
-"hatalarına sebep olmaktadırlar. Yazılım dönüştürmesi bu sonuçları azaltmayı "
-"amaçlayan bir yaklaşımdır. Bireysel değerler şunlardır:\n"
-"\n"
-"none\n"
-"Yazılım dönüştürmesine devre dışı bırakır.\n"
-"\n"
-"bob\n"
-"Resmin hareketleri kısımlarını atmak için çizgiler arasında gider gelir.\n"
-"\n"
-"weave\n"
-"Bob'a benzer şekilde, fakat tüm çözünürlüğü koruma eğilimiyle, yavaş "
-"hareketli sahnelerde çok detay daha iyidir.\n"
-"\n"
-"greedy\n"
-"Çok iyi uyarlanabilir döünştürücü, fakat daha fazla işlemci gücü "
-"gerektirir.\n"
-"\n"
-"onefield\n"
-"Daima karıştırı ve dikey çözünürlüğü azaltır.\n"
-"\n"
-"onefieldxv\n"
-"Onefield ile aynıdır, fakat karışımı donanımda gerçekleştirir.\n"
-"\n"
-"linearblend\n"
-"Tarak sonuçlarını kaldırmak için hafif bir dikey bulandırma uygular. "
-"Ortalama bir işlemci hızıyla iyi sonuçlar alınabilir."
+#: src/video_out/video_out_xcbxv.c:1429 src/video_out/video_out_xcbxv.c:1435
+#: src/video_out/video_out_xv.c:1476 src/video_out/video_out_xv.c:1482
+#: src/video_out/video_out_xvmc.c:1484 src/video_out/video_out_xvmc.c:1490
+#: src/video_out/video_out_xxmc.c:2701 src/video_out/video_out_xxmc.c:2707
+#, fuzzy, c-format
+msgid "%s: this adaptor supports the %s format.\n"
+msgstr "video_out_xv: bu çevirici yv12 kipini destekler.\n"
-#: src/video_out/video_out_xcbxv.c:1661 src/video_out/video_out_xv.c:1744
-#: src/video_out/video_out_xxmc.c:2780
+#: src/video_out/video_out_xcbxv.c:1473 src/video_out/video_out_xv.c:1553
+#: src/video_out/video_out_xxmc.c:2826
msgid "xine video output plugin using the MIT X video extension"
msgstr "MIT X görüntü genişlemesini kullanmak için xine görüntü eklentisi"
-#: src/video_out/video_out_xshm.c:194
+#: src/video_out/video_out_xshm.c:198
#, c-format
-msgid ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: shared memory error when allocating image\n"
msgstr ""
-"video_out_xshm: shared memory error when allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-#: src/video_out/video_out_xshm.c:210
+#: src/video_out/video_out_xv.c:293 src/video_out/video_out_xxmc.c:641
#, c-format
-msgid ""
-"video_out_xshm: %s: allocating image\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
+msgid "%s: XvShmCreateImage failed\n"
msgstr ""
-"video_out_xshm: %s: resmin yerine geçiyor\n"
-"video_out_xshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-#: src/video_out/video_out_xshm.c:220
-#, c-format
-msgid ""
-"video_out_xshm: shared memory error (address error) when allocating image \n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: resmin yerini geçerken paylaşılan bellek hatası (adres "
-"hatası ) \n"
-"video_out_xshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xshm.c:237
-#, c-format
-msgid ""
-"video_out_xshm: x11 error during shared memory XImage creation\n"
-"video_out_xshm: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xshm: paylaşılan bellek XImage oluşturma boyunca x11 hatası\n"
-"video_out_xshm: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xshm.c:1170
-#, c-format
-msgid "video_out_xshm: MIT shared memory extension not present on display.\n"
-msgstr ""
-"video_out_xshm: MIT Paylaşılan Bellek uzantısı şu and ekranda değildir.\n"
-
-#: src/video_out/video_out_xshm.c:1254
-#, c-format
-msgid "video_out_xshm: your video mode was not recognized, sorry :-(\n"
-msgstr "video_out_xshm: görüntü kipiniz algılanamadı, üzgünüm :-(\n"
-
-#: src/video_out/video_out_xv.c:298
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage failed\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage başarılamadı\n"
-"video_out_xv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xv.c:324
-#, c-format
-msgid ""
-"video_out_xv: XvShmCreateImage returned a zero size\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: XvShmCreateImage bir sıfır boyutuna dönüştü\n"
-"video_out_xv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xv.c:332
-#, c-format
-msgid ""
-"video_out_xv: shared memory error in shmget: %s\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: shmget: %s de paylaşılan bellek hatası\n"
-"video_out_xv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xv.c:364
-#, c-format
-msgid ""
-"video_out_xv: x11 error during shared memory XImage creation\n"
-"video_out_xv: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xv: paylaşılan bellek XImage oluşturma boyunca x11 hatası\n"
-"video_out_xv: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xv.c:1407
-#, c-format
-msgid "video_out_xv: Xv extension not present.\n"
-msgstr "video_out_xv: Xv uzantısı hazır değil.\n"
-
-#: src/video_out/video_out_xv.c:1432
-#, c-format
-msgid "%s: could not open Xv port %<PRId32> - autodetecting\n"
-msgstr ""
-
-#: src/video_out/video_out_xv.c:1451
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xv: Xv extension şu anda hazır fakat kullanılabilir yuv12 portunu "
-"bulamıyorum.\n"
-" Ekran donanım sürücünüz Xv desteği vermiyor gibi gözüküyor?!\n"
-
-#: src/video_out/video_out_xv.c:1460
+#: src/video_out/video_out_xv.c:1294 src/video_out/video_out_xxmc.c:2526
#, fuzzy, c-format
msgid ""
-"video_out_xv: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
+"%s: using Xv port %ld from adaptor %s for hardware colour space conversion "
+"and scaling.\n"
msgstr ""
"video_out_xv: Xv portunu %ld çeviriciden %s donanım renk modeli çevrimi ve "
"yükseltmesi için kullanıyor.\n"
-#: src/video_out/video_out_xv.c:1637
-#, c-format
-msgid "video_out_xv: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xv: bu çevirici yv12 kipini destekler.\n"
-
-#: src/video_out/video_out_xv.c:1642
-#, c-format
-msgid "video_out_xv: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xv: bu çevirici yuy2 kipini destekler.\n"
-
-#: src/video_out/video_out_xvmc.c:1608
-msgid "xine video output plugin using the XvMC X video extension"
-msgstr "XvMC X görüntü uzantısını kullanması için xine görüntü eklentisi"
-
-#: src/video_out/video_out_xvmc.c:1650
+#: src/video_out/video_out_xvmc.c:1566
#, c-format
msgid "video_out_xvmc: XvMC extension not present.\n"
msgstr "video_out_xvmc: XvMC uzantısı şu an hazır değil.\n"
-#: src/video_out/video_out_xvmc.c:1748
+#: src/video_out/video_out_xvmc.c:1664
#, c-format
msgid ""
"video_out_xvmc: Xv extension is present but I couldn't find a usable yuv12 "
@@ -4938,7 +4936,7 @@ msgstr ""
"video_out_xvmc: Xv uzantısı hazır fakat kullanılabilir durumda bir yuv12 "
"portu bulamıyorum.\n"
-#: src/video_out/video_out_xvmc.c:1757
+#: src/video_out/video_out_xvmc.c:1673
#, fuzzy, c-format
msgid ""
"video_out_xvmc: using Xv port %ld from adaptor %s\n"
@@ -4947,103 +4945,36 @@ msgstr ""
"video_out_xvmc: Xv portunu %ld çeviriciden %s kullanıyor\n"
" donanım renk modeli çevrimi ve yükselmesi için\n"
-#: src/video_out/video_out_xvmc.c:1762
+#: src/video_out/video_out_xvmc.c:1678
#, c-format
msgid " idct and motion compensation acceleration \n"
msgstr " idct ve hareket bedeli hızlandırılması \n"
-#: src/video_out/video_out_xvmc.c:1764
+#: src/video_out/video_out_xvmc.c:1680
#, c-format
msgid " motion compensation acceleration only\n"
msgstr " sadece hareket bedeli hızlandırılması\n"
-#: src/video_out/video_out_xvmc.c:1766
+#: src/video_out/video_out_xvmc.c:1682
#, c-format
msgid " no XvMC support \n"
msgstr " hiçbir XvMC desteği yok \n"
-#: src/video_out/video_out_xvmc.c:1767
+#: src/video_out/video_out_xvmc.c:1683
#, c-format
msgid " With Overlay = %d; UnsignedIntra = %d.\n"
msgstr " Üstyazımlı = %d; İmzalanmamış Intra = %d.\n"
-#: src/video_out/video_out_xxmc.c:639
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage failed\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage başarılamadı\n"
-"video_out_xxmc: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xxmc.c:649
-#, c-format
-msgid ""
-"video_out_xxmc: XvShmCreateImage returned a zero size\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XvShmCreateImage sıfır boyutuna dönüştü\n"
-"video_out_xxmc: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xxmc.c:657
-#, c-format
-msgid ""
-"video_out_xxmc: shared memory error in shmget: %s\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: shmget'de paylaşılan bellek hatası: %s\n"
-"video_out_xxmc: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xxmc.c:689
-#, c-format
-msgid ""
-"video_out_xxmc: x11 error during shared memory XImage creation\n"
-"video_out_xxmc: => not using MIT Shared Memory extension.\n"
-msgstr ""
-"video_out_xxmc: XImage oluşturması boyunca x11 hatası\n"
-"video_out_xxmc: => MIT Paylaşılan Bellek uzantısını kullanmıyor.\n"
-
-#: src/video_out/video_out_xxmc.c:2436
-#, c-format
-msgid "video_out_xxmc: Xv extension not present.\n"
-msgstr "video_out_xxmc: Xv uzantısı şu anda hazır değil.\n"
-
-#: src/video_out/video_out_xxmc.c:2480
-#, c-format
-msgid ""
-"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"
-msgstr ""
-"video_out_xxmc: Xv extension şu anda hazır fakat kullanılabilir yuv12 "
-"portunu bulamıyorum.\n"
-" Ekran donanım sürücünüz Xv desteği vermiyor gibi gözüküyor?!\n"
-
-#: src/video_out/video_out_xxmc.c:2489
-#, fuzzy, c-format
-msgid ""
-"video_out_xxmc: using Xv port %ld from adaptor %s for hardware colour space "
-"conversion and scaling.\n"
-msgstr ""
-"video_out_xxmc: donanım renk modeli çevrimi ve yükselmesi için Xv portunu "
-"%ld çevirividen %s kullanıyor\n"
-
-#: src/video_out/video_out_xxmc.c:2658
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yv12 format.\n"
-msgstr "video_out_xxmc: bu çevirici yv12 kipini destekler.\n"
-
-#: src/video_out/video_out_xxmc.c:2663
-#, c-format
-msgid "video_out_xxmc: this adaptor supports the yuy2 format.\n"
-msgstr "video_out_xxmc: bu çevirici yuy2 kipini destekler.\n"
+#: src/video_out/video_out_xvmc.c:1696
+msgid "xine video output plugin using the XvMC X video extension"
+msgstr "XvMC X görüntü uzantısını kullanması için xine görüntü eklentisi"
-#: src/video_out/video_out_xxmc.c:2691
+#: src/video_out/video_out_xxmc.c:2738
msgid "Make XvMC allocate more frames for better buffering."
msgstr ""
"Daha iyi tamponlama için XvMC belirlemesini daha fazla çerçeveye atayın."
-#: src/video_out/video_out_xxmc.c:2692
+#: src/video_out/video_out_xxmc.c:2739
msgid ""
"Some XvMC implementations allow more than 8 frames.\n"
"This option, when turned on, makes the driver try to\n"
@@ -5054,11 +4985,11 @@ msgstr ""
"15 kareyi denemesine izin verir. Birleşik renk berraklığı ve canlı VDR için "
"bu yapılmalıdır.\n"
-#: src/video_out/video_out_xxmc.c:2698
+#: src/video_out/video_out_xxmc.c:2745
msgid "Unichrome cpu save"
msgstr "Birleşik Renk Berraklığı işlemci koruması"
-#: src/video_out/video_out_xxmc.c:2699
+#: src/video_out/video_out_xxmc.c:2746
msgid ""
"Saves CPU time by sleeping while decoder works.\n"
"Only for Linux kernel 2.6 series or 2.4 with multimedia patch.\n"
@@ -5069,12 +5000,12 @@ msgstr ""
"birlikte.\n"
"Deneysel.\n"
-#: src/video_out/video_out_xxmc.c:2705
+#: src/video_out/video_out_xxmc.c:2752
#, fuzzy
msgid "Fix buggy NVIDIA XvMC subpicture colours"
msgstr "Sorunlu NVIDIA XvMC altresim renklerini düzeltin."
-#: src/video_out/video_out_xxmc.c:2706
+#: src/video_out/video_out_xxmc.c:2753
#, fuzzy
msgid ""
"There's a bug in NVIDIA's XvMC lib that makes red OSD colours\n"
@@ -5083,11 +5014,11 @@ msgstr ""
"NVIDIA'nın XvMC kütüphanesinde kırmızı OSD renklerinin mavi veya başka\n"
"gözükmelerine sebep olanen bir hata vardır.Bu seçenek temizleme gerektir.\n"
-#: src/video_out/video_out_xxmc.c:2711
+#: src/video_out/video_out_xxmc.c:2758
msgid "Use bob as accelerated deinterlace method."
msgstr "Hızlandırılmış dönüştürme yöntemi olarak bob'u kullanın."
-#: src/video_out/video_out_xxmc.c:2712
+#: src/video_out/video_out_xxmc.c:2759
msgid ""
"When interlacing is enabled for hardware accelerated frames,\n"
"alternate between top and bottom field at double the frame rate.\n"
@@ -5095,11 +5026,11 @@ msgstr ""
"Donanımca hızlandırılmış kareler için dönüştürme devrede olduğunda,\n"
"çerçeve oranındaki üst ve alt alanlara göz atmalı.\n"
-#: src/video_out/video_out_xxmc.c:2718
+#: src/video_out/video_out_xxmc.c:2765
msgid "Don't use bob deinterlacing for progressive frames."
msgstr "İlerleyen kareler için bob dönüştürmeyi kullanmayın."
-#: src/video_out/video_out_xxmc.c:2719
+#: src/video_out/video_out_xxmc.c:2766
msgid ""
"Progressive frames don't need deinterlacing, so disabling it on\n"
"demand should result in a better picture.\n"
@@ -5108,11 +5039,11 @@ msgstr ""
"dışı bırakmak\n"
"daha iyi bir görüntü elde etmenizi sağlayabilir.\n"
-#: src/video_out/video_out_xxmc.c:2725
+#: src/video_out/video_out_xxmc.c:2772
msgid "Don't use bob deinterlacing while a scaled OSD is active."
msgstr "Ayarlanmış OSD etkin olduğunda bob dönüştürmesini kullanmayın."
-#: src/video_out/video_out_xxmc.c:2726
+#: src/video_out/video_out_xxmc.c:2773
msgid ""
"Bob deinterlacing adds some noise to horizontal lines, so disabling it\n"
"on demand should result in a better OSD picture.\n"
@@ -5244,21 +5175,21 @@ msgstr ""
"Sonuç olarak, üstyazımların alfa karışımı eskisine oranla daha iyidir fakat "
"işlemci kullanımı da buna bağlı olarak azalmıştır."
-#: src/xine-engine/audio_decoder.c:370
+#: src/xine-engine/audio_decoder.c:371
#, c-format
msgid "audio_decoder: no plugin available to handle '%s'\n"
msgstr "audio_decoder: kullanılacak bir eklenti yok '%s'\n"
-#: src/xine-engine/audio_decoder.c:387
+#: src/xine-engine/audio_decoder.c:388
#, c-format
msgid "audio_decoder: error, unknown buffer type: %08x\n"
msgstr "audio_decoder: hata, bilinmeyen ön bellek türü: %08x\n"
-#: src/xine-engine/audio_decoder.c:491
+#: src/xine-engine/audio_decoder.c:492
msgid "number of audio buffers"
msgstr "ses ön belleklerinin sayısı"
-#: src/xine-engine/audio_decoder.c:492
+#: src/xine-engine/audio_decoder.c:493
msgid ""
"The number of audio buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5269,38 +5200,38 @@ msgstr ""
"sonucu doğuracağı anlamına gelir, fakat aynı zamanda da gecikme ve bellek "
"tüketiminin artması anlamına da gelir."
-#: src/xine-engine/audio_out.c:1115
+#: src/xine-engine/audio_out.c:1123
#, c-format
msgid ""
"audio_out: delay calculation impossible with an unavailable audio device\n"
msgstr ""
"audio_out: uyumsuz ses aygıtıyla gecikme hesaplaması yapmak olanaksızdır.\n"
-#: src/xine-engine/audio_out.c:1254
+#: src/xine-engine/audio_out.c:1262
#, c-format
msgid "write to sound card failed. Assuming the device was unplugged.\n"
msgstr "ses kartına yazma başarılamadı. Aygıtın bağlı olmadığı varsayılıyor.\n"
-#: src/xine-engine/audio_out.c:1434
+#: src/xine-engine/audio_out.c:1442
#, c-format
msgid "8 bits not supported by driver, converting to 16 bits.\n"
msgstr "8 bit sürücü tarafından desteklenmiyor, onu 16 bit'e çeviriyor.\n"
-#: src/xine-engine/audio_out.c:1442
+#: src/xine-engine/audio_out.c:1450
#, c-format
msgid "mono not supported by driver, converting to stereo.\n"
msgstr "mono sürücü tarafından desteklenmiyor, stereo'ya dönüştürülüyor.\n"
-#: src/xine-engine/audio_out.c:1448
+#: src/xine-engine/audio_out.c:1456
#, c-format
msgid "stereo not supported by driver, converting to mono.\n"
msgstr "stereo sürücü tarafından desteklenmiyor, mono'ya dönüştürülüyor.\n"
-#: src/xine-engine/audio_out.c:2130
+#: src/xine-engine/audio_out.c:2146
msgid "method to sync audio and video"
msgstr "ses ve görüntü arasındaki senkronu sağlama yöntemi"
-#: src/xine-engine/audio_out.c:2131
+#: src/xine-engine/audio_out.c:2147
msgid ""
"When playing audio and video, there are at least two clocks involved: The "
"system clock, to which video frames are synchronized and the clock in your "
@@ -5340,11 +5271,11 @@ msgstr ""
"ses verisinin harici kod çözücü aracılığıyla sayısal biçimlere dönüştürülen "
"sayısal ürünlerde işe yaramaz."
-#: src/xine-engine/audio_out.c:2159
+#: src/xine-engine/audio_out.c:2175
msgid "enable resampling"
msgstr "yeniden örneklemeyi etkinleştir "
-#: src/xine-engine/audio_out.c:2160
+#: src/xine-engine/audio_out.c:2176
msgid ""
"When the sample rate of the decoded audio does not match the capabilities of "
"your sound hardware, an adaptation called \"resampling\" is required. Here "
@@ -5356,11 +5287,11 @@ msgstr ""
"örneklemenin devrede olması veya olmamasını ya da gerektiğinde otomatik "
"olarak devreye girip girmeyeceğini siz seçebilirsiniz."
-#: src/xine-engine/audio_out.c:2167
+#: src/xine-engine/audio_out.c:2183
msgid "always resample to this rate (0 to disable)"
msgstr "daima bu orada yeniden örnekle (devre dışı için 0)"
-#: src/xine-engine/audio_out.c:2168
+#: src/xine-engine/audio_out.c:2184
msgid ""
"Some audio drivers do not correctly announce the capabilities of the audio "
"hardware. By setting a value other than zero here, you can force the audio "
@@ -5370,11 +5301,11 @@ msgstr ""
"bildiremezler. Değeri burada sıfırdan başka bir yere ayarlayarak, ses "
"akışının verilmiş orana yeniden örneklenmesini sağlayabilirsiniz."
-#: src/xine-engine/audio_out.c:2177
+#: src/xine-engine/audio_out.c:2193
msgid "offset for digital passthrough"
msgstr "sayısal dönüşüm için eşitleme"
-#: src/xine-engine/audio_out.c:2178
+#: src/xine-engine/audio_out.c:2194
msgid ""
"If you use an external surround decoder and audio is ahead or behind video, "
"you can enter a fixed offset here to compensate.\n"
@@ -5384,11 +5315,11 @@ msgstr ""
"veya gerisinde ise, dengelemek için buraya sabit bir değer girebilirsiniz.\n"
"Değerin birimi bir PTS tıklamasıdır, ki bu da saniyenin 90000de biridir."
-#: src/xine-engine/audio_out.c:2187
+#: src/xine-engine/audio_out.c:2203
msgid "play audio even on slow/fast speeds"
msgstr "sesi eşit olarak yavaş/hızlı hızlarında çal"
-#: src/xine-engine/audio_out.c:2188
+#: src/xine-engine/audio_out.c:2204
msgid ""
"If you enable this option, the audio will be heard even when playback speed "
"is different than 1X. Of course, it will sound distorted (lower/higher "
@@ -5400,83 +5331,83 @@ msgstr ""
"hızında). Ses bölgesini korumak isterseniz, ses .. eklentisini uzatmayı "
"denemek için deneyebilirsiniz."
-#: src/xine-engine/audio_out.c:2261
+#: src/xine-engine/audio_out.c:2277
msgid "startup audio volume"
msgstr "başlangıç ses düzeyi"
-#: src/xine-engine/audio_out.c:2262
+#: src/xine-engine/audio_out.c:2278
msgid "The overall audio volume set at xine startup."
msgstr "Xine başladığında duyulacak olan ayrıntılı ses gürlüğü ayarı."
-#: src/xine-engine/audio_out.c:2265
+#: src/xine-engine/audio_out.c:2281
msgid "restore volume level at startup"
msgstr "başlangıçtaki ses seviyesini yeniden yapılandır"
-#: src/xine-engine/audio_out.c:2266
+#: src/xine-engine/audio_out.c:2282
msgid "If disabled, xine will not modify any mixer settings at startup."
msgstr ""
"eğer etkin değilse, xine başlangıçta herhangi bir karşıtırıcı ayarı "
"yapmayacaktır."
-#: src/xine-engine/audio_out.c:2298
+#: src/xine-engine/audio_out.c:2314
#, c-format
msgid "audio_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"audio_out: üzgünüm, bu olay yaşanmamalıydı, lütfen xine uygulamasını baştan "
"başlatın.\n"
-#: src/xine-engine/buffer.c:64
+#: src/xine-engine/buffer.c:70
#, c-format
msgid "xine-lib: buffer.c: There has been a fatal error: TOO MANY FREE's\n"
msgstr "xine-lib: buffer.c: Sonlandırıcı bir hata var: TOO MANY FREE's\n"
-#: src/xine-engine/configfile.c:939
+#: src/xine-engine/configfile.c:953
#, c-format
msgid "The current config file has been modified by a newer version of xine."
msgstr ""
"Şu anki yapılandırma dosyası xine'nin daha yeni bir uygulaması tarafından "
"değiştirilmiş durumdadır."
-#: src/xine-engine/configfile.c:992
+#: src/xine-engine/configfile.c:1006
#, c-format
msgid "Loaded configuration from file '%s'\n"
msgstr ""
-#: src/xine-engine/configfile.c:997
+#: src/xine-engine/configfile.c:1011
#, fuzzy, c-format
msgid "Failed to load configuration from file '%s': %s\n"
msgstr "input_dvb: dvb kanal dosyası açılamadı '%s': %s\n"
-#: src/xine-engine/configfile.c:1052
+#: src/xine-engine/configfile.c:1068
#, c-format
msgid "configfile: WARNING: backing up configfile to %s failed\n"
msgstr ""
"configfile: UYARI: configfile dosyasının şuraya %s yedeklenmesi "
"başarılamadı\n"
-#: src/xine-engine/configfile.c:1053
+#: src/xine-engine/configfile.c:1069
#, c-format
msgid "configfile: WARNING: your configuration will not be saved\n"
msgstr "configfile: UYARI: yapılandırmanız kaydedilmeyecektir\n"
-#: src/xine-engine/configfile.c:1153
+#: src/xine-engine/configfile.c:1169
#, c-format
msgid "configfile: WARNING: writing configuration to %s failed\n"
msgstr "configfile: UYARI: yapılandırmanın şuraya %s yazılması başarılamadı\n"
-#: src/xine-engine/configfile.c:1154
+#: src/xine-engine/configfile.c:1170
#, c-format
msgid "configfile: WARNING: removing possibly broken config file %s\n"
msgstr ""
"configfile: UYARI: büyük ihtimaller bozulmuş olan yapılandırma dosyasını "
"kaldırıyor %s\n"
-#: src/xine-engine/configfile.c:1155
+#: src/xine-engine/configfile.c:1171
#, c-format
msgid "configfile: WARNING: you should check the backup file %s\n"
msgstr "configfile: UYARI: yedekleme dosyasını denetlemelisiniz %s\n"
-#: src/xine-engine/configfile.c:1290
+#: src/xine-engine/configfile.c:1633
#, c-format
msgid "configfile: entry '%s' mustn't be modified from MRL\n"
msgstr "configfile: girdi '%s' MRL tarafından değiştirilmiş olmamalı\n"
@@ -5494,58 +5425,58 @@ msgstr ""
"info_helper: desteklenmeyen dönüşüm %s -> UTF-8, hiç bir dönüşüm "
"gerçekleşmedi\n"
-#: src/xine-engine/input_cache.c:170
+#: src/xine-engine/input_cache.c:172
#, c-format
msgid ": open() function should never be called\n"
msgstr ": open() fonksiyonu asla çağrılamaz\n"
-#: src/xine-engine/input_cache.c:353
+#: src/xine-engine/input_cache.c:355
#, c-format
msgid ": input plugin not defined!\n"
msgstr ": girdi eklentisi tanımlanmadı!\n"
-#: src/xine-engine/input_rip.c:138 src/xine-engine/input_rip.c:258
+#: src/xine-engine/input_rip.c:140 src/xine-engine/input_rip.c:260
#, c-format
msgid "input_rip: reading of saved data failed: %s\n"
msgstr "input_rip: kaydedilen veriyi okuma hatası: %s\n"
-#: src/xine-engine/input_rip.c:153
+#: src/xine-engine/input_rip.c:155
#, c-format
msgid "input_rip: reading by input plugin failed\n"
msgstr "input_rip: giriş eklentisini okuma hatası\n"
-#: src/xine-engine/input_rip.c:161 src/xine-engine/input_rip.c:290
-#: src/xine-engine/input_rip.c:655
+#: src/xine-engine/input_rip.c:163 src/xine-engine/input_rip.c:292
+#: src/xine-engine/input_rip.c:657
#, c-format
msgid "input_rip: error writing to file %<PRIdMAX> bytes: %s\n"
msgstr "input_rip: dosyaya yazmada hata %<PRIdMAX> byte: %s\n"
-#: src/xine-engine/input_rip.c:182
+#: src/xine-engine/input_rip.c:184
#, c-format
msgid "input_rip: open() function should never be called\n"
msgstr "input_rip: open() fonksiyonu asla çağrılamaz\n"
-#: src/xine-engine/input_rip.c:313 src/xine-engine/input_rip.c:418
+#: src/xine-engine/input_rip.c:315 src/xine-engine/input_rip.c:420
#, c-format
msgid "input_rip: seeking failed\n"
msgstr "input_rip: aramada hata\n"
-#: src/xine-engine/input_rip.c:370 src/xine-engine/input_rip.c:388
+#: src/xine-engine/input_rip.c:372 src/xine-engine/input_rip.c:390
#, c-format
msgid "input_rip: seeking failed: %s\n"
msgstr "input_rip: aramada hata: %s\n"
-#: src/xine-engine/input_rip.c:396
+#: src/xine-engine/input_rip.c:398
#, c-format
msgid "input_rip: %<PRIdMAX> bytes dropped\n"
msgstr "input_rip: %<PRIdMAX> byte iptal edildi\n"
-#: src/xine-engine/input_rip.c:560
+#: src/xine-engine/input_rip.c:562
#, c-format
msgid "input_rip: input plugin not defined!\n"
msgstr "input_rip: giriÅŸ eklentisi belirtilmedi!\n"
-#: src/xine-engine/input_rip.c:566
+#: src/xine-engine/input_rip.c:568
#, c-format
msgid ""
"input_rip: target directory wasn't specified, please fill out the option "
@@ -5554,7 +5485,7 @@ msgstr ""
"input_rip: hedef dizin belirtilmedi, lütfen 'media.capture.save_dir' "
"seçeneğini yayınız\n"
-#: src/xine-engine/input_rip.c:568
+#: src/xine-engine/input_rip.c:570
msgid ""
"The stream save feature is disabled until you set media.capture.save_dir in "
"the configuration."
@@ -5562,12 +5493,12 @@ msgstr ""
"Yapılandırmada siz media.capture.save_dir ayarını yapana kadar, yayın "
"akışını kaydet seçeneği devre dışı bırakıldı."
-#: src/xine-engine/input_rip.c:575
+#: src/xine-engine/input_rip.c:577
#, c-format
msgid "input_rip: ripping/caching of this source is not permitted!\n"
msgstr "input_rip: bu kaynağın açılması/belleğe alınmasına izin verilmedi!\n"
-#: src/xine-engine/input_rip.c:577
+#: src/xine-engine/input_rip.c:579
msgid ""
"xine is not allowed to save from this source. (possibly copyrighted "
"material?)"
@@ -5575,51 +5506,51 @@ msgstr ""
"xine bu kaynaktan kaydedilmesine izin vermedi. (bir ihtimal telif hakları "
"ile korunmuÅŸ malzeme?)"
-#: src/xine-engine/input_rip.c:583
+#: src/xine-engine/input_rip.c:585
#, c-format
msgid "input_rip: file name not given!\n"
msgstr "input_rip: dosya adı verilmemiş!\n"
-#: src/xine-engine/input_rip.c:625
+#: src/xine-engine/input_rip.c:627
#, c-format
msgid "input_rip: error opening file %s: %s\n"
msgstr "input_rip: %s dosyası açılırken hata oluştu: %s\n"
-#: src/xine-engine/io_helper.c:252
+#: src/xine-engine/io_helper.c:254
#, c-format
msgid "io_helper: waiting abandoned\n"
msgstr "io_helper: bekleme bırakıldı\n"
-#: src/xine-engine/io_helper.c:259
+#: src/xine-engine/io_helper.c:261
#, c-format
msgid "io_helper: waiting failed: %s\n"
msgstr "io_helper: bekleme başarısız oldu: %s\n"
-#: src/xine-engine/io_helper.c:314
+#: src/xine-engine/io_helper.c:316
msgid "failed to get status of socket"
msgstr "soket durumu alınamadı"
-#: src/xine-engine/io_helper.c:388
+#: src/xine-engine/io_helper.c:391
#, c-format
msgid "io_helper: Permission denied\n"
msgstr "io_helper: İzin verilmedi\n"
-#: src/xine-engine/io_helper.c:392
+#: src/xine-engine/io_helper.c:395
#, c-format
msgid "io_helper: File not found\n"
msgstr "io_helper: Dosya bulunamadı\n"
-#: src/xine-engine/io_helper.c:396
+#: src/xine-engine/io_helper.c:399
#, c-format
msgid "io_helper: Connection Refused\n"
msgstr "io_helper: Bağlantı Reddedildi\n"
-#: src/xine-engine/load_plugins.c:208
+#: src/xine-engine/load_plugins.c:216
#, c-format
msgid "map_decoder_list: no space for decoder, skipped.\n"
msgstr "map_decoder_list: kod çözücü için yer yok, atlandı.\n"
-#: src/xine-engine/load_plugins.c:322
+#: src/xine-engine/load_plugins.c:331
#, c-format
msgid ""
"load_plugins: ignoring plugin %s, wrong iface version %d (should be %d)\n"
@@ -5627,12 +5558,12 @@ msgstr ""
"load_plugins: eklentileri göz ardı ediyor %s, yanlış iface sürümü %d "
"(olması gereken %d)\n"
-#: src/xine-engine/load_plugins.c:384
+#: src/xine-engine/load_plugins.c:391
#, c-format
msgid "priority for %s decoder"
msgstr "%s kod çözücü için öncelik"
-#: src/xine-engine/load_plugins.c:389
+#: src/xine-engine/load_plugins.c:396
msgid ""
"The priority provides a ranking in case some media can be handled by more "
"than one decoder.\n"
@@ -5642,7 +5573,7 @@ msgstr ""
"uğraşacağı göz önüne alınarak sınıflandırılır.\n"
"0 önceliği kod çözücünün öntanımlı önceliğini ektinleştirir."
-#: src/xine-engine/load_plugins.c:417
+#: src/xine-engine/load_plugins.c:424
#, c-format
msgid ""
"load_plugins: demuxer plugin %s does not provide a priority, xine-lib will "
@@ -5651,7 +5582,7 @@ msgstr ""
"load_plugins: demuxer eklentisi %s öncelik sağlamaz, xine-lib öntanımlı "
"önceliği kullanacak.\n"
-#: src/xine-engine/load_plugins.c:434
+#: src/xine-engine/load_plugins.c:441
#, c-format
msgid ""
"load_plugins: input plugin %s does not provide a priority, xine-lib will use "
@@ -5660,42 +5591,42 @@ msgstr ""
"load_plugins: giriş eklentisi %s öncelik sağlamaz, xine-lib öntanımlı "
"önceliği kullanacak.\n"
-#: src/xine-engine/load_plugins.c:490
+#: src/xine-engine/load_plugins.c:498
#, c-format
msgid "load_plugins: plugin %s found\n"
msgstr "load_plugins: %s eklentisi bulundu\n"
-#: src/xine-engine/load_plugins.c:493
+#: src/xine-engine/load_plugins.c:501
#, c-format
msgid "load_plugins: static plugin found\n"
msgstr "load_plugins: sabit eklenti bulundu\n"
-#: src/xine-engine/load_plugins.c:500
+#: src/xine-engine/load_plugins.c:508
#, c-format
msgid "load_plugins: plugin limit reached, %s could not be loaded\n"
msgstr "load_plugins: eklenti sınırına ulaşıldı, %s yüklenemez\n"
-#: src/xine-engine/load_plugins.c:503
+#: src/xine-engine/load_plugins.c:511
#, c-format
msgid "load_plugins: plugin limit reached, static plugin could not be loaded\n"
msgstr "load_plugins: eklenti sınırına ulaşıldı, statik eklenti yüklenemez\n"
-#: src/xine-engine/load_plugins.c:520
+#: src/xine-engine/load_plugins.c:528
#, c-format
msgid "load_plugins: unknown plugin type %d in %s\n"
msgstr "load_plugins: bilinmeyen eklenti türü %d in %s\n"
-#: src/xine-engine/load_plugins.c:524
+#: src/xine-engine/load_plugins.c:532
#, c-format
msgid "load_plugins: unknown statically linked plugin type %d\n"
msgstr "load_plugins: bilinmeyen statik bağlantılı eklenti türü %d\n"
-#: src/xine-engine/load_plugins.c:579
+#: src/xine-engine/load_plugins.c:589
#, c-format
msgid "load_plugins: unable to stat %s\n"
msgstr "load_plugins: stat yapamaz %s\n"
-#: src/xine-engine/load_plugins.c:620
+#: src/xine-engine/load_plugins.c:631
#, c-format
msgid ""
"load_plugins: cannot open plugin lib %s:\n"
@@ -5704,7 +5635,7 @@ msgstr ""
"load_plugins: eklenti kütüphanesini açamıyor %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:635
+#: src/xine-engine/load_plugins.c:646
#, c-format
msgid ""
"load_plugins: can't get plugin info from %s:\n"
@@ -5713,12 +5644,12 @@ msgstr ""
"load_plugins: ekleni bilgisini ÅŸuradan alabilir %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:653
+#: src/xine-engine/load_plugins.c:664
#, c-format
msgid "load_plugins: skipping unreadable plugin directory %s.\n"
msgstr "load_plugins: okunamayan eklenti dizinini atlıyor %s.\n"
-#: src/xine-engine/load_plugins.c:702
+#: src/xine-engine/load_plugins.c:732
#, c-format
msgid ""
"load_plugins: cannot (stage 2) open plugin lib %s:\n"
@@ -5727,42 +5658,47 @@ msgstr ""
"load_plugins: eklenti (aşama 2) eklenti kütüphanesini açamıyor %s:\n"
"%s\n"
-#: src/xine-engine/load_plugins.c:728
+#: src/xine-engine/load_plugins.c:766
#, c-format
msgid "load_plugins: Yikes! %s doesn't contain plugin info.\n"
msgstr "load_plugins: Aman! %s eklenti bilgisi yok.\n"
-#: src/xine-engine/load_plugins.c:1092
+#: src/xine-engine/load_plugins.c:1170 src/xine-engine/load_plugins.c:1179
+#, fuzzy, c-format
+msgid "Unable to create %s directory: %s\n"
+msgstr "Doğrudan ses nesnesi oluşturulamadı."
+
+#: src/xine-engine/load_plugins.c:1217
#, c-format
msgid "failed to save catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1099
+#: src/xine-engine/load_plugins.c:1224
#, c-format
msgid "failed to replace catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1105
+#: src/xine-engine/load_plugins.c:1230
#, c-format
msgid "failed to remove new catalogue cache: %s\n"
msgstr ""
-#: src/xine-engine/load_plugins.c:1362
+#: src/xine-engine/load_plugins.c:1492
#, c-format
msgid "load_plugins: unknown content detection strategy %d\n"
msgstr "load_plugins: bilinmeyen içerik bulma yöntemi %d\n"
-#: src/xine-engine/load_plugins.c:1472
+#: src/xine-engine/load_plugins.c:1617
#, c-format
msgid "load_plugins: using demuxer '%s'\n"
msgstr "load_plugins: demuxer eklentisini kullanıyor '%s'\n"
-#: src/xine-engine/load_plugins.c:1798 src/xine-engine/load_plugins.c:1845
+#: src/xine-engine/load_plugins.c:1939 src/xine-engine/load_plugins.c:1986
#, c-format
msgid "load_plugins: failed to load audio output plugin <%s>\n"
msgstr "load_plugins: ses çıkış eklentisini yüklemede hata <%s>\n"
-#: src/xine-engine/load_plugins.c:1848
+#: src/xine-engine/load_plugins.c:1989
#, c-format
msgid ""
"load_plugins: audio output auto-probing didn't find any usable audio "
@@ -5771,7 +5707,7 @@ msgstr ""
"load_plugins: ses çıktısı otomatik bulma işlemi kullanılabilir bir sürücü "
"bulamadı.\n"
-#: src/xine-engine/load_plugins.c:2152
+#: src/xine-engine/load_plugins.c:2299
#, c-format
msgid ""
"load_plugins: cannot unload plugin lib %s:\n"
@@ -5780,54 +5716,54 @@ msgstr ""
"load_plugins: eklenti kütüphanesi %s kaldırılamadı:\n"
"%s\n"
-#: src/xine-engine/osd.c:738
+#: src/xine-engine/osd.c:934
#, c-format
msgid "font '%s-%d' already loaded, weird.\n"
msgstr "'%s-%d' yazı tipi zaten yüklü.\n"
-#: src/xine-engine/osd.c:750
+#: src/xine-engine/osd.c:946
#, c-format
msgid "font '%s' loading failed (%d < %d)\n"
msgstr "'%s' yazı tipi yüklenemedi (%d < %d)\n"
-#: src/xine-engine/osd.c:760
+#: src/xine-engine/osd.c:956
#, c-format
msgid "wrong version for font '%s'. expected %d found %d.\n"
msgstr "'%s' yazı tipi için yanlış sürüm. beklenen %d bulunan %d.\n"
-#: src/xine-engine/osd.c:827
-#, c-format
-msgid "osd: cannot initialize ft2 library\n"
-msgstr "osd: ft2 kütüphanesi başlatılamadı\n"
-
-#: src/xine-engine/osd.c:855
+#: src/xine-engine/osd.c:1043
#, c-format
msgid "osd: error matching font %s with FontConfig"
msgstr "osd: %s yazı tipi FontConfig ile eşlenirken hata oluştu"
-#: src/xine-engine/osd.c:869
+#: src/xine-engine/osd.c:1057
#, c-format
msgid "osd: error loading font %s with FontConfig"
msgstr "osd: %s yazı tipi FontConfig ile yüklenirken hata oluştu"
-#: src/xine-engine/osd.c:872
+#: src/xine-engine/osd.c:1061
#, c-format
msgid "osd: error looking up font %s with FontConfig"
msgstr "osd: %s yazı tipine FontConfig ile bakılırken hata oluştu"
-#: src/xine-engine/osd.c:893
-#, c-format
-msgid "osd: error loading font %s with ft2\n"
+#: src/xine-engine/osd.c:1101
+#, fuzzy, c-format
+msgid "osd: error loading font %s with in XDG data directories.\n"
msgstr "osd: %s yazı tipi ft2 ile yüklenirken hata oluştu\n"
-#: src/xine-engine/osd.c:902
+#: src/xine-engine/osd.c:1110
+#, c-format
+msgid "osd: cannot initialize ft2 library\n"
+msgstr "osd: ft2 kütüphanesi başlatılamadı\n"
+
+#: src/xine-engine/osd.c:1136
#, c-format
msgid "osd: error setting font size (no scalable font?)\n"
msgstr ""
"osd: yazı tipi boyutu ayarlama hatası (boyutlandırılabilir yazı tipi yok "
"mudur?)\n"
-#: src/xine-engine/osd.c:1017
+#: src/xine-engine/osd.c:1251
#, c-format
msgid ""
"osd: unknown sequence starting with byte 0x%02X in encoding \"%s\", "
@@ -5836,46 +5772,46 @@ msgstr ""
"osd: 0x%02X ile başlayan ve \"%s\" kodlamasında bulunan bilinmeyen sıralama, "
"atlanıyor\n"
-#: src/xine-engine/osd.c:1073
+#: src/xine-engine/osd.c:1307
#, c-format
msgid "osd: can't find out current locale character set\n"
msgstr "osd: yerel karakter seti anlaşılamadı\n"
-#: src/xine-engine/osd.c:1083
+#: src/xine-engine/osd.c:1317
#, c-format
msgid "osd: unsupported conversion %s -> %s, no conversion performed\n"
msgstr "osd: desteklenmeyen dönüşüm %s -> %s, dönüşüm yapılmadı\n"
-#: src/xine-engine/osd.c:1138 src/xine-engine/osd.c:1306
+#: src/xine-engine/osd.c:1372 src/xine-engine/osd.c:1541
#, c-format
msgid "osd: font isn't defined\n"
msgstr "osd: yazı tipi belirtilmedi\n"
-#: src/xine-engine/osd.c:1177
+#: src/xine-engine/osd.c:1412
#, c-format
msgid "osd: error loading glyph\n"
msgstr "osd: glyph yüklenirken hata oluştu\n"
-#: src/xine-engine/osd.c:1183
+#: src/xine-engine/osd.c:1418
#, c-format
msgid "osd: error in rendering glyph\n"
msgstr "osd: glyph hazırlanırken hata oluştu\n"
-#: src/xine-engine/osd.c:1343
+#: src/xine-engine/osd.c:1578
#, c-format
msgid "osd: error loading glyph %i\n"
msgstr "osd: glyph %i yüklenirken hata oluştu\n"
-#: src/xine-engine/osd.c:1350
+#: src/xine-engine/osd.c:1585
#, c-format
msgid "osd: error in rendering\n"
msgstr "osd: hazırlama hatası\n"
-#: src/xine-engine/osd.c:1596
+#: src/xine-engine/osd.c:1890
msgid "palette (foreground-border-background) to use for subtitles and OSD"
msgstr "Altyazılar ve OSD için kullanılacak palet (ön yüz-sınır-arka plan)"
-#: src/xine-engine/osd.c:1597
+#: src/xine-engine/osd.c:1891
msgid ""
"The palette for on-screen-display and some subtitle formats that do not "
"specify any colouring themselves. The palettes are listed in the form: "
@@ -5885,11 +5821,19 @@ msgstr ""
"renklendirmelerini belirlemezler. Paletler formda listelenmiştir: ün yüz-"
"sınır-arka plan."
-#: src/xine-engine/video_decoder.c:135
-msgid "disable decoder flush at discontinuity"
+#: src/xine-engine/spu.c:36
+msgid "opacity for the black parts of bitmapped subtitles"
+msgstr ""
+
+#: src/xine-engine/spu.c:41
+msgid "opacity for the colour parts of bitmapped subtitles"
msgstr ""
#: src/xine-engine/video_decoder.c:136
+msgid "disable decoder flush at discontinuity"
+msgstr ""
+
+#: src/xine-engine/video_decoder.c:137
msgid ""
"when watching live tv a discontinuity happens for example about every 26.5 "
"hours due to a pts wrap.\n"
@@ -5904,21 +5848,21 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_decoder.c:419
+#: src/xine-engine/video_decoder.c:420
#, c-format
msgid "video_decoder: no plugin available to handle '%s'\n"
msgstr "video_decoder: '%s' dosyasını işleyebilmek için uygun eklenti yok\n"
-#: src/xine-engine/video_decoder.c:498
+#: src/xine-engine/video_decoder.c:499
#, c-format
msgid "video_decoder: error, unknown buffer type: %08x\n"
msgstr "video_decoder: hata, bilinmeyen tampon bellek türü: %08x\n"
-#: src/xine-engine/video_decoder.c:536
+#: src/xine-engine/video_decoder.c:537
msgid "number of video buffers"
msgstr "video tamponlarının sayısı"
-#: src/xine-engine/video_decoder.c:537
+#: src/xine-engine/video_decoder.c:538
msgid ""
"The number of video buffers (each is 8k in size) xine uses in its internal "
"queue. Higher values mean smoother playback for unreliable inputs, but also "
@@ -5929,12 +5873,12 @@ msgstr ""
"sonucu doğuracağı anlamına gelir, fakat aynı zamanda da gecikme ve bellek "
"tüketiminin artması anlamına da gelir."
-#: src/xine-engine/video_out.c:670
+#: src/xine-engine/video_out.c:978
#, c-format
msgid "%d frames delivered, %d frames skipped, %d frames discarded\n"
msgstr "%d kare alındı, %d kare atlandı, %d kare atıldı\n"
-#: src/xine-engine/video_out.c:845
+#: src/xine-engine/video_out.c:1153
#, c-format
msgid ""
"video_out: throwing away image with pts %<PRId64> because it's too old "
@@ -5943,16 +5887,16 @@ msgstr ""
"video_out: resmi pts ile atıyor %<PRId64> çünkü çok eski (diff : "
"%<PRId64>).\n"
-#: src/xine-engine/video_out.c:872
+#: src/xine-engine/video_out.c:1180
#, c-format
msgid "video_out: just discarded first frame after seek\n"
msgstr ""
-#: src/xine-engine/video_out.c:1172
+#: src/xine-engine/video_out.c:1508
msgid "disable decoder flush from video out"
msgstr ""
-#: src/xine-engine/video_out.c:1173
+#: src/xine-engine/video_out.c:1509
msgid ""
"video out causes a decoder flush when video out runs out of frames for "
"displaying,\n"
@@ -5968,11 +5912,11 @@ msgid ""
"differently meanwhile.\n"
msgstr ""
-#: src/xine-engine/video_out.c:1860
+#: src/xine-engine/video_out.c:2246
msgid "default number of video frames"
msgstr "video çerçevelerinin öntanımlı sayısı"
-#: src/xine-engine/video_out.c:1861
+#: src/xine-engine/video_out.c:2247
msgid ""
"The default number of video frames to request from xine video out driver. "
"Some drivers will override this setting with their own values."
@@ -5981,11 +5925,11 @@ msgstr ""
"sayısı. Bazı sürücüler kendi değerlerini koruyarak bu ayara önem "
"vermeyecektir."
-#: src/xine-engine/video_out.c:1918
+#: src/xine-engine/video_out.c:2304
msgid "percentage of skipped frames to tolerate"
msgstr "görmezden gelinecek atlanan çerçeve sayısı"
-#: src/xine-engine/video_out.c:1919
+#: src/xine-engine/video_out.c:2305
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not decoded in time, xine sends a notification."
@@ -5993,11 +5937,11 @@ msgstr ""
"Bu çerçeve oranlarından daha fazlası gösterilmezse, zamanında "
"kodlanmadıklarındandır, xine bir uyarı gönderir."
-#: src/xine-engine/video_out.c:1924
+#: src/xine-engine/video_out.c:2310
msgid "percentage of discarded frames to tolerate"
msgstr "görmezden gelinecek yoksayılan çerçeve sayısı"
-#: src/xine-engine/video_out.c:1925
+#: src/xine-engine/video_out.c:2311
msgid ""
"When more than this percentage of frames are not shown, because they were "
"not scheduled for display in time, xine sends a notification."
@@ -6005,18 +5949,18 @@ msgstr ""
"Bu çerçeve oranlarından daha fazlası gösterilmezse, zamanında "
"görüntülenmeleri için programlanmadıklarındandır, xine bir uyarı gönderir."
-#: src/xine-engine/video_out.c:1961
+#: src/xine-engine/video_out.c:2350
#, c-format
msgid "video_out: sorry, this should not happen. please restart xine.\n"
msgstr ""
"video_out: üzgünüm, bu olmamalıydı. lütfen xine uygulamasını yeniden "
"başlatın.\n"
-#: src/xine-engine/vo_scale.c:391
+#: src/xine-engine/vo_scale.c:384
msgid "horizontal image position in the output window"
msgstr "çıktı penceresindeki yatay resim konumu"
-#: src/xine-engine/vo_scale.c:392
+#: src/xine-engine/vo_scale.c:385
msgid ""
"If the video window's horizontal size is bigger than the actual image to "
"show, you can adjust the position where the image will be placed.\n"
@@ -6028,11 +5972,11 @@ msgstr ""
"Konum yüzdesel olarak verilmiştir, böylece 50 değeri \"ortada\", 0 değeri "
"\"çok solda\" ve 100 değeri \"çok sağda\" anlamına gelecektir."
-#: src/xine-engine/vo_scale.c:399
+#: src/xine-engine/vo_scale.c:392
msgid "vertical image position in the output window"
msgstr "çıktı penceresindeki dikey resim konumu"
-#: src/xine-engine/vo_scale.c:400
+#: src/xine-engine/vo_scale.c:393
msgid ""
"If the video window's vertical size is bigger than the actual image to show, "
"you can adjust the position where the image will be placed.\n"
@@ -6044,11 +5988,11 @@ msgstr ""
"Konum yüzdesel olarak verilmiştir, böylece 50 değeri \"ortada\", 0 değeri "
"\"yukarıda\" ve 100 değeri \"aşağıda\" anlamına gelecektir."
-#: src/xine-engine/vo_scale.c:407
+#: src/xine-engine/vo_scale.c:400
msgid "disable all video scaling"
msgstr "tüm video ölçeklemelerini pasifleştir"
-#: src/xine-engine/vo_scale.c:408
+#: src/xine-engine/vo_scale.c:401
msgid ""
"If you want the video image to be always shown at its original resolution, "
"you can disable all image scaling here.\n"
@@ -6067,146 +6011,146 @@ msgstr ""
"gibi bazı video sürücülerinin resim ölçeklemesi donanım hızlandırmalı "
"olmadığı için, bu işlemci kullanımını dramatik olarak azaltacaktır."
-#: src/xine-engine/xine.c:816 src/xine-engine/xine.c:937
-#: src/xine-engine/xine.c:977 src/xine-engine/xine.c:1013
-#: src/xine-engine/xine.c:1025 src/xine-engine/xine.c:1038
-#: src/xine-engine/xine.c:1051 src/xine-engine/xine.c:1064
-#: src/xine-engine/xine.c:1090 src/xine-engine/xine.c:1115
-#: src/xine-engine/xine.c:1152
+#: src/xine-engine/xine.c:859 src/xine-engine/xine.c:981
+#: src/xine-engine/xine.c:1021 src/xine-engine/xine.c:1057
+#: src/xine-engine/xine.c:1069 src/xine-engine/xine.c:1082
+#: src/xine-engine/xine.c:1095 src/xine-engine/xine.c:1108
+#: src/xine-engine/xine.c:1134 src/xine-engine/xine.c:1159
+#: src/xine-engine/xine.c:1196
#, c-format
msgid "xine: error while parsing mrl\n"
msgstr "xine: mrl ayrıştırma hatası\n"
-#: src/xine-engine/xine.c:875
+#: src/xine-engine/xine.c:918
#, c-format
msgid "xine: found input plugin : %s\n"
msgstr "xine: bulunan girdi eklentisi : %s\n"
-#: src/xine-engine/xine.c:891
+#: src/xine-engine/xine.c:935
#, c-format
msgid "xine: input plugin cannot open MRL [%s]\n"
msgstr "xine: girdi eklentisi MRL [%s] dosyasını açamadı\n"
-#: src/xine-engine/xine.c:900
+#: src/xine-engine/xine.c:944
#, c-format
msgid "xine: cannot find input plugin for MRL [%s]\n"
msgstr "xine: MRL [%s] için girdi eklentisi bulunamadı\n"
-#: src/xine-engine/xine.c:926
+#: src/xine-engine/xine.c:970
#, c-format
msgid "xine: specified demuxer %s failed to start\n"
msgstr "xine: belirlenmiş demuxer %s başlatılamadı\n"
-#: src/xine-engine/xine.c:963
+#: src/xine-engine/xine.c:1007
#, c-format
msgid "xine: join rip input plugin\n"
msgstr "xine: hızlı giriş eklentisini ekle\n"
-#: src/xine-engine/xine.c:970
+#: src/xine-engine/xine.c:1014
#, c-format
msgid "xine: error opening rip input plugin instance\n"
msgstr "xine: hızlı giriş eklentisini açmada hata\n"
-#: src/xine-engine/xine.c:1001
+#: src/xine-engine/xine.c:1045
#, c-format
msgid "xine: last_probed demuxer %s failed to start\n"
msgstr "xine: en son_kullanılan demuxer %s başlatılamadı\n"
-#: src/xine-engine/xine.c:1030
+#: src/xine-engine/xine.c:1074
#, c-format
msgid "ignoring video\n"
msgstr "video yoksayılıyor\n"
-#: src/xine-engine/xine.c:1043
+#: src/xine-engine/xine.c:1087
#, c-format
msgid "ignoring audio\n"
msgstr "ses yoksayılıyor\n"
-#: src/xine-engine/xine.c:1056
+#: src/xine-engine/xine.c:1100
#, c-format
msgid "ignoring subpicture\n"
msgstr "altresmi göz ardı ediyor\n"
-#: src/xine-engine/xine.c:1069
+#: src/xine-engine/xine.c:1113
#, c-format
msgid "input cache plugin disabled\n"
msgstr "girdi önbellek eklentisi pasifleştirildi\n"
-#: src/xine-engine/xine.c:1142
+#: src/xine-engine/xine.c:1186
#, c-format
msgid "subtitle mrl opened '%s'\n"
msgstr "alt yazı mrl dosyası '%s' açıldı\n"
-#: src/xine-engine/xine.c:1146
+#: src/xine-engine/xine.c:1190
#, c-format
msgid "xine: error opening subtitle mrl\n"
msgstr "xine: alt yazı mrl dosyası açılırken hata oluştu\n"
-#: src/xine-engine/xine.c:1178
+#: src/xine-engine/xine.c:1222
#, c-format
msgid "xine: error while parsing MRL\n"
msgstr "xine: MRL ayrıştırılırken hata oluştu\n"
-#: src/xine-engine/xine.c:1185
+#: src/xine-engine/xine.c:1229
#, c-format
msgid "xine: changing option '%s' from MRL isn't permitted\n"
msgstr ""
"xine: MRL dosyasındaki '%s' seçeneğinin değiştirilmesine izin verilmiyor\n"
-#: src/xine-engine/xine.c:1216
+#: src/xine-engine/xine.c:1260
#, fuzzy, c-format
msgid "xine: couldn't load plugin-specified demux %s for >%s<\n"
msgstr "xine: demux bunun için bulunamıyor >%s<\n"
-#: src/xine-engine/xine.c:1226
+#: src/xine-engine/xine.c:1270
#, c-format
msgid "xine: couldn't find demux for >%s<\n"
msgstr "xine: demux bunun için bulunamıyor >%s<\n"
-#: src/xine-engine/xine.c:1242
+#: src/xine-engine/xine.c:1286
#, c-format
msgid "xine: found demuxer plugin: %s\n"
msgstr "xine: demuxer eklentisi bulundu: %s\n"
-#: src/xine-engine/xine.c:1263
+#: src/xine-engine/xine.c:1308
#, c-format
msgid "xine: demuxer is already done. that was fast!\n"
msgstr "xine: demuxer hazır durumda. bu hızlıydı!\n"
-#: src/xine-engine/xine.c:1265
+#: src/xine-engine/xine.c:1310
#, c-format
msgid "xine: demuxer failed to start\n"
msgstr "xine: demuxer başlatılamadı\n"
-#: src/xine-engine/xine.c:1331
+#: src/xine-engine/xine.c:1376
#, c-format
msgid "xine_play: no demux available\n"
msgstr "xine_play: hiç bir demux uygun değil\n"
-#: src/xine-engine/xine.c:1402
+#: src/xine-engine/xine.c:1447
#, c-format
msgid "xine_play: demux failed to start\n"
msgstr "xine_play: demux başlatılamadı\n"
-#: src/xine-engine/xine.c:1684
+#: src/xine-engine/xine.c:1732
#, c-format
msgid "xine: The specified save_dir \"%s\" might be a security risk.\n"
msgstr "xine: Belirtilen save_dir \"%s\" bir güvenlik riski oluşturabilir.\n"
-#: src/xine-engine/xine.c:1689
+#: src/xine-engine/xine.c:1737
msgid "The specified save_dir might be a security risk."
msgstr "Belirtilen save_dir bir güvenlik riski oluşturabilir."
-#: src/xine-engine/xine.c:1720
+#: src/xine-engine/xine.c:1771
#, c-format
msgid "xine: locale not supported by C library\n"
msgstr "xine: sistem yereliniz C kütüphanesi tarafından desteklenmiyor\n"
-#: src/xine-engine/xine.c:1729
+#: src/xine-engine/xine.c:1780
msgid "media format detection strategy"
msgstr "ortam biçimi belirleme yöntemi"
-#: src/xine-engine/xine.c:1730
+#: src/xine-engine/xine.c:1781
msgid ""
"xine offers various methods to detect the media format of input to play. The "
"individual values are:\n"
@@ -6238,11 +6182,11 @@ msgstr ""
"extension\n"
"Sadece dosya adı uzantısından tanır.\n"
-#: src/xine-engine/xine.c:1748
+#: src/xine-engine/xine.c:1799
msgid "directory for saving streams"
msgstr "yayınların kaydedileceği dizin"
-#: src/xine-engine/xine.c:1749
+#: src/xine-engine/xine.c:1800
msgid ""
"When using the stream save feature, files will be written only into this "
"directory.\n"
@@ -6258,13 +6202,13 @@ msgstr ""
"Bu yüzden, belirttiğiniz dizinin her türlü içeriğe karşı dirençli olmasına "
"özen göstermelisiniz."
-#: src/xine-engine/xine.c:1760
+#: src/xine-engine/xine.c:1811
msgid "allow implicit changes to the configuration (e.g. by MRL)"
msgstr ""
"yapılandırmada kesin değişikliklere izin ver (örn. MRL tarafından yapılan "
"deÄŸiÅŸikliklere)"
-#: src/xine-engine/xine.c:1761
+#: src/xine-engine/xine.c:1812
msgid ""
"If enabled, you allow xine to change your configuration without explicit "
"actions from your side. For example configuration changes demanded by MRLs "
@@ -6282,11 +6226,11 @@ msgstr ""
"yapılandırmanızı kendi istedikleri gibi değiştirmelerine izin verirseniz, "
"xine'nin tamamen iÅŸleri berbat etmesiyle her ÅŸey sona erebilir."
-#: src/xine-engine/xine.c:1775
+#: src/xine-engine/xine.c:1826
msgid "Timeout for network stream reading (in seconds)"
msgstr "Ağ yayını okumada zaman aşımı (saniye olarak)"
-#: src/xine-engine/xine.c:1776
+#: src/xine-engine/xine.c:1827
msgid ""
"Specifies the timeout when reading from network streams, in seconds. Too low "
"values might stop streaming when the source is slow or the bandwidth is "
@@ -6297,75 +6241,75 @@ msgstr ""
"akışını durdurabilir, çok yüksek değerler ise bağlantı kesilirse çalıcının "
"donmasına neden olabilir."
-#: src/xine-engine/xine.c:2233
+#: src/xine-engine/xine.c:2305
msgid "messages"
msgstr "iletiler"
-#: src/xine-engine/xine.c:2234
+#: src/xine-engine/xine.c:2306
msgid "plugin"
msgstr "eklenti"
-#: src/xine-engine/xine.c:2235
+#: src/xine-engine/xine.c:2307
msgid "trace"
msgstr "iz"
-#: src/xine-engine/xine_interface.c:962
+#: src/xine-engine/xine_interface.c:971
msgid "Warning:"
msgstr "Uyarı:"
-#: src/xine-engine/xine_interface.c:963
+#: src/xine-engine/xine_interface.c:972
msgid "Unknown host:"
msgstr "Bilinmeyen makine:"
-#: src/xine-engine/xine_interface.c:964
+#: src/xine-engine/xine_interface.c:973
msgid "Unknown device:"
msgstr "Bilinmeyen aygıt:"
-#: src/xine-engine/xine_interface.c:965
+#: src/xine-engine/xine_interface.c:974
msgid "Network unreachable"
msgstr "AÄŸ eriÅŸilebilir deÄŸil"
-#: src/xine-engine/xine_interface.c:966
+#: src/xine-engine/xine_interface.c:975
msgid "Connection refused:"
msgstr "Bağlantı reddedildi:"
-#: src/xine-engine/xine_interface.c:967
+#: src/xine-engine/xine_interface.c:976
msgid "File not found:"
msgstr "Dosya bulunamadı:"
-#: src/xine-engine/xine_interface.c:968
+#: src/xine-engine/xine_interface.c:977
msgid "Read error from:"
msgstr "Okuma hatası alınan konum:"
-#: src/xine-engine/xine_interface.c:969
+#: src/xine-engine/xine_interface.c:978
msgid "Error loading library:"
msgstr "Kütüphane yükleme hatası:"
-#: src/xine-engine/xine_interface.c:970
+#: src/xine-engine/xine_interface.c:979
msgid "Encrypted media stream detected"
msgstr "Şifrelenmiş ortam yayını bulundu"
-#: src/xine-engine/xine_interface.c:971
+#: src/xine-engine/xine_interface.c:980
msgid "Security message:"
msgstr "Güvenlik iletisi:"
-#: src/xine-engine/xine_interface.c:972
+#: src/xine-engine/xine_interface.c:981
msgid "Audio device unavailable"
msgstr "Ses aygıtı kullanılamaz"
-#: src/xine-engine/xine_interface.c:973
+#: src/xine-engine/xine_interface.c:982
msgid "Permission error"
msgstr "Yetki hatası"
-#: src/xine-engine/xine_interface.c:974
+#: src/xine-engine/xine_interface.c:983
msgid "File is empty:"
msgstr "Dosya boÅŸ:"
-#: src/xine-utils/memcpy.c:481
+#: src/xine-utils/memcpy.c:492
msgid "memcopy method used by xine"
msgstr "xine tarafından kullanılan memcopy metodu"
-#: src/xine-utils/memcpy.c:482
+#: src/xine-utils/memcpy.c:493
msgid ""
"The copying of large memory blocks is one of the most expensive operations "
"on todays computers. Therefore xine provides various tuned methods to do "
@@ -6376,7 +6320,7 @@ msgstr ""
"farklı ayarlanmış yöntemler sunar. Genellikle, en iyi yöntem otomatik olarak "
"algılanacaktır."
-#: src/xine-utils/memcpy.c:509
+#: src/xine-utils/memcpy.c:520
#, c-format
msgid "Benchmarking memcpy methods (smaller is better):\n"
msgstr "Memcpy karşılaştırma yöntemleri (daha küçük olan daha iyidir):\n"
diff --git a/src/Makefile.am b/src/Makefile.am
index 5d21a97eb..a5a3d9d0f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
# Order is important be careful changing SUBDIRS
@@ -5,27 +6,15 @@ SUBDIRS = \
xine-utils \
xine-engine \
audio_out \
+ audio_dec \
video_out \
+ video_dec \
+ spu_dec \
dxr3 \
input \
demuxers \
- libffmpeg \
- libmpeg2 \
- libmpeg2new \
- liba52 \
- libspudec \
- libspucc \
- libspucmml \
- libspudvb \
- libspuhdmv \
- libsputext \
- libdts \
- libmad \
libw32dll \
- libxinevdec \
- libxineadec \
libreal \
- libfaad \
- libmusepack \
post \
- combined
+ combined \
+ vdr
diff --git a/src/audio_dec/Makefile.am b/src/audio_dec/Makefile.am
new file mode 100644
index 000000000..1d6dbaddc
--- /dev/null
+++ b/src/audio_dec/Makefile.am
@@ -0,0 +1,93 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+EXTRA_DIST = fooaudio.c
+noinst_HEADERS = ff_dvdata.h
+
+if ENABLE_MUSEPACK
+musepack_module = xineplug_decode_mpc.la
+endif
+
+if ENABLE_DTS
+dts_module = xineplug_decode_dts.la
+endif
+
+if ENABLE_MAD
+mad_module = xineplug_decode_mad.la
+endif
+
+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_lpcm.la \
+ xineplug_decode_dvaudio.la \
+ $(musepack_module) \
+ $(dts_module) \
+ $(mad_module) \
+ $(a52_module) \
+ $(faad_module)
+
+xineplug_decode_gsm610_la_SOURCES = gsm610.c
+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_LIBADD = $(XINE_LIB)
+
+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) $(AVUTIL_LIBS) -lm
+xineplug_decode_a52_la_CFLAGS = $(AM_CFLAGS) $(A52DEC_CFLAGS) $(AVUTIL_CFLAGS)
+
+xineplug_decode_faad_la_SOURCES = xine_faad_decoder.c
+xineplug_decode_faad_la_DEPENDENCIES = $(FAAD_DEPS)
+xineplug_decode_faad_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(FAAD_LIBS) -lm
+xineplug_decode_faad_la_CFLAGS = $(FAAD_CFLAGS)
+
+xineplug_decode_dvaudio_la_SOURCES = ff_dvaudio_decoder.c
+xineplug_decode_dvaudio_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_decode_dvaudio_la_CPPFLAGS = $(AM_CPPFLAGS) $(FFMPEG_CFLAGS)
diff --git a/src/audio_dec/ff_dvaudio_decoder.c b/src/audio_dec/ff_dvaudio_decoder.c
new file mode 100644
index 000000000..f38167cf8
--- /dev/null
+++ b/src/audio_dec/ff_dvaudio_decoder.c
@@ -0,0 +1,393 @@
+/*
+ * Copyright (C) 2005 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, USA
+ *
+ * dv audio decoder based on patch by Dan Dennedy <dan@dennedy.org>
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <string.h>
+#include <math.h>
+
+#define LOG_MODULE "dvaudio"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+
+#include "ff_dvdata.h" /* This is not installed by FFmpeg, its usage has to be cleared up */
+
+#define AUDIOBUFSIZE 128*1024
+#define MAXFRAMESIZE 131072
+
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} dvaudio_class_t;
+
+typedef struct dvaudio_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ int output_open;
+ int audio_channels;
+ int audio_bits;
+ int audio_sample_rate;
+
+ unsigned char *buf;
+ int bufsize;
+ int size;
+
+ char *decode_buffer;
+ int decoder_ok;
+
+} 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
+ * to have a fallback mechanism for complete search of missing packs.
+ */
+static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t)
+{
+ int offs;
+
+ switch (t) {
+ case dv_audio_source:
+ offs = (80*6 + 80*16*3 + 3);
+ break;
+ case dv_audio_control:
+ offs = (80*6 + 80*16*4 + 3);
+ break;
+ case dv_video_control:
+ offs = (80*5 + 48 + 5);
+ break;
+ default:
+ return NULL;
+ }
+
+ return (frame[offs] == t ? &frame[offs] : NULL);
+}
+
+static inline uint16_t dv_audio_12to16(uint16_t sample)
+{
+ uint16_t shift, result;
+
+ sample = (sample < 0x800) ? sample : sample | 0xf000;
+ shift = (sample & 0xf00) >> 8;
+
+ if (shift < 0x2 || shift > 0xd) {
+ result = sample;
+ } else if (shift < 0x8) {
+ shift--;
+ result = (sample - (256 * shift)) << shift;
+ } else {
+ shift = 0xe - shift;
+ result = ((sample + ((256 * shift) + 1)) << shift) - 1;
+ }
+
+ return result;
+}
+
+/*
+ * There's a couple of assumptions being made here:
+ * 1. By default we silence erroneous (0x8000/16bit 0x800/12bit) audio samples.
+ * We can pass them upwards when ffmpeg will be ready to deal with them.
+ * 2. We don't do software emphasis.
+ * 3. Audio is always returned as 16bit linear samples: 12bit nonlinear samples
+ * are converted into 16bit linear ones.
+ */
+static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2)
+{
+ int size, i, j, d, of, smpls, freq, quant, half_ch;
+ uint16_t lc, rc;
+ const DVprofile* sys;
+ const uint8_t* as_pack;
+
+ as_pack = dv_extract_pack(frame, dv_audio_source);
+ if (!as_pack) /* No audio ? */
+ return 0;
+
+ sys = dv_frame_profile(frame);
+ smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
+ freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48KHz, 1 - 44,1kHz, 2 - 32 kHz */
+ quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
+
+ if (quant > 1)
+ return -1; /* Unsupported quantization */
+
+ size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
+ half_ch = sys->difseg_size/2;
+
+ /* for each DIF segment */
+ for (i = 0; i < sys->difseg_size; i++) {
+ frame += 6 * 80; /* skip DIF segment header */
+ if (quant == 1 && i == half_ch) {
+ if (!pcm2)
+ break;
+ else
+ pcm = pcm2;
+ }
+
+ for (j = 0; j < 9; j++) {
+ for (d = 8; d < 80; d += 2) {
+ if (quant == 0) { /* 16bit quantization */
+ of = sys->audio_shuffle[i][j] + (d - 8)/2 * sys->audio_stride;
+ if (of*2 >= size)
+ continue;
+
+#ifdef WORDS_BIGENDIAN
+ pcm[of*2] = frame[d];
+ pcm[of*2+1] = frame[d+1];
+#else
+ pcm[of*2] = frame[d+1];
+ pcm[of*2+1] = frame[d];
+#endif
+ if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
+ pcm[of*2+1] = 0;
+ } else { /* 12bit quantization */
+ lc = ((uint16_t)frame[d] << 4) |
+ ((uint16_t)frame[d+2] >> 4);
+ rc = ((uint16_t)frame[d+1] << 4) |
+ ((uint16_t)frame[d+2] & 0x0f);
+ lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
+ rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
+
+ of = sys->audio_shuffle[i%half_ch][j] + (d - 8)/3 * sys->audio_stride;
+ if (of*2 >= size)
+ continue;
+
+#ifdef WORDS_BIGENDIAN
+ pcm[of*2] = lc >> 8;
+ pcm[of*2+1] = lc & 0xff;
+#else
+ pcm[of*2] = lc & 0xff;
+ pcm[of*2+1] = lc >> 8;
+#endif
+ of = sys->audio_shuffle[i%half_ch+half_ch][j] +
+ (d - 8)/3 * sys->audio_stride;
+#ifdef WORDS_BIGENDIAN
+ pcm[of*2] = rc >> 8;
+ pcm[of*2+1] = rc & 0xff;
+#else
+ pcm[of*2] = rc & 0xff;
+ pcm[of*2+1] = rc >> 8;
+#endif
+ ++d;
+ }
+ }
+
+ frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
+ }
+ }
+
+ return size;
+}
+
+static void dvaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ dvaudio_decoder_t *this = (dvaudio_decoder_t *) this_gen;
+ int bytes_consumed;
+ int decode_buffer_size;
+ int offset;
+ int out;
+ audio_buffer_t *audio_buffer;
+ int bytes_to_send;
+
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
+ this->buf = calloc(1, AUDIOBUFSIZE);
+ this->bufsize = AUDIOBUFSIZE;
+ this->size = 0;
+ this->decode_buffer = calloc(1, MAXFRAMESIZE);
+
+ this->audio_sample_rate = buf->decoder_info[1];
+ this->audio_bits = buf->decoder_info[2];
+ this->audio_channels = buf->decoder_info[3];
+
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DV Audio");
+
+ this->decoder_ok = 1;
+
+ return;
+ }
+
+ if (this->decoder_ok && !(buf->decoder_flags & (BUF_FLAG_HEADER|BUF_FLAG_SPECIAL))) {
+
+ if (!this->output_open) {
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream, this->audio_bits, this->audio_sample_rate,
+ _x_ao_channels2mode(this->audio_channels));
+ }
+
+ /* if the audio still isn't open, bail */
+ if (!this->output_open)
+ return;
+
+ if( this->size + buf->size > this->bufsize ) {
+ this->bufsize = this->size + 2 * buf->size;
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("dvaudio: increasing buffer to %d to avoid overflow.\n"),
+ this->bufsize);
+ this->buf = realloc( this->buf, this->bufsize );
+ }
+
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+ this->size += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */
+
+ offset = 0;
+ while (this->size>0) {
+ decode_buffer_size = dv_extract_audio(&this->buf[offset], this->decode_buffer, NULL);
+
+ if (decode_buffer_size > -1)
+ bytes_consumed = dv_frame_profile(&this->buf[offset])->frame_size;
+ else
+ bytes_consumed = decode_buffer_size;
+
+ /* dispatch the decoded audio */
+ out = 0;
+ while (out < decode_buffer_size) {
+ audio_buffer =
+ this->stream->audio_out->get_buffer (this->stream->audio_out);
+ if (audio_buffer->mem_size == 0) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "dvaudio: Help! Allocated audio buffer with nothing in it!\n");
+ return;
+ }
+
+ if ((decode_buffer_size - out) > audio_buffer->mem_size)
+ bytes_to_send = audio_buffer->mem_size;
+ else
+ bytes_to_send = decode_buffer_size - out;
+
+ /* fill up this buffer */
+ xine_fast_memcpy(audio_buffer->mem, &this->decode_buffer[out],
+ bytes_to_send);
+ /* byte count / 2 (bytes / sample) / channels */
+ audio_buffer->num_frames = bytes_to_send / 2 / this->audio_channels;
+
+ audio_buffer->vpts = buf->pts;
+ buf->pts = 0; /* only first buffer gets the real pts */
+ this->stream->audio_out->put_buffer (this->stream->audio_out,
+ audio_buffer, this->stream);
+
+ out += bytes_to_send;
+ }
+
+ this->size -= bytes_consumed;
+ offset += bytes_consumed;
+ }
+
+ /* reset internal accumulation buffer */
+ this->size = 0;
+ }
+ }
+}
+
+static void dvaudio_reset (audio_decoder_t *this_gen) {
+ dvaudio_decoder_t *this = (dvaudio_decoder_t *) this_gen;
+
+ this->size = 0;
+}
+
+static void dvaudio_discontinuity (audio_decoder_t *this_gen) {
+}
+
+static void dvaudio_dispose (audio_decoder_t *this_gen) {
+
+ dvaudio_decoder_t *this = (dvaudio_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->buf);
+ free(this->decode_buffer);
+
+ free (this_gen);
+}
+
+static audio_decoder_t *dvaudio_open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ dvaudio_decoder_t *this ;
+
+ this = calloc(1, sizeof (dvaudio_decoder_t));
+
+ this->audio_decoder.decode_data = dvaudio_decode_data;
+ this->audio_decoder.reset = dvaudio_reset;
+ this->audio_decoder.discontinuity = dvaudio_discontinuity;
+ this->audio_decoder.dispose = dvaudio_dispose;
+
+ this->output_open = 0;
+ this->audio_channels = 0;
+ this->stream = stream;
+ this->buf = NULL;
+ this->size = 0;
+ this->decoder_ok = 0;
+
+ return &this->audio_decoder;
+}
+
+static void *init_dvaudio_plugin (xine_t *xine, void *data) {
+
+ dvaudio_class_t *this ;
+
+ this = calloc(1, sizeof (dvaudio_class_t));
+
+ this->decoder_class.open_plugin = dvaudio_open_plugin;
+ this->decoder_class.identifier = "dv audio";
+ this->decoder_class.description = N_("dv audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static uint32_t supported_audio_types[] = {
+ BUF_AUDIO_DV,
+ 0
+};
+
+static const decoder_info_t dec_info_dvaudio = {
+ supported_audio_types, /* supported types */
+ 5 /* priority */
+};
+
+/*
+ * exported plugin catalog entry
+ */
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 16, "dvaudio", XINE_VERSION_CODE, &dec_info_dvaudio, init_dvaudio_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/ff_dvdata.h b/src/audio_dec/ff_dvdata.h
new file mode 100644
index 000000000..f1d7af260
--- /dev/null
+++ b/src/audio_dec/ff_dvdata.h
@@ -0,0 +1,2737 @@
+/*
+ * 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.
+ */
+
+#ifndef FFMPEG_DVDATA_H
+#define FFMPEG_DVDATA_H
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <avcodec.h>
+# include <rational.h>
+#else
+# include <libavcodec/avcodec.h>
+# include <libavutil/rational.h>
+#endif
+
+/*
+ * 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 av_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) && (frame[80*5 + 48] == dv_video_source)) { /* 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) && (frame[80*5 + 48] == dv_video_source)) { /* 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;
+}
+
+#endif /* FFMPEG_DVDATA_H */
diff --git a/src/audio_dec/fooaudio.c b/src/audio_dec/fooaudio.c
new file mode 100644
index 000000000..d2f1f74a4
--- /dev/null
+++ b/src/audio_dec/fooaudio.c
@@ -0,0 +1,340 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * fooaudio.c: This is a reference audio decoder for the xine multimedia
+ * player. It really works too! It will output a continuous sine wave in
+ * place of the data it should actually send.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+/* math.h required for fooaudio sine wave generation */
+#include <math.h>
+
+#define AUDIOBUFSIZE 128*1024
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} fooaudio_class_t;
+
+typedef struct fooaudio_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ int sample_rate; /* audio sample rate */
+ int bits_per_sample; /* bits/sample, usually 8 or 16 */
+ int channels; /* 1 or 2, usually */
+
+ int output_open; /* flag to indicate audio is ready */
+
+ unsigned char *buf; /* data accumulation buffer */
+ int bufsize; /* maximum size of buf */
+ int size; /* size of accumulated data in buf */
+
+ /* fooaudio-specific variables */
+ int64_t last_pts;
+ unsigned int iteration;
+
+} fooaudio_decoder_t;
+
+/**************************************************************************
+ * fooaudio specific decode functions
+ *************************************************************************/
+
+/**************************************************************************
+ * xine audio plugin functions
+ *************************************************************************/
+
+static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen;
+ audio_buffer_t *audio_buffer;
+ int i;
+ int64_t samples_to_generate;
+ int samples_to_send;
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
+
+ /* When the engine sends a BUF_FLAG_HEADER flag, it is time to initialize
+ * the decoder. The buffer element type has 4 decoder_info fields,
+ * 0..3. Field 1 is the sample rate. Field 2 is the bits/sample. Field
+ * 3 is the number of channels. */
+ this->sample_rate = buf->decoder_info[1];
+ this->bits_per_sample = buf->decoder_info[2];
+ this->channels = buf->decoder_info[3];
+
+ /* initialize the data accumulation buffer */
+ this->buf = calloc(1, AUDIOBUFSIZE);
+ this->bufsize = AUDIOBUFSIZE;
+ this->size = 0;
+
+ /* take this opportunity to initialize stream/meta information */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "fooaudio");
+
+ /* perform any other required initialization */
+ this->last_pts = -1;
+ this->iteration = 0;
+
+ return;
+ }
+
+ /* if the audio output is not open yet, open the audio output */
+#warning: Audio output is hardcoded to mono 16-bit PCM
+ if (!this->output_open) {
+ this->output_open = (this->stream->audio_out->open) (
+ this->stream->audio_out,
+ this->stream,
+/* this->bits_per_sample, */
+ 16,
+ this->sample_rate,
+/* _x_ao_channels2mode(this->channels));*/
+ AO_CAP_MODE_MONO);
+ }
+
+ /* if the audio still isn't open, do not go any further with the decode */
+ if (!this->output_open)
+ return;
+
+ /* accumulate the data passed through the buffer element type; increase
+ * the accumulator buffer size as necessary */
+ if( this->size + buf->size > this->bufsize ) {
+ this->bufsize = this->size + 2 * buf->size;
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "fooaudio: increasing source buffer to %d to avoid overflow.\n", this->bufsize);
+ this->buf = realloc( this->buf, this->bufsize );
+ }
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+ this->size += buf->size;
+
+ /* When a buffer element type has the BUF_FLAG_FRAME_END flag set, it is
+ * time to decode the data in the buffer. */
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+
+ /* This is where the real meat of the audio decoder is implemented.
+ * The general strategy is to decode the data in the accumulation buffer
+ * into raw PCM data and then dispatch the PCM to the engine in smaller
+ * buffers. What follows in the inside of this scope is the meat of
+ * this particular audio decoder. */
+
+ /* Operation of the fooaudio decoder:
+ * This decoder generates a continuous sine pattern based on the pts
+ * values sent by the xine engine. Two pts values are needed to know
+ * how long to make the audio. Thus, If this is the first frame or
+ * a seek has occurred (indicated by this->last_pts = -1),
+ * log the pts but do not create any audio.
+ *
+ * When a valid pts delta is generated, create n audio samples, where
+ * n is given as:
+ *
+ * n pts delta
+ * ----------- = --------- => n = (pts delta * sample rate) / 90000
+ * sample rate 90000
+ *
+ */
+
+ if (this->last_pts != -1) {
+
+ /* no real reason to set this variable to 0 first; I just wanted the
+ * novelty of using all 4 basic arithmetic ops in a row (+ - * /) */
+ samples_to_generate = 0;
+ samples_to_generate += buf->pts;
+ samples_to_generate -= this->last_pts;
+ samples_to_generate *= this->sample_rate;
+ samples_to_generate /= 90000;
+
+ /* save the pts now since it will likely be trashed later */
+ this->last_pts = buf->pts;
+
+ while (samples_to_generate) {
+
+ /* get an audio buffer */
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+ if (audio_buffer->mem_size == 0) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "fooaudio: Help! Allocated audio buffer with nothing in it!\n");
+ return;
+ }
+
+ /* samples_to_generate is a sample count; mem_size is a byte count */
+ if (samples_to_generate > audio_buffer->mem_size / 2)
+ samples_to_send = audio_buffer->mem_size / 2;
+ else
+ samples_to_send = samples_to_generate;
+ samples_to_generate -= samples_to_send;
+
+#define WAVE_HZ 300
+ /* fill up the samples in the buffer */
+ for (i = 0; i < samples_to_send; i++)
+ audio_buffer->mem[i] =
+ (short)(sin(2 * M_PI * this->iteration++ / WAVE_HZ) * 32767);
+
+ /* final prep for audio buffer dispatch */
+ audio_buffer->num_frames = samples_to_send;
+ audio_buffer->vpts = buf->pts;
+ buf->pts = 0; /* only first buffer gets the real pts */
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+ }
+ } else {
+ /* log the pts for the next time */
+ this->last_pts = buf->pts;
+ }
+
+ /* reset data accumulation buffer */
+ this->size = 0;
+ }
+}
+
+/* This function resets the state of the audio decoder. This usually
+ * entails resetting the data accumulation buffer. */
+static void fooaudio_reset (audio_decoder_t *this_gen) {
+
+ fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen;
+
+ this->size = 0;
+
+ /* this is specific to fooaudio */
+ this->last_pts = -1;
+}
+
+/* This function resets the last pts value of the audio decoder. */
+static void fooaudio_discontinuity (audio_decoder_t *this_gen) {
+
+ fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen;
+
+ /* this is specific to fooaudio */
+ this->last_pts = -1;
+}
+
+/* This function closes the audio output and frees the private audio decoder
+ * structure. */
+static void fooaudio_dispose (audio_decoder_t *this_gen) {
+
+ fooaudio_decoder_t *this = (fooaudio_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 */
+ free(this->buf);
+ free(this);
+}
+
+/* This function allocates, initializes, and returns a private audio
+ * decoder structure. */
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ fooaudio_decoder_t *this ;
+
+ this = (fooaudio_decoder_t *) calloc(1, sizeof(fooaudio_decoder_t));
+
+ /* connect the member functions */
+ this->audio_decoder.decode_data = fooaudio_decode_data;
+ this->audio_decoder.reset = fooaudio_reset;
+ this->audio_decoder.discontinuity = fooaudio_discontinuity;
+ this->audio_decoder.dispose = fooaudio_dispose;
+
+ /* connect the stream */
+ this->stream = stream;
+
+ /* audio output is not open at the start */
+ this->output_open = 0;
+
+ /* initialize the basic audio parameters */
+ this->channels = 0;
+ this->sample_rate = 0;
+ this->bits_per_sample = 0;
+
+ /* initialize the data accumulation buffer */
+ this->buf = NULL;
+ this->bufsize = 0;
+ this->size = 0;
+
+ /* return the newly-initialized audio decoder */
+ return &this->audio_decoder;
+}
+
+/* This function frees the audio decoder class and any other memory that was
+ * allocated. */
+static void dispose_class (audio_decoder_class_t *this_gen) {
+
+ fooaudio_class_t *this = (fooaudio_class_t *)this_gen;
+
+ free (this);
+}
+
+/* This function allocates a private audio decoder class and initializes
+ * the class's member functions. */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ fooaudio_class_t *this ;
+
+ this = (fooaudio_class_t *) xine_malloc (sizeof (fooaudio_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "fooaudio";
+ this->decoder_class.description = N_("fooaudio: reference xine audio decoder plugin");
+ this->decoder_class.dispose = dispose_class;
+
+ 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 const uint32_t audio_types[] = {
+ /* BUF_AUDIO_FOO, */
+ 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, 16, "fooaudio", XINE_VERSION_CODE, &dec_info_audio, &init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
+
diff --git a/src/audio_dec/gsm610.c b/src/audio_dec/gsm610.c
new file mode 100644
index 000000000..be98da798
--- /dev/null
+++ b/src/audio_dec/gsm610.c
@@ -0,0 +1,281 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * GSM 6.10 Audio Decoder
+ * This decoder is based on the GSM 6.10 codec library found at:
+ * http://kbs.cs.tu-berlin.de/~jutta/toast.html
+ * Additionally, here is an article regarding the software that appeared
+ * in Dr. Dobbs Journal:
+ * http://www.ddj.com/documents/s=1012/ddj9412b/9412b.htm
+ *
+ * This is the notice that comes with the software:
+ * --------------------------------------------------------------------
+ * Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
+ * Technische Universitaet Berlin
+ *
+ * Any use of this software is permitted provided that this notice is not
+ * removed and that neither the authors nor the Technische Universitaet Berlin
+ * are deemed to have made any representations as to the suitability of this
+ * software for any purpose nor are held responsible for any defects of
+ * this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
+ *
+ * As a matter of courtesy, the authors request to be informed about uses
+ * this software has found, about bugs in this software, and about any
+ * improvements that may be of general interest.
+ *
+ * Berlin, 28.11.1994
+ * Jutta Degener
+ * Carsten Bormann
+ * --------------------------------------------------------------------
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+#include "private.h"
+#include "gsm.h"
+
+#define AUDIOBUFSIZE 128*1024
+
+#define GSM610_SAMPLE_SIZE 16
+#define GSM610_BLOCK_SIZE 160
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} gsm610_class_t;
+
+typedef struct gsm610_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ unsigned int buf_type;
+ int output_open;
+ int sample_rate;
+
+ unsigned char *buf;
+ int bufsize;
+ int size;
+
+ gsm gsm_state;
+
+} gsm610_decoder_t;
+
+/**************************************************************************
+ * xine audio plugin functions
+ *************************************************************************/
+
+static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ gsm610_decoder_t *this = (gsm610_decoder_t *) this_gen;
+ audio_buffer_t *audio_buffer;
+ int in_ptr;
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
+ this->sample_rate = buf->decoder_info[1];
+
+ this->buf = calloc(1, AUDIOBUFSIZE);
+ this->bufsize = AUDIOBUFSIZE;
+ this->size = 0;
+
+ /* stream/meta info */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "GSM 6.10");
+
+ return;
+ }
+
+ if (!this->output_open) {
+
+ this->gsm_state = gsm_create();
+ this->buf_type = buf->type;
+
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream, GSM610_SAMPLE_SIZE, this->sample_rate, AO_CAP_MODE_MONO);
+ }
+
+ /* if the audio still isn't open, bail */
+ if (!this->output_open)
+ return;
+
+ if( this->size + buf->size > this->bufsize ) {
+ this->bufsize = this->size + 2 * buf->size;
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "gsm610: increasing source buffer to %d to avoid overflow.\n", this->bufsize);
+ this->buf = realloc( this->buf, this->bufsize );
+ }
+
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+ 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) {
+
+ this->gsm_state->wav_fmt = 1;
+
+ /* the data should line up on a 65-byte boundary */
+ if ((buf->size % 65) != 0) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "gsm610: received MS GSM block that does not line up\n");
+ this->size = 0;
+ return;
+ }
+
+ in_ptr = 0;
+ while (this->size) {
+ gsm_decode(this->gsm_state, &this->buf[in_ptr], decode_buffer);
+ if ((in_ptr % 65) == 0) {
+ in_ptr += 33;
+ this->size -= 33;
+ } else {
+ in_ptr += 32;
+ this->size -= 32;
+ }
+
+ /* dispatch the decoded audio; assume that the audio buffer will
+ * always contain at least 160 samples */
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+
+ xine_fast_memcpy(audio_buffer->mem, decode_buffer,
+ GSM610_BLOCK_SIZE * 2);
+ audio_buffer->num_frames = GSM610_BLOCK_SIZE;
+
+ audio_buffer->vpts = buf->pts;
+ buf->pts = 0; /* only first buffer gets the real pts */
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+ }
+ } else {
+
+ /* handle the other variant, which consists of 33-byte blocks */
+ this->gsm_state->wav_fmt = 0;
+
+ /* the data should line up on a 33-byte boundary */
+ if ((buf->size % 33) != 0) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "gsm610: received GSM block that does not line up\n");
+ this->size = 0;
+ return;
+ }
+
+ in_ptr = 0;
+ while (this->size) {
+ gsm_decode(this->gsm_state, &this->buf[in_ptr], decode_buffer);
+ in_ptr += 33;
+ this->size -= 33;
+
+ /* dispatch the decoded audio; assume that the audio buffer will
+ * always contain at least 160 samples */
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+
+ xine_fast_memcpy(audio_buffer->mem, decode_buffer,
+ GSM610_BLOCK_SIZE * 2);
+ audio_buffer->num_frames = GSM610_BLOCK_SIZE;
+
+ audio_buffer->vpts = buf->pts;
+ buf->pts = 0; /* only first buffer gets the real pts */
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+ }
+ }
+ }
+}
+
+static void gsm610_reset (audio_decoder_t *this_gen) {
+}
+
+static void gsm610_discontinuity (audio_decoder_t *this_gen) {
+}
+
+static void gsm610_dispose (audio_decoder_t *this_gen) {
+
+ gsm610_decoder_t *this = (gsm610_decoder_t *) this_gen;
+
+ if (this->gsm_state)
+ gsm_destroy(this->gsm_state);
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+ this->output_open = 0;
+
+ if (this->buf)
+ free(this->buf);
+
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ gsm610_decoder_t *this ;
+
+ this = (gsm610_decoder_t *) calloc(1, sizeof(gsm610_decoder_t));
+
+ this->audio_decoder.decode_data = gsm610_decode_data;
+ this->audio_decoder.reset = gsm610_reset;
+ this->audio_decoder.discontinuity = gsm610_discontinuity;
+ this->audio_decoder.dispose = gsm610_dispose;
+
+ this->output_open = 0;
+ this->sample_rate = 0;
+ this->stream = stream;
+ this->buf = NULL;
+ this->size = 0;
+
+ return &this->audio_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ gsm610_class_t *this ;
+
+ this = (gsm610_class_t *) calloc(1, sizeof(gsm610_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "GSM 6.10";
+ this->decoder_class.description = N_("GSM 6.10 audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_MSGSM,
+ BUF_AUDIO_GSM610,
+ 0
+};
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 9 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 16, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/xine_a52_decoder.c b/src/audio_dec/xine_a52_decoder.c
new file mode 100644
index 000000000..628920fbc
--- /dev/null
+++ b/src/audio_dec/xine_a52_decoder.c
@@ -0,0 +1,864 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * stuff needed to turn liba52 into a xine decoder plugin
+ */
+
+#ifndef __sun
+/* required for swab() */
+#define _XOPEN_SOURCE 500
+#endif
+/* avoid compiler warnings */
+#define _BSD_SOURCE 1
+
+#include "config.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+
+#define LOG_MODULE "a52_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+#define LOG_PTS
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+
+#ifdef HAVE_A52DEC_A52_H
+# include <a52dec/a52.h>
+#else
+# include "a52.h"
+#endif
+
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <crc.h>
+#else
+# include <libavutil/crc.h>
+#endif
+
+#undef DEBUG_A52
+#ifdef DEBUG_A52
+int a52file;
+#endif
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+ config_values_t *config;
+
+ float a52_level;
+ int disable_dynrng_compress;
+ int enable_surround_downmix;
+
+ const AVCRC *av_crc;
+} a52dec_class_t;
+
+typedef struct a52dec_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ a52dec_class_t *class;
+ xine_stream_t *stream;
+ int64_t pts;
+ int64_t pts_list[5];
+ int32_t pts_list_position;
+
+ uint8_t frame_buffer[3840];
+ uint8_t *frame_ptr;
+ int sync_state;
+ int frame_length, frame_todo;
+ uint16_t syncword;
+
+ a52_state_t *a52_state;
+ int a52_flags;
+ int a52_bit_rate;
+ int a52_sample_rate;
+ int have_lfe;
+
+ int a52_flags_map[11];
+ int ao_flags_map[11];
+
+ int audio_caps;
+ int bypass_mode;
+ int output_sampling_rate;
+ int output_open;
+ int output_mode;
+
+} a52dec_decoder_t;
+
+struct frmsize_s
+{
+ uint16_t bit_rate;
+ uint16_t frm_size[3];
+};
+
+static const struct frmsize_s frmsizecod_tbl[64] =
+{
+ { 32 ,{64 ,69 ,96 } },
+ { 32 ,{64 ,70 ,96 } },
+ { 40 ,{80 ,87 ,120 } },
+ { 40 ,{80 ,88 ,120 } },
+ { 48 ,{96 ,104 ,144 } },
+ { 48 ,{96 ,105 ,144 } },
+ { 56 ,{112 ,121 ,168 } },
+ { 56 ,{112 ,122 ,168 } },
+ { 64 ,{128 ,139 ,192 } },
+ { 64 ,{128 ,140 ,192 } },
+ { 80 ,{160 ,174 ,240 } },
+ { 80 ,{160 ,175 ,240 } },
+ { 96 ,{192 ,208 ,288 } },
+ { 96 ,{192 ,209 ,288 } },
+ { 112 ,{224 ,243 ,336 } },
+ { 112 ,{224 ,244 ,336 } },
+ { 128 ,{256 ,278 ,384 } },
+ { 128 ,{256 ,279 ,384 } },
+ { 160 ,{320 ,348 ,480 } },
+ { 160 ,{320 ,349 ,480 } },
+ { 192 ,{384 ,417 ,576 } },
+ { 192 ,{384 ,418 ,576 } },
+ { 224 ,{448 ,487 ,672 } },
+ { 224 ,{448 ,488 ,672 } },
+ { 256 ,{512 ,557 ,768 } },
+ { 256 ,{512 ,558 ,768 } },
+ { 320 ,{640 ,696 ,960 } },
+ { 320 ,{640 ,697 ,960 } },
+ { 384 ,{768 ,835 ,1152 } },
+ { 384 ,{768 ,836 ,1152 } },
+ { 448 ,{896 ,975 ,1344 } },
+ { 448 ,{896 ,976 ,1344 } },
+ { 512 ,{1024 ,1114 ,1536 } },
+ { 512 ,{1024 ,1115 ,1536 } },
+ { 576 ,{1152 ,1253 ,1728 } },
+ { 576 ,{1152 ,1254 ,1728 } },
+ { 640 ,{1280 ,1393 ,1920 } },
+ { 640 ,{1280 ,1394 ,1920 } }
+};
+
+/* config callbacks */
+static void a52_level_change_cb(void *this_gen, xine_cfg_entry_t *entry);
+static void dynrng_compress_change_cb(void *this_gen, xine_cfg_entry_t *entry);
+static void surround_downmix_change_cb(void *this_gen, xine_cfg_entry_t *entry);
+
+
+static void a52dec_reset (audio_decoder_t *this_gen) {
+
+ a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
+
+ this->syncword = 0;
+ this->sync_state = 0;
+ this->pts = 0;
+ this->pts_list[0] = 0;
+ this->pts_list_position = 0;
+}
+
+static void a52dec_discontinuity (audio_decoder_t *this_gen) {
+
+ a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
+
+ this->pts = 0;
+ this->pts_list[0] = 0;
+ this->pts_list_position = 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 inline void mute_channel (int16_t * s16, int num_channels) {
+ int i;
+
+ for (i = 0; i < 256; i++) {
+ s16[num_channels*i] = 0;
+ }
+}
+
+static void a52dec_decode_frame (a52dec_decoder_t *this, int64_t pts, int preview_mode) {
+
+ int output_mode = AO_CAP_MODE_STEREO;
+
+ /*
+ * do we want to decode this frame in software?
+ */
+#ifdef LOG_PTS
+ printf("a52dec:decode_frame:pts=%lld\n",pts);
+#endif
+ if (!this->bypass_mode) {
+
+ int a52_output_flags, i;
+ sample_t level = this->class->a52_level;
+ audio_buffer_t *buf;
+ int16_t *int_samples;
+ sample_t *samples = a52_samples(this->a52_state);
+
+ /*
+ * oki, decode this frame in software
+ */
+
+ /* determine output mode */
+
+ a52_output_flags = this->a52_flags_map[this->a52_flags & A52_CHANNEL_MASK];
+
+ if (a52_frame (this->a52_state,
+ this->frame_buffer,
+ &a52_output_flags,
+ &level, 384)) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: a52_frame error\n");
+ return;
+ }
+
+ if (this->class->disable_dynrng_compress)
+ a52_dynrng (this->a52_state, NULL, NULL);
+
+ this->have_lfe = a52_output_flags & A52_LFE;
+ if (this->have_lfe)
+ if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
+ output_mode = AO_CAP_MODE_5_1CHANNEL;
+ } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
+ output_mode = AO_CAP_MODE_4_1CHANNEL;
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: WHAT DO I DO!!!\n");
+ output_mode = this->ao_flags_map[a52_output_flags];
+ }
+ else
+ output_mode = this->ao_flags_map[a52_output_flags];
+ /*
+ * (re-)open output device
+ */
+
+ if (!this->output_open
+ || (this->a52_sample_rate != this->output_sampling_rate)
+ || (output_mode != this->output_mode)) {
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream, 16,
+ this->a52_sample_rate,
+ output_mode) ;
+ this->output_sampling_rate = this->a52_sample_rate;
+ this->output_mode = output_mode;
+ }
+
+
+ if (!this->output_open || preview_mode)
+ return;
+
+
+ /*
+ * decode a52 and convert/interleave samples
+ */
+
+ buf = this->stream->audio_out->get_buffer (this->stream->audio_out);
+ int_samples = buf->mem;
+ buf->num_frames = 256*6;
+
+ for (i = 0; i < 6; i++) {
+ if (a52_block (this->a52_state)) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: a52_block error on audio channel %d\n", i);
+#if 0
+ for(n=0;n<2000;n++) {
+ printf("%02x ",this->frame_buffer[n]);
+ if ((n % 32) == 0) printf("\n");
+ }
+ printf("\n");
+#endif
+ buf->num_frames = 0;
+ break;
+ }
+
+ switch (output_mode) {
+ case AO_CAP_MODE_MONO:
+ float_to_int (&samples[0], int_samples+(i*256), 1);
+ break;
+ case AO_CAP_MODE_STEREO:
+ float_to_int (&samples[0*256], int_samples+(i*256*2), 2);
+ float_to_int (&samples[1*256], int_samples+(i*256*2)+1, 2);
+ break;
+ case AO_CAP_MODE_4CHANNEL:
+ float_to_int (&samples[0*256], int_samples+(i*256*4), 4); /* L */
+ float_to_int (&samples[1*256], int_samples+(i*256*4)+1, 4); /* R */
+ float_to_int (&samples[2*256], int_samples+(i*256*4)+2, 4); /* RL */
+ float_to_int (&samples[3*256], int_samples+(i*256*4)+3, 4); /* RR */
+ break;
+ case AO_CAP_MODE_4_1CHANNEL:
+ float_to_int (&samples[0*256], int_samples+(i*256*6)+5, 6); /* LFE */
+ float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
+ float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
+ float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
+ float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
+ mute_channel ( int_samples+(i*256*6)+4, 6); /* C */
+ break;
+ case AO_CAP_MODE_5CHANNEL:
+ float_to_int (&samples[0*256], int_samples+(i*256*6)+0, 6); /* L */
+ float_to_int (&samples[1*256], int_samples+(i*256*6)+4, 6); /* C */
+ float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
+ float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
+ float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
+ mute_channel ( int_samples+(i*256*6)+5, 6); /* LFE */
+ break;
+ case AO_CAP_MODE_5_1CHANNEL:
+ float_to_int (&samples[0*256], int_samples+(i*256*6)+5, 6); /* lfe */
+ float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
+ float_to_int (&samples[2*256], int_samples+(i*256*6)+4, 6); /* C */
+ float_to_int (&samples[3*256], int_samples+(i*256*6)+1, 6); /* R */
+ float_to_int (&samples[4*256], int_samples+(i*256*6)+2, 6); /* RL */
+ float_to_int (&samples[5*256], int_samples+(i*256*6)+3, 6); /* RR */
+ break;
+ default:
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: help - unsupported mode %08x\n", output_mode);
+ }
+ }
+
+ lprintf ("%d frames output\n", buf->num_frames);
+
+ /* output decoded samples */
+
+ buf->vpts = pts;
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, buf, this->stream);
+
+ } else {
+
+ /*
+ * loop through a52 data
+ */
+
+ if (!this->output_open) {
+
+ int sample_rate, bit_rate, flags;
+
+ a52_syncinfo (this->frame_buffer, &flags, &sample_rate, &bit_rate);
+
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream, 16,
+ sample_rate,
+ AO_CAP_MODE_A52) ;
+ this->output_mode = AO_CAP_MODE_A52;
+ }
+
+ if (this->output_open && !preview_mode) {
+ /* SPDIF Passthrough
+ * Build SPDIF Header and encaps the A52 audio data in it.
+ */
+ uint32_t syncword, crc1, fscod,frmsizecod,bsid,bsmod,frame_size;
+ uint8_t *data_out,*data_in;
+ audio_buffer_t *buf = this->stream->audio_out->get_buffer (this->stream->audio_out);
+ data_in=(uint8_t *) this->frame_buffer;
+ data_out=(uint8_t *) buf->mem;
+ syncword = data_in[0] | (data_in[1] << 8);
+ crc1 = data_in[2] | (data_in[3] << 8);
+ fscod = (data_in[4] >> 6) & 0x3;
+ frmsizecod = data_in[4] & 0x3f;
+ bsid = (data_in[5] >> 3) & 0x1f;
+ bsmod = data_in[5] & 0x7; /* bsmod, stream = 0 */
+ frame_size = frmsizecod_tbl[frmsizecod].frm_size[fscod] ;
+
+ data_out[0] = 0x72; data_out[1] = 0xf8; /* spdif syncword */
+ data_out[2] = 0x1f; data_out[3] = 0x4e; /* .............. */
+ data_out[4] = 0x01; /* AC3 data */
+ data_out[5] = bsmod; /* bsmod, stream = 0 */
+ data_out[6] = (frame_size << 4) & 0xff; /* frame_size * 16 */
+ data_out[7] = ((frame_size ) >> 4) & 0xff;
+ swab(data_in, &data_out[8], frame_size * 2 );
+
+ buf->num_frames = 1536;
+ buf->vpts = pts;
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, buf, this->stream);
+
+ }
+ }
+}
+
+static void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
+ uint8_t *current = buf->content;
+ uint8_t *sync_start=current + 1;
+ uint8_t *end = buf->content + buf->size;
+ uint8_t byte;
+ int32_t n;
+
+ lprintf ("decode data %d bytes of type %08x, pts=%"PRId64"\n",
+ buf->size, buf->type, buf->pts);
+ lprintf ("decode data decoder_info=%d, %d\n",buf->decoder_info[1],buf->decoder_info[2]);
+
+ if (buf->decoder_flags & BUF_FLAG_HEADER)
+ return;
+
+ /* swap byte pairs if this is RealAudio DNET data */
+ if (buf->type == BUF_AUDIO_DNET) {
+
+ lprintf ("byte-swapping dnet\n");
+
+ while (current != end) {
+ byte = *current++;
+ *(current - 1) = *current;
+ *current++ = byte;
+ }
+
+ /* reset */
+ current = buf->content;
+ end = buf->content + buf->size;
+ }
+
+ /* A52 packs come from the DVD in blocks of about 2048 bytes.
+ * Only 1 PTS values can be assigned to each block.
+ * An A52 frame is about 1700 bytes long.
+ * So, a single A52 packs can contain 2 A52 frames (or the beginning of an A52 frame at least).
+ * If we have a PTS value, which A52 frame does it apply to? The A52 pack tells us that.
+ * So, the info about which A52 frame the PTS applies to is contained in decoder_info sent from the demuxer.
+ *
+ * The PTS value from the A52 pack (DVD sector) can only be applied at the start of an A52 frame.
+ * We call the start of an A52 frame a frame header.
+ * So, if a A52 pack has 2 "Number of frame headers" is means that the A52 pack contains 2 A52 frame headers.
+ * The "First access unit" then tells us which A52 frame the PTS value applies to.
+ *
+ * Take the following example: -
+ * PACK1: PTS = 10. Contains the entire A52 frame1, followed by the beginning of the frame2. PTS applies to frame1.
+ * PACK2: PTS = 1000, Contains the rest of frame2, and the whole of frame3. and the start of frame4. PTS applies to frame4.
+ * PACK3: PTS = 0 (none), Contains the rest of frame4.
+ *
+ * Output should be: -
+ * frame1, PTS=10
+ * frame2, PTS=0
+ * frame3, PTS=0
+ * frame4, PTS=1000
+ *
+ * So, we have to keep track of PTS values from previous A52 packs here, otherwise they get put on the wrong frame.
+ */
+
+
+ /* FIXME: the code here does not match the explanation above */
+ if (buf->pts) {
+ int32_t info;
+ info = buf->decoder_info[1];
+ this->pts = buf->pts;
+ this->pts_list[this->pts_list_position]=buf->pts;
+ this->pts_list_position++;
+ if( this->pts_list_position > 3 )
+ this->pts_list_position = 3;
+ if (info == 2) {
+ this->pts_list[this->pts_list_position]=0;
+ this->pts_list_position++;
+ if( this->pts_list_position > 3 )
+ this->pts_list_position = 3;
+ }
+ }
+#if 0
+ for(n=0;n < buf->size;n++) {
+ if ((n % 32) == 0) printf("\n");
+ printf("%x ", current[n]);
+ }
+ printf("\n");
+#endif
+
+ lprintf ("processing...state %d\n", this->sync_state);
+
+ while (current < end) {
+ switch (this->sync_state) {
+ case 0: /* Looking for sync header */
+ this->syncword = (this->syncword << 8) | *current++;
+ if (this->syncword == 0x0b77) {
+
+ this->frame_buffer[0] = 0x0b;
+ this->frame_buffer[1] = 0x77;
+
+ this->sync_state = 1;
+ this->frame_ptr = this->frame_buffer+2;
+ }
+ break;
+
+ case 1: /* Looking for enough bytes for sync_info. */
+ sync_start = current - 1;
+ *this->frame_ptr++ = *current++;
+ if ((this->frame_ptr - this->frame_buffer) > 16) {
+ int a52_flags_old = this->a52_flags;
+ int a52_sample_rate_old = this->a52_sample_rate;
+ int a52_bit_rate_old = this->a52_bit_rate;
+
+ this->frame_length = a52_syncinfo (this->frame_buffer,
+ &this->a52_flags,
+ &this->a52_sample_rate,
+ &this->a52_bit_rate);
+
+ if (this->frame_length < 80) { /* Invalid a52 frame_length */
+ this->syncword = 0;
+ current = sync_start;
+ this->sync_state = 0;
+ break;
+ }
+
+ lprintf("Frame length = %d\n",this->frame_length);
+
+ this->frame_todo = this->frame_length - 17;
+ this->sync_state = 2;
+ if (!_x_meta_info_get(this->stream, XINE_META_INFO_AUDIOCODEC) ||
+ a52_flags_old != this->a52_flags ||
+ a52_sample_rate_old != this->a52_sample_rate ||
+ a52_bit_rate_old != this->a52_bit_rate) {
+
+ switch (this->a52_flags & A52_CHANNEL_MASK) {
+ case A52_3F2R:
+ if (this->a52_flags & A52_LFE)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 5.1");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 5.0");
+ break;
+ case A52_3F1R:
+ case A52_2F2R:
+ if (this->a52_flags & A52_LFE)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 4.1");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 4.0");
+ break;
+ case A52_2F1R:
+ case A52_3F:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 3.0");
+ break;
+ case A52_STEREO:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 2.0 (stereo)");
+ break;
+ case A52_DOLBY:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 2.0 (dolby)");
+ break;
+ case A52_MONO:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 1.0");
+ break;
+ default:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52");
+ break;
+ }
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, this->a52_bit_rate);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->a52_sample_rate);
+ }
+ }
+ break;
+
+ case 2: /* Filling frame_buffer with sync_info bytes */
+ *this->frame_ptr++ = *current++;
+ this->frame_todo--;
+ if (this->frame_todo < 1) {
+ this->sync_state = 3;
+ } else break;
+
+ case 3: { /* Ready for decode */
+ if (av_crc(this->class->av_crc, 0, &this->frame_buffer[2], this->frame_length - 2) != 0) { /* CRC16 failed */
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52:a52 frame failed crc16 checksum.\n");
+ current = sync_start;
+ this->pts = 0;
+ this->syncword = 0;
+ this->sync_state = 0;
+ break;
+ }
+ }
+#if 0
+ a52dec_decode_frame (this, this->pts_list[0], buf->decoder_flags & BUF_FLAG_PREVIEW);
+#else
+ a52dec_decode_frame (this, this->pts, buf->decoder_flags & BUF_FLAG_PREVIEW);
+#endif
+ for(n=0;n<4;n++) {
+ this->pts_list[n] = this->pts_list[n+1];
+ }
+ this->pts_list_position--;
+ if( this->pts_list_position < 0 )
+ this->pts_list_position = 0;
+#if 0
+ printf("liba52: pts_list = %lld, %lld, %lld\n",
+ this->pts_list[0],
+ this->pts_list[1],
+ this->pts_list[2]);
+#endif
+ case 4: /* Clear up ready for next frame */
+ this->pts = 0;
+ this->syncword = 0;
+ this->sync_state = 0;
+ break;
+ default: /* No come here */
+ break;
+ }
+ }
+
+#ifdef DEBUG_A52
+ write (a52file, this->frame_buffer, this->frame_length);
+#endif
+}
+
+static void a52dec_dispose (audio_decoder_t *this_gen) {
+
+ a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+ this->output_open = 0;
+
+ a52_free(this->a52_state);
+ this->a52_state = NULL;
+
+#ifdef DEBUG_A52
+ close (a52file);
+#endif
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ a52dec_decoder_t *this ;
+
+ lprintf ("open_plugin called\n");
+
+ this = calloc(1, sizeof (a52dec_decoder_t));
+
+ this->audio_decoder.decode_data = a52dec_decode_data;
+ this->audio_decoder.reset = a52dec_reset;
+ this->audio_decoder.discontinuity = a52dec_discontinuity;
+ this->audio_decoder.dispose = a52dec_dispose;
+ this->stream = stream;
+ this->class = (a52dec_class_t *) class_gen;
+
+ /* int i; */
+
+ this->audio_caps = stream->audio_out->get_capabilities(stream->audio_out);
+ this->syncword = 0;
+ this->sync_state = 0;
+ this->output_open = 0;
+ this->pts = 0;
+ this->pts_list[0] = 0;
+ this->pts_list_position = 0;
+
+ if( !this->a52_state ) {
+ this->a52_state =
+#ifdef HAVE_A52DEC_A52_H /* External liba52 */
+ /* When using external liba52, enable _all_ capabilities, even
+ if that might break stuff if they add some new capability
+ that depends on CPU's caps.
+ At the moment the only capability is DJBFFT, which is tested
+ only if djbfft is being used at compile time.
+
+ The actual question would be: why don't they check for
+ capabilities themselves?
+ */
+#warning "Enabling all external liba52 capabilities."
+ a52_init (0xFFFFFFFF)
+#else
+ a52_init (xine_mm_accel())
+#endif
+ ;
+ }
+
+ /*
+ * find out if this driver supports a52 output
+ * or, if not, how many channels we've got
+ */
+
+ if (this->audio_caps & AO_CAP_MODE_A52)
+ this->bypass_mode = 1;
+ else {
+ this->bypass_mode = 0;
+
+ this->a52_flags_map[A52_MONO] = A52_MONO;
+ this->a52_flags_map[A52_STEREO] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+ this->a52_flags_map[A52_3F] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+ this->a52_flags_map[A52_2F1R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+ this->a52_flags_map[A52_3F1R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+ this->a52_flags_map[A52_2F2R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+ this->a52_flags_map[A52_3F2R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+ this->a52_flags_map[A52_DOLBY] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
+
+ this->ao_flags_map[A52_MONO] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_STEREO] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[A52_3F] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[A52_2F1R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[A52_3F1R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[A52_DOLBY] = AO_CAP_MODE_STEREO;
+
+ /* find best mode */
+ if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
+
+ this->a52_flags_map[A52_2F2R] = A52_2F2R;
+ this->a52_flags_map[A52_3F2R] = A52_3F2R | A52_LFE;
+ this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_5CHANNEL;
+
+ } else if (this->audio_caps & AO_CAP_MODE_5CHANNEL) {
+
+ this->a52_flags_map[A52_2F2R] = A52_2F2R;
+ this->a52_flags_map[A52_3F2R] = A52_3F2R;
+ this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_5CHANNEL;
+
+ } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
+
+ this->a52_flags_map[A52_2F2R] = A52_2F2R;
+ this->a52_flags_map[A52_3F2R] = A52_2F2R | A52_LFE;
+ this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_4CHANNEL;
+
+ } else if (this->audio_caps & AO_CAP_MODE_4CHANNEL) {
+
+ this->a52_flags_map[A52_2F2R] = A52_2F2R;
+ this->a52_flags_map[A52_3F2R] = A52_2F2R;
+
+ this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_4CHANNEL;
+
+ /* else if (this->audio_caps & AO_CAP_MODE_STEREO)
+ defaults are ok */
+ } else if (!(this->audio_caps & AO_CAP_MODE_STEREO)) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("HELP! a mono-only audio driver?!\n"));
+
+ this->a52_flags_map[A52_MONO] = A52_MONO;
+ this->a52_flags_map[A52_STEREO] = A52_MONO;
+ this->a52_flags_map[A52_3F] = A52_MONO;
+ this->a52_flags_map[A52_2F1R] = A52_MONO;
+ this->a52_flags_map[A52_3F1R] = A52_MONO;
+ this->a52_flags_map[A52_2F2R] = A52_MONO;
+ this->a52_flags_map[A52_3F2R] = A52_MONO;
+ this->a52_flags_map[A52_DOLBY] = A52_MONO;
+
+ this->ao_flags_map[A52_MONO] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_STEREO] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_3F] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_2F1R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_3F1R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[A52_DOLBY] = AO_CAP_MODE_MONO;
+ }
+ }
+
+ /*
+ for (i = 0; i<8; i++)
+ this->a52_flags_map[i] |= A52_ADJUST_LEVEL;
+ */
+#ifdef DEBUG_A52
+ a52file = xine_create_cloexec("test.a52", O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
+#endif
+ return &this->audio_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ a52dec_class_t *this;
+ config_values_t *cfg;
+
+ this = calloc(1, sizeof (a52dec_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "a/52dec";
+ this->decoder_class.description = N_("liba52 based a52 audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ this->av_crc = av_crc_get_table(AV_CRC_16_ANSI);
+
+ cfg = this->config = xine->config;
+
+ this->a52_level = (float) cfg->register_range (cfg, "audio.a52.level", 100,
+ 0, 200,
+ _("A/52 volume"),
+ _("With A/52 audio, you can modify the volume "
+ "at the decoder level. This has the advantage "
+ "of the audio being already decoded for the "
+ "specified volume, so later operations like "
+ "channel downmixing will work on an audio stream "
+ "of the given volume."),
+ 10, a52_level_change_cb, this) / 100.0;
+ this->disable_dynrng_compress = !cfg->register_bool (cfg, "audio.a52.dynamic_range", 0,
+ _("use A/52 dynamic range compression"),
+ _("Dynamic range compression limits the dynamic "
+ "range of the audio. This means making the loud "
+ "sounds softer, and the soft sounds louder, so you can "
+ "more easily listen to the audio in a noisy "
+ "environment without disturbing anyone."),
+ 0, dynrng_compress_change_cb, this);
+ this->enable_surround_downmix = cfg->register_bool (cfg, "audio.a52.surround_downmix", 0,
+ _("downmix audio to 2 channel surround stereo"),
+ _("When you want to listen to multichannel surround "
+ "sound, but you have only two speakers or a "
+ "surround decoder or amplifier which does some "
+ "sort of matrix surround decoding like prologic, "
+ "you should enable this option so that the "
+ "additional channels are mixed into the stereo "
+ "signal."),
+ 0, surround_downmix_change_cb, this);
+ lprintf ("init_plugin called\n");
+ return this;
+}
+
+static void a52_level_change_cb(void *this_gen, xine_cfg_entry_t *entry)
+{
+ ((a52dec_class_t *)this_gen)->a52_level = entry->num_value / 100.0;
+}
+
+static void dynrng_compress_change_cb(void *this_gen, xine_cfg_entry_t *entry)
+{
+ ((a52dec_class_t *)this_gen)->disable_dynrng_compress = !entry->num_value;
+}
+
+static void surround_downmix_change_cb(void *this_gen, xine_cfg_entry_t *entry)
+{
+ ((a52dec_class_t *)this_gen)->enable_surround_downmix = entry->num_value;
+}
+
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_A52,
+ BUF_AUDIO_DNET,
+ 0
+ };
+
+static const decoder_info_t dec_info_audio = {
+ 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 | PLUGIN_MUST_PRELOAD, 16, "a/52", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/xine_dts_decoder.c b/src/audio_dec/xine_dts_decoder.c
new file mode 100644
index 000000000..9711650a4
--- /dev/null
+++ b/src/audio_dec/xine_dts_decoder.c
@@ -0,0 +1,590 @@
+/*
+ * Copyright (C) 2000-2007 the xine project
+ *
+ * This file is part of xine, a unix 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, USA
+ */
+
+/**
+ * @file
+ * @brief DTS decoder for xine
+ *
+ * @author Joachim Koenig (2001-09-04)
+ * @author James Courtier-Dutton (2001-12-09)
+ */
+
+#ifndef __sun
+/* required for swab() */
+#define _XOPEN_SOURCE 500
+#endif
+/* avoid compiler warnings */
+#define _BSD_SOURCE 1
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <assert.h>
+
+#define LOG_MODULE "libdts"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+
+#include "bswap.h"
+
+#include <dts.h>
+
+#define MAX_AC5_FRAME 4096
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} dts_class_t;
+
+typedef struct {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+ audio_decoder_class_t *class;
+
+ dts_state_t *dts_state;
+ int64_t pts;
+
+ int audio_caps;
+ int sync_state;
+ int ac5_length, ac5_pcm_length, frame_todo;
+ uint32_t syncdword;
+ uint8_t frame_buffer[MAX_AC5_FRAME];
+ uint8_t *frame_ptr;
+
+ int output_open;
+
+ int bypass_mode;
+ int dts_flags;
+ int dts_sample_rate;
+ int dts_bit_rate;
+ int dts_flags_map[11]; /* Convert from stream dts_flags to the dts_flags we want from the dts downmixer */
+ int ao_flags_map[11]; /* Convert from the xine AO_CAP's to dts_flags. */
+ int have_lfe;
+
+
+} dts_decoder_t;
+
+static void dts_reset (audio_decoder_t *const this_gen) {
+}
+
+static void dts_discontinuity (audio_decoder_t *const this_gen) {
+}
+
+/**
+ * @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 *const s16, const int num_channels) {
+ const int endidx = 256 * num_channels;
+ int i;
+
+ for (i = 0; i < endidx; i += num_channels)
+ s16[i] = 0;
+}
+
+static void dts_decode_frame (dts_decoder_t *this, const int64_t pts) {
+
+ audio_buffer_t *audio_buffer;
+ uint32_t ac5_spdif_type=0;
+ int output_mode = AO_CAP_MODE_STEREO;
+ uint8_t *data_out;
+ uint8_t *const data_in = this->frame_buffer;
+
+ lprintf("decode_frame\n");
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+ audio_buffer->vpts = pts;
+
+ if(this->bypass_mode) {
+ /* SPDIF digital output */
+ if (!this->output_open) {
+ this->output_open = ((this->stream->audio_out->open) (this->stream->audio_out, this->stream,
+ 16, this->dts_sample_rate,
+ AO_CAP_MODE_AC5));
+ }
+
+ if (!this->output_open)
+ return;
+
+ data_out=(uint8_t *) audio_buffer->mem;
+ if (this->ac5_length > 8191) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: ac5_length too long\n");
+ this->ac5_pcm_length = 0;
+ }
+
+ switch (this->ac5_pcm_length) {
+ case 512:
+ ac5_spdif_type = 0x0b; /* DTS-1 (512-sample bursts) */
+ break;
+ case 1024:
+ ac5_spdif_type = 0x0c; /* DTS-1 (1024-sample bursts) */
+ break;
+ case 2048:
+ ac5_spdif_type = 0x0d; /* DTS-1 (2048-sample bursts) */
+ break;
+ default:
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libdts: DTS %i-sample bursts not supported\n", this->ac5_pcm_length);
+ return;
+ }
+
+#ifdef LOG_DEBUG
+ {
+ int i;
+ printf("libdts: DTS frame type=%d\n",data_in[4] >> 7);
+ printf("libdts: DTS deficit frame count=%d\n",(data_in[4] & 0x7f) >> 2);
+ printf("libdts: DTS AC5 PCM samples=%d\n",ac5_pcm_samples);
+ printf("libdts: DTS AC5 length=%d\n",this->ac5_length);
+ printf("libdts: DTS AC5 bitrate=%d\n",((data_in[8] & 0x03) << 4) | (data_in[8] >> 4));
+ printf("libdts: DTS AC5 spdif type=%d\n", ac5_spdif_type);
+
+ printf("libdts: ");
+ for(i=2000;i<2048;i++) {
+ printf("%02x ",data_in[i]);
+ }
+ printf("\n");
+ }
+#endif
+
+ lprintf("length=%d pts=%"PRId64"\n",this->ac5_pcm_length,audio_buffer->vpts);
+
+ audio_buffer->num_frames = this->ac5_pcm_length;
+
+ // Checking if AC5 data plus IEC958 header will fit into frames samples data
+ if ( this->ac5_length + 8 <= this->ac5_pcm_length * 2 * 2 ) {
+ data_out[0] = 0x72; data_out[1] = 0xf8; /* spdif syncword */
+ data_out[2] = 0x1f; data_out[3] = 0x4e; /* .............. */
+ data_out[4] = ac5_spdif_type; /* DTS data */
+ data_out[5] = 0; /* Unknown */
+ data_out[6] = (this->ac5_length << 3) & 0xff; /* ac5_length * 8 */
+ data_out[7] = ((this->ac5_length ) >> 5) & 0xff;
+
+ if( this->ac5_pcm_length ) {
+ if( this->ac5_pcm_length % 2) {
+ swab(data_in, &data_out[8], this->ac5_length );
+ } else {
+ swab(data_in, &data_out[8], this->ac5_length + 1);
+ }
+ }
+ // Transmit it without header otherwise, receivers will autodetect DTS
+ } else {
+ lprintf("AC5 data is too large (%i > %i), sending without IEC958 header\n",
+ this->ac5_length + 8, this->ac5_pcm_length * 2 * 2);
+ memcpy(data_out, data_in, this->ac5_length);
+ }
+ } else {
+ /* Software decode */
+ int i, dts_output_flags;
+ int16_t *const int_samples = audio_buffer->mem;
+ int number_of_dts_blocks;
+
+ level_t level = 1.0;
+ sample_t *samples;
+
+ dts_output_flags = this->dts_flags_map[this->dts_flags & DTS_CHANNEL_MASK];
+
+ if(dts_frame(this->dts_state, data_in, &dts_output_flags, &level, 0)) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: dts_frame error\n");
+ return;
+ }
+
+ this->have_lfe = dts_output_flags & DTS_LFE;
+ if (this->have_lfe)
+ if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
+ output_mode = AO_CAP_MODE_5_1CHANNEL;
+ } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
+ output_mode = AO_CAP_MODE_4_1CHANNEL;
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: WHAT DO I DO!!!\n");
+ output_mode = this->ao_flags_map[dts_output_flags & DTS_CHANNEL_MASK];
+ }
+ else
+ output_mode = this->ao_flags_map[dts_output_flags & DTS_CHANNEL_MASK];
+
+ if (!this->output_open) {
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream,
+ 16, this->dts_sample_rate,
+ output_mode);
+ }
+
+ if (!this->output_open)
+ return;
+ number_of_dts_blocks = dts_blocks_num (this->dts_state);
+ audio_buffer->num_frames = 256*number_of_dts_blocks;
+ for(i = 0; i < number_of_dts_blocks; i++) {
+ if(dts_block(this->dts_state)) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libdts: dts_block error on audio channel %d\n", i);
+ audio_buffer->num_frames = 0;
+ break;
+ }
+
+ samples = dts_samples(this->dts_state);
+ switch (output_mode) {
+ case AO_CAP_MODE_MONO:
+ float_to_int (&samples[0], int_samples+(i*256), 1);
+ break;
+ case AO_CAP_MODE_STEREO:
+ /* Tested, working. */
+ float_to_int (&samples[0*256], int_samples+(i*256*2), 2); /* L */
+ float_to_int (&samples[1*256], int_samples+(i*256*2)+1, 2); /* R */
+ break;
+ case AO_CAP_MODE_4CHANNEL:
+ /* Tested, working */
+ float_to_int (&samples[0*256], int_samples+(i*256*4), 4); /* L */
+ float_to_int (&samples[1*256], int_samples+(i*256*4)+1, 4); /* R */
+ float_to_int (&samples[2*256], int_samples+(i*256*4)+2, 4); /* RL */
+ float_to_int (&samples[3*256], int_samples+(i*256*4)+3, 4); /* RR */
+ break;
+ case AO_CAP_MODE_4_1CHANNEL:
+ /* Tested, working */
+ float_to_int (&samples[0*256], int_samples+(i*256*6)+0, 6); /* L */
+ float_to_int (&samples[1*256], int_samples+(i*256*6)+1, 6); /* R */
+ float_to_int (&samples[2*256], int_samples+(i*256*6)+2, 6); /* RL */
+ float_to_int (&samples[3*256], int_samples+(i*256*6)+3, 6); /* RR */
+ float_to_int (&samples[4*256], int_samples+(i*256*6)+5, 6); /* LFE */
+ mute_channel ( int_samples+(i*256*6)+4, 6); /* C */
+ break;
+ case AO_CAP_MODE_5CHANNEL:
+ /* Tested, working */
+ float_to_int (&samples[0*256], int_samples+(i*256*6)+4, 6); /* C */
+ float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
+ float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
+ float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
+ float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
+ mute_channel ( int_samples+(i*256*6)+5, 6); /* LFE */
+ break;
+ case AO_CAP_MODE_5_1CHANNEL:
+ float_to_int (&samples[0*256], int_samples+(i*256*6)+4, 6); /* C */
+ float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
+ float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
+ float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
+ float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
+ float_to_int (&samples[5*256], int_samples+(i*256*6)+5, 6); /* LFE */ /* Not working yet */
+ break;
+ default:
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: help - unsupported mode %08x\n", output_mode);
+ }
+ }
+ }
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+
+}
+
+static void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ 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 *const end = buf->content + buf->size;
+
+ lprintf("decode_data\n");
+
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER)
+ return;
+
+ lprintf ("processing...state %d\n", this->sync_state);
+
+ while (current < end) {
+ switch (this->sync_state) {
+ case 0: /* Looking for sync header */
+ this->syncdword = (this->syncdword << 8) | *current++;
+/*
+ if ((this->syncdword == 0xff1f00e8) ||
+ (this->syncdword == 0x1fffe800) ||
+ (this->syncdword == 0xfe7f0180) ||
+ (this->syncdword == 0x7ffe8001) ) {
+*/
+
+ 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);
+
+ 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;
+
+ case 1: /* Looking for enough bytes for sync_info. */
+ sync_start = current - 1;
+ *this->frame_ptr++ = *current++;
+ if ((this->frame_ptr - this->frame_buffer) > 19) {
+ 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,
+ &this->dts_sample_rate,
+ &this->dts_bit_rate, &(this->ac5_pcm_length));
+ lprintf("ac5_length=%d\n",this->ac5_length);
+ lprintf("dts_sample_rate=%d\n",this->dts_sample_rate);
+
+ if ( (this->ac5_length < 80) || (this->ac5_length > MAX_AC5_FRAME) ) { /* Invalid dts ac5_pcm_length */
+ this->syncdword = 0;
+ current = sync_start;
+ this->sync_state = 0;
+ break;
+ }
+
+ lprintf("Frame length = %d\n",this->ac5_pcm_length);
+
+ this->frame_todo = this->ac5_length - 20;
+ this->sync_state = 2;
+ if (!_x_meta_info_get(this->stream, XINE_META_INFO_AUDIOCODEC) ||
+ old_dts_flags != this->dts_flags ||
+ old_dts_sample_rate != this->dts_sample_rate ||
+ old_dts_bit_rate != this->dts_bit_rate) {
+
+ switch (this->dts_flags & DTS_CHANNEL_MASK) {
+ case DTS_3F2R:
+ if (this->dts_flags & DTS_LFE)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 5.1");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 5.0");
+ break;
+ case DTS_3F1R:
+ case DTS_2F2R:
+ if (this->dts_flags & DTS_LFE)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 4.1");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 4.0");
+ break;
+ case DTS_2F1R:
+ case DTS_3F:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 3.0");
+ break;
+ case DTS_STEREO:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 2.0 (stereo)");
+ break;
+ case DTS_MONO:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 1.0");
+ break;
+ default:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS");
+ break;
+ }
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, this->dts_bit_rate);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->dts_sample_rate);
+ }
+ }
+ break;
+
+ case 2: /* Filling frame_buffer with sync_info bytes */
+ *this->frame_ptr++ = *current++;
+ this->frame_todo--;
+ if (this->frame_todo < 1) {
+ this->sync_state = 3;
+ } else break;
+
+ case 3: /* Ready for decode */
+#if 0
+ dtsdec_decode_frame (this, this->pts_list[0]);
+#else
+ dts_decode_frame (this, this->pts);
+#endif
+ case 4: /* Clear up ready for next frame */
+ this->pts = 0;
+ this->syncdword = 0;
+ this->sync_state = 0;
+ break;
+ default: /* No come here */
+ break;
+ }
+ }
+}
+
+static void dts_dispose (audio_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);
+
+ free (this);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+ dts_decoder_t *this ;
+
+ lprintf("open_plugin\n");
+
+ this = calloc(1, sizeof (dts_decoder_t));
+
+ this->audio_decoder.decode_data = dts_decode_data;
+ this->audio_decoder.reset = dts_reset;
+ this->audio_decoder.discontinuity = dts_discontinuity;
+ this->audio_decoder.dispose = dts_dispose;
+
+ this->dts_state = dts_init(0);
+ this->audio_caps = stream->audio_out->get_capabilities(stream->audio_out);
+ if(this->audio_caps & AO_CAP_MODE_AC5)
+ this->bypass_mode = 1;
+ 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;
+ this->dts_flags_map[DTS_2F1R] = DTS_STEREO;
+ this->dts_flags_map[DTS_3F1R] = DTS_STEREO;
+ this->dts_flags_map[DTS_2F2R] = DTS_STEREO;
+ this->dts_flags_map[DTS_3F2R] = DTS_STEREO;
+
+ this->ao_flags_map[DTS_MONO] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_STEREO] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[DTS_3F] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[DTS_2F1R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[DTS_3F1R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_STEREO;
+ this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_STEREO;
+
+ /* find best mode */
+ if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
+
+ this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
+ this->dts_flags_map[DTS_3F2R] = DTS_3F2R | DTS_LFE;
+ this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_5CHANNEL;
+
+ } else if (this->audio_caps & AO_CAP_MODE_5CHANNEL) {
+
+ this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
+ this->dts_flags_map[DTS_3F2R] = DTS_3F2R;
+ this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_5CHANNEL;
+
+ } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
+
+ this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
+ this->dts_flags_map[DTS_3F2R] = DTS_2F2R | DTS_LFE;
+ this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_4CHANNEL;
+
+ } else if (this->audio_caps & AO_CAP_MODE_4CHANNEL) {
+
+ this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
+ this->dts_flags_map[DTS_3F2R] = DTS_2F2R;
+
+ this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
+ this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_4CHANNEL;
+
+ /* else if (this->audio_caps & AO_CAP_MODE_STEREO)
+ defaults are ok */
+ } else if (!(this->audio_caps & AO_CAP_MODE_STEREO)) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("HELP! a mono-only audio driver?!\n"));
+
+ this->dts_flags_map[DTS_MONO] = DTS_MONO;
+ this->dts_flags_map[DTS_STEREO] = DTS_MONO;
+ this->dts_flags_map[DTS_3F] = DTS_MONO;
+ this->dts_flags_map[DTS_2F1R] = DTS_MONO;
+ this->dts_flags_map[DTS_3F1R] = DTS_MONO;
+ this->dts_flags_map[DTS_2F2R] = DTS_MONO;
+ this->dts_flags_map[DTS_3F2R] = DTS_MONO;
+
+ this->ao_flags_map[DTS_MONO] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_STEREO] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_3F] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_2F1R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_3F1R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_MONO;
+ this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_MONO;
+ }
+ }
+ this->stream = stream;
+ this->class = class_gen;
+ this->output_open = 0;
+
+ return &this->audio_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+ dts_class_t *this ;
+
+ lprintf("init_plugin\n");
+
+ this = calloc(1, sizeof (dts_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "DTS";
+ this->decoder_class.description = N_("DTS passthru audio format decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_DTS, 0
+ };
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 16, "dts", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/xine_faad_decoder.c b/src/audio_dec/xine_faad_decoder.c
new file mode 100644
index 000000000..be495ee8f
--- /dev/null
+++ b/src/audio_dec/xine_faad_decoder.c
@@ -0,0 +1,506 @@
+/*
+ * Copyright (C) 2000-2005 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, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define LOG_MODULE "libfaad"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#ifdef HAVE_NEAACDEC_H
+#include <neaacdec.h>
+#else
+#include "common.h"
+#include "structs.h"
+#include "decoder.h"
+#include "syntax.h"
+#endif
+
+#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} faad_class_t;
+
+typedef struct faad_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ /* faad2 stuff */
+ NeAACDecHandle faac_dec;
+ NeAACDecConfigurationPtr faac_cfg;
+ NeAACDecFrameInfo faac_finfo;
+ int faac_failed;
+
+ int raw_mode;
+
+ unsigned char *buf;
+ int size;
+ int rec_audio_src_size;
+ int max_audio_src_size;
+ int64_t pts;
+
+ unsigned char *dec_config;
+ int dec_config_size;
+
+ unsigned long rate;
+ int bits_per_sample;
+ unsigned char num_channels;
+ int sbr;
+
+ int output_open;
+
+ unsigned long total_time;
+ unsigned long total_data;
+} faad_decoder_t;
+
+
+static void faad_reset (audio_decoder_t *this_gen) {
+
+ faad_decoder_t *this = (faad_decoder_t *) this_gen;
+ this->size = 0;
+}
+
+static void faad_meta_info_set ( faad_decoder_t *this ) {
+ switch (this->num_channels) {
+ case 1:
+ if (this->faac_finfo.sbr == SBR_UPSAMPLED)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "HE-AAC 1.0 (libfaad)");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "AAC 1.0 (libfaad)");
+ break;
+ case 2:
+ /* check if this is downmixed 5.1 */
+ if (!this->faac_cfg || !this->faac_cfg->downMatrix) {
+ if (this->faac_finfo.sbr == SBR_UPSAMPLED)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "HE-AAC 2.0 (libfaad)");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "AAC 2.0 (libfaad)");
+ break;
+ }
+ case 6:
+ if (this->faac_finfo.sbr == SBR_UPSAMPLED)
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "HE-AAC 5.1 (libfaad)");
+ else
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "AAC 5.1 (libfaad)");
+ break;
+ }
+}
+
+static int faad_open_dec( faad_decoder_t *this ) {
+ int used;
+
+ this->faac_dec = NeAACDecOpen();
+ if( !this->faac_dec ) {
+ xprintf( this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libfaad: libfaad NeAACDecOpen() failed.\n"));
+ this->faac_failed++;
+ } else {
+ if( this->dec_config ) {
+ used = NeAACDecInit2(this->faac_dec, this->dec_config, this->dec_config_size,
+ &this->rate, &this->num_channels);
+
+ if( used < 0 ) {
+ xprintf( this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libfaad: libfaad NeAACDecInit2 failed.\n"));
+ this->faac_failed++;
+ } else
+ lprintf( "NeAACDecInit2 returned rate=%"PRId32" channels=%d\n",
+ this->rate, this->num_channels );
+ } else {
+ used = NeAACDecInit(this->faac_dec, this->buf, this->size,
+ &this->rate, &this->num_channels);
+
+ if( used < 0 ) {
+ xprintf ( this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libfaad: libfaad NeAACDecInit failed.\n"));
+ this->faac_failed++;
+ } else {
+ lprintf( "NeAACDecInit() returned rate=%"PRId32" channels=%d (used=%d)\n",
+ this->rate, this->num_channels, used);
+
+ this->size -= used;
+ memmove( this->buf, &this->buf[used], this->size );
+ }
+ }
+ }
+
+ if( !this->bits_per_sample )
+ this->bits_per_sample = 16;
+
+ if( this->faac_failed ) {
+ if( this->faac_dec ) {
+ NeAACDecClose( this->faac_dec );
+ this->faac_dec = NULL;
+ }
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
+ } else {
+ faad_meta_info_set(this);
+ }
+
+ return this->faac_failed;
+}
+
+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:
+ 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) {
+ ao_cap_mode = AO_CAP_MODE_5_1CHANNEL;
+ break;
+ } else {
+ this->faac_cfg = NeAACDecGetCurrentConfiguration(this->faac_dec);
+ this->faac_cfg->downMatrix = 1;
+ NeAACDecSetConfiguration(this->faac_dec, this->faac_cfg);
+ this->num_channels = 2;
+ }
+ case 2:
+ ao_cap_mode=AO_CAP_MODE_STEREO;
+ break;
+ default:
+ return 0;
+ }
+
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream,
+ this->bits_per_sample,
+ this->rate,
+ ao_cap_mode) ;
+ return this->output_open;
+}
+
+static void faad_decode_audio ( faad_decoder_t *this, int end_frame ) {
+ int used, decoded, outsize;
+ uint8_t *sample_buffer;
+ uint8_t *inbuf;
+ audio_buffer_t *audio_buffer;
+ int sample_size = this->size;
+
+ if( !this->faac_dec )
+ return;
+
+ inbuf = this->buf;
+ while( (!this->raw_mode && end_frame && this->size >= 10) ||
+ (this->raw_mode && this->size >= this->rec_audio_src_size) ) {
+
+ sample_buffer = NeAACDecDecode(this->faac_dec,
+ &this->faac_finfo, inbuf, sample_size);
+
+ if( !sample_buffer ) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libfaad: %s\n", NeAACDecGetErrorMessage(this->faac_finfo.error));
+ used = 1;
+ } else {
+ used = this->faac_finfo.bytesconsumed;
+
+ /* raw AAC parameters might only be known after decoding the first frame */
+ if( !this->dec_config &&
+ (this->num_channels != this->faac_finfo.channels ||
+ this->rate != this->faac_finfo.samplerate) ) {
+
+ this->num_channels = this->faac_finfo.channels;
+ this->rate = this->faac_finfo.samplerate;
+
+ lprintf("NeAACDecDecode() returned rate=%"PRId32" channels=%d used=%d\n",
+ this->rate, this->num_channels, used);
+
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+ this->output_open = 0;
+ faad_open_output( this );
+
+ faad_meta_info_set( this );
+ }
+
+ /* faad doesn't tell us about sbr until after the first frame */
+ if (this->sbr != this->faac_finfo.sbr) {
+ this->sbr = this->faac_finfo.sbr;
+ faad_meta_info_set( this );
+ }
+
+ /* estimate bitrate */
+ this->total_time += (1000*this->faac_finfo.samples/(this->rate*this->num_channels));
+ this->total_data += 8*used;
+
+ if ((this->total_time > LONG_MAX) || (this->total_data > LONG_MAX)) {
+ this->total_time >>= 2;
+ this->total_data >>= 2;
+ }
+
+ if (this->total_time)
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
+ 1000*(this->total_data/this->total_time));
+
+ decoded = this->faac_finfo.samples * 2; /* 1 sample = 2 bytes */
+
+ lprintf("decoded %d/%d output %ld\n",
+ used, this->size, this->faac_finfo.samples );
+
+ /* Performing necessary channel reordering because aac uses a different
+ * layout than alsa:
+ *
+ * aac 5.1 channel layout: c l r ls rs lfe
+ * alsa 5.1 channel layout: l r ls rs c lfe
+ *
+ * Reordering is only necessary for 5.0 and above. Currently only 5.0
+ * and 5.1 is being taken care of, the rest will stay in the wrong order
+ * for now.
+ *
+ * WARNING: the following needs a output format of 16 bits per sample.
+ * TODO: - reorder while copying (in the while() loop) and optimizing
+ */
+ if(this->num_channels == 5 || this->num_channels == 6)
+ {
+ int i = 0;
+ uint16_t* buf = (uint16_t*)(sample_buffer);
+
+ for(; i < this->faac_finfo.samples; i += this->num_channels) {
+ uint16_t center = buf[i];
+ *((uint64_t*)(buf + i)) = *((uint64_t*)(buf + i + 1));
+ buf[i + 4] = center;
+ }
+ }
+
+ while( decoded ) {
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+
+ if( decoded < audio_buffer->mem_size )
+ outsize = decoded;
+ else
+ outsize = audio_buffer->mem_size;
+
+ xine_fast_memcpy( audio_buffer->mem, sample_buffer, outsize );
+
+ audio_buffer->num_frames = outsize / (this->num_channels*2);
+ audio_buffer->vpts = this->pts;
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+ this->pts = 0;
+ decoded -= outsize;
+ sample_buffer += outsize;
+ }
+ }
+
+ if(used >= this->size){
+ this->size = 0;
+ } else {
+ this->size -= used;
+ inbuf += used;
+ }
+
+ if( !this->raw_mode )
+ this->size = 0;
+ }
+
+ if( this->size )
+ memmove( this->buf, inbuf, this->size);
+
+}
+
+static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ faad_decoder_t *this = (faad_decoder_t *) this_gen;
+
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ /* store config information from ESDS mp4/qt atom */
+ if( !this->faac_dec && (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
+ buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG ) {
+
+ this->dec_config = malloc(buf->decoder_info[2]);
+ this->dec_config_size = buf->decoder_info[2];
+ memcpy(this->dec_config, buf->decoder_info_ptr[2], buf->decoder_info[2]);
+
+ if( faad_open_dec(this) )
+ return;
+
+ this->raw_mode = 0;
+ }
+
+ /* get audio parameters from file header
+ (may be overwritten by libfaad returned parameters) */
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
+ this->rate=buf->decoder_info[1];
+ this->bits_per_sample=buf->decoder_info[2] ;
+ this->num_channels=buf->decoder_info[3] ;
+
+ if( buf->size > sizeof(xine_waveformatex) ) {
+ xine_waveformatex *wavex = (xine_waveformatex *) buf->content;
+
+ if( wavex->cbSize > 0 ) {
+ this->dec_config = malloc(wavex->cbSize);
+ this->dec_config_size = wavex->cbSize;
+ memcpy(this->dec_config, buf->content + sizeof(xine_waveformatex),
+ wavex->cbSize);
+
+ if( faad_open_dec(this) )
+ return;
+
+ this->raw_mode = 0;
+ }
+ }
+ } else {
+
+ lprintf ("decoding %d data bytes...\n", buf->size);
+
+ if( (int)buf->size <= 0 || this->faac_failed )
+ return;
+
+ if( !this->size )
+ this->pts = buf->pts;
+
+ if( this->size + buf->size > this->max_audio_src_size ) {
+ this->max_audio_src_size = this->size + 2 * buf->size;
+ this->buf = realloc( this->buf, this->max_audio_src_size );
+ }
+
+ memcpy (&this->buf[this->size], buf->content, buf->size);
+ this->size += buf->size;
+
+ if( !this->faac_dec && faad_open_dec(this) )
+ return;
+
+ /* open audio device as needed */
+ if (!this->output_open) {
+ faad_open_output( this );
+ }
+
+ faad_decode_audio(this, buf->decoder_flags & BUF_FLAG_FRAME_END );
+ }
+}
+
+static void faad_discontinuity (audio_decoder_t *this_gen) {
+}
+
+static void faad_dispose (audio_decoder_t *this_gen) {
+
+ faad_decoder_t *this = (faad_decoder_t *) this_gen;
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+ this->output_open = 0;
+
+ if( this->buf )
+ free(this->buf);
+ this->buf = NULL;
+ this->size = 0;
+ this->max_audio_src_size = 0;
+
+ if( this->dec_config )
+ free(this->dec_config);
+ this->dec_config = NULL;
+ this->dec_config_size = 0;
+
+ if( this->faac_dec )
+ NeAACDecClose(this->faac_dec);
+ this->faac_dec = NULL;
+ this->faac_failed = 0;
+
+ free (this);
+}
+
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ faad_decoder_t *this ;
+
+ this = calloc(1, sizeof (faad_decoder_t));
+
+ this->audio_decoder.decode_data = faad_decode_data;
+ this->audio_decoder.reset = faad_reset;
+ this->audio_decoder.discontinuity = faad_discontinuity;
+ this->audio_decoder.dispose = faad_dispose;
+
+ this->stream = stream;
+ this->output_open = 0;
+ this->raw_mode = 1;
+ this->faac_dec = NULL;
+ this->faac_failed = 0;
+ this->buf = NULL;
+ this->size = 0;
+ this->max_audio_src_size = 0;
+ this->dec_config = NULL;
+ this->dec_config_size = 0;
+ this->total_time = 0;
+ this->total_data = 0;
+
+ this->rate = 0;
+
+ return &this->audio_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ faad_class_t *this ;
+
+ this = calloc(1, sizeof (faad_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "FAAD";
+ this->decoder_class.description = N_("Freeware Advanced Audio Decoder");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_AAC, 0
+ };
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 16, "faad", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/xine_lpcm_decoder.c b/src/audio_dec/xine_lpcm_decoder.c
new file mode 100644
index 000000000..db4a79fff
--- /dev/null
+++ b/src/audio_dec/xine_lpcm_decoder.c
@@ -0,0 +1,409 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/**
+ * @file
+ * @author James Courtier-Dutton <james@superbug.demon.co.uk>
+ *
+ * @date 2001-08-31 Added LPCM rate sensing
+ */
+
+#ifndef __sun
+#define _XOPEN_SOURCE 500
+#endif
+/* avoid compiler warnings */
+#define _BSD_SOURCE 1
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <netinet/in.h> /* ntohs */
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+
+#ifdef WIN32
+#include <winsock.h>
+/*#include <Winsock2.h>*/ /* htons */
+#endif
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} lpcm_class_t;
+
+typedef struct lpcm_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ uint32_t rate;
+ uint32_t bits_per_sample;
+ uint32_t number_of_channels;
+ uint32_t ao_cap_mode;
+
+ int output_open;
+ int cpu_be; /* TRUE, if we're a Big endian CPU */
+
+ int64_t pts;
+
+ uint8_t *buf;
+ size_t buffered_bytes;
+ size_t buf_size;
+
+} lpcm_decoder_t;
+
+static void lpcm_reset (audio_decoder_t *this_gen) {
+
+ lpcm_decoder_t *this = (lpcm_decoder_t *) this_gen;
+
+ free (this->buf);
+ this->buf = NULL;
+}
+
+static void lpcm_discontinuity (audio_decoder_t *this_gen) {
+
+ lpcm_reset(this_gen);
+}
+
+static void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ lpcm_decoder_t *this = (lpcm_decoder_t *) this_gen;
+ int16_t *sample_buffer=(int16_t *)buf->content;
+ int buf_size = buf->size;
+ int stream_be;
+ audio_buffer_t *audio_buffer;
+ int format_changed = 0;
+ int special_dvd_audio = 0;
+
+ /* Drop preview data */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ /* get config byte from mpeg2 stream */
+ if ( (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
+ buf->decoder_info[1] == BUF_SPECIAL_LPCM_CONFIG ) {
+ unsigned int bits_per_sample = 16;
+ unsigned int sample_rate = 0;
+ unsigned int num_channels;
+
+ lprintf("lpcm_decoder: config data 0x%x\n", buf->decoder_info[2]);
+
+ /* BluRay PCM header is 4 bytes */
+ if (buf->decoder_info[2] & 0xffffff00) {
+ static const uint8_t channels[16] = {0, 1, 0, 2, 3, 3, 4, 4, 5, 6, 7, 8, 0, 0, 0, 0};
+
+ num_channels = channels[(buf->decoder_info[2] >> (16+4)) & 0x0f];
+ switch ((buf->decoder_info[2] >> (24+6)) & 0x03) {
+ case 1: bits_per_sample = 16; break;
+ case 2: /*bits_per_sample = 20; break;*/
+ /* fall thru. Samples are 0-padded to 24 bits, and
+ * converted later to 16 bits by dropping 8 lowest bits.
+ * this needs to be changed if audio out some day accepts 24bit samples.
+ */
+ case 3: bits_per_sample = 24; break;
+ default: bits_per_sample = 0; break;
+ }
+ switch ((buf->decoder_info[2] >> 16) & 0x0f) {
+ case 1: sample_rate = 48000; break;
+ case 4: sample_rate = 96000; break;
+ case 5: sample_rate = 192000; break;
+ default: sample_rate = 0; break;
+ }
+
+ if (!num_channels || !sample_rate || !bits_per_sample)
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ "lpcm_decoder: unsupported BluRay PCM format: 0x%08x\n", buf->decoder_info[2]);
+
+ if (this->buffered_bytes)
+ xine_log (this->stream->xine, XINE_LOG_MSG, "lpcm_decoder: %zd bytes lost !\n", this->buffered_bytes);
+
+ if (!this->buf) {
+ this->buffered_bytes = 0;
+ this->buf_size = 8128;
+ this->buf = malloc(this->buf_size);
+ }
+
+ } else {
+
+ /* MPEG2/DVD PCM header is one byte */
+ num_channels = (buf->decoder_info[2] & 0x7) + 1;
+ switch ((buf->decoder_info[2]>>4) & 3) {
+ case 0: sample_rate = 48000; break;
+ case 1: sample_rate = 96000; break;
+ case 2: sample_rate = 44100; break;
+ case 3: sample_rate = 32000; break;
+ }
+ switch ((buf->decoder_info[2]>>6) & 3) {
+ case 0: bits_per_sample = 16; break;
+ case 1: bits_per_sample = 20; break;
+ case 2: bits_per_sample = 24; special_dvd_audio = 1; break;
+ }
+ }
+
+ if( this->bits_per_sample != bits_per_sample ||
+ this->number_of_channels != num_channels ||
+ this->rate != sample_rate ||
+ !this->output_open ) {
+ this->bits_per_sample = bits_per_sample;
+ this->number_of_channels = num_channels;
+ this->rate = sample_rate;
+ format_changed++;
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "lpcm_decoder: format changed to %d channels, %d bits per sample, %d Hz, %d kbit/s\n",
+ num_channels, bits_per_sample, sample_rate, (num_channels * sample_rate * bits_per_sample)/1024);
+ }
+ }
+
+ if( buf->decoder_flags & BUF_FLAG_STDHEADER ) {
+ this->rate=buf->decoder_info[1];
+ this->bits_per_sample=buf->decoder_info[2];
+ this->number_of_channels=buf->decoder_info[3];
+ format_changed++;
+ }
+
+ /*
+ * (re-)open output device
+ */
+ if ( format_changed ) {
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+ this->ao_cap_mode=_x_ao_channels2mode(this->number_of_channels);
+
+ /* force 24-bit samples into 16 bits for now */
+ if (this->bits_per_sample == 24)
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream,
+ 16,
+ this->rate,
+ this->ao_cap_mode) ;
+ else
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream,
+ this->bits_per_sample,
+ this->rate,
+ this->ao_cap_mode) ;
+
+ /* stream/meta info */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Linear PCM");
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
+ this->bits_per_sample * this->rate * this->number_of_channels);
+ }
+
+ if (!this->output_open || (buf->decoder_flags & BUF_FLAG_HEADER) )
+ return;
+
+ if (buf->pts && !this->pts)
+ this->pts = buf->pts;
+
+ /* data accumulation */
+ if (this->buf) {
+ int frame_end = buf->decoder_flags & BUF_FLAG_FRAME_END;
+ if (this->buffered_bytes || !frame_end) {
+ if (this->buf_size < this->buffered_bytes + buf->size) {
+ this->buf_size *= 2;
+ this->buf = realloc(this->buf, this->buf_size);
+ }
+
+ memcpy(this->buf + this->buffered_bytes, buf->content, buf->size);
+ this->buffered_bytes += buf->size;
+
+ if (!frame_end)
+ return;
+
+ sample_buffer = (int16_t*)this->buf;
+ buf_size = this->buffered_bytes;
+ this->buffered_bytes = 0;
+ }
+ }
+
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+
+ /* Swap LPCM samples into native byte order, if necessary */
+ buf->type &= 0xffff0000;
+ stream_be = ( buf->type == BUF_AUDIO_LPCM_BE );
+
+ if( this->bits_per_sample == 16 ){
+ if (stream_be != this->cpu_be)
+ swab (sample_buffer, audio_buffer->mem, buf_size);
+ else
+ memcpy (audio_buffer->mem, sample_buffer, buf_size);
+ }
+ else if( this->bits_per_sample == 20 ) {
+ uint8_t *s = (uint8_t *)sample_buffer;
+ uint8_t *d = (uint8_t *)audio_buffer->mem;
+ int n = buf_size;
+
+ if (stream_be != this->cpu_be) {
+ while( n >= 0 ) {
+ swab( s, d, 8 );
+ s += 10;
+ d += 8;
+ n -= 10;
+ }
+ } else {
+ while( n >= 0 ) {
+ memcpy( d, s, 8 );
+ s += 10;
+ d += 8;
+ n -= 10;
+ }
+ }
+ } else if( this->bits_per_sample == 24 ) {
+ uint8_t *s = (uint8_t *)sample_buffer;
+ uint8_t *d = (uint8_t *)audio_buffer->mem;
+ int n = buf_size;
+
+ if ( stream_be ) {
+ if (special_dvd_audio)
+ while (n >= 12) {
+ if ( stream_be == this->cpu_be ) {
+ *d++ = s[0];
+ *d++ = s[1];
+ *d++ = s[2];
+ *d++ = s[3];
+ *d++ = s[4];
+ *d++ = s[5];
+ *d++ = s[6];
+ *d++ = s[7];
+ } else {
+ *d++ = s[1];
+ *d++ = s[0];
+ *d++ = s[3];
+ *d++ = s[2];
+ *d++ = s[5];
+ *d++ = s[4];
+ *d++ = s[7];
+ *d++ = s[6];
+ }
+ s += 12;
+ n -= 12;
+ }
+ else
+ while (n >= 3) {
+ if ( stream_be == this->cpu_be ) {
+ *d++ = s[0];
+ *d++ = s[1];
+ } else {
+ *d++ = s[1];
+ *d++ = s[0];
+ }
+ s += 3;
+ n -= 3;
+ }
+ } else {
+ while (n >= 3) {
+ if ( stream_be == this->cpu_be ) {
+ *d++ = s[1];
+ *d++ = s[2];
+ } else {
+ *d++ = s[2];
+ *d++ = s[1];
+ }
+ s += 3;
+ n -= 3;
+ }
+ }
+
+ if ( (d - (uint8_t*)audio_buffer->mem)/2*3 < buf_size )
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: lost %i bytes of %i in the buffer\n", (int)(buf_size - (d - (uint8_t*)audio_buffer->mem)/2*3), buf_size);
+
+ } else {
+ memcpy (audio_buffer->mem, sample_buffer, buf_size);
+ }
+
+ audio_buffer->vpts = this->pts;
+ audio_buffer->num_frames = (((buf_size*8)/this->number_of_channels)/this->bits_per_sample);
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+ this->pts = 0;
+}
+
+static void lpcm_dispose (audio_decoder_t *this_gen) {
+ lpcm_decoder_t *this = (lpcm_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->buf);
+
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ lpcm_decoder_t *this ;
+
+ this = (lpcm_decoder_t *) calloc(1, sizeof(lpcm_decoder_t));
+
+ this->audio_decoder.decode_data = lpcm_decode_data;
+ this->audio_decoder.reset = lpcm_reset;
+ this->audio_decoder.discontinuity = lpcm_discontinuity;
+ this->audio_decoder.dispose = lpcm_dispose;
+
+ this->output_open = 0;
+ this->rate = 0;
+ this->bits_per_sample=0;
+ this->number_of_channels=0;
+ this->ao_cap_mode=0;
+ this->stream = stream;
+
+ this->cpu_be = ( htons(1) == 1 );
+
+ return &this->audio_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ lpcm_class_t *this ;
+
+ this = (lpcm_class_t *) calloc(1, sizeof(lpcm_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "Linear PCM";
+ this->decoder_class.description = N_("Linear PCM audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_LPCM_BE, BUF_AUDIO_LPCM_LE, 0
+};
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 16, "pcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/xine_mad_decoder.c b/src/audio_dec/xine_mad_decoder.c
new file mode 100644
index 000000000..ac16e84a6
--- /dev/null
+++ b/src/audio_dec/xine_mad_decoder.c
@@ -0,0 +1,446 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * stuff needed to turn libmad into a xine decoder plugin
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include "config.h"
+
+#ifdef HAVE_MAD_H
+#include <mad.h>
+#endif
+
+#define LOG_MODULE "mad_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+
+#ifdef HAVE_MAD_H
+# include <mad.h>
+#else
+# include "frame.h"
+# include "synth.h"
+#endif
+
+#define INPUT_BUF_SIZE 16384
+
+/* According to Rob Leslie (libmad author) :
+ * The absolute theoretical maximum frame size is 2881 bytes: MPEG 2.5 Layer II,
+ * 8000 Hz @ 160 kbps, with a padding slot. (Such a frame is unlikely, but it was
+ * a useful exercise to compute all possible frame sizes.) Add to this an 8 byte
+ * MAD_BUFFER_GUARD, and the minimum buffer size you should be streaming to
+ * libmad in the general case is 2889 bytes.
+
+ * Theoretical frame sizes for Layer III range from 24 to 1441 bytes, but there
+ * is a "soft" limit imposed by the standard of 960 bytes. Nonetheless MAD can
+ * decode frames of any size as long as they fit entirely in the buffer you pass,
+ * not including the MAD_BUFFER_GUARD bytes.
+ */
+#define MAD_MIN_SIZE 2889
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} mad_class_t;
+
+typedef struct mad_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *xstream;
+
+ int64_t pts;
+
+ struct mad_synth synth;
+ struct mad_stream stream;
+ struct mad_frame frame;
+
+ int output_sampling_rate;
+ int output_open;
+ int output_mode;
+
+ uint8_t buffer[INPUT_BUF_SIZE];
+ int bytes_in_buffer;
+ int preview_mode;
+ int start_padding;
+ int end_padding;
+ int needs_more_data;
+
+} mad_decoder_t;
+
+static void mad_reset (audio_decoder_t *this_gen) {
+
+ mad_decoder_t *this = (mad_decoder_t *) this_gen;
+
+ mad_synth_finish (&this->synth);
+ mad_frame_finish (&this->frame);
+ mad_stream_finish(&this->stream);
+
+ this->pts = 0;
+ this->bytes_in_buffer = 0;
+ this->preview_mode = 0;
+ this->start_padding = 0;
+ this->end_padding = 0;
+ this->needs_more_data = 0;
+
+ mad_synth_init (&this->synth);
+ mad_stream_init (&this->stream);
+ this->stream.options = MAD_OPTION_IGNORECRC;
+ mad_frame_init (&this->frame);
+}
+
+
+static void mad_discontinuity (audio_decoder_t *this_gen) {
+
+ mad_decoder_t *this = (mad_decoder_t *) this_gen;
+
+ this->pts = 0;
+}
+
+/* utility to scale and round samples to 16 bits */
+
+static inline
+signed int scale(mad_fixed_t sample)
+{
+ /* round */
+ sample += (1L << (MAD_F_FRACBITS - 16));
+
+ /* clip */
+ if (sample >= MAD_F_ONE)
+ sample = MAD_F_ONE - 1;
+ else if (sample < -MAD_F_ONE)
+ sample = -MAD_F_ONE;
+
+ /* quantize */
+ return sample >> (MAD_F_FRACBITS + 1 - 16);
+}
+
+/*
+static int head_check(mad_decoder_t *this) {
+
+ if( (this->header & 0xffe00000) != 0xffe00000)
+ return 0;
+ if(!((this->header>>17)&3))
+ return 0;
+ if( ((this->header>>12)&0xf) == 0xf)
+ return 0;
+ if( ((this->header>>10)&0x3) == 0x3 )
+ return 0;
+ return 1;
+}
+*/
+
+static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ mad_decoder_t *this = (mad_decoder_t *) this_gen;
+ int bytes_in_buffer_at_pts;
+
+ lprintf ("decode data, size: %d, decoder_flags: %d\n", buf->size, buf->decoder_flags);
+
+ if (buf->size>(INPUT_BUF_SIZE-this->bytes_in_buffer)) {
+ xprintf (this->xstream->xine, XINE_VERBOSITY_DEBUG,
+ "libmad: ALERT input buffer too small (%d bytes, %d avail)!\n",
+ buf->size, INPUT_BUF_SIZE-this->bytes_in_buffer);
+ buf->size = INPUT_BUF_SIZE-this->bytes_in_buffer;
+ }
+
+ if ((buf->decoder_flags & BUF_FLAG_HEADER) == 0) {
+
+ /* reset decoder on leaving preview mode */
+ if ((buf->decoder_flags & BUF_FLAG_PREVIEW) == 0) {
+ if (this->preview_mode) {
+ mad_reset (this_gen);
+ }
+ } else {
+ this->preview_mode = 1;
+ }
+
+ bytes_in_buffer_at_pts = this->bytes_in_buffer;
+
+ xine_fast_memcpy (&this->buffer[this->bytes_in_buffer],
+ buf->content, buf->size);
+ this->bytes_in_buffer += buf->size;
+
+ /*
+ printf ("libmad: decode data - doing it\n");
+ */
+
+ mad_stream_buffer (&this->stream, this->buffer,
+ this->bytes_in_buffer);
+
+ if (this->bytes_in_buffer < MAD_MIN_SIZE && buf->pts == 0)
+ return;
+
+ if (!this->needs_more_data) {
+ this->pts = buf->pts;
+ if (buf->decoder_flags & BUF_FLAG_AUDIO_PADDING) {
+ this->start_padding = buf->decoder_info[1];
+ this->end_padding = buf->decoder_info[2];
+ } else {
+ this->start_padding = 0;
+ this->end_padding = 0;
+ }
+ }
+
+ while (1) {
+
+ if (mad_frame_decode (&this->frame, &this->stream) != 0) {
+
+ if (this->stream.next_frame) {
+ int num_bytes =
+ this->buffer + this->bytes_in_buffer - this->stream.next_frame;
+
+ /* printf("libmad: MAD_ERROR_BUFLEN\n"); */
+
+ memmove(this->buffer, this->stream.next_frame, num_bytes);
+ this->bytes_in_buffer = num_bytes;
+ }
+
+ switch (this->stream.error) {
+
+ case MAD_ERROR_BUFLEN:
+ /* libmad wants more data */
+ this->needs_more_data = 1;
+ return;
+
+ default:
+ lprintf ("error 0x%04X, mad_stream_buffer %d bytes\n", this->stream.error, this->bytes_in_buffer);
+ mad_stream_buffer (&this->stream, this->buffer,
+ this->bytes_in_buffer);
+ }
+
+ } else {
+ int mode = (this->frame.header.mode == MAD_MODE_SINGLE_CHANNEL) ? AO_CAP_MODE_MONO : AO_CAP_MODE_STEREO;
+
+ if (!this->output_open
+ || (this->output_sampling_rate != this->frame.header.samplerate)
+ || (this->output_mode != mode)) {
+
+ lprintf ("audio sample rate %d mode %08x\n", this->frame.header.samplerate, mode);
+
+ /* the mpeg audio demuxer can set audio bitrate */
+ if (! _x_stream_info_get(this->xstream, XINE_STREAM_INFO_AUDIO_BITRATE)) {
+ _x_stream_info_set(this->xstream, XINE_STREAM_INFO_AUDIO_BITRATE,
+ this->frame.header.bitrate);
+ }
+
+ /* the mpeg audio demuxer can set this meta info */
+ if (! _x_meta_info_get(this->xstream, XINE_META_INFO_AUDIOCODEC)) {
+ switch (this->frame.header.layer) {
+ case MAD_LAYER_I:
+ _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
+ "MPEG audio layer 1 (lib: MAD)");
+ break;
+ case MAD_LAYER_II:
+ _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
+ "MPEG audio layer 2 (lib: MAD)");
+ break;
+ case MAD_LAYER_III:
+ _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
+ "MPEG audio layer 3 (lib: MAD)");
+ break;
+ default:
+ _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
+ "MPEG audio (lib: MAD)");
+ }
+ }
+
+ if (this->output_open) {
+ this->xstream->audio_out->close (this->xstream->audio_out, this->xstream);
+ this->output_open = 0;
+ }
+ if (!this->output_open) {
+ this->output_open = (this->xstream->audio_out->open) (this->xstream->audio_out,
+ this->xstream, 16,
+ this->frame.header.samplerate,
+ mode) ;
+ }
+ if (!this->output_open) {
+ return;
+ }
+ this->output_sampling_rate = this->frame.header.samplerate;
+ this->output_mode = mode;
+ }
+
+ mad_synth_frame (&this->synth, &this->frame);
+
+ if ( (buf->decoder_flags & BUF_FLAG_PREVIEW) == 0 ) {
+
+ unsigned int nchannels, nsamples;
+ mad_fixed_t const *left_ch, *right_ch;
+ struct mad_pcm *pcm = &this->synth.pcm;
+ audio_buffer_t *audio_buffer;
+ uint16_t *output;
+ int bitrate;
+ int pts_offset;
+
+ audio_buffer = this->xstream->audio_out->get_buffer (this->xstream->audio_out);
+ output = audio_buffer->mem;
+
+ nchannels = pcm->channels;
+ nsamples = pcm->length;
+ left_ch = pcm->samples[0];
+ right_ch = pcm->samples[1];
+
+ /* padding */
+ if (this->start_padding || this->end_padding) {
+ /* check padding validity */
+ if (nsamples < (this->start_padding + this->end_padding)) {
+ lprintf("invalid padding data");
+ this->start_padding = 0;
+ this->end_padding = 0;
+ }
+ lprintf("nsamples=%d, start_padding=%d, end_padding=%d\n",
+ nsamples, this->start_padding, this->end_padding);
+ nsamples -= this->start_padding + this->end_padding;
+ left_ch += this->start_padding;
+ right_ch += this->start_padding;
+ }
+ audio_buffer->num_frames = nsamples;
+ audio_buffer->vpts = this->pts;
+
+ while (nsamples--) {
+ /* output sample(s) in 16-bit signed little-endian PCM */
+
+ *output++ = scale(*left_ch++);
+
+ if (nchannels == 2)
+ *output++ = scale(*right_ch++);
+
+ }
+
+ audio_buffer->num_frames = pcm->length;
+
+ /* pts computing */
+ if (this->frame.header.bitrate > 0) {
+ bitrate = this->frame.header.bitrate;
+ } else {
+ bitrate = _x_stream_info_get(this->xstream, XINE_STREAM_INFO_AUDIO_BITRATE);
+ lprintf("offset %d bps\n", bitrate);
+ }
+ audio_buffer->vpts = buf->pts;
+ if (audio_buffer->vpts && (bitrate > 0)) {
+ pts_offset = (bytes_in_buffer_at_pts * 8 * 90) / (bitrate / 1000);
+ lprintf("pts: %"PRId64", offset: %d pts, %d bytes\n", buf->pts, pts_offset, bytes_in_buffer_at_pts);
+ if (audio_buffer->vpts < pts_offset)
+ pts_offset = audio_buffer->vpts;
+ audio_buffer->vpts -= pts_offset;
+ }
+
+ this->xstream->audio_out->put_buffer (this->xstream->audio_out, audio_buffer, this->xstream);
+
+ this->pts = buf->pts;
+ buf->pts = 0;
+ if (buf->decoder_flags & BUF_FLAG_AUDIO_PADDING) {
+ this->start_padding = buf->decoder_info[1];
+ this->end_padding = buf->decoder_info[2];
+ buf->decoder_info[1] = 0;
+ buf->decoder_info[2] = 0;
+ } else {
+ this->start_padding = 0;
+ this->end_padding = 0;
+ }
+ }
+ lprintf ("decode worked\n");
+ }
+ }
+ }
+}
+
+static void mad_dispose (audio_decoder_t *this_gen) {
+
+ mad_decoder_t *this = (mad_decoder_t *) this_gen;
+
+ mad_synth_finish (&this->synth);
+ mad_frame_finish (&this->frame);
+ mad_stream_finish(&this->stream);
+
+ if (this->output_open) {
+ this->xstream->audio_out->close (this->xstream->audio_out, this->xstream);
+ this->output_open = 0;
+ }
+
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ mad_decoder_t *this ;
+
+ this = (mad_decoder_t *) calloc(1, sizeof(mad_decoder_t));
+
+ this->audio_decoder.decode_data = mad_decode_data;
+ this->audio_decoder.reset = mad_reset;
+ this->audio_decoder.discontinuity = mad_discontinuity;
+ this->audio_decoder.dispose = mad_dispose;
+
+ this->output_open = 0;
+ this->bytes_in_buffer = 0;
+ this->preview_mode = 0;
+
+ this->xstream = stream;
+
+ mad_synth_init (&this->synth);
+ mad_stream_init (&this->stream);
+ mad_frame_init (&this->frame);
+
+ this->stream.options = MAD_OPTION_IGNORECRC;
+
+ lprintf ("init\n");
+
+ return &this->audio_decoder;
+}
+
+/*
+ * mad plugin class
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ mad_class_t *this;
+
+ this = (mad_class_t *) calloc(1, sizeof(mad_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "mad";
+ this->decoder_class.description = N_("libmad based mpeg audio layer 1/2/3 decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_MPEG, 0
+};
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 8 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_DECODER, 16, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/audio_dec/xine_musepack_decoder.c b/src/audio_dec/xine_musepack_decoder.c
new file mode 100644
index 000000000..758ca9726
--- /dev/null
+++ b/src/audio_dec/xine_musepack_decoder.c
@@ -0,0 +1,540 @@
+/*
+ * Copyright (C) 2005 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, USA
+ */
+
+/**
+ * @file
+ * @brief xine interface to libmusepack/libmpcdec
+ * @author James Stembridge <jstembridge@gmail.com>
+ *
+ * @todo Add support for 32-bit float samples.
+ * @todo Add support for seeking.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define LOG_MODULE "mpc_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+
+#ifdef HAVE_MPCDEC_MPCDEC_H
+# include <mpcdec/mpcdec.h>
+#elif defined(HAVE_MPC_MPCDEC_H)
+# include <mpc/mpcdec.h>
+#else
+# include "mpcdec/mpcdec.h"
+#endif
+
+#define MPC_DECODER_MEMSIZE 65536
+#define MPC_DECODER_MEMSIZE2 (MPC_DECODER_MEMSIZE/2)
+
+#define INIT_BUFSIZE (MPC_DECODER_MEMSIZE*2)
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} mpc_class_t;
+
+typedef struct mpc_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ int sample_rate; /* audio sample rate */
+ int bits_per_sample; /* bits/sample, usually 8 or 16 */
+ int channels; /* 1 or 2, usually */
+
+ int output_open; /* flag to indicate audio is ready */
+
+ unsigned char *buf; /* data accumulation buffer */
+ unsigned int buf_max; /* maximum size of buf */
+ unsigned int read; /* size of accum. data already read */
+ unsigned int size; /* size of accumulated data in buf */
+
+ mpc_reader reader;
+ mpc_streaminfo streaminfo;
+#ifndef HAVE_MPC_MPCDEC_H
+ mpc_decoder decoder;
+#else
+ mpc_demux *decoder;
+#endif
+
+ int decoder_ok;
+ unsigned int current_frame;
+
+ int32_t file_size;
+
+} mpc_decoder_t;
+
+
+/**************************************************************************
+ * musepack specific functions
+ *************************************************************************/
+
+/* Reads size bytes of data into buffer at ptr. */
+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);
+
+ /* Don't try to read more data than we have */
+ if (size > (this->size - this->read))
+ size = this->size - this->read;
+
+ /* Copy the data */
+ xine_fast_memcpy(ptr, &this->buf[this->read], size);
+
+ /* Update our position in the data buffer */
+ this->read += size;
+
+ return size;
+}
+
+/* Seeks to byte position offset. */
+#ifndef HAVE_MPC_MPCDEC_H
+static mpc_bool_t mpc_reader_seek(void *const data, const int32_t offset) {
+ mpc_decoder_t *const this = (mpc_decoder_t *) data;
+#else
+static mpc_bool_t mpc_reader_seek(mpc_reader *data, int32_t offset) {
+ mpc_decoder_t *const this = (mpc_decoder_t *) data->data;
+#endif
+
+ lprintf("mpc_reader_seek: offset=%d\n", offset);
+
+ /* seek is only called when reading the header so we can assume
+ * that the buffer starts at the start of the file */
+ this->read = offset;
+
+#ifndef HAVE_MPC_MPCDEC_H
+ return TRUE;
+#else
+ return MPC_TRUE;
+#endif
+}
+
+/* Returns the current byte offset in the stream. */
+#ifndef HAVE_MPC_MPCDEC_H
+static int32_t mpc_reader_tell(void *const data) {
+#else
+static int32_t mpc_reader_tell(mpc_reader *const data) {
+#endif
+ lprintf("mpc_reader_tell\n");
+
+ /* Tell isn't used so just return 0 */
+ return 0;
+}
+
+/* Returns the total length of the source stream, in bytes. */
+#ifndef HAVE_MPC_MPCDEC_H
+static int32_t mpc_reader_get_size(void *const data) {
+ mpc_decoder_t *const this = (mpc_decoder_t *) data;
+#else
+static int32_t mpc_reader_get_size(mpc_reader *const data) {
+ mpc_decoder_t *const this = (mpc_decoder_t *) data->data;
+#endif
+
+ lprintf("mpc_reader_get_size\n");
+
+ return this->file_size;
+}
+
+/* True if the stream is a seekable stream. */
+#ifndef HAVE_MPC_MPCDEC_H
+static mpc_bool_t mpc_reader_canseek(void *data) {
+ lprintf("mpc_reader_canseek\n");
+
+ return TRUE;
+#else
+static mpc_bool_t mpc_reader_canseek(mpc_reader *data) {
+
+ lprintf("mpc_reader_canseek\n");
+ return MPC_TRUE;
+#endif
+}
+
+/**
+ * @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;
+ for (i = 0; i < samples; i++) {
+ 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]); */
+ }
+}
+
+/* Decode a musepack frame */
+static int mpc_decode_frame (mpc_decoder_t *this) {
+ float buffer[MPC_DECODER_BUFFER_LENGTH];
+ uint32_t frames;
+#ifdef HAVE_MPC_MPCDEC_H
+ mpc_frame_info frame;
+#endif
+
+ lprintf("mpd_decode_frame\n");
+
+#ifndef HAVE_MPC_MPCDEC_H
+ frames = mpc_decoder_decode(&this->decoder, buffer, 0, 0);
+#else
+ frame.buffer = buffer;
+ mpc_demux_decode(this->decoder, &frame);
+ frames = frame.samples;
+#endif
+
+ if (frames > 0) {
+ audio_buffer_t *audio_buffer;
+ int16_t *int_samples;
+
+ lprintf("got %d samples\n", frames);
+
+ /* Get audio buffer */
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+ audio_buffer->vpts = 0;
+ audio_buffer->num_frames = frames;
+
+ /* Convert samples */
+ int_samples = (int16_t *) audio_buffer->mem;
+ float_to_int(buffer, int_samples, frames*this->channels);
+
+ /* Output converted samples */
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+ }
+
+ return frames;
+}
+
+/**************************************************************************
+ * xine audio plugin functions
+ *************************************************************************/
+
+static void mpc_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+ mpc_decoder_t *this = (mpc_decoder_t *) this_gen;
+ int err;
+
+ lprintf("mpc_decode_data\n");
+
+ if (!_x_stream_info_get(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED))
+ return;
+
+ /* We don't handle special buffers */
+ if (buf->decoder_flags & BUF_FLAG_SPECIAL)
+ return;
+
+ /* Read header */
+ if (buf->decoder_flags & BUF_FLAG_HEADER) {
+
+ lprintf("header\n");
+
+ /* File size is in decoder_info[0] */
+ this->file_size = buf->decoder_info[0];
+
+ /* Initialise the data accumulation buffer */
+ this->buf = calloc(1, INIT_BUFSIZE);
+ this->buf_max = INIT_BUFSIZE;
+ this->read = 0;
+ this->size = 0;
+
+ /* Initialise the reader */
+ this->reader.read = mpc_reader_read;
+ this->reader.seek = mpc_reader_seek;
+ this->reader.tell = mpc_reader_tell;
+ this->reader.get_size = mpc_reader_get_size;
+ this->reader.canseek = mpc_reader_canseek;
+ this->reader.data = this;
+
+ /* Copy header to buffer */
+ xine_fast_memcpy(this->buf, buf->content, buf->size);
+ this->size = buf->size;
+
+#ifdef HAVE_MPC_MPCDEC_H
+ this->decoder = mpc_demux_init(&this->reader);
+ if (!this->decoder) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libmusepack: mpc_demux_init failed.\n"));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
+ return;
+ }
+ mpc_demux_get_info(this->decoder, &this->streaminfo);
+#else
+ /* Initialise and read stream info */
+ mpc_streaminfo_init(&this->streaminfo);
+
+ if ((err = mpc_streaminfo_read(&this->streaminfo, &this->reader))) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libmusepack: mpc_streaminfo_read failed: %d\n"), err);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
+ return;
+ }
+#endif
+
+ this->sample_rate = this->streaminfo.sample_freq;
+ this->channels = this->streaminfo.channels;
+ this->bits_per_sample = 16;
+
+ /* After the header the demuxer starts sending data from an offset
+ * of 28 bytes */
+ this->size = 28;
+
+ /* We need to keep track of the current frame so we now when we've
+ * reached the end of the stream */
+ this->current_frame = 0;
+
+ /* Setup the decoder */
+#ifndef HAVE_MPC_MPCDEC_H
+ mpc_decoder_setup(&this->decoder, &this->reader);
+#endif
+ this->decoder_ok = 0;
+
+ /* Take this opportunity to initialize stream/meta information */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "Musepack (libmusepack)");
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
+ (int) this->streaminfo.average_bitrate);
+
+ return;
+ }
+
+ lprintf("data: %u size=%u read=%u\n", buf->size, this->size, this->read);
+
+ /* if the audio output is not open yet, open the audio output */
+ 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,
+ _x_ao_channels2mode(this->channels));
+
+ /* if the audio still isn't open, do not go any further with the decode */
+ if (!this->output_open)
+ return;
+ }
+
+ /* If we run out of space in our internal buffer we discard what's
+ * already been read */
+ if (((this->size + buf->size) > this->buf_max) && this->read) {
+ lprintf("discarding read data\n");
+ this->size -= this->read;
+ memmove(this->buf, &this->buf[this->read], this->size);
+ this->read = 0;
+ }
+
+ /* If there still isn't space we have to increase the size of the
+ * internal buffer */
+ if ((this->size + buf->size) > this->buf_max) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libmusepack: increasing internal buffer size\n");
+ this->buf_max += 2*buf->size;
+ this->buf = realloc(this->buf, this->buf_max);
+ }
+
+ /* Copy data */
+ xine_fast_memcpy(&this->buf[this->size], buf->content, buf->size);
+ this->size += buf->size;
+
+ /* Time to decode */
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+ /* Increment frame count */
+#ifndef HAVE_MPC_MPCDEC_H
+ if (this->current_frame++ == this->streaminfo.frames) {
+#else
+ if (this->current_frame++ == this->streaminfo.samples) {
+#endif
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libmusepack: data after last frame ignored\n"));
+ return;
+ }
+
+ if (!this->decoder_ok) {
+ /* We require MPC_DECODER_MEMSIZE bytes to initialise the decoder */
+ if ((this->size - this->read) >= MPC_DECODER_MEMSIZE) {
+ lprintf("initialise");
+
+#ifndef HAVE_MPC_MPCDEC_H
+ if (!mpc_decoder_initialize(&this->decoder, &this->streaminfo)) {
+#else
+ if (!this->decoder) {
+#endif
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libmusepack: mpc_decoder_initialise failed\n"));
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
+ return;
+ }
+
+ this->decoder_ok = 1;
+ } else {
+ /* Not enough data yet */
+ return;
+ }
+ }
+
+ /* mpc_decoder_decode may cause a read of MPC_DECODER_MEMSIZE/2 bytes so
+ * make sure we have enough data available */
+ if ((this->size - this->read) >= MPC_DECODER_MEMSIZE2) {
+ lprintf("decoding\n");
+
+ if ((err = mpc_decode_frame(this)) < 0) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libmusepack: mpc_decoder_decode failed: %d\n"), err);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
+ return;
+ }
+ }
+
+ /* If we are at the end of the stream we decode the remaining frames as we
+ * know we'll have enough data */
+#ifndef HAVE_MPC_MPCDEC_H
+ if (this->current_frame == this->streaminfo.frames) {
+#else
+ if (this->current_frame == this->streaminfo.samples) {
+#endif
+ lprintf("flushing buffers\n");
+
+ do {
+ if ((err = mpc_decode_frame(this)) < 0) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("libmusepack: mpc_decoder_decode failed: %d\n"), err);
+ }
+ } while (err > 0);
+
+ lprintf("buffers flushed\n");
+ }
+ }
+}
+
+static void mpc_reset (audio_decoder_t *this_gen) {
+ mpc_decoder_t *this = (mpc_decoder_t *) this_gen;
+
+ this->size = 0;
+ this->read = 0;
+}
+
+static void mpc_discontinuity (audio_decoder_t *this_gen) {
+ /* mpc_decoder_t *this = (mpc_decoder_t *) this_gen; */
+}
+
+static void mpc_dispose (audio_decoder_t *this_gen) {
+
+ mpc_decoder_t *this = (mpc_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 */
+ free(this->buf);
+#ifdef HAVE_MPC_MPCDEC_H
+ if (this->decoder)
+ mpc_demux_exit(this->decoder);
+#endif
+
+ free(this);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ mpc_decoder_t *this ;
+
+ this = (mpc_decoder_t *) calloc(1, sizeof(mpc_decoder_t));
+
+ /* connect the member functions */
+ this->audio_decoder.decode_data = mpc_decode_data;
+ this->audio_decoder.reset = mpc_reset;
+ this->audio_decoder.discontinuity = mpc_discontinuity;
+ this->audio_decoder.dispose = mpc_dispose;
+
+ /* connect the stream */
+ this->stream = stream;
+
+ /* audio output is not open at the start */
+ this->output_open = 0;
+
+ /* no buffer yet */
+ this->buf = NULL;
+
+ /* initialize the basic audio parameters */
+ this->channels = 0;
+ this->sample_rate = 0;
+ this->bits_per_sample = 0;
+
+ /* return the newly-initialized audio decoder */
+ return &this->audio_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ mpc_class_t *this ;
+
+ this = (mpc_class_t *) calloc(1, sizeof(mpc_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "mpc";
+ this->decoder_class.description = N_("mpc: musepack audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_MPC,
+ 0
+};
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 5 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* { type, API version, "name", version, special_info, init_function }, */
+ { PLUGIN_AUDIO_DECODER, 16, "mpc", XINE_VERSION_CODE, &dec_info_audio, &init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
+
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index 750d03915..3d35504e9 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -1,143 +1,127 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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
-if HAVE_SNDIO
+if ENABLE_SNDIO
sndio_module = xineplug_ao_out_sndio.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) \
- $(jack_module) \
+ $(fusionsound_module) \
+ $(jack_module) \
$(sndio_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_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_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_alsa_la_SOURCES = audio_alsa_out.c
xineplug_ao_out_alsa_la_LIBADD = $(XINE_LIB) $(ALSA_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_alsa_la_CFLAGS = $(VISIBILITY_FLAG) $(ALSA_CFLAGS)
+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 = $(XINE_LIB) $(ESD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_esd_la_CFLAGS = $(VISIBILITY_FLAG) $(ESD_CFLAGS)
+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_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_arts_la_SOURCES = audio_arts_out.c
-xineplug_ao_out_arts_la_LIBADD = $(XINE_LIB) $(ARTS_LIBS)
-xineplug_ao_out_arts_la_CFLAGS = $(VISIBILITY_FLAG) $(ARTS_CFLAGS)
+#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 = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(LTLIBINTL)
-xineplug_ao_out_directx_la_CFLAGS = $(VISIBILITY_FLAG)
+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 = $(AM_LDFLAGS) \
- -Wl,-framework -Wl,Cocoa -framework CoreAudio \
- -Wl,-framework -Wl,AudioUnit -framework AudioUnit \
-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 = $(XINE_LIB) $(PULSEAUDIO_LIBS) $(LTLIBINTL)
-xineplug_ao_out_pulseaudio_la_CFLAGS = $(VISIBILITY_FLAG) $(PULSEAUDIO_CFLAGS)
+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_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_ao_out_directx2_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_ao_out_directx2_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS) $(LTLIBINTL)
+xineplug_ao_out_directx2_la_LIBADD = $(XINE_LIB) $(DIRECTX_AUDIO_LIBS) $(PTHREAD_LIBS)
xineplug_ao_out_fusionsound_la_SOURCES = audio_fusionsound_out.c
xineplug_ao_out_fusionsound_la_LIBADD = $(XINE_LIB) $(FUSIONSOUND_LIBS)
-xineplug_ao_out_fusionsound_la_CFLAGS = $(VISIBILITY_FLAG) $(FUSIONSOUND_CFLAGS)
+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 = $(XINE_LIB) $(JACK_LIBS) $(LTLIBINTL)
-xineplug_ao_out_jack_la_CFLAGS = $(VISIBILITY_FLAG) $(JACK_CFLAGS)
+xineplug_ao_out_jack_la_CFLAGS = $(AM_FLAGS) $(JACK_CFLAGS)
xineplug_ao_out_sndio_la_SOURCES = audio_sndio_out.c
xineplug_ao_out_sndio_la_LIBADD = $(XINE_LIB) $(SNDIO_LIBS)
-xineplug_ao_out_sndio_la_CFLAGS = $(VISIBILITY_FLAG) $(SNDIO_CFLAGS)
+xineplug_ao_out_sndio_la_CFLAGS = $(AM_CFLAGS) $(SNDIO_CFLAGS)
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index b8cc1a8ca..abf37f1b3 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -50,10 +50,10 @@
#include <inttypes.h>
#include <pthread.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/audio_out.h>
/*
#define ALSA_LOG
@@ -63,7 +63,7 @@
#define LOG_DEBUG
*/
-#define AO_OUT_ALSA_IFACE_VERSION 8
+#define AO_OUT_ALSA_IFACE_VERSION 9
#define BUFFER_TIME 1000*1000
#define GAP_TOLERANCE 5000
@@ -138,7 +138,7 @@ static int my_snd_mixer_wait(snd_mixer_t *mixer, int timeout) {
return count;
if ((unsigned int) count > sizeof(spfds) / sizeof(spfds[0])) {
- pfds = malloc(count * sizeof(*pfds));
+ pfds = calloc(count, sizeof(*pfds));
if (!pfds)
return -ENOMEM;
@@ -1696,22 +1696,6 @@ static void alsa_speaker_arrangement_cb (void *user_data,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "alsa";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using alsa-compliant audio devices/drivers");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- alsa_class_t *this = (alsa_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
alsa_class_t *this;
@@ -1721,9 +1705,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "alsa";
+ this->driver_class.description = N_("xine audio output plugin using alsa-compliant audio devices/drivers");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
/* this->config = xine->config; */
this->xine = xine;
diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c
deleted file mode 100644
index 7f796f2b3..000000000
--- a/src/audio_out/audio_arts_out.c
+++ /dev/null
@@ -1,416 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#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 = calloc(1, 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 = calloc(1, 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_coreaudio_out.c b/src/audio_out/audio_coreaudio_out.c
index 5e31a15e5..acee16750 100644
--- a/src/audio_out/audio_coreaudio_out.c
+++ b/src/audio_out/audio_coreaudio_out.c
@@ -41,9 +41,9 @@
#include <unistd.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include <CoreAudio/CoreAudio.h>
#include <CoreAudio/CoreAudioTypes.h>
@@ -52,7 +52,7 @@
#include <AudioUnit/AudioUnitParameters.h>
#include <AudioUnit/AudioOutputUnit.h>
-#define AO_OUT_COREAUDIO_IFACE_VERSION 8
+#define AO_OUT_COREAUDIO_IFACE_VERSION 9
#define GAP_TOLERANCE AO_MAX_GAP
#define BUFSIZE 30720
@@ -560,22 +560,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "coreaudio";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine output plugin for Coreaudio/Mac OS X");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- coreaudio_class_t *this = (coreaudio_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
coreaudio_class_t *this;
@@ -587,9 +571,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "coreaudio";
+ this->driver_class.description = N_("xine output plugin for Coreaudio/Mac OS X");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_directx2_out.c b/src/audio_out/audio_directx2_out.c
index 335aad1a7..de1aadd2a 100644
--- a/src/audio_out/audio_directx2_out.c
+++ b/src/audio_out/audio_directx2_out.c
@@ -61,12 +61,11 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
-#define AO_OUT_DIRECTX2_IFACE_VERSION 8
-
+#define AO_OUT_DIRECTX2_IFACE_VERSION 9
/*
* If GAP_TOLERANCE is lower than AO_MAX_GAP, xine will
@@ -936,22 +935,6 @@ static ao_driver_t *open_plugin(audio_driver_class_t *class_gen, const void *dat
return (ao_driver_t *)this;
}
-
-static char* get_identifier(audio_driver_class_t *this_gen) {
- return "directx2";
-}
-
-
-static char *get_description(audio_driver_class_t *this_gen) {
- return _("second xine audio output plugin using directx");
-}
-
-
-static void dispose_class(audio_driver_class_t *this_gen) {
- free(this_gen);
-}
-
-
static void *init_class(xine_t *xine, void *data) {
dx2_class_t *this;
@@ -962,9 +945,9 @@ static void *init_class(xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "directx2";
+ this->driver_class.description = N_("second xine audio output plugin using directx");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->xine = xine;
diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c
index 893a11976..0df4b21de 100644
--- a/src/audio_out/audio_directx_out.c
+++ b/src/audio_out/audio_directx_out.c
@@ -38,8 +38,8 @@ typedef unsigned char boolean;
#define LOG
*/
-#include "audio_out.h"
-#include "xine_internal.h"
+#include <xine/audio_out.h>
+#include <xine/xine_internal.h>
#define MAX_CHANNELS 6
@@ -52,7 +52,7 @@ typedef unsigned char boolean;
#define DSBUFF_LEFT 1
#define DSBUFF_RIGHT 2
-#define AO_DIRECTX_IFACE_VERSION 8
+#define AO_DIRECTX_IFACE_VERSION 9
/*****************************************************************************
* DirectDraw GUIDs.
@@ -823,20 +823,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
return ( ao_driver_t * ) ao_directx;
}
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "DirectX";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin for win32 using directx");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
- audiox_class_t *audiox = (audiox_class_t *) this_gen;
-
- free (audiox);
-}
-
static void *init_class (xine_t *xine, void *data) {
audiox_class_t *audiox;
@@ -850,9 +836,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
audiox->driver_class.open_plugin = open_plugin;
- audiox->driver_class.get_identifier = get_identifier;
- audiox->driver_class.get_description = get_description;
- audiox->driver_class.dispose = dispose_class;
+ audiox->driver_class.identifier = "DirectX";
+ audiox->driver_class.description = N_("xine audio output plugin for win32 using directx");
+ audiox->driver_class.dispose = default_audio_driver_class_dispose;
audiox->xine = xine;
audiox->config = xine->config;
diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c
index ae7576259..917a4bfab 100644
--- a/src/audio_out/audio_esd_out.c
+++ b/src/audio_out/audio_esd_out.c
@@ -33,12 +33,12 @@
#include <sys/uio.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "metronom.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
+#include <xine/metronom.h>
-#define AO_OUT_ESD_IFACE_VERSION 8
+#define AO_OUT_ESD_IFACE_VERSION 9
#define REBLOCK 1 /* reblock output to ESD_BUF_SIZE blks */
#define GAP_TOLERANCE 5000
@@ -563,22 +563,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "esd";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using esound");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- esd_class_t *this = (esd_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
esd_class_t *this;
@@ -588,9 +572,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "esd";
+ this->driver_class.description = N_("xine audio output plugin using esound");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->xine = xine;
diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c
index bc40d4efd..0a4471a19 100644
--- a/src/audio_out/audio_file_out.c
+++ b/src/audio_out/audio_file_out.c
@@ -32,12 +32,12 @@
#include <inttypes.h>
#include <sys/stat.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include "bswap.h"
-#define AO_OUT_FILE_IFACE_VERSION 8
+#define AO_OUT_FILE_IFACE_VERSION 9
#define GAP_TOLERANCE INT_MAX
@@ -85,7 +85,7 @@ typedef struct file_driver_s {
uint32_t bits_per_sample;
uint32_t bytes_per_frame;
- char *fname;
+ const char *fname;
int fd;
size_t bytes_written;
struct timeval endtime;
@@ -376,22 +376,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "file";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine file audio output plugin");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- file_class_t *this = (file_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
file_class_t *this;
@@ -403,9 +387,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "file";
+ this->driver_class.description = N_("xine file audio output plugin");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c
index 873ab32e9..c3455fd14 100644
--- a/src/audio_out/audio_fusionsound_out.c
+++ b/src/audio_out/audio_fusionsound_out.c
@@ -34,9 +34,9 @@
#define LOG_VERBOSE
#include "xine.h"
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/xineutils.h>
#include <directfb.h>
@@ -48,8 +48,14 @@
FUSIONSOUND_MINOR_VERSION, \
FUSIONSOUND_MICRO_VERSION )
+#if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(1,1,0)
+# include <fusionsound_limits.h> /* defines FS_MAX_CHANNELS */
+#else
+# define FS_MAX_CHANNELS 2
+#endif
+
-#define AO_OUT_FS_IFACE_VERSION 8
+#define AO_OUT_FS_IFACE_VERSION 9
#define GAP_TOLERANCE 5000
@@ -100,7 +106,29 @@ static int ao_fusionsound_open(ao_driver_t *ao_driver,
break;
case AO_CAP_MODE_STEREO:
dsc.channels = 2;
- break;
+ break;
+#if FS_MAX_CHANNELS > 2
+ case AO_CAP_MODE_4CHANNEL:
+ dsc.channels = 4;
+ dsc.channelmode = FSCM_SURROUND40_2F2R;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+ case AO_CAP_MODE_4_1CHANNEL:
+ dsc.channels = 5;
+ dsc.channelmode = FSCM_SURROUND41_2F2R;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+ case AO_CAP_MODE_5CHANNEL:
+ dsc.channels = 5;
+ dsc.channelmode = FSCM_SURROUND50;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+ case AO_CAP_MODE_5_1CHANNEL:
+ dsc.channels = 6;
+ dsc.channelmode = FSCM_SURROUND51;
+ dsc.flags |= FSBDF_CHANNELMODE;
+ break;
+#endif
default:
xprintf (this->xine, XINE_VERBOSITY_LOG,
"audio_fusionsound_out: mode %#x not supported\n", mode);
@@ -250,13 +278,18 @@ static void ao_fusionsound_close(ao_driver_t *ao_driver){
*/
static uint32_t ao_fusionsound_get_capabilities(ao_driver_t *ao_driver) {
+ uint32_t caps = AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO |
+ AO_CAP_MIXER_VOL | AO_CAP_MUTE_VOL |
+ AO_CAP_8BITS | AO_CAP_16BITS |
+ AO_CAP_24BITS;
#if FUSIONSOUND_VERSION_CODE >= VERSION_CODE(0,9,26)
- return (AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL |
- AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS | AO_CAP_FLOAT32);
-#else
- return (AO_CAP_MODE_MONO | AO_CAP_MODE_STEREO | AO_CAP_MIXER_VOL |
- AO_CAP_8BITS | AO_CAP_16BITS | AO_CAP_24BITS);
+ caps |= AO_CAP_FLOAT32;
+#endif
+#if FS_MAX_CHANNELS > 2
+ caps |= AO_CAP_MODE_4CHANNEL | AO_CAP_MODE_4_1CHANNEL |
+ AO_CAP_MODE_5CHANNEL | AO_CAP_MODE_5_1CHANNEL;
#endif
+ return caps;
}
static void ao_fusionsound_exit(ao_driver_t *ao_driver) {
@@ -434,18 +467,6 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class,
* class functions
*/
-static char* get_identifier(audio_driver_class_t *ao_class) {
- return "FusionSound";
-}
-
-static char* get_description(audio_driver_class_t *ao_class) {
- return "xine FusionSound audio output plugin";
-}
-
-static void dispose_class(audio_driver_class_t *ao_class) {
- free (ao_class);
-}
-
static void* init_class(xine_t *xine, void *data) {
fusionsound_class_t *class;
const char *error;
@@ -468,9 +489,9 @@ static void* init_class(xine_t *xine, void *data) {
}
class->ao_class.open_plugin = open_plugin;
- class->ao_class.get_identifier = get_identifier;
- class->ao_class.get_description = get_description;
- class->ao_class.dispose = dispose_class;
+ class->ao_class.identifier = "FunsionSound";
+ class->ao_class.description = N_("xine FusionSound audio output plugin");
+ class->ao_class.dispose = default_audio_driver_class_dispose;
class->xine = xine;
return class;
diff --git a/src/audio_out/audio_irixal_out.c b/src/audio_out/audio_irixal_out.c
index 336996a99..3a0f21196 100644
--- a/src/audio_out/audio_irixal_out.c
+++ b/src/audio_out/audio_irixal_out.c
@@ -37,10 +37,10 @@
#include <dmedia/audio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/audio_out.h>
//#ifndef AFMT_S16_NE
//# if defined(sparc) || defined(__sparc__) || defined(PPC)
diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c
index 1fadb3a13..975a5f38a 100644
--- a/src/audio_out/audio_jack_out.c
+++ b/src/audio_out/audio_jack_out.c
@@ -11,13 +11,13 @@
#include <unistd.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include <jack/jack.h>
-#define AO_OUT_JACK_IFACE_VERSION 8
+#define AO_OUT_JACK_IFACE_VERSION 9
#define GAP_TOLERANCE AO_MAX_GAP
/* maximum number of channels supported, avoids lots of mallocs */
@@ -896,38 +896,23 @@ static void jack_speaker_arrangement_cb (void *user_data,
/*
* class functions
*/
+static void *init_class (xine_t *xine, void *data) {
-static char *get_identifier (audio_driver_class_t *this_gen)
-{
- return "jack";
-}
-
-static char *get_description (audio_driver_class_t *this_gen)
-{
- return _("xine output plugin for JACK Audio Connection Kit");
-}
+ jack_class_t *this;
-static void dispose_class (audio_driver_class_t *this_gen)
-{
- jack_class_t *this = (jack_class_t *) this_gen;
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data)
-{
- jack_class_t *this;
+ this = calloc(1, sizeof (jack_class_t));
- this = calloc(1, sizeof (jack_class_t));
+ this->driver_class.open_plugin = open_jack_plugin;
+ this->driver_class.identifier = "jack";
+ this->driver_class.description = N_("xine output plugin for JACK Audio Connection Kit");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
- this->driver_class.open_plugin = open_jack_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->config = xine->config;
+ this->xine = xine;
- this->config = xine->config;
- this->xine = xine;
+ fprintf(stderr, "jack init_class returning %p\n", (void *)this);
- return this;
+ return this;
}
static ao_info_t ao_info_jack = { 6 };
@@ -937,8 +922,7 @@ static ao_info_t ao_info_jack = { 6 };
*/
const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_JACK_IFACE_VERSION, "jack", XINE_VERSION_CODE,
- &ao_info_jack, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_AUDIO_OUT, AO_OUT_JACK_IFACE_VERSION, "jack", XINE_VERSION_CODE /* XINE_VERSION_CODE */, &ao_info_jack, init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/audio_out/audio_none_out.c b/src/audio_out/audio_none_out.c
index c3d351035..c63d3a563 100644
--- a/src/audio_out/audio_none_out.c
+++ b/src/audio_out/audio_none_out.c
@@ -31,11 +31,11 @@
#include <unistd.h>
#include <inttypes.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
-#define AO_OUT_NONE_IFACE_VERSION 8
+#define AO_OUT_NONE_IFACE_VERSION 9
#define AUDIO_NUM_FRAGMENTS 15
#define AUDIO_FRAGMENT_SIZE 8192
@@ -214,22 +214,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "none";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine dummy audio output plugin");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- none_class_t *this = (none_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
none_class_t *this;
@@ -241,9 +225,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "none";
+ this->driver_class.description = N_("xine dummy audio output plugin");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index a68c6bd71..06d9115ef 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_out.c
@@ -64,10 +64,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/audio_out.h>
#include <sys/time.h>
@@ -93,7 +93,7 @@
# define AFMT_AC3 0x00000400
#endif
-#define AO_OUT_OSS_IFACE_VERSION 8
+#define AO_OUT_OSS_IFACE_VERSION 9
#define AUDIO_NUM_FRAGMENTS 15
#define AUDIO_FRAGMENT_SIZE 8192
@@ -660,7 +660,7 @@ static int ao_oss_ctrl(ao_driver_t *this_gen, int cmd, ...) {
* If not, the function returns 0.
*/
static int probe_audio_devices(oss_driver_t *this) {
- const char *base_names[2] = {"/dev/dsp", "/dev/sound/dsp"};
+ static const char *const base_names[2] = {"/dev/dsp", "/dev/sound/dsp"};
int base_num, i;
int audio_fd, rate;
int best_rate;
@@ -1040,14 +1040,10 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
parse += 3;
if (devname_val == 0)
snprintf(mixer_dev, sizeof(mixer_dev), "%smixer%s", mixer_name, parse);
- else {
- if (mixer_num == -1)
- snprintf(mixer_dev, sizeof(mixer_dev), "%smixer", mixer_name);
- else
- snprintf(mixer_dev, sizeof(mixer_dev), "%smixer%d", mixer_name, mixer_num);
- }
- } else {
- _x_abort();
+ else if (mixer_num == -1)
+ snprintf(mixer_dev, sizeof(mixer_dev), "%smixer", mixer_name);
+ else
+ snprintf(mixer_dev, sizeof(mixer_dev), "%smixer%d", mixer_name, mixer_num);
}
this->mixer.fd = xine_open_cloexec(mixer_dev, O_RDONLY);
@@ -1145,22 +1141,6 @@ static void oss_speaker_arrangement_cb (void *user_data,
/*
* class functions
*/
-
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "oss";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using oss-compliant audio devices/drivers");
-}
-
-static void dispose_class (audio_driver_class_t *this_gen) {
-
- oss_class_t *this = (oss_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
oss_class_t *this;
@@ -1170,9 +1150,9 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
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->driver_class.identifier = "oss";
+ this->driver_class.description = N_("xine audio output plugin using oss-compliant audio devices/drivers");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c
index 93e134785..5370389c7 100644
--- a/src/audio_out/audio_pulse_out.c
+++ b/src/audio_out/audio_pulse_out.c
@@ -41,9 +41,9 @@
#include <pulse/pulseaudio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include "bswap.h"
#define GAP_TOLERANCE AO_MAX_GAP
@@ -954,14 +954,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
* class functions
*/
-static char* get_identifier (audio_driver_class_t *this_gen) {
- return "pulseaudio";
-}
-
-static char* get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using pulseaudio sound server");
-}
-
static void dispose_class (audio_driver_class_t *this_gen) {
pulse_class_t *this = (pulse_class_t *) this_gen;
@@ -981,9 +973,9 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
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->driver_class.identifier = "pulseaudio";
+ this->driver_class.description = N_("xine audio output plugin using pulseaudio sound server");
return this;
}
@@ -998,6 +990,6 @@ static const ao_info_t ao_info_pulse = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, 8, "pulseaudio", XINE_VERSION_CODE, &ao_info_pulse, init_class },
+ { PLUGIN_AUDIO_OUT, 9, "pulseaudio", XINE_VERSION_CODE, &ao_info_pulse, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/audio_out/audio_sndio_out.c b/src/audio_out/audio_sndio_out.c
index 1d789b5e8..55d479963 100644
--- a/src/audio_out/audio_sndio_out.c
+++ b/src/audio_out/audio_sndio_out.c
@@ -32,9 +32,9 @@
#include <sndio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#include "bswap.h"
#define GAP_TOLERANCE AO_MAX_GAP
@@ -362,16 +362,6 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da
* class functions
*/
-static char* get_identifier (audio_driver_class_t *this_gen)
-{
- return "sndio";
-}
-
-static char* get_description (audio_driver_class_t *this_gen)
-{
- return _("xine audio output plugin using sndio audio devices/drivers ");
-}
-
static void dispose_class (audio_driver_class_t *this_gen)
{
sndio_class_t *this = (sndio_class_t *) this_gen;
@@ -390,8 +380,8 @@ static void *init_class (xine_t *xine, void *data)
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
+ this->driver_class.identifier = "sndio";
+ this->driver_class.description = N_("xine audio output plugin using sndio audio devices/drivers ");
this->driver_class.dispose = dispose_class;
this->xine = xine;
@@ -409,6 +399,6 @@ static const ao_info_t ao_info_sndio = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, 8, "sndio", XINE_VERSION_CODE, &ao_info_sndio, init_class },
+ { PLUGIN_AUDIO_OUT, 9, "sndio", XINE_VERSION_CODE, &ao_info_sndio, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index cd6319ee8..34d2f14ec 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -45,9 +45,9 @@
typedef unsigned uint_t;
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
#ifdef __svr4__
#define CS4231_WORKAROUND 1 /* enable workaround for audiocs play.samples bug */
@@ -64,7 +64,7 @@ typedef unsigned uint_t;
#define AUDIO_PRECISION_16 16
#endif
-#define AO_SUN_IFACE_VERSION 8
+#define AO_SUN_IFACE_VERSION 9
#define GAP_TOLERANCE 5000
#define GAP_NONRT_TOLERANCE AO_MAX_GAP
@@ -246,13 +246,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);
}
@@ -332,7 +330,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
};
@@ -1013,22 +1011,6 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v
/*
* class functions
*/
-
-static char* ao_sun_get_identifier (audio_driver_class_t *this_gen) {
- return "sun";
-}
-
-static char* ao_sun_get_description (audio_driver_class_t *this_gen) {
- return _("xine audio output plugin using sun-compliant audio devices/drivers");
-}
-
-static void ao_sun_dispose_class (audio_driver_class_t *this_gen) {
-
- sun_class_t *this = (sun_class_t *) this_gen;
-
- free (this);
-}
-
static void *ao_sun_init_class (xine_t *xine, void *data) {
sun_class_t *this;
@@ -1037,9 +1019,9 @@ static void *ao_sun_init_class (xine_t *xine, void *data) {
return NULL;
this->driver_class.open_plugin = ao_sun_open_plugin;
- this->driver_class.get_identifier = ao_sun_get_identifier;
- this->driver_class.get_description = ao_sun_get_description;
- this->driver_class.dispose = ao_sun_dispose_class;
+ this->driver_class.identifier = "sun";
+ this->driver_class.description = N_("xine audio output plugin using sun-compliant audio devices/drivers");
+ this->driver_class.dispose = default_audio_driver_class_dispose;
this->xine = xine;
diff --git a/src/combined/Makefile.am b/src/combined/Makefile.am
index 6a43fed47..cfb33d5ce 100644
--- a/src/combined/Makefile.am
+++ b/src/combined/Makefile.am
@@ -1,24 +1,68 @@
+include $(top_srcdir)/misc/Makefile.quiet
+SUBDIRS = ffmpeg
+
include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = ffmpeg
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
-if HAVE_WAVPACK
+if ENABLE_WAVPACK
xineplug_wavpack = xineplug_wavpack.la
endif
-if HAVE_LIBFLAC
+if ENABLE_NOSEFART
+xineplug_nsf = xineplug_nsf.la
+endif
+
+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)
-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/combined_wavpack.c b/src/combined/combined_wavpack.c
deleted file mode 100644
index 5e4f47342..000000000
--- a/src/combined/combined_wavpack.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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, USA
- *
- * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
- */
-
-#include "xine_internal.h"
-#include "combined_wavpack.h"
-
-static const demuxer_info_t demux_info_wv = {
- 0 /* priority */
-};
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_WAVPACK, 0
- };
-
-static const decoder_info_t decoder_info_wv = {
- audio_types, /* supported types */
- 8 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "wavpack", XINE_VERSION_CODE, &demux_info_wv, demux_wv_init_plugin },
- { PLUGIN_AUDIO_DECODER, 15, "wavpackdec", XINE_VERSION_CODE, &decoder_info_wv, decoder_wavpack_init_plugin },
- { PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
-};
diff --git a/src/combined/combined_wavpack.h b/src/combined/combined_wavpack.h
deleted file mode 100644
index 3cfa78509..000000000
--- a/src/combined/combined_wavpack.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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, USA
- *
- * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
- */
-
-#include "os_types.h"
-#include "attributes.h"
-
-typedef struct {
- uint32_t idcode; /* This should always be the string "wvpk" */
- uint32_t block_size; /* Size of the rest of the frame */
- uint16_t wv_version; /* Version of the wavpack, 0x0403 should be latest */
- uint8_t track; /* Unused, has to be 0 */
- uint8_t index; /* Unused, has to be 0 */
- uint32_t file_samples; /* (uint32_t)-1 if unknown, else the total number
- of samples for the file */
- uint32_t samples_index; /* Index of the first sample in block, from the
- start of the file */
- 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 */
-} 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
-
-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_flac.c b/src/combined/decoder_flac.c
deleted file mode 100644
index b8650810b..000000000
--- a/src/combined/decoder_flac.c
+++ /dev/null
@@ -1,454 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * John McCutchan 2003
- * FLAC Decoder (http://flac.sf.net)
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include <FLAC/stream_decoder.h>
-
-#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8
-#include <FLAC/seekable_stream_decoder.h>
-#define LEGACY_FLAC
-#else
-#undef LEGACY_FLAC
-#endif
-
-#define LOG_MODULE "flac_decoder"
-#define LOG_VERBOSE
-
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-
-#include "demux_flac.h"
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} flac_class_t;
-
-typedef struct flac_decoder_s {
- audio_decoder_t audio_decoder;
-
- 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;
- size_t buf_size;
- size_t buf_pos;
- size_t min_size;
-
-} flac_decoder_t;
-
-/*
- * FLAC callback functions
- */
-
-#ifdef LEGACY_FLAC
-static FLAC__StreamDecoderReadStatus
-flac_read_callback (const FLAC__StreamDecoder *decoder,
- FLAC__byte buffer[],
- unsigned *bytes,
- void *client_data)
-#else
-static FLAC__StreamDecoderReadStatus
-flac_read_callback (const FLAC__StreamDecoder *decoder,
- FLAC__byte buffer[],
- size_t *bytes,
- void *client_data)
-#endif
-{
- flac_decoder_t *this = (flac_decoder_t *)client_data;
- size_t number_of_bytes_to_copy;
-
- lprintf("flac_read_callback: %zd\n", (size_t)*bytes);
-
- if (this->buf_pos > *bytes)
- number_of_bytes_to_copy = *bytes;
- else
- number_of_bytes_to_copy = this->buf_pos;
-
- lprintf("number_of_bytes_to_copy: %zd\n", number_of_bytes_to_copy);
-
- *bytes = number_of_bytes_to_copy;
-
- xine_fast_memcpy (buffer, this->buf, number_of_bytes_to_copy);
-
- this->buf_pos -= number_of_bytes_to_copy;
- memmove(this->buf, &this->buf[number_of_bytes_to_copy], this->buf_pos );
-
- if(number_of_bytes_to_copy)
- return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
- else
- return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
-}
-
-static FLAC__StreamDecoderWriteStatus
-flac_write_callback (const FLAC__StreamDecoder *decoder,
- const FLAC__Frame *frame,
- const FLAC__int32 *const buffer[],
- void *client_data)
-{
- flac_decoder_t *this = (flac_decoder_t *)client_data;
- audio_buffer_t *audio_buffer = NULL;
- int samples_left = frame->header.blocksize;
- int bytes_per_sample = (frame->header.bits_per_sample <= 8) ? 1 : 2;
- int buf_samples;
- int8_t *data8;
- int16_t *data16;
- int i,j;
-
- lprintf("flac_write_callback\n");
-
- while( samples_left ) {
-
- audio_buffer = this->stream->audio_out->get_buffer(this->stream->audio_out);
-
- if( audio_buffer->mem_size < samples_left * frame->header.channels * bytes_per_sample )
- buf_samples = audio_buffer->mem_size / (frame->header.channels * bytes_per_sample);
- else
- buf_samples = samples_left;
-
- switch (frame->header.bits_per_sample) {
- case 8:
- data8 = (int8_t *)audio_buffer->mem;
-
- for( j=0; j < buf_samples; j++ )
- for( i=0; i < frame->header.channels; i++ )
- *data8++ = buffer[i][j];
- break;
-
- case 16:
- data16 = (int16_t *)audio_buffer->mem;
-
- for( j=0; j < buf_samples; j++ )
- for( i=0; i < frame->header.channels; i++ )
- *data16++ = buffer[i][j];
- break;
-
- case 24:
- data16 = (int16_t *)audio_buffer->mem;
-
- for( j=0; j < buf_samples; j++ )
- for( i=0; i < frame->header.channels; i++ )
- *data16++ = buffer[i][j] >> 8;
- break;
-
- }
-
- audio_buffer->num_frames = buf_samples;
- audio_buffer->vpts = this->pts;
- this->pts = 0;
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
- samples_left -= buf_samples;
- }
- return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
-}
-
-#ifdef LEGACY_FLAC
-static void
-flac_metadata_callback (const FLAC__StreamDecoder *decoder,
- const FLAC__StreamMetadata *metadata,
- void *client_data)
-{
- /* flac_decoder_t *this = (flac_decoder_t *)client_data; */
-
- lprintf("Metadata callback called!\n");
-
-#ifdef LOG
- if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
- printf("libflac: min_blocksize = %d\n", metadata->data.stream_info.min_blocksize);
- printf("libflac: max_blocksize = %d\n", metadata->data.stream_info.max_blocksize);
- printf("libflac: min_framesize = %d\n", metadata->data.stream_info.min_framesize);
- printf("libflac: max_framesize = %d\n", metadata->data.stream_info.max_framesize);
- /* does not work well:
- this->min_size = 2 * metadata->data.stream_info.max_blocksize; */
- }
-#endif
-
- return;
-}
-#endif
-
-static void
-flac_error_callback (const FLAC__StreamDecoder *decoder,
- FLAC__StreamDecoderErrorStatus status,
- void *client_data)
-{
- /* This will be called if there is an error in the flac stream */
- lprintf("flac_error_callback\n");
-
-#ifdef LOG
- if (status == FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
- printf("libflac: Decoder lost synchronization.\n");
- else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER)
- printf("libflac: Decoder encounted a corrupted frame header.\n");
- else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH)
- printf("libflac: Frame's data did not match the CRC in the footer.\n");
- else
- printf("libflac: unknown error.\n");
-#endif
-
- return;
-}
-
-
-/*
- * FLAC plugin decoder
- */
-
-static void
-flac_reset (audio_decoder_t *this_gen)
-{
- flac_decoder_t *this = (flac_decoder_t *) this_gen;
-
- this->buf_pos = 0;
-
- if( FLAC__stream_decoder_get_state(this->flac_decoder) !=
- FLAC__STREAM_DECODER_SEARCH_FOR_METADATA )
- FLAC__stream_decoder_flush (this->flac_decoder);
-}
-
-static void
-flac_discontinuity (audio_decoder_t *this_gen)
-{
- flac_decoder_t *this = (flac_decoder_t *) this_gen;
-
- this->pts = 0;
-
- lprintf("Discontinuity!\n");
-}
-
-static void
-flac_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
-{
- flac_decoder_t *this = (flac_decoder_t *) this_gen;
- int ret = 1;
-
- /* We are getting the stream header, open up the audio
- * device, and collect information about the stream
- */
- 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);
-
- if (!this->output_open)
- {
- const int bits = this->bits_per_sample;
- this->output_open = (this->stream->audio_out->open) (
- this->stream->audio_out,
- this->stream,
- bits > 16 ? 16 : bits,
- this->sample_rate,
- mode);
- }
- this->buf_pos = 0;
- } else if (this->output_open)
- {
- /* This isn't a header frame and we have opened the output device */
-
-
- /* What we have buffered so far, and what is coming in
- * is larger than our buffer
- */
- if (this->buf_pos + buf->size > this->buf_size)
- {
- this->buf_size += 2 * buf->size;
- this->buf = realloc (this->buf, this->buf_size);
- lprintf("reallocating buffer to %d\n", this->buf_size);
- }
-
- xine_fast_memcpy (&this->buf[this->buf_pos], buf->content, buf->size);
- this->buf_pos += buf->size;
-
- if (buf->pts)
- this->pts = buf->pts;
-
- /* We have enough to decode a frame */
- while( ret && this->buf_pos > this->min_size ) {
-
- FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(this->flac_decoder);
-
- if( state == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA ) {
- lprintf("process_until_end_of_metadata\n");
- ret = FLAC__stream_decoder_process_until_end_of_metadata (this->flac_decoder);
- } else if ( state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ||
- state == FLAC__STREAM_DECODER_READ_FRAME ) {
- lprintf("process_single\n");
- ret = FLAC__stream_decoder_process_single (this->flac_decoder);
- } else {
- lprintf("aborted.\n");
- FLAC__stream_decoder_flush (this->flac_decoder);
- break;
- }
- }
- } else
- return;
-
-
-}
-
-static void
-flac_dispose (audio_decoder_t *this_gen) {
- flac_decoder_t *this = (flac_decoder_t *) this_gen;
-
- FLAC__stream_decoder_finish (this->flac_decoder);
-
- FLAC__stream_decoder_delete (this->flac_decoder);
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
- if (this->buf)
- free(this->buf);
-
- free (this_gen);
-}
-
-static audio_decoder_t *
-open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
- flac_decoder_t *this ;
-
- this = calloc(1, sizeof (flac_decoder_t));
-
- this->audio_decoder.decode_data = flac_decode_data;
- this->audio_decoder.reset = flac_reset;
- this->audio_decoder.discontinuity = flac_discontinuity;
- this->audio_decoder.dispose = flac_dispose;
- this->stream = stream;
-
- this->output_open = 0;
- this->buf = NULL;
- this->buf_size = 0;
- this->min_size = 65536;
- this->pts = 0;
-
- this->flac_decoder = FLAC__stream_decoder_new();
-
-#ifdef LEGACY_FLAC
- FLAC__stream_decoder_set_read_callback (this->flac_decoder,
- flac_read_callback);
- FLAC__stream_decoder_set_write_callback (this->flac_decoder,
- flac_write_callback);
- FLAC__stream_decoder_set_metadata_callback (this->flac_decoder,
- flac_metadata_callback);
- FLAC__stream_decoder_set_error_callback (this->flac_decoder,
- flac_error_callback);
-
- FLAC__stream_decoder_set_client_data (this->flac_decoder, this);
-
- if (FLAC__stream_decoder_init (this->flac_decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) {
- free (this);
- return NULL;
- }
-#else
- if ( FLAC__stream_decoder_init_stream (this->flac_decoder,
- flac_read_callback,
- NULL, /* seek */
- NULL, /* tell */
- NULL, /* length */
- NULL, /* eof */
- flac_write_callback,
- NULL, /* metadata */
- flac_error_callback,
- this
- ) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
- free (this);
- return NULL;
- }
-#endif
-
- return (audio_decoder_t *) this;
-}
-
-/*
- * flac plugin class
- */
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "flacdec";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "flac audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *
-init_plugin (xine_t *xine, void *data) {
- flac_class_t *this;
-
- this = calloc(1, sizeof (flac_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_FLAC, 0
- };
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 8 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "flac", XINE_VERSION_CODE, NULL, demux_flac_init_class },
- { PLUGIN_AUDIO_DECODER, 15, "flacdec", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/combined/decoder_wavpack.c b/src/combined/decoder_wavpack.c
deleted file mode 100644
index 21dc0dbd1..000000000
--- a/src/combined/decoder_wavpack.c
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * 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, USA
- *
- * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#define LOG_MODULE "decode_wavpack"
-#define LOG_VERBOSE
-
-#include "xine_internal.h"
-#include "attributes.h"
-#include "bswap.h"
-
-#include <wavpack/wavpack.h>
-#include "combined_wavpack.h"
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} wavpack_class_t;
-
-typedef struct {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- uint8_t *buf;
- size_t buf_size;
- size_t buf_pos;
-
- int sample_rate;
- uint16_t bits_per_sample:6;
- uint16_t channels:4;
-
- uint16_t output_open:1;
-
-} wavpack_decoder_t;
-
-/* Wrapper functions for Wavpack */
-static int32_t xine_buffer_read_bytes(void *const this_gen, void *const data,
- int32_t bcount) {
- wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
-
- if ( bcount <= 0 )
- return 0;
-
- if ( bcount > (this->buf_size - this->buf_pos) )
- bcount = (this->buf_size - this->buf_pos);
-
- xine_fast_memcpy(data, this->buf + this->buf_pos, bcount);
- this->buf_pos += bcount;
-
- return bcount;
-}
-
-static uint32_t xine_buffer_get_pos(void *const this_gen) {
- wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
- return this->buf_pos;
-}
-
-static int xine_buffer_set_pos_rel(void *const this_gen, const int32_t delta,
- const int mode) {
- wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
-
- switch(mode) {
- case SEEK_SET:
- if ( delta < 0 || delta > this->buf_size )
- return -1;
-
- this->buf_pos = delta;
- return 0;
- case SEEK_CUR:
- if ( (this->buf_pos+delta) < 0 || (this->buf_pos+delta) > this->buf_size )
- return -1;
-
- this->buf_pos += delta;
- return 0;
- case SEEK_END:
- if ( delta < 0 || delta > this->buf_size )
- return -1;
-
- this->buf_pos = this->buf_size - delta;
-
- return 0;
-
- default:
- return -1;
- }
-}
-
-static int xine_buffer_set_pos_abs(void *const this_gen, const uint32_t pos) {
- return xine_buffer_set_pos_rel(this_gen, pos, SEEK_SET);
-}
-
-static int xine_buffer_push_back_byte(void *const this_gen, const int c) {
- if ( ! xine_buffer_set_pos_rel(this_gen, -1, SEEK_CUR) )
- return EOF;
- return c;
-}
-
-static uint32_t xine_buffer_get_length(void *const this_gen) {
- wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
- return this->buf_size;
-}
-
-static int xine_buffer_can_seek(void *const this_gen) {
- return 1;
-}
-
-static int32_t xine_buffer_write_bytes(__attr_unused void *const id,
- __attr_unused void *const data,
- __attr_unused const int32_t bcount) {
- lprintf("xine_buffer_write_bytes: access is read-only.\n");
- return 0;
-}
-
-/* Wavpack plugin functions */
-static void wavpack_reset (audio_decoder_t *const this_gen)
-{
- wavpack_decoder_t *const this = (wavpack_decoder_t *) this_gen;
-
- this->buf_pos = 0;
-}
-
-static void wavpack_discontinuity (audio_decoder_t *const this_gen)
-{
- /* wavpack_decoder_t *this = (wavpack_decoder_t *) this_gen; */
-
- lprintf("Discontinuity!\n");
-}
-
-static void wavpack_decode_data (audio_decoder_t *const this_gen, buf_element_t *const buf)
-{
- wavpack_decoder_t *const this = (wavpack_decoder_t *) this_gen;
-
- /* We are getting the stream header, open up the audio
- * device, and collect information about the stream
- */
- if (buf->decoder_flags & BUF_FLAG_STDHEADER)
- {
- int mode = AO_CAP_MODE_MONO;
-
- this->sample_rate = buf->decoder_info[1];
- _x_assert(buf->decoder_info[2] <= 32);
- this->bits_per_sample = buf->decoder_info[2];
- _x_assert(buf->decoder_info[3] <= 8);
- this->channels = buf->decoder_info[3];
-
- mode = _x_ao_channels2mode(this->channels);
-
- _x_meta_info_set(this->stream, XINE_META_INFO_AUDIOCODEC,
- "WavPack");
-
- 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,
- mode) ? 1 : 0;
- }
- this->buf_pos = 0;
- } else if (this->output_open) {
- /* This isn't a header frame and we have opened the output device */
-
- /* What we have buffered so far, and what is coming in
- * is larger than our buffer
- */
- if (this->buf_pos + buf->size > this->buf_size)
- {
- this->buf_size += 2 * buf->size;
- this->buf = realloc (this->buf, this->buf_size);
- lprintf("reallocating buffer to %zd\n", this->buf_size);
- }
-
- xine_fast_memcpy (&this->buf[this->buf_pos], buf->content, buf->size);
- this->buf_pos += buf->size;
-
- if ( buf->decoder_flags & BUF_FLAG_FRAME_END ) {
- static WavpackStreamReader wavpack_buffer_reader = {
- .read_bytes = xine_buffer_read_bytes,
- .get_pos = xine_buffer_get_pos,
- .set_pos_abs = xine_buffer_set_pos_abs,
- .set_pos_rel = xine_buffer_set_pos_rel,
- .push_back_byte = xine_buffer_push_back_byte,
- .get_length = xine_buffer_get_length,
- .can_seek = xine_buffer_can_seek,
- .write_bytes = xine_buffer_write_bytes
- };
-
- WavpackContext *ctx = NULL;
- /* Current version of wavpack (4.40) does not write more than this */
- char error[256] = { 0, };
- int32_t samples_left; uint32_t samples_total;
- const wvheader_t *header = (const wvheader_t*)this->buf;
-
- this->buf_pos = 0;
-
- if ( le2me_32(header->samples_count) == 0 ) return;
-
- ctx = WavpackOpenFileInputEx(&wavpack_buffer_reader, this, NULL, error, OPEN_STREAMING, 0);
- if ( ! ctx ) {
- lprintf("unable to open the stream: %s\n", error);
- this->buf_pos = 0;
- return;
- }
-
- samples_left = samples_total = header->samples_count;
- while ( samples_left > 0 ) {
- uint32_t buf_samples, decoded_count;
- audio_buffer_t *audio_buffer = this->stream->audio_out->get_buffer(this->stream->audio_out);
- int32_t *decoded;
- int i;
-
- buf_samples = audio_buffer->mem_size / (this->channels * (this->bits_per_sample/8));
- if ( buf_samples > samples_left ) buf_samples = samples_left;
-
- decoded = alloca(buf_samples * this->channels * sizeof(int32_t));
-
- decoded_count = WavpackUnpackSamples(ctx, decoded, buf_samples);
- if ( decoded_count == 0 && *error ) {
- lprintf("Error during decode: %s\n", error);
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, NULL);
- break;
- }
-
- if ( decoded_count == 0 ) {
- lprintf("Finished decoding, but still %d samples left?\n", samples_left);
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, NULL);
- break;
- }
-
- lprintf("Decoded %d samples\n", buf_samples);
-
- samples_left -= decoded_count;
-
- audio_buffer->num_frames = decoded_count;
- audio_buffer->vpts = 0; /* TODO: Fix the pts calculation */
- // audio_buffer->vpts = (buf->pts * (samples_total-samples_left)) / samples_total;
- lprintf("Audio buffer with pts %"PRId64"\n", audio_buffer->vpts);
-
- switch(this->bits_per_sample) {
- case 8: {
- int8_t *data8 = (int8_t*)audio_buffer->mem;
- for(i = 0; i < decoded_count*this->channels; i++)
- data8[i] = decoded[i];
- }
- break;
- case 16: {
- int16_t *data16 = (int16_t*)audio_buffer->mem;
- for(i = 0; i < decoded_count*this->channels; i++)
- data16[i] = decoded[i];
- }
- }
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
- }
-
- WavpackCloseFile(ctx);
- this->buf_pos = 0;
- }
- }
-}
-
-static void wavpack_dispose (audio_decoder_t *this_gen) {
- wavpack_decoder_t *this = (wavpack_decoder_t *) this_gen;
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
- free(this->buf);
-
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
- wavpack_decoder_t * const this = calloc(1, sizeof (wavpack_decoder_t));
-
- this->audio_decoder.decode_data = wavpack_decode_data;
- this->audio_decoder.reset = wavpack_reset;
- this->audio_decoder.discontinuity = wavpack_discontinuity;
- this->audio_decoder.dispose = wavpack_dispose;
- this->stream = stream;
-
- this->buf = NULL;
- this->buf_size = 0;
-
- return (audio_decoder_t *) this;
-}
-
-/*
- * wavpack plugin class
- */
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "wavpackdec";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "wavpack audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-void *decoder_wavpack_init_plugin (xine_t *xine, void *data) {
- wavpack_class_t *this;
-
- this = calloc(1, sizeof (wavpack_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c
deleted file mode 100644
index 494bb5050..000000000
--- a/src/combined/demux_flac.c
+++ /dev/null
@@ -1,771 +0,0 @@
-/*
- * Copyright (C) 2000-2006 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, USA
- *
- *
- * John McCutchan
- * FLAC demuxer (http://flac.sf.net)
- *
- * TODO: Skip id3v2 tags.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sched.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include <FLAC/stream_decoder.h>
-
-#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8
-#include <FLAC/seekable_stream_decoder.h>
-#define LEGACY_FLAC
-#else
-#undef LEGACY_FLAC
-#endif
-
-#define LOG_MODULE "demux_flac"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "../demuxers/demux.h"
-
-#include "demux_flac.h"
-
-#ifndef LEGACY_FLAC
-# define FLAC__SeekableStreamDecoder FLAC__StreamDecoder
-#endif
-
-/* FLAC Demuxer plugin */
-typedef struct demux_flac_s {
- demux_plugin_t demux_plugin;
-
- xine_stream_t *stream;
-
- fifo_buffer_t *audio_fifo;
- fifo_buffer_t *video_fifo;
-
- input_plugin_t *input;
-
- int status;
-
- int seek_flag;
-
- off_t data_start;
- off_t data_size;
-
- /* FLAC Stuff */
- FLAC__SeekableStreamDecoder *flac_decoder;
-
- uint64_t total_samples;
- uint64_t bits_per_sample;
- uint64_t channels;
- uint64_t sample_rate;
- uint64_t length_in_msec;
-} demux_flac_t ;
-
-
-/* FLAC Demuxer class */
-typedef struct demux_flac_class_s {
- demux_class_t demux_class;
-
- xine_t *xine;
- config_values_t *config;
-
-} demux_flac_class_t;
-
-/* FLAC Callbacks */
-static
-#ifdef LEGACY_FLAC
-FLAC__SeekableStreamDecoderReadStatus
-flac_read_callback (const FLAC__SeekableStreamDecoder *decoder,
- FLAC__byte buffer[],
- unsigned *bytes,
- void *client_data)
-#else
-FLAC__StreamDecoderReadStatus
-flac_read_callback (const FLAC__SeekableStreamDecoder *decoder,
- FLAC__byte buffer[],
- size_t *bytes,
- void *client_data)
-#endif
-{
- demux_flac_t *this = (demux_flac_t *)client_data;
- input_plugin_t *input = this->input;
- off_t offset = *bytes;
-
- lprintf("flac_read_callback\n");
-
- /* This should only be called when flac is reading the metadata
- * of the flac stream.
- */
-
- offset = input->read (input, buffer, offset);
-
- lprintf("Read %lld / %u bytes into buffer\n", offset, *bytes);
-
- /* This is the way to detect EOF with xine input plugins */
- if ( offset <= 0 && *bytes != 0 )
- {
- *bytes = offset;
- lprintf("Marking EOF\n");
-
- this->status = DEMUX_FINISHED;
-#ifdef LEGACY_FLAC
- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
-#else
- return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
-#endif
- }
- else
- {
- *bytes = offset;
- lprintf("Read was perfect\n");
-
-#ifdef LEGACY_FLAC
- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
-#else
- return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
-#endif
- }
-}
-
-static
-#ifdef LEGACY_FLAC
-FLAC__SeekableStreamDecoderSeekStatus
-#else
-FLAC__StreamDecoderSeekStatus
-#endif
-flac_seek_callback (const FLAC__SeekableStreamDecoder *decoder,
- FLAC__uint64 absolute_byte_offset,
- void *client_data)
-{
- input_plugin_t *input = ((demux_flac_t *)client_data)->input;
- off_t offset;
-
- lprintf("flac_seek_callback\n");
-
- offset = input->seek (input, absolute_byte_offset, SEEK_SET);
-
- if (offset == -1)
-#ifdef LEGACY_FLAC
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
-#else
- return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
-#endif
- else
-#ifdef LEGACY_FLAC
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
-#else
- return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
-#endif
-}
-
-static
-#ifdef LEGACY_FLAC
-FLAC__SeekableStreamDecoderTellStatus
-#else
-FLAC__StreamDecoderTellStatus
-#endif
-flac_tell_callback (const FLAC__SeekableStreamDecoder *decoder,
- FLAC__uint64 *absolute_byte_offset,
- void *client_data)
-{
- input_plugin_t *input = ((demux_flac_t *)client_data)->input;
- off_t offset;
-
- lprintf("flac_tell_callback\n");
-
- offset = input->get_current_pos (input);
-
- *absolute_byte_offset = offset;
-
-#ifdef LEGACY_FLAC
- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
-#else
- return FLAC__STREAM_DECODER_TELL_STATUS_OK;
-#endif
-}
-
-static
-#ifdef LEGACY_FLAC
-FLAC__SeekableStreamDecoderLengthStatus
-#else
-FLAC__StreamDecoderLengthStatus
-#endif
-flac_length_callback (const FLAC__SeekableStreamDecoder *decoder,
- FLAC__uint64 *stream_length,
- void *client_data)
-{
- input_plugin_t *input = ((demux_flac_t *)client_data)->input;
- off_t offset;
-
- lprintf("flac_length_callback\n");
-
- offset = input->get_length (input);
-
- /* FIXME, can flac handle -1 as offset ? */
-#ifdef LEGACY_FLAC
- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
-#else
- return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
-#endif
-}
-
-static FLAC__bool
-flac_eof_callback (const FLAC__SeekableStreamDecoder *decoder,
- void *client_data)
-{
- demux_flac_t *this = (demux_flac_t *)client_data;
-
- lprintf("flac_eof_callback\n");
-
- if (this->status == DEMUX_FINISHED)
- {
- lprintf("flac_eof_callback: True!\n");
-
- return true;
- }
- else
- {
- lprintf("flac_eof_callback: False!\n");
-
- return false;
- }
-}
-
-static FLAC__StreamDecoderWriteStatus
-flac_write_callback (const FLAC__SeekableStreamDecoder *decoder,
- const FLAC__Frame *frame,
- const FLAC__int32 * const buffer[],
- void *client_data)
-{
- /* This should never be called, all we use flac for in this demuxer
- * is seeking. We do the decoding in the decoder
- */
-
- lprintf("Error: Write callback was called!\n");
-
- return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
-}
-
-static void
-flac_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
- const FLAC__StreamMetadata *metadata,
- void *client_data)
-{
- demux_flac_t *this = (demux_flac_t *)client_data;
-
- lprintf("IN: Metadata callback\n");
-
- /* This should be called when we first look at a flac stream,
- * We get information about the stream here.
- */
- if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
- lprintf("Got METADATA!\n");
-
- this->total_samples = metadata->data.stream_info.total_samples;
- this->bits_per_sample = metadata->data.stream_info.bits_per_sample;
- this->channels = metadata->data.stream_info.channels;
- this->sample_rate = metadata->data.stream_info.sample_rate;
- this->length_in_msec = (this->total_samples * 1000) /
- this->sample_rate;
- }
- return;
-}
-
-static void
-flac_error_callback (const FLAC__SeekableStreamDecoder *decoder,
- FLAC__StreamDecoderErrorStatus status,
- void *client_data)
-{
- demux_flac_t *this = (demux_flac_t *)client_data;
- /* This will be called if there is an error when flac is seeking
- * in the stream.
- */
-
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_flac: flac_error_callback\n");
-
- if (status == FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_flac: Decoder lost synchronization.\n");
- else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER)
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_flac: Decoder encounted a corrupted frame header.\n");
- else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH)
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_flac: Frame's data did not match the CRC in the footer.\n");
- else
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_flac: unknown error.\n");
-
- this->status = DEMUX_FINISHED;
-
- return;
-}
-
-/* FLAC Demuxer plugin */
-static int
-demux_flac_send_chunk (demux_plugin_t *this_gen) {
- demux_flac_t *this = (demux_flac_t *) this_gen;
- buf_element_t *buf = NULL;
- off_t current_file_pos, file_size = 0;
- int64_t current_pts;
- unsigned int remaining_sample_bytes = 0;
-
- remaining_sample_bytes = 2048;
-
- current_file_pos = this->input->get_current_pos (this->input)
- - this->data_start;
- if( (this->data_size - this->data_start) > 0 )
- file_size = (this->data_size - this->data_start);
-
- current_pts = current_file_pos;
- current_pts *= this->length_in_msec * 90;
- if( file_size )
- current_pts /= file_size;
-
- if (this->seek_flag) {
-#ifdef USE_ESTIMATED_PTS
- _x_demux_control_newpts (this->stream, current_pts, BUF_FLAG_SEEK);
-#else
- _x_demux_control_newpts (this->stream, 0, BUF_FLAG_SEEK);
-#endif
- this->seek_flag = 0;
- }
-
-
- while (remaining_sample_bytes)
- {
- if(!this->audio_fifo) {
- this->status = DEMUX_FINISHED;
- break;
- }
-
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
- buf->type = BUF_AUDIO_FLAC;
- if( file_size )
- buf->extra_info->input_normpos = (int) ((double)current_file_pos * 65535 / file_size);
- buf->extra_info->input_time = current_pts / 90;
-#ifdef USE_ESTIMATED_PTS
- buf->pts = current_pts;
-#else
- buf->pts = 0;
-#endif
-
- if (remaining_sample_bytes > buf->max_size)
- buf->size = buf->max_size;
- else
- buf->size = remaining_sample_bytes;
-
- remaining_sample_bytes -= buf->size;
-
- if (this->input->read (this->input,buf->content,buf->size)!=buf->size) {
- lprintf("buf->size != input->read()\n");
-
- buf->free_buffer (buf);
- this->status = DEMUX_FINISHED;
- break;
- }
-
- /*
- if (!remaining_sample_bytes)
- {
- buf->decoder_flags |= BUF_FLAG_FRAME_END;
- }*/
-
- this->audio_fifo->put (this->audio_fifo, buf);
- }
-
- return this->status;
-}
-
-static void
-demux_flac_send_headers (demux_plugin_t *this_gen) {
- demux_flac_t *this = (demux_flac_t *) this_gen;
-
- buf_element_t *buf;
-
- lprintf("demux_flac_send_headers\n");
-
- this->video_fifo = this->stream->video_fifo;
- this->audio_fifo = this->stream->audio_fifo;
-
- this->status = DEMUX_OK;
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, this->channels);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->sample_rate);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, this->bits_per_sample);
-
- _x_demux_control_start (this->stream);
-
- if (this->audio_fifo) {
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
- buf->type = BUF_AUDIO_FLAC;
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
- buf->decoder_info[0] = 0;
- buf->decoder_info[1] = this->sample_rate;
- buf->decoder_info[2] = this->bits_per_sample;
- buf->decoder_info[3] = this->channels;
- buf->size = 0;
- this->audio_fifo->put (this->audio_fifo, buf);
- }
-}
-
-static void
-demux_flac_dispose (demux_plugin_t *this_gen) {
- demux_flac_t *this = (demux_flac_t *) this_gen;
-
- lprintf("demux_flac_dispose\n");
-
- if (this->flac_decoder)
-#ifdef LEGACY_FLAC
- FLAC__seekable_stream_decoder_delete (this->flac_decoder);
-#else
- FLAC__stream_decoder_delete (this->flac_decoder);
-#endif
-
- free(this);
- return;
-}
-
-static int
-demux_flac_get_status (demux_plugin_t *this_gen) {
- demux_flac_t *this = (demux_flac_t *) this_gen;
-
- lprintf("demux_flac_get_status\n");
-
- return this->status;
-}
-
-
-static int
-demux_flac_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) {
- demux_flac_t *this = (demux_flac_t *) this_gen;
-
- lprintf("demux_flac_seek\n");
-
- start_pos = (off_t) ( (double) start_pos / 65535 *
- this->input->get_length (this->input) );
-
- if (!start_pos && start_time) {
- double distance = (double)start_time;
-
- if (this->length_in_msec != 0)
- {
- distance /= (double)this->length_in_msec;
- }
- start_pos = (uint64_t)(distance * (this->data_size - this->data_start));
- }
-
- if (start_pos || !start_time) {
-
- start_pos += this->data_start;
- this->input->seek (this->input, start_pos, SEEK_SET);
- lprintf ("Seek to position: %lld\n", start_pos);
-
- } else {
-
- double distance = (double)start_time;
- uint64_t target_sample;
- FLAC__bool s = false;
-
- if (this->length_in_msec != 0)
- {
- distance /= (double)this->length_in_msec;
- }
- target_sample = (uint64_t)(distance * this->total_samples);
-
-#ifdef LEGACY_FLAC
- s = FLAC__seekable_stream_decoder_seek_absolute (this->flac_decoder,
- target_sample);
-#else
- s = FLAC__stream_decoder_seek_absolute (this->flac_decoder,
- target_sample);
-#endif
-
- if (s) {
- lprintf ("Seek to: %d successfull!\n", start_time);
- } else
- this->status = DEMUX_FINISHED;
- }
-
- _x_demux_flush_engine (this->stream);
- this->seek_flag = 1;
-
- return this->status;
-}
-
-static int
-demux_flac_get_stream_length (demux_plugin_t *this_gen) {
- demux_flac_t *this = (demux_flac_t *) this_gen;
-
- lprintf("demux_flac_get_stream_length\n");
-
- if (this->flac_decoder)
- return this->length_in_msec;
- else
- return 0;
-}
-
-static uint32_t
-demux_flac_get_capabilities (demux_plugin_t *this_gen) {
- lprintf("demux_flac_get_capabilities\n");
-
- return DEMUX_CAP_NOCAP;
-}
-
-static int
-demux_flac_get_optional_data (demux_plugin_t *this_gen, void *data, int dtype) {
- lprintf("demux_flac_get_optional_data\n");
-
- return DEMUX_OPTIONAL_UNSUPPORTED;
-}
-
-static demux_plugin_t *
-open_plugin (demux_class_t *class_gen,
- xine_stream_t *stream,
- input_plugin_t *input) {
- demux_flac_t *this;
-
- lprintf("open_plugin\n");
-
- switch (stream->content_detection_method) {
- case METHOD_BY_CONTENT:
- {
- uint8_t buf[MAX_PREVIEW_SIZE];
- int len;
-
- /*
- * try to get a preview of the data
- */
- len = input->get_optional_data (input, buf, INPUT_OPTIONAL_DATA_PREVIEW);
- if (len == INPUT_OPTIONAL_UNSUPPORTED) {
-
- if (input->get_capabilities (input) & INPUT_CAP_SEEKABLE) {
-
- input->seek (input, 0, SEEK_SET);
- if ( (len=input->read (input, buf, 1024)) <= 0)
- return NULL;
- input->seek (input, 0, SEEK_SET);
-
- } else
- return NULL;
- }
-
- /* FIXME: Skip id3v2 tag */
- /* Look for fLaC tag at the beginning of file */
- if ( (buf[0] != 'f') || (buf[1] != 'L') ||
- (buf[2] != 'a') || (buf[3] != 'C') )
- return NULL;
- }
- break;
- case METHOD_BY_EXTENSION: {
- const char *ending, *mrl;
-
- mrl = input->get_mrl (input);
-
- ending = strrchr (mrl, '.');
-
- if (!ending || (strlen (ending) < 5))
- return NULL;
-
- if (strncasecmp (ending, ".flac", 5))
- return NULL;
- }
- break;
- case METHOD_EXPLICIT:
- break;
- default:
- return NULL;
- break;
- }
-
- /*
- * if we reach this point, the input has been accepted.
- */
-
- this = calloc(1, sizeof (demux_flac_t));
- this->stream = stream;
- this->input = input;
-
- this->demux_plugin.send_headers = demux_flac_send_headers;
- this->demux_plugin.send_chunk = demux_flac_send_chunk;
- this->demux_plugin.seek = demux_flac_seek;
- this->demux_plugin.dispose = demux_flac_dispose;
- this->demux_plugin.get_status = demux_flac_get_status;
- this->demux_plugin.get_stream_length = demux_flac_get_stream_length;
- this->demux_plugin.get_capabilities = demux_flac_get_capabilities;
- this->demux_plugin.get_optional_data = demux_flac_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->seek_flag = 0;
-
-
- /* Get a new FLAC decoder and hook up callbacks */
-#ifdef LEGACY_FLAC
- this->flac_decoder = FLAC__seekable_stream_decoder_new();
- lprintf("this->flac_decoder: %p\n", this->flac_decoder);
-
- FLAC__seekable_stream_decoder_set_md5_checking (this->flac_decoder, false);
- FLAC__seekable_stream_decoder_set_read_callback (this->flac_decoder,
- flac_read_callback);
- FLAC__seekable_stream_decoder_set_seek_callback (this->flac_decoder,
- flac_seek_callback);
- FLAC__seekable_stream_decoder_set_tell_callback (this->flac_decoder,
- flac_tell_callback);
- FLAC__seekable_stream_decoder_set_length_callback (this->flac_decoder,
- flac_length_callback);
- FLAC__seekable_stream_decoder_set_eof_callback (this->flac_decoder,
- flac_eof_callback);
- FLAC__seekable_stream_decoder_set_metadata_callback (this->flac_decoder,
- flac_metadata_callback);
- FLAC__seekable_stream_decoder_set_write_callback (this->flac_decoder,
- flac_write_callback);
- FLAC__seekable_stream_decoder_set_error_callback (this->flac_decoder,
- flac_error_callback);
- FLAC__seekable_stream_decoder_set_client_data (this->flac_decoder,
- this);
-
- FLAC__seekable_stream_decoder_init (this->flac_decoder);
-#else
- this->flac_decoder = FLAC__stream_decoder_new();
- lprintf("this->flac_decoder: %p\n", this->flac_decoder);
-
- if ( ! this->flac_decoder ) {
- free(this);
- return NULL;
- }
-
- FLAC__stream_decoder_set_md5_checking (this->flac_decoder, false);
-
- if ( FLAC__stream_decoder_init_stream(this->flac_decoder,
- flac_read_callback,
- flac_seek_callback,
- flac_tell_callback,
- flac_length_callback,
- flac_eof_callback,
- flac_write_callback,
- flac_metadata_callback,
- flac_error_callback,
- this
- ) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
-#ifdef LEGACY_FLAC
- FLAC__seekable_stream_decoder_delete (this->flac_decoder);
-#else
- FLAC__stream_decoder_delete (this->flac_decoder);
-#endif
- free(this);
- return NULL;
- }
-#endif
-
- /* Get some stream info */
- this->data_size = this->input->get_length (this->input);
- this->data_start = this->input->get_current_pos (this->input);
-
- /* This will cause FLAC to give us the rest of the information on
- * this flac stream
- */
- this->status = DEMUX_OK;
-#ifdef LEGACY_FLAC
- FLAC__seekable_stream_decoder_process_until_end_of_metadata (this->flac_decoder);
-#else
- FLAC__stream_decoder_process_until_end_of_metadata (this->flac_decoder);
-#endif
-
- lprintf("Processed file until end of metadata: %s\n",
- this->status == DEMUX_OK ? "success" : "failure");
-
- if (this->status != DEMUX_OK) {
-#ifdef LEGACY_FLAC
- FLAC__seekable_stream_decoder_delete (this->flac_decoder);
-#else
- FLAC__stream_decoder_delete (this->flac_decoder);
-#endif
- free (this);
- return NULL;
- }
-
- return &this->demux_plugin;
-}
-
-
-/* FLAC Demuxer class */
-
-static const char *
-get_description (demux_class_t *this_gen) {
- return "FLAC demux plugin";
-}
-
-static const char *
-get_identifier (demux_class_t *this_gen) {
- return "FLAC";
-}
-
-static const char *
-get_extensions (demux_class_t *this_gen) {
- return "flac";
-}
-
-static const char *
-get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-flac: flac: FLAC Audio;"
- "audio/flac: flac: FLAC Audio;";
-}
-
-static void
-class_dispose (demux_class_t *this_gen) {
- demux_flac_class_t *this = (demux_flac_class_t *) this_gen;
-
- lprintf("class_dispose\n");
-
- free (this);
-}
-
-void *
-demux_flac_init_class (xine_t *xine, void *data) {
-
- demux_flac_class_t *this;
-
- lprintf("demux_flac_init_class\n");
-
- this = calloc(1, sizeof (demux_flac_class_t));
- this->config = xine->config;
- this->xine = xine;
-
- this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
-
- return this;
-}
diff --git a/src/combined/demux_flac.h b/src/combined/demux_flac.h
deleted file mode 100644
index d9e09e34a..000000000
--- a/src/combined/demux_flac.h
+++ /dev/null
@@ -1,26 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#ifndef HAVE_DEMUX_FLAC_H
-#define HAVE_DEMUX_FLAC_H
-
-void *demux_flac_init_class (xine_t *xine, void *data);
-
-#endif
diff --git a/src/combined/demux_wavpack.c b/src/combined/demux_wavpack.c
deleted file mode 100644
index 94a23acdc..000000000
--- a/src/combined/demux_wavpack.c
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (C) 2006-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, USA
- *
- * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#define LOG_MODULE "demux_wavpack"
-#define LOG_VERBOSE
-#define LOG
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "bswap.h"
-#include "attributes.h"
-
-#include <wavpack/wavpack.h>
-#include "combined_wavpack.h"
-
-typedef struct {
- demux_plugin_t demux_plugin;
-
- xine_stream_t *stream;
- fifo_buffer_t *audio_fifo;
- input_plugin_t *input;
- int status;
-
- uint32_t current_sample;
- uint32_t samples;
- uint32_t samplerate;
- uint16_t bits_per_sample:6;
- uint16_t channels:4;
-} demux_wv_t;
-
-typedef struct {
- demux_class_t demux_class;
-} demux_wv_class_t;
-
-static int32_t xine_input_read_bytes(void *const this_gen, void *const data,
- const int32_t bcount) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- return this->read(this, data, bcount);
-}
-
-static uint32_t xine_input_get_pos(void *const this_gen) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- return this->get_current_pos(this);
-}
-
-static int xine_input_set_pos_abs(void *const this_gen, const uint32_t pos) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- return this->seek(this, pos, SEEK_SET);
-}
-
-static int xine_input_set_pos_rel(void *const this_gen, const int32_t delta,
- const int mode) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- return this->seek(this, delta, mode);
-}
-
-static int xine_input_push_back_byte(void *const this_gen, const int c) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- if ( this->seek(this, -1, SEEK_CUR) ) {
- return c;
- } else {
- lprintf("xine_input_push_back_byte: unable to seek.\n");
- return EOF;
- }
-}
-
-static uint32_t xine_input_get_length(void *const this_gen) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- return this->get_length(this);
-}
-
-static int xine_input_can_seek(void *const this_gen) {
- input_plugin_t *const this = (input_plugin_t*)this_gen;
- return INPUT_IS_SEEKABLE(this);
-}
-
-static int32_t xine_input_write_bytes(__attr_unused void *const id,
- __attr_unused void *const data,
- __attr_unused const int32_t bcount) {
- lprintf("xine_input_write_bytes: acces is read-only.\n");
- return 0;
-}
-
-static WavpackStreamReader wavpack_input_reader = {
- .read_bytes = xine_input_read_bytes,
- .get_pos = xine_input_get_pos,
- .set_pos_abs = xine_input_set_pos_abs,
- .set_pos_rel = xine_input_set_pos_rel,
- .push_back_byte = xine_input_push_back_byte,
- .get_length = xine_input_get_length,
- .can_seek = xine_input_can_seek,
- .write_bytes = xine_input_write_bytes
-};
-
-static int open_wv_file(demux_wv_t *const this) {
- WavpackContext *ctx = NULL;
- char error[256]; /* Current version of wavpack (4.31) does not write more than this */
- wvheader_t header;
- uint32_t tmp;
-
- /* Right now we don't support non-seekable streams */
- if (! INPUT_IS_SEEKABLE(this->input) ) {
- lprintf("open_wv_file: non-seekable inputs aren't supported yet.\n");
- return 0;
- }
-
- /* Read the file header */
- if (_x_demux_read_header(this->input, (uint8_t*)(&header), sizeof(wvheader_t)) != sizeof(wvheader_t))
- return 0;
-
- /* Validate header, we currently support only Wavpack 4 */
- if ( header.idcode != wvpk_signature || (le2me_16(header.wv_version) >> 8) != 4 )
- return 0;
-
- /* Rewind */
- this->input->seek(this->input, 0, SEEK_SET);
-
- ctx = WavpackOpenFileInputEx(&wavpack_input_reader, this->input, NULL, error, 0, 0);
- if ( ! ctx ) {
- lprintf("xine_open_wavpack_input: unable to open the stream: %s\n", error);
- return 0;
- }
-
- this->current_sample = 0;
- this->samples = WavpackGetNumSamples(ctx);
- lprintf("number of samples: %u\n", this->samples);
- this->samplerate = WavpackGetSampleRate(ctx);
- lprintf("samplerate: %u Hz\n", this->samplerate);
-
- tmp = WavpackGetBitsPerSample(ctx); _x_assert(tmp <= 32);
- lprintf("bits_per_sample: %u\n", tmp);
- this->bits_per_sample = tmp;
-
- tmp = WavpackGetNumChannels(ctx); _x_assert(tmp <= 8);
- lprintf("channels: %u\n", tmp);
- this->channels = tmp;
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC,
- wvpk_signature);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS,
- this->channels);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE,
- this->samplerate);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS,
- this->bits_per_sample);
-
- WavpackCloseFile(ctx);
- this->input->seek(this->input, SEEK_SET, 0);
-
- return 1;
-}
-
-static int demux_wv_send_chunk(demux_plugin_t *const this_gen) {
- demux_wv_t *const this = (demux_wv_t *) this_gen;
- uint32_t bytes_to_read; uint8_t header_sent = 0;
- wvheader_t header;
-
- lprintf("new frame\n");
-
- /* Check if we've finished */
- if (this->current_sample >= this->samples) {
- lprintf("all frames read\n");
- this->status = DEMUX_FINISHED;
- return this->status;
- }
-
- lprintf("current sample: %u\n", this->current_sample);
-
- do {
- if ( this->input->read(this->input, (uint8_t*)(&header), sizeof(wvheader_t)) != sizeof(wvheader_t) ) {
- this->status = DEMUX_FINISHED;
- return this->status;
- }
-
- /* The size of the block is «of course» minus 8, and
- it also includes the size of the header.
- */
- bytes_to_read = le2me_32(header.block_size) + 8 - sizeof(wvheader_t);
-
- lprintf("demux_wavpack: going to read %u bytes.\n", bytes_to_read);
-
- while(bytes_to_read) {
- off_t bytes_read = 0, bytes_to_read_now, offset = 0;
- buf_element_t *buf = NULL;
- int64_t input_time_guess;
-
- /* Get a buffer */
- buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo);
- buf->type = BUF_AUDIO_WAVPACK;
- buf->decoder_flags = 0;
-
- /* Set normalised position */
- buf->extra_info->input_normpos =
- (int) ((double) this->input->get_current_pos(this->input) * 65535 /
- this->input->get_length(this->input));
-
- buf->pts = (((this->current_sample) / this->samplerate))*90000;
- lprintf("Sending buffer with PTS %"PRId64"\n", buf->pts);
-
- /* Set time */
- input_time_guess = this->samples;
- input_time_guess /= this->samplerate;
- input_time_guess *= 1000;
- input_time_guess *= buf->extra_info->input_normpos;
- input_time_guess /= 65535;
- buf->extra_info->input_time = input_time_guess;
-
- if ( ! header_sent )
- offset = sizeof(wvheader_t);
-
- bytes_to_read_now = ( bytes_to_read+offset > buf->max_size ) ? buf->max_size-offset : bytes_to_read;
- if ( ! header_sent ) {
- header_sent = 1;
- xine_fast_memcpy(buf->content, &header, sizeof(wvheader_t));
- }
-
- bytes_read = this->input->read(this->input, &buf->content[offset], bytes_to_read_now);
-
- buf->size = offset + bytes_read;
-
- bytes_to_read -= bytes_read;
-
- if ( bytes_to_read <= 0 && (le2me_32(header.flags) & FINAL_BLOCK) == FINAL_BLOCK)
- buf->decoder_flags |= BUF_FLAG_FRAME_END;
-
- this->audio_fifo->put(this->audio_fifo, buf);
- }
- } while ( (le2me_32(header.flags) & FINAL_BLOCK) != FINAL_BLOCK );
-
- this->current_sample += le2me_32(header.samples_count);
-
- return this->status;
-}
-
-static void demux_wv_send_headers(demux_plugin_t *const this_gen) {
- demux_wv_t *const this = (demux_wv_t *) this_gen;
- buf_element_t *buf;
-
- this->audio_fifo = this->stream->audio_fifo;
-
- this->status = DEMUX_OK;
-
- /* Send start buffers */
- _x_demux_control_start(this->stream);
-
- /* Send header to decoder */
- if (this->audio_fifo) {
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
-
- buf->type = BUF_AUDIO_WAVPACK;
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
- buf->decoder_info[0] = this->input->get_length(this->input);
- buf->decoder_info[1] = this->samplerate;
- buf->decoder_info[2] = this->bits_per_sample;
- buf->decoder_info[3] = this->channels;
-
- buf->size = 0;
-
- this->audio_fifo->put (this->audio_fifo, buf);
- }
-}
-
-static int demux_wv_seek (demux_plugin_t *this_gen,
- off_t start_pos, int start_time, int playing) {
- demux_wv_t *const this = (demux_wv_t *) this_gen;
-
- /* If thread is not running, initialize demuxer */
- if( !playing ) {
-
- /* send new pts */
- _x_demux_control_newpts(this->stream, 0, 0);
-
- this->status = DEMUX_OK;
-
- }
-
- return this->status;
-}
-
-static void demux_wv_dispose (demux_plugin_t *const this_gen) {
- demux_wv_t *const this = (demux_wv_t *) this_gen;
-
- free(this);
-}
-
-static int demux_wv_get_status (demux_plugin_t *const this_gen) {
- const demux_wv_t *const this = (const demux_wv_t *) this_gen;
-
- return this->status;
-}
-
-static int demux_wv_get_stream_length (demux_plugin_t *const this_gen) {
- const demux_wv_t *const this = (demux_wv_t *) this_gen;
-
- return (this->samples*1000) / this->samplerate;
-}
-
-static uint32_t demux_wv_get_capabilities(demux_plugin_t *const this_gen) {
- return DEMUX_CAP_NOCAP;
-}
-
-static int demux_wv_get_optional_data(demux_plugin_t *const this_gen,
- void *data, const int data_type) {
- return DEMUX_OPTIONAL_UNSUPPORTED;
-}
-
-static demux_plugin_t *open_plugin (demux_class_t *const class_gen,
- xine_stream_t *const stream,
- input_plugin_t *const input) {
- demux_wv_t *const this = calloc(1, sizeof (demux_wv_t));
- this->stream = stream;
- this->input = input;
-
- this->demux_plugin.send_headers = demux_wv_send_headers;
- this->demux_plugin.send_chunk = demux_wv_send_chunk;
- this->demux_plugin.seek = demux_wv_seek;
- this->demux_plugin.dispose = demux_wv_dispose;
- this->demux_plugin.get_status = demux_wv_get_status;
- this->demux_plugin.get_stream_length = demux_wv_get_stream_length;
- this->demux_plugin.get_capabilities = demux_wv_get_capabilities;
- this->demux_plugin.get_optional_data = demux_wv_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->status = DEMUX_FINISHED;
- switch (stream->content_detection_method) {
-
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* Falling through is intended */
-
- case METHOD_BY_CONTENT:
- case METHOD_EXPLICIT:
-
- if (!open_wv_file(this)) {
- free (this);
- return NULL;
- }
-
- break;
-
- default:
- free (this);
- return NULL;
- }
-
- return &this->demux_plugin;
-}
-
-static const char *get_description (demux_class_t *const this_gen) {
- return "Wavpack demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *const this_gen) {
- return "Wavpack";
-}
-
-static const char *get_extensions (demux_class_t *const this_gen) {
- return "wv wvp";
-}
-
-static const char *get_mimetypes (demux_class_t *const this_gen) {
- return "audio/x-wavpack: wv,wvp: WavPack audio;";
-}
-
-static void class_dispose (demux_class_t *const this_gen) {
- demux_wv_class_t *const this = (demux_wv_class_t *) this_gen;
-
- free (this);
-}
-
-void *demux_wv_init_plugin (xine_t *const xine, void *const data) {
- demux_wv_class_t *const this = calloc(1, sizeof (demux_wv_class_t));
-
- this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
-
- return this;
-}
diff --git a/src/combined/ffmpeg/Makefile.am b/src/combined/ffmpeg/Makefile.am
index 86200d718..3ae65f115 100644
--- a/src/combined/ffmpeg/Makefile.am
+++ b/src/combined/ffmpeg/Makefile.am
@@ -1,73 +1,49 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
-DEFAULT_INCLUDES = -I.
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_CPPFLAGS = $(ZLIB_CPPFLAGS)
+AM_LDFLAGS = $(xineplug_ldflags)
-if HAVE_FFMPEG
-ff_cppflags = $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
-link_ffmpeg = $(FFMPEG_LIBS) $(FFMPEG_UTIL_LIBS) $(FFMPEG_POSTPROC_LIBS)
-else
-ff_cppflags = -I$(top_builddir)/src/libffmpeg -I$(top_srcdir)/src/libffmpeg/libavcodec -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
-endif
+xineplug_LTLIBRARIES = xineplug_decode_ff.la
ff_generated = \
avcodec_video.list avcodec_audio.list \
ff_video_list.h ff_audio_list.h
BUILT_SOURCES = $(ff_generated)
+DISTCLEANFILES = $(ff_generated)
-# ffmpeg_config.h is generated by configure
-DISTCLEANFILES = ffmpeg_config.h $(ff_generated)
+EXTRA_DIST = xine_video.list xine_audio.list mkcodeclist.pl
-# this must always be included, even if the current machine has no DXR3...
-EXTRA_DIST = ffmpeg_encoder.c \
- xine_video.list xine_audio.list mkcodeclist.pl
-
-xineplug_LTLIBRARIES = xineplug_decode_ff.la xineplug_decode_dvaudio.la
+noinst_HEADERS = ffmpeg_compat.h
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 \
- ffmpeg_compat.h
-if HAVE_DXR3
-AM_CPPFLAGS = -I$(top_srcdir)/src/dxr3 $(X_CFLAGS) $(ff_cppflags) \
- $(ZLIB_CPPFLAGS)
-xineplug_decode_ff_la_SOURCES += ffmpeg_encoder.c
-else
-AM_CPPFLAGS = $(ff_cppflags) $(ZLIB_CPPFLAGS)
-endif
-
-xineplug_decode_ff_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_decode_ff_la_LDFLAGS = $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS)
-xineplug_decode_ff_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) -lm $(ZLIB_LIBS) \
- $(link_ffmpeg) $(PTHREAD_LIBS) $(LTLIBINTL)
+ ff_mpeg_parser.c ffmpeg_decoder.h ff_mpeg_parser.h
-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)
+nodist_xineplug_decode_ff_la_SOURCES = ffmpeg_config.h
-$(top_srcdir)/src/libffmpeg/libavcodec/libavcodec.la:
- make -C $(top_srcdir)/src/libffmpeg
+xineplug_decode_ff_la_CFLAGS = $(AM_CFLAGS) $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
+xineplug_decode_ff_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) -lm $(ZLIB_LIBS) \
+ $(FFMPEG_LIBS) $(AVUTIL_LIBS) $(FFMPEG_POSTPROC_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
+xineplug_decode_ff_la_LDFLAGS = $(AM_LDFLAGS) $(IMPURE_TEXT_LDFLAGS)
# Generation of ffmpeg->xine codec mapping lists (see xine_*.list).
-AV_CPP = $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
+AV_CPP = $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AVUTIL_CFLAGS)
# Extract some CODEC_ID_* from avcodec.h. Requires some sed mangling.
avcodec_audio.list: AV_CODECS:=/CODEC_ID_PCM_S16LE/,/CODEC_ID_DVD_SUBTITLE/
avcodec_video.list: AV_CODECS:=/CODEC_ID_MPEG1VIDEO/,/CODEC_ID_PCM_S16LE/
avcodec_audio.list avcodec_video.list:
- echo '#include "$(srcdir)/ffmpeg_decoder.h"' | $(AV_CPP) - |\
+ $(AM_V_GEN)echo '#include "$(srcdir)/ffmpeg_decoder.h"' | $(AV_CPP) - |\
sed -e $(AV_CODECS)'! d; s/^[ \t]*//; s/[=,].*//; /^$$/ d' >$@
# Generate the mappings. These are #included where needed.
ff_%_list.h: $(srcdir)/mkcodeclist.pl avcodec_%.list $(srcdir)/xine_%.list
- $(PERL) $^ $@
+ $(AM_V_GEN)$(PERL) $^ $@
ff_audio_decoder.c: ff_audio_list.h
ff_video_decoder.c: ff_video_list.h
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c
index 7ecf8290d..740595b9e 100644
--- a/src/combined/ffmpeg/ff_audio_decoder.c
+++ b/src/combined/ffmpeg/ff_audio_decoder.c
@@ -22,7 +22,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
-#include "../../libffmpeg/ffmpeg_config.h"
#endif
#include <stdlib.h>
@@ -38,9 +37,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#include "ffmpeg_decoder.h"
#include "ffmpeg_compat.h"
@@ -648,18 +647,6 @@ static audio_decoder_t *ff_audio_open_plugin (audio_decoder_class_t *class_gen,
return &this->audio_decoder;
}
-static char *ff_audio_get_identifier (audio_decoder_class_t *this) {
- return "ffmpeg audio";
-}
-
-static char *ff_audio_get_description (audio_decoder_class_t *this) {
- return "ffmpeg based audio decoder plugin";
-}
-
-static void ff_audio_dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
void *init_audio_plugin (xine_t *xine, void *data) {
ff_audio_class_t *this ;
@@ -667,9 +654,9 @@ void *init_audio_plugin (xine_t *xine, void *data) {
this = calloc(1, sizeof (ff_audio_class_t));
this->decoder_class.open_plugin = ff_audio_open_plugin;
- this->decoder_class.get_identifier = ff_audio_get_identifier;
- this->decoder_class.get_description = ff_audio_get_description;
- this->decoder_class.dispose = ff_audio_dispose_class;
+ this->decoder_class.identifier = "ffmpeg audio";
+ this->decoder_class.description = N_("ffmpeg based audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
pthread_once( &once_control, init_once_routine );
diff --git a/src/combined/ffmpeg/ff_dvaudio_decoder.c b/src/combined/ffmpeg/ff_dvaudio_decoder.c
deleted file mode 100644
index 4d78162df..000000000
--- a/src/combined/ffmpeg/ff_dvaudio_decoder.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Copyright (C) 2005 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, USA
- *
- * dv audio decoder based on patch by Dan Dennedy <dan@dennedy.org>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-#include <string.h>
-#include <math.h>
-
-#define LOG_MODULE "dvaudio"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "buffer.h"
-#include "xineutils.h"
-
-#ifdef _MSC_VER
-/* ffmpeg has own definitions of those types */
-# undef int8_t
-# undef uint8_t
-# undef int16_t
-# undef uint16_t
-# undef int32_t
-# undef uint32_t
-# undef int64_t
-# undef uint64_t
-#endif
-
-#ifdef HAVE_FFMPEG_AVUTIL_H
-# include <avcodec.h>
-#elif defined HAVE_FFMPEG
-# include <libavcodec/avcodec.h>
-#else
-# include "../../libffmpeg/libavcodec/avcodec.h"
-#endif
-
-#include "../../libffmpeg/libavcodec/dvdata.h"
-
-#ifdef _MSC_VER
-# undef malloc
-# undef free
-# undef realloc
-#endif
-
-#define AUDIOBUFSIZE 128*1024
-#define MAXFRAMESIZE 131072
-
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} dvaudio_class_t;
-
-typedef struct dvaudio_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- int output_open;
- int audio_channels;
- int audio_bits;
- int audio_sample_rate;
-
- unsigned char *buf;
- int bufsize;
- int size;
-
- char *decode_buffer;
- int decoder_ok;
-
-} 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
- * to have a fallback mechanism for complete search of missing packs.
- */
-static const uint8_t* dv_extract_pack(uint8_t* frame, enum dv_pack_type t)
-{
- int offs;
-
- switch (t) {
- case dv_audio_source:
- offs = (80*6 + 80*16*3 + 3);
- break;
- case dv_audio_control:
- offs = (80*6 + 80*16*4 + 3);
- break;
- case dv_video_control:
- offs = (80*5 + 48 + 5);
- break;
- default:
- return NULL;
- }
-
- return (frame[offs] == t ? &frame[offs] : NULL);
-}
-
-static inline uint16_t dv_audio_12to16(uint16_t sample)
-{
- uint16_t shift, result;
-
- sample = (sample < 0x800) ? sample : sample | 0xf000;
- shift = (sample & 0xf00) >> 8;
-
- if (shift < 0x2 || shift > 0xd) {
- result = sample;
- } else if (shift < 0x8) {
- shift--;
- result = (sample - (256 * shift)) << shift;
- } else {
- shift = 0xe - shift;
- result = ((sample + ((256 * shift) + 1)) << shift) - 1;
- }
-
- return result;
-}
-
-/*
- * There's a couple of assumptions being made here:
- * 1. By default we silence erroneous (0x8000/16bit 0x800/12bit) audio samples.
- * We can pass them upwards when ffmpeg will be ready to deal with them.
- * 2. We don't do software emphasis.
- * 3. Audio is always returned as 16bit linear samples: 12bit nonlinear samples
- * are converted into 16bit linear ones.
- */
-static int dv_extract_audio(uint8_t* frame, uint8_t* pcm, uint8_t* pcm2)
-{
- int size, i, j, d, of, smpls, freq, quant, half_ch;
- uint16_t lc, rc;
- const DVprofile* sys;
- const uint8_t* as_pack;
-
- as_pack = dv_extract_pack(frame, dv_audio_source);
- if (!as_pack) /* No audio ? */
- return 0;
-
- sys = dv_frame_profile(frame);
- smpls = as_pack[1] & 0x3f; /* samples in this frame - min. samples */
- freq = (as_pack[4] >> 3) & 0x07; /* 0 - 48KHz, 1 - 44,1kHz, 2 - 32 kHz */
- quant = as_pack[4] & 0x07; /* 0 - 16bit linear, 1 - 12bit nonlinear */
-
- if (quant > 1)
- return -1; /* Unsupported quantization */
-
- size = (sys->audio_min_samples[freq] + smpls) * 4; /* 2ch, 2bytes */
- half_ch = sys->difseg_size/2;
-
- /* for each DIF segment */
- for (i = 0; i < sys->difseg_size; i++) {
- frame += 6 * 80; /* skip DIF segment header */
- if (quant == 1 && i == half_ch) {
- if (!pcm2)
- break;
- else
- pcm = pcm2;
- }
-
- for (j = 0; j < 9; j++) {
- for (d = 8; d < 80; d += 2) {
- if (quant == 0) { /* 16bit quantization */
- of = sys->audio_shuffle[i][j] + (d - 8)/2 * sys->audio_stride;
- if (of*2 >= size)
- continue;
-
-#ifdef WORDS_BIGENDIAN
- pcm[of*2] = frame[d];
- pcm[of*2+1] = frame[d+1];
-#else
- pcm[of*2] = frame[d+1];
- pcm[of*2+1] = frame[d];
-#endif
- if (pcm[of*2+1] == 0x80 && pcm[of*2] == 0x00)
- pcm[of*2+1] = 0;
- } else { /* 12bit quantization */
- lc = ((uint16_t)frame[d] << 4) |
- ((uint16_t)frame[d+2] >> 4);
- rc = ((uint16_t)frame[d+1] << 4) |
- ((uint16_t)frame[d+2] & 0x0f);
- lc = (lc == 0x800 ? 0 : dv_audio_12to16(lc));
- rc = (rc == 0x800 ? 0 : dv_audio_12to16(rc));
-
- of = sys->audio_shuffle[i%half_ch][j] + (d - 8)/3 * sys->audio_stride;
- if (of*2 >= size)
- continue;
-
-#ifdef WORDS_BIGENDIAN
- pcm[of*2] = lc >> 8;
- pcm[of*2+1] = lc & 0xff;
-#else
- pcm[of*2] = lc & 0xff;
- pcm[of*2+1] = lc >> 8;
-#endif
- of = sys->audio_shuffle[i%half_ch+half_ch][j] +
- (d - 8)/3 * sys->audio_stride;
-#ifdef WORDS_BIGENDIAN
- pcm[of*2] = rc >> 8;
- pcm[of*2+1] = rc & 0xff;
-#else
- pcm[of*2] = rc & 0xff;
- pcm[of*2+1] = rc >> 8;
-#endif
- ++d;
- }
- }
-
- frame += 16 * 80; /* 15 Video DIFs + 1 Audio DIF */
- }
- }
-
- return size;
-}
-
-static void dvaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- dvaudio_decoder_t *this = (dvaudio_decoder_t *) this_gen;
- int bytes_consumed;
- int decode_buffer_size;
- int offset;
- int out;
- audio_buffer_t *audio_buffer;
- int bytes_to_send;
-
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
- this->buf = calloc(1, AUDIOBUFSIZE);
- this->bufsize = AUDIOBUFSIZE;
- this->size = 0;
- this->decode_buffer = calloc(1, MAXFRAMESIZE);
-
- this->audio_sample_rate = buf->decoder_info[1];
- this->audio_bits = buf->decoder_info[2];
- this->audio_channels = buf->decoder_info[3];
-
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DV Audio");
-
- this->decoder_ok = 1;
-
- return;
- }
-
- if (this->decoder_ok && !(buf->decoder_flags & (BUF_FLAG_HEADER|BUF_FLAG_SPECIAL))) {
-
- if (!this->output_open) {
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream, this->audio_bits, this->audio_sample_rate,
- _x_ao_channels2mode(this->audio_channels));
- }
-
- /* if the audio still isn't open, bail */
- if (!this->output_open)
- return;
-
- if( this->size + buf->size > this->bufsize ) {
- this->bufsize = this->size + 2 * buf->size;
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("dvaudio: increasing buffer to %d to avoid overflow.\n"),
- this->bufsize);
- this->buf = realloc( this->buf, this->bufsize );
- }
-
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
- this->size += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */
-
- offset = 0;
- while (this->size>0) {
- decode_buffer_size = dv_extract_audio(&this->buf[offset], this->decode_buffer, NULL);
-
- if (decode_buffer_size > -1)
- bytes_consumed = dv_frame_profile(&this->buf[offset])->frame_size;
- else
- bytes_consumed = decode_buffer_size;
-
- /* dispatch the decoded audio */
- out = 0;
- while (out < decode_buffer_size) {
- audio_buffer =
- this->stream->audio_out->get_buffer (this->stream->audio_out);
- if (audio_buffer->mem_size == 0) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "dvaudio: Help! Allocated audio buffer with nothing in it!\n");
- return;
- }
-
- if ((decode_buffer_size - out) > audio_buffer->mem_size)
- bytes_to_send = audio_buffer->mem_size;
- else
- bytes_to_send = decode_buffer_size - out;
-
- /* fill up this buffer */
- xine_fast_memcpy(audio_buffer->mem, &this->decode_buffer[out],
- bytes_to_send);
- /* byte count / 2 (bytes / sample) / channels */
- audio_buffer->num_frames = bytes_to_send / 2 / this->audio_channels;
-
- audio_buffer->vpts = buf->pts;
- buf->pts = 0; /* only first buffer gets the real pts */
- this->stream->audio_out->put_buffer (this->stream->audio_out,
- audio_buffer, this->stream);
-
- out += bytes_to_send;
- }
-
- this->size -= bytes_consumed;
- offset += bytes_consumed;
- }
-
- /* reset internal accumulation buffer */
- this->size = 0;
- }
- }
-}
-
-static void dvaudio_reset (audio_decoder_t *this_gen) {
- dvaudio_decoder_t *this = (dvaudio_decoder_t *) this_gen;
-
- this->size = 0;
-}
-
-static void dvaudio_discontinuity (audio_decoder_t *this_gen) {
-}
-
-static void dvaudio_dispose (audio_decoder_t *this_gen) {
-
- dvaudio_decoder_t *this = (dvaudio_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->buf);
- free(this->decode_buffer);
-
- free (this_gen);
-}
-
-static audio_decoder_t *dvaudio_open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- dvaudio_decoder_t *this ;
-
- this = calloc(1, sizeof (dvaudio_decoder_t));
-
- this->audio_decoder.decode_data = dvaudio_decode_data;
- this->audio_decoder.reset = dvaudio_reset;
- this->audio_decoder.discontinuity = dvaudio_discontinuity;
- this->audio_decoder.dispose = dvaudio_dispose;
-
- this->output_open = 0;
- this->audio_channels = 0;
- this->stream = stream;
- this->buf = NULL;
- this->size = 0;
- this->decoder_ok = 0;
-
- return &this->audio_decoder;
-}
-
-static char *dvaudio_get_identifier (audio_decoder_class_t *this) {
- return "dv audio";
-}
-
-static char *dvaudio_get_description (audio_decoder_class_t *this) {
- return "dv audio decoder plugin";
-}
-
-static void dvaudio_dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_dvaudio_plugin (xine_t *xine, void *data) {
-
- dvaudio_class_t *this ;
-
- this = calloc(1, sizeof (dvaudio_class_t));
-
- this->decoder_class.open_plugin = dvaudio_open_plugin;
- this->decoder_class.get_identifier = dvaudio_get_identifier;
- this->decoder_class.get_description = dvaudio_get_description;
- this->decoder_class.dispose = dvaudio_dispose_class;
-
- return this;
-}
-
-static uint32_t supported_audio_types[] = {
- BUF_AUDIO_DV,
- 0
-};
-
-static const decoder_info_t dec_info_dvaudio = {
- supported_audio_types, /* supported types */
- 5 /* priority */
-};
-
-/*
- * exported plugin catalog entry
- */
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "dvaudio", XINE_VERSION_CODE, &dec_info_dvaudio, init_dvaudio_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/combined/ffmpeg/ff_mpeg_parser.h b/src/combined/ffmpeg/ff_mpeg_parser.h
index 5797933df..c1ebc326f 100644
--- a/src/combined/ffmpeg/ff_mpeg_parser.h
+++ b/src/combined/ffmpeg/ff_mpeg_parser.h
@@ -23,7 +23,7 @@
#ifndef HAVE_MPEG_PARSER_H
#define HAVE_MPEG_PARSER_H
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "ffmpeg_decoder.h"
#define BUFFER_SIZE (1194 * 1024) /* libmpeg2's buffer size */
diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
index 2ec18c55f..5334b8d71 100644
--- a/src/combined/ffmpeg/ff_video_decoder.c
+++ b/src/combined/ffmpeg/ff_video_decoder.c
@@ -22,7 +22,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
-#include "../../libffmpeg/ffmpeg_config.h"
#endif
#include <stdlib.h>
@@ -38,10 +37,10 @@
/*
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "bswap.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "ffmpeg_decoder.h"
#include "ff_mpeg_parser.h"
@@ -81,12 +80,10 @@ struct ff_video_decoder_s {
xine_stream_t *stream;
int64_t pts;
int64_t last_pts;
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
uint64_t pts_tag_mask;
uint64_t pts_tag;
int pts_tag_counter;
int pts_tag_stable_counter;
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
int video_step;
int reported_video_step;
@@ -226,10 +223,8 @@ static int get_buffer(AVCodecContext *context, AVFrame *av_frame){
av_frame->type= FF_BUFFER_TYPE_USER;
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/* take over pts for this frame to have it reordered */
av_frame->reordered_opaque = context->reordered_opaque;
-#endif
xine_list_push_back(this->dr1_frames, av_frame);
@@ -1077,7 +1072,6 @@ static void ff_handle_special_buffer (ff_video_decoder_t *this, buf_element_t *b
}
}
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
static uint64_t ff_tag_pts(ff_video_decoder_t *this, uint64_t pts)
{
return pts | this->pts_tag;
@@ -1123,7 +1117,6 @@ static void ff_check_pts_tagging(ff_video_decoder_t *this, uint64_t pts)
}
}
}
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
@@ -1146,14 +1139,12 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *bu
uint8_t *current;
int next_flush;
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/* apply valid pts to first frame _starting_ thereafter only */
if (this->pts && !this->context->reordered_opaque) {
this->context->reordered_opaque =
this->av_frame->reordered_opaque = ff_tag_pts (this, this->pts);
this->pts = 0;
}
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
got_picture = 0;
if (!flush) {
@@ -1236,16 +1227,11 @@ static void ff_handle_mpeg12_buffer (ff_video_decoder_t *this, buf_element_t *bu
free_img = 0;
}
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/* get back reordered pts */
img->pts = ff_untag_pts (this, this->av_frame->reordered_opaque);
ff_check_pts_tagging (this, this->av_frame->reordered_opaque);
this->av_frame->reordered_opaque = 0;
this->context->reordered_opaque = 0;
-#else
- img->pts = this->pts;
- this->pts = 0;
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
if (this->av_frame->repeat_pict)
img->duration = this->video_step * 3 / 2;
@@ -1313,7 +1299,6 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
this->size = 0;
}
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
if (this->size == 0) {
/* take over pts when we are about to buffer a frame */
this->av_frame->reordered_opaque = ff_tag_pts(this, this->pts);
@@ -1321,7 +1306,6 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
this->context->reordered_opaque = ff_tag_pts(this, this->pts);
this->pts = 0;
}
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
/* data accumulation */
if (buf->size > 0) {
@@ -1388,10 +1372,8 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
&got_picture, &chunk_buf[offset],
this->size);
#endif
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/* reset consumed pts value */
this->context->reordered_opaque = ff_tag_pts(this, 0);
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
lprintf("consumed size: %d, got_picture: %d\n", len, got_picture);
if ((len <= 0) || (len > this->size)) {
@@ -1409,12 +1391,10 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
memmove (this->buf, &chunk_buf[offset], this->size);
chunk_buf = this->buf;
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/* take over pts for next access unit */
this->av_frame->reordered_opaque = ff_tag_pts(this, this->pts);
this->context->reordered_opaque = ff_tag_pts(this, this->pts);
this->pts = 0;
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
}
}
}
@@ -1423,11 +1403,7 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
video_step_to_use = (this->video_step || !this->context->time_base.den)
? this->video_step
: (int)(90000ll
-#if LIBAVCODEC_VERSION_INT >= 0x341400
* this->context->ticks_per_frame
-#elif LIBAVCODEC_VERSION_INT >= 0x340000
-# warning Building without avcodec ticks_per_frame support; you should upgrade your libavcodec and recompile
-#endif
* this->context->time_base.num / this->context->time_base.den);
/* aspect ratio provided by ffmpeg, override previous setting */
@@ -1517,14 +1493,9 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
ff_convert_frame(this, img);
}
-#ifndef AVCODEC_HAS_REORDERED_OPAQUE
- img->pts = this->pts;
- this->pts = 0;
-#else /* AVCODEC_HAS_REORDERED_OPAQUE */
img->pts = ff_untag_pts(this, this->av_frame->reordered_opaque);
ff_check_pts_tagging(this, this->av_frame->reordered_opaque); /* only check for valid frames */
this->av_frame->reordered_opaque = 0;
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
/* workaround for weird 120fps streams */
if( video_step_to_use == 750 ) {
@@ -1567,13 +1538,8 @@ static void ff_handle_buffer (ff_video_decoder_t *this, buf_element_t *buf) {
this->output_format,
VO_BOTH_FIELDS|this->frame_flags);
/* set PTS to allow early syncing */
-#ifndef AVCODEC_HAS_REORDERED_OPAQUE
- img->pts = this->pts;
- this->pts = 0;
-#else /* AVCODEC_HAS_REORDERED_OPAQUE */
img->pts = ff_untag_pts(this, this->av_frame->reordered_opaque);
this->av_frame->reordered_opaque = 0;
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
img->duration = video_step_to_use;
@@ -1627,6 +1593,8 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
}
} else {
+ if (this->decoder_init_mode && !this->is_mpeg12)
+ ff_handle_preview_buffer(this, buf);
/* decode */
/* PES: each valid pts shall be used only once */
@@ -1674,12 +1642,10 @@ static void ff_reset (video_decoder_t *this_gen) {
if (this->is_mpeg12)
mpeg_parser_reset(this->mpeg_parser);
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
this->pts_tag_mask = 0;
this->pts_tag = 0;
this->pts_tag_counter = 0;
this->pts_tag_stable_counter = 0;
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
}
static void ff_discontinuity (video_decoder_t *this_gen) {
@@ -1688,7 +1654,6 @@ static void ff_discontinuity (video_decoder_t *this_gen) {
lprintf ("ff_discontinuity\n");
this->pts = 0;
-#ifdef AVCODEC_HAS_REORDERED_OPAQUE
/*
* there is currently no way to reset all the pts which are stored in the decoder.
* therefore, we add a unique tag (generated from pts_tag_counter) to pts (see
@@ -1721,7 +1686,6 @@ static void ff_discontinuity (video_decoder_t *this_gen) {
counter_mask <<= 1;
}
}
-#endif /* AVCODEC_HAS_REORDERED_OPAQUE */
}
static void ff_dispose (video_decoder_t *this_gen) {
@@ -1829,18 +1793,6 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen,
return &this->video_decoder;
}
-static char *ff_video_get_identifier (video_decoder_class_t *this) {
- return "ffmpeg video";
-}
-
-static char *ff_video_get_description (video_decoder_class_t *this) {
- return "ffmpeg based video decoder plugin";
-}
-
-static void ff_video_dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
void *init_video_plugin (xine_t *xine, void *data) {
ff_video_class_t *this;
@@ -1849,9 +1801,9 @@ void *init_video_plugin (xine_t *xine, void *data) {
this = calloc(1, sizeof (ff_video_class_t));
this->decoder_class.open_plugin = ff_video_open_plugin;
- this->decoder_class.get_identifier = ff_video_get_identifier;
- this->decoder_class.get_description = ff_video_get_description;
- this->decoder_class.dispose = ff_video_dispose_class;
+ this->decoder_class.identifier = "ffmpeg video";
+ this->decoder_class.description = N_("ffmpeg based video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
this->xine = xine;
pthread_once( &once_control, init_once_routine );
@@ -1900,12 +1852,12 @@ void *init_video_plugin (xine_t *xine, void *data) {
return this;
}
-static uint32_t wmv8_video_types[] = {
+static const uint32_t wmv8_video_types[] = {
BUF_VIDEO_WMV8,
0
};
-static uint32_t wmv9_video_types[] = {
+static const uint32_t wmv9_video_types[] = {
BUF_VIDEO_WMV9,
0
};
diff --git a/src/combined/ffmpeg/ffmpeg_decoder.c b/src/combined/ffmpeg/ffmpeg_decoder.c
index 879df5387..4f44a7f8b 100644
--- a/src/combined/ffmpeg/ffmpeg_decoder.c
+++ b/src/combined/ffmpeg/ffmpeg_decoder.c
@@ -22,10 +22,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
-#include "../../libffmpeg/ffmpeg_config.h"
#endif
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "ffmpeg_decoder.h"
#include "ffmpeg_compat.h"
@@ -37,279 +36,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);
-#ifdef CODEC_ID_EAC3
- REGISTER_DECODER(EAC3, eac3);
-#endif
- 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();
@@ -322,9 +48,9 @@ void init_once_routine(void) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "ffmpegvideo", XINE_VERSION_CODE, &dec_info_ffmpeg_video, init_video_plugin },
- { PLUGIN_VIDEO_DECODER, 18, "ffmpeg-wmv8", XINE_VERSION_CODE, &dec_info_ffmpeg_wmv8, init_video_plugin },
- { PLUGIN_VIDEO_DECODER, 18, "ffmpeg-wmv9", XINE_VERSION_CODE, &dec_info_ffmpeg_wmv9, init_video_plugin },
- { PLUGIN_AUDIO_DECODER, 15, "ffmpegaudio", XINE_VERSION_CODE, &dec_info_ffmpeg_audio, init_audio_plugin },
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "ffmpegvideo", XINE_VERSION_CODE, &dec_info_ffmpeg_video, init_video_plugin },
+ { PLUGIN_VIDEO_DECODER, 19, "ffmpeg-wmv8", XINE_VERSION_CODE, &dec_info_ffmpeg_wmv8, init_video_plugin },
+ { PLUGIN_VIDEO_DECODER, 19, "ffmpeg-wmv9", XINE_VERSION_CODE, &dec_info_ffmpeg_wmv9, init_video_plugin },
+ { PLUGIN_AUDIO_DECODER, 16, "ffmpegaudio", XINE_VERSION_CODE, &dec_info_ffmpeg_audio, init_audio_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/combined/ffmpeg/ffmpeg_decoder.h b/src/combined/ffmpeg/ffmpeg_decoder.h
index 957a25231..4d9943384 100644
--- a/src/combined/ffmpeg/ffmpeg_decoder.h
+++ b/src/combined/ffmpeg/ffmpeg_decoder.h
@@ -27,10 +27,8 @@
#ifdef HAVE_FFMPEG_AVUTIL_H
# include <avcodec.h>
-#elif defined HAVE_FFMPEG
-# include <libavcodec/avcodec.h>
#else
-# include "../../libffmpeg/libavcodec/avcodec.h"
+# include <libavcodec/avcodec.h>
#endif
typedef struct ff_codec_s {
diff --git a/src/combined/ffmpeg/ffmpeg_encoder.c b/src/combined/ffmpeg/ffmpeg_encoder.c
deleted file mode 100644
index 8e0b03d9b..000000000
--- a/src/combined/ffmpeg/ffmpeg_encoder.c
+++ /dev/null
@@ -1,336 +0,0 @@
-/*
- * Copyright (C) 2000-2004 the xine project
- *
- * This file is part of xine, a unix 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, USA
- */
-
-/* mpeg encoders for the dxr3 video out plugin. */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <errno.h>
-#include <math.h>
-
-#define LOG_MODULE "dxr3_mpeg_encoder"
-/* #define LOG_VERBOSE */
-/* #define LOG */
-
-#include "video_out_dxr3.h"
-
-#ifdef HAVE_FFMPEG_AVUTIL_H
-# include <avcodec.h>
-#elif defined HAVE_FFMPEG
-# include <libavcodec/avcodec.h>
-#else
-# include "../../libffmpeg/libavcodec/avcodec.h"
-#endif
-
-#include "ffmpeg_compat.h"
-
-/* buffer size for encoded mpeg1 stream; will hold one intra frame
- * at 640x480 typical sizes are <50 kB. 512 kB should be plenty */
-#define DEFAULT_BUFFER_SIZE 512*1024
-
-
-/*initialisation function, used by the dxr3 plugin */
-int dxr3_encoder_init(dxr3_driver_t *drv) EXPORTED;
-
-/* functions required by encoder api */
-static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame);
-static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame);
-static int lavc_on_unneeded(dxr3_driver_t *drv);
-
-/*encoder structure*/
-typedef struct lavc_data_s {
- encoder_data_t encoder_data;
- AVCodecContext *context; /* handle for encoding */
- int width, height; /* width and height of the video frame */
- uint8_t *ffmpeg_buffer; /* lavc buffer */
- AVFrame *picture; /* picture to be encoded */
- uint8_t *out[3]; /* aligned buffer for YV12 data */
- uint8_t *buf; /* unaligned YV12 buffer */
-} lavc_data_t;
-
-
-int dxr3_encoder_init(dxr3_driver_t *drv)
-{
- lavc_data_t* this;
- avcodec_init();
-
- avcodec_register_all();
- lprintf("lavc init , version %x\n", avcodec_version());
- this = calloc(1, sizeof(lavc_data_t));
- if (!this) return 0;
-
- this->encoder_data.type = ENC_LAVC;
- this->encoder_data.on_update_format = lavc_on_update_format;
- this->encoder_data.on_frame_copy = NULL;
- this->encoder_data.on_display_frame = lavc_on_display_frame;
- this->encoder_data.on_unneeded = lavc_on_unneeded;
- this->context = 0;
-
- drv->enc = &this->encoder_data;
- return 1;
-}
-
-/* helper function */
-static int lavc_prepare_frame(lavc_data_t *this, dxr3_driver_t *drv, dxr3_frame_t *frame);
-
-static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
-{
- lavc_data_t *this = (lavc_data_t *)drv->enc;
- AVCodec *codec;
- unsigned char use_quantizer;
-
- if (this->context) {
- avcodec_close(this->context);
- free(this->context);
- free(this->picture);
- this->context = NULL;
- this->picture = NULL;
- }
-
- /* if YUY2 and dimensions changed, we need to re-allocate the
- * internal YV12 buffer */
- if (frame->vo_frame.format == XINE_IMGFMT_YUY2) {
- int image_size = frame->vo_frame.pitches[0] * frame->oheight;
-
- this->out[0] = xine_xmalloc_aligned(16, image_size * 3/2,
- (void *)&this->buf);
- this->out[1] = this->out[0] + image_size;
- this->out[2] = this->out[1] + image_size/4;
-
- /* fill with black (yuv 16,128,128) */
- memset(this->out[0], 16, image_size);
- memset(this->out[1], 128, image_size/4);
- memset(this->out[2], 128, image_size/4);
- lprintf("Using YUY2->YV12 conversion\n");
- }
-
- /* resolution must be a multiple of two */
- if ((frame->vo_frame.pitches[0] % 2 != 0) || (frame->oheight % 2 != 0)) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: lavc only handles video dimensions which are multiples of 2\n");
- return 0;
- }
-
- /* get mpeg codec handle */
- codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
- if (!codec) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: lavc MPEG1 codec not found\n");
- return 0;
- }
- lprintf("lavc MPEG1 encoder found.\n");
-
- this->width = frame->vo_frame.pitches[0];
- this->height = frame->oheight;
-
- this->context = avcodec_alloc_context();
- if (!this->context) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: Couldn't start the ffmpeg library\n");
- return 0;
- }
- this->picture = avcodec_alloc_frame();
- if (!this->picture) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: Couldn't allocate ffmpeg frame\n");
- return 0;
- }
-
- /* mpeg1 encoder only support YUV420P */
- this->context->pix_fmt = PIX_FMT_YUVJ420P;
-
- /* put sample parameters */
- this->context->bit_rate = drv->class->xine->config->register_range(drv->class->xine->config,
- "dxr3.encoding.lavc_bitrate", 10000, 1000, 20000,
- _("libavcodec mpeg output bitrate (kbit/s)"),
- _("The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
- "Higher values will increase quality and CPU usage.\n"
- "This setting is only considered, when constant quality mode is disabled."), 10, NULL, NULL);
- this->context->bit_rate *= 1000; /* config in kbit/s, libavcodec wants bit/s */
-
- use_quantizer = drv->class->xine->config->register_bool(drv->class->xine->config,
- "dxr3.encoding.lavc_quantizer", 1,
- _("constant quality mode"),
- _("When enabled, libavcodec will use a constant quality mode by dynamically "
- "compressing the images based on their complexity. When disabled, libavcodec "
- "will use constant bitrate mode."), 10, NULL, NULL);
-
- if (use_quantizer) {
- this->context->qmin = drv->class->xine->config->register_range(drv->class->xine->config,
- "dxr3.encoding.lavc_qmin", 1, 1, 10,
- _("minimum compression"),
- _("The minimum compression to apply to an image in constant quality mode."),
- 10, NULL, NULL);
-
- this->context->qmax = drv->class->xine->config->register_range(drv->class->xine->config,
- "dxr3.encoding.lavc_qmax", 2, 1, 20,
- _("maximum quantizer"),
- _("The maximum compression to apply to an image in constant quality mode."),
- 10, NULL, NULL);
- }
-
- lprintf("lavc -> bitrate %d \n", this->context->bit_rate);
-
- this->context->width = frame->vo_frame.pitches[0];
- this->context->height = frame->oheight;
-
- this->context->gop_size = 0; /*intra frames only */
- this->context->me_method = ME_ZERO; /*motion estimation type*/
-
- this->context->time_base.den = 90000;
- if (frame->vo_frame.duration > 90000 / 24)
- this->context->time_base.num = 90000 / 24;
- else if (frame->vo_frame.duration < 90000 / 60)
- this->context->time_base.num = 90000 / 60;
- else
- this->context->time_base.num = frame->vo_frame.duration;
- /* ffmpeg can complain about illegal framerates, but since this seems no
- * problem for the DXR3, we just tell ffmpeg to be more lax with */
- this->context->strict_std_compliance = -1;
-
- /* open avcodec */
- if (avcodec_open(this->context, codec) < 0) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG, "dxr3_mpeg_encoder: could not open codec\n");
- return 0;
- }
- lprintf("dxr3_mpeg_encoder: lavc MPEG1 codec opened.\n");
-
- if (!this->ffmpeg_buffer)
- this->ffmpeg_buffer = (unsigned char *)malloc(DEFAULT_BUFFER_SIZE); /* why allocate more than needed ?! */
- if (!this->ffmpeg_buffer) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: Couldn't allocate temp buffer for mpeg data\n");
- return 0;
- }
-
- return 1;
-}
-
-static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame)
-{
- int size;
- lavc_data_t* this = (lavc_data_t *)drv->enc;
- ssize_t written;
-
- if (frame->vo_frame.bad_frame) return 1;
- /* ignore old frames */
- if ((frame->vo_frame.pitches[0] != this->context->width) || (frame->oheight != this->context->height)) {
- frame->vo_frame.free(&frame->vo_frame);
- lprintf("LAVC ignoring frame !!!\n");
- return 1;
- }
-
- /* prepare frame for conversion, handles YUY2 -> YV12 conversion when necessary */
- lavc_prepare_frame(this, drv, frame);
-
- /* do the encoding */
- size = avcodec_encode_video(this->context, this->ffmpeg_buffer, DEFAULT_BUFFER_SIZE, this->picture);
-
- frame->vo_frame.free(&frame->vo_frame);
-
- if (size < 0) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: encoding failed\n");
- return 0;
- }
-
- written = write(drv->fd_video, this->ffmpeg_buffer, size);
- if (written < 0) {
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: video device write failed (%s)\n", strerror(errno));
- return 0;
- }
- if (written != size)
- xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
- "dxr3_mpeg_encoder: Could only write %zd of %d mpeg bytes.\n", written, size);
- return 1;
-}
-
-static int lavc_on_unneeded(dxr3_driver_t *drv)
-{
- lavc_data_t *this = (lavc_data_t *)drv->enc;
- lprintf("flushing buffers\n");
- if (this->context) {
- avcodec_close(this->context);
- free(this->context);
- free(this->picture);
- this->context = NULL;
- this->picture = NULL;
- }
- return 1;
-}
-
-static int lavc_prepare_frame(lavc_data_t *this, dxr3_driver_t *drv, dxr3_frame_t *frame)
-{
- int i, j, w2;
- uint8_t *yuy2;
-
- if (frame->vo_frame.bad_frame) return 1;
-
- if (frame->vo_frame.format == XINE_IMGFMT_YUY2) {
- /* need YUY2->YV12 conversion */
- if (!(this->out[0] && this->out[1] && this->out[2]) ) {
- lprintf("Internal YV12 buffer not created.\n");
- return 0;
- }
- this->picture->data[0] = this->out[0] + frame->vo_frame.pitches[0] * drv->top_bar; /* y */
- this->picture->data[1] = this->out[1] + (frame->vo_frame.pitches[0] / 2) * (drv->top_bar / 2); /* u */
- this->picture->data[2] = this->out[2] + (frame->vo_frame.pitches[0] / 2) * (drv->top_bar / 2); /* v */
- yuy2 = frame->vo_frame.base[0];
- w2 = frame->vo_frame.pitches[0] / 2;
- for (i = 0; i < frame->vo_frame.height; i += 2) {
- for (j = 0; j < w2; j++) {
- /* packed YUV 422 is: Y[i] U[i] Y[i+1] V[i] */
- *(this->picture->data[0]++) = *(yuy2++);
- *(this->picture->data[1]++) = *(yuy2++);
- *(this->picture->data[0]++) = *(yuy2++);
- *(this->picture->data[2]++) = *(yuy2++);
- }
- /* down sampling */
- for (j = 0; j < w2; j++) {
- /* skip every second line for U and V */
- *(this->picture->data[0]++) = *(yuy2++);
- yuy2++;
- *(this->picture->data[0]++) = *(yuy2++);
- yuy2++;
- }
- }
- /* reset for encoder */
- this->picture->data[0] = this->out[0];
- this->picture->data[1] = this->out[1];
- this->picture->data[2] = this->out[2];
- }
- else { /* YV12 **/
- this->picture->data[0] = frame->real_base[0];
- this->picture->data[1] = frame->real_base[1];
- this->picture->data[2] = frame->real_base[2];
- }
- this->picture->linesize[0] = this->context->width;
- this->picture->linesize[1] = this->context->width / 2;
- this->picture->linesize[2] = this->context->width / 2;
- return 1;
-}
diff --git a/src/combined/ffmpeg/mkcodeclist.pl b/src/combined/ffmpeg/mkcodeclist.pl
index b4a10921a..311d147af 100755
--- a/src/combined/ffmpeg/mkcodeclist.pl
+++ b/src/combined/ffmpeg/mkcodeclist.pl
@@ -38,9 +38,9 @@ while (defined ($line = <LIST>)) {
$Type = $type;
$Type =~ tr/a-z/A-Z/;
} elsif (substr ($line, 0, 7) eq 'config=') {
- # "#ifdef CONFIG_FOO_DECODER" mappings
+ # avcodec minimum version mappings
($a, $f, $t) = split (/=/, $line, 3);
- $config{$f} = $t;
+ $config{$f} = $t if $t =~ /^\d+,\d+,\d+$/
} else {
# codec details
push @known, [split (/\s+/, $line, 3)];
@@ -63,6 +63,7 @@ my $w = ($out ne '-');
if ($w) {
# Write the C source code for the codec lists
open LIST, "> $out" or die $!;
+ print LIST "#ifndef AV_VERSION_INT\n# define AV_VERSION_INT(a,b,c) 0x7FFFFFFF\n#endif\n" or die $!;
print LIST "static const ff_codec_t ff_${type}_lookup[] = {\n" or die $!;
foreach $line (@known) {
next if $line->[0] eq '!';
@@ -73,12 +74,12 @@ if ($w) {
foreach $line (@known) {
next if $line->[0] eq '!';
next unless defined $codecs{$line->[1]};
- $a = $line->[1];
+ $a = '';
$a = $config{$a} if defined $config{$a};
if ($a eq '') {
print LIST " BUF_${Type}_$line->[0],\n" or die $!;
} else {
- print LIST " #ifdef CONFIG_${a}_DECODER\n BUF_${Type}_$line->[0],\n #endif\n" or die $!;
+ print LIST " #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT($a)\n BUF_${Type}_$line->[0],\n #endif\n" or die $!;
}
}
print LIST " 0,\n};\n" or die $!;
diff --git a/src/combined/ffmpeg/xine_audio.list b/src/combined/ffmpeg/xine_audio.list
index 0ebbfbda6..8a40c29cb 100644
--- a/src/combined/ffmpeg/xine_audio.list
+++ b/src/combined/ffmpeg/xine_audio.list
@@ -1,5 +1,4 @@
type=audio
-config=MP3ADU=
# xine-lib BUF_AUDIO_ ffmpeg CODEC_ID_ description or comment
# ("!"=ignore) (quote any "s)
diff --git a/src/combined/ffmpeg/xine_video.list b/src/combined/ffmpeg/xine_video.list
index bd1238d6f..009f4dafd 100644
--- a/src/combined/ffmpeg/xine_video.list
+++ b/src/combined/ffmpeg/xine_video.list
@@ -1,7 +1,4 @@
type=video
-config=VP6F=VP6
-config=FLV1=FLV
-config=THEORA=
# xine-lib BUF_VIDEO_ ffmpeg CODEC_ID_ description or comment
# ("!"=ignore) (quote any "s)
diff --git a/src/combined/flac_decoder.c b/src/combined/flac_decoder.c
new file mode 100644
index 000000000..2d4176f9a
--- /dev/null
+++ b/src/combined/flac_decoder.c
@@ -0,0 +1,432 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * John McCutchan 2003
+ * FLAC Decoder (http://flac.sf.net)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#include <FLAC/stream_decoder.h>
+
+#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8
+#include <FLAC/seekable_stream_decoder.h>
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
+#define LOG_MODULE "flac_decoder"
+#define LOG_VERBOSE
+
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} flac_class_t;
+
+typedef struct flac_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ int64_t pts;
+
+ xine_stream_t *stream;
+
+ FLAC__StreamDecoder *flac_decoder;
+
+ unsigned char *buf;
+ size_t buf_size;
+ size_t buf_pos;
+ size_t min_size;
+
+ int output_open;
+
+} flac_decoder_t;
+
+/*
+ * FLAC callback functions
+ */
+
+#ifdef LEGACY_FLAC
+static FLAC__StreamDecoderReadStatus
+flac_read_callback (const FLAC__StreamDecoder *decoder,
+ FLAC__byte buffer[],
+ unsigned *bytes,
+ void *client_data)
+#else
+static FLAC__StreamDecoderReadStatus
+flac_read_callback (const FLAC__StreamDecoder *decoder,
+ FLAC__byte buffer[],
+ size_t *bytes,
+ void *client_data)
+#endif
+{
+ flac_decoder_t *this = (flac_decoder_t *)client_data;
+ size_t number_of_bytes_to_copy;
+
+ lprintf("flac_read_callback: %zd\n", (size_t)*bytes);
+
+ if (this->buf_pos > *bytes)
+ number_of_bytes_to_copy = *bytes;
+ else
+ number_of_bytes_to_copy = this->buf_pos;
+
+ lprintf("number_of_bytes_to_copy: %zd\n", number_of_bytes_to_copy);
+
+ *bytes = number_of_bytes_to_copy;
+
+ xine_fast_memcpy (buffer, this->buf, number_of_bytes_to_copy);
+
+ this->buf_pos -= number_of_bytes_to_copy;
+ memmove(this->buf, &this->buf[number_of_bytes_to_copy], this->buf_pos );
+
+ if(number_of_bytes_to_copy)
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+ else
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
+}
+
+static FLAC__StreamDecoderWriteStatus
+flac_write_callback (const FLAC__StreamDecoder *decoder,
+ const FLAC__Frame *frame,
+ const FLAC__int32 *const buffer[],
+ void *client_data)
+{
+ flac_decoder_t *this = (flac_decoder_t *)client_data;
+ audio_buffer_t *audio_buffer = NULL;
+ int samples_left = frame->header.blocksize;
+ int bytes_per_sample = (frame->header.bits_per_sample <= 8) ? 1 : 2;
+ int buf_samples;
+ int8_t *data8;
+ int16_t *data16;
+ int i,j;
+
+ lprintf("flac_write_callback\n");
+
+ while( samples_left ) {
+
+ audio_buffer = this->stream->audio_out->get_buffer(this->stream->audio_out);
+
+ if( audio_buffer->mem_size < samples_left * frame->header.channels * bytes_per_sample )
+ buf_samples = audio_buffer->mem_size / (frame->header.channels * bytes_per_sample);
+ else
+ buf_samples = samples_left;
+
+ switch (frame->header.bits_per_sample) {
+ case 8:
+ data8 = (int8_t *)audio_buffer->mem;
+
+ for( j=0; j < buf_samples; j++ )
+ for( i=0; i < frame->header.channels; i++ )
+ *data8++ = buffer[i][j];
+ break;
+
+ case 16:
+ data16 = (int16_t *)audio_buffer->mem;
+
+ for( j=0; j < buf_samples; j++ )
+ for( i=0; i < frame->header.channels; i++ )
+ *data16++ = buffer[i][j];
+ break;
+
+ case 24:
+ data16 = (int16_t *)audio_buffer->mem;
+
+ for( j=0; j < buf_samples; j++ )
+ for( i=0; i < frame->header.channels; i++ )
+ *data16++ = buffer[i][j] >> 8;
+ break;
+
+ }
+
+ audio_buffer->num_frames = buf_samples;
+ audio_buffer->vpts = this->pts;
+ this->pts = 0;
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+ samples_left -= buf_samples;
+ }
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+}
+
+#ifdef LEGACY_FLAC
+static void
+flac_metadata_callback (const FLAC__StreamDecoder *decoder,
+ const FLAC__StreamMetadata *metadata,
+ void *client_data)
+{
+ /* flac_decoder_t *this = (flac_decoder_t *)client_data; */
+
+ lprintf("Metadata callback called!\n");
+
+#ifdef LOG
+ if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
+ printf("libflac: min_blocksize = %d\n", metadata->data.stream_info.min_blocksize);
+ printf("libflac: max_blocksize = %d\n", metadata->data.stream_info.max_blocksize);
+ printf("libflac: min_framesize = %d\n", metadata->data.stream_info.min_framesize);
+ printf("libflac: max_framesize = %d\n", metadata->data.stream_info.max_framesize);
+ /* does not work well:
+ this->min_size = 2 * metadata->data.stream_info.max_blocksize; */
+ }
+#endif
+
+ return;
+}
+#endif
+
+static void
+flac_error_callback (const FLAC__StreamDecoder *decoder,
+ FLAC__StreamDecoderErrorStatus status,
+ void *client_data)
+{
+ /* This will be called if there is an error in the flac stream */
+ lprintf("flac_error_callback\n");
+
+#ifdef LOG
+ if (status == FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
+ printf("libflac: Decoder lost synchronization.\n");
+ else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER)
+ printf("libflac: Decoder encounted a corrupted frame header.\n");
+ else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH)
+ printf("libflac: Frame's data did not match the CRC in the footer.\n");
+ else
+ printf("libflac: unknown error.\n");
+#endif
+
+ return;
+}
+
+
+/*
+ * FLAC plugin decoder
+ */
+
+static void
+flac_reset (audio_decoder_t *this_gen)
+{
+ flac_decoder_t *this = (flac_decoder_t *) this_gen;
+
+ this->buf_pos = 0;
+
+ if( FLAC__stream_decoder_get_state(this->flac_decoder) !=
+ FLAC__STREAM_DECODER_SEARCH_FOR_METADATA )
+ FLAC__stream_decoder_flush (this->flac_decoder);
+}
+
+static void
+flac_discontinuity (audio_decoder_t *this_gen)
+{
+ flac_decoder_t *this = (flac_decoder_t *) this_gen;
+
+ this->pts = 0;
+
+ lprintf("Discontinuity!\n");
+}
+
+static void
+flac_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
+{
+ flac_decoder_t *this = (flac_decoder_t *) this_gen;
+ int ret = 1;
+
+ /* We are getting the stream header, open up the audio
+ * device, and collect information about the stream
+ */
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER)
+ {
+ 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)
+ {
+ const int bits = bits_per_sample;
+ this->output_open = (this->stream->audio_out->open) (
+ this->stream->audio_out,
+ this->stream,
+ bits > 16 ? 16 : bits,
+ sample_rate,
+ mode);
+ }
+ this->buf_pos = 0;
+ } else if (this->output_open)
+ {
+ /* This isn't a header frame and we have opened the output device */
+
+
+ /* What we have buffered so far, and what is coming in
+ * is larger than our buffer
+ */
+ if (this->buf_pos + buf->size > this->buf_size)
+ {
+ this->buf_size += 2 * buf->size;
+ this->buf = realloc (this->buf, this->buf_size);
+ lprintf("reallocating buffer to %d\n", this->buf_size);
+ }
+
+ xine_fast_memcpy (&this->buf[this->buf_pos], buf->content, buf->size);
+ this->buf_pos += buf->size;
+
+ if (buf->pts)
+ this->pts = buf->pts;
+
+ /* We have enough to decode a frame */
+ while( ret && this->buf_pos > this->min_size ) {
+
+ FLAC__StreamDecoderState state = FLAC__stream_decoder_get_state(this->flac_decoder);
+
+ if( state == FLAC__STREAM_DECODER_SEARCH_FOR_METADATA ) {
+ lprintf("process_until_end_of_metadata\n");
+ ret = FLAC__stream_decoder_process_until_end_of_metadata (this->flac_decoder);
+ } else if ( state == FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC ||
+ state == FLAC__STREAM_DECODER_READ_FRAME ) {
+ lprintf("process_single\n");
+ ret = FLAC__stream_decoder_process_single (this->flac_decoder);
+ } else {
+ lprintf("aborted.\n");
+ FLAC__stream_decoder_flush (this->flac_decoder);
+ break;
+ }
+ }
+ } else
+ return;
+
+
+}
+
+static void
+flac_dispose (audio_decoder_t *this_gen) {
+ flac_decoder_t *this = (flac_decoder_t *) this_gen;
+
+ FLAC__stream_decoder_finish (this->flac_decoder);
+
+ FLAC__stream_decoder_delete (this->flac_decoder);
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+ if (this->buf)
+ free(this->buf);
+
+ free (this_gen);
+}
+
+static audio_decoder_t *
+open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+ flac_decoder_t *this ;
+
+ this = calloc(1, sizeof (flac_decoder_t));
+
+ this->audio_decoder.decode_data = flac_decode_data;
+ this->audio_decoder.reset = flac_reset;
+ this->audio_decoder.discontinuity = flac_discontinuity;
+ this->audio_decoder.dispose = flac_dispose;
+ this->stream = stream;
+
+ this->output_open = 0;
+ this->buf = NULL;
+ this->buf_size = 0;
+ this->min_size = 65536;
+ this->pts = 0;
+
+ this->flac_decoder = FLAC__stream_decoder_new();
+
+#ifdef LEGACY_FLAC
+ FLAC__stream_decoder_set_read_callback (this->flac_decoder,
+ flac_read_callback);
+ FLAC__stream_decoder_set_write_callback (this->flac_decoder,
+ flac_write_callback);
+ FLAC__stream_decoder_set_metadata_callback (this->flac_decoder,
+ flac_metadata_callback);
+ FLAC__stream_decoder_set_error_callback (this->flac_decoder,
+ flac_error_callback);
+
+ FLAC__stream_decoder_set_client_data (this->flac_decoder, this);
+
+ if (FLAC__stream_decoder_init (this->flac_decoder) != FLAC__STREAM_DECODER_SEARCH_FOR_METADATA) {
+ free (this);
+ return NULL;
+ }
+#else
+ if ( FLAC__stream_decoder_init_stream (this->flac_decoder,
+ flac_read_callback,
+ NULL, /* seek */
+ NULL, /* tell */
+ NULL, /* length */
+ NULL, /* eof */
+ flac_write_callback,
+ NULL, /* metadata */
+ flac_error_callback,
+ this
+ ) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
+ free (this);
+ return NULL;
+ }
+#endif
+
+ return (audio_decoder_t *) this;
+}
+
+/*
+ * flac plugin class
+ */
+static void *
+init_plugin (xine_t *xine, void *data) {
+ flac_class_t *this;
+
+ this = calloc(1, sizeof (flac_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "flacdec";
+ this->decoder_class.description = N_("flac audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+
+ return this;
+}
+
+void *demux_flac_init_class (xine_t *xine, void *data);
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_FLAC, 0
+ };
+
+static const decoder_info_t dec_info_audio = {
+ audio_types, /* supported types */
+ 8 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_DEMUX, 27, "flac", XINE_VERSION_CODE, NULL, demux_flac_init_class },
+ { PLUGIN_AUDIO_DECODER, 16, "flacdec", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/combined/flac_demuxer.c b/src/combined/flac_demuxer.c
new file mode 100644
index 000000000..7b4ed3c95
--- /dev/null
+++ b/src/combined/flac_demuxer.c
@@ -0,0 +1,726 @@
+/*
+ * Copyright (C) 2000-2006 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, USA
+ *
+ *
+ * John McCutchan
+ * FLAC demuxer (http://flac.sf.net)
+ *
+ * TODO: Skip id3v2 tags.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <sched.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <FLAC/stream_decoder.h>
+
+#if !defined FLAC_API_VERSION_CURRENT || FLAC_API_VERSION_CURRENT < 8
+#include <FLAC/seekable_stream_decoder.h>
+#define LEGACY_FLAC
+#else
+#undef LEGACY_FLAC
+#endif
+
+#define LOG_MODULE "demux_flac"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+
+#ifndef LEGACY_FLAC
+# define FLAC__SeekableStreamDecoder FLAC__StreamDecoder
+#endif
+
+/* FLAC Demuxer plugin */
+typedef struct demux_flac_s {
+ demux_plugin_t demux_plugin;
+
+ xine_stream_t *stream;
+
+ fifo_buffer_t *audio_fifo;
+ fifo_buffer_t *video_fifo;
+
+ input_plugin_t *input;
+
+ int status;
+
+ int seek_flag;
+
+ off_t data_start;
+ off_t data_size;
+
+ /* FLAC Stuff */
+ FLAC__SeekableStreamDecoder *flac_decoder;
+
+ uint64_t total_samples;
+ uint64_t bits_per_sample;
+ uint64_t channels;
+ uint64_t sample_rate;
+ uint64_t length_in_msec;
+} demux_flac_t ;
+
+
+/* FLAC Demuxer class */
+typedef struct demux_flac_class_s {
+ demux_class_t demux_class;
+
+ xine_t *xine;
+ config_values_t *config;
+
+} demux_flac_class_t;
+
+/* FLAC Callbacks */
+static
+#ifdef LEGACY_FLAC
+FLAC__SeekableStreamDecoderReadStatus
+flac_read_callback (const FLAC__SeekableStreamDecoder *decoder,
+ FLAC__byte buffer[],
+ unsigned *bytes,
+ void *client_data)
+#else
+FLAC__StreamDecoderReadStatus
+flac_read_callback (const FLAC__SeekableStreamDecoder *decoder,
+ FLAC__byte buffer[],
+ size_t *bytes,
+ void *client_data)
+#endif
+{
+ demux_flac_t *this = (demux_flac_t *)client_data;
+ input_plugin_t *input = this->input;
+ off_t offset = *bytes;
+
+ lprintf("flac_read_callback\n");
+
+ /* This should only be called when flac is reading the metadata
+ * of the flac stream.
+ */
+
+ offset = input->read (input, buffer, offset);
+
+ lprintf("Read %lld / %u bytes into buffer\n", offset, *bytes);
+
+ /* This is the way to detect EOF with xine input plugins */
+ if ( offset <= 0 && *bytes != 0 )
+ {
+ *bytes = offset;
+ lprintf("Marking EOF\n");
+
+ this->status = DEMUX_FINISHED;
+#ifdef LEGACY_FLAC
+ return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR;
+#else
+ return FLAC__STREAM_DECODER_READ_STATUS_ABORT;
+#endif
+ }
+ else
+ {
+ *bytes = offset;
+ lprintf("Read was perfect\n");
+
+#ifdef LEGACY_FLAC
+ return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE;
+#endif
+ }
+}
+
+static
+#ifdef LEGACY_FLAC
+FLAC__SeekableStreamDecoderSeekStatus
+#else
+FLAC__StreamDecoderSeekStatus
+#endif
+flac_seek_callback (const FLAC__SeekableStreamDecoder *decoder,
+ FLAC__uint64 absolute_byte_offset,
+ void *client_data)
+{
+ input_plugin_t *input = ((demux_flac_t *)client_data)->input;
+ off_t offset;
+
+ lprintf("flac_seek_callback\n");
+
+ offset = input->seek (input, absolute_byte_offset, SEEK_SET);
+
+ if (offset == -1)
+#ifdef LEGACY_FLAC
+ return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_ERROR;
+#endif
+ else
+#ifdef LEGACY_FLAC
+ return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_SEEK_STATUS_OK;
+#endif
+}
+
+static
+#ifdef LEGACY_FLAC
+FLAC__SeekableStreamDecoderTellStatus
+#else
+FLAC__StreamDecoderTellStatus
+#endif
+flac_tell_callback (const FLAC__SeekableStreamDecoder *decoder,
+ FLAC__uint64 *absolute_byte_offset,
+ void *client_data)
+{
+ input_plugin_t *input = ((demux_flac_t *)client_data)->input;
+ off_t offset;
+
+ lprintf("flac_tell_callback\n");
+
+ offset = input->get_current_pos (input);
+
+ *absolute_byte_offset = offset;
+
+#ifdef LEGACY_FLAC
+ return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_TELL_STATUS_OK;
+#endif
+}
+
+static
+#ifdef LEGACY_FLAC
+FLAC__SeekableStreamDecoderLengthStatus
+#else
+FLAC__StreamDecoderLengthStatus
+#endif
+flac_length_callback (const FLAC__SeekableStreamDecoder *decoder,
+ FLAC__uint64 *stream_length,
+ void *client_data)
+{
+ input_plugin_t *input = ((demux_flac_t *)client_data)->input;
+ off_t offset;
+
+ lprintf("flac_length_callback\n");
+
+ offset = input->get_length (input);
+
+ /* FIXME, can flac handle -1 as offset ? */
+#ifdef LEGACY_FLAC
+ return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
+#else
+ return FLAC__STREAM_DECODER_LENGTH_STATUS_OK;
+#endif
+}
+
+static FLAC__bool
+flac_eof_callback (const FLAC__SeekableStreamDecoder *decoder,
+ void *client_data)
+{
+ demux_flac_t *this = (demux_flac_t *)client_data;
+
+ lprintf("flac_eof_callback\n");
+
+ if (this->status == DEMUX_FINISHED)
+ {
+ lprintf("flac_eof_callback: True!\n");
+
+ return true;
+ }
+ else
+ {
+ lprintf("flac_eof_callback: False!\n");
+
+ return false;
+ }
+}
+
+static FLAC__StreamDecoderWriteStatus
+flac_write_callback (const FLAC__SeekableStreamDecoder *decoder,
+ const FLAC__Frame *frame,
+ const FLAC__int32 * const buffer[],
+ void *client_data)
+{
+ /* This should never be called, all we use flac for in this demuxer
+ * is seeking. We do the decoding in the decoder
+ */
+
+ lprintf("Error: Write callback was called!\n");
+
+ return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
+}
+
+static void
+flac_metadata_callback (const FLAC__SeekableStreamDecoder *decoder,
+ const FLAC__StreamMetadata *metadata,
+ void *client_data)
+{
+ demux_flac_t *this = (demux_flac_t *)client_data;
+
+ lprintf("IN: Metadata callback\n");
+
+ /* This should be called when we first look at a flac stream,
+ * We get information about the stream here.
+ */
+ if (metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
+ lprintf("Got METADATA!\n");
+
+ this->total_samples = metadata->data.stream_info.total_samples;
+ this->bits_per_sample = metadata->data.stream_info.bits_per_sample;
+ this->channels = metadata->data.stream_info.channels;
+ this->sample_rate = metadata->data.stream_info.sample_rate;
+ this->length_in_msec = (this->total_samples * 1000) /
+ this->sample_rate;
+ }
+ return;
+}
+
+static void
+flac_error_callback (const FLAC__SeekableStreamDecoder *decoder,
+ FLAC__StreamDecoderErrorStatus status,
+ void *client_data)
+{
+ demux_flac_t *this = (demux_flac_t *)client_data;
+ /* This will be called if there is an error when flac is seeking
+ * in the stream.
+ */
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_flac: flac_error_callback\n");
+
+ if (status == FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "demux_flac: Decoder lost synchronization.\n");
+ else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER)
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "demux_flac: Decoder encounted a corrupted frame header.\n");
+ else if (status == FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH)
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "demux_flac: Frame's data did not match the CRC in the footer.\n");
+ else
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_flac: unknown error.\n");
+
+ this->status = DEMUX_FINISHED;
+
+ return;
+}
+
+/* FLAC Demuxer plugin */
+static int
+demux_flac_send_chunk (demux_plugin_t *this_gen) {
+ demux_flac_t *this = (demux_flac_t *) this_gen;
+ buf_element_t *buf = NULL;
+ off_t current_file_pos, file_size = 0;
+ int64_t current_pts;
+ unsigned int remaining_sample_bytes = 0;
+
+ remaining_sample_bytes = 2048;
+
+ current_file_pos = this->input->get_current_pos (this->input)
+ - this->data_start;
+ if( (this->data_size - this->data_start) > 0 )
+ file_size = (this->data_size - this->data_start);
+
+ current_pts = current_file_pos;
+ current_pts *= this->length_in_msec * 90;
+ if( file_size )
+ current_pts /= file_size;
+
+ if (this->seek_flag) {
+#ifdef USE_ESTIMATED_PTS
+ _x_demux_control_newpts (this->stream, current_pts, BUF_FLAG_SEEK);
+#else
+ _x_demux_control_newpts (this->stream, 0, BUF_FLAG_SEEK);
+#endif
+ this->seek_flag = 0;
+ }
+
+
+ while (remaining_sample_bytes)
+ {
+ if(!this->audio_fifo) {
+ this->status = DEMUX_FINISHED;
+ break;
+ }
+
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_AUDIO_FLAC;
+ if( file_size )
+ buf->extra_info->input_normpos = (int) ((double)current_file_pos * 65535 / file_size);
+ buf->extra_info->input_time = current_pts / 90;
+#ifdef USE_ESTIMATED_PTS
+ buf->pts = current_pts;
+#else
+ buf->pts = 0;
+#endif
+
+ if (remaining_sample_bytes > buf->max_size)
+ buf->size = buf->max_size;
+ else
+ buf->size = remaining_sample_bytes;
+
+ remaining_sample_bytes -= buf->size;
+
+ if (this->input->read (this->input,buf->content,buf->size)!=buf->size) {
+ lprintf("buf->size != input->read()\n");
+
+ buf->free_buffer (buf);
+ this->status = DEMUX_FINISHED;
+ break;
+ }
+
+ /*
+ if (!remaining_sample_bytes)
+ {
+ buf->decoder_flags |= BUF_FLAG_FRAME_END;
+ }*/
+
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+
+ return this->status;
+}
+
+static void
+demux_flac_send_headers (demux_plugin_t *this_gen) {
+ demux_flac_t *this = (demux_flac_t *) this_gen;
+
+ buf_element_t *buf;
+
+ lprintf("demux_flac_send_headers\n");
+
+ this->video_fifo = this->stream->video_fifo;
+ this->audio_fifo = this->stream->audio_fifo;
+
+ this->status = DEMUX_OK;
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, this->channels);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->sample_rate);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, this->bits_per_sample);
+
+ _x_demux_control_start (this->stream);
+
+ if (this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_AUDIO_FLAC;
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
+ buf->decoder_info[0] = 0;
+ buf->decoder_info[1] = this->sample_rate;
+ buf->decoder_info[2] = this->bits_per_sample;
+ buf->decoder_info[3] = this->channels;
+ buf->size = 0;
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+}
+
+static void
+demux_flac_dispose (demux_plugin_t *this_gen) {
+ demux_flac_t *this = (demux_flac_t *) this_gen;
+
+ lprintf("demux_flac_dispose\n");
+
+ if (this->flac_decoder)
+#ifdef LEGACY_FLAC
+ FLAC__seekable_stream_decoder_delete (this->flac_decoder);
+#else
+ FLAC__stream_decoder_delete (this->flac_decoder);
+#endif
+
+ free(this);
+ return;
+}
+
+static int
+demux_flac_get_status (demux_plugin_t *this_gen) {
+ demux_flac_t *this = (demux_flac_t *) this_gen;
+
+ lprintf("demux_flac_get_status\n");
+
+ return this->status;
+}
+
+
+static int
+demux_flac_seek (demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing) {
+ demux_flac_t *this = (demux_flac_t *) this_gen;
+
+ lprintf("demux_flac_seek\n");
+
+ start_pos = (off_t) ( (double) start_pos / 65535 *
+ this->input->get_length (this->input) );
+
+ if (!start_pos && start_time) {
+ double distance = (double)start_time;
+
+ if (this->length_in_msec != 0)
+ {
+ distance /= (double)this->length_in_msec;
+ }
+ start_pos = (uint64_t)(distance * (this->data_size - this->data_start));
+ }
+
+ if (start_pos || !start_time) {
+
+ start_pos += this->data_start;
+ this->input->seek (this->input, start_pos, SEEK_SET);
+ lprintf ("Seek to position: %lld\n", start_pos);
+
+ } else {
+
+ double distance = (double)start_time;
+ uint64_t target_sample;
+ FLAC__bool s = false;
+
+ if (this->length_in_msec != 0)
+ {
+ distance /= (double)this->length_in_msec;
+ }
+ target_sample = (uint64_t)(distance * this->total_samples);
+
+#ifdef LEGACY_FLAC
+ s = FLAC__seekable_stream_decoder_seek_absolute (this->flac_decoder,
+ target_sample);
+#else
+ s = FLAC__stream_decoder_seek_absolute (this->flac_decoder,
+ target_sample);
+#endif
+
+ if (s) {
+ lprintf ("Seek to: %d successfull!\n", start_time);
+ } else
+ this->status = DEMUX_FINISHED;
+ }
+
+ _x_demux_flush_engine (this->stream);
+ this->seek_flag = 1;
+
+ return this->status;
+}
+
+static int
+demux_flac_get_stream_length (demux_plugin_t *this_gen) {
+ demux_flac_t *this = (demux_flac_t *) this_gen;
+
+ lprintf("demux_flac_get_stream_length\n");
+
+ if (this->flac_decoder)
+ return this->length_in_msec;
+ else
+ return 0;
+}
+
+static uint32_t
+demux_flac_get_capabilities (demux_plugin_t *this_gen) {
+ lprintf("demux_flac_get_capabilities\n");
+
+ return DEMUX_CAP_NOCAP;
+}
+
+static int
+demux_flac_get_optional_data (demux_plugin_t *this_gen, void *data, int dtype) {
+ lprintf("demux_flac_get_optional_data\n");
+
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+}
+
+static demux_plugin_t *
+open_plugin (demux_class_t *class_gen,
+ xine_stream_t *stream,
+ input_plugin_t *input) {
+ demux_flac_t *this;
+
+ lprintf("open_plugin\n");
+
+ switch (stream->content_detection_method) {
+ case METHOD_BY_CONTENT:
+ {
+ uint8_t buf[MAX_PREVIEW_SIZE];
+ int len;
+
+ /*
+ * try to get a preview of the data
+ */
+ len = input->get_optional_data (input, buf, INPUT_OPTIONAL_DATA_PREVIEW);
+ if (len == INPUT_OPTIONAL_UNSUPPORTED) {
+
+ if (input->get_capabilities (input) & INPUT_CAP_SEEKABLE) {
+
+ input->seek (input, 0, SEEK_SET);
+ if ( (len=input->read (input, buf, 1024)) <= 0)
+ return NULL;
+ input->seek (input, 0, SEEK_SET);
+
+ } else
+ return NULL;
+ }
+
+ /* FIXME: Skip id3v2 tag */
+ /* Look for fLaC tag at the beginning of file */
+ if ( (buf[0] != 'f') || (buf[1] != 'L') ||
+ (buf[2] != 'a') || (buf[3] != 'C') )
+ return NULL;
+ }
+ break;
+ case METHOD_BY_MRL:
+ case METHOD_EXPLICIT:
+ break;
+ default:
+ return NULL;
+ break;
+ }
+
+ /*
+ * if we reach this point, the input has been accepted.
+ */
+
+ this = calloc(1, sizeof (demux_flac_t));
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_flac_send_headers;
+ this->demux_plugin.send_chunk = demux_flac_send_chunk;
+ this->demux_plugin.seek = demux_flac_seek;
+ this->demux_plugin.dispose = demux_flac_dispose;
+ this->demux_plugin.get_status = demux_flac_get_status;
+ this->demux_plugin.get_stream_length = demux_flac_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_flac_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_flac_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->seek_flag = 0;
+
+
+ /* Get a new FLAC decoder and hook up callbacks */
+#ifdef LEGACY_FLAC
+ this->flac_decoder = FLAC__seekable_stream_decoder_new();
+ lprintf("this->flac_decoder: %p\n", this->flac_decoder);
+
+ FLAC__seekable_stream_decoder_set_md5_checking (this->flac_decoder, false);
+ FLAC__seekable_stream_decoder_set_read_callback (this->flac_decoder,
+ flac_read_callback);
+ FLAC__seekable_stream_decoder_set_seek_callback (this->flac_decoder,
+ flac_seek_callback);
+ FLAC__seekable_stream_decoder_set_tell_callback (this->flac_decoder,
+ flac_tell_callback);
+ FLAC__seekable_stream_decoder_set_length_callback (this->flac_decoder,
+ flac_length_callback);
+ FLAC__seekable_stream_decoder_set_eof_callback (this->flac_decoder,
+ flac_eof_callback);
+ FLAC__seekable_stream_decoder_set_metadata_callback (this->flac_decoder,
+ flac_metadata_callback);
+ FLAC__seekable_stream_decoder_set_write_callback (this->flac_decoder,
+ flac_write_callback);
+ FLAC__seekable_stream_decoder_set_error_callback (this->flac_decoder,
+ flac_error_callback);
+ FLAC__seekable_stream_decoder_set_client_data (this->flac_decoder,
+ this);
+
+ FLAC__seekable_stream_decoder_init (this->flac_decoder);
+#else
+ this->flac_decoder = FLAC__stream_decoder_new();
+ lprintf("this->flac_decoder: %p\n", this->flac_decoder);
+
+ if ( ! this->flac_decoder ) {
+ free(this);
+ return NULL;
+ }
+
+ FLAC__stream_decoder_set_md5_checking (this->flac_decoder, false);
+
+ if ( FLAC__stream_decoder_init_stream(this->flac_decoder,
+ flac_read_callback,
+ flac_seek_callback,
+ flac_tell_callback,
+ flac_length_callback,
+ flac_eof_callback,
+ flac_write_callback,
+ flac_metadata_callback,
+ flac_error_callback,
+ this
+ ) != FLAC__STREAM_DECODER_INIT_STATUS_OK ) {
+#ifdef LEGACY_FLAC
+ FLAC__seekable_stream_decoder_delete (this->flac_decoder);
+#else
+ FLAC__stream_decoder_delete (this->flac_decoder);
+#endif
+ free(this);
+ return NULL;
+ }
+#endif
+
+ /* Get some stream info */
+ this->data_size = this->input->get_length (this->input);
+ this->data_start = this->input->get_current_pos (this->input);
+
+ /* This will cause FLAC to give us the rest of the information on
+ * this flac stream
+ */
+ this->status = DEMUX_OK;
+#ifdef LEGACY_FLAC
+ FLAC__seekable_stream_decoder_process_until_end_of_metadata (this->flac_decoder);
+#else
+ FLAC__stream_decoder_process_until_end_of_metadata (this->flac_decoder);
+#endif
+
+ lprintf("Processed file until end of metadata: %s\n",
+ this->status == DEMUX_OK ? "success" : "failure");
+
+ if (this->status != DEMUX_OK) {
+#ifdef LEGACY_FLAC
+ FLAC__seekable_stream_decoder_delete (this->flac_decoder);
+#else
+ FLAC__stream_decoder_delete (this->flac_decoder);
+#endif
+ free (this);
+ return NULL;
+ }
+
+ return &this->demux_plugin;
+}
+
+
+/* FLAC Demuxer class */
+void *
+demux_flac_init_class (xine_t *xine, void *data) {
+
+ demux_flac_class_t *this;
+
+ lprintf("demux_flac_init_class\n");
+
+ this = calloc(1, sizeof (demux_flac_class_t));
+ this->config = xine->config;
+ this->xine = xine;
+
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("FLAC demux plugin");
+ this->demux_class.identifier = "FLAC";
+ this->demux_class.mimetypes = "application/x-flac: flac: FLAC Audio;"
+ "application/flac: flac: FLAC Audio;";
+ this->demux_class.extensions = "flac";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
diff --git a/src/combined/nsf_combined.c b/src/combined/nsf_combined.c
new file mode 100644
index 000000000..c4c19f48a
--- /dev/null
+++ b/src/combined/nsf_combined.c
@@ -0,0 +1,42 @@
+/*
+ * 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, USA
+ */
+
+#include <xine/xine_internal.h>
+#include "nsf_combined.h"
+
+static const demuxer_info_t demux_info_nsf = {
+ 10 /* priority */
+};
+
+static const 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, 27, "nsfdemux", XINE_VERSION_CODE, &demux_info_nsf, demux_nsf_init_plugin },
+ { PLUGIN_AUDIO_DECODER, 16, "nsfdec", XINE_VERSION_CODE, &decoder_info_nsf, decoder_nsf_init_plugin },
+ { PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
+};
diff --git a/src/combined/nsf_combined.h b/src/combined/nsf_combined.h
new file mode 100644
index 000000000..4376ecf7a
--- /dev/null
+++ b/src/combined/nsf_combined.h
@@ -0,0 +1,22 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+void *decoder_nsf_init_plugin (xine_t *xine, void *data);
+void *demux_nsf_init_plugin (xine_t *xine, void *data);
diff --git a/src/combined/nsf_decoder.c b/src/combined/nsf_decoder.c
new file mode 100644
index 000000000..36f7f2990
--- /dev/null
+++ b/src/combined/nsf_decoder.c
@@ -0,0 +1,251 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * NSF Audio "Decoder" using the Nosefart NSF engine by Matt Conte
+ * http://www.baisoku.org/
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+/* Nosefart includes */
+#include "types.h"
+#include "nsf.h"
+
+#include "nsf_combined.h"
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} nsf_class_t;
+
+typedef struct nsf_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ int sample_rate; /* audio sample rate */
+ int bits_per_sample; /* bits/sample, usually 8 or 16 */
+ int channels; /* 1 or 2, usually */
+
+ int output_open; /* flag to indicate audio is ready */
+
+ int nsf_size;
+ unsigned char *nsf_file;
+ int nsf_index;
+ int song_number;
+
+ /* nsf-specific variables */
+ int64_t last_pts;
+ unsigned int iteration;
+
+ nsf_t *nsf;
+} nsf_decoder_t;
+
+/**************************************************************************
+ * xine audio plugin functions
+ *************************************************************************/
+
+static void nsf_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ nsf_decoder_t *this = (nsf_decoder_t *) this_gen;
+ audio_buffer_t *audio_buffer;
+
+ if (buf->decoder_flags & BUF_FLAG_HEADER) {
+
+ /* When the engine sends a BUF_FLAG_HEADER flag, it is time to initialize
+ * the decoder. The buffer element type has 4 decoder_info fields,
+ * 0..3. Field 1 is the sample rate. Field 2 is the bits/sample. Field
+ * 3 is the number of channels. */
+ this->sample_rate = buf->decoder_info[1];
+ this->bits_per_sample = buf->decoder_info[2];
+ this->channels = buf->decoder_info[3];
+
+ /* take this opportunity to initialize stream/meta information */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "NES Music (Nosefart)");
+
+ this->song_number = buf->content[4];
+ /* allocate a buffer for the file */
+ this->nsf_size = _X_BE_32(&buf->content[0]);
+ this->nsf_file = calloc(1, this->nsf_size);
+ this->nsf_index = 0;
+
+ /* peform any other required initialization */
+ this->last_pts = -1;
+ this->iteration = 0;
+
+ return;
+ }
+
+ /* accumulate chunks from the NSF file until whole file is received */
+ if (this->nsf_index < this->nsf_size) {
+ xine_fast_memcpy(&this->nsf_file[this->nsf_index], buf->content,
+ buf->size);
+ this->nsf_index += buf->size;
+
+ if (this->nsf_index == this->nsf_size) {
+ /* file has been received, proceed to initialize engine */
+ nsf_init();
+ this->nsf = nsf_load(NULL, this->nsf_file, this->nsf_size);
+ if (!this->nsf) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "nsf: could not initialize NSF\n");
+ /* make the decoder return on every subsequent buffer */
+ this->nsf_index = 0;
+ return;
+ }
+ this->nsf->current_song = this->song_number;
+ nsf_playtrack(this->nsf, this->nsf->current_song, this->sample_rate,
+ this->bits_per_sample, this->channels);
+ }
+ return;
+ }
+
+ /* if the audio output is not open yet, open the audio output */
+ 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,
+ _x_ao_channels2mode(this->channels));
+ }
+
+ /* if the audio still isn't open, do not go any further with the decode */
+ if (!this->output_open)
+ return;
+
+ /* check if a song change was requested */
+ if (buf->decoder_info[1]) {
+ this->nsf->current_song = buf->decoder_info[1];
+ nsf_playtrack(this->nsf, this->nsf->current_song, this->sample_rate,
+ this->bits_per_sample, this->channels);
+ }
+
+ /* time to decode a frame */
+ if (this->last_pts != -1) {
+
+ /* process a frame */
+ nsf_frame(this->nsf);
+
+ /* get an audio buffer */
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+ if (audio_buffer->mem_size == 0) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "nsf: Help! Allocated audio buffer with nothing in it!\n");
+ return;
+ }
+
+ apu_process(audio_buffer->mem, this->sample_rate / this->nsf->playback_rate);
+ audio_buffer->vpts = buf->pts;
+ audio_buffer->num_frames = this->sample_rate / this->nsf->playback_rate;
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+ }
+ this->last_pts = buf->pts;
+}
+
+/* This function resets the state of the audio decoder. This usually
+ * entails resetting the data accumulation buffer. */
+static void nsf_reset (audio_decoder_t *this_gen) {
+
+ nsf_decoder_t *this = (nsf_decoder_t *) this_gen;
+
+ this->last_pts = -1;
+}
+
+/* This function resets the last pts value of the audio decoder. */
+static void nsf_discontinuity (audio_decoder_t *this_gen) {
+
+ nsf_decoder_t *this = (nsf_decoder_t *) this_gen;
+
+ this->last_pts = -1;
+}
+
+/* This function closes the audio output and frees the private audio decoder
+ * structure. */
+static void nsf_dispose (audio_decoder_t *this_gen) {
+
+ nsf_decoder_t *this = (nsf_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 */
+ nsf_free(&this->nsf);
+ free(this->nsf_file);
+ free(this);
+}
+
+/* This function allocates, initializes, and returns a private audio
+ * decoder structure. */
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ nsf_decoder_t *this ;
+
+ this = (nsf_decoder_t *) calloc(1, sizeof(nsf_decoder_t));
+
+ /* connect the member functions */
+ this->audio_decoder.decode_data = nsf_decode_data;
+ this->audio_decoder.reset = nsf_reset;
+ this->audio_decoder.discontinuity = nsf_discontinuity;
+ this->audio_decoder.dispose = nsf_dispose;
+
+ /* connect the stream */
+ this->stream = stream;
+
+ /* audio output is not open at the start */
+ this->output_open = 0;
+
+ /* initialize the basic audio parameters */
+ this->channels = 0;
+ this->sample_rate = 0;
+ this->bits_per_sample = 0;
+
+ /* return the newly-initialized audio decoder */
+ return &this->audio_decoder;
+}
+
+/* This function allocates a private audio decoder class and initializes
+ * the class's member functions. */
+void *decoder_nsf_init_plugin (xine_t *xine, void *data) {
+
+ nsf_class_t *this ;
+
+ this = (nsf_class_t *) calloc(1, sizeof(nsf_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "NSF";
+ this->decoder_class.description = N_("NES Music audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
diff --git a/src/combined/nsf_demuxer.c b/src/combined/nsf_demuxer.c
new file mode 100644
index 000000000..2081d13b8
--- /dev/null
+++ b/src/combined/nsf_demuxer.c
@@ -0,0 +1,353 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/*
+ * NSF File "Demuxer" by Mike Melanson (melanson@pcisys.net)
+ * This is really just a loader for NES Music File Format (extension NSF)
+ * which loads an entire NSF file and passes it over to the NSF audio
+ * decoder.
+ *
+ * After the file is sent over, the demuxer controls the playback by
+ * sending empty buffers with incrementing pts values.
+ *
+ * For more information regarding the NSF format, visit:
+ * http://www.tripoint.org/kevtris/nes/nsfspec.txt
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+/********** logging **********/
+#define LOG_MODULE "demux_nsf"
+/* #define LOG_VERBOSE */
+/* #define LOG */
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
+#include "bswap.h"
+
+#include "nsf_combined.h"
+
+#define NSF_HEADER_SIZE 0x80
+#define NSF_SAMPLERATE 44100
+#define NSF_BITS 8
+#define NSF_CHANNELS 1
+#define NSF_REFRESH_RATE 60
+#define NSF_PTS_INC (90000 / NSF_REFRESH_RATE)
+
+typedef struct {
+ demux_plugin_t demux_plugin;
+
+ xine_stream_t *stream;
+ fifo_buffer_t *video_fifo;
+ fifo_buffer_t *audio_fifo;
+ input_plugin_t *input;
+ int status;
+
+ int total_songs;
+ int current_song;
+ int new_song; /* indicates song change */
+
+ char *title;
+ char *artist;
+ char *copyright;
+
+ off_t filesize;
+
+ int64_t current_pts;
+ int file_sent;
+} demux_nsf_t;
+
+typedef struct {
+ demux_class_t demux_class;
+} demux_nsf_class_t;
+
+/* returns 1 if the NSF file was opened successfully, 0 otherwise */
+static int open_nsf_file(demux_nsf_t *this) {
+ unsigned char header[NSF_HEADER_SIZE];
+
+ this->input->seek(this->input, 0, SEEK_SET);
+ if (this->input->read(this->input, header, NSF_HEADER_SIZE) !=
+ NSF_HEADER_SIZE)
+ return 0;
+
+ /* check for the signature */
+ if (memcmp(header, "NESM\x1A", 5) != 0)
+ return 0;
+
+ this->total_songs = header[6];
+ this->current_song = header[7];
+ 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);
+
+ return 1;
+}
+
+static int demux_nsf_send_chunk(demux_plugin_t *this_gen) {
+ demux_nsf_t *this = (demux_nsf_t *) this_gen;
+ buf_element_t *buf;
+ int bytes_read;
+ char title[100];
+
+ /* send chunks of the file to the decoder until file is completely
+ * loaded; then send control buffers */
+ if (!this->file_sent) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_AUDIO_NSF;
+ bytes_read = this->input->read(this->input, buf->content, buf->max_size);
+
+ if (bytes_read <= 0) {
+ /* the file has been completely loaded, free the buffer and start
+ * sending control buffers */
+ buf->free_buffer(buf);
+ this->file_sent = 1;
+
+ } else {
+
+ /* keep loading the file */
+ if (bytes_read < buf->max_size)
+ buf->size = bytes_read;
+ else
+ buf->size = buf->max_size;
+
+ buf->extra_info->input_normpos = 0;
+ buf->extra_info->input_time = 0;
+ buf->pts = 0;
+
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+ }
+
+ /* this is not an 'else' because control might fall through from above */
+ if (this->file_sent) {
+ /* send a control buffer */
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+
+ if (this->new_song) {
+
+ buf->decoder_info[1] = this->current_song;
+ this->new_song = 0;
+ sprintf(title, "%s, song %d/%d",
+ this->title, this->current_song, this->total_songs);
+
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, title);
+
+ _x_demux_control_newpts(this->stream, this->current_pts, 0);
+
+ } else
+ buf->decoder_info[1] = 0;
+
+ buf->type = BUF_AUDIO_NSF;
+ if(this->total_songs)
+ buf->extra_info->input_normpos = (this->current_song - 1) * 65535 / this->total_songs;
+ buf->extra_info->input_time = this->current_pts / 90;
+ buf->pts = this->current_pts;
+ buf->size = 0;
+ this->audio_fifo->put (this->audio_fifo, buf);
+
+ this->current_pts += NSF_PTS_INC;
+ }
+
+ return this->status;
+}
+
+static void demux_nsf_send_headers(demux_plugin_t *this_gen) {
+ demux_nsf_t *this = (demux_nsf_t *) this_gen;
+ buf_element_t *buf;
+ char copyright[100];
+
+ this->video_fifo = this->stream->video_fifo;
+ this->audio_fifo = this->stream->audio_fifo;
+
+ this->status = DEMUX_OK;
+
+ /* load stream information */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS,
+ NSF_CHANNELS);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE,
+ NSF_SAMPLERATE);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS,
+ NSF_BITS);
+
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, this->title);
+ _x_meta_info_set(this->stream, XINE_META_INFO_ARTIST, this->artist);
+ sprintf(copyright, "(C) %s", this->copyright);
+ _x_meta_info_set(this->stream, XINE_META_INFO_COMMENT, copyright);
+
+ /* send start buffers */
+ _x_demux_control_start(this->stream);
+
+ /* send init info to the audio decoder */
+ if (this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = BUF_AUDIO_NSF;
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END;
+ buf->decoder_info[0] = 5;
+ buf->decoder_info[1] = NSF_SAMPLERATE;
+ buf->decoder_info[2] = NSF_BITS;
+ buf->decoder_info[3] = NSF_CHANNELS;
+
+ /* send the NSF filesize in the body, big endian format */
+ buf->content[0] = (this->filesize >> 24) & 0xFF;
+ buf->content[1] = (this->filesize >> 16) & 0xFF;
+ buf->content[2] = (this->filesize >> 8) & 0xFF;
+ buf->content[3] = (this->filesize >> 0) & 0xFF;
+ /* send the requested song */
+ buf->content[4] = this->current_song + 5;
+
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+}
+
+static int demux_nsf_seek (demux_plugin_t *this_gen,
+ off_t start_pos, int start_time, int playing) {
+
+ demux_nsf_t *this = (demux_nsf_t *) this_gen;
+ start_pos = (off_t) ( (double) start_pos / 65535 *
+ this->total_songs );
+
+ /* if thread is not running, initialize demuxer */
+ if( !playing ) {
+
+ /* send new pts */
+ _x_demux_control_newpts(this->stream, 0, 0);
+
+ this->status = DEMUX_OK;
+
+ /* reposition stream at the start for loading */
+ this->input->seek(this->input, 0, SEEK_SET);
+
+ this->file_sent = 0;
+ this->current_pts = 0;
+ this->new_song = 1;
+ } else {
+ this->current_song = start_pos + 1;
+ this->new_song = 1;
+ this->current_pts = 0;
+ _x_demux_flush_engine(this->stream);
+ }
+
+ return this->status;
+}
+
+static void demux_nsf_dispose (demux_plugin_t *this_gen) {
+ demux_nsf_t *this = (demux_nsf_t *) this_gen;
+
+ free(this->title);
+ free(this->artist);
+ free(this->copyright);
+ free(this);
+}
+
+static int demux_nsf_get_status (demux_plugin_t *this_gen) {
+ demux_nsf_t *this = (demux_nsf_t *) this_gen;
+
+ return this->status;
+}
+
+/* return the approximate length in miliseconds */
+static int demux_nsf_get_stream_length (demux_plugin_t *this_gen) {
+ return 0;
+}
+
+static uint32_t demux_nsf_get_capabilities(demux_plugin_t *this_gen) {
+ return DEMUX_CAP_NOCAP;
+}
+
+static int demux_nsf_get_optional_data(demux_plugin_t *this_gen,
+ void *data, int data_type) {
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+}
+
+static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *stream,
+ input_plugin_t *input) {
+
+ demux_nsf_t *this;
+
+ if (!INPUT_IS_SEEKABLE(input)) {
+ xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");
+ return NULL;
+ }
+
+ this = calloc(1, sizeof(demux_nsf_t));
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_nsf_send_headers;
+ this->demux_plugin.send_chunk = demux_nsf_send_chunk;
+ this->demux_plugin.seek = demux_nsf_seek;
+ this->demux_plugin.dispose = demux_nsf_dispose;
+ this->demux_plugin.get_status = demux_nsf_get_status;
+ this->demux_plugin.get_stream_length = demux_nsf_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_nsf_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_nsf_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->status = DEMUX_FINISHED;
+
+ switch (stream->content_detection_method) {
+
+ case METHOD_BY_MRL:
+ case METHOD_BY_CONTENT:
+ case METHOD_EXPLICIT:
+
+ if (!open_nsf_file(this)) {
+ free (this);
+ return NULL;
+ }
+
+ break;
+
+ default:
+ free (this);
+ return NULL;
+ }
+
+ return &this->demux_plugin;
+}
+
+void *demux_nsf_init_plugin (xine_t *xine, void *data) {
+ demux_nsf_class_t *this;
+
+ this = calloc(1, sizeof(demux_nsf_class_t));
+
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("NES Music file demux plugin");
+ this->demux_class.identifier = "NSF";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "nsf";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
diff --git a/src/combined/wavpack_combined.c b/src/combined/wavpack_combined.c
new file mode 100644
index 000000000..8fe241d27
--- /dev/null
+++ b/src/combined/wavpack_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
+ */
+
+#include <xine/xine_internal.h>
+#include "wavpack_combined.h"
+
+static const demuxer_info_t demux_info_wv = {
+ 0 /* priority */
+};
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_WAVPACK, 0
+ };
+
+static const decoder_info_t decoder_info_wv = {
+ audio_types, /* supported types */
+ 8 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_DEMUX, 27, "wavpack", XINE_VERSION_CODE, &demux_info_wv, demux_wv_init_plugin },
+ { PLUGIN_AUDIO_DECODER, 16, "wavpackdec", XINE_VERSION_CODE, &decoder_info_wv, decoder_wavpack_init_plugin },
+ { PLUGIN_NONE, 0, NULL, 0, NULL, NULL }
+};
diff --git a/src/combined/wavpack_combined.h b/src/combined/wavpack_combined.h
new file mode 100644
index 000000000..87358169b
--- /dev/null
+++ b/src/combined/wavpack_combined.h
@@ -0,0 +1,45 @@
+/*
+ * 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, USA
+ *
+ * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
+ */
+
+#include <xine/os_types.h>
+#include <xine/attributes.h>
+#include "bswap.h"
+
+typedef struct {
+ uint32_t idcode; /* This should always be the string "wvpk" */
+ uint32_t block_size; /* Size of the rest of the frame */
+ uint16_t wv_version; /* Version of the wavpack, 0x0403 should be latest */
+ uint8_t track; /* Unused, has to be 0 */
+ uint8_t index; /* Unused, has to be 0 */
+ uint32_t file_samples; /* (uint32_t)-1 if unknown, else the total number
+ of samples for the file */
+ uint32_t samples_index; /* Index of the first sample in block, from the
+ start of the file */
+ 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 */
+} XINE_PACKED wvheader_t;
+
+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/wavpack_decoder.c b/src/combined/wavpack_decoder.c
new file mode 100644
index 000000000..253180cf2
--- /dev/null
+++ b/src/combined/wavpack_decoder.c
@@ -0,0 +1,328 @@
+/*
+ * 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, USA
+ *
+ * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#define LOG_MODULE "decode_wavpack"
+#define LOG_VERBOSE
+
+#include <xine/xine_internal.h>
+#include <xine/attributes.h>
+#include "bswap.h"
+
+#include <wavpack/wavpack.h>
+#include "wavpack_combined.h"
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} wavpack_class_t;
+
+typedef struct {
+ audio_decoder_t audio_decoder;
+
+ xine_stream_t *stream;
+
+ uint8_t *buf;
+ size_t buf_size;
+ size_t buf_pos;
+
+ int sample_rate;
+ uint16_t bits_per_sample:6;
+ uint16_t channels:4;
+
+ uint16_t output_open:1;
+
+} wavpack_decoder_t;
+
+/* Wrapper functions for Wavpack */
+static int32_t xine_buffer_read_bytes(void *const this_gen, void *const data,
+ int32_t bcount) {
+ wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
+
+ if ( bcount <= 0 )
+ return 0;
+
+ if ( bcount > (this->buf_size - this->buf_pos) )
+ bcount = (this->buf_size - this->buf_pos);
+
+ xine_fast_memcpy(data, this->buf + this->buf_pos, bcount);
+ this->buf_pos += bcount;
+
+ return bcount;
+}
+
+static uint32_t xine_buffer_get_pos(void *const this_gen) {
+ wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
+ return this->buf_pos;
+}
+
+static int xine_buffer_set_pos_rel(void *const this_gen, const int32_t delta,
+ const int mode) {
+ wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
+
+ switch(mode) {
+ case SEEK_SET:
+ if ( delta < 0 || delta > this->buf_size )
+ return -1;
+
+ this->buf_pos = delta;
+ return 0;
+ case SEEK_CUR:
+ if ( (this->buf_pos+delta) < 0 || (this->buf_pos+delta) > this->buf_size )
+ return -1;
+
+ this->buf_pos += delta;
+ return 0;
+ case SEEK_END:
+ if ( delta < 0 || delta > this->buf_size )
+ return -1;
+
+ this->buf_pos = this->buf_size - delta;
+
+ return 0;
+
+ default:
+ return -1;
+ }
+
+ return -1;
+}
+
+static int xine_buffer_set_pos_abs(void *const this_gen, const uint32_t pos) {
+ return xine_buffer_set_pos_rel(this_gen, pos, SEEK_SET);
+}
+
+static int xine_buffer_push_back_byte(void *const this_gen, const int c) {
+ if ( ! xine_buffer_set_pos_rel(this_gen, -1, SEEK_CUR) )
+ return EOF;
+ return c;
+}
+
+static uint32_t xine_buffer_get_length(void *const this_gen) {
+ wavpack_decoder_t *const this = (wavpack_decoder_t*)this_gen;
+ return this->buf_size;
+}
+
+static int xine_buffer_can_seek(void *const this_gen) {
+ return 1;
+}
+
+static int32_t xine_buffer_write_bytes(__attr_unused void *const id,
+ __attr_unused void *const data,
+ __attr_unused const int32_t bcount) {
+ lprintf("xine_buffer_write_bytes: access is read-only.\n");
+ return 0;
+}
+
+/* Wavpack plugin functions */
+static void wavpack_reset (audio_decoder_t *const this_gen)
+{
+ wavpack_decoder_t *const this = (wavpack_decoder_t *) this_gen;
+
+ this->buf_pos = 0;
+}
+
+static void wavpack_discontinuity (audio_decoder_t *const this_gen)
+{
+ /* wavpack_decoder_t *this = (wavpack_decoder_t *) this_gen; */
+
+ lprintf("Discontinuity!\n");
+}
+
+static void wavpack_decode_data (audio_decoder_t *const this_gen, buf_element_t *const buf)
+{
+ wavpack_decoder_t *const this = (wavpack_decoder_t *) this_gen;
+
+ /* We are getting the stream header, open up the audio
+ * device, and collect information about the stream
+ */
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER)
+ {
+ int mode = AO_CAP_MODE_MONO;
+
+ this->sample_rate = buf->decoder_info[1];
+ _x_assert(buf->decoder_info[2] <= 32);
+ this->bits_per_sample = buf->decoder_info[2];
+ _x_assert(buf->decoder_info[3] <= 8);
+ this->channels = buf->decoder_info[3];
+
+ mode = _x_ao_channels2mode(this->channels);
+
+ _x_meta_info_set(this->stream, XINE_META_INFO_AUDIOCODEC,
+ "WavPack");
+
+ 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,
+ mode) ? 1 : 0;
+ }
+ this->buf_pos = 0;
+ } else if (this->output_open) {
+ /* This isn't a header frame and we have opened the output device */
+
+ /* What we have buffered so far, and what is coming in
+ * is larger than our buffer
+ */
+ if (this->buf_pos + buf->size > this->buf_size)
+ {
+ this->buf_size += 2 * buf->size;
+ this->buf = realloc (this->buf, this->buf_size);
+ lprintf("reallocating buffer to %zd\n", this->buf_size);
+ }
+
+ xine_fast_memcpy (&this->buf[this->buf_pos], buf->content, buf->size);
+ this->buf_pos += buf->size;
+
+ if ( buf->decoder_flags & BUF_FLAG_FRAME_END ) {
+ static WavpackStreamReader wavpack_buffer_reader = {
+ .read_bytes = xine_buffer_read_bytes,
+ .get_pos = xine_buffer_get_pos,
+ .set_pos_abs = xine_buffer_set_pos_abs,
+ .set_pos_rel = xine_buffer_set_pos_rel,
+ .push_back_byte = xine_buffer_push_back_byte,
+ .get_length = xine_buffer_get_length,
+ .can_seek = xine_buffer_can_seek,
+ .write_bytes = xine_buffer_write_bytes
+ };
+
+ WavpackContext *ctx = NULL;
+ /* Current version of wavpack (4.40) does not write more than this */
+ char error[256] = { 0, };
+ int32_t samples_left; uint32_t samples_total;
+ const wvheader_t *header = (const wvheader_t*)this->buf;
+
+ this->buf_pos = 0;
+
+ if ( le2me_32(header->samples_count) == 0 ) return;
+
+ ctx = WavpackOpenFileInputEx(&wavpack_buffer_reader, this, NULL, error, OPEN_STREAMING, 0);
+ if ( ! ctx ) {
+ lprintf("unable to open the stream: %s\n", error);
+ this->buf_pos = 0;
+ return;
+ }
+
+ samples_left = samples_total = header->samples_count;
+ while ( samples_left > 0 ) {
+ uint32_t buf_samples, decoded_count;
+ audio_buffer_t *audio_buffer = this->stream->audio_out->get_buffer(this->stream->audio_out);
+ int32_t *decoded;
+ int i;
+
+ buf_samples = audio_buffer->mem_size / (this->channels * (this->bits_per_sample/8));
+ if ( buf_samples > samples_left ) buf_samples = samples_left;
+
+ decoded = alloca(buf_samples * this->channels * sizeof(int32_t));
+
+ decoded_count = WavpackUnpackSamples(ctx, decoded, buf_samples);
+ if ( decoded_count == 0 && *error ) {
+ lprintf("Error during decode: %s\n", error);
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, NULL);
+ break;
+ }
+
+ if ( decoded_count == 0 ) {
+ lprintf("Finished decoding, but still %d samples left?\n", samples_left);
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, NULL);
+ break;
+ }
+
+ lprintf("Decoded %d samples\n", buf_samples);
+
+ samples_left -= decoded_count;
+
+ audio_buffer->num_frames = decoded_count;
+ audio_buffer->vpts = 0; /* TODO: Fix the pts calculation */
+ // audio_buffer->vpts = (buf->pts * (samples_total-samples_left)) / samples_total;
+ lprintf("Audio buffer with pts %"PRId64"\n", audio_buffer->vpts);
+
+ switch(this->bits_per_sample) {
+ case 8: {
+ int8_t *data8 = (int8_t*)audio_buffer->mem;
+ for(i = 0; i < decoded_count*this->channels; i++)
+ data8[i] = decoded[i];
+ }
+ break;
+ case 16: {
+ int16_t *data16 = (int16_t*)audio_buffer->mem;
+ for(i = 0; i < decoded_count*this->channels; i++)
+ data16[i] = decoded[i];
+ }
+ }
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+ }
+
+ WavpackCloseFile(ctx);
+ this->buf_pos = 0;
+ }
+ }
+}
+
+static void wavpack_dispose (audio_decoder_t *this_gen) {
+ wavpack_decoder_t *this = (wavpack_decoder_t *) this_gen;
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+ free(this->buf);
+
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
+ wavpack_decoder_t * const this = calloc(1, sizeof (wavpack_decoder_t));
+
+ this->audio_decoder.decode_data = wavpack_decode_data;
+ this->audio_decoder.reset = wavpack_reset;
+ this->audio_decoder.discontinuity = wavpack_discontinuity;
+ this->audio_decoder.dispose = wavpack_dispose;
+ this->stream = stream;
+
+ this->buf = NULL;
+ this->buf_size = 0;
+
+ return (audio_decoder_t *) this;
+}
+
+/*
+ * wavpack plugin class
+ */
+
+void *decoder_wavpack_init_plugin (xine_t *xine, void *data) {
+ wavpack_class_t *this;
+
+ this = calloc(1, sizeof (wavpack_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "wavpackdec";
+ this->decoder_class.description = N_("wavpack audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
diff --git a/src/combined/wavpack_demuxer.c b/src/combined/wavpack_demuxer.c
new file mode 100644
index 000000000..a4cec9e56
--- /dev/null
+++ b/src/combined/wavpack_demuxer.c
@@ -0,0 +1,376 @@
+/*
+ * Copyright (C) 2006-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, USA
+ *
+ * xine interface to libwavpack by Diego Pettenò <flameeyes@gmail.com>
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#define LOG_MODULE "demux_wavpack"
+#define LOG_VERBOSE
+#define LOG
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include "bswap.h"
+#include <xine/attributes.h>
+
+#include <wavpack/wavpack.h>
+#include "wavpack_combined.h"
+
+typedef struct {
+ demux_plugin_t demux_plugin;
+
+ xine_stream_t *stream;
+ fifo_buffer_t *audio_fifo;
+ input_plugin_t *input;
+ int status;
+
+ uint32_t current_sample;
+ uint32_t samples;
+ uint32_t samplerate;
+ uint16_t bits_per_sample:6;
+ uint16_t channels:4;
+} demux_wv_t;
+
+typedef struct {
+ demux_class_t demux_class;
+} demux_wv_class_t;
+
+static int32_t xine_input_read_bytes(void *const this_gen, void *const data,
+ const int32_t bcount) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ return this->read(this, data, bcount);
+}
+
+static uint32_t xine_input_get_pos(void *const this_gen) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ return this->get_current_pos(this);
+}
+
+static int xine_input_set_pos_abs(void *const this_gen, const uint32_t pos) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ return this->seek(this, pos, SEEK_SET);
+}
+
+static int xine_input_set_pos_rel(void *const this_gen, const int32_t delta,
+ const int mode) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ return this->seek(this, delta, mode);
+}
+
+static int xine_input_push_back_byte(void *const this_gen, const int c) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ if ( this->seek(this, -1, SEEK_CUR) ) {
+ return c;
+ } else {
+ lprintf("xine_input_push_back_byte: unable to seek.\n");
+ return EOF;
+ }
+}
+
+static uint32_t xine_input_get_length(void *const this_gen) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ return this->get_length(this);
+}
+
+static int xine_input_can_seek(void *const this_gen) {
+ input_plugin_t *const this = (input_plugin_t*)this_gen;
+ return INPUT_IS_SEEKABLE(this);
+}
+
+static int32_t xine_input_write_bytes(__attr_unused void *const id,
+ __attr_unused void *const data,
+ __attr_unused const int32_t bcount) {
+ lprintf("xine_input_write_bytes: acces is read-only.\n");
+ return 0;
+}
+
+static WavpackStreamReader wavpack_input_reader = {
+ .read_bytes = xine_input_read_bytes,
+ .get_pos = xine_input_get_pos,
+ .set_pos_abs = xine_input_set_pos_abs,
+ .set_pos_rel = xine_input_set_pos_rel,
+ .push_back_byte = xine_input_push_back_byte,
+ .get_length = xine_input_get_length,
+ .can_seek = xine_input_can_seek,
+ .write_bytes = xine_input_write_bytes
+};
+
+static int open_wv_file(demux_wv_t *const this) {
+ WavpackContext *ctx = NULL;
+ char error[256]; /* Current version of wavpack (4.31) does not write more than this */
+ wvheader_t header;
+ uint32_t tmp;
+
+ /* Right now we don't support non-seekable streams */
+ if (! INPUT_IS_SEEKABLE(this->input) ) {
+ lprintf("open_wv_file: non-seekable inputs aren't supported yet.\n");
+ return 0;
+ }
+
+ /* Read the file header */
+ if (_x_demux_read_header(this->input, (uint8_t*)(&header), sizeof(wvheader_t)) != sizeof(wvheader_t))
+ return 0;
+
+ /* Validate header, we currently support only Wavpack 4 */
+ if ( header.idcode != wvpk_signature || (le2me_16(header.wv_version) >> 8) != 4 )
+ return 0;
+
+ /* Rewind */
+ this->input->seek(this->input, 0, SEEK_SET);
+
+ ctx = WavpackOpenFileInputEx(&wavpack_input_reader, this->input, NULL, error, 0, 0);
+ if ( ! ctx ) {
+ lprintf("xine_open_wavpack_input: unable to open the stream: %s\n", error);
+ return 0;
+ }
+
+ this->current_sample = 0;
+ this->samples = WavpackGetNumSamples(ctx);
+ lprintf("number of samples: %u\n", this->samples);
+ this->samplerate = WavpackGetSampleRate(ctx);
+ lprintf("samplerate: %u Hz\n", this->samplerate);
+
+ tmp = WavpackGetBitsPerSample(ctx); _x_assert(tmp <= 32);
+ lprintf("bits_per_sample: %u\n", tmp);
+ this->bits_per_sample = tmp;
+
+ tmp = WavpackGetNumChannels(ctx); _x_assert(tmp <= 8);
+ lprintf("channels: %u\n", tmp);
+ this->channels = tmp;
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC,
+ wvpk_signature);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS,
+ this->channels);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE,
+ this->samplerate);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS,
+ this->bits_per_sample);
+
+ WavpackCloseFile(ctx);
+ this->input->seek(this->input, SEEK_SET, 0);
+
+ return 1;
+}
+
+static int demux_wv_send_chunk(demux_plugin_t *const this_gen) {
+ demux_wv_t *const this = (demux_wv_t *) this_gen;
+ uint32_t bytes_to_read; uint8_t header_sent = 0;
+ wvheader_t header;
+
+ lprintf("new frame\n");
+
+ /* Check if we've finished */
+ if (this->current_sample >= this->samples) {
+ lprintf("all frames read\n");
+ this->status = DEMUX_FINISHED;
+ return this->status;
+ }
+
+ lprintf("current sample: %u\n", this->current_sample);
+
+ do {
+ if ( this->input->read(this->input, (uint8_t*)(&header), sizeof(wvheader_t)) != sizeof(wvheader_t) ) {
+ this->status = DEMUX_FINISHED;
+ return this->status;
+ }
+
+ /* The size of the block is «of course» minus 8, and
+ it also includes the size of the header.
+ */
+ bytes_to_read = le2me_32(header.block_size) + 8 - sizeof(wvheader_t);
+
+ lprintf("demux_wavpack: going to read %u bytes.\n", bytes_to_read);
+
+ while(bytes_to_read) {
+ off_t bytes_read = 0, bytes_to_read_now, offset = 0;
+ buf_element_t *buf = NULL;
+ int64_t input_time_guess;
+
+ /* Get a buffer */
+ buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo);
+ buf->type = BUF_AUDIO_WAVPACK;
+ buf->decoder_flags = 0;
+
+ /* Set normalised position */
+ buf->extra_info->input_normpos =
+ (int) ((double) this->input->get_current_pos(this->input) * 65535 /
+ this->input->get_length(this->input));
+
+ buf->pts = (((this->current_sample) / this->samplerate))*90000;
+ lprintf("Sending buffer with PTS %"PRId64"\n", buf->pts);
+
+ /* Set time */
+ input_time_guess = this->samples;
+ input_time_guess /= this->samplerate;
+ input_time_guess *= 1000;
+ input_time_guess *= buf->extra_info->input_normpos;
+ input_time_guess /= 65535;
+ buf->extra_info->input_time = input_time_guess;
+
+ if ( ! header_sent )
+ offset = sizeof(wvheader_t);
+
+ bytes_to_read_now = ( bytes_to_read+offset > buf->max_size ) ? buf->max_size-offset : bytes_to_read;
+ if ( ! header_sent ) {
+ header_sent = 1;
+ xine_fast_memcpy(buf->content, &header, sizeof(wvheader_t));
+ }
+
+ bytes_read = this->input->read(this->input, &buf->content[offset], bytes_to_read_now);
+
+ buf->size = offset + bytes_read;
+
+ bytes_to_read -= bytes_read;
+
+ if ( bytes_to_read <= 0 && (le2me_32(header.flags) & FINAL_BLOCK) == FINAL_BLOCK)
+ buf->decoder_flags |= BUF_FLAG_FRAME_END;
+
+ this->audio_fifo->put(this->audio_fifo, buf);
+ }
+ } while ( (le2me_32(header.flags) & FINAL_BLOCK) != FINAL_BLOCK );
+
+ this->current_sample += le2me_32(header.samples_count);
+
+ return this->status;
+}
+
+static void demux_wv_send_headers(demux_plugin_t *const this_gen) {
+ demux_wv_t *const this = (demux_wv_t *) this_gen;
+ buf_element_t *buf;
+
+ this->audio_fifo = this->stream->audio_fifo;
+
+ this->status = DEMUX_OK;
+
+ /* Send start buffers */
+ _x_demux_control_start(this->stream);
+
+ /* Send header to decoder */
+ if (this->audio_fifo) {
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+
+ buf->type = BUF_AUDIO_WAVPACK;
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
+ buf->decoder_info[0] = this->input->get_length(this->input);
+ buf->decoder_info[1] = this->samplerate;
+ buf->decoder_info[2] = this->bits_per_sample;
+ buf->decoder_info[3] = this->channels;
+
+ buf->size = 0;
+
+ this->audio_fifo->put (this->audio_fifo, buf);
+ }
+}
+
+static int demux_wv_seek (demux_plugin_t *this_gen,
+ off_t start_pos, int start_time, int playing) {
+ demux_wv_t *const this = (demux_wv_t *) this_gen;
+
+ /* If thread is not running, initialize demuxer */
+ if( !playing ) {
+
+ /* send new pts */
+ _x_demux_control_newpts(this->stream, 0, 0);
+
+ this->status = DEMUX_OK;
+
+ }
+
+ return this->status;
+}
+
+static int demux_wv_get_status (demux_plugin_t *const this_gen) {
+ const demux_wv_t *const this = (const demux_wv_t *) this_gen;
+
+ return this->status;
+}
+
+static int demux_wv_get_stream_length (demux_plugin_t *const this_gen) {
+ const demux_wv_t *const this = (demux_wv_t *) this_gen;
+
+ return (this->samples*1000) / this->samplerate;
+}
+
+static uint32_t demux_wv_get_capabilities(demux_plugin_t *const this_gen) {
+ return DEMUX_CAP_NOCAP;
+}
+
+static int demux_wv_get_optional_data(demux_plugin_t *const this_gen,
+ void *data, const int data_type) {
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+}
+
+static demux_plugin_t *open_plugin (demux_class_t *const class_gen,
+ xine_stream_t *const stream,
+ input_plugin_t *const input) {
+ demux_wv_t *const this = calloc(1, sizeof (demux_wv_t));
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_wv_send_headers;
+ this->demux_plugin.send_chunk = demux_wv_send_chunk;
+ this->demux_plugin.seek = demux_wv_seek;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
+ this->demux_plugin.get_status = demux_wv_get_status;
+ this->demux_plugin.get_stream_length = demux_wv_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_wv_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_wv_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->status = DEMUX_FINISHED;
+ switch (stream->content_detection_method) {
+
+ case METHOD_BY_MRL:
+ case METHOD_BY_CONTENT:
+ case METHOD_EXPLICIT:
+
+ if (!open_wv_file(this)) {
+ free (this);
+ return NULL;
+ }
+
+ break;
+
+ default:
+ free (this);
+ return NULL;
+ }
+
+ return &this->demux_plugin;
+}
+
+void *demux_wv_init_plugin (xine_t *const xine, void *const data) {
+ demux_wv_class_t *const this = calloc(1, sizeof (demux_wv_class_t));
+
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("Wavpack demux plugin");
+ this->demux_class.identifier = "Wavpack";
+ this->demux_class.mimetypes = "audio/x-wavpack: wv,wvp: WavPack audio;";
+ this->demux_class.extensions = "wv wvp";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
diff --git a/src/combined/xine_ogg_demuxer.c b/src/combined/xine_ogg_demuxer.c
new file mode 100644
index 000000000..d8fae78f7
--- /dev/null
+++ b/src/combined/xine_ogg_demuxer.c
@@ -0,0 +1,2260 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/*
+ * demultiplexer for ogg streams
+ */
+/* 2003.02.09 (dilb) update of the handling for audio/video infos for strongarm cpus. */
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include <ogg/ogg.h>
+
+#ifdef HAVE_VORBIS
+#include <vorbis/codec.h>
+#endif
+
+#ifdef HAVE_SPEEX
+#include <speex/speex.h>
+#include <speex/speex_header.h>
+#include <speex/speex_stereo.h>
+#include <speex/speex_callbacks.h>
+#endif
+
+#ifdef HAVE_THEORA
+#include <theora/theora.h>
+#endif
+
+#define LOG_MODULE "demux_ogg"
+#define LOG_VERBOSE
+
+/*
+#define LOG
+*/
+
+#define DEBUG_PACKETS 0
+#define DEBUG_PREVIEWS 0
+#define DEBUG_PTS 0
+#define DEBUG_VIDEO_PACKETS 0
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include "bswap.h"
+#include "flacutils.h"
+
+#define CHUNKSIZE 8500
+#define PACKET_TYPE_HEADER 0x01
+#define PACKET_TYPE_COMMENT 0x03
+#define PACKET_TYPE_CODEBOOK 0x05
+#define PACKET_TYPE_BITS 0x07
+#define PACKET_LEN_BITS01 0xc0
+#define PACKET_LEN_BITS2 0x02
+#define PACKET_IS_SYNCPOINT 0x08
+
+#define MAX_STREAMS 32
+
+#define PTS_AUDIO 0
+#define PTS_VIDEO 1
+
+#define WRAP_THRESHOLD 900000
+
+#define SUB_BUFSIZE 1024
+
+typedef struct chapter_entry_s {
+ int64_t start_pts;
+ char *name;
+} chapter_entry_t;
+
+typedef struct chapter_info_s {
+ int current_chapter;
+ int max_chapter;
+ chapter_entry_t *entries;
+} chapter_info_t;
+
+typedef struct stream_info_s {
+ ogg_stream_state oss;
+ uint32_t buf_types;
+ int headers;
+ int64_t header_granulepos;
+ int64_t factor;
+ int64_t quotient;
+ int resync;
+ char *language;
+ /* CMML, Ogg Skeleton stream information */
+ int granuleshift;
+ /* Annodex v2 stream information */
+ int hide_first_header;
+ int delivered_bos;
+ int delivered_eos;
+} stream_info_t;
+
+typedef struct demux_ogg_s {
+ demux_plugin_t demux_plugin;
+
+ xine_stream_t *stream;
+ fifo_buffer_t *audio_fifo;
+ fifo_buffer_t *video_fifo;
+ input_plugin_t *input;
+ int status;
+
+ int frame_duration;
+
+#ifdef HAVE_THEORA
+ theora_info t_info;
+ theora_comment t_comment;
+#endif
+
+ ogg_sync_state oy;
+ ogg_page og;
+
+ int64_t start_pts;
+ int64_t last_pts[2];
+
+ int time_length;
+
+ int num_streams;
+ stream_info_t *si[MAX_STREAMS]; /* stream info */
+
+ int num_audio_streams;
+ int num_video_streams;
+ int unhandled_video_streams;
+ int num_spu_streams;
+
+ off_t avg_bitrate;
+
+ char *meta[XINE_STREAM_INFO_MAX];
+ chapter_info_t *chapter_info;
+ xine_event_queue_t *event_queue;
+
+ uint8_t send_newpts:1;
+ uint8_t buf_flag_seek:1;
+ uint8_t keyframe_needed:1;
+ uint8_t ignore_keyframes:1;
+} demux_ogg_t ;
+
+typedef struct {
+ demux_class_t demux_class;
+} demux_ogg_class_t;
+
+typedef struct {
+ demux_class_t demux_class;
+} demux_anx_class_t;
+
+
+#ifdef HAVE_THEORA
+static int intlog(int num) {
+ int ret=0;
+
+ while(num>0){
+ num=num/2;
+ ret=ret+1;
+ }
+ return(ret);
+}
+#endif
+
+static int get_stream (demux_ogg_t *this, int serno) {
+ /*finds the stream_num, which belongs to a ogg serno*/
+ int i;
+
+ for (i = 0; i<this->num_streams; i++) {
+ if (this->si[i]->oss.serialno == serno) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+static int new_stream_info (demux_ogg_t *this, const int cur_serno) {
+ int stream_num;
+
+ this->si[this->num_streams] = (stream_info_t *)calloc(1, sizeof(stream_info_t));
+ ogg_stream_init(&this->si[this->num_streams]->oss, cur_serno);
+ stream_num = this->num_streams;
+ this->si[stream_num]->buf_types = 0;
+ this->si[stream_num]->header_granulepos = -1;
+ this->si[stream_num]->headers = 0;
+ this->num_streams++;
+
+ return stream_num;
+}
+
+static int64_t get_pts (demux_ogg_t *this, int stream_num , int64_t granulepos ) {
+ /*calculates an pts from an granulepos*/
+ if (granulepos<0) {
+ if ( this->si[stream_num]->header_granulepos>=0 ) {
+ /*return the smallest valid pts*/
+ return 1;
+ } else
+ return 0;
+ } else if (this->si[stream_num]->buf_types == BUF_VIDEO_THEORA ||
+ (this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_SPU_CMML) {
+ int64_t iframe, pframe;
+ int granuleshift;
+ granuleshift = this->si[stream_num]->granuleshift;
+ iframe = granulepos >> granuleshift;
+ pframe = granulepos - (iframe << granuleshift);
+ if (this->si[stream_num]->quotient)
+ return 1+((iframe+pframe) * this->si[stream_num]->factor / this->si[stream_num]->quotient);
+ else
+ return 0;
+ } else if (this->si[stream_num]->quotient)
+ return 1+(granulepos * this->si[stream_num]->factor / this->si[stream_num]->quotient);
+ else
+ return 0;
+}
+
+static int read_ogg_packet (demux_ogg_t *this) {
+ char *buffer;
+ long bytes;
+ long total = 0;
+ while (ogg_sync_pageout(&this->oy,&this->og)!=1) {
+ buffer = ogg_sync_buffer(&this->oy, CHUNKSIZE);
+ bytes = this->input->read(this->input, buffer, CHUNKSIZE);
+ if (bytes <= 0) {
+ if (total == 0) {
+ lprintf("read_ogg_packet read nothing\n");
+ return 0;
+ }
+ break;
+ }
+ ogg_sync_wrote(&this->oy, bytes);
+ total += bytes;
+ }
+ return 1;
+}
+
+static void get_stream_length (demux_ogg_t *this) {
+ /*determine the streamlenght and set this->time_length accordingly.
+ ATTENTION:current_pos and oggbuffers will be destroyed by this function,
+ there will be no way to continue playback uninterrupted.
+
+ You have to seek afterwards, because after get_stream_length, the
+ current_position is at the end of the file */
+
+ off_t filelength;
+ int done=0;
+ int stream_num;
+
+ this->time_length=-1;
+
+ if (this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) {
+ filelength=this->input->get_length(this->input);
+
+ if (filelength!=-1) {
+ if (filelength>70000) {
+ this->demux_plugin.seek(&this->demux_plugin,
+ (off_t) ( (double)(filelength-65536)/filelength*65535), 0, 0);
+ }
+ done=0;
+ while (!done) {
+ if (!read_ogg_packet (this)) {
+ if (this->time_length) {
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_BITRATE,
+ ((int64_t) 8000*filelength)/this->time_length);
+ /*this is a fine place to compute avg_bitrate*/
+ this->avg_bitrate= 8000*filelength/this->time_length;
+ }
+ return;
+ }
+ stream_num=get_stream(this, ogg_page_serialno (&this->og) );
+ if (stream_num!=-1) {
+ if (this->time_length < (get_pts(this, stream_num, ogg_page_granulepos(&this->og) / 90)))
+ this->time_length = get_pts(this, stream_num, ogg_page_granulepos(&this->og)) / 90;
+ }
+ }
+ }
+ }
+}
+
+#ifdef HAVE_THEORA
+static void send_ogg_packet (demux_ogg_t *this,
+ fifo_buffer_t *fifo,
+ ogg_packet *op,
+ int64_t pts,
+ uint32_t decoder_flags,
+ int stream_num) {
+
+ buf_element_t *buf;
+
+ int done=0,todo=op->bytes;
+ const size_t op_size = sizeof(ogg_packet);
+
+ while (done<todo) {
+ size_t offset=0;
+ buf = fifo->buffer_pool_alloc (fifo);
+ buf->decoder_flags = decoder_flags;
+ if (done==0) {
+ memcpy (buf->content, op, op_size);
+ offset=op_size;
+ buf->decoder_flags = buf->decoder_flags | BUF_FLAG_FRAME_START;
+ }
+
+ if (done+buf->max_size-offset < todo) {
+ memcpy (buf->content+offset, op->packet+done, buf->max_size-offset);
+ buf->size = buf->max_size;
+ done=done+buf->max_size-offset;
+ } else {
+ memcpy (buf->content+offset , op->packet+done, todo-done);
+ buf->size = todo-done+offset;
+ done=todo;
+ buf->decoder_flags = buf->decoder_flags | BUF_FLAG_FRAME_END;
+ }
+
+ buf->pts = pts;
+ if( this->input->get_length (this->input) )
+ buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
+ 65535 / this->input->get_length (this->input) );
+ buf->extra_info->input_time = buf->pts / 90 ;
+ buf->type = this->si[stream_num]->buf_types;
+
+ fifo->put (fifo, buf);
+ }
+}
+#endif
+
+/* redefine abs as macro to handle 64-bit diffs.
+ i guess llabs may not be available everywhere */
+#define abs(x) ( ((x)<0) ? -(x) : (x) )
+
+static void check_newpts (demux_ogg_t *this, int64_t pts, int video, int preview) {
+ int64_t diff;
+
+ llprintf(DEBUG_PTS, "new pts %" PRId64 " found in stream\n",pts);
+
+ diff = pts - this->last_pts[video];
+
+ if (!preview && (pts>=0) &&
+ (this->send_newpts || (this->last_pts[video] && abs(diff)>WRAP_THRESHOLD) ) ) {
+
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "diff=%" PRId64 " (pts=%" PRId64 ", last_pts=%" PRId64 ")\n", diff, pts, this->last_pts[video]);
+
+ if (this->buf_flag_seek) {
+ _x_demux_control_newpts(this->stream, pts, BUF_FLAG_SEEK);
+ this->buf_flag_seek = 0;
+ } else {
+ _x_demux_control_newpts(this->stream, pts, 0);
+ }
+ this->send_newpts = 0;
+ this->last_pts[1-video] = 0;
+ }
+
+ if (!preview && (pts>=0) )
+ this->last_pts[video] = pts;
+
+ /* use pts for bitrate measurement */
+
+ /*compute avg_bitrate if time_length isn't set*/
+ if ((pts>180000) && !(this->time_length)) {
+ this->avg_bitrate = this->input->get_current_pos (this->input) * 8 * 90000/ pts;
+
+ if (this->avg_bitrate<1)
+ this->avg_bitrate = 1;
+
+ }
+}
+
+static void ogg_handle_event (demux_ogg_t *this) {
+ xine_event_t *event;
+
+ while ((event = xine_event_get(this->event_queue))) {
+ switch(event->type) {
+ case XINE_EVENT_INPUT_NEXT:
+ {
+ if (this->chapter_info) {
+ int c_chap = this->chapter_info->current_chapter;
+ if (c_chap+1 < this->chapter_info->max_chapter) {
+ int start_time = this->chapter_info->entries[c_chap+1].start_pts / 90;
+ this->demux_plugin.seek((demux_plugin_t *)this, 0, start_time, 1);
+ }
+ }
+ }
+ break;
+ case XINE_EVENT_INPUT_PREVIOUS:
+ {
+ if (this->chapter_info) {
+ int c_chap = this->chapter_info->current_chapter;
+ if (c_chap >= 1) {
+ int start_time = this->chapter_info->entries[c_chap-1].start_pts / 90;
+ this->demux_plugin.seek((demux_plugin_t *)this, 0, start_time, 1);
+ }
+ }
+ }
+ break;
+ }
+ xine_event_free(event);
+ }
+ return;
+}
+
+
+#define OGG_META(TAG,APPEND) { #TAG"=", XINE_META_INFO_##TAG, APPEND }
+#define OGG_META_L(TAG,APPEND,META) { #TAG"=", XINE_META_INFO_##META, APPEND }
+static const struct ogg_meta {
+ char tag[16];
+ int meta;
+ int append;
+} metadata[] = {
+ OGG_META (ALBUM, 0),
+ OGG_META (ARTIST, 0),
+ OGG_META (PUBLISHER, 0),
+ OGG_META (COPYRIGHT, 0),
+ OGG_META (DISCNUMBER, 0),
+ OGG_META (LICENSE, 0),
+ OGG_META (TITLE, 0),
+ OGG_META_L (TRACKNUMBER, 0, TRACK_NUMBER),
+ OGG_META (COMPOSER, 1),
+ OGG_META (ARRANGER, 1),
+ OGG_META (LYRICIST, 1),
+ OGG_META (AUTHOR, 1),
+ OGG_META (CONDUCTOR, 1),
+ OGG_META (PERFORMER, 1),
+ OGG_META (ENSEMBLE, 1),
+ OGG_META (OPUS, 0),
+ OGG_META (PART, 0),
+ OGG_META (PARTNUMBER, 0),
+ OGG_META (GENRE, 1),
+ OGG_META_L (DATE, 1, YEAR), /* hmm... */
+ OGG_META (LOCATION, 0),
+ OGG_META (COMMENT, 0),
+};
+
+#if 0
+/* ensure that those marked "append" are cleared */
+/* FIXME: is this useful? Should they be cleared on first write? */
+static void prepare_read_comments (demux_ogg_t *this)
+{
+ int i;
+
+ for (i = 0; i < sizeof (metadata) / sizeof (struct ogg_meta); ++i)
+ if (metadata[i].append) {
+ free (this->meta[metadata[i].meta]);
+ this->meta[metadata[i].meta] = NULL;
+ }
+}
+#endif
+
+static int read_comments (demux_ogg_t *this, const char *comment)
+{
+ int i;
+
+ for (i = 0; i < sizeof (metadata) / sizeof (struct ogg_meta); ++i) {
+ size_t ml = strlen (metadata[i].tag);
+ if (!strncasecmp (metadata[i].tag, comment, ml) && comment[ml]) {
+ if (metadata[i].append && this->meta[metadata[i].meta]) {
+ char *newstr;
+ if (asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml) >= 0) {
+ free (this->meta[metadata[i].meta]);
+ this->meta[metadata[i].meta] = newstr;
+ }
+ }
+ else {
+ free (this->meta[metadata[i].meta]);
+ this->meta[metadata[i].meta] = strdup (comment + ml);
+ }
+ _x_meta_info_set_utf8(this->stream, metadata[i].meta, this->meta[metadata[i].meta]);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+ * utility function to read a LANGUAGE= line from the user_comments,
+ * to label audio and spu streams
+ * utility function to read CHAPTER*=, TITLE= etc. from the user_comments,
+ * to name (parts of) the stream
+ */
+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;
+ vorbis_info vi;
+
+ vorbis_comment_init(&vc);
+ vorbis_info_init(&vi);
+
+ /* this is necessary to make libvorbis accept this vorbis_info*/
+ vi.rate=1;
+
+ if ( vorbis_synthesis_headerin(&vi, &vc, op) >= 0) {
+ ptr=vc.user_comments;
+ while(*ptr) {
+ comment=*ptr++;
+ if ( !strncasecmp ("LANGUAGE=", comment, 9) ) {
+ this->si[stream_num]->language = strdup (comment + strlen ("LANGUAGE=") );
+ }
+ else
+ read_comments (this, comment);
+ }
+ }
+ vorbis_comment_clear(&vc);
+ vorbis_info_clear(&vi);
+#endif
+}
+
+/*
+ * utility function to read CHAPTER*= from the user_comments,
+ * to name parts of the stream
+ */
+static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) {
+#ifdef HAVE_VORBIS
+ char **ptr;
+ char *comment;
+ vorbis_comment vc;
+ vorbis_info vi;
+
+ vorbis_comment_init(&vc);
+ vorbis_info_init(&vi);
+
+ /* this is necessary to make libvorbis accept this vorbis_info*/
+ vi.rate=1;
+
+ if ( vorbis_synthesis_headerin(&vi, &vc, op) >= 0) {
+ char *chapter_time = 0;
+ char *chapter_name = 0;
+ int chapter_no = 0;
+
+ ptr=vc.user_comments;
+
+ while(*ptr) {
+ comment=*ptr++;
+ if (read_comments (this, comment))
+ continue;
+
+ if ( !chapter_time && strlen(comment) == 22 &&
+ !strncasecmp ("CHAPTER" , comment, 7) &&
+ isdigit(*(comment+7)) && isdigit(*(comment+8)) &&
+ (*(comment+9) == '=')) {
+
+ chapter_time = strdup(comment+10);
+ chapter_no = strtol(comment+7, NULL, 10);
+ }
+ if ( !chapter_name && !strncasecmp("CHAPTER", comment, 7) &&
+ isdigit(*(comment+7)) && isdigit(*(comment+8)) &&
+ !strncasecmp ("NAME=", comment+9, 5)) {
+
+ if (strtol(comment+7,NULL,10) == chapter_no) {
+ chapter_name = strdup(comment+14);
+ }
+ }
+ if (chapter_time && chapter_name && chapter_no){
+ int hour, min, sec, msec;
+
+ lprintf("create chapter entry: no=%d name=%s time=%s\n", chapter_no, chapter_name, chapter_time);
+ hour= strtol(chapter_time, NULL, 10);
+ min = strtol(chapter_time+3, NULL, 10);
+ sec = strtol(chapter_time+6, NULL, 10);
+ msec = strtol(chapter_time+9, NULL, 10);
+ lprintf("time: %d %d %d %d\n", hour, min,sec,msec);
+
+ if (!this->chapter_info) {
+ this->chapter_info = (chapter_info_t *)calloc(1, sizeof(chapter_info_t));
+ this->chapter_info->current_chapter = -1;
+ }
+ this->chapter_info->max_chapter = chapter_no;
+ this->chapter_info->entries = realloc( this->chapter_info->entries, chapter_no*sizeof(chapter_entry_t));
+ this->chapter_info->entries[chapter_no-1].name = chapter_name;
+ this->chapter_info->entries[chapter_no-1].start_pts = (msec + (1000.0 * sec) + (60000.0 * min) + (3600000.0 * hour))*90;
+
+ free (chapter_time);
+ chapter_no = 0;
+ chapter_time = chapter_name = 0;
+ }
+ }
+ }
+ vorbis_comment_clear(&vc);
+ vorbis_info_clear(&vi);
+#endif
+}
+
+/*
+ * update the display of the title, if needed
+ */
+static void update_chapter_display (demux_ogg_t *this, int stream_num, ogg_packet *op) {
+ int chapter = 0;
+ int64_t pts = get_pts(this, stream_num, op->granulepos );
+
+ while (chapter < this->chapter_info->max_chapter &&
+ this->chapter_info->entries[chapter].start_pts < pts) {
+ chapter++;
+ }
+ chapter--;
+
+ if (chapter != this->chapter_info->current_chapter){
+ xine_ui_data_t data = {
+ .str = { 0, },
+ .str_len = 0
+ };
+ xine_event_t uevent = {
+ .type = XINE_EVENT_UI_SET_TITLE,
+ .stream = this->stream,
+ .data = &data,
+ .data_length = sizeof(data)
+ };
+
+ this->chapter_info->current_chapter = chapter;
+
+ if (chapter >= 0) {
+ if (this->meta[XINE_META_INFO_TITLE]) {
+ data.str_len = snprintf(data.str, sizeof(data.str), "%s / %s", this->meta[XINE_META_INFO_TITLE], this->chapter_info->entries[chapter].name);
+ } else {
+ strncpy(data.str, this->chapter_info->entries[chapter].name, sizeof(data.str)-1);
+ }
+ } else {
+ strncpy(data.str, this->meta[XINE_META_INFO_TITLE], sizeof(data.str));
+ }
+ if ( data.str_len == 0 )
+ data.str_len = strlen(data.str);
+
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, data.str);
+ lprintf("new TITLE: %s\n", data.str);
+
+ xine_event_send(this->stream, &uevent);
+ }
+}
+
+/*
+ * utility function to pack one ogg_packet into a xine
+ * buffer, fill out all needed fields
+ * and send it to the right fifo
+ */
+
+static void send_ogg_buf (demux_ogg_t *this,
+ ogg_packet *op,
+ int stream_num,
+ uint32_t decoder_flags) {
+
+ int hdrlen;
+ int normpos = 0;
+
+ if( this->input->get_length (this->input) )
+ normpos = (int)( (double) this->input->get_current_pos (this->input) *
+ 65535 / this->input->get_length (this->input) );
+
+
+ hdrlen = (*op->packet & PACKET_LEN_BITS01) >> 6;
+ hdrlen |= (*op->packet & PACKET_LEN_BITS2) << 1;
+
+ /* for Annodex files: the first packet after the AnxData info packet needs
+ * to have its BOS flag set: we set it here */
+ if (!this->si[stream_num]->delivered_bos) {
+ op->b_o_s = 1;
+ this->si[stream_num]->delivered_bos = 1;
+ }
+
+ if ( this->audio_fifo
+ && (this->si[stream_num]->buf_types & 0xFF000000) == BUF_AUDIO_BASE) {
+ uint8_t *data;
+ int size;
+ int64_t pts;
+
+ if (op->packet[0] == PACKET_TYPE_COMMENT ) {
+ read_language_comment(this, op, stream_num);
+ }
+
+ if ((this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_AUDIO_SPEEX ||
+ (this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_AUDIO_FLAC ||
+ (this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_AUDIO_VORBIS) {
+ data = op->packet;
+ size = op->bytes;
+ } else {
+ data = op->packet+1+hdrlen;
+ size = op->bytes-1-hdrlen;
+ }
+ llprintf(DEBUG_PACKETS, "audio data size %d\n", size);
+
+ if ((op->granulepos != -1) || (this->si[stream_num]->header_granulepos != -1)) {
+ pts = get_pts(this, stream_num, op->granulepos );
+ check_newpts( this, pts, PTS_AUDIO, decoder_flags );
+ } else
+ pts = 0;
+
+ llprintf(DEBUG_PACKETS,
+ "audiostream %d op-gpos %" PRId64 " hdr-gpos %" PRId64 " pts %" PRId64 " \n",
+ stream_num,
+ op->granulepos,
+ this->si[stream_num]->header_granulepos,
+ pts);
+
+ _x_demux_send_data(this->audio_fifo, data, size,
+ pts, this->si[stream_num]->buf_types, decoder_flags,
+ normpos,
+ pts / 90, this->time_length, 0);
+
+#ifdef HAVE_THEORA
+ } else if ((this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_VIDEO_THEORA) {
+
+ int64_t pts;
+ theora_info t_info;
+ theora_comment t_comment;
+
+ theora_info_init (&t_info);
+ theora_comment_init (&t_comment);
+
+ /*Lets see if this is an Header*/
+ if ((theora_decode_header(&t_info, &t_comment, op))>=0) {
+ decoder_flags=decoder_flags|BUF_FLAG_HEADER;
+ lprintf ("found an header\n");
+ }
+
+ if ((op->granulepos != -1) || (this->si[stream_num]->header_granulepos != -1)) {
+ pts = get_pts(this, stream_num, op->granulepos );
+ check_newpts( this, pts, PTS_VIDEO, decoder_flags );
+ } else
+ pts = 0;
+
+ llprintf(DEBUG_PACKETS,
+ "theorastream %d op-gpos %" PRId64 " hdr-gpos %" PRId64 " pts %" PRId64 " \n",
+ stream_num,
+ op->granulepos,
+ this->si[stream_num]->header_granulepos,
+ pts);
+
+ send_ogg_packet (this, this->video_fifo, op, pts, decoder_flags, stream_num);
+
+ theora_comment_clear (&t_comment);
+ theora_info_clear (&t_info);
+#endif
+
+ } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_VIDEO_BASE) {
+
+ uint8_t *data;
+ int size;
+ int64_t pts;
+
+ llprintf(DEBUG_VIDEO_PACKETS,
+ "video buffer, type=%08x\n", this->si[stream_num]->buf_types);
+
+ if (op->packet[0] == PACKET_TYPE_COMMENT ) {
+ read_chapter_comment(this, op);
+ }else{
+ data = op->packet+1+hdrlen;
+ size = op->bytes-1-hdrlen;
+
+ if ((op->granulepos != -1) || (this->si[stream_num]->header_granulepos != -1)) {
+ pts = get_pts(this, stream_num, op->granulepos );
+ check_newpts( this, pts, PTS_VIDEO, decoder_flags );
+ } else
+ pts = 0;
+
+ llprintf(DEBUG_VIDEO_PACKETS,
+ "videostream %d op-gpos %" PRId64 " hdr-gpos %" PRId64 " pts %" PRId64 " \n",
+ stream_num,
+ op->granulepos,
+ this->si[stream_num]->header_granulepos,
+ pts);
+
+ _x_demux_send_data(this->video_fifo, data, size,
+ pts, this->si[stream_num]->buf_types, decoder_flags,
+ normpos,
+ pts / 90, this->time_length, 0);
+
+ if (this->chapter_info && op->granulepos != -1) {
+ update_chapter_display(this, stream_num, op);
+ }
+ }
+ } else if ((this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_SPU_CMML) {
+ buf_element_t *buf;
+ uint32_t *val;
+ char *str;
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+
+ buf->type = this->si[stream_num]->buf_types;
+
+ buf->pts = get_pts (this, stream_num, op->granulepos);
+
+ val = (uint32_t * )buf->content;
+ str = (char *)val;
+
+ memcpy(str, op->packet, op->bytes);
+ str[op->bytes] = '\0';
+
+ buf->size = 12 + op->bytes + 1;
+
+ lprintf ("CMML stream %d (bytes=%ld): PTS %"PRId64": %s\n",
+ stream_num, op->bytes, buf->pts, str);
+
+ this->video_fifo->put (this->video_fifo, buf);
+ } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_SPU_BASE) {
+
+ buf_element_t *buf;
+ int i;
+ char *subtitle,*str;
+ int lenbytes;
+ int start,end;
+ uint32_t *val;
+
+ for (i = 0, lenbytes = 0; i < hdrlen; i++) {
+ lenbytes = lenbytes << 8;
+ lenbytes += *((unsigned char *) op->packet + hdrlen - i);
+ }
+
+ if (op->packet[0] == PACKET_TYPE_HEADER ) {
+ lprintf ("Textstream-header-packet\n");
+ } else if (op->packet[0] == PACKET_TYPE_COMMENT ) {
+ lprintf ("Textstream-comment-packet\n");
+ read_language_comment(this, op, stream_num);
+ } else {
+ subtitle = (char *)&op->packet[hdrlen + 1];
+
+ if ((strlen(subtitle) > 1) || (*subtitle != ' ')) {
+ start = op->granulepos;
+ end = start+lenbytes;
+ lprintf ("subtitlestream %d: %d -> %d :%s\n",stream_num,start,end,subtitle);
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+
+ buf->type = this->si[stream_num]->buf_types;
+ buf->pts = 0;
+
+ val = (uint32_t * )buf->content;
+ *val++ = start;
+ *val++ = end;
+ str = (char *)val;
+
+ memcpy (str, subtitle, 1+strlen(subtitle));
+
+ this->video_fifo->put (this->video_fifo, buf);
+ }
+ }
+ } else {
+ lprintf("unknown stream type %x\n", this->si[stream_num]->buf_types);
+ }
+}
+
+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;
+
+ this->si[stream_num]->buf_types = BUF_AUDIO_VORBIS
+ +this->num_audio_streams++;
+
+ this->si[stream_num]->headers = 3;
+
+ vorbis_info_init(&vi);
+ vorbis_comment_init(&vc);
+ if (vorbis_synthesis_headerin(&vi, &vc, op) >= 0) {
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, vi.bitrate_nominal);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, vi.rate);
+
+ this->si[stream_num]->factor = 90000;
+ this->si[stream_num]->quotient = vi.rate;
+
+ if (vi.bitrate_nominal<1)
+ this->avg_bitrate += 100000; /* assume 100 kbit */
+ else
+ this->avg_bitrate += vi.bitrate_nominal;
+
+ } else {
+ this->si[stream_num]->factor = 900;
+ this->si[stream_num]->quotient = 441;
+
+ this->si[stream_num]->headers = 0;
+ xine_log (this->stream->xine, XINE_LOG_MSG,
+ _("ogg: vorbis audio track indicated but no vorbis stream header found.\n"));
+ }
+ 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) {
+#ifdef HAVE_SPEEX
+ void *st;
+ SpeexMode *mode;
+ SpeexHeader *header;
+
+ this->si[stream_num]->buf_types = BUF_AUDIO_SPEEX
+ +this->num_audio_streams++;
+
+ this->si[stream_num]->headers = 1;
+
+ header = speex_packet_to_header (op->packet, op->bytes);
+
+ if (header) {
+ int bitrate;
+ mode = (SpeexMode *) speex_mode_list[header->mode];
+
+ st = speex_decoder_init (mode);
+
+ speex_decoder_ctl (st, SPEEX_GET_BITRATE, &bitrate);
+
+ if (bitrate <= 1)
+ bitrate = 16000; /* assume 16 kbit */
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, bitrate);
+
+ this->si[stream_num]->factor = 90000;
+ this->si[stream_num]->quotient = header->rate;
+
+ this->avg_bitrate += bitrate;
+
+ lprintf ("detected Speex stream,\trate %d\tbitrate %d\n", header->rate, bitrate);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, header->rate);
+ this->si[stream_num]->headers += header->extra_headers;
+ }
+#else
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Speex stream detected, unable to play\n");
+
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+#endif
+}
+
+static void decode_video_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+ buf_element_t *buf;
+ xine_bmiheader bih;
+ int channel;
+
+#ifdef LOG
+ int16_t locbits_per_sample;
+ int32_t locsize, locdefault_len, locbuffersize;
+ int64_t locsamples_per_unit;
+#endif
+ uint32_t locsubtype;
+ int32_t locwidth, locheight;
+ int64_t loctime_unit;
+
+ /* read fourcc with machine endianness */
+ locsubtype = *((uint32_t *)&op->packet[9]);
+
+ /* everything else little endian */
+ loctime_unit = _X_LE_64(&op->packet[17]);
+#ifdef LOG
+ locsize = _X_LE_32(&op->packet[13]);
+ locsamples_per_unit = _X_LE_64(&op->packet[25]);
+ locdefault_len = _X_LE_32(&op->packet[33]);
+ locbuffersize = _X_LE_32(&op->packet[37]);
+ locbits_per_sample = _X_LE_16(&op->packet[41]);
+#endif
+ locwidth = _X_LE_32(&op->packet[45]);
+ locheight = _X_LE_32(&op->packet[49]);
+
+ lprintf ("direct show filter created stream detected, hexdump:\n");
+#ifdef LOG
+ xine_hexdump (op->packet, op->bytes);
+#endif
+
+ channel = this->num_video_streams++;
+
+ this->si[stream_num]->buf_types = _x_fourcc_to_buf_video (locsubtype);
+ if( !this->si[stream_num]->buf_types )
+ {
+ this->si[stream_num]->buf_types = BUF_VIDEO_UNKNOWN;
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, locsubtype);
+ }
+ this->si[stream_num]->buf_types |= channel;
+ this->si[stream_num]->headers = 0; /* header is sent below */
+
+ lprintf ("subtype %.4s\n", (char*)&locsubtype);
+ lprintf ("time_unit %" PRId64 "\n", loctime_unit);
+ lprintf ("samples_per_unit %" PRId64 "\n", locsamples_per_unit);
+ lprintf ("default_len %d\n", locdefault_len);
+ lprintf ("buffersize %d\n", locbuffersize);
+ lprintf ("bits_per_sample %d\n", locbits_per_sample);
+ lprintf ("width %d\n", locwidth);
+ lprintf ("height %d\n", locheight);
+ lprintf ("buf_type %08x\n",this->si[stream_num]->buf_types);
+
+ bih.biSize=sizeof(xine_bmiheader);
+ bih.biWidth = locwidth;
+ bih.biHeight= locheight;
+ bih.biPlanes= 0;
+ memcpy(&bih.biCompression, &locsubtype, 4);
+ bih.biBitCount= 0;
+ bih.biSizeImage=locwidth*locheight;
+ bih.biXPelsPerMeter=1;
+ bih.biYPelsPerMeter=1;
+ bih.biClrUsed=0;
+ bih.biClrImportant=0;
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAMERATE|
+ BUF_FLAG_FRAME_END;
+ this->frame_duration = loctime_unit * 9 / 1000;
+ this->si[stream_num]->factor = loctime_unit * 9;
+ this->si[stream_num]->quotient = 1000;
+ buf->decoder_info[0] = this->frame_duration;
+ memcpy (buf->content, &bih, sizeof (xine_bmiheader));
+ buf->size = sizeof (xine_bmiheader);
+ buf->type = this->si[stream_num]->buf_types;
+
+ /* video metadata */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_FOURCC, locsubtype);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, locwidth);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, locheight);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->frame_duration);
+
+ this->avg_bitrate += 500000; /* FIXME */
+
+ this->video_fifo->put (this->video_fifo, buf);
+}
+
+static void decode_audio_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+
+ if (this->audio_fifo) {
+ buf_element_t *buf;
+ int codec;
+ char str[5];
+ int channel;
+
+#ifdef LOG
+ int16_t locblockalign;
+ int32_t locsize, locdefault_len, locbuffersize;
+ int64_t loctime_unit;
+#endif
+ int16_t locbits_per_sample, locchannels;
+ int32_t locavgbytespersec;
+ int64_t locsamples_per_unit;
+
+#ifdef LOG
+ locsize = _X_LE_32(&op->packet[13]);
+ loctime_unit = _X_LE_64(&op->packet[17]);
+ locbuffersize = _X_LE_32(&op->packet[37]);
+ locdefault_len = _X_LE_32(&op->packet[33]);
+ locblockalign = _X_LE_16(&op->packet[47]);
+#endif
+ locsamples_per_unit = _X_LE_64(&op->packet[25]);
+ locbits_per_sample = _X_LE_16(&op->packet[41]);
+ locchannels = _X_LE_16(&op->packet[45]);
+ locavgbytespersec= _X_LE_32(&op->packet[49]);
+
+ lprintf ("direct show filter created audio stream detected, hexdump:\n");
+#ifdef LOG
+ xine_hexdump (op->packet, op->bytes);
+#endif
+
+ memcpy(str, &op->packet[9], 4);
+ str[4] = 0;
+ codec = strtoul(str, NULL, 16);
+
+ channel= this->num_audio_streams++;
+
+ this->si[stream_num]->buf_types = _x_formattag_to_buf_audio(codec);
+ if( this->si[stream_num]->buf_types ) {
+ this->si[stream_num]->buf_types |= channel;
+ } else {
+ this->si[stream_num]->buf_types = BUF_AUDIO_UNKNOWN;
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE, codec);
+ /*break;*/
+ }
+
+ lprintf ("subtype 0x%x\n", codec);
+ lprintf ("time_unit %" PRId64 "\n", loctime_unit);
+ lprintf ("samples_per_unit %" PRId64 "\n", locsamples_per_unit);
+ lprintf ("default_len %d\n", locdefault_len);
+ lprintf ("buffersize %d\n", locbuffersize);
+ lprintf ("bits_per_sample %d\n", locbits_per_sample);
+ lprintf ("channels %d\n", locchannels);
+ lprintf ("blockalign %d\n", locblockalign);
+ lprintf ("avgbytespersec %d\n", locavgbytespersec);
+ lprintf ("buf_type %08x\n",this->si[stream_num]->buf_types);
+
+ buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
+ buf->type = this->si[stream_num]->buf_types;
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
+ buf->decoder_info[0] = 0;
+ buf->decoder_info[1] = locsamples_per_unit;
+ buf->decoder_info[2] = locbits_per_sample;
+ buf->decoder_info[3] = locchannels;
+ this->audio_fifo->put (this->audio_fifo, buf);
+
+ this->si[stream_num]->headers = 0; /* header already sent */
+ this->si[stream_num]->factor = 90000;
+ this->si[stream_num]->quotient = locsamples_per_unit;
+
+ this->avg_bitrate += locavgbytespersec*8;
+
+ /* audio metadata */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC, codec);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, locchannels);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, locbits_per_sample);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, locsamples_per_unit);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, locavgbytespersec * 8);
+
+ } else /* no audio_fifo there */
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+}
+
+static void decode_dshow_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+
+ lprintf ("older Direct Show filter-generated stream header detected. Hexdump:\n");
+#ifdef LOG
+ xine_hexdump (op->packet, op->bytes);
+#endif
+
+ this->si[stream_num]->headers = 0; /* header is sent below */
+
+ if ( (_X_LE_32(&op->packet[96]) == 0x05589f80) && (op->bytes >= 184)) {
+
+ buf_element_t *buf;
+ xine_bmiheader bih;
+ int channel;
+ uint32_t fcc;
+
+ lprintf ("seems to be a video stream.\n");
+
+ channel = this->num_video_streams++;
+ fcc = *(uint32_t*)(op->packet+68);
+ lprintf ("fourcc %08x\n", fcc);
+
+ this->si[stream_num]->buf_types = _x_fourcc_to_buf_video (fcc);
+ if( !this->si[stream_num]->buf_types )
+ {
+ this->si[stream_num]->buf_types = BUF_VIDEO_UNKNOWN;
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, fcc);
+ }
+ this->si[stream_num]->buf_types |= channel;
+
+ bih.biSize = sizeof(xine_bmiheader);
+ bih.biWidth = _X_LE_32(&op->packet[176]);
+ bih.biHeight = _X_LE_32(&op->packet[180]);
+ bih.biPlanes = 0;
+ memcpy (&bih.biCompression, op->packet+68, 4);
+ bih.biBitCount = _X_LE_16(&op->packet[182]);
+ if (!bih.biBitCount)
+ bih.biBitCount = 24; /* FIXME ? */
+ bih.biSizeImage = (bih.biBitCount>>3)*bih.biWidth*bih.biHeight;
+ bih.biXPelsPerMeter = 1;
+ bih.biYPelsPerMeter = 1;
+ bih.biClrUsed = 0;
+ bih.biClrImportant = 0;
+
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAMERATE|
+ BUF_FLAG_FRAME_END;
+ this->frame_duration = (*(int64_t*)(op->packet+164)) * 9 / 1000;
+ this->si[stream_num]->factor = (*(int64_t*)(op->packet+164)) * 9;
+ this->si[stream_num]->quotient = 1000;
+
+ buf->decoder_info[0] = this->frame_duration;
+ memcpy (buf->content, &bih, sizeof (xine_bmiheader));
+ buf->size = sizeof (xine_bmiheader);
+ buf->type = this->si[stream_num]->buf_types;
+ this->video_fifo->put (this->video_fifo, buf);
+
+ lprintf ("subtype %.4s\n", (char*)&fcc);
+ lprintf ("buf_type %08x\n", this->si[stream_num]->buf_types);
+ lprintf ("video size %d x %d\n", bih.biWidth, bih.biHeight);
+ lprintf ("frame duration %d\n", this->frame_duration);
+
+ /* video metadata */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, bih.biWidth);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, bih.biHeight);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->frame_duration);
+
+ this->avg_bitrate += 500000; /* FIXME */
+
+ this->ignore_keyframes = 1;
+
+ } else if (_X_LE_32(&op->packet[96]) == 0x05589F81) {
+
+#if 0
+ /* FIXME: no test streams */
+
+ buf_element_t *buf;
+ int codec;
+ char str[5];
+ int channel;
+ int extra_size;
+
+ extra_size = *(int16_t*)(op->packet+140);
+ format = *(int16_t*)(op->packet+124);
+ channels = *(int16_t*)(op->packet+126);
+ samplerate = *(int32_t*)(op->packet+128);
+ nAvgBytesPerSec = *(int32_t*)(op->packet+132);
+ nBlockAlign = *(int16_t*)(op->packet+136);
+ wBitsPerSample = *(int16_t*)(op->packet+138);
+ samplesize = (sh_a->wf->wBitsPerSample+7)/8;
+ cbSize = extra_size;
+ if(extra_size > 0)
+ memcpy(wf+sizeof(WAVEFORMATEX),op->packet+142,extra_size);
+#endif
+
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "FIXME, old audio format not handled\n");
+
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+
+ } else {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "old header detected but stream type is unknown\n");
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+ }
+}
+
+static void decode_text_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+ int channel=0;
+ uint32_t *val;
+ buf_element_t *buf;
+
+ lprintf ("textstream detected.\n");
+ this->si[stream_num]->headers = 2;
+ channel = this->num_spu_streams++;
+ this->si[stream_num]->buf_types = BUF_SPU_OGM | channel;
+
+ /*send an empty spu to inform the video_decoder, that there is a stream*/
+ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
+ buf->type = this->si[stream_num]->buf_types;
+ buf->pts = 0;
+ val = (uint32_t * )buf->content;
+ *val++=0;
+ *val++=0;
+ *val++=0;
+ this->video_fifo->put (this->video_fifo, buf);
+}
+
+static void decode_theora_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+
+#ifdef HAVE_THEORA
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "demux_ogg: Theorastreamsupport is highly alpha at the moment\n");
+
+ if (theora_decode_header(&this->t_info, &this->t_comment, op) >= 0) {
+
+ this->num_video_streams++;
+
+ this->si[stream_num]->factor = (int64_t) 90000 * (int64_t) this->t_info.fps_denominator;
+
+ if (!this->t_info.fps_numerator) {
+ this->t_info.fps_numerator = 1; /* FIXME: default value ? */
+ }
+ this->si[stream_num]->quotient = this->t_info.fps_numerator;
+
+ this->frame_duration = ((int64_t) 90000*this->t_info.fps_denominator);
+ this->frame_duration /= this->t_info.fps_numerator;
+
+ this->si[stream_num]->granuleshift = intlog(this->t_info.keyframe_frequency_force-1);
+
+ this->si[stream_num]->headers=3;
+ this->si[stream_num]->buf_types = BUF_VIDEO_THEORA;
+
+ _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "theora");
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->t_info.frame_width);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->t_info.frame_height);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->frame_duration);
+
+ /*currently aspect_nominator and -denumerator are 0?*/
+ if (this->t_info.aspect_denominator) {
+ int64_t ratio = ((int64_t) this->t_info.aspect_numerator * 10000);
+
+ ratio /= this->t_info.aspect_denominator;
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, ratio);
+ }
+
+ lprintf ("decoded theora header \n");
+ lprintf ("frameduration %d\n",this->frame_duration);
+ lprintf ("w:%d h:%d \n",this->t_info.frame_width,this->t_info.frame_height);
+ lprintf ("an:%d ad:%d \n",this->t_info.aspect_numerator,this->t_info.aspect_denominator);
+ } else {
+ /*Rejected stream*/
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "A theora header was rejected by libtheora\n");
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+ this->si[stream_num]->headers = 0; /* FIXME: don't know */
+ }
+#else
+ this->si[stream_num]->buf_types = BUF_VIDEO_THEORA;
+ this->num_video_streams++;
+ this->unhandled_video_streams++;
+ _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "theora");
+#endif
+}
+
+static void decode_flac_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+ xine_flac_metadata_header header;
+ xine_flac_streaminfo_block streaminfo = {};
+ buf_element_t *buf;
+ xine_waveformatex wave;
+
+ /* Packet type */
+ _x_assert(op->packet[0] == 0x7F);
+
+ /* OggFLAC signature */
+ _x_assert(_X_BE_32(&op->packet[1]) == ME_FOURCC('F', 'L', 'A', 'C'));
+
+ /* Version: supported only 1.0 */
+ _x_assert(op->packet[5] == 1); _x_assert(op->packet[6] == 0);
+
+ /* Header count */
+ this->si[stream_num]->headers = 0/*_X_BE_16(&op->packet[7]) +1*/;
+
+ /* fLaC signature */
+ _x_assert(_X_BE_32(&op->packet[9]) == ME_FOURCC('f', 'L', 'a', 'C'));
+
+ _x_parse_flac_metadata_header(&op->packet[13], &header);
+
+ switch ( header.blocktype ) {
+ case FLAC_BLOCKTYPE_STREAMINFO:
+ _x_assert(header.length == FLAC_STREAMINFO_SIZE);
+ _x_parse_flac_streaminfo_block(&op->packet[17], &streaminfo);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, streaminfo.samplerate);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, streaminfo.channels);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, streaminfo.bits_per_sample);
+
+ break;
+ }
+
+ this->si[stream_num]->buf_types = BUF_AUDIO_FLAC
+ +this->num_audio_streams++;
+
+ this->si[stream_num]->factor = 90000;
+
+ buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo);
+
+ buf->type = BUF_AUDIO_FLAC;
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
+
+ buf->decoder_info[0] = 0;
+ buf->decoder_info[1] = streaminfo.samplerate;
+ buf->decoder_info[2] = streaminfo.bits_per_sample;
+ buf->decoder_info[3] = streaminfo.channels;
+ buf->size = sizeof(xine_waveformatex) + FLAC_STREAMINFO_SIZE;
+ memcpy(buf->content+sizeof(xine_waveformatex), &op->packet[17], FLAC_STREAMINFO_SIZE);
+ xine_hexdump(&op->packet[17], FLAC_STREAMINFO_SIZE);
+ wave.cbSize = FLAC_STREAMINFO_SIZE;
+ memcpy(buf->content, &wave, sizeof(xine_waveformatex));
+
+ this->audio_fifo->put(this->audio_fifo, buf);
+
+ /* Skip the Ogg framing info */
+ op->bytes -= 9;
+ op->packet += 9;
+}
+
+static void decode_annodex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+ lprintf ("Annodex stream detected\n");
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+ this->si[stream_num]->headers = 1;
+ this->si[stream_num]->header_granulepos = op->granulepos;
+ _x_meta_info_set(this->stream, XINE_META_INFO_SYSTEMLAYER, "Annodex");
+}
+
+static void decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+ int64_t granule_rate_n, granule_rate_d;
+ uint32_t secondary_headers;
+ const char *content_type = "";
+ size_t content_type_length = 0;
+
+ lprintf("AnxData stream detected\n");
+
+ /* read granule rate */
+ granule_rate_n = _X_LE_64(&op->packet[8]);
+ granule_rate_d = _X_LE_64(&op->packet[16]);
+ secondary_headers = _X_LE_32(&op->packet[24]);
+
+ lprintf("granule_rate %" PRId64 "/%" PRId64 ", %d secondary headers\n",
+ granule_rate_n, granule_rate_d, secondary_headers);
+
+ /* read "Content-Type" MIME header */
+ const char *startline = &op->packet[28];
+ const char *endline;
+ if ( strcmp(&op->packet[28], "Content-Type: ") == 0 &&
+ (endline = strstr(startline, "\r\n")) ) {
+ content_type = startline + sizeof("Content-Type: ");
+ content_type_length = startline - endline;
+ }
+
+ lprintf("Content-Type: %s (length:%td)\n", content_type, content_type_length);
+
+ /* how many header packets in the AnxData stream? */
+ this->si[stream_num]->headers = secondary_headers + 1;
+ this->si[stream_num]->hide_first_header = 1;
+
+ /* set factor and quotient */
+ this->si[stream_num]->factor = (int64_t) 90000 * granule_rate_d;
+ this->si[stream_num]->quotient = granule_rate_n;
+
+ lprintf("factor: %" PRId64 ", quotient: %" PRId64 "\n",
+ this->si[stream_num]->factor, this->si[stream_num]->quotient);
+
+ /* 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++;
+#ifdef HAVE_SPEEX
+ this->si[stream_num]->buf_types = BUF_AUDIO_SPEEX;
+#else
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+#endif
+ } else if (!strncmp(content_type, "video/x-theora", content_type_length)) {
+ this->num_video_streams++;
+#ifdef HAVE_THEORA
+ this->si[stream_num]->buf_types = BUF_VIDEO_THEORA;
+#else
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+#endif
+ } else if (!strncmp(content_type, "text/x-cmml", content_type_length)) {
+ unsigned int channel = this->num_spu_streams++;
+ this->si[stream_num]->headers = 0;
+ this->si[stream_num]->buf_types = BUF_SPU_CMML | channel;
+ this->si[stream_num]->granuleshift = 0;
+ } else {
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+ }
+
+}
+
+static void decode_cmml_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
+ unsigned int channel = this->num_spu_streams++;
+ this->si[stream_num]->headers = 0;
+ this->si[stream_num]->buf_types = BUF_SPU_CMML | channel;
+
+ this->si[stream_num]->factor = 90000 * _X_LE_64(&op->packet[20]);
+ this->si[stream_num]->quotient = _X_LE_64(&op->packet[12]);
+ this->si[stream_num]->granuleshift = (int)op->packet[28];
+}
+
+/*
+ * interpret stream start packages, send headers
+ */
+static void send_header (demux_ogg_t *this) {
+
+ int stream_num = -1;
+ int cur_serno;
+ int done = 0;
+ ogg_packet op;
+ xine_event_t ui_event;
+
+ lprintf ("detecting stream types...\n");
+
+ this->ignore_keyframes = 0;
+
+ while (!done) {
+ if (!read_ogg_packet(this) || !this->og.header || !this->og.body) {
+ return;
+ }
+ /* now we've got at least one new page */
+
+ cur_serno = ogg_page_serialno (&this->og);
+
+ if (ogg_page_bos(&this->og)) {
+ lprintf ("beginning of stream\n");
+ lprintf ("serial number %d\n", cur_serno);
+
+ if( this->num_streams == MAX_STREAMS ) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG, "demux_ogg: MAX_STREAMS exceeded, aborting.\n");
+ this->status = DEMUX_FINISHED;
+ return;
+ }
+ stream_num = new_stream_info(this, cur_serno);
+
+ } else {
+ stream_num = get_stream(this, cur_serno);
+ if (stream_num == -1) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG, "demux_ogg: stream with no beginning!\n");
+ this->status = DEMUX_FINISHED;
+ return;
+ }
+ }
+
+ ogg_stream_pagein(&this->si[stream_num]->oss, &this->og);
+
+ while (ogg_stream_packetout(&this->si[stream_num]->oss, &op) == 1) {
+
+ if (!this->si[stream_num]->buf_types) {
+
+ /* detect buftype */
+ if (!memcmp (&op.packet[1], "vorbis", 6)) {
+ decode_vorbis_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[0], "Speex", 5)) {
+ decode_speex_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[1], "video", 5)) {
+ decode_video_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[1], "audio", 5)) {
+ decode_audio_header(this, stream_num, &op);
+ } else if (op.bytes >= 142
+ && !memcmp (&op.packet[1], "Direct Show Samples embedded in Ogg", 35) ) {
+ decode_dshow_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[1], "text", 4)) {
+ decode_text_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[1], "theora", 6)) {
+ decode_theora_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[1], "FLAC", 4)) {
+ decode_flac_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[0], "Annodex", 7)) {
+ decode_annodex_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[0], "AnxData", 7)) {
+ decode_anxdata_header(this, stream_num, &op);
+ } else if (!memcmp (&op.packet[0], "CMML", 4)) {
+ decode_cmml_header(this, stream_num, &op);
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "demux_ogg: unknown stream type (signature >%.8s<). hex dump of bos packet follows:\n",
+ op.packet);
+ if(this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
+ xine_hexdump (op.packet, op.bytes);
+
+ this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
+ }
+ }
+
+ /* send preview buffer */
+ if (this->si[stream_num]->headers > 0 ||
+ op.packet[0] == PACKET_TYPE_COMMENT) {
+ if (this->si[stream_num]->hide_first_header)
+ this->si[stream_num]->hide_first_header = 0;
+ else {
+ lprintf ("sending preview buffer of stream type %08x\n",
+ this->si[stream_num]->buf_types);
+
+ send_ogg_buf (this, &op, stream_num, BUF_FLAG_HEADER);
+ this->si[stream_num]->headers --;
+ }
+ }
+
+ /* are we finished ? */
+ if (!ogg_page_bos(&this->og)) {
+ int i;
+ done = 1;
+
+ for (i=0; i<this->num_streams; i++) {
+ if (this->si[i]->headers > 0)
+ done = 0;
+
+ llprintf(DEBUG_PREVIEWS,
+ "%d preview buffers left to send from stream %d\n",
+ this->si[i]->headers, i);
+ }
+ }
+ }
+ }
+
+ ui_event.type = XINE_EVENT_UI_CHANNELS_CHANGED;
+ ui_event.data_length = 0;
+ xine_event_send(this->stream, &ui_event);
+
+ /*get the streamlength*/
+ get_stream_length (this);
+
+}
+
+static int demux_ogg_send_chunk (demux_plugin_t *this_gen) {
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+
+ int stream_num;
+ int cur_serno;
+
+ ogg_packet op;
+
+ ogg_handle_event(this);
+
+ llprintf(DEBUG_PACKETS, "send package...\n");
+
+ if (!read_ogg_packet(this)) {
+ this->status = DEMUX_FINISHED;
+ lprintf ("EOF\n");
+ return this->status;
+ }
+
+ if (!this->og.header || !this->og.body) {
+ this->status = DEMUX_FINISHED;
+ lprintf ("EOF\n");
+ return this->status;
+ }
+
+ /* now we've got one new page */
+
+ cur_serno = ogg_page_serialno (&this->og);
+ stream_num = get_stream(this, cur_serno);
+ if (stream_num < 0) {
+ lprintf ("error: unknown stream, serialnumber %d\n", cur_serno);
+
+ if (!ogg_page_bos(&this->og)) {
+ lprintf ("help, stream with no beginning!\n");
+ }
+ lprintf ("adding late stream with serial number %d (all content will be discarded)\n", cur_serno);
+
+ if( this->num_streams == MAX_STREAMS ) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG, "demux_ogg: MAX_STREAMS exceeded, aborting.\n");
+ this->status = DEMUX_FINISHED;
+ return this->status;
+ }
+ stream_num = new_stream_info(this, cur_serno);
+ }
+
+ ogg_stream_pagein(&this->si[stream_num]->oss, &this->og);
+
+ if (ogg_page_bos(&this->og)) {
+ lprintf ("beginning of stream: serial number %d - discard\n",
+ ogg_page_serialno (&this->og));
+ while (ogg_stream_packetout(&this->si[stream_num]->oss, &op) == 1) ;
+ return this->status;
+ }
+
+ /*while keyframeseeking only process videostream*/
+ if (!this->ignore_keyframes && this->keyframe_needed
+ && ((this->si[stream_num]->buf_types & 0xFF000000) != BUF_VIDEO_BASE))
+ return this->status;
+
+ while (ogg_stream_packetout(&this->si[stream_num]->oss, &op) == 1) {
+ /* printf("demux_ogg: packet: %.8s\n", op.packet); */
+ /* printf("demux_ogg: got a packet\n"); */
+
+ if ((*op.packet & PACKET_TYPE_HEADER) &&
+ (this->si[stream_num]->buf_types!=BUF_VIDEO_THEORA) && (this->si[stream_num]->buf_types!=BUF_AUDIO_SPEEX) && (this->si[stream_num]->buf_types!=BUF_AUDIO_FLAC)) {
+ if (op.granulepos != -1) {
+ this->si[stream_num]->header_granulepos = op.granulepos;
+ lprintf ("header with granulepos, remembering granulepos\n");
+ } else {
+ lprintf ("header => discard\n");
+ }
+ continue;
+ }
+
+ /*discard granulepos-less packets and to early audiopackets*/
+ if (this->si[stream_num]->resync) {
+ if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_SPU_BASE) {
+ /*never drop subtitles*/
+ this->si[stream_num]->resync=0;
+ } else if ((op.granulepos == -1) && (this->si[stream_num]->header_granulepos == -1)) {
+ continue;
+ } else {
+
+ /*dump too early packets*/
+ if ((get_pts(this,stream_num,op.granulepos)-this->start_pts) > -90000)
+ this->si[stream_num]->resync=0;
+ else
+ continue;
+ }
+ }
+
+ if (!this->ignore_keyframes && this->keyframe_needed) {
+ lprintf ("keyframe needed... buf_type=%08x\n", this->si[stream_num]->buf_types);
+ if (this->si[stream_num]->buf_types == BUF_VIDEO_THEORA) {
+#ifdef HAVE_THEORA
+
+ int keyframe_granule_shift;
+ int64_t pframe=-1,iframe=-1;
+
+ keyframe_granule_shift = this->si[stream_num]->granuleshift;
+
+ if(op.granulepos>=0){
+ iframe=op.granulepos>>keyframe_granule_shift;
+ pframe=op.granulepos-(iframe<<keyframe_granule_shift);
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "seeking keyframe i %" PRId64 " p %" PRId64 "\n", iframe, pframe);
+ if (pframe!=0)
+ continue;
+ } else
+ continue;
+ this->keyframe_needed = 0;
+ this->start_pts=get_pts(this,stream_num,op.granulepos);
+#endif
+ } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_VIDEO_BASE) {
+
+ /*calculate the current pts*/
+ if (op.granulepos!=-1) {
+ this->start_pts=get_pts(this, stream_num, op.granulepos);
+ } else if (this->start_pts!=-1)
+ this->start_pts=this->start_pts+this->frame_duration;
+
+ /*seek the keyframe*/
+ if ((*op.packet == PACKET_IS_SYNCPOINT) && (this->start_pts!=-1))
+ this->keyframe_needed = 0;
+ else
+ continue;
+
+ } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_VIDEO_BASE) continue;
+ }
+ send_ogg_buf (this, &op, stream_num, 0);
+
+ /*delete used header_granulepos*/
+ if (op.granulepos == -1)
+ this->si[stream_num]->header_granulepos = -1;
+
+ }
+ if (ogg_page_eos(&this->og)) {
+ int i;
+ int finished_streams = 0;
+
+ lprintf("end of stream, serialnumber %d\n", cur_serno);
+ this->si[stream_num]->delivered_eos = 1;
+
+ /* check if all logical streams are finished */
+ for (i = 0; i < this->num_streams; i++) {
+ finished_streams += this->si[i]->delivered_eos;
+ }
+
+ /* if all streams are finished, perhaps a chained stream follows */
+ if (finished_streams == this->num_streams) {
+ /* delete current logical streams */
+ for (i = 0; i < this->num_streams; i++) {
+ ogg_stream_clear(&this->si[i]->oss);
+ if (this->si[i]->language) {
+ free (this->si[i]->language);
+ }
+ free (this->si[i]);
+ }
+ this->num_streams = 0;
+ this->num_audio_streams = 0;
+ this->num_video_streams = 0;
+ this->unhandled_video_streams = 0;
+ this->num_spu_streams = 0;
+ this->avg_bitrate = 1;
+
+ /* try to read a chained stream */
+ this->send_newpts = 1;
+ this->last_pts[0] = 0;
+ this->last_pts[1] = 0;
+
+ /* send control buffer to avoid buffer leak */
+ _x_demux_control_end(this->stream, 0);
+ _x_demux_control_start(this->stream);
+ send_header(this);
+ }
+ }
+
+ return this->status;
+}
+
+static void demux_ogg_dispose (demux_plugin_t *this_gen) {
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+ int i;
+
+ for (i=0; i<this->num_streams; i++) {
+ ogg_stream_clear(&this->si[i]->oss);
+
+ if (this->si[i]->language) {
+ free (this->si[i]->language);
+ }
+ free(this->si[i]);
+ }
+
+ ogg_sync_clear(&this->oy);
+
+#ifdef HAVE_THEORA
+ theora_comment_clear (&this->t_comment);
+ theora_info_clear (&this->t_info);
+#endif
+
+ if (this->chapter_info){
+ free (this->chapter_info->entries);
+ free (this->chapter_info);
+ }
+ for (i = 0; i < XINE_STREAM_INFO_MAX; ++i)
+ free (this->meta[i]);
+
+ if (this->event_queue)
+ xine_event_dispose_queue (this->event_queue);
+
+ free (this);
+}
+
+static int demux_ogg_get_status (demux_plugin_t *this_gen) {
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+
+ return this->status;
+}
+
+static void demux_ogg_send_headers (demux_plugin_t *this_gen) {
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+
+ this->video_fifo = this->stream->video_fifo;
+ this->audio_fifo = this->stream->audio_fifo;
+
+ this->status = DEMUX_OK;
+
+ /*
+ * send start buffers
+ */
+
+ this->last_pts[0] = 0;
+ this->last_pts[1] = 0;
+
+ /*
+ * initialize ogg engine
+ */
+ ogg_sync_init(&this->oy);
+
+ this->num_streams = 0;
+ this->num_audio_streams = 0;
+ this->num_video_streams = 0;
+ this->num_spu_streams = 0;
+ this->avg_bitrate = 1;
+
+ this->input->seek (this->input, 0, SEEK_SET);
+
+ if (this->status == DEMUX_OK) {
+ _x_demux_control_start(this->stream);
+ send_header (this);
+ lprintf ("headers sent, avg bitrate is %" PRId64 "\n", this->avg_bitrate);
+ }
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO,
+ this->num_video_streams > 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED,
+ this->num_video_streams > this->unhandled_video_streams);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO,
+ this->num_audio_streams > 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL,
+ this->num_spu_streams);
+}
+
+static int demux_ogg_seek (demux_plugin_t *this_gen,
+ off_t start_pos, int start_time, int playing) {
+
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+ int i;
+ start_time /= 1000;
+ start_pos = (off_t) ( (double) start_pos / 65535 *
+ this->input->get_length (this->input) );
+ /*
+ * seek to start position
+ */
+
+ if (INPUT_IS_SEEKABLE(this->input)) {
+
+ this->keyframe_needed = (this->num_video_streams>0);
+
+ if ( (!start_pos) && (start_time)) {
+ if (this->time_length != -1) {
+ /*do the seek via time*/
+ int current_time=-1;
+ off_t current_pos;
+ current_pos=this->input->get_current_pos(this->input);
+
+ /*try to find out the current time*/
+ if (this->last_pts[PTS_VIDEO]) {
+ current_time=this->last_pts[PTS_VIDEO]/90000;
+ } else if (this->last_pts[PTS_AUDIO]) {
+ current_time=this->last_pts[PTS_AUDIO]/90000;
+ }
+
+ /*fixme, the file could grow, do something
+ about this->time_length using get_lenght to verify, that the stream
+ hasn` changed its length, otherwise no seek to "new" data is possible*/
+
+ lprintf ("seek to time %d called\n",start_time);
+ lprintf ("current time is %d\n",current_time);
+
+ if (current_time > start_time) {
+ /*seek between beginning and current_pos*/
+
+ /*fixme - sometimes we seek backwards and during
+ keyframeseeking, we undo the seek*/
+
+ start_pos = start_time * current_pos
+ / current_time ;
+ } else {
+ /*seek between current_pos and end*/
+ start_pos = current_pos +
+ ((start_time - current_time) *
+ ( this->input->get_length(this->input) - current_pos ) /
+ ( (this->time_length / 1000) - current_time)
+ );
+ }
+
+ lprintf ("current_pos is %" PRId64 "\n",current_pos);
+ lprintf ("new_pos is %" PRId64 "\n",start_pos);
+
+ } else {
+ /*seek using avg_bitrate*/
+ start_pos = start_time * this->avg_bitrate/8;
+ }
+
+ lprintf ("seeking to %d seconds => %" PRId64 " bytes\n",
+ start_time, start_pos);
+
+ }
+
+ ogg_sync_reset(&this->oy);
+
+ for (i=0; i<this->num_streams; i++) {
+ this->si[i]->header_granulepos = -1;
+ ogg_stream_reset(&this->si[i]->oss);
+ }
+
+ /*some strange streams have no syncpoint flag set at the beginning*/
+ if (start_pos == 0)
+ this->keyframe_needed = 0;
+
+ lprintf ("seek to %" PRId64 " called\n",start_pos);
+
+ this->input->seek (this->input, start_pos, SEEK_SET);
+
+ }
+
+ /* fixme - this would be a nice position to do the following tasks
+ 1. adjust an ogg videostream to a keyframe
+ 2. compare the keyframe_pts with start_time. if the difference is to
+ high (e.g. larger than max keyframe_intervall, do a new seek or
+ continue reading
+ 3. adjust the audiostreams in such a way, that the
+ difference is not to high.
+
+ In short words, do all the cleanups necessary to continue playback
+ without further actions
+ */
+
+ this->send_newpts = 1;
+ this->status = DEMUX_OK;
+
+ if( !playing ) {
+
+ this->buf_flag_seek = 0;
+
+ } else {
+ if (start_pos!=0) {
+ this->buf_flag_seek = 1;
+ /*each stream has to continue with a packet that has an
+ granulepos*/
+ for (i=0; i<this->num_streams; i++) {
+ this->si[i]->resync = 1;
+ }
+
+ this->start_pts=-1;
+ }
+
+ _x_demux_flush_engine(this->stream);
+ }
+
+ return this->status;
+}
+
+static int demux_ogg_get_stream_length (demux_plugin_t *this_gen) {
+
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+
+ if (this->time_length==-1){
+ if (this->avg_bitrate) {
+ return (int)((int64_t)1000 * this->input->get_length (this->input) * 8 /
+ this->avg_bitrate);
+ } else {
+ return 0;
+ }
+ } else {
+ return this->time_length;
+ }
+}
+
+static uint32_t demux_ogg_get_capabilities(demux_plugin_t *this_gen) {
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+ int cap_chapter = 0;
+
+ if (this->chapter_info)
+ cap_chapter = DEMUX_CAP_CHAPTERS;
+
+ return DEMUX_CAP_SPULANG | DEMUX_CAP_AUDIOLANG | cap_chapter;
+}
+
+static int format_lang_string (demux_ogg_t * this, uint32_t buf_mask, uint32_t buf_type, int channel, char *str) {
+ int stream_num;
+
+ for (stream_num=0; stream_num<this->num_streams; stream_num++) {
+ if ((this->si[stream_num]->buf_types & buf_mask) == buf_type) {
+ if (this->si[stream_num]->language) {
+ if (snprintf (str, XINE_LANG_MAX, "%s", this->si[stream_num]->language) >= XINE_LANG_MAX)
+ /* the string got truncated */
+ str[XINE_LANG_MAX - 2] = str[XINE_LANG_MAX - 3] = str[XINE_LANG_MAX - 4] = '.';
+ /* TODO: provide long version in XINE_META_INFO_FULL_LANG */
+ } else {
+ snprintf(str, XINE_LANG_MAX, "channel %d",channel);
+ }
+ return DEMUX_OPTIONAL_SUCCESS;
+ }
+ }
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+}
+
+static int demux_ogg_get_optional_data(demux_plugin_t *this_gen,
+ void *data, int data_type) {
+
+ demux_ogg_t *this = (demux_ogg_t *) this_gen;
+
+ char *str=(char *) data;
+ int channel = *((int *)data);
+
+ switch (data_type) {
+ case DEMUX_OPTIONAL_DATA_SPULANG:
+ lprintf ("DEMUX_OPTIONAL_DATA_SPULANG channel = %d\n",channel);
+ if (channel==-1) {
+ strcpy( str, "none");
+ return DEMUX_OPTIONAL_SUCCESS;
+ } else if ((channel>=0) && (channel<this->num_streams)) {
+ return format_lang_string (this, 0xFFFFFFFF, BUF_SPU_OGM+channel, channel, str);
+ }
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+ case DEMUX_OPTIONAL_DATA_AUDIOLANG:
+ lprintf ("DEMUX_OPTIONAL_DATA_AUDIOLANG channel = %d\n",channel);
+ if (channel==-1) {
+ return format_lang_string (this, 0xFF00001F, BUF_AUDIO_BASE, channel, str);
+ } else if ((channel>=0) && (channel<this->num_streams)) {
+ return format_lang_string (this, 0xFF00001F, BUF_AUDIO_BASE+channel, channel, str);
+ }
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+ default:
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+ }
+}
+
+static int detect_ogg_content (int detection_method, demux_class_t *class_gen,
+ input_plugin_t *input) {
+
+ switch (detection_method) {
+
+ case METHOD_BY_CONTENT: {
+ uint32_t header;
+
+ if (_x_demux_read_header(input, &header, 4) != 4)
+ return 0;
+
+ return !!( header == ME_FOURCC('O', 'g', 'g', 'S') );
+ }
+
+ case METHOD_BY_MRL:
+ case METHOD_EXPLICIT:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static int detect_anx_content (int detection_method, demux_class_t *class_gen,
+ input_plugin_t *input) {
+
+ if (detect_ogg_content(detection_method, class_gen, input) == 0)
+ return 0;
+
+ switch (detection_method) {
+
+#define ANNODEX_SIGNATURE_SEARCH 128
+
+ case METHOD_BY_CONTENT: {
+ uint8_t buf[ANNODEX_SIGNATURE_SEARCH];
+
+ if (_x_demux_read_header(input, buf, ANNODEX_SIGNATURE_SEARCH) !=
+ ANNODEX_SIGNATURE_SEARCH)
+ return 0;
+
+ /* scan for 'Annodex' signature in the first 64 bytes */
+ return !!memmem(buf, ANNODEX_SIGNATURE_SEARCH,
+ "Annodex", sizeof("Annodex")-1);
+ }
+
+#undef ANNODEX_SIGNATURE_SEARCH
+
+ case METHOD_BY_MRL:
+ case METHOD_EXPLICIT:
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+static demux_plugin_t *anx_open_plugin (demux_class_t *class_gen,
+ xine_stream_t *stream,
+ input_plugin_t *input) {
+
+ demux_ogg_t *this;
+ int i;
+
+ if (detect_anx_content(stream->content_detection_method, class_gen, input) == 0)
+ return NULL;
+
+ /*
+ * if we reach this point, the input has been accepted.
+ */
+
+ this = calloc(1, sizeof(demux_ogg_t));
+ this->stream = stream;
+ this->input = input;
+
+ /* the Annodex demuxer currently calls into exactly the same functions as
+ * the Ogg demuxer, which seems to make this function a bit redundant, but
+ * this design leaves us a bit more room to change an Annodex demuxer's
+ * behaviour in the future if necessary */
+ this->demux_plugin.send_headers = demux_ogg_send_headers;
+ this->demux_plugin.send_chunk = demux_ogg_send_chunk;
+ this->demux_plugin.seek = demux_ogg_seek;
+ this->demux_plugin.dispose = demux_ogg_dispose;
+ this->demux_plugin.get_status = demux_ogg_get_status;
+ this->demux_plugin.get_stream_length = demux_ogg_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_ogg_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_ogg_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->status = DEMUX_FINISHED;
+
+#ifdef HAVE_THEORA
+ theora_info_init (&this->t_info);
+ theora_comment_init (&this->t_comment);
+#endif
+
+ for (i = 0; i < XINE_STREAM_INFO_MAX; ++i)
+ this->meta[i] = NULL;
+ this->chapter_info = 0;
+ this->event_queue = xine_event_new_queue (this->stream);
+
+ return &this->demux_plugin;
+}
+
+static demux_plugin_t *ogg_open_plugin (demux_class_t *class_gen,
+ xine_stream_t *stream,
+ input_plugin_t *input) {
+
+ demux_ogg_t *this;
+ int i;
+
+ if (detect_ogg_content(stream->content_detection_method, class_gen, input) == 0)
+ return NULL;
+
+ /*
+ * if we reach this point, the input has been accepted.
+ */
+
+ this = calloc(1, sizeof(demux_ogg_t));
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_ogg_send_headers;
+ this->demux_plugin.send_chunk = demux_ogg_send_chunk;
+ this->demux_plugin.seek = demux_ogg_seek;
+ this->demux_plugin.dispose = demux_ogg_dispose;
+ this->demux_plugin.get_status = demux_ogg_get_status;
+ this->demux_plugin.get_stream_length = demux_ogg_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_ogg_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_ogg_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->status = DEMUX_FINISHED;
+
+#ifdef HAVE_THEORA
+ theora_info_init (&this->t_info);
+ theora_comment_init (&this->t_comment);
+#endif
+
+ this->chapter_info = 0;
+ for (i = 0; i < XINE_STREAM_INFO_MAX; ++i)
+ this->meta[i] = NULL;
+ this->event_queue = xine_event_new_queue (this->stream);
+
+ return &this->demux_plugin;
+}
+
+/*
+ * Annodex demuxer class
+ */
+static void *anx_init_class (xine_t *xine, void *data) {
+ demux_anx_class_t *this;
+
+ this = calloc(1, sizeof(demux_anx_class_t));
+
+ this->demux_class.open_plugin = anx_open_plugin;
+ this->demux_class.description = N_("Annodex demux plugin");
+ this->demux_class.identifier = "Annodex";
+ this->demux_class.mimetypes =
+ "application/annodex: anx: Annodex media;"
+ "application/x-annodex: anx: Annodex media;"
+ "audio/annodex: axa: Annodex audio;"
+ "audio/x-annodex: axa: Annodex audio;"
+ "video/annodex: axv: Annodex video;"
+ "video/x-annodex: axv: Annodex video;";
+ this->demux_class.extensions = "anx axa axv";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
+
+/*
+ * ogg demuxer class
+ */
+static void *ogg_init_class (xine_t *xine, void *data) {
+ demux_ogg_class_t *this;
+
+ this = calloc(1, sizeof(demux_ogg_class_t));
+
+ this->demux_class.open_plugin = ogg_open_plugin;
+ this->demux_class.description = N_("OGG demux plugin");
+ this->demux_class.identifier = "OGG";
+ this->demux_class.mimetypes =
+ "application/ogg: ogx: Ogg Stream;"
+ "application/x-ogm: ogx: Ogg Stream;"
+ "application/x-ogm-audio: oga: Ogg Audio;"
+ "application/x-ogm-video: ogv: Ogg Video;"
+ "application/x-ogg: ogx: Ogg Stream;"
+ "audio/ogg: oga: Ogg Audio;"
+ "audio/x-ogg: oga: Ogg Audio;"
+ "video/ogg: ogv: Ogg Video;";
+ "video/x-ogg: ogv: Ogg Video;";
+ this->demux_class.extensions = "ogx ogv oga ogg spx ogm";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+static const demuxer_info_t demux_info_anx = {
+ 20 /* priority */
+};
+
+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, 27, "ogg", XINE_VERSION_CODE, &demux_info_ogg, ogg_init_class },
+ { PLUGIN_DEMUX, 27, "anx", XINE_VERSION_CODE, &demux_info_anx, anx_init_class },
+#ifdef HAVE_VORBIS
+ { PLUGIN_AUDIO_DECODER, 16, "vorbis", XINE_VERSION_CODE, &dec_info_vorbis, vorbis_init_plugin },
+#endif
+#ifdef HAVE_SPEEX
+ { PLUGIN_AUDIO_DECODER, 16, "speex", XINE_VERSION_CODE, &dec_info_speex, speex_init_plugin },
+#endif
+#ifdef HAVE_THEORA
+ { PLUGIN_VIDEO_DECODER, 19, "theora", XINE_VERSION_CODE, &dec_info_theora, theora_init_plugin },
+#endif
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/combined/xine_speex_decoder.c b/src/combined/xine_speex_decoder.c
new file mode 100644
index 000000000..acdf5e394
--- /dev/null
+++ b/src/combined/xine_speex_decoder.c
@@ -0,0 +1,404 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * (ogg/)speex audio decoder plugin (libspeex wrapper) for xine
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#define LOG_MODULE "speex_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+#define LOG_BUFFERS 0
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+
+#include <ogg/ogg.h>
+
+#include <speex/speex.h>
+#include <speex/speex_header.h>
+#include <speex/speex_callbacks.h>
+#include <speex/speex_stereo.h>
+
+#define MAX_FRAME_SIZE 2000
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} speex_class_t;
+
+typedef struct speex_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ int64_t pts;
+
+ int output_sampling_rate;
+ int output_open;
+ int output_mode;
+
+ /* speex stuff */
+ void *st;
+ int frame_size;
+ int rate;
+ int nframes;
+ int channels;
+ SpeexBits bits;
+ SpeexStereoState stereo;
+ int expect_metadata;
+
+ int header_count;
+
+ xine_stream_t *stream;
+
+} speex_decoder_t;
+
+
+static void speex_reset (audio_decoder_t *this_gen) {
+
+ speex_decoder_t *this = (speex_decoder_t *) this_gen;
+
+ speex_bits_init (&this->bits);
+}
+
+static void speex_discontinuity (audio_decoder_t *this_gen) {
+
+ speex_decoder_t *this = (speex_decoder_t *) this_gen;
+
+ this->pts=0;
+}
+
+/* Known speex comment keys from ogg123 sources*/
+static const struct {
+ char key[16]; /* includes the '=' for programming convenience */
+ int xine_metainfo_index;
+} speex_comment_keys[] = {
+ {"ARTIST=", XINE_META_INFO_ARTIST},
+ {"ALBUM=", XINE_META_INFO_ALBUM},
+ {"TITLE=", XINE_META_INFO_TITLE},
+ {"GENRE=", XINE_META_INFO_GENRE},
+ {"DESCRIPTION=", XINE_META_INFO_COMMENT},
+ {"DATE=", XINE_META_INFO_YEAR}
+};
+
+#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \
+ ((buf[base+2]<<16)&0xff0000)| \
+ ((buf[base+1]<<8)&0xff00)| \
+ (buf[base]&0xff))
+
+static
+void read_metadata (speex_decoder_t *this, char * comments, int length)
+{
+ char * c = comments;
+ int len, i, nb_fields;
+ char * end;
+
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "speex");
+
+ if (length < 8) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
+ return;
+ }
+
+ end = c+length;
+ len = readint (c, 0);
+ c += 4;
+
+ if (c+len > end) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
+ return;
+ }
+
+#ifdef LOG
+ /* Encoder */
+ printf ("libspeex: ");
+ fwrite (c, 1, len, stdout);
+ printf ("\n");
+#endif
+
+ c += len;
+
+ if (c+4 > end) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
+ return;
+ }
+
+ nb_fields = readint (c, 0);
+ c += 4;
+
+ for (i = 0; i < nb_fields; i++) {
+ if (c+4 > end) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
+ return;
+ }
+
+ len = readint (c, 0);
+ c += 4;
+ if (c+len > end) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
+ return;
+ }
+
+#ifdef LOG
+ printf ("libspeex: ");
+ fwrite (c, 1, len, stdout);
+ printf ("\n");
+#endif
+
+ for (i = 0; i < (sizeof(speex_comment_keys)/sizeof(speex_comment_keys[0])); i++) {
+ size_t keylen = strlen(speex_comment_keys[i].key);
+
+ if ( !strncasecmp (speex_comment_keys[i].key, c,
+ keylen) ) {
+ char meta_info[(len - keylen) + 1];
+
+ lprintf ("known metadata %d %d\n",
+ i, speex_comment_keys[i].xine_metainfo_index);
+
+ strncpy(meta_info, &c[keylen], len-keylen);
+ _x_meta_info_set_utf8(this->stream, speex_comment_keys[i].xine_metainfo_index, meta_info);
+ }
+ }
+
+ c += len;
+ }
+}
+
+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);
+
+ if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
+ !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) {
+ lprintf ("preview buffer, %d headers to go\n", this->header_count);
+
+ if (this->header_count) {
+
+ if (!this->st) {
+ SpeexMode * spx_mode;
+ SpeexHeader * spx_header;
+ unsigned int modeID;
+ int bitrate;
+
+ speex_bits_init (&this->bits);
+
+ 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");
+ return;
+ }
+
+ modeID = (unsigned int)spx_header->mode;
+ if (modeID >= SPEEX_NB_MODES) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": invalid mode ID %u\n", modeID);
+ return;
+ }
+
+ spx_mode = (SpeexMode *) speex_mode_list[modeID];
+
+ if (spx_mode->bitstream_version != spx_header->mode_bitstream_version) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: incompatible Speex mode bitstream version\n");
+ return;
+ }
+
+ this->st = speex_decoder_init (spx_mode);
+ if (!this->st) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: decoder initialization failed\n");
+ return;
+ }
+
+ this->rate = spx_header->rate;
+ speex_decoder_ctl (this->st, SPEEX_SET_SAMPLING_RATE, &this->rate);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE,
+ this->rate);
+
+ this->channels = spx_header->nb_channels;
+ if (this->channels == 2) {
+ SpeexCallback callback;
+
+ callback.callback_id = SPEEX_INBAND_STEREO;
+ callback.func = speex_std_stereo_request_handler;
+ callback.data = &this->stereo;
+ speex_decoder_ctl (this->st, SPEEX_SET_HANDLER, &callback);
+ }
+
+ this->nframes = spx_header->frames_per_packet;
+ if (!this->nframes) this->nframes = 1;
+
+ speex_decoder_ctl (this->st, SPEEX_GET_FRAME_SIZE, &this->frame_size);
+
+ speex_decoder_ctl (this->st, SPEEX_GET_BITRATE, &bitrate);
+ if (bitrate <= 1) bitrate = 16000; /* assume 16 kbit */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, bitrate);
+
+ this->header_count += spx_header->extra_headers;
+ this->expect_metadata = 1;
+
+ free (spx_header);
+ } else if (this->expect_metadata) {
+ read_metadata (this, buf_content, buf->size);
+ }
+
+ this->header_count--;
+
+ if (!this->header_count) {
+ int mode = _x_ao_channels2mode(this->channels);
+
+ if (!this->output_open) {
+ this->output_open =
+ (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream,
+ 16,
+ this->rate,
+ mode);
+ lprintf ("this->output_open after attempt is %d\n", this->output_open);
+ }
+ }
+ }
+
+ } else if (this->output_open) {
+ 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);
+
+ for (j = 0; j < this->nframes; j++) {
+ int ret;
+ int bitrate;
+
+ ret = speex_decode_int (this->st, &this->bits, audio_buffer->mem);
+
+ if (ret==-1)
+ break;
+ if (ret==-2) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: Decoding error, corrupted stream?\n");
+ break;
+ }
+ if (speex_bits_remaining(&this->bits)<0) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: Decoding overflow, corrupted stream?\n");
+ break;
+ }
+
+ if (this->channels == 2) {
+ speex_decode_stereo_int (audio_buffer->mem, this->frame_size, &this->stereo);
+ }
+
+ speex_decoder_ctl (this->st, SPEEX_GET_BITRATE, &bitrate);
+ if (bitrate <= 1) bitrate = 16000; /* assume 16 kbit */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, bitrate);
+
+ audio_buffer->vpts = this->pts;
+ this->pts=0;
+ audio_buffer->num_frames = this->frame_size;
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+ buf->pts=0;
+
+ }
+ }
+ else {
+ llprintf (LOG_BUFFERS, "output not open\n");
+ }
+}
+
+static void speex_dispose (audio_decoder_t *this_gen) {
+
+ speex_decoder_t *this = (speex_decoder_t *) this_gen;
+
+ if (this->st) {
+ speex_decoder_destroy (this->st);
+ }
+ speex_bits_destroy (&this->bits);
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
+ xine_stream_t *stream) {
+
+ speex_decoder_t *this ;
+ static SpeexStereoState init_stereo = SPEEX_STEREO_STATE_INIT;
+
+ this = (speex_decoder_t *) calloc(1, sizeof(speex_decoder_t));
+
+ this->audio_decoder.decode_data = speex_decode_data;
+ this->audio_decoder.reset = speex_reset;
+ this->audio_decoder.discontinuity = speex_discontinuity;
+ this->audio_decoder.dispose = speex_dispose;
+ this->stream = stream;
+
+ this->output_open = 0;
+ this->header_count = 1;
+ this->expect_metadata = 0;
+
+ this->st = NULL;
+
+ this->channels = 1;
+
+ memcpy (&this->stereo, &init_stereo, sizeof (SpeexStereoState));
+
+ return (audio_decoder_t *) this;
+}
+
+/*
+ * speex plugin class
+ */
+
+void *speex_init_plugin (xine_t *xine, void *data) {
+
+ speex_class_t *this;
+
+ this = (speex_class_t *) calloc(1, sizeof(speex_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "speex";
+ this->decoder_class.description = N_("Speex audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_SPEEX, 0
+ };
+
+const decoder_info_t dec_info_speex = {
+ audio_types, /* supported types */
+ 5 /* priority */
+};
diff --git a/src/combined/xine_theora_decoder.c b/src/combined/xine_theora_decoder.c
new file mode 100644
index 000000000..fbea502ca
--- /dev/null
+++ b/src/combined/xine_theora_decoder.c
@@ -0,0 +1,369 @@
+/*
+ * Copyright (C) 2001-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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * xine decoder plugin using libtheora
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <inttypes.h>
+#include <string.h>
+#include <pthread.h>
+#include <math.h>
+#include <assert.h>
+#include <theora/theora.h>
+
+#define LOG_MODULE "theora_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/metronom.h>
+#include <xine/xineutils.h>
+
+typedef struct theora_class_s {
+ video_decoder_class_t decoder_class;
+} theora_class_t;
+
+typedef struct theora_decoder_s {
+ video_decoder_t theora_decoder;
+ theora_class_t *class;
+ theora_info t_info;
+ theora_comment t_comment;
+ theora_state t_state;
+ ogg_packet op;
+ yuv_buffer yuv;
+ xine_stream_t* stream;
+ int reject;
+ int op_max_size;
+ unsigned char* packet;
+ int done;
+ int width, height;
+ double ratio;
+ int offset_x, offset_y;
+ int frame_duration;
+ int skipframes;
+ int hp_read;
+ int initialized;
+} theora_decoder_t;
+
+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;
+ this->packet=realloc(this->packet, this->op_max_size);
+ this->op.packet=this->packet;
+ }
+ xine_fast_memcpy ( this->packet+this->done, src, size);
+ this->done=this->done+size;
+}
+
+static void yuv2frame(yuv_buffer *yuv, vo_frame_t *frame, int offset_x, int offset_y) {
+ int i;
+ int crop_offset;
+
+ /* fixme - direct rendering (exchaning pointers) may be possible.
+ * frame->base[0] = yuv->y could work if one could change the
+ * pitches[0,1,2] values, and rely on the drawing routine using
+ * the new pitches. With cropping and offsets, it's a bit trickier,
+ * but it would still be possible.
+ * Attempts at doing this have yielded nothing but SIGSEVs so far.
+ */
+
+ /* Copy yuv data onto the frame. Cropping and offset as specified
+ * by the frame_width, frame_height, offset_x and offset_y fields
+ * in the theora header is carried out.
+ */
+
+ crop_offset=offset_x+yuv->y_stride*offset_y;
+ for(i=0;i<frame->height;i++)
+ xine_fast_memcpy(frame->base[0]+frame->pitches[0]*i,
+ yuv->y+crop_offset+yuv->y_stride*i,
+ frame->width);
+
+ crop_offset=(offset_x/2)+(yuv->uv_stride)*(offset_y/2);
+ for(i=0;i<frame->height/2;i++){
+ xine_fast_memcpy(frame->base[1]+frame->pitches[1]*i,
+ yuv->u+crop_offset+yuv->uv_stride*i,
+ frame->width/2);
+ xine_fast_memcpy(frame->base[2]+frame->pitches[2]*i,
+ yuv->v+crop_offset+yuv->uv_stride*i,
+ frame->width/2);
+
+ }
+}
+
+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*/
+
+ 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));
+ this->op.packet=this->packet;
+
+ readin_op (this, buf->content + sizeof(ogg_packet), buf->size - sizeof(ogg_packet) );
+ /*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*/
+ printf ("libtheora: rejecting packet\n");
+ this->reject=1;
+ return 0;
+ }
+ readin_op (this, buf->content, buf->size );
+ }
+
+ if ((buf->decoder_flags & BUF_FLAG_FRAME_END) && !this->reject) {
+ if ( this->done != this->op.bytes ) {
+ printf ("libtheora: A packet changed its size during transfer - rejected\n");
+ printf (" size %d should be %ld\n", this->done , this->op.bytes);
+ this->op.bytes=this->done;
+ }
+ return 1;
+ }
+ return 0;
+}
+
+static void theora_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
+ /*
+ * decode data from buf and feed decoded frames to
+ * video output
+ */
+ theora_decoder_t *this = (theora_decoder_t *) this_gen;
+ vo_frame_t *frame;
+ yuv_buffer yuv;
+ int ret;
+
+ if (!collect_data(this, buf)) return;
+ /*return, until a entire packets is collected*/
+
+ if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
+ !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) {
+ /*get the first 3 packets and decode the header during preview*/
+
+ if (this->hp_read==0) {
+ /*decode first hp*/
+ if (theora_decode_header(&this->t_info, &this->t_comment, &this->op)>=0) {
+ this->hp_read++;
+ return;
+ }
+ }
+
+ if (this->hp_read==1) {
+ /*decode three header packets*/
+ if (theora_decode_header(&this->t_info, &this->t_comment,&this->op)) {
+ printf ("libtheora: Was unable to decode header #%d, corrupt stream?\n",this->hp_read);
+ } else {
+ this->hp_read++;
+ return;
+ }
+ }
+
+ if (this->hp_read==2) {
+ if (theora_decode_header(&this->t_info, &this->t_comment,&this->op)) {
+ printf ("libtheora: Was unable to decode header #%d, corrupt stream?\n",this->hp_read);
+ }
+ /*headers are now decoded. initialize the decoder*/
+ theora_decode_init (&this->t_state, &this->t_info);
+
+ lprintf("theora stream is Theora %dx%d %.02f fps video.\n"
+ " frame content is %dx%d with offset (%d,%d).\n"
+ " pixel aspect is %d:%d.\n",
+ this->t_info.width,this->t_info.height,
+ (double)this->t_info.fps_numerator/this->t_info.fps_denominator,
+ this->t_info.frame_width, this->t_info.frame_height,
+ this->t_info.offset_x, this->t_info.offset_y,
+ this->t_info.aspect_numerator, this->t_info.aspect_denominator);
+
+ this->frame_duration=((int64_t)90000*this->t_info.fps_denominator)/this->t_info.fps_numerator;
+ this->width=this->t_info.frame_width;
+ this->height=this->t_info.frame_height;
+ if (this->t_info.aspect_numerator==0 || this->t_info.aspect_denominator==0)
+ /* 0-values are undefined, so don't do any scaling. */
+ this->ratio=(double)this->width/(double)this->height;
+ else
+ /* Yes, this video needs to be scaled. */
+ this->ratio=(double)(this->width*this->t_info.aspect_numerator) /
+ (double)(this->height*this->t_info.aspect_denominator);
+ this->offset_x=this->t_info.offset_x;
+ this->offset_y=this->t_info.offset_y;
+ this->initialized=1;
+ this->hp_read++;
+ }
+
+ } else if (buf->decoder_flags & BUF_FLAG_HEADER) {
+ /*ignore headerpackets*/
+
+ return;
+
+ } else {
+ /*decode videodata*/
+
+ if (!this->initialized) {
+ printf ("libtheora: cannot decode stream without header\n");
+ return;
+ }
+
+ ret=theora_decode_packetin( &this->t_state, &this->op);
+
+ if ( ret!=0) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "libtheora:Received an bad packet\n");
+ } else if (!this->skipframes) {
+
+ theora_decode_YUVout(&this->t_state,&yuv);
+
+ /*fixme - aspectratio from theora is not considered*/
+ frame = this->stream->video_out->get_frame( this->stream->video_out,
+ this->width, this->height,
+ this->ratio,
+ XINE_IMGFMT_YV12,
+ VO_BOTH_FIELDS);
+ yuv2frame(&yuv, frame, this->offset_x, this->offset_y);
+
+ frame->pts = buf->pts;
+ frame->duration=this->frame_duration;
+ this->skipframes=frame->draw(frame, this->stream);
+ frame->free(frame);
+ } else {
+ this->skipframes=this->skipframes-1;
+ }
+ }
+}
+
+
+static void theora_flush (video_decoder_t *this_gen) {
+ /*
+ * flush out any frames that are still stored in the decoder
+ */
+ theora_decoder_t *this = (theora_decoder_t *) this_gen;
+ this->skipframes=0;
+}
+
+static void theora_reset (video_decoder_t *this_gen) {
+ /*
+ * reset decoder after engine flush (prepare for new
+ * video data not related to recently decoded data)
+ */
+ theora_decoder_t *this = (theora_decoder_t *) this_gen;
+ this->skipframes=0;
+}
+
+static void theora_discontinuity (video_decoder_t *this_gen) {
+ /*
+ * inform decoder that a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
+ theora_decoder_t *this = (theora_decoder_t *) this_gen;
+ this->skipframes=0;
+}
+
+static void theora_dispose (video_decoder_t *this_gen) {
+ /*
+ * close down, free all resources
+ */
+
+ theora_decoder_t *this = (theora_decoder_t *) this_gen;
+
+ lprintf ("dispose \n");
+
+ theora_clear (&this->t_state);
+ theora_comment_clear (&this->t_comment);
+ theora_info_clear (&this->t_info);
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ free (this->packet);
+ free (this);
+}
+
+static video_decoder_t *theora_open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ /*
+ * open a new instance of this plugin class
+ */
+
+ theora_decoder_t *this ;
+
+ this = (theora_decoder_t *) calloc(1, sizeof(theora_decoder_t));
+
+ this->theora_decoder.decode_data = theora_decode_data;
+ this->theora_decoder.flush = theora_flush;
+ this->theora_decoder.reset = theora_reset;
+ this->theora_decoder.discontinuity = theora_discontinuity;
+ this->theora_decoder.dispose = theora_dispose;
+
+ this->stream = stream;
+ this->class = (theora_class_t *) class_gen;
+
+ this->op_max_size = 4096;
+ this->packet = malloc(this->op_max_size);
+
+ this->done = 0;
+
+ this->stream = stream;
+
+ this->initialized = 0;
+
+ theora_comment_init (&this->t_comment);
+ theora_info_init (&this->t_info);
+ (stream->video_out->open) (stream->video_out, stream);
+
+ return &this->theora_decoder;
+
+}
+
+/*
+ * theora plugin class
+ */
+void *theora_init_plugin (xine_t *xine, void *data) {
+ /*initialize our plugin*/
+ theora_class_t *this;
+
+ this = (theora_class_t *) calloc(1, sizeof(theora_class_t));
+
+ this->decoder_class.open_plugin = theora_open_plugin;
+ this->decoder_class.identifier = "theora video";
+ this->decoder_class.description = N_("theora video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 };
+
+const decoder_info_t dec_info_theora = {
+ supported_types, /* supported types */
+ 5 /* priority */
+};
diff --git a/src/combined/xine_vorbis_decoder.c b/src/combined/xine_vorbis_decoder.c
new file mode 100644
index 000000000..9864177d6
--- /dev/null
+++ b/src/combined/xine_vorbis_decoder.c
@@ -0,0 +1,366 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+
+#define LOG_MODULE "vorbis_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+
+#include <ogg/ogg.h>
+#include <vorbis/codec.h>
+
+#define MAX_NUM_SAMPLES 4096
+#define INIT_BUFSIZE 8192
+
+typedef struct {
+ audio_decoder_class_t decoder_class;
+} vorbis_class_t;
+
+typedef struct vorbis_decoder_s {
+ audio_decoder_t audio_decoder;
+
+ int64_t pts;
+
+ int output_sampling_rate;
+ int output_open;
+ int output_mode;
+
+ ogg_packet op; /* we must use this struct to sent data to libvorbis */
+
+ /* vorbis stuff */
+ vorbis_info vi; /* stores static vorbis bitstream settings */
+ vorbis_comment vc;
+ vorbis_dsp_state vd; /* central working state for packet->PCM decoder */
+ vorbis_block vb; /* local working state for packet->PCM decoder */
+
+ int16_t convbuffer[MAX_NUM_SAMPLES];
+ int convsize;
+
+ int header_count;
+
+ xine_stream_t *stream;
+
+ /* data accumulation stuff */
+ unsigned char *buf;
+ int bufsize;
+ int size;
+
+} vorbis_decoder_t;
+
+
+static void vorbis_reset (audio_decoder_t *this_gen) {
+
+ vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
+
+ if( this->header_count ) return;
+ this->size = 0;
+
+ /* clear block first, as it might contain allocated data */
+ vorbis_block_clear(&this->vb);
+ vorbis_block_init(&this->vd,&this->vb);
+}
+
+static void vorbis_discontinuity (audio_decoder_t *this_gen) {
+
+ vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
+
+ this->pts=0;
+}
+
+/* Known vorbis comment keys from ogg123 sources*/
+static const struct {
+ const char *key; /* includes the '=' for programming convenience */
+ int xine_metainfo_index;
+} vorbis_comment_keys[] = {
+ {"ARTIST=", XINE_META_INFO_ARTIST},
+ {"ALBUM=", XINE_META_INFO_ALBUM},
+ {"TITLE=", XINE_META_INFO_TITLE},
+ {"GENRE=", XINE_META_INFO_GENRE},
+ {"DESCRIPTION=", XINE_META_INFO_COMMENT},
+ {"COMMENT=", XINE_META_INFO_COMMENT},
+ {"DATE=", XINE_META_INFO_YEAR},
+ {"TRACKNUMBER=", XINE_META_INFO_TRACK_NUMBER},
+ {NULL, 0}
+};
+
+static void get_metadata (vorbis_decoder_t *this) {
+
+ char **ptr=this->vc.user_comments;
+ while(*ptr){
+
+ char *comment = *ptr;
+ int i;
+
+ lprintf("%s\n", comment);
+
+ for (i = 0; vorbis_comment_keys[i].key != NULL; i++) {
+
+ if ( !strncasecmp (vorbis_comment_keys[i].key, comment,
+ strlen(vorbis_comment_keys[i].key)) ) {
+
+ lprintf ("known metadata %d %d\n",
+ i, vorbis_comment_keys[i].xine_metainfo_index);
+
+ _x_meta_info_set_utf8(this->stream, vorbis_comment_keys[i].xine_metainfo_index,
+ comment + strlen(vorbis_comment_keys[i].key));
+
+ }
+ }
+ ++ptr;
+ }
+
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "vorbis");
+}
+
+static void vorbis_check_bufsize (vorbis_decoder_t *this, int size) {
+ if (size > this->bufsize) {
+ this->bufsize = size + size / 2;
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("vorbis: increasing buffer to %d to avoid overflow.\n"),
+ this->bufsize);
+ this->buf = realloc(this->buf, this->bufsize);
+ }
+}
+
+static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
+
+ vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
+
+ memset( &this->op, 0, sizeof(this->op) );
+
+ /* data accumulation */
+ vorbis_check_bufsize(this, this->size + buf->size);
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+ this->size += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+ this->op.packet = this->buf;
+ this->op.bytes = this->size;
+
+ /* reset accumultaion buffer */
+ this->size = 0;
+
+ if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
+ !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) {
+
+ lprintf ("%d headers to go\n", this->header_count);
+
+ if (this->header_count) {
+ int res = 0;
+
+ if (this->header_count == 3)
+ this->op.b_o_s = 1;
+
+ if ( (res = vorbis_synthesis_headerin(&this->vi,&this->vc,&this->op)) < 0 ) {
+ /* error case; not a vorbis header */
+ xine_log(this->stream->xine, XINE_LOG_MSG, "libvorbis: this bitstream does not contain vorbis audio data. Following first 64 bytes (return: %d).\n", res);
+ xine_hexdump((char *)this->op.packet, this->op.bytes < 64 ? this->op.bytes : 64);
+ return;
+ }
+
+ this->header_count--;
+
+ if (!this->header_count) {
+
+ int mode = AO_CAP_MODE_MONO;
+
+ get_metadata (this);
+
+ mode = _x_ao_channels2mode(this->vi.channels);
+
+ this->convsize=MAX_NUM_SAMPLES/this->vi.channels;
+
+ if (!this->output_open) {
+ this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
+ this->stream,
+ 16,
+ this->vi.rate,
+ mode) ;
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
+ this->vi.bitrate_nominal);
+
+ }
+
+ /* OK, got and parsed all three headers. Initialize the Vorbis
+ * packet->PCM decoder. */
+ lprintf("all three headers parsed. initializing decoder.\n");
+ /* initialize central decode state */
+ vorbis_synthesis_init(&this->vd,&this->vi);
+ /* initialize local state for most of the decode so multiple
+ * block decodes can proceed in parallel. We could init
+ * multiple vorbis_block structures for vd here */
+ vorbis_block_init(&this->vd,&this->vb);
+ }
+ }
+
+ } else if (this->output_open) {
+
+ float **pcm;
+ int samples;
+
+ if(vorbis_synthesis(&this->vb,&this->op)==0)
+ vorbis_synthesis_blockin(&this->vd,&this->vb);
+
+ if (buf->pts!=0)
+ this->pts=buf->pts;
+
+ while ((samples=vorbis_synthesis_pcmout(&this->vd,&pcm))>0){
+
+ /* **pcm is a multichannel float vector. In stereo, for
+ * example, pcm[0][...] is left, and pcm[1][...] is right.
+ * samples is the size of each channel. Convert the float
+ * values (-1.<=range<=1.) to whatever PCM format and write
+ * it out
+ */
+
+ int i,j;
+ int bout=(samples<this->convsize?samples:this->convsize);
+ audio_buffer_t *audio_buffer;
+
+ audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
+
+ /* convert floats to 16 bit signed ints (host order) and
+ interleave */
+ for(i=0;i<this->vi.channels;i++){
+ ogg_int16_t *ptr=audio_buffer->mem+i;
+ float *mono=pcm[i];
+ for(j=0;j<bout;j++){
+ int val=(mono[j] + 1.0f) * 32768.f;
+ val -= 32768;
+ /* might as well guard against clipping */
+ if(val>32767){
+ val=32767;
+ } else if(val<-32768){
+ val=-32768;
+ }
+ *ptr=val;
+ ptr+=this->vi.channels;
+ }
+ }
+
+ audio_buffer->vpts = this->pts;
+ this->pts=0;
+ audio_buffer->num_frames = bout;
+
+ this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
+
+ buf->pts=0;
+
+ /* tell libvorbis how many samples we actually consumed */
+ vorbis_synthesis_read(&this->vd,bout);
+ }
+ } else {
+ lprintf("output not open\n");
+ }
+ }
+}
+
+static void vorbis_dispose (audio_decoder_t *this_gen) {
+
+ vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
+
+ if( !this->header_count ) {
+ lprintf("deinitializing decoder\n");
+
+ vorbis_block_clear(&this->vb);
+ vorbis_dsp_clear(&this->vd);
+ }
+
+ vorbis_comment_clear(&this->vc);
+
+ vorbis_info_clear(&this->vi); /* must be called last */
+
+ if (this->output_open)
+ this->stream->audio_out->close (this->stream->audio_out, this->stream);
+
+ lprintf("libvorbis instance destroyed\n");
+
+ free (this_gen);
+}
+
+static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
+ xine_stream_t *stream) {
+
+ vorbis_decoder_t *this ;
+
+ this = (vorbis_decoder_t *) calloc(1, sizeof(vorbis_decoder_t));
+
+ this->audio_decoder.decode_data = vorbis_decode_data;
+ this->audio_decoder.reset = vorbis_reset;
+ this->audio_decoder.discontinuity = vorbis_discontinuity;
+ this->audio_decoder.dispose = vorbis_dispose;
+ this->stream = stream;
+
+ this->output_open = 0;
+ this->header_count = 3;
+ this->convsize = 0;
+
+ this->bufsize = INIT_BUFSIZE;
+ this->buf = calloc(1, INIT_BUFSIZE);
+ this->size = 0;
+
+ vorbis_info_init(&this->vi);
+ vorbis_comment_init(&this->vc);
+
+ lprintf("libvorbis decoder instance created\n");
+
+ return (audio_decoder_t *) this;
+}
+
+/*
+ * vorbis plugin class
+ */
+void *vorbis_init_plugin (xine_t *xine, void *data) {
+
+ vorbis_class_t *this;
+
+ this = (vorbis_class_t *) calloc(1, sizeof(vorbis_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "vorbis";
+ this->decoder_class.description = N_("vorbis audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
+
+ return this;
+}
+
+static const uint32_t audio_types[] = {
+ BUF_AUDIO_VORBIS, 0
+ };
+
+const decoder_info_t dec_info_vorbis = {
+ audio_types, /* supported types */
+ 5 /* priority */
+};
diff --git a/src/demuxers/Makefile.am b/src/demuxers/Makefile.am
index 01ec2a93e..32b5616f7 100644
--- a/src/demuxers/Makefile.am
+++ b/src/demuxers/Makefile.am
@@ -1,35 +1,38 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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_"
+
+noinst_HEADERS = asfheader.h qtpalette.h group_games.h group_audio.h id3.h ebml.h matroska.h demux_matroska.h iff.h flacutils.h real_common.h
-if BUILD_ASF
+if ENABLE_ASF
asf_module = xineplug_dmx_asf.la
endif
-if BUILD_NOSEFART
-nsf_demuxer = demux_nsf.c
+if ENABLE_MNG
+mng_module = xineplug_dmx_mng.la
endif
-if HAVE_LIBMNG
-mng_module = xineplug_dmx_mng.la
+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 \
@@ -49,17 +52,16 @@ xineplug_LTLIBRARIES = $(ogg_module) $(asf_module) $(mng_module) $(image_module)
xineplug_dmx_nsv.la \
xineplug_dmx_matroska.la \
xineplug_dmx_iff.la \
- xineplug_dmx_flv.la
-
-xineplug_dmx_ogg_la_SOURCES = demux_ogg.c
-xineplug_dmx_ogg_la_LIBADD = $(XINE_LIB) $(VORBIS_LIBS) $(SPEEX_LIBS) $(THEORA_LIBS) $(OGG_LIBS) $(LTLIBINTL)
-xineplug_dmx_ogg_la_CFLAGS = $(AM_CFLAGS) $(VORBIS_CFLAGS) $(SPEEX_CFLAGS) $(THEORA_CFLAGS) $(OGG_CFLAGS)
+ xineplug_dmx_flv.la \
+ xineplug_dmx_playlist.la \
+ xineplug_dmx_vc1_es.la
xineplug_dmx_avi_la_SOURCES = demux_avi.c
xineplug_dmx_avi_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
xineplug_dmx_mpeg_block_la_SOURCES = demux_mpeg_block.c
-xineplug_dmx_mpeg_block_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_dmx_mpeg_block_la_CFLAGS = $(AM_CFLAGS) $(AVUTIL_CFLAGS)
+xineplug_dmx_mpeg_block_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(AVUTIL_LIBS)
xineplug_dmx_mpeg_la_SOURCES = demux_mpeg.c
xineplug_dmx_mpeg_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
@@ -67,15 +69,20 @@ xineplug_dmx_mpeg_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
xineplug_dmx_mpeg_elem_la_SOURCES = demux_elem.c
xineplug_dmx_mpeg_elem_la_LIBADD = $(XINE_LIB)
+xineplug_dmx_vc1_es_la_SOURCES = demux_vc1es.c
+xineplug_dmx_vc1_es_la_LIBADD = $(XINE_LIB)
+
xineplug_dmx_mpeg_pes_la_SOURCES = demux_mpeg_pes.c
-xineplug_dmx_mpeg_pes_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_dmx_mpeg_pes_la_CFLAGS = $(AM_CFLAGS) $(AVUTIL_CFLAGS)
+xineplug_dmx_mpeg_pes_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(AVUTIL_LIBS)
xineplug_dmx_mpeg_ts_la_SOURCES = demux_ts.c
-xineplug_dmx_mpeg_ts_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+xineplug_dmx_mpeg_ts_la_CFLAGS = $(AM_CFLAGS) $(AVUTIL_CFLAGS)
+xineplug_dmx_mpeg_ts_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(AVUTIL_LIBS)
xineplug_dmx_qt_la_SOURCES = demux_qt.c
-xineplug_dmx_qt_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS) $(LTLIBINTL)
-xineplug_dmx_qt_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
+xineplug_dmx_qt_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(ZLIB_LIBS)
+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)
@@ -95,7 +102,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)
@@ -105,17 +112,21 @@ xineplug_dmx_games_la_SOURCES = group_games.c demux_eawve.c \
demux_vqa.c demux_wc3movie.c demux_str.c \
demux_film.c demux_smjpeg.c demux_4xm.c \
demux_vmd.c
+xineplug_dmx_games_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
xineplug_dmx_games_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
xineplug_dmx_audio_la_SOURCES = group_audio.c demux_aud.c demux_aiff.c \
- demux_cdda.c demux_mpgaudio.c $(nsf_demuxer) \
+ 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)
@@ -130,9 +141,9 @@ xineplug_dmx_nsv_la_SOURCES = demux_nsv.c
xineplug_dmx_nsv_la_LIBADD = $(XINE_LIB)
xineplug_dmx_matroska_la_SOURCES = demux_matroska.c demux_matroska-chapters.c ebml.c
-xineplug_dmx_matroska_la_LIBADD = $(XINE_LIB) $(ZLIB_LIBS) $(LTLIBINTL)
-xineplug_dmx_matroska_la_CPPFLAGS = $(ZLIB_CPPFLAGS)
+xineplug_dmx_matroska_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(ZLIB_LIBS)
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)
@@ -140,5 +151,5 @@ 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 demux_matroska.h iff.h flacutils.h real_common.h
+xineplug_dmx_playlist_la_SOURCES = demux_playlist.c
+xineplug_dmx_playlist_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
diff --git a/src/demuxers/asfheader.c b/src/demuxers/asfheader.c
index 5b309b76b..9810aead9 100644
--- a/src/demuxers/asfheader.c
+++ b/src/demuxers/asfheader.c
@@ -17,7 +17,7 @@
#define LOG
*/
-#include "xineutils.h"
+#include <xine/xineutils.h>
#include "bswap.h"
#include "asfheader.h"
@@ -63,7 +63,6 @@ struct asf_header_internal_s {
/* private part */
int number_count;
uint16_t numbers[ASF_MAX_NUM_STREAMS];
- iconv_t iconv_cd;
uint8_t *bitrate_pointers[ASF_MAX_NUM_STREAMS];
};
@@ -130,8 +129,7 @@ static uint8_t *asf_reader_get_bytes(asf_reader_t *reader, size_t size) {
if ((reader->size - reader->pos) < size)
return NULL;
- buffer = malloc(size);
- if (!buffer)
+ if (! (buffer = malloc(size)) )
return NULL;
memcpy(buffer, reader->buffer + reader->pos, size);
reader->pos += size;
@@ -152,7 +150,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");
@@ -241,8 +239,7 @@ static int asf_header_parse_file_properties(asf_header_t *header, uint8_t *buffe
return 0;
}
- asf_file = malloc(sizeof(asf_file_t));
- if (!asf_file) {
+ if (! (asf_file = malloc(sizeof(asf_file_t))) ) {
lprintf("cannot allocate asf_file_struct\n");
return 0;
}
@@ -296,8 +293,7 @@ static int asf_header_parse_stream_properties(asf_header_t *header, uint8_t *buf
if (buffer_len < 54)
goto exit_error;
- asf_stream = malloc(sizeof(asf_stream_t));
- if (!asf_stream)
+ if (! (asf_stream = malloc(sizeof(asf_stream_t))) )
goto exit_error;
asf_stream->private_data = NULL;
@@ -366,8 +362,7 @@ static int asf_header_parse_stream_extended_properties(asf_header_t *header, uin
if (buffer_len < 64)
return 0;
- asf_stream_extension = malloc(sizeof(asf_stream_extension_t));
- if (!asf_stream_extension)
+ if (! (asf_stream_extension = malloc(sizeof(asf_stream_extension_t))) )
return 0;
asf_reader_init(&reader, buffer, buffer_len);
@@ -637,6 +632,7 @@ static int asf_header_parse_content_description(asf_header_t *header_pub, uint8_
asf_reader_t reader;
asf_content_t *content;
uint16_t title_length, author_length, copyright_length, description_length, rating_length;
+ iconv_t iconv_cd;
if (buffer_len < 10)
return 0;
@@ -645,6 +641,9 @@ static int asf_header_parse_content_description(asf_header_t *header_pub, uint8_
if (!content)
return 0;
+ if ( (iconv_cd = iconv_open("UTF-8", "UCS-2LE")) == (iconv_t)-1 )
+ return 0;
+
asf_reader_init(&reader, buffer, buffer_len);
asf_reader_get_16(&reader, &title_length);
asf_reader_get_16(&reader, &author_length);
@@ -652,11 +651,11 @@ static int asf_header_parse_content_description(asf_header_t *header_pub, uint8_
asf_reader_get_16(&reader, &description_length);
asf_reader_get_16(&reader, &rating_length);
- content->title = asf_reader_get_string(&reader, title_length, header->iconv_cd);
- content->author = asf_reader_get_string(&reader, author_length, header->iconv_cd);
- content->copyright = asf_reader_get_string(&reader, copyright_length, header->iconv_cd);
- content->description = asf_reader_get_string(&reader, description_length, header->iconv_cd);
- content->rating = asf_reader_get_string(&reader, rating_length, header->iconv_cd);
+ content->title = asf_reader_get_string(&reader, title_length, iconv_cd);
+ content->author = asf_reader_get_string(&reader, author_length, iconv_cd);
+ content->copyright = asf_reader_get_string(&reader, copyright_length, iconv_cd);
+ content->description = asf_reader_get_string(&reader, description_length, iconv_cd);
+ content->rating = asf_reader_get_string(&reader, rating_length, iconv_cd);
lprintf("title: %d chars: \"%s\"\n", title_length, content->title);
lprintf("author: %d chars: \"%s\"\n", author_length, content->author);
@@ -665,6 +664,8 @@ static int asf_header_parse_content_description(asf_header_t *header_pub, uint8_
lprintf("rating: %d chars: \"%s\"\n", rating_length, content->rating);
header->pub.content = content;
+
+ iconv_close(iconv_cd);
return 1;
}
@@ -683,16 +684,11 @@ asf_header_t *asf_header_new (uint8_t *buffer, int buffer_len) {
lprintf("parsing_asf_header\n");
if (buffer_len < 6) {
printf("invalid buffer size\n");
- free(asf_header);
return NULL;
}
- asf_header->iconv_cd = iconv_open ("UTF-8", "UCS-2LE");
- if (asf_header->iconv_cd == (iconv_t)-1) {
- printf("iconv open error\n");
- free(asf_header);
+ if (! (asf_header = calloc(1, sizeof(asf_header_internal_t))) )
return NULL;
- }
asf_reader_init(&reader, buffer, buffer_len);
asf_reader_get_32(&reader, &object_count);
@@ -829,9 +825,6 @@ void asf_header_delete (asf_header_t *header_pub) {
asf_header_delete_stream_extended_properties(header->pub.stream_extensions[i]);
}
- if (header->iconv_cd != (iconv_t)-1)
- iconv_close (header->iconv_cd);
-
free(header);
}
diff --git a/src/demuxers/demux.h b/src/demuxers/demux.h
deleted file mode 100644
index a824730ea..000000000
--- a/src/demuxers/demux.h
+++ /dev/null
@@ -1,212 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#ifndef HAVE_DEMUX_H
-#define HAVE_DEMUX_H
-
-#ifdef XINE_COMPILE
-# include "input/input_plugin.h"
-# include "buffer.h"
-# include "xine_internal.h"
-#else
-# include <xine/input_plugin.h>
-# include <xine/buffer.h>
-# include <xine/xine_internal.h>
-#endif
-
-#define DEMUXER_PLUGIN_IFACE_VERSION 26
-
-#define DEMUX_OK 0
-#define DEMUX_FINISHED 1
-
-#define DEMUX_CANNOT_HANDLE 0
-#define DEMUX_CAN_HANDLE 1
-
-#define METHOD_BY_CONTENT 1
-#define METHOD_BY_EXTENSION 2
-#define METHOD_EXPLICIT 3
-
-typedef struct demux_class_s demux_class_t ;
-typedef struct demux_plugin_s demux_plugin_t;
-
-struct demux_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- demux_plugin_t* (*open_plugin) (demux_class_t *this, xine_stream_t *stream, input_plugin_t *input);
-
- /*
- * return human readable (verbose = 1 line) description for this plugin
- */
- const char* (*get_description) (demux_class_t *this);
-
- /*
- * return human readable identifier for this plugin
- */
-
- const char* (*get_identifier) (demux_class_t *this);
-
- /*
- * return MIME types supported for this plugin
- */
-
- const char* (*get_mimetypes) (demux_class_t *this);
-
- /*
- * return ' ' seperated list of file extensions this
- * demuxer is likely to handle
- * (will be used to filter media files in
- * file selection dialogs)
- */
-
- const char* (*get_extensions) (demux_class_t *this);
-
- /*
- * close down, free all resources
- */
- void (*dispose) (demux_class_t *this);
-};
-
-
-/*
- * any demux plugin must implement these functions
- */
-
-struct demux_plugin_s {
-
- /*
- * send headers, followed by BUF_CONTROL_HEADERS_DONE down the
- * fifos, then return. do not start demux thread (yet)
- */
-
- void (*send_headers) (demux_plugin_t *this);
-
- /*
- * ask demux to seek
- *
- * for seekable streams, a start position can be specified
- *
- * start_pos : position in input source (0..65535)
- * this is defined as most convenient to demuxer, can be
- * either time or offset based.
- * start_time : position measured in miliseconds from stream start
- * playing : true if this is a new seek within an already playing stream
- * false if playback of this stream has not started yet
- *
- * if both parameters are !=0 start_pos will be used
- * for non-seekable streams both values will be ignored
- *
- * returns the demux status (like get_status, but immediately after
- * starting the demuxer)
- */
-
- int (*seek) (demux_plugin_t *this,
- off_t start_pos, int start_time, int playing );
-
- /*
- * send a chunk of data down to decoder fifos
- *
- * the meaning of "chunk" is specific to every demux, usually
- * it involves parsing one unit of data from stream.
- *
- * this function will be called from demux loop and should return
- * the demux current status
- */
-
- int (*send_chunk) (demux_plugin_t *this);
-
- /*
- * free resources
- */
-
- void (*dispose) (demux_plugin_t *this) ;
-
- /*
- * returns DEMUX_OK or DEMUX_FINISHED
- */
-
- int (*get_status) (demux_plugin_t *this) ;
-
- /*
- * gets stream length in miliseconds (might be estimated)
- * may return 0 for non-seekable streams
- */
-
- int (*get_stream_length) (demux_plugin_t *this);
-
- /*
- * return capabilities of demuxed stream
- */
-
- uint32_t (*get_capabilities) (demux_plugin_t *this);
-
- /*
- * request optional data from input plugin.
- */
- int (*get_optional_data) (demux_plugin_t *this, void *data, int data_type);
-
- /*
- * "backwards" link to plugin class
- */
-
- demux_class_t *demux_class;
-
- void *node; /* used by plugin loader */
-
-} ;
-
-/*
- * possible capabilites a demux plugin can have:
- */
-#define DEMUX_CAP_NOCAP 0x00000000
-
-/*
- * DEMUX_CAP_AUDIOLANG:
- * DEMUX_CAP_SPULANG:
- * demux plugin knows something about audio/spu languages,
- * e.g. knows that audio stream #0 is english,
- * audio stream #1 is german, ... Same bits as INPUT
- * capabilities .
- */
-
-#define DEMUX_CAP_AUDIOLANG 0x00000008
-#define DEMUX_CAP_SPULANG 0x00000010
-
-/*
- * DEMUX_CAP_CHAPTERS:
- * The media streams provided by this plugin have an internal
- * structure dividing it into segments usable for navigation.
- * For those plugins, the behaviour of the skip button in UIs
- * should be changed from "next MRL" to "next chapter" by
- * sending XINE_EVENT_INPUT_NEXT.
- * Same bits as INPUT capabilities.
- */
-
-#define DEMUX_CAP_CHAPTERS 0x00000080
-
-
-#define DEMUX_OPTIONAL_UNSUPPORTED 0
-#define DEMUX_OPTIONAL_SUCCESS 1
-
-#define DEMUX_OPTIONAL_DATA_AUDIOLANG 2
-#define DEMUX_OPTIONAL_DATA_SPULANG 3
-
-#endif
diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c
index a58cf0f22..5f941e570 100644
--- a/src/demuxers/demux_4xm.c
+++ b/src/demuxers/demux_4xm.c
@@ -40,10 +40,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -432,12 +432,6 @@ static int demux_fourxm_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_fourxm_dispose (demux_plugin_t *this_gen) {
- demux_fourxm_t *this = (demux_fourxm_t *) this_gen;
-
- free(this->tracks);
-}
-
static int demux_fourxm_get_status (demux_plugin_t *this_gen) {
demux_fourxm_t *this = (demux_fourxm_t *) this_gen;
@@ -472,7 +466,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_fourxm_send_headers;
this->demux_plugin.send_chunk = demux_fourxm_send_chunk;
this->demux_plugin.seek = demux_fourxm_seek;
- this->demux_plugin.dispose = demux_fourxm_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_fourxm_get_status;
this->demux_plugin.get_stream_length = demux_fourxm_get_stream_length;
this->demux_plugin.get_capabilities = demux_fourxm_get_capabilities;
@@ -483,17 +477,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -512,39 +496,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "4X Technologies (4xm) demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "4X Technologies";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "4xm";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_fourxm_class_t *this = (demux_fourxm_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_fourxm_init_plugin (xine_t *xine, void *data) {
demux_fourxm_class_t *this;
this = calloc(1, sizeof(demux_fourxm_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("4X Technologies (4xm) demux plugin");
+ this->demux_class.identifier = "4X Technologies";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "4xm";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c
index 0ac645b78..bc2e72f73 100644
--- a/src/demuxers/demux_aac.c
+++ b/src/demuxers/demux_aac.c
@@ -39,10 +39,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -70,28 +70,24 @@ typedef struct {
static int open_aac_file(demux_aac_t *this) {
int i;
uint8_t peak[MAX_PREVIEW_SIZE];
+ uint32_t signature;
uint16_t syncword = 0;
uint32_t id3size = 0;
off_t data_start = 0;
_x_assert(MAX_PREVIEW_SIZE > 10);
- /* Get enough data to be able to check the size of ID3 tag */
- if (_x_demux_read_header(this->input, peak, 10) != 10)
+ if (_x_demux_read_header(this->input, &signature, 4) != 4)
return 0;
/* Check if there's an ID3v2 tag at the start */
- if ( id3v2_istag(peak) ) {
- id3size = _X_BE_32_synchsafe(&peak[6]);
-
+ if ( id3v2_istag(signature) ) {
this->input->seek(this->input, 4, SEEK_SET);
- id3v2_parse_tag(this->input, this->stream, peak);
-
- lprintf("ID3v2 tag encountered, skipping %u bytes.\n", id3size);
+ id3v2_parse_tag(this->input, this->stream, signature);
}
- if ( this->input->read(this->input, peak, 4) != 4 )
+ if ( this->input->read(this->input, &signature, 4) != 4 )
return 0;
/* Check for an ADIF header - should be at the start of the file */
@@ -101,10 +97,9 @@ static int open_aac_file(demux_aac_t *this) {
}
/* Look for an ADTS header - might not be at the start of the file */
- if ( id3size != 0 && this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE ) {
- lprintf("Getting a buffer of size %u starting from %u\n", MAX_PREVIEW_SIZE, id3size);
+ if ( this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE ) {
+ lprintf("Getting a buffer of size %u\n", MAX_PREVIEW_SIZE);
- this->input->seek(this->input, id3size, SEEK_SET);
if ( this->input->read(this->input, peak, MAX_PREVIEW_SIZE) != MAX_PREVIEW_SIZE )
return 0;
this->input->seek(this->input, 0, SEEK_SET);
@@ -231,12 +226,6 @@ static int demux_aac_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_aac_dispose (demux_plugin_t *this_gen) {
- demux_aac_t *this = (demux_aac_t *) this_gen;
-
- free(this);
-}
-
static int demux_aac_get_status (demux_plugin_t *this_gen) {
demux_aac_t *this = (demux_aac_t *) this_gen;
@@ -270,7 +259,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_aac_send_headers;
this->demux_plugin.send_chunk = demux_aac_send_chunk;
this->demux_plugin.seek = demux_aac_seek;
- this->demux_plugin.dispose = demux_aac_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_aac_get_status;
this->demux_plugin.get_stream_length = demux_aac_get_stream_length;
this->demux_plugin.get_capabilities = demux_aac_get_capabilities;
@@ -280,19 +269,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->status = DEMUX_FINISHED;
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* Falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
if (!open_aac_file(this)) {
@@ -309,39 +286,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "ADIF/ADTS AAC demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "AAC";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "aac";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_aac_class_t *this = (demux_aac_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_aac_init_plugin (xine_t *xine, void *data) {
demux_aac_class_t *this;
this = calloc(1, sizeof(demux_aac_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("ADIF/ADTS AAC demux plugin");
+ this->demux_class.identifier = "AAC";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "aac";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c
index 05be00ae9..d42396f90 100644
--- a/src/demuxers/demux_ac3.c
+++ b/src/demuxers/demux_ac3.c
@@ -47,10 +47,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -381,12 +381,6 @@ static int demux_ac3_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_ac3_dispose (demux_plugin_t *this_gen) {
- demux_ac3_t *this = (demux_ac3_t *) this_gen;
-
- free(this);
-}
-
static int demux_ac3_get_status (demux_plugin_t *this_gen) {
demux_ac3_t *this = (demux_ac3_t *) this_gen;
@@ -421,7 +415,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_ac3_send_headers;
this->demux_plugin.send_chunk = demux_ac3_send_chunk;
this->demux_plugin.seek = demux_ac3_seek;
- this->demux_plugin.dispose = demux_ac3_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_ac3_get_status;
this->demux_plugin.get_stream_length = demux_ac3_get_stream_length;
this->demux_plugin.get_capabilities = demux_ac3_get_capabilities;
@@ -432,19 +426,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -463,39 +445,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Raw AC3 demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "AC3";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "ac3";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/ac3: ac3: Dolby Digital audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_ac3_class_t *this = (demux_ac3_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_ac3_init_plugin (xine_t *xine, void *data) {
demux_ac3_class_t *this;
this = calloc(1, sizeof(demux_ac3_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Raw AC3 demux plugin");
+ this->demux_class.identifier = "AC3";
+ this->demux_class.mimetypes = "audio/ac3: ac3: Dolby Digital audio;";
+ this->demux_class.extensions = "ac3";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c
index 0b4f5c513..8ddb7b6a4 100644
--- a/src/demuxers/demux_aiff.c
+++ b/src/demuxers/demux_aiff.c
@@ -33,10 +33,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -336,12 +336,6 @@ static int demux_aiff_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_aiff_dispose (demux_plugin_t *this_gen) {
- demux_aiff_t *this = (demux_aiff_t *) this_gen;
-
- free(this);
-}
-
static int demux_aiff_get_status (demux_plugin_t *this_gen) {
demux_aiff_t *this = (demux_aiff_t *) this_gen;
@@ -376,7 +370,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_aiff_send_headers;
this->demux_plugin.send_chunk = demux_aiff_send_chunk;
this->demux_plugin.seek = demux_aiff_seek;
- this->demux_plugin.dispose = demux_aiff_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_aiff_get_status;
this->demux_plugin.get_stream_length = demux_aiff_get_stream_length;
this->demux_plugin.get_capabilities = demux_aiff_get_capabilities;
@@ -387,19 +381,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -418,41 +400,20 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "AIFF file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "AIFF";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "aif aiff";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-aiff: aif, aiff: AIFF audio;"
- "audio/aiff: aif, aiff: AIFF audio;"
- "audio/x-pn-aiff: aif, aiff: AIFF audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_aiff_class_t *this = (demux_aiff_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_aiff_init_plugin (xine_t *xine, void *data) {
demux_aiff_class_t *this;
this = calloc(1, sizeof(demux_aiff_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("AIFF file demux plugin");
+ this->demux_class.identifier = "AIFF";
+ this->demux_class.mimetypes =
+ "audio/x-aiff: aif, aiff: AIFF audio;"
+ "audio/aiff: aif, aiff: AIFF audio;"
+ "audio/x-pn-aiff: aif, aiff: AIFF audio;";
+ this->demux_class.extensions = "aif aiff";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c
index d2f0a89de..b33c83b18 100644
--- a/src/demuxers/demux_asf.c
+++ b/src/demuxers/demux_asf.c
@@ -45,12 +45,12 @@
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "demux.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#include "asfheader.h"
-#include "xmlparser.h"
+#include <xine/xmlparser.h>
#define CODEC_TYPE_AUDIO 0
#define CODEC_TYPE_VIDEO 1
@@ -385,7 +385,7 @@ static void asf_send_video_header (demux_asf_t *this, int stream) {
static int asf_read_header (demux_asf_t *this) {
int i;
uint64_t asf_header_len;
- char *asf_header_buffer = NULL;
+ uint8_t *asf_header_buffer = NULL;
asf_header_len = get_le64(this);
if (asf_header_len > 4 * 1024 * 1024)
@@ -484,10 +484,9 @@ static int asf_read_header (demux_asf_t *this) {
demux_stream->buf_type = _x_formattag_to_buf_audio
( ((xine_waveformatex *)asf_stream->private_data)->wFormatTag );
if ( !demux_stream->buf_type ) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_asf: unknown audio type 0x%x\n",
- ((xine_waveformatex *)asf_stream->private_data)->wFormatTag);
demux_stream->buf_type = BUF_AUDIO_UNKNOWN;
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE,
+ ((xine_waveformatex *)asf_stream->private_data)->wFormatTag);
}
_x_meta_info_set(this->stream, XINE_META_INFO_AUDIOCODEC, _x_buf_audio_name(demux_stream->buf_type));
@@ -530,10 +529,8 @@ static int asf_read_header (demux_asf_t *this) {
demux_stream->buf_type = _x_fourcc_to_buf_video(bmiheader->biCompression);
if( !demux_stream->buf_type ) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_asf: unknown video format %.4s\n", (char*)&(bmiheader->biCompression));
-
demux_stream->buf_type = BUF_VIDEO_UNKNOWN;
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, bmiheader->biCompression);
}
_x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, _x_buf_video_name(demux_stream->buf_type));
@@ -647,14 +644,14 @@ static int demux_asf_send_headers_common (demux_asf_t *this) {
}
static void asf_reorder(demux_asf_t *this, uint8_t *src, int len){
- uint8_t *dst = malloc(len);
+ uint8_t dst[len];
uint8_t *s2 = src;
int i = 0, x, y;
while(len-i >= this->reorder_h * this->reorder_w*this->reorder_b){
for(x = 0; x < this->reorder_w; x++)
for(y = 0; y < this->reorder_h; y++){
- memcpy(dst + i, s2 + (y * this->reorder_w+x) * this->reorder_b,
+ memcpy(&dst[i], s2 + (y * this->reorder_w+x) * this->reorder_b,
this->reorder_b);
i += this->reorder_b;
}
@@ -662,7 +659,6 @@ static void asf_reorder(demux_asf_t *this, uint8_t *src, int len){
}
xine_fast_memcpy(src,dst,i);
- free(dst);
}
/* redefine abs as macro to handle 64-bit diffs.
@@ -1716,7 +1712,7 @@ static int demux_asf_send_chunk (demux_plugin_t *this_gen) {
default:
{
- int header_size = 0;
+ uint32_t header_size = 0;
if (asf_parse_packet_align(this)) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_asf: asf_parse_packet_align failed\n");
@@ -1902,7 +1898,7 @@ static int demux_asf_seek (demux_plugin_t *this_gen,
start_pos -= (start_pos - this->first_packet_pos) % this->packet_size;
while ((start_pos >= this->first_packet_pos) && (state != 5)) {
- int header_size;
+ uint32_t header_size;
/* seek to the beginning of the previous packet */
lprintf ("demux_asf_seek: seek back\n");
@@ -2076,10 +2072,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;
}
@@ -2087,23 +2081,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const ending = strrchr (mrl, '.');
-
- if (!ending)
- return NULL;
-
- if (strncasecmp(ending, ".asf", 4) &&
- strncasecmp(ending, ".wmv", 4) &&
- strncasecmp(ending, ".wma", 4) ) {
- return NULL;
- }
-
- lprintf ("extension accepted.\n");
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -2152,38 +2130,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "ASF demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "ASF";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- /* asx, wvx, wax are metafile or playlist */
- return "asf wmv wma asx wvx wax";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
-
- return "video/x-ms-asf: asf: ASF stream;"
- "video/x-ms-wmv: wmv: Windows Media Video;"
- "audio/x-ms-wma: wma: Windows Media Audio;"
- "application/vnd.ms-asf: asf: ASF stream;"
- "application/x-mplayer2: asf,asx,asp: mplayer2;"
- "video/x-ms-asf-plugin: asf,asx,asp: mms animation;"
- "video/x-ms-wvx: wvx: wmv metafile;"
- "video/x-ms-wax: wva: wma metafile;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_asf_class_t *this = (demux_asf_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_asf_class_t *this;
@@ -2193,11 +2139,20 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("ASF demux plugin");
+ this->demux_class.identifier = "ASF";
+ this->demux_class.mimetypes =
+ "video/x-ms-asf: asf: ASF stream;"
+ "video/x-ms-wmv: wmv: Windows Media Video;"
+ "audio/x-ms-wma: wma: Windows Media Audio;"
+ "application/vnd.ms-asf: asf: ASF stream;"
+ "application/x-mplayer2: asf,asx,asp: mplayer2;"
+ "video/x-ms-asf-plugin: asf,asx,asp: mms animation;"
+ "video/x-ms-wvx: wvx: wmv metafile;"
+ "video/x-ms-wax: wva: wma metafile;";
+ /* asx, wvx, wax are metafile or playlist */
+ this->demux_class.extensions = "asf wmv wma asx wvx wax";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -2212,6 +2167,6 @@ static const demuxer_info_t demux_info_asf = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "asf", XINE_VERSION_CODE, &demux_info_asf, init_class },
+ { PLUGIN_DEMUX, 27, "asf", XINE_VERSION_CODE, &demux_info_asf, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c
index caaa4e91a..258494ffd 100644
--- a/src/demuxers/demux_aud.c
+++ b/src/demuxers/demux_aud.c
@@ -45,10 +45,10 @@
#include <string.h>
#include <stdlib.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_audio.h"
@@ -131,7 +131,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;
@@ -241,11 +241,6 @@ static int demux_aud_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_aud_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_aud_get_status (demux_plugin_t *this_gen) {
demux_aud_t *this = (demux_aud_t *) this_gen;
@@ -277,7 +272,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_aud_send_headers;
this->demux_plugin.send_chunk = demux_aud_send_chunk;
this->demux_plugin.seek = demux_aud_seek;
- this->demux_plugin.dispose = demux_aud_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_aud_get_status;
this->demux_plugin.get_stream_length = demux_aud_get_stream_length;
this->demux_plugin.get_capabilities = demux_aud_get_capabilities;
@@ -289,19 +284,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
case METHOD_BY_CONTENT: /* no reliable detection */
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
if (!open_aud_file(this)) {
@@ -318,39 +301,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Westwood Studios AUD file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Westwood Studios AUD";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "aud";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_aud_class_t *this = (demux_aud_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_aud_init_plugin (xine_t *xine, void *data) {
demux_aud_class_t *this;
this = calloc(1, sizeof(demux_aud_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Westwood Studios AUD file demux plugin");
+ this->demux_class.identifier = "Westwood Studios AUD";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "aud";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index 79bfc9f12..ae97b576e 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.c
@@ -70,9 +70,9 @@
#define DEBUG_ODML
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#include "bswap.h"
/*
@@ -1881,7 +1881,12 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {
if (!this->avi->bih->biCompression)
this->avi->video_type = BUF_VIDEO_RGB;
else
+ {
this->avi->video_type = _x_fourcc_to_buf_video(this->avi->bih->biCompression);
+ if (!this->avi->video_type)
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE,
+ this->avi->bih->biCompression);
+ }
for(i=0; i < this->avi->n_audio; i++) {
this->avi->audio[i]->audio_type = _x_formattag_to_buf_audio (this->avi->audio[i]->wavex->wFormatTag);
@@ -1894,10 +1899,10 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {
}
if( !this->avi->audio[i]->audio_type ) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "unknown audio type 0x%x\n",
- this->avi->audio[i]->wavex->wFormatTag);
this->no_audio = 1;
this->avi->audio[i]->audio_type = BUF_AUDIO_UNKNOWN;
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE,
+ this->avi->audio[i]->wavex->wFormatTag);
} else
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_avi: audio type %s (wFormatTag 0x%x)\n",
_x_buf_audio_name(this->avi->audio[i]->audio_type),
@@ -1909,8 +1914,8 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {
* however, at least for this case (compressor: xvid biCompression: DIVX), the
* xvid fourcc must prevail as it is used by ffmpeg to detect encoder bugs. [MF]
*/
- if( _x_fourcc_to_buf_video(this->avi->compressor) == BUF_VIDEO_XVID &&
- _x_fourcc_to_buf_video(this->avi->bih->biCompression) == BUF_VIDEO_MPEG4 ) {
+ if( this->avi->video_type == BUF_VIDEO_MPEG4 &&
+ _x_fourcc_to_buf_video(this->avi->compressor) == BUF_VIDEO_XVID ) {
this->avi->bih->biCompression = this->avi->compressor;
this->avi->video_type = BUF_VIDEO_XVID;
}
@@ -1959,6 +1964,8 @@ static void demux_avi_send_headers (demux_plugin_t *this_gen) {
this->avi->compressor = this->avi->bih->biCompression;
} else {
this->avi->video_type = _x_fourcc_to_buf_video(this->avi->compressor);
+ if (!this->avi->video_type)
+ _x_fourcc_to_buf_video(this->avi->bih->biCompression);
}
_x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_FOURCC,
@@ -2263,17 +2270,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
break;
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions))
- return NULL;
- }
- /* we want to fall through here */
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -2320,41 +2317,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
/*
* demux avi class
*/
-
-static const char *get_description (demux_class_t *this_gen) {
- return "AVI/RIFF demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "AVI";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "avi";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/msvideo: avi: AVI video;"
- "video/x-msvideo: avi: AVI video;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_avi_class_t *this = (demux_avi_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_avi_class_t *this;
this = calloc(1, sizeof(demux_avi_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("AVI/RIFF demux plugin");
+ this->demux_class.identifier = "AVI";
+ this->demux_class.mimetypes =
+ "video/msvideo: avi: AVI video;"
+ "video/x-msvideo: avi: AVI video;";
+ this->demux_class.extensions = "avi";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -2368,6 +2343,6 @@ static const demuxer_info_t demux_info_avi = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "avi", XINE_VERSION_CODE, &demux_info_avi, init_class },
+ { PLUGIN_DEMUX, 27, "avi", XINE_VERSION_CODE, &demux_info_avi, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c
index 6aee5042e..f936ff4f2 100644
--- a/src/demuxers/demux_cdda.c
+++ b/src/demuxers/demux_cdda.c
@@ -41,10 +41,10 @@
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -159,12 +159,6 @@ static int demux_cdda_seek (demux_plugin_t *this_gen, off_t start_pos, int start
return this->status;
}
-static void demux_cdda_dispose (demux_plugin_t *this_gen) {
- demux_cdda_t *this = (demux_cdda_t *) this_gen;
-
- free(this);
-}
-
static int demux_cdda_get_status (demux_plugin_t *this_gen) {
demux_cdda_t *this = (demux_cdda_t *) this_gen;
@@ -200,7 +194,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_cdda_send_headers;
this->demux_plugin.send_chunk = demux_cdda_send_chunk;
this->demux_plugin.seek = demux_cdda_seek;
- this->demux_plugin.dispose = demux_cdda_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_cdda_get_status;
this->demux_plugin.get_stream_length = demux_cdda_get_stream_length;
this->demux_plugin.get_capabilities = demux_cdda_get_capabilities;
@@ -212,14 +206,8 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
case METHOD_BY_CONTENT:
- case METHOD_BY_EXTENSION:
- if (strncasecmp (input->get_mrl (input), "cdda:", 5)) {
- free (this);
- return NULL;
- }
-
- break;
-
+ return NULL;
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -231,39 +219,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "CD Digital Audio demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "CDDA";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return NULL;
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_cdda_class_t *this = (demux_cdda_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_cdda_init_plugin (xine_t *xine, void *data) {
demux_cdda_class_t *this;
this = calloc(1, sizeof(demux_cdda_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("CD Digital Audio demux plugin");
+ this->demux_class.identifier = "CDDA";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "cdda:/";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c
index 0c73877e9..3c624a8c9 100644
--- a/src/demuxers/demux_dts.c
+++ b/src/demuxers/demux_dts.c
@@ -43,10 +43,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -375,12 +375,6 @@ static int demux_dts_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_dts_dispose (demux_plugin_t *this_gen) {
- demux_dts_t *this = (demux_dts_t *) this_gen;
-
- free(this);
-}
-
static int demux_dts_get_status (demux_plugin_t *this_gen) {
demux_dts_t *this = (demux_dts_t *) this_gen;
@@ -408,7 +402,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_dts_send_headers;
this->demux_plugin.send_chunk = demux_dts_send_chunk;
this->demux_plugin.seek = demux_dts_seek;
- this->demux_plugin.dispose = demux_dts_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_dts_get_status;
this->demux_plugin.get_stream_length = demux_dts_get_stream_length;
this->demux_plugin.get_capabilities = demux_dts_get_capabilities;
@@ -419,19 +413,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
if (!open_dts_file(this)) {
@@ -448,39 +430,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Raw DTS demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "DTS";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "dts";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_dts_class_t *this = (demux_dts_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_dts_init_plugin (xine_t *xine, void *data) {
demux_dts_class_t *this;
this = calloc(1, sizeof(demux_dts_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Raw DTS demux plugin");
+ this->demux_class.identifier = "DTS";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "dts";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c
index 2e393847c..735735548 100644
--- a/src/demuxers/demux_eawve.c
+++ b/src/demuxers/demux_eawve.c
@@ -39,10 +39,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
-#include "demux.h"
+#include <xine/demux.h>
#include "group_games.h"
#define FOURCC_TAG BE_FOURCC
@@ -314,10 +314,6 @@ static int demux_eawve_seek(demux_eawve_t *this, off_t start_pos, int start_time
return this->status;
}
-static void demux_eawve_dispose(demux_eawve_t *this){
- free(this);
-}
-
static int demux_eawve_get_status(demux_eawve_t *this){
return this->status;
}
@@ -348,7 +344,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
this->demux_plugin.send_headers = (void*)demux_eawve_send_headers;
this->demux_plugin.send_chunk = (void*)demux_eawve_send_chunk;
this->demux_plugin.seek = (void*)demux_eawve_seek;
- this->demux_plugin.dispose = (void*)demux_eawve_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = (void*)demux_eawve_get_status;
this->demux_plugin.get_stream_length = (void*)demux_eawve_get_stream_length;
this->demux_plugin.get_capabilities = demux_eawve_get_capabilities;
@@ -359,19 +355,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -390,37 +374,17 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
return &this->demux_plugin;
}
-static const char *get_description(demux_class_t *this_gen){
- return "Electronics Arts WVE format demux plugin";
-}
-
-static const char *get_identifier(demux_class_t *this_gen){
- return "EA WVE";
-}
-
-static const char *get_extensions(demux_class_t *this_gen){
- return "wve";
-}
-
-static const char *get_mimetypes(demux_class_t *this_gen){
- return NULL;
-}
-
-static void class_dispose(demux_class_t *this){
- free(this);
-}
-
void *demux_eawve_init_plugin(xine_t *xine, void *data) {
demux_eawve_class_t *this;
this = calloc(1, sizeof(demux_eawve_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Electronics Arts WVE format demux plugin");
+ this->demux_class.identifier = "EA WVE";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "wve";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c
index d38fe3c62..ddd067eb0 100644
--- a/src/demuxers/demux_elem.c
+++ b/src/demuxers/demux_elem.c
@@ -38,10 +38,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#define NUM_PREVIEW_BUFFERS 50
#define SCRATCH_SIZE 256
@@ -169,11 +169,6 @@ static int demux_mpeg_elem_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_mpeg_elem_dispose (demux_plugin_t *this) {
-
- free (this);
-}
-
static int demux_mpeg_elem_get_stream_length(demux_plugin_t *this_gen) {
return 0 ; /*FIXME: implement */
}
@@ -222,15 +217,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
break;
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions))
- return NULL;
- }
+ case METHOD_BY_MRL:
break;
case METHOD_EXPLICIT:
@@ -247,7 +234,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_mpeg_elem_send_headers;
this->demux_plugin.send_chunk = demux_mpeg_elem_send_chunk;
this->demux_plugin.seek = demux_mpeg_elem_seek;
- this->demux_plugin.dispose = demux_mpeg_elem_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_mpeg_elem_get_status;
this->demux_plugin.get_stream_length = demux_mpeg_elem_get_stream_length;
this->demux_plugin.get_capabilities = demux_mpeg_elem_get_capabilities;
@@ -259,39 +246,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Elementary MPEG stream demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEG_ELEM";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mpv";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mpeg_elem_class_t *this = (demux_mpeg_elem_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_elem_class_t *this;
this = calloc(1, sizeof(demux_mpeg_elem_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Elementary MPEG stream demux plugin");
+ this->demux_class.identifier = "MPEG_ELEM";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "mpv";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -305,6 +270,6 @@ static const demuxer_info_t demux_info_elem = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "elem", XINE_VERSION_CODE, &demux_info_elem, init_plugin },
+ { PLUGIN_DEMUX, 27, "elem", XINE_VERSION_CODE, &demux_info_elem, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index a8bd0b288..c2cd271ea 100644
--- a/src/demuxers/demux_film.c
+++ b/src/demuxers/demux_film.c
@@ -47,10 +47,10 @@
* demuxer is dispatching to the engine */
#define DEBUG_FILM_DEMUX 0
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -154,7 +154,7 @@ static int open_film_file(demux_film_t *film) {
film_header = malloc(film_header_size);
if (!film_header)
return 0;
- strncpy(film->version, &scratch[8], 4);
+ memcpy(film->version, &scratch[8], 4);
llprintf(DEBUG_FILM_LOAD, "0x%X header bytes, version %c%c%c%c\n",
film_header_size,
film->version[0],
@@ -201,7 +201,11 @@ static int open_film_file(demux_film_t *film) {
film->video_type = _x_fourcc_to_buf_video(*(uint32_t *)&film_header[i + 8]);
if( !film->video_type )
+ {
film->video_type = BUF_VIDEO_UNKNOWN;
+ _x_report_video_fourcc (film->stream->xine, LOG_MODULE,
+ *(uint32_t *)&film_header[i + 8]);
+ }
/* fetch the audio information if the chunk size checks out */
if (chunk_size == 32) {
@@ -251,12 +255,11 @@ static int open_film_file(demux_film_t *film) {
llprintf(DEBUG_FILM_LOAD, "parsing STAB chunk\n");
/* load the sample table */
- if (film->sample_table)
- free(film->sample_table);
+ free(film->sample_table);
film->frequency = _X_BE_32(&film_header[i + 8]);
film->sample_count = _X_BE_32(&film_header[i + 12]);
film->sample_table =
- calloc(film->sample_count, sizeof(film_sample_t));
+ xine_xcalloc(film->sample_count, sizeof(film_sample_t));
if (!film->sample_table)
goto film_abort;
for (j = 0; j < film->sample_count; j++) {
@@ -824,8 +827,7 @@ static int demux_film_seek (demux_plugin_t *this_gen, off_t start_pos, int start
static void demux_film_dispose (demux_plugin_t *this_gen) {
demux_film_t *this = (demux_film_t *) this_gen;
- if (this->sample_table)
- free(this->sample_table);
+ free(this->sample_table);
free(this->interleave_buffer);
free(this);
}
@@ -874,19 +876,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -905,39 +895,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "FILM (CPK) demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "FILM (CPK)";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "cpk cak film";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_film_class_t *this = (demux_film_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_film_init_plugin (xine_t *xine, void *data) {
demux_film_class_t *this;
this = calloc(1, sizeof(demux_film_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("FILM (CPK) demux plugin");
+ this->demux_class.identifier = "FILM (CPK)";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "cpk cak film";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c
index 672eafdbb..2135f8d60 100644
--- a/src/demuxers/demux_flac.c
+++ b/src/demuxers/demux_flac.c
@@ -43,10 +43,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_audio.h"
@@ -83,6 +83,7 @@ typedef struct {
* It returns 1 if flac file was opened successfully. */
static int open_flac_file(demux_flac_t *flac) {
+ uint32_t signature;
unsigned char preamble[10];
unsigned int block_length;
unsigned char buffer[FLAC_SEEKPOINT_SIZE];
@@ -93,7 +94,7 @@ static int open_flac_file(demux_flac_t *flac) {
/* fetch the file signature, 4 bytes will read both the fLaC
* signature and the */
- if (_x_demux_read_header(flac->input, preamble, 4) != 4)
+ if (_x_demux_read_header(flac->input, &signature, 4) != 4)
return 0;
flac->input->seek(flac->input, 4, SEEK_SET);
@@ -103,16 +104,15 @@ static int open_flac_file(demux_flac_t *flac) {
* users use them and want them working, so check and skip the ID3
* tag if present.
*/
- if ( id3v2_istag(preamble) ) {
- id3v2_parse_tag(flac->input, flac->stream, preamble);
+ if ( id3v2_istag(signature) ) {
+ id3v2_parse_tag(flac->input, flac->stream, signature);
- if ( flac->input->read(flac->input, preamble, 4) != 4 )
+ if ( flac->input->read(flac->input, &signature, 4) != 4 )
return 0;
}
/* validate signature */
- if ((preamble[0] != 'f') || (preamble[1] != 'L') ||
- (preamble[2] != 'a') || (preamble[3] != 'C'))
+ if ( signature != ME_FOURCC('f', 'L', 'a', 'C') )
return 0;
/* loop through the metadata blocks; use a do-while construct since there
@@ -167,8 +167,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 = calloc(flac->seekpoint_count,
- sizeof(flac_seekpoint_t));
+ flac->seekpoints = xine_xcalloc(flac->seekpoint_count,
+ sizeof(flac_seekpoint_t));
if (flac->seekpoint_count && !flac->seekpoints)
return 0;
for (i = 0; i < flac->seekpoint_count; i++) {
@@ -196,8 +196,7 @@ static int open_flac_file(demux_flac_t *flac) {
{
char comments[block_length + 1]; /* last byte for NUL termination */
char *ptr = comments;
- uint32_t length, user_comment_list_length;
- int cn;
+ uint32_t length, user_comment_list_length, cn;
char *comment;
char c;
@@ -532,19 +531,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -563,40 +550,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Free Lossless Audio Codec (flac) demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "FLAC";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "flac";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-flac: flac: FLAC Audio;"
- "audio/flac: flac: FLAC Audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_flac_class_t *this = (demux_flac_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_flac_init_plugin (xine_t *xine, void *data) {
demux_flac_class_t *this;
this = calloc(1, sizeof(demux_flac_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Free Lossless Audio Codec (flac) demux plugin");
+ this->demux_class.identifier = "FLAC";
+ this->demux_class.mimetypes =
+ "audio/x-flac: flac: FLAC Audio;"
+ "audio/flac: flac: FLAC Audio;";
+ this->demux_class.extensions = "flac";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c
index 7735671b9..498f7f0db 100644
--- a/src/demuxers/demux_fli.c
+++ b/src/demuxers/demux_fli.c
@@ -35,10 +35,10 @@
#include <string.h>
#include <stdlib.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#define FLI_HEADER_SIZE 128
@@ -266,11 +266,6 @@ static int demux_fli_seek (demux_plugin_t *this_gen, off_t start_pos, int start_
return this->status;
}
-static void demux_fli_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_fli_get_status (demux_plugin_t *this_gen) {
demux_fli_t *this = (demux_fli_t *) this_gen;
@@ -310,7 +305,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_fli_send_headers;
this->demux_plugin.send_chunk = demux_fli_send_chunk;
this->demux_plugin.seek = demux_fli_seek;
- this->demux_plugin.dispose = demux_fli_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_fli_get_status;
this->demux_plugin.get_stream_length = demux_fli_get_stream_length;
this->demux_plugin.get_capabilities = demux_fli_get_capabilities;
@@ -321,19 +316,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -352,39 +335,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Autodesk Animator FLI/FLC demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "FLI/FLC";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "fli flc";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/x-flic: fli,flc: Autodesk FLIC files;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_fli_class_t *this = (demux_fli_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_fli_class_t *this;
this = calloc(1, sizeof(demux_fli_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Autodesk Animator FLI/FLC demux plugin");
+ this->demux_class.identifier = "FLI/FLC";
+ this->demux_class.mimetypes = "video/x-flic: fli,flc: Autodesk FLIC files;";
+ this->demux_class.extensions = "fli flc";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -398,6 +359,6 @@ static const demuxer_info_t demux_info_fli = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "fli", XINE_VERSION_CODE, &demux_info_fli, init_plugin },
+ { PLUGIN_DEMUX, 27, "fli", XINE_VERSION_CODE, &demux_info_fli, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c
index c421e6053..090fe1097 100644
--- a/src/demuxers/demux_flv.c
+++ b/src/demuxers/demux_flv.c
@@ -42,10 +42,10 @@
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -799,8 +799,7 @@ static void seek_flv_file(demux_flv_t *this, off_t seek_pos, int seek_pts) {
return;
}
/* check StreamID and CodecID */
- if (buf[0] == 0 && buf[1] == 0 && buf[2] == 0 &&
- buf[3] == (this->videocodec | 0x10)) {
+ if ( _X_ME_32(buf) == ME_FOURCC(0, 0, 0, (this->videocodec | 0x10)) ) {
this->input->seek(this->input, -16, SEEK_CUR);
lprintf(" ...resynced after %d bytes\n", i);
return;
@@ -975,7 +974,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->status = DEMUX_FINISHED;
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION:
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
if (!open_flv_file(this)) {
@@ -992,41 +991,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Flash Video file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "FLV";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "flv";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/x-flv: flv: Flash video;"
- "video/flv: flv: Flash video;"
- "application/x-flash-video: flv: Flash video;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_flv_class_t *this = (demux_flv_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_flv_class_t *this;
this = calloc(1, sizeof(demux_flv_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Flash Video file demux plugin");
+ this->demux_class.identifier = "FLV";
+ this->demux_class.mimetypes = "video/x-flv: flv: Flash video;"
+ "video/flv: flv: Flash video;"
+ "application/x-flash-video: flv: Flash video;";
+ this->demux_class.extensions = "flv";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1040,6 +1017,6 @@ static const demuxer_info_t demux_info_flv = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "flashvideo", XINE_VERSION_CODE, &demux_info_flv, init_plugin },
+ { PLUGIN_DEMUX, 27, "flashvideo", XINE_VERSION_CODE, &demux_info_flv, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c
index 7fbc89ca5..954a2fc1a 100644
--- a/src/demuxers/demux_idcin.c
+++ b/src/demuxers/demux_idcin.c
@@ -83,10 +83,10 @@
* demuxer is dispatching to the engine */
/* #define LOG */
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -129,7 +129,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 */
@@ -356,7 +356,8 @@ static int open_idcin_file(demux_idcin_t *this) {
static void demux_idcin_send_headers(demux_plugin_t *this_gen) {
demux_idcin_t *this = (demux_idcin_t *) this_gen;
buf_element_t *buf;
- uint32_t i, size;
+ uint32_t i;
+ int size;
this->video_fifo = this->stream->video_fifo;
this->audio_fifo = this->stream->audio_fifo;
@@ -449,11 +450,6 @@ static int demux_idcin_seek (demux_plugin_t *this_gen, off_t start_pos, int star
return this->status;
}
-static void demux_idcin_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_idcin_get_status (demux_plugin_t *this_gen) {
demux_idcin_t *this = (demux_idcin_t *) this_gen;
@@ -485,7 +481,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_idcin_send_headers;
this->demux_plugin.send_chunk = demux_idcin_send_chunk;
this->demux_plugin.seek = demux_idcin_seek;
- this->demux_plugin.dispose = demux_idcin_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_idcin_get_status;
this->demux_plugin.get_stream_length = demux_idcin_get_stream_length;
this->demux_plugin.get_capabilities = demux_idcin_get_capabilities;
@@ -496,19 +492,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -527,40 +511,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-
-static const char *get_description (demux_class_t *this_gen) {
- return "Id Quake II Cinematic file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Id CIN";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "cin";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_idcin_class_t *this = (demux_idcin_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_idcin_init_plugin (xine_t *xine, void *data) {
demux_idcin_class_t *this;
this = calloc(1, sizeof(demux_idcin_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Id Quake II Cinematic file demux plugin");
+ this->demux_class.identifier = "Id CIN";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "cin";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c
index fb7d1c748..f199723e1 100644
--- a/src/demuxers/demux_iff.c
+++ b/src/demuxers/demux_iff.c
@@ -47,10 +47,10 @@
#include <string.h>
#include <stdlib.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "iff.h"
@@ -1122,92 +1122,29 @@ static int demux_iff_seek (demux_plugin_t *this_gen,
static void demux_iff_dispose (demux_plugin_t *this_gen) {
demux_iff_t *this = (demux_iff_t *) this_gen;
- if( this->bmhd ) {
- free(this->bmhd);
- this->bmhd = NULL;
- }
- if( this->cmap ) {
- free( this->cmap );
- this->cmap = NULL;
- }
- if( this->grab ) {
- free(this->grab);
- this->grab = NULL;
- }
- if( this->dest ) {
- free(this->dest);
- this->dest = NULL;
- }
- if( this->camg ) {
- free(this->camg);
- this->camg = NULL;
- }
- if( this->ccrt ) {
- free(this->ccrt);
- this->ccrt = NULL;
- }
- if( this->dpi ) {
- free(this->dpi);
- this->dpi = NULL;
- }
-
- if( this->vhdr ) {
- free(this->vhdr);
- this->vhdr = NULL;
- }
- if( this->atak )
- {
- free( this->atak );
- this->atak = NULL;
- }
- if( this->rlse ) {
- free( this->rlse );
- this->rlse = NULL;
- }
-
- if( this->anhd ) {
- free( this->anhd );
- this->anhd = NULL;
- }
+ free(this->bmhd);
+ free(this->cmap);
+ free(this->grab);
+ free(this->dest);
+ free(this->camg);
+ free(this->ccrt);
+ free(this->dpi);
+ free(this->vhdr);
+ free(this->atak);
+ free(this->rlse);
+ free(this->anhd);
+ free(this->dpan);
+
+ free(this->title);
+ free(this->copyright);
+ free(this->author);
+ free(this->annotations);
+ free(this->version);
+ free(this->text);
+
+ free (this->audio_interleave_buffer);
+ free (this->audio_read_buffer);
- if( this->dpan ) {
- free( this->dpan );
- this->dpan = NULL;
- }
-
- if( this->title ) {
- free (this->title);
- this->title = NULL;
- }
- if( this->copyright ) {
- free (this->copyright);
- this->copyright = NULL;
- }
- if( this->author ) {
- free (this->author);
- this->author = NULL;
- }
- if( this->annotations ) {
- free (this->annotations);
- this->annotations = NULL;
- }
- if( this->version ) {
- free (this->version);
- this->version = NULL;
- }
- if( this->text ) {
- free (this->text);
- this->text = NULL;
- }
-
- if( this->audio_interleave_buffer ) {
- free (this->audio_interleave_buffer);
- this->audio_interleave_buffer = NULL;
- }
- if( this->audio_read_buffer ) {
- free (this->audio_read_buffer);
- this->audio_read_buffer = NULL;
- }
this->audio_buffer_filled = 0;
free(this);
@@ -1258,19 +1195,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -1289,46 +1214,25 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "IFF demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "IFF";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "iff svx 8svx 16sv ilbm ham ham6 ham8 anim anim3 anim5 anim7 anim8";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-8svx: 8svx: IFF-8SVX Audio;"
- "audio/8svx: 8svx: IFF-8SVX Audio;"
- "audio/x-16sv: 16sv: IFF-16SV Audio;"
- "audio/168sv: 16sv: IFF-16SV Audio;"
- "image/x-ilbm: ilbm: IFF-ILBM Picture;"
- "image/ilbm: ilbm: IFF-ILBM Picture;"
- "video/x-anim: anim: IFF-ANIM Video;"
- "video/anim: anim: IFF-ANIM Video;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_iff_class_t *this = (demux_iff_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_iff_class_t *this;
this = calloc(1, sizeof(demux_iff_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("IFF demux plugin");
+ this->demux_class.identifier = "IFF";
+ this->demux_class.mimetypes =
+ "audio/x-8svx: 8svx: IFF-8SVX Audio;"
+ "audio/8svx: 8svx: IFF-8SVX Audio;"
+ "audio/x-16sv: 16sv: IFF-16SV Audio;"
+ "audio/168sv: 16sv: IFF-16SV Audio;"
+ "image/x-ilbm: ilbm: IFF-ILBM Picture;"
+ "image/ilbm: ilbm: IFF-ILBM Picture;"
+ "video/x-anim: anim: IFF-ANIM Video;"
+ "video/anim: anim: IFF-ANIM Video;";
+ this->demux_class.extensions = "iff svx 8svx 16sv ilbm ham ham6 ham8 anim anim3 anim5 anim7 anim8";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1342,7 +1246,7 @@ static const demuxer_info_t demux_info_iff = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "iff", XINE_VERSION_CODE, &demux_info_iff, init_plugin },
+ { PLUGIN_DEMUX, 27, "iff", XINE_VERSION_CODE, &demux_info_iff, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c
index 08136edba..af3983ea6 100644
--- a/src/demuxers/demux_image.c
+++ b/src/demuxers/demux_image.c
@@ -38,10 +38,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
-#include "demux.h"
+#include <xine/demux.h>
#define IMAGE_HEADER_LEN 4
@@ -143,13 +143,6 @@ static int demux_image_get_optional_data(demux_plugin_t *this_gen,
return DEMUX_OPTIONAL_UNSUPPORTED;
}
-static void demux_image_dispose (demux_plugin_t *this_gen) {
- demux_image_t *this = (demux_image_t *) this_gen;
-
- lprintf("closed\n");
- free (this);
-}
-
static demux_plugin_t *open_plugin (demux_class_t *class_gen,
xine_stream_t *stream,
input_plugin_t *input) {
@@ -174,18 +167,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
}
break;
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- return NULL;
- }
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -205,7 +187,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
this->demux_plugin.send_headers = demux_image_send_headers;
this->demux_plugin.send_chunk = demux_image_send_chunk;
this->demux_plugin.seek = demux_image_seek;
- this->demux_plugin.dispose = demux_image_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_image_get_status;
this->demux_plugin.get_stream_length = demux_image_get_stream_length;
this->demux_plugin.get_capabilities = demux_image_get_capabilities;
@@ -222,41 +204,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
/*
* image demuxer class
*/
-
-static const char *get_description (demux_class_t *this_gen) {
- return "image demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "imagedmx";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "png gif jpg jpeg";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_image_class_t *this = (demux_image_class_t *) this_gen;
-
- lprintf("class closed\n");
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_image_class_t *this;
this = calloc(1, sizeof(demux_image_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("image demux plugin");
+ this->demux_class.identifier = "imagedmx";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "png gif jpg jpeg";
+ this->demux_class.dispose = default_demux_class_dispose;
lprintf("class opened\n");
return this;
@@ -271,6 +229,6 @@ static const demuxer_info_t demux_info_image = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "image", XINE_VERSION_CODE, &demux_info_image, init_class },
+ { PLUGIN_DEMUX, 27, "image", XINE_VERSION_CODE, &demux_info_image, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c
index 5b4e12ef8..a8930b8fa 100644
--- a/src/demuxers/demux_ipmovie.c
+++ b/src/demuxers/demux_ipmovie.c
@@ -40,10 +40,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -532,7 +532,7 @@ static int open_ipmovie_file(demux_ipmovie_t *this) {
IPMOVIE_SIGNATURE_SIZE)
return 0;
- if (strncmp(signature, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0)
+ if (memcmp(signature, IPMOVIE_SIGNATURE, IPMOVIE_SIGNATURE_SIZE) != 0)
return 0;
/* file is qualified; skip over the signature bytes (+ 6 unknown) in the stream */
@@ -691,19 +691,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -722,39 +710,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Interplay MVE Movie demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Interplay MVE";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mve mv8";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_ipmovie_class_t *this = (demux_ipmovie_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_ipmovie_init_plugin (xine_t *xine, void *data) {
demux_ipmovie_class_t *this;
this = calloc(1, sizeof(demux_ipmovie_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Interplay MVE Movie demux plugin");
+ this->demux_class.identifier = "Interplay MVE";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "mve mv8";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_matroska-chapters.c b/src/demuxers/demux_matroska-chapters.c
index 4bfafe0da..93e6d4cd6 100644
--- a/src/demuxers/demux_matroska-chapters.c
+++ b/src/demuxers/demux_matroska-chapters.c
@@ -36,9 +36,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#include "ebml.h"
#include "matroska.h"
diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c
index 242293502..32feacf28 100644
--- a/src/demuxers/demux_matroska.c
+++ b/src/demuxers/demux_matroska.c
@@ -43,10 +43,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "ebml.h"
@@ -1135,7 +1135,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
case MATROSKA_ID_TR_CODECPRIVATE:
{
- char *codec_private;
+ uint8_t *codec_private;
if (elem.len >= 0x80000000)
return 0;
codec_private = malloc (elem.len);
@@ -1251,10 +1251,10 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
}
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- "demux_matroska: Track %d, %s %s\n",
- track->track_num,
- (track->codec_id ? track->codec_id : ""),
- (track->language ? track->language : ""));
+ "demux_matroska: Track %d, %s %s\n",
+ track->track_num,
+ (track->codec_id ? track->codec_id : ""),
+ (track->language ? track->language : ""));
if (track->codec_id) {
void (*init_codec)(demux_matroska_t *, matroska_track_t *) = NULL;
@@ -1267,13 +1267,15 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
_x_bmiheader_le2me(bih);
track->buf_type = _x_fourcc_to_buf_video(bih->biCompression);
+ if (!track->buf_type)
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, bih->biCompression);
init_codec = init_codec_video;
}
} else if (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_UNCOMPRESSED)) {
} else if ((!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_MPEG4_SP)) ||
- (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_MPEG4_ASP)) ||
- (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_MPEG4_AP))) {
+ (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_MPEG4_ASP)) ||
+ (!strcmp(track->codec_id, MATROSKA_CODEC_ID_V_MPEG4_AP))) {
xine_bmiheader *bih;
lprintf("MATROSKA_CODEC_ID_V_MPEG4_*\n");
@@ -1374,8 +1376,8 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
track->buf_type = BUF_VIDEO_THEORA_RAW;
init_codec = init_codec_xiph;
} else if ((!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L1)) ||
- (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L2)) ||
- (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L3))) {
+ (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L2)) ||
+ (!strcmp(track->codec_id, MATROSKA_CODEC_ID_A_MPEG1_L3))) {
lprintf("MATROSKA_CODEC_ID_A_MPEG1\n");
track->buf_type = BUF_AUDIO_MPEG;
init_codec = init_codec_audio;
@@ -1413,10 +1415,12 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
_x_waveformatex_le2me(wfh);
track->buf_type = _x_formattag_to_buf_audio(wfh->wFormatTag);
+ if (!track->buf_type)
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE, wfh->wFormatTag);
init_codec = init_codec_audio;
}
} else if (!strncmp(track->codec_id, MATROSKA_CODEC_ID_A_AAC,
- sizeof(MATROSKA_CODEC_ID_A_AAC) - 1)) {
+ sizeof(MATROSKA_CODEC_ID_A_AAC) - 1)) {
lprintf("MATROSKA_CODEC_ID_A_AAC\n");
track->buf_type = BUF_AUDIO_AAC;
init_codec = init_codec_aac;
@@ -1500,10 +1504,10 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) {
}
if (init_codec) {
- if (! track->fifo) {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- "demux_matroska: Error: fifo not set up for track of type type %" PRIu32 "\n", track->track_type);
- return 0;
+ if (! track->fifo) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ "demux_matroska: Error: fifo not set up for track of type type %" PRIu32 "\n", track->track_type);
+ return 0;
}
init_codec(this, track);
}
@@ -1653,10 +1657,10 @@ static int parse_cue_point(demux_matroska_t *this) {
this->num_indexes++;
}
if ((index->num_entries % 1024) == 0) {
- index->pos = (off_t *)realloc(index->pos, sizeof(off_t) *
- (index->num_entries + 1024));
- index->timecode = (off_t *)realloc(index->timecode, sizeof(uint64_t) *
- (index->num_entries + 1024));
+ index->pos = realloc(index->pos, sizeof(off_t) *
+ (index->num_entries + 1024));
+ index->timecode = realloc(index->timecode, sizeof(uint64_t) *
+ (index->num_entries + 1024));
}
index->pos[index->num_entries] = pos;
index->timecode[index->num_entries] = timecode;
@@ -1742,10 +1746,7 @@ static int parse_tags(demux_matroska_t *this) {
static void alloc_block_data (demux_matroska_t *this, size_t len) {
/* memory management */
if (this->block_data_size < len) {
- if (this->block_data)
- this->block_data = realloc(this->block_data, len);
- else
- this->block_data = malloc(len);
+ this->block_data = realloc(this->block_data, len);
this->block_data_size = len;
}
}
@@ -2849,37 +2850,26 @@ static void demux_matroska_dispose (demux_plugin_t *this_gen) {
/* free tracks */
for (i = 0; i < this->num_tracks; i++) {
- matroska_track_t *track;
-
- track = this->tracks[i];
- if (track->language)
- free (track->language);
- if (track->codec_id)
- free (track->codec_id);
- if (track->codec_private)
- free (track->codec_private);
- if (track->video_track)
- free (track->video_track);
- if (track->audio_track)
- free (track->audio_track);
- if (track->sub_track)
- free (track->sub_track);
+ matroska_track_t *const track = this->tracks[i];
+
+ free (track->language);
+ free (track->codec_id);
+ free (track->codec_private);
+ free (track->video_track);
+ free (track->audio_track);
+ free (track->sub_track);
free (track);
}
/* Free the cues. */
for (i = 0; i < this->num_indexes; i++) {
- if (this->indexes[i].pos)
- free(this->indexes[i].pos);
- if (this->indexes[i].timecode)
- free(this->indexes[i].timecode);
+ free(this->indexes[i].pos);
+ free(this->indexes[i].timecode);
}
- if (this->indexes)
- free(this->indexes);
+ free(this->indexes);
/* Free the top_level elem list */
- if (this->top_level_list)
- free(this->top_level_list);
+ free(this->top_level_list);
free(this->title);
@@ -2987,18 +2977,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl(input);
- const char *const extensions = class_gen->get_extensions (class_gen);;
-
- lprintf ("stage by extension %s\n", mrl);
-
- if (!_x_demux_check_extension (mrl, extensions))
- return NULL;
-
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -3057,36 +3036,6 @@ error:
/*
* demux matroska class
*/
-
-static const char *get_description (demux_class_t *this_gen) {
- return "matroska & webm demux plugin";
-}
-
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "matroska";
-}
-
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mkv wbm webm";
-}
-
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/mkv: mkv: matroska;"
- "video/x-matroska: mkv: matroska;"
- "video/webm: wbm,webm: WebM;";
-}
-
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_matroska_class_t *this = (demux_matroska_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_matroska_class_t *this;
@@ -3095,11 +3044,14 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("matroska & webm demux plugin");
+ this->demux_class.identifier = "matroska";
+ this->demux_class.mimetypes = "video/mkv: mkv: matroska;"
+ "video/x-matroska: mkv: matroska;"
+ "video/webm: wbm,webm: WebM;";
+
+ this->demux_class.extensions = "mkv wbm webm";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -3113,6 +3065,6 @@ static const demuxer_info_t demux_info_matroska = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "matroska", XINE_VERSION_CODE, &demux_info_matroska, init_class },
+ { PLUGIN_DEMUX, 27, "matroska", XINE_VERSION_CODE, &demux_info_matroska, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_matroska.h b/src/demuxers/demux_matroska.h
index 841847ec1..670827598 100644
--- a/src/demuxers/demux_matroska.h
+++ b/src/demuxers/demux_matroska.h
@@ -35,9 +35,9 @@
#include <stdlib.h>
#include <zlib.h>
-#include "xine_internal.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "ebml.h"
diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c
index bf4dfec4e..b2bb819d8 100644
--- a/src/demuxers/demux_mng.c
+++ b/src/demuxers/demux_mng.c
@@ -44,9 +44,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#include <libmng.h>
@@ -295,17 +295,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
}
break;
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl(input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
+ case METHOD_BY_MRL:
break;
default:
@@ -344,40 +334,21 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre
return &this->demux_plugin;
}
-static const char *get_description(demux_class_t *this_gen){
- return "Multiple-image Network Graphics demux plugin";
-}
-
-static const char *get_identifier(demux_class_t *this_gen){
- return "MNG";
-}
-
-static const char *get_extensions(demux_class_t *this_gen){
- return "png mng";
-}
-
-static const char *get_mimetypes(demux_class_t *this_gen){
- return "image/png: png: PNG image;"
- "image/x-png: png: PNG image;"
- "video/mng: mng: MNG animation;"
- "video/x-mng: mng: MNG animation;";
-}
-
-static void class_dispose(demux_class_t *this){
- free (this);
-}
-
static void *init_plugin(xine_t *xine, void *data){
demux_mng_class_t *this;
this = calloc(1, sizeof(demux_mng_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Multiple-image Network Graphics demux plugin");
+ this->demux_class.identifier = "MNG";
+ this->demux_class.mimetypes =
+ "image/png: png: PNG image;"
+ "image/x-png: png: PNG image;"
+ "video/mng: mng: MNG animation;"
+ "video/x-mng: mng: MNG animation;";
+ this->demux_class.extensions = "png mng";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -387,6 +358,6 @@ static const demuxer_info_t demux_info_mng = {
};
const plugin_info_t xine_plugin_info[] EXPORTED = {
- { PLUGIN_DEMUX, 26, "mng", XINE_VERSION_CODE, &demux_info_mng, (void*)init_plugin},
+ { PLUGIN_DEMUX, 27, "mng", XINE_VERSION_CODE, &demux_info_mng, (void*)init_plugin},
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c
index 2749eb048..4de5ca7d8 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>
@@ -44,11 +42,10 @@
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
-#include "group_audio.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "modplug.h"
#include "bswap.h"
@@ -347,21 +344,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
case METHOD_EXPLICIT:
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- if (!open_mod_file(this)) {
- free (this);
- return NULL;
- }
- }
+ case METHOD_BY_MRL:
break;
case METHOD_BY_CONTENT:
@@ -376,20 +359,16 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "ModPlug Amiga MOD Music file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "mod";
-}
+static void *demux_mod_init_plugin (xine_t *xine, void *data) {
+ demux_mod_class_t *this;
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mod it stm s3m 669 amf med mdl xm";
-}
+ this = calloc(1, sizeof(demux_mod_class_t));
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-mod: mod: SoundTracker/NoiseTracker/ProTracker Module;"
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("ModPlug Amiga MOD Music file demux plugin");
+ this->demux_class.identifier = "mod";
+ this->demux_class.mimetypes =
+ "audio/x-mod: mod: SoundTracker/NoiseTracker/ProTracker Module;"
"audio/mod: mod: SoundTracker/NoiseTracker/ProTracker Module;"
"audio/it: it: ImpulseTracker Module;"
"audio/x-it: it: ImpulseTracker Module;"
@@ -402,27 +381,17 @@ static const char *get_mimetypes (demux_class_t *this_gen) {
"audio/x-amf: amf: ADRIFT Module File;"
"audio/x-xm: xm: FastTracker II Audio;"
"audio/xm: xm: FastTracker II Audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mod_class_t *this = (demux_mod_class_t *) this_gen;
-
- free (this);
-}
-
-void *demux_mod_init_plugin (xine_t *xine, void *data) {
- demux_mod_class_t *this;
-
- this = calloc(1, sizeof(demux_mod_class_t));
-
- this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.extensions = "mod it stm s3m 669 amf med mdl xm";
+ this->demux_class.dispose = default_demux_class_dispose;
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, 27, "modplug", XINE_VERSION_CODE, &demux_info_mod, demux_mod_init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/demuxers/demux_mpc.c b/src/demuxers/demux_mpc.c
index 04b25eeb5..6658e82bc 100644
--- a/src/demuxers/demux_mpc.c
+++ b/src/demuxers/demux_mpc.c
@@ -41,10 +41,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
#include "id3.h"
@@ -90,7 +90,7 @@ static int open_mpc_file(demux_mpc_t *this) {
/* TODO: non-seeking version */
if (INPUT_IS_SEEKABLE(this->input)) {
/* Check for id3v2 tag */
- if (id3v2_istag(this->header)) {
+ if (id3v2_istag(_X_BE_32(this->header))) {
lprintf("found id3v2 header\n");
@@ -287,12 +287,6 @@ static int demux_mpc_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_mpc_dispose (demux_plugin_t *this_gen) {
- demux_mpc_t *this = (demux_mpc_t *) this_gen;
-
- free(this);
-}
-
static int demux_mpc_get_status (demux_plugin_t *this_gen) {
demux_mpc_t *this = (demux_mpc_t *) this_gen;
@@ -326,7 +320,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_mpc_send_headers;
this->demux_plugin.send_chunk = demux_mpc_send_chunk;
this->demux_plugin.seek = demux_mpc_seek;
- this->demux_plugin.dispose = demux_mpc_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_mpc_get_status;
this->demux_plugin.get_stream_length = demux_mpc_get_stream_length;
this->demux_plugin.get_capabilities = demux_mpc_get_capabilities;
@@ -336,19 +330,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->status = DEMUX_FINISHED;
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* Falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -367,40 +349,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Musepack demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Musepack";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mpc mp+ mpp";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/musepack: mpc, mp+, mpp: Musepack audio;"
- "audio/x-musepack: mpc, mp+, mpp: Musepack audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mpc_class_t *this = (demux_mpc_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_mpc_init_plugin (xine_t *xine, void *data) {
demux_mpc_class_t *this;
this = calloc(1, sizeof(demux_mpc_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Musepack demux plugin");
+ this->demux_class.identifier = "Musepack";
+ this->demux_class.mimetypes =
+ "audio/musepack: mpc, mp+, mpp: Musepack audio;"
+ "audio/x-musepack: mpc, mp+, mpp: Musepack audio;";
+ this->demux_class.extensions = "mpc mp+ mpp";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c
index dbaae108d..a0d813db6 100644
--- a/src/demuxers/demux_mpeg.c
+++ b/src/demuxers/demux_mpeg.c
@@ -39,9 +39,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "demux.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
+#include <xine/xineutils.h>
#define NUM_PREVIEW_BUFFERS 150
#define SCRATCH_SIZE 256
@@ -246,6 +246,8 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
len = read_bytes(this, 2);
+ //printf( "parse_mpeg2_packet: stream_id=%X\n", stream_id);
+
if (stream_id==0xbd) {
int track;
@@ -483,7 +485,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
}
- } else if ((stream_id >= 0xbc) && ((stream_id & 0xf0) == 0xe0)) {
+ } else if ( ((stream_id >= 0xbc) && ((stream_id & 0xf0) == 0xe0)) || stream_id==0xfd ) {
w = read_bytes(this, 1);
flags = read_bytes(this, 1);
@@ -532,7 +534,7 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr)
return;
}
- buf->type = BUF_VIDEO_MPEG;
+ buf->type = (stream_id==0xfd) ? BUF_VIDEO_VC1 : BUF_VIDEO_MPEG;
buf->pts = pts;
buf->decoder_info[0] = pts - dts;
check_newpts( this, pts, PTS_VIDEO );
@@ -1054,11 +1056,6 @@ static int demux_mpeg_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_mpeg_dispose (demux_plugin_t *this_gen) {
-
- free (this_gen);
-}
-
static int demux_mpeg_get_stream_length (demux_plugin_t *this_gen) {
demux_mpeg_t *this = (demux_mpeg_t *) this_gen;
@@ -1090,7 +1087,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_mpeg_send_headers;
this->demux_plugin.send_chunk = demux_mpeg_send_chunk;
this->demux_plugin.seek = demux_mpeg_seek;
- this->demux_plugin.dispose = demux_mpeg_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_mpeg_get_status;
this->demux_plugin.get_stream_length = demux_mpeg_get_stream_length;
this->demux_plugin.get_capabilities = demux_mpeg_get_capabilities;
@@ -1212,19 +1209,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -1236,40 +1221,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "MPEG program stream demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEG";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mpg mpeg";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/mpeg: mpeg, mpg, mpe: MPEG animation;"
- "video/x-mpeg: mpeg, mpg, mpe: MPEG animation;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mpeg_class_t *this = (demux_mpeg_class_t *) this_gen;
-
- free (this);
- }
-
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_class_t *this;
this = calloc(1, sizeof(demux_mpeg_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("MPEG program stream demux plugin");
+ this->demux_class.identifier = "MPEG";
+ this->demux_class.mimetypes =
+ "video/mpeg: mpeg, mpg, mpe: MPEG animation;"
+ "video/x-mpeg: mpeg, mpg, mpe: MPEG animation;";
+ this->demux_class.extensions = "mpg mpeg";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1283,6 +1247,6 @@ static const demuxer_info_t demux_info_mpeg = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "mpeg", XINE_VERSION_CODE, &demux_info_mpeg, init_plugin },
+ { PLUGIN_DEMUX, 27, "mpeg", XINE_VERSION_CODE, &demux_info_mpeg, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c
index 08655ada9..cad841456 100644
--- a/src/demuxers/demux_mpeg_block.c
+++ b/src/demuxers/demux_mpeg_block.c
@@ -31,15 +31,21 @@
#include <unistd.h>
#include <string.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#define LOG_MODULE "demux_mpeg_block"
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#define NUM_PREVIEW_BUFFERS 250
#define DISC_TRESHOLD 90000
@@ -1449,37 +1455,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
break;
- case METHOD_BY_EXTENSION: {
- char *ending;
-
- const char *const mrl = input->get_mrl (input);
-
- if(!strncmp(mrl, "vcd:", 4)) {
- this->blocksize = 2324;
- demux_mpeg_block_accept_input (this, input);
- } else if(!strncmp(mrl, "dvd:", 4) || !strncmp(mrl, "pvr:", 4)) {
- this->blocksize = 2048;
- demux_mpeg_block_accept_input (this, input);
- } else {
- ending = strrchr(mrl, '.');
-
- if (!ending) {
- free (this);
- return NULL;
- }
- if ( (!strncasecmp (ending, ".vob", 4)) ||
- (!strncmp((ending + 3), "mpeg2", 5)) ||
- (!strncmp((ending + 3), "mpeg1", 5)) ) {
- this->blocksize = 2048;
- demux_mpeg_block_accept_input(this, input);
- } else {
- free (this);
- return NULL;
- }
- }
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT: {
this->blocksize = input->get_blocksize(input);
@@ -1506,29 +1482,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "DVD/VOB demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEG_BLOCK";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "vob";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_mpeg_block_class_t *this = (demux_mpeg_block_class_t *) this_gen;
-
- free (this);
- }
-
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_block_class_t *this;
@@ -1538,11 +1491,11 @@ static void *init_plugin (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("DVD/VOB demux plugin");
+ this->demux_class.identifier = "MPEG_BLOCK";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "vob vcd:/ dvd:/ pvr:/";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1556,6 +1509,6 @@ static const demuxer_info_t demux_info_mpeg_block = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "mpeg_block", XINE_VERSION_CODE, &demux_info_mpeg_block, init_plugin },
+ { PLUGIN_DEMUX, 27, "mpeg_block", XINE_VERSION_CODE, &demux_info_mpeg_block, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c
index 305069b3c..4d53b6d34 100644
--- a/src/demuxers/demux_mpeg_pes.c
+++ b/src/demuxers/demux_mpeg_pes.c
@@ -35,15 +35,21 @@
#include <unistd.h>
#include <string.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#define LOG_MODULE "demux_mpeg_pes"
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#define NUM_PREVIEW_BUFFERS 250
#define DISC_TRESHOLD 90000
@@ -73,7 +79,6 @@ typedef struct demux_mpeg_pes_s {
char cur_mrl[256];
uint8_t *scratch;
- void *scratch_base;
int64_t nav_last_end_pts;
int64_t nav_last_start_pts;
@@ -1470,7 +1475,7 @@ static void demux_mpeg_pes_dispose (demux_plugin_t *this_gen) {
demux_mpeg_pes_t *this = (demux_mpeg_pes_t *) this_gen;
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
}
@@ -1656,7 +1661,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.get_optional_data = demux_mpeg_pes_get_optional_data;
this->demux_plugin.demux_class = class_gen;
- this->scratch = xine_xmalloc_aligned (512, 4096, &this->scratch_base);
+ this->scratch = av_mallocz(4096);
this->status = DEMUX_FINISHED;
/* Don't start demuxing stream until we see a program_stream_pack_header */
/* We need to system header in order to identify is the stream is mpeg1 or mpeg2. */
@@ -1675,7 +1680,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
/* use demux_mpeg_block for block devices */
if ((input->get_capabilities(input) & INPUT_CAP_BLOCK)) {
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
@@ -1691,7 +1696,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
|| (this->preview_data[2] != 0x01) ) {
lprintf("open_plugin:preview_data failed\n");
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
@@ -1702,7 +1707,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
case 0xbd ... 0xbe:
break;
default:
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
@@ -1724,7 +1729,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
|| (this->scratch[2] != 0x01) ) {
lprintf("open_plugin:scratch failed\n");
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
@@ -1735,7 +1740,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
case 0xbd ... 0xbe:
break;
default:
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
@@ -1749,31 +1754,14 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
}
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const ending = strrchr(mrl, '.');
-
- if (!ending) {
- free (this->scratch_base);
- free (this);
- return NULL;
- }
-
- if (strncasecmp(ending, ".MPEG", 5)
- && strncasecmp (ending, ".vdr", 4)
- && strncasecmp (ending, ".mpg", 4)) {
- free (this->scratch_base);
- free (this);
- return NULL;
- }
- }
- break;
+ case METHOD_BY_MRL:
+ break;
case METHOD_EXPLICIT: {
@@ -1782,36 +1770,13 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
break;
default:
- free (this->scratch_base);
+ av_free (this->scratch);
free (this);
return NULL;
}
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "mpeg pes demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEG_PES";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "pes";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/mp2p: m2p: MPEG2 program stream;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_mpeg_pes_class_t *this = (demux_mpeg_pes_class_t *) this_gen;
-
- free (this);
- }
-
static void *init_plugin (xine_t *xine, void *data) {
demux_mpeg_pes_class_t *this;
@@ -1820,11 +1785,11 @@ static void *init_plugin (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("mpeg pes demux plugin");
+ this->demux_class.identifier = "MPEG_PES";
+ this->demux_class.mimetypes = "video/mp2p: m2p: MPEG2 program stream;";
+ this->demux_class.extensions = "pes vdr:/ netvdr:/";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1838,6 +1803,6 @@ static const demuxer_info_t demux_info_mpeg_pes = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "mpeg_pes", XINE_VERSION_CODE, &demux_info_mpeg_pes, init_plugin },
+ { PLUGIN_DEMUX, 27, "mpeg_pes", XINE_VERSION_CODE, &demux_info_mpeg_pes, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index 6205f9a08..8bcb7b760 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.c
@@ -38,10 +38,10 @@
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "compat.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/compat.h>
#include "bswap.h"
#include "group_audio.h"
#include "id3.h"
@@ -59,7 +59,7 @@
#define RIFF_TAG FOURCC_TAG('R', 'I', 'F', 'F')
#define AVI_TAG FOURCC_TAG('A', 'V', 'I', ' ')
#define CDXA_TAG FOURCC_TAG('C', 'D', 'X', 'A')
-#define MPEG_MARKER FOURCC_TAG( 0x00, 0x00, 0x01, 0xBA )
+#define MPEG_MARKER ME_FOURCC( 0x00, 0x00, 0x01, 0xBA )
/* Xing header stuff */
@@ -478,7 +478,7 @@ static vbri_header_t *XINE_MALLOC 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 = calloc (vbri->toc_entries + 1, sizeof (int));
+ vbri->toc = xine_xcalloc ((vbri->toc_entries + 1), sizeof(int));
if (!vbri->toc) {
free (vbri);
return NULL;
@@ -758,8 +758,8 @@ static int demux_mpgaudio_next (demux_mpgaudio_t *this, int decoder_flags, int s
/* the stream is broken, don't keep info about previous frames */
this->free_bitrate_size = 0;
- if ( id3v2_istag(header) ) {
- if (!id3v2_parse_tag(this->input, this->stream, header)) {
+ if ( id3v2_istag(_X_ME_32(header)) ) {
+ if (!id3v2_parse_tag(this->input, this->stream, _X_ME_32(header))) {
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
LOG_MODULE ": ID3V2 tag parsing error\n");
bytes = 1; /* resync */
@@ -861,19 +861,16 @@ static int detect_mpgaudio_file(input_plugin_t *input,
if (preview_len < 4)
return 0;
- lprintf("got preview %02x %02x %02x %02x\n",
- buf[0], buf[1], buf[2], buf[3]);
+ head = _X_ME_32(buf);
- head = _X_BE_32(buf);
+ lprintf("got preview %08x\n", head);
- if ((head == ID3V22_TAG) ||
- (head == ID3V23_TAG) ||
- (head == ID3V24_TAG)) {
+ if (id3v2_istag(head)) {
/* check if a mp3 frame follows the tag
* 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");
@@ -988,7 +985,7 @@ static void demux_mpgaudio_send_headers (demux_plugin_t *this_gen) {
*/
{
char scratch_buf[256];
- char *mpeg_ver[3] = {"1", "2", "2.5"};
+ static const char mpeg_ver[3][4] = {"1", "2", "2.5"};
snprintf(scratch_buf, 256, "MPEG %s Layer %1d%s",
mpeg_ver[this->cur_frame.version_idx], this->cur_frame.layer,
@@ -1131,11 +1128,6 @@ static int demux_mpgaudio_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_mpgaudio_dispose (demux_plugin_t *this) {
-
- free (this);
-}
-
static int demux_mpgaudio_get_stream_length (demux_plugin_t *this_gen) {
demux_mpgaudio_t *this = (demux_mpgaudio_t *) this_gen;
@@ -1171,18 +1163,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl(input);
- const char *const extensions = class_gen->get_extensions (class_gen);
-
- lprintf ("stage by extension %s\n", mrl);
-
- if (!_x_demux_check_extension (mrl, extensions))
- return NULL;
-
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -1195,7 +1176,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_mpgaudio_send_headers;
this->demux_plugin.send_chunk = demux_mpgaudio_send_chunk;
this->demux_plugin.seek = demux_mpgaudio_seek;
- this->demux_plugin.dispose = demux_mpgaudio_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_mpgaudio_get_status;
this->demux_plugin.get_stream_length = demux_mpgaudio_get_stream_length;
this->demux_plugin.get_capabilities = demux_mpgaudio_get_capabilities;
@@ -1218,49 +1199,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
/*
* demux mpegaudio class
*/
-
-static const char *get_description (demux_class_t *this_gen) {
- return "MPEG audio demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEGAUDIO";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- demux_mpgaudio_class_t *this = (demux_mpgaudio_class_t *) this_gen;
-
- if( _x_decoder_available(this->xine, BUF_AUDIO_MPEG) )
- return "mp3 mp2 mpa mpega";
- else
- return "";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- demux_mpgaudio_class_t *this = (demux_mpgaudio_class_t *) this_gen;
-
- if( _x_decoder_available(this->xine, BUF_AUDIO_MPEG) )
- return "audio/mpeg2: mp2: MPEG audio;"
- "audio/x-mpeg2: mp2: MPEG audio;"
- "audio/mpeg3: mp3: MPEG audio;"
- "audio/x-mpeg3: mp3: MPEG audio;"
- "audio/mpeg: mpa,abs,mpega: MPEG audio;"
- "audio/x-mpeg: mpa,abs,mpega: MPEG audio;"
- "audio/x-mpegurl: mp3: MPEG audio;"
- "audio/mpegurl: mp3: MPEG audio;"
- "audio/mp3: mp3: MPEG audio;"
- "audio/x-mp3: mp3: MPEG audio;";
- else
- return "";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_mpgaudio_class_t *this = (demux_mpgaudio_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_mpgaudio_init_class (xine_t *xine, void *data) {
demux_mpgaudio_class_t *this;
@@ -1269,11 +1207,26 @@ void *demux_mpgaudio_init_class (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("MPEG audio demux plugin");
+ this->demux_class.identifier = "MPEGAUDIO";
+ if( _x_decoder_available(this->xine, BUF_AUDIO_MPEG) ) {
+ this->demux_class.mimetypes =
+ "audio/mpeg2: mp2: MPEG audio;"
+ "audio/x-mpeg2: mp2: MPEG audio;"
+ "audio/mpeg3: mp3: MPEG audio;"
+ "audio/x-mpeg3: mp3: MPEG audio;"
+ "audio/mpeg: mpa,abs,mpega: MPEG audio;"
+ "audio/x-mpeg: mpa,abs,mpega: MPEG audio;"
+ "audio/x-mpegurl: mp3: MPEG audio;"
+ "audio/mpegurl: mp3: MPEG audio;"
+ "audio/mp3: mp3: MPEG audio;"
+ "audio/x-mp3: mp3: MPEG audio;";
+ this->demux_class.extensions = "mp3 mp2 mpa mpega";
+ } else {
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = NULL;
+ }
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_nsf.c b/src/demuxers/demux_nsf.c
deleted file mode 100644
index 40aeae9da..000000000
--- a/src/demuxers/demux_nsf.c
+++ /dev/null
@@ -1,386 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-/*
- * NSF File "Demuxer" by Mike Melanson (melanson@pcisys.net)
- * This is really just a loader for NES Music File Format (extension NSF)
- * which loads an entire NSF file and passes it over to the NSF audio
- * decoder.
- *
- * After the file is sent over, the demuxer controls the playback by
- * sending empty buffers with incrementing pts values.
- *
- * For more information regarding the NSF format, visit:
- * http://www.tripoint.org/kevtris/nes/nsfspec.txt
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdlib.h>
-
-/********** logging **********/
-#define LOG_MODULE "demux_nsf"
-/* #define LOG_VERBOSE */
-/* #define LOG */
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
-#include "bswap.h"
-#include "group_audio.h"
-
-#define NSF_HEADER_SIZE 0x80
-#define NSF_SAMPLERATE 44100
-#define NSF_BITS 8
-#define NSF_CHANNELS 1
-#define NSF_REFRESH_RATE 60
-#define NSF_PTS_INC (90000 / NSF_REFRESH_RATE)
-
-typedef struct {
- demux_plugin_t demux_plugin;
-
- xine_stream_t *stream;
- fifo_buffer_t *video_fifo;
- fifo_buffer_t *audio_fifo;
- input_plugin_t *input;
- int status;
-
- int total_songs;
- int current_song;
- int new_song; /* indicates song change */
-
- char *title;
- char *artist;
- char *copyright;
-
- off_t filesize;
-
- int64_t current_pts;
- int file_sent;
-} demux_nsf_t;
-
-typedef struct {
- demux_class_t demux_class;
-} demux_nsf_class_t;
-
-/* returns 1 if the NSF file was opened successfully, 0 otherwise */
-static int open_nsf_file(demux_nsf_t *this) {
- unsigned char header[NSF_HEADER_SIZE];
-
- this->input->seek(this->input, 0, SEEK_SET);
- if (this->input->read(this->input, header, NSF_HEADER_SIZE) !=
- NSF_HEADER_SIZE)
- return 0;
-
- /* check for the signature */
- if (memcmp(header, "NESM\x1A", 5) != 0)
- return 0;
-
- this->total_songs = header[6];
- this->current_song = header[7];
- 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);
-
- return 1;
-}
-
-static int demux_nsf_send_chunk(demux_plugin_t *this_gen) {
- demux_nsf_t *this = (demux_nsf_t *) this_gen;
- buf_element_t *buf;
- int bytes_read;
- char title[100];
-
- /* send chunks of the file to the decoder until file is completely
- * loaded; then send control buffers */
- if (!this->file_sent) {
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
- buf->type = BUF_AUDIO_NSF;
- bytes_read = this->input->read(this->input, buf->content, buf->max_size);
-
- if (bytes_read <= 0) {
- /* the file has been completely loaded, free the buffer and start
- * sending control buffers */
- buf->free_buffer(buf);
- this->file_sent = 1;
-
- } else {
-
- /* keep loading the file */
- if (bytes_read < buf->max_size)
- buf->size = bytes_read;
- else
- buf->size = buf->max_size;
-
- buf->extra_info->input_normpos = 0;
- buf->extra_info->input_time = 0;
- buf->pts = 0;
-
- this->audio_fifo->put (this->audio_fifo, buf);
- }
- }
-
- /* this is not an 'else' because control might fall through from above */
- if (this->file_sent) {
- /* send a control buffer */
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
-
- if (this->new_song) {
-
- buf->decoder_info[1] = this->current_song;
- this->new_song = 0;
- sprintf(title, "%s, song %d/%d",
- this->title, this->current_song, this->total_songs);
-
- _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, title);
-
- _x_demux_control_newpts(this->stream, this->current_pts, 0);
-
- } else
- buf->decoder_info[1] = 0;
-
- buf->type = BUF_AUDIO_NSF;
- if(this->total_songs)
- buf->extra_info->input_normpos = (this->current_song - 1) * 65535 / this->total_songs;
- buf->extra_info->input_time = this->current_pts / 90;
- buf->pts = this->current_pts;
- buf->size = 0;
- this->audio_fifo->put (this->audio_fifo, buf);
-
- this->current_pts += NSF_PTS_INC;
- }
-
- return this->status;
-}
-
-static void demux_nsf_send_headers(demux_plugin_t *this_gen) {
- demux_nsf_t *this = (demux_nsf_t *) this_gen;
- buf_element_t *buf;
- char copyright[100];
-
- this->video_fifo = this->stream->video_fifo;
- this->audio_fifo = this->stream->audio_fifo;
-
- this->status = DEMUX_OK;
-
- /* load stream information */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS,
- NSF_CHANNELS);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE,
- NSF_SAMPLERATE);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS,
- NSF_BITS);
-
- _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, this->title);
- _x_meta_info_set(this->stream, XINE_META_INFO_ARTIST, this->artist);
- sprintf(copyright, "(C) %s", this->copyright);
- _x_meta_info_set(this->stream, XINE_META_INFO_COMMENT, copyright);
-
- /* send start buffers */
- _x_demux_control_start(this->stream);
-
- /* send init info to the audio decoder */
- if (this->audio_fifo) {
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
- buf->type = BUF_AUDIO_NSF;
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_FRAME_END;
- buf->decoder_info[0] = 5;
- buf->decoder_info[1] = NSF_SAMPLERATE;
- buf->decoder_info[2] = NSF_BITS;
- buf->decoder_info[3] = NSF_CHANNELS;
-
- /* send the NSF filesize in the body, big endian format */
- buf->content[0] = (this->filesize >> 24) & 0xFF;
- buf->content[1] = (this->filesize >> 16) & 0xFF;
- buf->content[2] = (this->filesize >> 8) & 0xFF;
- buf->content[3] = (this->filesize >> 0) & 0xFF;
- /* send the requested song */
- buf->content[4] = this->current_song + 5;
-
- this->audio_fifo->put (this->audio_fifo, buf);
- }
-}
-
-static int demux_nsf_seek (demux_plugin_t *this_gen,
- off_t start_pos, int start_time, int playing) {
-
- demux_nsf_t *this = (demux_nsf_t *) this_gen;
- start_pos = (off_t) ( (double) start_pos / 65535 *
- this->total_songs );
-
- /* if thread is not running, initialize demuxer */
- if( !playing ) {
-
- /* send new pts */
- _x_demux_control_newpts(this->stream, 0, 0);
-
- this->status = DEMUX_OK;
-
- /* reposition stream at the start for loading */
- this->input->seek(this->input, 0, SEEK_SET);
-
- this->file_sent = 0;
- this->current_pts = 0;
- this->new_song = 1;
- } else {
- this->current_song = start_pos + 1;
- this->new_song = 1;
- this->current_pts = 0;
- _x_demux_flush_engine(this->stream);
- }
-
- return this->status;
-}
-
-static void demux_nsf_dispose (demux_plugin_t *this_gen) {
- demux_nsf_t *this = (demux_nsf_t *) this_gen;
-
- free(this->title);
- free(this->artist);
- free(this->copyright);
- free(this);
-}
-
-static int demux_nsf_get_status (demux_plugin_t *this_gen) {
- demux_nsf_t *this = (demux_nsf_t *) this_gen;
-
- return this->status;
-}
-
-/* return the approximate length in miliseconds */
-static int demux_nsf_get_stream_length (demux_plugin_t *this_gen) {
- return 0;
-}
-
-static uint32_t demux_nsf_get_capabilities(demux_plugin_t *this_gen) {
- return DEMUX_CAP_NOCAP;
-}
-
-static int demux_nsf_get_optional_data(demux_plugin_t *this_gen,
- void *data, int data_type) {
- return DEMUX_OPTIONAL_UNSUPPORTED;
-}
-
-static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *stream,
- input_plugin_t *input) {
-
- demux_nsf_t *this;
-
- if (!INPUT_IS_SEEKABLE(input)) {
- xprintf(stream->xine, XINE_VERBOSITY_DEBUG, "input not seekable, can not handle!\n");
- return NULL;
- }
-
- this = calloc(1, sizeof(demux_nsf_t));
- this->stream = stream;
- this->input = input;
-
- this->demux_plugin.send_headers = demux_nsf_send_headers;
- this->demux_plugin.send_chunk = demux_nsf_send_chunk;
- this->demux_plugin.seek = demux_nsf_seek;
- this->demux_plugin.dispose = demux_nsf_dispose;
- this->demux_plugin.get_status = demux_nsf_get_status;
- this->demux_plugin.get_stream_length = demux_nsf_get_stream_length;
- this->demux_plugin.get_capabilities = demux_nsf_get_capabilities;
- this->demux_plugin.get_optional_data = demux_nsf_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->status = DEMUX_FINISHED;
-
- switch (stream->content_detection_method) {
-
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
- case METHOD_BY_CONTENT:
- case METHOD_EXPLICIT:
-
- if (!open_nsf_file(this)) {
- free (this);
- return NULL;
- }
-
- break;
-
- default:
- free (this);
- return NULL;
- }
-
- return &this->demux_plugin;
-}
-
-static const char *get_description (demux_class_t *this_gen) {
- return "NES Music file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "NSF";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "nsf";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_nsf_class_t *this = (demux_nsf_class_t *) this_gen;
-
- free (this);
-}
-
-void *demux_nsf_init_plugin (xine_t *xine, void *data) {
- demux_nsf_class_t *this;
-
- this = calloc(1, sizeof(demux_nsf_class_t));
-
- this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
-
- return this;
-}
diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c
index 8017d3d3f..89b6de6d6 100644
--- a/src/demuxers/demux_nsv.c
+++ b/src/demuxers/demux_nsv.c
@@ -40,12 +40,12 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
-#include "buffer.h"
+#include <xine/buffer.h>
#define FOURCC_TAG BE_FOURCC
#define NSVf_TAG FOURCC_TAG('N', 'S', 'V', 'f')
@@ -298,13 +298,21 @@ static int open_nsv_file(demux_nsv_t *this) {
if (_x_is_fourcc(&preview[4], "NONE"))
this->video_type = 0;
else
+ {
this->video_type = _x_fourcc_to_buf_video(this->video_fourcc);
+ if (!this->video_type)
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, this->video_fourcc);
+ }
this->audio_fourcc = _X_ME_32(&preview[8]);
if (_x_is_fourcc(&preview[8], "NONE"))
this->audio_type = 0;
else
+ {
this->audio_type = _x_formattag_to_buf_audio(this->audio_fourcc);
+ if (!this->audio_type)
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE, this->audio_fourcc);
+ }
this->bih.biSize = sizeof(this->bih);
this->bih.biWidth = _X_LE_16(&preview[12]);
@@ -558,11 +566,6 @@ static int demux_nsv_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_nsv_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_nsv_get_status (demux_plugin_t *this_gen) {
demux_nsv_t *this = (demux_nsv_t *) this_gen;
@@ -594,7 +597,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_nsv_send_headers;
this->demux_plugin.send_chunk = demux_nsv_send_chunk;
this->demux_plugin.seek = demux_nsv_seek;
- this->demux_plugin.dispose = demux_nsv_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_nsv_get_status;
this->demux_plugin.get_stream_length = demux_nsv_get_stream_length;
this->demux_plugin.get_capabilities = demux_nsv_get_capabilities;
@@ -605,19 +608,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -636,39 +627,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Nullsoft Video demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Nullsoft NSV";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "nsv";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_nsv_class_t *this = (demux_nsv_class_t *) this_gen;
-
- free (this);
-}
-
static void *demux_nsv_init_plugin (xine_t *xine, void *data) {
demux_nsv_class_t *this;
this = calloc(1, sizeof(demux_nsv_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Nullsoft Video demux plugin");
+ this->demux_class.identifier = "Nullsoft NSV";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "nsv";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -682,6 +651,6 @@ static const demuxer_info_t demux_info_nsv = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "nsv", XINE_VERSION_CODE, &demux_info_nsv, demux_nsv_init_plugin },
+ { PLUGIN_DEMUX, 27, "nsv", XINE_VERSION_CODE, &demux_info_nsv, demux_nsv_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c
deleted file mode 100644
index 8849e445e..000000000
--- a/src/demuxers/demux_ogg.c
+++ /dev/null
@@ -1,2312 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-/*
- * demultiplexer for ogg streams
- */
-/* 2003.02.09 (dilb) update of the handling for audio/video infos for strongarm cpus. */
-
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include <ogg/ogg.h>
-#include <vorbis/codec.h>
-
-#ifdef HAVE_SPEEX
-#include <speex/speex.h>
-#include <speex/speex_header.h>
-#include <speex/speex_stereo.h>
-#include <speex/speex_callbacks.h>
-#endif
-
-#ifdef HAVE_THEORA
-#include <theora/theora.h>
-#endif
-
-#define LOG_MODULE "demux_ogg"
-#define LOG_VERBOSE
-
-/*
-#define LOG
-*/
-
-#define DEBUG_PACKETS 0
-#define DEBUG_PREVIEWS 0
-#define DEBUG_PTS 0
-#define DEBUG_VIDEO_PACKETS 0
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "bswap.h"
-#include "flacutils.h"
-
-#define CHUNKSIZE 8500
-#define PACKET_TYPE_HEADER 0x01
-#define PACKET_TYPE_COMMENT 0x03
-#define PACKET_TYPE_CODEBOOK 0x05
-#define PACKET_TYPE_BITS 0x07
-#define PACKET_LEN_BITS01 0xc0
-#define PACKET_LEN_BITS2 0x02
-#define PACKET_IS_SYNCPOINT 0x08
-
-#define MAX_STREAMS 32
-
-#define PTS_AUDIO 0
-#define PTS_VIDEO 1
-
-#define WRAP_THRESHOLD 900000
-
-#define SUB_BUFSIZE 1024
-
-typedef struct chapter_entry_s {
- int64_t start_pts;
- char *name;
-} chapter_entry_t;
-
-typedef struct chapter_info_s {
- int current_chapter;
- int max_chapter;
- chapter_entry_t *entries;
-} chapter_info_t;
-
-typedef struct stream_info_s {
- ogg_stream_state oss;
- uint32_t buf_types;
- int headers;
- int64_t header_granulepos;
- int64_t factor;
- int64_t quotient;
- int resync;
- char *language;
- /* CMML, Ogg Skeleton stream information */
- int granuleshift;
- /* Annodex v2 stream information */
- int hide_first_header;
- int delivered_bos;
- int delivered_eos;
-} stream_info_t;
-
-typedef struct demux_ogg_s {
- demux_plugin_t demux_plugin;
-
- xine_stream_t *stream;
- fifo_buffer_t *audio_fifo;
- fifo_buffer_t *video_fifo;
- input_plugin_t *input;
- int status;
-
- int frame_duration;
-
-#ifdef HAVE_THEORA
- theora_info t_info;
- theora_comment t_comment;
-#endif
-
- ogg_sync_state oy;
- ogg_page og;
-
- int64_t start_pts;
- int64_t last_pts[2];
-
- int time_length;
-
- int num_streams;
- stream_info_t *si[MAX_STREAMS]; /* stream info */
-
- int num_audio_streams;
- int num_video_streams;
- int unhandled_video_streams;
- int num_spu_streams;
-
- off_t avg_bitrate;
-
- char *meta[XINE_STREAM_INFO_MAX];
- chapter_info_t *chapter_info;
- xine_event_queue_t *event_queue;
-
- uint8_t send_newpts:1;
- uint8_t buf_flag_seek:1;
- uint8_t keyframe_needed:1;
- uint8_t ignore_keyframes:1;
-} demux_ogg_t ;
-
-typedef struct {
- demux_class_t demux_class;
-} demux_ogg_class_t;
-
-typedef struct {
- demux_class_t demux_class;
-} demux_anx_class_t;
-
-
-#ifdef HAVE_THEORA
-static int intlog(int num) {
- int ret=0;
-
- while(num>0){
- num=num/2;
- ret=ret+1;
- }
- return(ret);
-}
-#endif
-
-static int get_stream (demux_ogg_t *this, int serno) {
- /*finds the stream_num, which belongs to a ogg serno*/
- int i;
-
- for (i = 0; i<this->num_streams; i++) {
- if (this->si[i]->oss.serialno == serno) {
- return i;
- }
- }
- return -1;
-}
-
-static int new_stream_info (demux_ogg_t *this, const int cur_serno) {
- int stream_num;
-
- this->si[this->num_streams] = (stream_info_t *)calloc(1, sizeof(stream_info_t));
- ogg_stream_init(&this->si[this->num_streams]->oss, cur_serno);
- stream_num = this->num_streams;
- this->si[stream_num]->buf_types = 0;
- this->si[stream_num]->header_granulepos = -1;
- this->si[stream_num]->headers = 0;
- this->num_streams++;
-
- return stream_num;
-}
-
-static int64_t get_pts (demux_ogg_t *this, int stream_num , int64_t granulepos ) {
- /*calculates an pts from an granulepos*/
- if (granulepos<0) {
- if ( this->si[stream_num]->header_granulepos>=0 ) {
- /*return the smallest valid pts*/
- return 1;
- } else
- return 0;
- } else if (this->si[stream_num]->buf_types == BUF_VIDEO_THEORA ||
- (this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_SPU_CMML) {
- int64_t iframe, pframe;
- int granuleshift;
- granuleshift = this->si[stream_num]->granuleshift;
- iframe = granulepos >> granuleshift;
- pframe = granulepos - (iframe << granuleshift);
- if (this->si[stream_num]->quotient)
- return 1+((iframe+pframe) * this->si[stream_num]->factor / this->si[stream_num]->quotient);
- else
- return 0;
- } else if (this->si[stream_num]->quotient)
- return 1+(granulepos * this->si[stream_num]->factor / this->si[stream_num]->quotient);
- else
- return 0;
-}
-
-static int read_ogg_packet (demux_ogg_t *this) {
- char *buffer;
- long bytes;
- long total = 0;
- while (ogg_sync_pageout(&this->oy,&this->og)!=1) {
- buffer = ogg_sync_buffer(&this->oy, CHUNKSIZE);
- bytes = this->input->read(this->input, buffer, CHUNKSIZE);
- if (bytes <= 0) {
- if (total == 0) {
- lprintf("read_ogg_packet read nothing\n");
- return 0;
- }
- break;
- }
- ogg_sync_wrote(&this->oy, bytes);
- total += bytes;
- }
- return 1;
-}
-
-static void get_stream_length (demux_ogg_t *this) {
- /*determine the streamlenght and set this->time_length accordingly.
- ATTENTION:current_pos and oggbuffers will be destroyed by this function,
- there will be no way to continue playback uninterrupted.
-
- You have to seek afterwards, because after get_stream_length, the
- current_position is at the end of the file */
-
- off_t filelength;
- int done=0;
- int stream_num;
-
- this->time_length=-1;
-
- if (this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) {
- filelength=this->input->get_length(this->input);
-
- if (filelength!=-1) {
- if (filelength>70000) {
- this->demux_plugin.seek(&this->demux_plugin,
- (off_t) ( (double)(filelength-65536)/filelength*65535), 0, 0);
- }
- done=0;
- while (!done) {
- if (!read_ogg_packet (this)) {
- if (this->time_length) {
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_BITRATE,
- ((int64_t) 8000*filelength)/this->time_length);
- /*this is a fine place to compute avg_bitrate*/
- this->avg_bitrate= 8000*filelength/this->time_length;
- }
- return;
- }
- stream_num=get_stream(this, ogg_page_serialno (&this->og) );
- if (stream_num!=-1) {
- if (this->time_length < (get_pts(this, stream_num, ogg_page_granulepos(&this->og) / 90)))
- this->time_length = get_pts(this, stream_num, ogg_page_granulepos(&this->og)) / 90;
- }
- }
- }
- }
-}
-
-#ifdef HAVE_THEORA
-static void send_ogg_packet (demux_ogg_t *this,
- fifo_buffer_t *fifo,
- ogg_packet *op,
- int64_t pts,
- uint32_t decoder_flags,
- int stream_num) {
-
- buf_element_t *buf;
-
- int done=0,todo=op->bytes;
- const size_t op_size = sizeof(ogg_packet);
-
- while (done<todo) {
- size_t offset=0;
- buf = fifo->buffer_pool_alloc (fifo);
- buf->decoder_flags = decoder_flags;
- if (done==0) {
- memcpy (buf->content, op, op_size);
- offset=op_size;
- buf->decoder_flags = buf->decoder_flags | BUF_FLAG_FRAME_START;
- }
-
- if (done+buf->max_size-offset < todo) {
- memcpy (buf->content+offset, op->packet+done, buf->max_size-offset);
- buf->size = buf->max_size;
- done=done+buf->max_size-offset;
- } else {
- memcpy (buf->content+offset , op->packet+done, todo-done);
- buf->size = todo-done+offset;
- done=todo;
- buf->decoder_flags = buf->decoder_flags | BUF_FLAG_FRAME_END;
- }
-
- buf->pts = pts;
- if( this->input->get_length (this->input) )
- buf->extra_info->input_normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
- buf->extra_info->input_time = buf->pts / 90 ;
- buf->type = this->si[stream_num]->buf_types;
-
- fifo->put (fifo, buf);
- }
-}
-#endif
-
-/* redefine abs as macro to handle 64-bit diffs.
- i guess llabs may not be available everywhere */
-#define abs(x) ( ((x)<0) ? -(x) : (x) )
-
-static void check_newpts (demux_ogg_t *this, int64_t pts, int video, int preview) {
- int64_t diff;
-
- llprintf(DEBUG_PTS, "new pts %" PRId64 " found in stream\n",pts);
-
- diff = pts - this->last_pts[video];
-
- if (!preview && (pts>=0) &&
- (this->send_newpts || (this->last_pts[video] && abs(diff)>WRAP_THRESHOLD) ) ) {
-
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "diff=%" PRId64 " (pts=%" PRId64 ", last_pts=%" PRId64 ")\n", diff, pts, this->last_pts[video]);
-
- if (this->buf_flag_seek) {
- _x_demux_control_newpts(this->stream, pts, BUF_FLAG_SEEK);
- this->buf_flag_seek = 0;
- } else {
- _x_demux_control_newpts(this->stream, pts, 0);
- }
- this->send_newpts = 0;
- this->last_pts[1-video] = 0;
- }
-
- if (!preview && (pts>=0) )
- this->last_pts[video] = pts;
-
- /* use pts for bitrate measurement */
-
- /*compute avg_bitrate if time_length isn't set*/
- if ((pts>180000) && !(this->time_length)) {
- this->avg_bitrate = this->input->get_current_pos (this->input) * 8 * 90000/ pts;
-
- if (this->avg_bitrate<1)
- this->avg_bitrate = 1;
-
- }
-}
-
-static void ogg_handle_event (demux_ogg_t *this) {
- xine_event_t *event;
-
- while ((event = xine_event_get(this->event_queue))) {
- switch(event->type) {
- case XINE_EVENT_INPUT_NEXT:
- {
- if (this->chapter_info) {
- int c_chap = this->chapter_info->current_chapter;
- if (c_chap+1 < this->chapter_info->max_chapter) {
- int start_time = this->chapter_info->entries[c_chap+1].start_pts / 90;
- this->demux_plugin.seek((demux_plugin_t *)this, 0, start_time, 1);
- }
- }
- }
- break;
- case XINE_EVENT_INPUT_PREVIOUS:
- {
- if (this->chapter_info) {
- int c_chap = this->chapter_info->current_chapter;
- if (c_chap >= 1) {
- int start_time = this->chapter_info->entries[c_chap-1].start_pts / 90;
- this->demux_plugin.seek((demux_plugin_t *)this, 0, start_time, 1);
- }
- }
- }
- break;
- }
- xine_event_free(event);
- }
- return;
-}
-
-
-#define OGG_META(TAG,APPEND) { #TAG"=", XINE_META_INFO_##TAG, APPEND }
-#define OGG_META_L(TAG,APPEND,META) { #TAG"=", XINE_META_INFO_##META, APPEND }
-static const struct ogg_meta {
- char tag[16];
- int meta;
- int append;
-} metadata[] = {
- OGG_META (ALBUM, 0),
- OGG_META (ARTIST, 0),
- OGG_META (PUBLISHER, 0),
- OGG_META (COPYRIGHT, 0),
- OGG_META (DISCNUMBER, 0),
- OGG_META (LICENSE, 0),
- OGG_META (TITLE, 0),
- OGG_META_L (TRACKNUMBER, 0, TRACK_NUMBER),
- OGG_META (COMPOSER, 1),
- OGG_META (ARRANGER, 1),
- OGG_META (LYRICIST, 1),
- OGG_META (AUTHOR, 1),
- OGG_META (CONDUCTOR, 1),
- OGG_META (PERFORMER, 1),
- OGG_META (ENSEMBLE, 1),
- OGG_META (OPUS, 0),
- OGG_META (PART, 0),
- OGG_META (PARTNUMBER, 0),
- OGG_META (GENRE, 1),
- OGG_META_L (DATE, 1, YEAR), /* hmm... */
- OGG_META (LOCATION, 0),
- OGG_META (COMMENT, 0),
-};
-
-#if 0
-/* ensure that those marked "append" are cleared */
-/* FIXME: is this useful? Should they be cleared on first write? */
-static void prepare_read_comments (demux_ogg_t *this)
-{
- int i;
-
- for (i = 0; i < sizeof (metadata) / sizeof (struct ogg_meta); ++i)
- if (metadata[i].append) {
- free (this->meta[metadata[i].meta]);
- this->meta[metadata[i].meta] = NULL;
- }
-}
-#endif
-
-static int read_comments (demux_ogg_t *this, const char *comment)
-{
- int i;
-
- for (i = 0; i < sizeof (metadata) / sizeof (struct ogg_meta); ++i) {
- size_t ml = strlen (metadata[i].tag);
- if (!strncasecmp (metadata[i].tag, comment, ml) && comment[ml]) {
- if (metadata[i].append && this->meta[metadata[i].meta]) {
- char *newstr;
- if (asprintf (&newstr, "%s\n%s", this->meta[metadata[i].meta], comment + ml) >= 0) {
- free (this->meta[metadata[i].meta]);
- this->meta[metadata[i].meta] = newstr;
- }
- }
- else {
- free (this->meta[metadata[i].meta]);
- this->meta[metadata[i].meta] = strdup (comment + ml);
- }
- _x_meta_info_set_utf8(this->stream, metadata[i].meta, this->meta[metadata[i].meta]);
- return 1;
- }
- }
- return 0;
-}
-
-/*
- * utility function to read a LANGUAGE= line from the user_comments,
- * to label audio and spu streams
- * utility function to read CHAPTER*=, TITLE= etc. from the user_comments,
- * to name (parts of) the stream
- */
-static void read_language_comment (demux_ogg_t *this, ogg_packet *op, int stream_num) {
- char **ptr;
- char *comment;
- vorbis_comment vc;
- vorbis_info vi;
-
- vorbis_comment_init(&vc);
- vorbis_info_init(&vi);
-
- /* this is necessary to make libvorbis accept this vorbis_info*/
- vi.rate=1;
-
- if ( vorbis_synthesis_headerin(&vi, &vc, op) >= 0) {
- ptr=vc.user_comments;
- while(*ptr) {
- comment=*ptr++;
- if ( !strncasecmp ("LANGUAGE=", comment, 9) ) {
- this->si[stream_num]->language = strdup (comment + strlen ("LANGUAGE=") );
- }
- else
- read_comments (this, comment);
- }
- }
- vorbis_comment_clear(&vc);
- vorbis_info_clear(&vi);
-}
-
-/*
- * utility function to read CHAPTER*= from the user_comments,
- * to name parts of the stream
- */
-static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) {
- char **ptr;
- char *comment;
- vorbis_comment vc;
- vorbis_info vi;
-
- vorbis_comment_init(&vc);
- vorbis_info_init(&vi);
-
- /* this is necessary to make libvorbis accept this vorbis_info*/
- vi.rate=1;
-
- if ( vorbis_synthesis_headerin(&vi, &vc, op) >= 0) {
- char *chapter_time = 0;
- char *chapter_name = 0;
- int chapter_no = 0;
-
- ptr=vc.user_comments;
-
- while(*ptr) {
- comment=*ptr++;
- if (read_comments (this, comment))
- continue;
-
- if ( !chapter_time && strlen(comment) == 22 &&
- !strncasecmp ("CHAPTER" , comment, 7) &&
- isdigit(*(comment+7)) && isdigit(*(comment+8)) &&
- (*(comment+9) == '=')) {
-
- chapter_time = strdup(comment+10);
- chapter_no = strtol(comment+7, NULL, 10);
- }
- if ( !chapter_name && !strncasecmp("CHAPTER", comment, 7) &&
- isdigit(*(comment+7)) && isdigit(*(comment+8)) &&
- !strncasecmp ("NAME=", comment+9, 5)) {
-
- if (strtol(comment+7,NULL,10) == chapter_no) {
- chapter_name = strdup(comment+14);
- }
- }
- if (chapter_time && chapter_name && chapter_no){
- int hour, min, sec, msec;
-
- lprintf("create chapter entry: no=%d name=%s time=%s\n", chapter_no, chapter_name, chapter_time);
- hour= strtol(chapter_time, NULL, 10);
- min = strtol(chapter_time+3, NULL, 10);
- sec = strtol(chapter_time+6, NULL, 10);
- msec = strtol(chapter_time+9, NULL, 10);
- lprintf("time: %d %d %d %d\n", hour, min,sec,msec);
-
- if (!this->chapter_info) {
- this->chapter_info = (chapter_info_t *)calloc(1, sizeof(chapter_info_t));
- this->chapter_info->current_chapter = -1;
- }
- this->chapter_info->max_chapter = chapter_no;
- this->chapter_info->entries = realloc( this->chapter_info->entries, chapter_no*sizeof(chapter_entry_t));
- this->chapter_info->entries[chapter_no-1].name = chapter_name;
- this->chapter_info->entries[chapter_no-1].start_pts = (msec + (1000.0 * sec) + (60000.0 * min) + (3600000.0 * hour))*90;
-
- free (chapter_time);
- chapter_no = 0;
- chapter_time = chapter_name = 0;
- }
- }
- }
- vorbis_comment_clear(&vc);
- vorbis_info_clear(&vi);
-}
-
-/*
- * update the display of the title, if needed
- */
-static void update_chapter_display (demux_ogg_t *this, int stream_num, ogg_packet *op) {
- int chapter = 0;
- int64_t pts = get_pts(this, stream_num, op->granulepos );
-
- while (chapter < this->chapter_info->max_chapter &&
- this->chapter_info->entries[chapter].start_pts < pts) {
- chapter++;
- }
- chapter--;
-
- if (chapter != this->chapter_info->current_chapter){
- xine_ui_data_t data = {
- .str = { 0, },
- .str_len = 0
- };
- xine_event_t uevent = {
- .type = XINE_EVENT_UI_SET_TITLE,
- .stream = this->stream,
- .data = &data,
- .data_length = sizeof(data)
- };
-
- this->chapter_info->current_chapter = chapter;
-
- if (chapter >= 0) {
- if (this->meta[XINE_META_INFO_TITLE]) {
- data.str_len = snprintf(data.str, sizeof(data.str), "%s / %s", this->meta[XINE_META_INFO_TITLE], this->chapter_info->entries[chapter].name);
- } else {
- strncpy(data.str, this->chapter_info->entries[chapter].name, sizeof(data.str)-1);
- }
- } else {
- strncpy(data.str, this->meta[XINE_META_INFO_TITLE], sizeof(data.str));
- }
- if ( data.str_len == 0 )
- data.str_len = strlen(data.str);
-
- _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, data.str);
- lprintf("new TITLE: %s\n", data.str);
-
- xine_event_send(this->stream, &uevent);
- }
-}
-
-/*
- * utility function to pack one ogg_packet into a xine
- * buffer, fill out all needed fields
- * and send it to the right fifo
- */
-
-static void send_ogg_buf (demux_ogg_t *this,
- ogg_packet *op,
- int stream_num,
- uint32_t decoder_flags) {
-
- int hdrlen;
- int normpos = 0;
-
- if( this->input->get_length (this->input) )
- normpos = (int)( (double) this->input->get_current_pos (this->input) *
- 65535 / this->input->get_length (this->input) );
-
-
- hdrlen = (*op->packet & PACKET_LEN_BITS01) >> 6;
- hdrlen |= (*op->packet & PACKET_LEN_BITS2) << 1;
-
- /* for Annodex files: the first packet after the AnxData info packet needs
- * to have its BOS flag set: we set it here */
- if (!this->si[stream_num]->delivered_bos) {
- op->b_o_s = 1;
- this->si[stream_num]->delivered_bos = 1;
- }
-
- if ( this->audio_fifo
- && (this->si[stream_num]->buf_types & 0xFF000000) == BUF_AUDIO_BASE) {
- uint8_t *data;
- int size;
- int64_t pts;
-
- if (op->packet[0] == PACKET_TYPE_COMMENT ) {
- read_language_comment(this, op, stream_num);
- }
-
- if ((this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_AUDIO_SPEEX ||
- (this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_AUDIO_FLAC ||
- (this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_AUDIO_VORBIS) {
- data = op->packet;
- size = op->bytes;
- } else {
- data = op->packet+1+hdrlen;
- size = op->bytes-1-hdrlen;
- }
- llprintf(DEBUG_PACKETS, "audio data size %d\n", size);
-
- if ((op->granulepos != -1) || (this->si[stream_num]->header_granulepos != -1)) {
- pts = get_pts(this, stream_num, op->granulepos );
- check_newpts( this, pts, PTS_AUDIO, decoder_flags );
- } else
- pts = 0;
-
- llprintf(DEBUG_PACKETS,
- "audiostream %d op-gpos %" PRId64 " hdr-gpos %" PRId64 " pts %" PRId64 " \n",
- stream_num,
- op->granulepos,
- this->si[stream_num]->header_granulepos,
- pts);
-
- _x_demux_send_data(this->audio_fifo, data, size,
- pts, this->si[stream_num]->buf_types, decoder_flags,
- normpos,
- pts / 90, this->time_length, 0);
-
-#ifdef HAVE_THEORA
- } else if ((this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_VIDEO_THEORA) {
-
- int64_t pts;
- theora_info t_info;
- theora_comment t_comment;
-
- theora_info_init (&t_info);
- theora_comment_init (&t_comment);
-
- /*Lets see if this is an Header*/
- if ((theora_decode_header(&t_info, &t_comment, op))>=0) {
- decoder_flags=decoder_flags|BUF_FLAG_HEADER;
- lprintf ("found an header\n");
- }
-
- if ((op->granulepos != -1) || (this->si[stream_num]->header_granulepos != -1)) {
- pts = get_pts(this, stream_num, op->granulepos );
- check_newpts( this, pts, PTS_VIDEO, decoder_flags );
- } else
- pts = 0;
-
- llprintf(DEBUG_PACKETS,
- "theorastream %d op-gpos %" PRId64 " hdr-gpos %" PRId64 " pts %" PRId64 " \n",
- stream_num,
- op->granulepos,
- this->si[stream_num]->header_granulepos,
- pts);
-
- send_ogg_packet (this, this->video_fifo, op, pts, decoder_flags, stream_num);
-
- theora_comment_clear (&t_comment);
- theora_info_clear (&t_info);
-#endif
-
- } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_VIDEO_BASE) {
-
- uint8_t *data;
- int size;
- int64_t pts;
-
- llprintf(DEBUG_VIDEO_PACKETS,
- "video buffer, type=%08x\n", this->si[stream_num]->buf_types);
-
- if (op->packet[0] == PACKET_TYPE_COMMENT ) {
- read_chapter_comment(this, op);
- }else{
- data = op->packet+1+hdrlen;
- size = op->bytes-1-hdrlen;
-
- if ((op->granulepos != -1) || (this->si[stream_num]->header_granulepos != -1)) {
- pts = get_pts(this, stream_num, op->granulepos );
- check_newpts( this, pts, PTS_VIDEO, decoder_flags );
- } else
- pts = 0;
-
- llprintf(DEBUG_VIDEO_PACKETS,
- "videostream %d op-gpos %" PRId64 " hdr-gpos %" PRId64 " pts %" PRId64 " \n",
- stream_num,
- op->granulepos,
- this->si[stream_num]->header_granulepos,
- pts);
-
- _x_demux_send_data(this->video_fifo, data, size,
- pts, this->si[stream_num]->buf_types, decoder_flags,
- normpos,
- pts / 90, this->time_length, 0);
-
- if (this->chapter_info && op->granulepos != -1) {
- update_chapter_display(this, stream_num, op);
- }
- }
- } else if ((this->si[stream_num]->buf_types & 0xFFFF0000) == BUF_SPU_CMML) {
- buf_element_t *buf;
- uint32_t *val;
- char *str;
-
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
-
- buf->type = this->si[stream_num]->buf_types;
-
- buf->pts = get_pts (this, stream_num, op->granulepos);
-
- val = (uint32_t * )buf->content;
- str = (char *)val;
-
- memcpy(str, op->packet, op->bytes);
- str[op->bytes] = '\0';
-
- buf->size = 12 + op->bytes + 1;
-
- lprintf ("CMML stream %d (bytes=%ld): PTS %"PRId64": %s\n",
- stream_num, op->bytes, buf->pts, str);
-
- this->video_fifo->put (this->video_fifo, buf);
- } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_SPU_BASE) {
-
- buf_element_t *buf;
- int i;
- char *subtitle,*str;
- int lenbytes;
- int start,end;
- uint32_t *val;
-
- for (i = 0, lenbytes = 0; i < hdrlen; i++) {
- lenbytes = lenbytes << 8;
- lenbytes += *((unsigned char *) op->packet + hdrlen - i);
- }
-
- if (op->packet[0] == PACKET_TYPE_HEADER ) {
- lprintf ("Textstream-header-packet\n");
- } else if (op->packet[0] == PACKET_TYPE_COMMENT ) {
- lprintf ("Textstream-comment-packet\n");
- read_language_comment(this, op, stream_num);
- } else {
- subtitle = (char *)&op->packet[hdrlen + 1];
-
- if ((strlen(subtitle) > 1) || (*subtitle != ' ')) {
- start = op->granulepos;
- end = start+lenbytes;
- lprintf ("subtitlestream %d: %d -> %d :%s\n",stream_num,start,end,subtitle);
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
-
- buf->type = this->si[stream_num]->buf_types;
- buf->pts = 0;
-
- val = (uint32_t * )buf->content;
- *val++ = start;
- *val++ = end;
- str = (char *)val;
-
- memcpy (str, subtitle, 1+strlen(subtitle));
-
- this->video_fifo->put (this->video_fifo, buf);
- }
- }
- } else {
- lprintf("unknown stream type %x\n", this->si[stream_num]->buf_types);
- }
-}
-
-static void decode_vorbis_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- vorbis_info vi;
- vorbis_comment vc;
-
- this->si[stream_num]->buf_types = BUF_AUDIO_VORBIS
- +this->num_audio_streams++;
-
- this->si[stream_num]->headers = 3;
-
- vorbis_info_init(&vi);
- vorbis_comment_init(&vc);
- if (vorbis_synthesis_headerin(&vi, &vc, op) >= 0) {
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, vi.bitrate_nominal);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, vi.rate);
-
- this->si[stream_num]->factor = 90000;
- this->si[stream_num]->quotient = vi.rate;
-
- if (vi.bitrate_nominal<1)
- this->avg_bitrate += 100000; /* assume 100 kbit */
- else
- this->avg_bitrate += vi.bitrate_nominal;
-
- } else {
- this->si[stream_num]->factor = 900;
- this->si[stream_num]->quotient = 441;
-
- this->si[stream_num]->headers = 0;
- xine_log (this->stream->xine, XINE_LOG_MSG,
- _("ogg: vorbis audio track indicated but no vorbis stream header found.\n"));
- }
- vorbis_comment_clear(&vc);
- vorbis_info_clear(&vi);
-}
-
-static void decode_speex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
-#ifdef HAVE_SPEEX
- void *st;
- SpeexMode *mode;
- SpeexHeader *header;
-
- this->si[stream_num]->buf_types = BUF_AUDIO_SPEEX
- +this->num_audio_streams++;
-
- this->si[stream_num]->headers = 1;
-
- header = speex_packet_to_header (op->packet, op->bytes);
-
- if (header) {
- int bitrate;
- mode = (SpeexMode *) speex_mode_list[header->mode];
-
- st = speex_decoder_init (mode);
-
- speex_decoder_ctl (st, SPEEX_GET_BITRATE, &bitrate);
-
- if (bitrate <= 1)
- bitrate = 16000; /* assume 16 kbit */
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, bitrate);
-
- this->si[stream_num]->factor = 90000;
- this->si[stream_num]->quotient = header->rate;
-
- this->avg_bitrate += bitrate;
-
- lprintf ("detected Speex stream,\trate %d\tbitrate %d\n", header->rate, bitrate);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, header->rate);
- this->si[stream_num]->headers += header->extra_headers;
- }
-#else
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Speex stream detected, unable to play\n");
-
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
-#endif
-}
-
-static void decode_video_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- buf_element_t *buf;
- xine_bmiheader bih;
- int channel;
-
-#ifdef LOG
- int16_t locbits_per_sample;
- int32_t locsize, locdefault_len, locbuffersize;
- int64_t locsamples_per_unit;
-#endif
- uint32_t locsubtype;
- int32_t locwidth, locheight;
- int64_t loctime_unit;
-
- /* read fourcc with machine endianness */
- locsubtype = *((uint32_t *)&op->packet[9]);
-
- /* everything else little endian */
- loctime_unit = _X_LE_64(&op->packet[17]);
-#ifdef LOG
- locsize = _X_LE_32(&op->packet[13]);
- locsamples_per_unit = _X_LE_64(&op->packet[25]);
- locdefault_len = _X_LE_32(&op->packet[33]);
- locbuffersize = _X_LE_32(&op->packet[37]);
- locbits_per_sample = _X_LE_16(&op->packet[41]);
-#endif
- locwidth = _X_LE_32(&op->packet[45]);
- locheight = _X_LE_32(&op->packet[49]);
-
- lprintf ("direct show filter created stream detected, hexdump:\n");
-#ifdef LOG
- xine_hexdump (op->packet, op->bytes);
-#endif
-
- channel = this->num_video_streams++;
-
- this->si[stream_num]->buf_types = _x_fourcc_to_buf_video (locsubtype);
- if( !this->si[stream_num]->buf_types )
- this->si[stream_num]->buf_types = BUF_VIDEO_UNKNOWN;
- this->si[stream_num]->buf_types |= channel;
- this->si[stream_num]->headers = 0; /* header is sent below */
-
- lprintf ("subtype %.4s\n", (char*)&locsubtype);
- lprintf ("time_unit %" PRId64 "\n", loctime_unit);
- lprintf ("samples_per_unit %" PRId64 "\n", locsamples_per_unit);
- lprintf ("default_len %d\n", locdefault_len);
- lprintf ("buffersize %d\n", locbuffersize);
- lprintf ("bits_per_sample %d\n", locbits_per_sample);
- lprintf ("width %d\n", locwidth);
- lprintf ("height %d\n", locheight);
- lprintf ("buf_type %08x\n",this->si[stream_num]->buf_types);
-
- bih.biSize=sizeof(xine_bmiheader);
- bih.biWidth = locwidth;
- bih.biHeight= locheight;
- bih.biPlanes= 0;
- memcpy(&bih.biCompression, &locsubtype, 4);
- bih.biBitCount= 0;
- bih.biSizeImage=locwidth*locheight;
- bih.biXPelsPerMeter=1;
- bih.biYPelsPerMeter=1;
- bih.biClrUsed=0;
- bih.biClrImportant=0;
-
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAMERATE|
- BUF_FLAG_FRAME_END;
- this->frame_duration = loctime_unit * 9 / 1000;
- this->si[stream_num]->factor = loctime_unit * 9;
- this->si[stream_num]->quotient = 1000;
- buf->decoder_info[0] = this->frame_duration;
- memcpy (buf->content, &bih, sizeof (xine_bmiheader));
- buf->size = sizeof (xine_bmiheader);
- buf->type = this->si[stream_num]->buf_types;
-
- /* video metadata */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_FOURCC, locsubtype);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, locwidth);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, locheight);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->frame_duration);
-
- this->avg_bitrate += 500000; /* FIXME */
-
- this->video_fifo->put (this->video_fifo, buf);
-}
-
-static void decode_audio_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
-
- if (this->audio_fifo) {
- buf_element_t *buf;
- int codec;
- char str[5];
- int channel;
-
-#ifdef LOG
- int16_t locblockalign;
- int32_t locsize, locdefault_len, locbuffersize;
- int64_t loctime_unit;
-#endif
- int16_t locbits_per_sample, locchannels;
- int32_t locavgbytespersec;
- int64_t locsamples_per_unit;
-
-#ifdef LOG
- locsize = _X_LE_32(&op->packet[13]);
- loctime_unit = _X_LE_64(&op->packet[17]);
- locbuffersize = _X_LE_32(&op->packet[37]);
- locdefault_len = _X_LE_32(&op->packet[33]);
- locblockalign = _X_LE_16(&op->packet[47]);
-#endif
- locsamples_per_unit = _X_LE_64(&op->packet[25]);
- locbits_per_sample = _X_LE_16(&op->packet[41]);
- locchannels = _X_LE_16(&op->packet[45]);
- locavgbytespersec= _X_LE_32(&op->packet[49]);
-
- lprintf ("direct show filter created audio stream detected, hexdump:\n");
-#ifdef LOG
- xine_hexdump (op->packet, op->bytes);
-#endif
-
- memcpy(str, &op->packet[9], 4);
- str[4] = 0;
- codec = strtoul(str, NULL, 16);
-
- channel= this->num_audio_streams++;
-
- this->si[stream_num]->buf_types = _x_formattag_to_buf_audio(codec);
- if( this->si[stream_num]->buf_types ) {
- this->si[stream_num]->buf_types |= channel;
- } else {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_ogg: unknown audio codec type 0x%x\n", codec);
- this->si[stream_num]->buf_types = BUF_AUDIO_UNKNOWN;
- /*break;*/
- }
-
- lprintf ("subtype 0x%x\n", codec);
- lprintf ("time_unit %" PRId64 "\n", loctime_unit);
- lprintf ("samples_per_unit %" PRId64 "\n", locsamples_per_unit);
- lprintf ("default_len %d\n", locdefault_len);
- lprintf ("buffersize %d\n", locbuffersize);
- lprintf ("bits_per_sample %d\n", locbits_per_sample);
- lprintf ("channels %d\n", locchannels);
- lprintf ("blockalign %d\n", locblockalign);
- lprintf ("avgbytespersec %d\n", locavgbytespersec);
- lprintf ("buf_type %08x\n",this->si[stream_num]->buf_types);
-
- buf = this->audio_fifo->buffer_pool_alloc (this->audio_fifo);
- buf->type = this->si[stream_num]->buf_types;
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
- buf->decoder_info[0] = 0;
- buf->decoder_info[1] = locsamples_per_unit;
- buf->decoder_info[2] = locbits_per_sample;
- buf->decoder_info[3] = locchannels;
- this->audio_fifo->put (this->audio_fifo, buf);
-
- this->si[stream_num]->headers = 0; /* header already sent */
- this->si[stream_num]->factor = 90000;
- this->si[stream_num]->quotient = locsamples_per_unit;
-
- this->avg_bitrate += locavgbytespersec*8;
-
- /* audio metadata */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_FOURCC, codec);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, locchannels);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, locbits_per_sample);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, locsamples_per_unit);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, locavgbytespersec * 8);
-
- } else /* no audio_fifo there */
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
-}
-
-static void decode_dshow_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
-
- lprintf ("older Direct Show filter-generated stream header detected. Hexdump:\n");
-#ifdef LOG
- xine_hexdump (op->packet, op->bytes);
-#endif
-
- this->si[stream_num]->headers = 0; /* header is sent below */
-
- if ( _x_is_fourcc(&op->packet[96], "\x05\x58\x9f\x80") && (op->bytes >= 184)) {
-
- buf_element_t *buf;
- xine_bmiheader bih;
- int channel;
- uint32_t fcc;
-
- lprintf ("seems to be a video stream.\n");
-
- channel = this->num_video_streams++;
- fcc = *(uint32_t*)(op->packet+68);
- lprintf ("fourcc %08x\n", fcc);
-
- this->si[stream_num]->buf_types = _x_fourcc_to_buf_video (fcc);
- if( !this->si[stream_num]->buf_types )
- this->si[stream_num]->buf_types = BUF_VIDEO_UNKNOWN;
- this->si[stream_num]->buf_types |= channel;
-
- bih.biSize = sizeof(xine_bmiheader);
- bih.biWidth = _X_LE_32(&op->packet[176]);
- bih.biHeight = _X_LE_32(&op->packet[180]);
- bih.biPlanes = 0;
- memcpy (&bih.biCompression, op->packet+68, 4);
- bih.biBitCount = _X_LE_16(&op->packet[182]);
- if (!bih.biBitCount)
- bih.biBitCount = 24; /* FIXME ? */
- bih.biSizeImage = (bih.biBitCount>>3)*bih.biWidth*bih.biHeight;
- bih.biXPelsPerMeter = 1;
- bih.biYPelsPerMeter = 1;
- bih.biClrUsed = 0;
- bih.biClrImportant = 0;
-
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAMERATE|
- BUF_FLAG_FRAME_END;
- this->frame_duration = (*(int64_t*)(op->packet+164)) * 9 / 1000;
- this->si[stream_num]->factor = (*(int64_t*)(op->packet+164)) * 9;
- this->si[stream_num]->quotient = 1000;
-
- buf->decoder_info[0] = this->frame_duration;
- memcpy (buf->content, &bih, sizeof (xine_bmiheader));
- buf->size = sizeof (xine_bmiheader);
- buf->type = this->si[stream_num]->buf_types;
- this->video_fifo->put (this->video_fifo, buf);
-
- lprintf ("subtype %.4s\n", (char*)&fcc);
- lprintf ("buf_type %08x\n", this->si[stream_num]->buf_types);
- lprintf ("video size %d x %d\n", bih.biWidth, bih.biHeight);
- lprintf ("frame duration %d\n", this->frame_duration);
-
- /* video metadata */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, bih.biWidth);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, bih.biHeight);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->frame_duration);
-
- this->avg_bitrate += 500000; /* FIXME */
-
- this->ignore_keyframes = 1;
-
- } else if (_x_is_fourcc(&op->packet[96], "\x05\x58\x9f\x81")) {
-
-#if 0
- /* FIXME: no test streams */
-
- buf_element_t *buf;
- int codec;
- char str[5];
- int channel;
- int extra_size;
-
- extra_size = *(int16_t*)(op->packet+140);
- format = *(int16_t*)(op->packet+124);
- channels = *(int16_t*)(op->packet+126);
- samplerate = *(int32_t*)(op->packet+128);
- nAvgBytesPerSec = *(int32_t*)(op->packet+132);
- nBlockAlign = *(int16_t*)(op->packet+136);
- wBitsPerSample = *(int16_t*)(op->packet+138);
- samplesize = (sh_a->wf->wBitsPerSample+7)/8;
- cbSize = extra_size;
- if(extra_size > 0)
- memcpy(wf+sizeof(WAVEFORMATEX),op->packet+142,extra_size);
-#endif
-
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "FIXME, old audio format not handled\n");
-
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
-
- } else {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "old header detected but stream type is unknown\n");
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
- }
-}
-
-static void decode_text_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- int channel=0;
- uint32_t *val;
- buf_element_t *buf;
-
- lprintf ("textstream detected.\n");
- this->si[stream_num]->headers = 2;
- channel = this->num_spu_streams++;
- this->si[stream_num]->buf_types = BUF_SPU_OGM | channel;
-
- /*send an empty spu to inform the video_decoder, that there is a stream*/
- buf = this->video_fifo->buffer_pool_alloc (this->video_fifo);
- buf->type = this->si[stream_num]->buf_types;
- buf->pts = 0;
- val = (uint32_t * )buf->content;
- *val++=0;
- *val++=0;
- *val++=0;
- this->video_fifo->put (this->video_fifo, buf);
-}
-
-static void decode_theora_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
-
-#ifdef HAVE_THEORA
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_ogg: Theorastreamsupport is highly alpha at the moment\n");
-
- if (theora_decode_header(&this->t_info, &this->t_comment, op) >= 0) {
-
- this->num_video_streams++;
-
- this->si[stream_num]->factor = (int64_t) 90000 * (int64_t) this->t_info.fps_denominator;
-
- if (!this->t_info.fps_numerator) {
- this->t_info.fps_numerator = 1; /* FIXME: default value ? */
- }
- this->si[stream_num]->quotient = this->t_info.fps_numerator;
-
- this->frame_duration = ((int64_t) 90000*this->t_info.fps_denominator);
- this->frame_duration /= this->t_info.fps_numerator;
-
- this->si[stream_num]->granuleshift = intlog(this->t_info.keyframe_frequency_force-1);
-
- this->si[stream_num]->headers=3;
- this->si[stream_num]->buf_types = BUF_VIDEO_THEORA;
-
- _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "theora");
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->t_info.frame_width);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->t_info.frame_height);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->frame_duration);
-
- /*currently aspect_nominator and -denumerator are 0?*/
- if (this->t_info.aspect_denominator) {
- int64_t ratio = ((int64_t) this->t_info.aspect_numerator * 10000);
-
- ratio /= this->t_info.aspect_denominator;
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, ratio);
- }
-
- lprintf ("decoded theora header \n");
- lprintf ("frameduration %d\n",this->frame_duration);
- lprintf ("w:%d h:%d \n",this->t_info.frame_width,this->t_info.frame_height);
- lprintf ("an:%d ad:%d \n",this->t_info.aspect_numerator,this->t_info.aspect_denominator);
- } else {
- /*Rejected stream*/
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "A theora header was rejected by libtheora\n");
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
- this->si[stream_num]->headers = 0; /* FIXME: don't know */
- }
-#else
- this->si[stream_num]->buf_types = BUF_VIDEO_THEORA;
- this->num_video_streams++;
- this->unhandled_video_streams++;
- _x_meta_info_set(this->stream, XINE_META_INFO_VIDEOCODEC, "theora");
-#endif
-}
-
-static void decode_flac_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- xine_flac_metadata_header header;
- xine_flac_streaminfo_block streaminfo = {};
- buf_element_t *buf;
- xine_waveformatex wave;
-
- static const uint8_t flac_signature_1[] =
- {
- /* Packet type */
- 0x7F,
- /* OggFLAC signature */
- 'F', 'L', 'A', 'C',
- /* Version: only 1.0 supported */
- 1, 0
- };
- static const uint8_t flac_signature_2[] = "fLaC";
-
- _x_assert(memcmp(&op->packet[0], flac_signature_1, sizeof(flac_signature_1)) == 0);
- _x_assert(memcmp(&op->packet[9], flac_signature_2, sizeof(flac_signature_2)) == 0);
-
- /* Header count */
- this->si[stream_num]->headers = 0/*_X_BE_16(&op->packet[7]) +1*/;
-
- _x_parse_flac_metadata_header(&op->packet[13], &header);
-
- switch ( header.blocktype ) {
- case FLAC_BLOCKTYPE_STREAMINFO:
- _x_assert(header.length == FLAC_STREAMINFO_SIZE);
- _x_parse_flac_streaminfo_block(&op->packet[17], &streaminfo);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, streaminfo.samplerate);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS, streaminfo.channels);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITS, streaminfo.bits_per_sample);
-
- break;
- }
-
- this->si[stream_num]->buf_types = BUF_AUDIO_FLAC
- +this->num_audio_streams++;
-
- this->si[stream_num]->factor = 90000;
-
- buf = this->audio_fifo->buffer_pool_alloc(this->audio_fifo);
-
- buf->type = BUF_AUDIO_FLAC;
- buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
-
- buf->decoder_info[0] = 0;
- buf->decoder_info[1] = streaminfo.samplerate;
- buf->decoder_info[2] = streaminfo.bits_per_sample;
- buf->decoder_info[3] = streaminfo.channels;
- buf->size = sizeof(xine_waveformatex) + FLAC_STREAMINFO_SIZE;
- memcpy(buf->content+sizeof(xine_waveformatex), &op->packet[17], FLAC_STREAMINFO_SIZE);
- xine_hexdump(&op->packet[17], FLAC_STREAMINFO_SIZE);
- wave.cbSize = FLAC_STREAMINFO_SIZE;
- memcpy(buf->content, &wave, sizeof(xine_waveformatex));
-
- this->audio_fifo->put(this->audio_fifo, buf);
-
- /* Skip the Ogg framing info */
- op->bytes -= 9;
- op->packet += 9;
-}
-
-static void decode_annodex_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- lprintf ("Annodex stream detected\n");
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
- this->si[stream_num]->headers = 1;
- this->si[stream_num]->header_granulepos = op->granulepos;
- _x_meta_info_set(this->stream, XINE_META_INFO_SYSTEMLAYER, "Annodex");
-}
-
-static void decode_anxdata_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- int64_t granule_rate_n, granule_rate_d;
- uint32_t secondary_headers;
- const char *content_type = "";
- size_t content_type_length = 0;
-
- lprintf("AnxData stream detected\n");
-
- /* read granule rate */
- granule_rate_n = _X_LE_64(&op->packet[8]);
- granule_rate_d = _X_LE_64(&op->packet[16]);
- secondary_headers = _X_LE_32(&op->packet[24]);
-
- lprintf("granule_rate %" PRId64 "/%" PRId64 ", %d secondary headers\n",
- granule_rate_n, granule_rate_d, secondary_headers);
-
- /* read "Content-Type" MIME header */
- const char *startline = &op->packet[28];
- const char *endline;
- if ( strcmp(&op->packet[28], "Content-Type: ") == 0 &&
- (endline = strstr(startline, "\r\n")) ) {
- content_type = startline + sizeof("Content-Type: ");
- content_type_length = startline - endline;
- }
-
- lprintf("Content-Type: %s (length:%td)\n", content_type, content_type_length);
-
- /* how many header packets in the AnxData stream? */
- this->si[stream_num]->headers = secondary_headers + 1;
- this->si[stream_num]->hide_first_header = 1;
-
- /* set factor and quotient */
- this->si[stream_num]->factor = (int64_t) 90000 * granule_rate_d;
- this->si[stream_num]->quotient = granule_rate_n;
-
- lprintf("factor: %" PRId64 ", quotient: %" PRId64 "\n",
- this->si[stream_num]->factor, this->si[stream_num]->quotient);
-
- /* what type of stream are we dealing with? */
- if (!strncmp(content_type, "audio/x-vorbis", content_type_length)) {
- this->si[stream_num]->buf_types = BUF_AUDIO_VORBIS;
- this->num_audio_streams++;
- } else if (!strncmp(content_type, "audio/x-speex", content_type_length)) {
- this->num_audio_streams++;
-#ifdef HAVE_SPEEX
- this->si[stream_num]->buf_types = BUF_AUDIO_SPEEX;
-#else
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
-#endif
- } else if (!strncmp(content_type, "video/x-theora", content_type_length)) {
- this->num_video_streams++;
-#ifdef HAVE_THEORA
- this->si[stream_num]->buf_types = BUF_VIDEO_THEORA;
-#else
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
-#endif
- } else if (!strncmp(content_type, "text/x-cmml", content_type_length)) {
- unsigned int channel = this->num_spu_streams++;
- this->si[stream_num]->headers = 0;
- this->si[stream_num]->buf_types = BUF_SPU_CMML | channel;
- this->si[stream_num]->granuleshift = 0;
- } else {
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
- }
-
-}
-
-static void decode_cmml_header (demux_ogg_t *this, const int stream_num, ogg_packet *op) {
- unsigned int channel = this->num_spu_streams++;
- this->si[stream_num]->headers = 0;
- this->si[stream_num]->buf_types = BUF_SPU_CMML | channel;
-
- this->si[stream_num]->factor = 90000 * _X_LE_64(&op->packet[20]);
- this->si[stream_num]->quotient = _X_LE_64(&op->packet[12]);
- this->si[stream_num]->granuleshift = (int)op->packet[28];
-}
-
-/*
- * interpret stream start packages, send headers
- */
-static void send_header (demux_ogg_t *this) {
-
- int stream_num = -1;
- int cur_serno;
- int done = 0;
- ogg_packet op;
- xine_event_t ui_event;
-
- lprintf ("detecting stream types...\n");
-
- this->ignore_keyframes = 0;
-
- while (!done) {
- if (!read_ogg_packet(this) || !this->og.header || !this->og.body) {
- return;
- }
- /* now we've got at least one new page */
-
- cur_serno = ogg_page_serialno (&this->og);
-
- if (ogg_page_bos(&this->og)) {
- lprintf ("beginning of stream\n");
- lprintf ("serial number %d\n", cur_serno);
-
- if( this->num_streams == MAX_STREAMS ) {
- xprintf (this->stream->xine, XINE_VERBOSITY_LOG, "demux_ogg: MAX_STREAMS exceeded, aborting.\n");
- this->status = DEMUX_FINISHED;
- return;
- }
- stream_num = new_stream_info(this, cur_serno);
-
- } else {
- stream_num = get_stream(this, cur_serno);
- if (stream_num == -1) {
- xprintf (this->stream->xine, XINE_VERBOSITY_LOG, "demux_ogg: stream with no beginning!\n");
- this->status = DEMUX_FINISHED;
- return;
- }
- }
-
- ogg_stream_pagein(&this->si[stream_num]->oss, &this->og);
-
- while (ogg_stream_packetout(&this->si[stream_num]->oss, &op) == 1) {
-
- if (!this->si[stream_num]->buf_types) {
-
- /* detect buftype */
- if (!strncmp (&op.packet[1], "vorbis", 6)) {
- decode_vorbis_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[0], "Speex", 5)) {
- decode_speex_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[1], "video", 5)) {
- decode_video_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[1], "audio", 5)) {
- decode_audio_header(this, stream_num, &op);
- } else if (op.bytes >= 142
- && !strncmp (&op.packet[1], "Direct Show Samples embedded in Ogg", 35) ) {
- decode_dshow_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[1], "text", 4)) {
- decode_text_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[1], "theora", 6)) {
- decode_theora_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[1], "FLAC", 4)) {
- decode_flac_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[0], "Annodex", 7)) {
- decode_annodex_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[0], "AnxData", 7)) {
- decode_anxdata_header(this, stream_num, &op);
- } else if (!strncmp (&op.packet[0], "CMML", 4)) {
- decode_cmml_header(this, stream_num, &op);
- } else {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "demux_ogg: unknown stream type (signature >%.8s<). hex dump of bos packet follows:\n",
- op.packet);
- if(this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG)
- xine_hexdump (op.packet, op.bytes);
-
- this->si[stream_num]->buf_types = BUF_CONTROL_NOP;
- }
- }
-
- /* send preview buffer */
- if (this->si[stream_num]->headers > 0 ||
- op.packet[0] == PACKET_TYPE_COMMENT) {
- if (this->si[stream_num]->hide_first_header)
- this->si[stream_num]->hide_first_header = 0;
- else {
- lprintf ("sending preview buffer of stream type %08x\n",
- this->si[stream_num]->buf_types);
-
- send_ogg_buf (this, &op, stream_num, BUF_FLAG_HEADER);
- this->si[stream_num]->headers --;
- }
- }
-
- /* are we finished ? */
- if (!ogg_page_bos(&this->og)) {
- int i;
- done = 1;
-
- for (i=0; i<this->num_streams; i++) {
- if (this->si[i]->headers > 0)
- done = 0;
-
- llprintf(DEBUG_PREVIEWS,
- "%d preview buffers left to send from stream %d\n",
- this->si[i]->headers, i);
- }
- }
- }
- }
-
- ui_event.type = XINE_EVENT_UI_CHANNELS_CHANGED;
- ui_event.data_length = 0;
- xine_event_send(this->stream, &ui_event);
-
- /*get the streamlength*/
- get_stream_length (this);
-
-}
-
-static int demux_ogg_send_chunk (demux_plugin_t *this_gen) {
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
-
- int stream_num;
- int cur_serno;
-
- ogg_packet op;
-
- ogg_handle_event(this);
-
- llprintf(DEBUG_PACKETS, "send package...\n");
-
- if (!read_ogg_packet(this)) {
- this->status = DEMUX_FINISHED;
- lprintf ("EOF\n");
- return this->status;
- }
-
- if (!this->og.header || !this->og.body) {
- this->status = DEMUX_FINISHED;
- lprintf ("EOF\n");
- return this->status;
- }
-
- /* now we've got one new page */
-
- cur_serno = ogg_page_serialno (&this->og);
- stream_num = get_stream(this, cur_serno);
- if (stream_num < 0) {
- lprintf ("error: unknown stream, serialnumber %d\n", cur_serno);
-
- if (!ogg_page_bos(&this->og)) {
- lprintf ("help, stream with no beginning!\n");
- }
- lprintf ("adding late stream with serial number %d (all content will be discarded)\n", cur_serno);
-
- if( this->num_streams == MAX_STREAMS ) {
- xprintf (this->stream->xine, XINE_VERBOSITY_LOG, "demux_ogg: MAX_STREAMS exceeded, aborting.\n");
- this->status = DEMUX_FINISHED;
- return this->status;
- }
- stream_num = new_stream_info(this, cur_serno);
- }
-
- ogg_stream_pagein(&this->si[stream_num]->oss, &this->og);
-
- if (ogg_page_bos(&this->og)) {
- lprintf ("beginning of stream: serial number %d - discard\n",
- ogg_page_serialno (&this->og));
- while (ogg_stream_packetout(&this->si[stream_num]->oss, &op) == 1) ;
- return this->status;
- }
-
- /*while keyframeseeking only process videostream*/
- if (!this->ignore_keyframes && this->keyframe_needed
- && ((this->si[stream_num]->buf_types & 0xFF000000) != BUF_VIDEO_BASE))
- return this->status;
-
- while (ogg_stream_packetout(&this->si[stream_num]->oss, &op) == 1) {
- /* printf("demux_ogg: packet: %.8s\n", op.packet); */
- /* printf("demux_ogg: got a packet\n"); */
-
- if ((*op.packet & PACKET_TYPE_HEADER) &&
- (this->si[stream_num]->buf_types!=BUF_VIDEO_THEORA) && (this->si[stream_num]->buf_types!=BUF_AUDIO_SPEEX) && (this->si[stream_num]->buf_types!=BUF_AUDIO_FLAC)) {
- if (op.granulepos != -1) {
- this->si[stream_num]->header_granulepos = op.granulepos;
- lprintf ("header with granulepos, remembering granulepos\n");
- } else {
- lprintf ("header => discard\n");
- }
- continue;
- }
-
- /*discard granulepos-less packets and to early audiopackets*/
- if (this->si[stream_num]->resync) {
- if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_SPU_BASE) {
- /*never drop subtitles*/
- this->si[stream_num]->resync=0;
- } else if ((op.granulepos == -1) && (this->si[stream_num]->header_granulepos == -1)) {
- continue;
- } else {
-
- /*dump too early packets*/
- if ((get_pts(this,stream_num,op.granulepos)-this->start_pts) > -90000)
- this->si[stream_num]->resync=0;
- else
- continue;
- }
- }
-
- if (!this->ignore_keyframes && this->keyframe_needed) {
- lprintf ("keyframe needed... buf_type=%08x\n", this->si[stream_num]->buf_types);
- if (this->si[stream_num]->buf_types == BUF_VIDEO_THEORA) {
-#ifdef HAVE_THEORA
-
- int keyframe_granule_shift;
- int64_t pframe=-1,iframe=-1;
-
- keyframe_granule_shift = this->si[stream_num]->granuleshift;
-
- if(op.granulepos>=0){
- iframe=op.granulepos>>keyframe_granule_shift;
- pframe=op.granulepos-(iframe<<keyframe_granule_shift);
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "seeking keyframe i %" PRId64 " p %" PRId64 "\n", iframe, pframe);
- if (pframe!=0)
- continue;
- } else
- continue;
- this->keyframe_needed = 0;
- this->start_pts=get_pts(this,stream_num,op.granulepos);
-#endif
- } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_VIDEO_BASE) {
-
- /*calculate the current pts*/
- if (op.granulepos!=-1) {
- this->start_pts=get_pts(this, stream_num, op.granulepos);
- } else if (this->start_pts!=-1)
- this->start_pts=this->start_pts+this->frame_duration;
-
- /*seek the keyframe*/
- if ((*op.packet == PACKET_IS_SYNCPOINT) && (this->start_pts!=-1))
- this->keyframe_needed = 0;
- else
- continue;
-
- } else if ((this->si[stream_num]->buf_types & 0xFF000000) == BUF_VIDEO_BASE) continue;
- }
- send_ogg_buf (this, &op, stream_num, 0);
-
- /*delete used header_granulepos*/
- if (op.granulepos == -1)
- this->si[stream_num]->header_granulepos = -1;
-
- }
- if (ogg_page_eos(&this->og)) {
- int i;
- int finished_streams = 0;
-
- lprintf("end of stream, serialnumber %d\n", cur_serno);
- this->si[stream_num]->delivered_eos = 1;
-
- /* check if all logical streams are finished */
- for (i = 0; i < this->num_streams; i++) {
- finished_streams += this->si[i]->delivered_eos;
- }
-
- /* if all streams are finished, perhaps a chained stream follows */
- if (finished_streams == this->num_streams) {
- /* delete current logical streams */
- for (i = 0; i < this->num_streams; i++) {
- ogg_stream_clear(&this->si[i]->oss);
- if (this->si[i]->language) {
- free (this->si[i]->language);
- }
- free (this->si[i]);
- }
- this->num_streams = 0;
- this->num_audio_streams = 0;
- this->num_video_streams = 0;
- this->unhandled_video_streams = 0;
- this->num_spu_streams = 0;
- this->avg_bitrate = 1;
-
- /* try to read a chained stream */
- this->send_newpts = 1;
- this->last_pts[0] = 0;
- this->last_pts[1] = 0;
-
- /* send control buffer to avoid buffer leak */
- _x_demux_control_end(this->stream, 0);
- _x_demux_control_start(this->stream);
- send_header(this);
- }
- }
-
- return this->status;
-}
-
-static void demux_ogg_dispose (demux_plugin_t *this_gen) {
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
- int i;
-
- for (i=0; i<this->num_streams; i++) {
- ogg_stream_clear(&this->si[i]->oss);
-
- if (this->si[i]->language) {
- free (this->si[i]->language);
- }
- free(this->si[i]);
- }
-
- ogg_sync_clear(&this->oy);
-
-#ifdef HAVE_THEORA
- theora_comment_clear (&this->t_comment);
- theora_info_clear (&this->t_info);
-#endif
-
- if (this->chapter_info){
- free (this->chapter_info->entries);
- free (this->chapter_info);
- }
- for (i = 0; i < XINE_STREAM_INFO_MAX; ++i)
- free (this->meta[i]);
-
- if (this->event_queue)
- xine_event_dispose_queue (this->event_queue);
-
- free (this);
-}
-
-static int demux_ogg_get_status (demux_plugin_t *this_gen) {
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
-
- return this->status;
-}
-
-static void demux_ogg_send_headers (demux_plugin_t *this_gen) {
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
-
- this->video_fifo = this->stream->video_fifo;
- this->audio_fifo = this->stream->audio_fifo;
-
- this->status = DEMUX_OK;
-
- /*
- * send start buffers
- */
-
- this->last_pts[0] = 0;
- this->last_pts[1] = 0;
-
- /*
- * initialize ogg engine
- */
- ogg_sync_init(&this->oy);
-
- this->num_streams = 0;
- this->num_audio_streams = 0;
- this->num_video_streams = 0;
- this->num_spu_streams = 0;
- this->avg_bitrate = 1;
-
- this->input->seek (this->input, 0, SEEK_SET);
-
- if (this->status == DEMUX_OK) {
- _x_demux_control_start(this->stream);
- send_header (this);
- lprintf ("headers sent, avg bitrate is %" PRId64 "\n", this->avg_bitrate);
- }
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO,
- this->num_video_streams > 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED,
- this->num_video_streams > this->unhandled_video_streams);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO,
- this->num_audio_streams > 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_MAX_SPU_CHANNEL,
- this->num_spu_streams);
-}
-
-static int demux_ogg_seek (demux_plugin_t *this_gen,
- off_t start_pos, int start_time, int playing) {
-
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
- int i;
- start_time /= 1000;
- start_pos = (off_t) ( (double) start_pos / 65535 *
- this->input->get_length (this->input) );
- /*
- * seek to start position
- */
-
- if (INPUT_IS_SEEKABLE(this->input)) {
-
- this->keyframe_needed = (this->num_video_streams>0);
-
- if ( (!start_pos) && (start_time)) {
- if (this->time_length != -1) {
- /*do the seek via time*/
- int current_time=-1;
- off_t current_pos;
- current_pos=this->input->get_current_pos(this->input);
-
- /*try to find out the current time*/
- if (this->last_pts[PTS_VIDEO]) {
- current_time=this->last_pts[PTS_VIDEO]/90000;
- } else if (this->last_pts[PTS_AUDIO]) {
- current_time=this->last_pts[PTS_AUDIO]/90000;
- }
-
- /*fixme, the file could grow, do something
- about this->time_length using get_lenght to verify, that the stream
- hasn` changed its length, otherwise no seek to "new" data is possible*/
-
- lprintf ("seek to time %d called\n",start_time);
- lprintf ("current time is %d\n",current_time);
-
- if (current_time > start_time) {
- /*seek between beginning and current_pos*/
-
- /*fixme - sometimes we seek backwards and during
- keyframeseeking, we undo the seek*/
-
- start_pos = start_time * current_pos
- / current_time ;
- } else {
- /*seek between current_pos and end*/
- start_pos = current_pos +
- ((start_time - current_time) *
- ( this->input->get_length(this->input) - current_pos ) /
- ( (this->time_length / 1000) - current_time)
- );
- }
-
- lprintf ("current_pos is %" PRId64 "\n",current_pos);
- lprintf ("new_pos is %" PRId64 "\n",start_pos);
-
- } else {
- /*seek using avg_bitrate*/
- start_pos = start_time * this->avg_bitrate/8;
- }
-
- lprintf ("seeking to %d seconds => %" PRId64 " bytes\n",
- start_time, start_pos);
-
- }
-
- ogg_sync_reset(&this->oy);
-
- for (i=0; i<this->num_streams; i++) {
- this->si[i]->header_granulepos = -1;
- ogg_stream_reset(&this->si[i]->oss);
- }
-
- /*some strange streams have no syncpoint flag set at the beginning*/
- if (start_pos == 0)
- this->keyframe_needed = 0;
-
- lprintf ("seek to %" PRId64 " called\n",start_pos);
-
- this->input->seek (this->input, start_pos, SEEK_SET);
-
- }
-
- /* fixme - this would be a nice position to do the following tasks
- 1. adjust an ogg videostream to a keyframe
- 2. compare the keyframe_pts with start_time. if the difference is to
- high (e.g. larger than max keyframe_intervall, do a new seek or
- continue reading
- 3. adjust the audiostreams in such a way, that the
- difference is not to high.
-
- In short words, do all the cleanups necessary to continue playback
- without further actions
- */
-
- this->send_newpts = 1;
- this->status = DEMUX_OK;
-
- if( !playing ) {
-
- this->buf_flag_seek = 0;
-
- } else {
- if (start_pos!=0) {
- this->buf_flag_seek = 1;
- /*each stream has to continue with a packet that has an
- granulepos*/
- for (i=0; i<this->num_streams; i++) {
- this->si[i]->resync = 1;
- }
-
- this->start_pts=-1;
- }
-
- _x_demux_flush_engine(this->stream);
- }
-
- return this->status;
-}
-
-static int demux_ogg_get_stream_length (demux_plugin_t *this_gen) {
-
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
-
- if (this->time_length==-1){
- if (this->avg_bitrate) {
- return (int)((int64_t)1000 * this->input->get_length (this->input) * 8 /
- this->avg_bitrate);
- } else {
- return 0;
- }
- } else {
- return this->time_length;
- }
-}
-
-static uint32_t demux_ogg_get_capabilities(demux_plugin_t *this_gen) {
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
- int cap_chapter = 0;
-
- if (this->chapter_info)
- cap_chapter = DEMUX_CAP_CHAPTERS;
-
- return DEMUX_CAP_SPULANG | DEMUX_CAP_AUDIOLANG | cap_chapter;
-}
-
-static int format_lang_string (demux_ogg_t * this, uint32_t buf_mask, uint32_t buf_type, int channel, char *str) {
- int stream_num;
-
- for (stream_num=0; stream_num<this->num_streams; stream_num++) {
- if ((this->si[stream_num]->buf_types & buf_mask) == buf_type) {
- if (this->si[stream_num]->language) {
- if (snprintf (str, XINE_LANG_MAX, "%s", this->si[stream_num]->language) >= XINE_LANG_MAX)
- /* the string got truncated */
- str[XINE_LANG_MAX - 2] = str[XINE_LANG_MAX - 3] = str[XINE_LANG_MAX - 4] = '.';
- /* TODO: provide long version in XINE_META_INFO_FULL_LANG */
- } else {
- snprintf(str, XINE_LANG_MAX, "channel %d",channel);
- }
- return DEMUX_OPTIONAL_SUCCESS;
- }
- }
- return DEMUX_OPTIONAL_UNSUPPORTED;
-}
-
-static int demux_ogg_get_optional_data(demux_plugin_t *this_gen,
- void *data, int data_type) {
-
- demux_ogg_t *this = (demux_ogg_t *) this_gen;
-
- char *str=(char *) data;
- int channel = *((int *)data);
-
- switch (data_type) {
- case DEMUX_OPTIONAL_DATA_SPULANG:
- lprintf ("DEMUX_OPTIONAL_DATA_SPULANG channel = %d\n",channel);
- if (channel==-1) {
- strcpy( str, "none");
- return DEMUX_OPTIONAL_SUCCESS;
- } else if ((channel>=0) && (channel<this->num_streams)) {
- return format_lang_string (this, 0xFFFFFFFF, BUF_SPU_OGM+channel, channel, str);
- }
- return DEMUX_OPTIONAL_UNSUPPORTED;
- case DEMUX_OPTIONAL_DATA_AUDIOLANG:
- lprintf ("DEMUX_OPTIONAL_DATA_AUDIOLANG channel = %d\n",channel);
- if (channel==-1) {
- return format_lang_string (this, 0xFF00001F, BUF_AUDIO_BASE, channel, str);
- } else if ((channel>=0) && (channel<this->num_streams)) {
- return format_lang_string (this, 0xFF00001F, BUF_AUDIO_BASE+channel, channel, str);
- }
- return DEMUX_OPTIONAL_UNSUPPORTED;
- default:
- return DEMUX_OPTIONAL_UNSUPPORTED;
- }
-}
-
-static int detect_ogg_content (int detection_method, demux_class_t *class_gen,
- input_plugin_t *input) {
-
- switch (detection_method) {
-
- case METHOD_BY_CONTENT: {
- uint8_t buf[4];
-
- if (_x_demux_read_header(input, buf, 4) != 4)
- return 0;
-
- return _x_is_fourcc(buf, "OggS");
- }
-
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (_x_demux_check_extension (mrl, extensions))
- return 1;
- else
- return 0;
- }
-
- case METHOD_EXPLICIT:
- return 1;
-
- default:
- return 0;
- }
-}
-
-static int detect_anx_content (int detection_method, demux_class_t *class_gen,
- input_plugin_t *input) {
-
- if (detect_ogg_content(detection_method, class_gen, input) == 0)
- return 0;
-
- switch (detection_method) {
-
-#define ANNODEX_SIGNATURE_SEARCH 128
-
- case METHOD_BY_CONTENT: {
- uint8_t buf[ANNODEX_SIGNATURE_SEARCH];
- int found_annodex_signature = 0;
- const char *annodex_signature = "Annodex";
- int annodex_signature_length = 7; /* = strlen(annodex_signature) */
- int i, j;
-
- if (_x_demux_read_header(input, buf, ANNODEX_SIGNATURE_SEARCH) !=
- ANNODEX_SIGNATURE_SEARCH)
- return 0;
-
- /* scan for 'Annodex' signature in the first 64 bytes */
- for (i = 0, j = 0; i < ANNODEX_SIGNATURE_SEARCH; i++) {
- if (buf[i] == annodex_signature[j]) {
- if (j >= annodex_signature_length) {
- /* found signature */
- found_annodex_signature = 1;
- break;
- } else {
- j++;
- }
- }
- }
-
- if (found_annodex_signature)
- return 1;
- else
- return 0;
- }
-
-#undef ANNODEX_SIGNATURE_SEARCH
-
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (_x_demux_check_extension (mrl, extensions))
- return 1;
- else
- return 0;
- }
-
- case METHOD_EXPLICIT:
- return 1;
-
- default:
- return 0;
- }
-}
-
-static demux_plugin_t *anx_open_plugin (demux_class_t *class_gen,
- xine_stream_t *stream,
- input_plugin_t *input) {
-
- demux_ogg_t *this;
- int i;
-
- if (detect_anx_content(stream->content_detection_method, class_gen, input) == 0)
- return NULL;
-
- /*
- * if we reach this point, the input has been accepted.
- */
-
- this = calloc(1, sizeof(demux_ogg_t));
- this->stream = stream;
- this->input = input;
-
- /* the Annodex demuxer currently calls into exactly the same functions as
- * the Ogg demuxer, which seems to make this function a bit redundant, but
- * this design leaves us a bit more room to change an Annodex demuxer's
- * behaviour in the future if necessary */
- this->demux_plugin.send_headers = demux_ogg_send_headers;
- this->demux_plugin.send_chunk = demux_ogg_send_chunk;
- this->demux_plugin.seek = demux_ogg_seek;
- this->demux_plugin.dispose = demux_ogg_dispose;
- this->demux_plugin.get_status = demux_ogg_get_status;
- this->demux_plugin.get_stream_length = demux_ogg_get_stream_length;
- this->demux_plugin.get_capabilities = demux_ogg_get_capabilities;
- this->demux_plugin.get_optional_data = demux_ogg_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->status = DEMUX_FINISHED;
-
-#ifdef HAVE_THEORA
- theora_info_init (&this->t_info);
- theora_comment_init (&this->t_comment);
-#endif
-
- for (i = 0; i < XINE_STREAM_INFO_MAX; ++i)
- this->meta[i] = NULL;
- this->chapter_info = 0;
- this->event_queue = xine_event_new_queue (this->stream);
-
- return &this->demux_plugin;
-}
-
-static demux_plugin_t *ogg_open_plugin (demux_class_t *class_gen,
- xine_stream_t *stream,
- input_plugin_t *input) {
-
- demux_ogg_t *this;
- int i;
-
- if (detect_ogg_content(stream->content_detection_method, class_gen, input) == 0)
- return NULL;
-
- /*
- * if we reach this point, the input has been accepted.
- */
-
- this = calloc(1, sizeof(demux_ogg_t));
- this->stream = stream;
- this->input = input;
-
- this->demux_plugin.send_headers = demux_ogg_send_headers;
- this->demux_plugin.send_chunk = demux_ogg_send_chunk;
- this->demux_plugin.seek = demux_ogg_seek;
- this->demux_plugin.dispose = demux_ogg_dispose;
- this->demux_plugin.get_status = demux_ogg_get_status;
- this->demux_plugin.get_stream_length = demux_ogg_get_stream_length;
- this->demux_plugin.get_capabilities = demux_ogg_get_capabilities;
- this->demux_plugin.get_optional_data = demux_ogg_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->status = DEMUX_FINISHED;
-
-#ifdef HAVE_THEORA
- theora_info_init (&this->t_info);
- theora_comment_init (&this->t_comment);
-#endif
-
- this->chapter_info = 0;
- for (i = 0; i < XINE_STREAM_INFO_MAX; ++i)
- this->meta[i] = NULL;
- this->event_queue = xine_event_new_queue (this->stream);
-
- return &this->demux_plugin;
-}
-
-/*
- * Annodex demuxer class
- */
-
-static const char *anx_get_description (demux_class_t *this_gen) {
- return "Annodex demux plugin";
-}
-
-static const char *anx_get_identifier (demux_class_t *this_gen) {
- return "Annodex";
-}
-
-static const char *anx_get_extensions (demux_class_t *this_gen) {
- return "anx axa axv";
-}
-
-static const char *anx_get_mimetypes (demux_class_t *this_gen) {
- return "application/annodex: anx: Annodex media;"
- "application/x-annodex: anx: Annodex media;"
- "audio/annodex: axa: Annodex audio;"
- "audio/x-annodex: axa: Annodex audio;"
- "video/annodex: axv: Annodex video;"
- "video/x-annodex: axv: Annodex video;";
-}
-
-static void anx_class_dispose (demux_class_t *this_gen) {
- demux_anx_class_t *this = (demux_anx_class_t *) this_gen;
-
- free (this);
-}
-
-static void *anx_init_class (xine_t *xine, void *data) {
- demux_anx_class_t *this;
-
- this = calloc(1, sizeof(demux_anx_class_t));
-
- this->demux_class.open_plugin = anx_open_plugin;
- this->demux_class.get_description = anx_get_description;
- this->demux_class.get_identifier = anx_get_identifier;
- this->demux_class.get_mimetypes = anx_get_mimetypes;
- this->demux_class.get_extensions = anx_get_extensions;
- this->demux_class.dispose = anx_class_dispose;
-
- return this;
-}
-
-/*
- * ogg demuxer class
- */
-
-static const char *ogg_get_description (demux_class_t *this_gen) {
- return "OGG demux plugin";
-}
-
-static const char *ogg_get_identifier (demux_class_t *this_gen) {
- return "OGG";
-}
-
-static const char *ogg_get_extensions (demux_class_t *this_gen) {
- return "ogx ogv oga ogg spx ogm";
-}
-
-static const char *ogg_get_mimetypes (demux_class_t *this_gen) {
- return "application/ogg: ogx: Ogg Stream;"
- "application/x-ogg: ogx: Ogg Stream;"
- "application/x-ogm: ogx: Ogg Stream;"
- "application/x-ogm-audio: oga: Ogg Audio;"
- "application/x-ogm-video: ogv: Ogg Video;"
- "audio/ogg: oga: Ogg Audio;"
- "audio/x-ogg: oga: Ogg Audio;"
- "video/ogg: ogv: Ogg Video;"
- "video/x-ogg: ogv: Ogg Video;";
-}
-
-static void ogg_class_dispose (demux_class_t *this_gen) {
- demux_ogg_class_t *this = (demux_ogg_class_t *) this_gen;
-
- free (this);
-}
-
-static void *ogg_init_class (xine_t *xine, void *data) {
- demux_ogg_class_t *this;
-
- this = calloc(1, sizeof(demux_ogg_class_t));
-
- this->demux_class.open_plugin = ogg_open_plugin;
- this->demux_class.get_description = ogg_get_description;
- this->demux_class.get_identifier = ogg_get_identifier;
- this->demux_class.get_mimetypes = ogg_get_mimetypes;
- this->demux_class.get_extensions = ogg_get_extensions;
- this->demux_class.dispose = ogg_class_dispose;
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-static const demuxer_info_t demux_info_anx = {
- 20 /* priority */
-};
-
-static const demuxer_info_t demux_info_ogg = {
- 10 /* priority */
-};
-
-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 },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/demuxers/demux_playlist.c b/src/demuxers/demux_playlist.c
new file mode 100644
index 000000000..5fa62b606
--- /dev/null
+++ b/src/demuxers/demux_playlist.c
@@ -0,0 +1,722 @@
+/*
+ * 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
+ *
+ *
+ * Playlist parser/demuxer by
+ * Claudio Ciccani (klan@users.sourceforge.net)
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+
+#define LOG_MODULE "demux_playlist"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+#include <xine/demux.h>
+
+typedef enum {
+ XINE_PLT_NONE = 0,
+ XINE_PLT_REF = ME_FOURCC('R','E','F',0),
+ XINE_PLT_M3U = ME_FOURCC('M','3','U',0),
+ XINE_PLT_RAM = ME_FOURCC('R','A','M',0),
+ XINE_PLT_PLS = ME_FOURCC('P','L','S',0),
+ XINE_PLT_ASX = ME_FOURCC('A','S','X',0),
+ XINE_PLT_SMI = ME_FOURCC('S','M','I',0),
+ XINE_PLT_QTL = ME_FOURCC('Q','T','L',0),
+ XINE_PLT_XSPF = ME_FOURCC('X','S','P',0),
+ XINE_PLT_RSS = ME_FOURCC('R','S','S',0)
+} playlist_t;
+
+typedef struct {
+ demux_plugin_t demux_plugin;
+
+ xine_t *xine;
+ xine_stream_t *stream;
+ input_plugin_t *input;
+
+ playlist_t playlist;
+
+ int status;
+} demux_playlist_t;
+
+typedef struct {
+ demux_class_t demux_class;
+} demux_playlist_class_t;
+
+
+static playlist_t detect_by_extension (input_plugin_t *input) {
+ char *ext;
+
+ ext = strrchr (input->get_mrl (input), '.');
+ if (!ext)
+ return XINE_PLT_NONE;
+
+ if (!strcasecmp (ext, ".m3u"))
+ return XINE_PLT_M3U;
+ if (!strcasecmp (ext, ".ram"))
+ return XINE_PLT_RAM;
+ if (!strcasecmp (ext, ".pls"))
+ return XINE_PLT_PLS;
+ if (!strcasecmp (ext, ".wax") ||
+ !strcasecmp (ext, ".wvx") ||
+ !strcasecmp (ext, ".asx"))
+ return XINE_PLT_ASX;
+ if (!strcasecmp (ext, ".smi") ||
+ !strcasecmp (ext, ".smil"))
+ return XINE_PLT_SMI;
+ if (!strcasecmp (ext, ".qtl"))
+ return XINE_PLT_QTL;
+ if (!strcasecmp (ext, ".xspf"))
+ return XINE_PLT_XSPF;
+ if (!strcasecmp (ext, ".rss"))
+ return XINE_PLT_RSS;
+
+ return XINE_PLT_NONE;
+}
+
+static playlist_t detect_by_content (input_plugin_t *input) {
+ char buf[256], *tmp;
+ int len;
+
+ len = _x_demux_read_header (input, buf, sizeof(buf)-1);
+ if (len <= 0)
+ return XINE_PLT_NONE;
+ buf[len] = '\0';
+
+ tmp = buf;
+ while (*tmp && isspace(*tmp))
+ tmp++;
+
+ if (!strncmp (tmp, "[Reference]", 11) ||
+ !strncmp (tmp, "Ref1=", 5))
+ return XINE_PLT_REF;
+ if (!strncmp (tmp, "#EXTM3U", 7))
+ return XINE_PLT_M3U;
+ if (!strncmp (tmp, "file://", 7) ||
+ !strncmp (tmp, "http://", 7) ||
+ !strncmp (tmp, "rtsp://", 7) ||
+ !strncmp (tmp, "pnm://", 6))
+ return XINE_PLT_RAM;
+ if (!strncmp (tmp, "[Playlist]", 10 ))
+ return XINE_PLT_PLS;
+ if (!strncasecmp (tmp, "<ASX", 4))
+ return XINE_PLT_ASX;
+ if (!strncmp (tmp, "<smil", 5))
+ return XINE_PLT_SMI;
+ if (!strncmp (tmp, "<?quicktime", 11))
+ return XINE_PLT_QTL;
+ if (!strncmp (tmp, "<playlist", 9))
+ return XINE_PLT_XSPF;
+ if (!strncmp (tmp, "<rss", 4))
+ return XINE_PLT_RSS;
+
+ if (!strncmp (tmp, "<?xml", 5)) {
+ tmp += 5;
+ while ((tmp = strchr (tmp, '<'))) {
+ if (!strncasecmp (tmp, "<ASX", 4))
+ return XINE_PLT_ASX;
+ if (!strncmp (tmp, "<smil", 5))
+ return XINE_PLT_SMI;
+ if (!strncmp (tmp, "<?quicktime", 11))
+ return XINE_PLT_QTL;
+ if (!strncmp (tmp, "<playlist", 9))
+ return XINE_PLT_XSPF;
+ if (!strncmp (tmp, "<rss", 4))
+ return XINE_PLT_RSS;
+ tmp++;
+ }
+ }
+
+ return XINE_PLT_NONE;
+}
+
+static char* trim (char *s) {
+ char *e;
+
+ while (*s && isspace(*s))
+ s++;
+
+ e = s + strlen(s) - 1;
+ while (e > s && isspace(*e))
+ *e-- = '\0';
+
+ return s;
+}
+
+static int parse_time (const char *s) {
+ int t = 0;
+ int i;
+
+ if (!s)
+ return 0;
+
+ if (!strncmp (s, "npt=", 4))
+ s += 4;
+ else if (!strncmp (s, "smpte=", 6))
+ s += 6;
+
+ for (i = 0; i < 3; i++) {
+ t *= 60;
+ t += atoi(s);
+ s = strchr (s, ':');
+ if (!s)
+ break;
+ s++;
+ }
+
+ return t*1000;
+}
+
+static void parse_ref (demux_playlist_t *this, char *data, int length) {
+ char *src = data;
+ char *end;
+ int alt = 0;
+
+ while (src && *src) {
+ end = strchr (src, '\n');
+ if (end)
+ *end = '\0';
+
+ src = trim (src);
+ if (!strncmp (src, "Ref", 3)) {
+ src = strchr (src, '=');
+ if (src && *(src+1)) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, alt++, src+1, NULL, 0, 0);
+ }
+ }
+
+ src = end;
+ if (src)
+ src++;
+ }
+}
+
+static void parse_m3u (demux_playlist_t *this, char *data, int length) {
+ char *src = data;
+ char *end;
+ char *title = NULL;
+
+ while (src && *src) {
+ end = strchr (src, '\n');
+ if (end)
+ *end = '\0';
+
+ src = trim (src);
+ if (*src == '#') {
+ if (!strncmp (src+1, "EXTINF:", 7)) {
+ title = strchr (src+8, ',');
+ if (title)
+ title++;
+ }
+ }
+ else if (*src) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0);
+ }
+
+ src = end;
+ if (src)
+ src++;
+ }
+}
+
+static void parse_ram (demux_playlist_t *this, char *data, int length) {
+ char *src = data;
+ char *end;
+
+ while (src && *src) {
+ end = strchr (src, '\n');
+ if (end)
+ *end = '\0';
+
+ src = trim (src);
+ if (!strcmp (src, "--stop--"))
+ break;
+
+ if (*src && *src != '#') {
+ char *title = NULL;
+
+ if (!strncmp (src, "rtsp://", 7) || !strncmp (src, "pnm://", 7)) {
+ char *tmp = strrchr (src, '?');
+ if (tmp) {
+ *tmp = '\0';
+ title = strstr (tmp+1, "title=");
+ if (title) {
+ title += 6;
+ tmp = strchr (title, '&');
+ if (tmp)
+ *tmp = '\0';
+ }
+ }
+ }
+
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0);
+ }
+
+ src = end;
+ if (src)
+ src++;
+ }
+}
+
+static void parse_pls (demux_playlist_t *this, char *data, int length) {
+ char *src = data;
+ char *end;
+
+ while (src && *src) {
+ end = strchr (src, '\n');
+ if (end)
+ *end = '\0';
+
+ src = trim (src);
+ if (!strncmp (src, "File", 4)) {
+ src = strchr (src+4, '=');
+ if (src && *(src+1)) {
+ lprintf ("mrl:'%s'\n", src+1);
+ _x_demux_send_mrl_reference (this->stream, 0, src+1, NULL, 0, 0);
+ }
+ }
+
+ src = end;
+ if (src)
+ src++;
+ }
+}
+
+static void parse_asx (demux_playlist_t *this, char *data, int length) {
+ xml_node_t *root, *node, *tmp;
+ int is_asx = 0;
+
+ xml_parser_init (data, length, XML_PARSER_CASE_INSENSITIVE);
+
+ if (xml_parser_build_tree (&root) >= 0) {
+ if (!strcasecmp (root->name, "asx")) {
+ is_asx = 1;
+
+ for (node = root->child; node; node = node->next) {
+ if (!strcasecmp (node->name, "entry")) {
+ const char *title = NULL;
+ const char *src = NULL;
+ const char *start = NULL;
+ const char *duration = NULL;
+
+ for (tmp = node->child; tmp; tmp = tmp->next) {
+ if (!strcasecmp (tmp->name, "title")) {
+ title = tmp->data;
+ }
+ else if (!strcasecmp (tmp->name, "ref")) {
+ src = xml_parser_get_property (tmp, "href");
+ }
+ else if (!strcasecmp (tmp->name, "starttime")) {
+ start = xml_parser_get_property (tmp, "value");
+ }
+ else if (!strcasecmp (tmp->name, "duration")) {
+ duration = xml_parser_get_property (tmp, "value");
+ }
+ }
+
+ if (src) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, title,
+ parse_time(start), parse_time(duration));
+ }
+ }
+ }
+ }
+
+ xml_parser_free_tree (root);
+ }
+
+ if (!is_asx) {
+ /* No tags found? Might be a references list. */
+ parse_ref (this, data, length);
+ }
+}
+
+static void parse_smi (demux_playlist_t *this, char *data, int length) {
+ xml_node_t *root, *node, *tmp;
+ int is_smi = 0;
+
+ xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE);
+
+ if (xml_parser_build_tree (&root) >= 0) {
+ for (node = root; node; node = node->next) {
+ if (!strcmp (node->name, "smil"))
+ break;
+ }
+
+ if (node) {
+ is_smi = 1;
+
+ for (node = node->child; node; node = node->next) {
+ if (!strcmp (node->name, "body")) {
+ for (tmp = node->child; tmp; tmp = tmp->next) {
+ if (!strcmp (tmp->name, "audio") || !strcmp (tmp->name, "video")) {
+ const char *src, *title;
+ int start, end;
+
+ src = xml_parser_get_property (tmp, "src");
+ title = xml_parser_get_property (tmp, "title");
+ start = parse_time (xml_parser_get_property (tmp, "clipBegin") ? :
+ xml_parser_get_property (tmp, "clip-begin"));
+ end = parse_time (xml_parser_get_property (tmp, "clipEnd") ? :
+ xml_parser_get_property (tmp, "clip-end"));
+
+ if (src) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, title,
+ start, end ? (end-start) : 0);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ xml_parser_free_tree (root);
+ }
+
+ if (!is_smi) {
+ /* No tags found? Might be a RAM playlist. */
+ parse_ram (this, data, length);
+ }
+}
+
+static void parse_qtl (demux_playlist_t *this, char *data, int length) {
+ xml_node_t *root, *node;
+
+ xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE);
+
+ if (xml_parser_build_tree (&root) >= 0) {
+ for (node = root; node; node = node->next) {
+ if (!strcmp (node->name, "embed")) {
+ const char *src;
+
+ src = xml_parser_get_property (node, "src");
+ if (src) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, NULL, 0, 0);
+ }
+ }
+ }
+
+ xml_parser_free_tree (root);
+ }
+}
+
+static void parse_xspf (demux_playlist_t *this, char *data, int length) {
+ xml_node_t *root, *node, *tmp;
+
+ xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE);
+
+ if (xml_parser_build_tree (&root) >= 0) {
+ for (node = root; node; node = node->next) {
+ if (!strcmp (node->name, "playlist"))
+ break;
+ }
+ if (node) {
+ for (node = node->child; node; node = node->next) {
+ if (!strcmp (node->name, "trackList"))
+ break;
+ }
+ }
+ if (node) {
+ for (node = node->child; node; node = node->next) {
+ if (!strcmp (node->name, "track")) {
+ char *src = NULL;
+ char *title = NULL;
+
+ for (tmp = node->child; tmp; tmp = tmp->next) {
+ if (!strcmp (tmp->name, "location")) {
+ src = trim((char*)tmp->data);
+ }
+ else if (!strcmp (tmp->name, "title")) {
+ title = trim((char*)tmp->data);
+ }
+ }
+
+ if (src) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0);
+ }
+ }
+ }
+ }
+
+ xml_parser_free_tree (root);
+ }
+}
+
+static void parse_rss (demux_playlist_t *this, char *data, int length) {
+ xml_node_t *root, *node, *item, *tmp;
+
+ xml_parser_init (data, length, XML_PARSER_CASE_SENSITIVE);
+
+ if (xml_parser_build_tree (&root) >= 0) {
+ for (node = root; node; node = node->next) {
+ if (!strcmp (node->name, "rss"))
+ break;
+ }
+
+ if (node) {
+ for (node = node->child; node; node = node->next) {
+ if (strcmp (node->name, "channel"))
+ continue;
+
+ for (item = node->child; item; item = item->next) {
+ if (!strcmp (item->name, "item")) {
+ const char *title = NULL;
+ const char *src = NULL;
+
+ for (tmp = item->child; tmp; tmp = tmp->next) {
+ if (!strcmp (tmp->name, "title")) {
+ title = tmp->data;
+ }
+ else if (!strcmp (tmp->name, "enclosure")) {
+ src = xml_parser_get_property (tmp, "url");
+ }
+ }
+
+ if (src) {
+ lprintf ("mrl:'%s'\n", src);
+ _x_demux_send_mrl_reference (this->stream, 0, src, title, 0, 0);
+ }
+ }
+ }
+ }
+ }
+
+ xml_parser_free_tree (root);
+ }
+}
+
+
+static void demux_playlist_send_headers (demux_plugin_t *this_gen) {
+ demux_playlist_t *this = (demux_playlist_t *) this_gen;
+
+ this->status = DEMUX_OK;
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 0);
+
+ _x_demux_control_start (this->stream);
+
+ this->input->seek (this->input, 0, SEEK_SET);
+}
+
+
+static int demux_playlist_send_chunk (demux_plugin_t *this_gen) {
+ demux_playlist_t *this = (demux_playlist_t *) this_gen;
+ char *data = NULL;
+ int length;
+
+ length = this->input->get_length (this->input);
+ if (length > 0) {
+ data = xine_xmalloc (length+1);
+ if (data)
+ this->input->read (this->input, data, length);
+ }
+ else {
+ char buf[1024];
+ int len;
+
+ length = 0;
+ while ((len = this->input->read (this->input, buf, sizeof(buf))) > 0) {
+ data = realloc (data, length+len+1);
+ if (!data)
+ break;
+
+ memcpy (data+length, buf, len);
+ length += len;
+ data[length] = '\0';
+ }
+ }
+
+ lprintf ("data:%p length:%d\n", data, length);
+
+ if (data) {
+ switch (this->playlist) {
+ case XINE_PLT_REF:
+ parse_ref (this, data, length);
+ break;
+ case XINE_PLT_M3U:
+ parse_m3u (this, data, length);
+ break;
+ case XINE_PLT_RAM:
+ parse_ram (this, data, length);
+ break;
+ case XINE_PLT_PLS:
+ parse_pls (this, data, length);
+ break;
+ case XINE_PLT_ASX:
+ parse_asx (this, data, length);
+ break;
+ case XINE_PLT_SMI:
+ parse_smi (this, data, length);
+ break;
+ case XINE_PLT_QTL:
+ parse_qtl (this, data, length);
+ break;
+ case XINE_PLT_XSPF:
+ parse_xspf (this, data, length);
+ break;
+ case XINE_PLT_RSS:
+ parse_rss (this, data, length);
+ break;
+ default:
+ lprintf ("unexpected playlist type 0x%08x\n", this->playlist);
+ break;
+ }
+
+ free (data);
+ }
+
+ this->status = DEMUX_FINISHED;
+
+ return DEMUX_FINISHED;
+}
+
+static int demux_playlist_seek (demux_plugin_t *this_gen,
+ off_t start_pos, int start_time, int playing) {
+ return DEMUX_OK;
+}
+
+static int demux_playlist_get_status (demux_plugin_t *this_gen) {
+ demux_playlist_t *this = (demux_playlist_t *) this_gen;
+
+ return this->status;
+}
+
+static int demux_playlist_get_stream_length (demux_plugin_t *this_gen) {
+ return 0;
+}
+
+static uint32_t demux_playlist_get_capabilities (demux_plugin_t *this_gen) {
+ return DEMUX_CAP_NOCAP;
+}
+
+static int demux_playlist_get_optional_data (demux_plugin_t *this_gen,
+ void *data, int data_type) {
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+}
+
+
+static demux_plugin_t *open_plugin (demux_class_t *class_gen,
+ xine_stream_t *stream, input_plugin_t *input) {
+ demux_playlist_t *this;
+
+ this = xine_xmalloc (sizeof (demux_playlist_t));
+ this->xine = stream->xine;
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_playlist_send_headers;
+ this->demux_plugin.send_chunk = demux_playlist_send_chunk;
+ this->demux_plugin.seek = demux_playlist_seek;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
+ this->demux_plugin.get_status = demux_playlist_get_status;
+ this->demux_plugin.get_stream_length = demux_playlist_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_playlist_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_playlist_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ switch (stream->content_detection_method) {
+ case METHOD_BY_MRL:
+ lprintf ("detect by extension\n");
+ this->playlist = detect_by_extension (input);
+ if (!this->playlist) {
+ free (this);
+ return NULL;
+ }
+ break;
+
+ case METHOD_BY_CONTENT:
+ case METHOD_EXPLICIT:
+ lprintf ("detect by content\n");
+ this->playlist = detect_by_content (input);
+ if (!this->playlist) {
+ free (this);
+ return NULL;
+ }
+ break;
+
+ default:
+ free (this);
+ return NULL;
+ }
+
+ lprintf ("playlist:0x%08x (%s)\n", this->playlist, (char*)&this->playlist);
+
+ return &this->demux_plugin;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+ demux_playlist_class_t *this;
+
+ this = xine_xmalloc (sizeof(demux_playlist_class_t));
+
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("Playlist demux plugin");
+ this->demux_class.identifier = "playlist";
+ this->demux_class.mimetypes =
+ "audio/mpegurl: m3u: M3U playlist;"
+ "audio/x-mpegurl: m3u: M3U playlist;"
+ //"audio/x-pn-realaudio: ram: RAM playlist;"
+ //"audio/vnd.rn-realaudio: ram: RAM playlist;"
+ "audio/x-scpls: pls: Winamp playlist;"
+ "audio/x-ms-wax: wax, asx: WAX playlist;"
+ "audio/x-ms-wvx: wvx, asx: WVX playlist;"
+ "application/smil: smi, smil: SMIL playlist;"
+ "application/x-quicktimeplayer: qtl: Quicktime playlist;"
+ "application/xspf+xml: xspf: XSPF playlist;";
+ this->demux_class.extensions = "m3u ram pls asx wax wvx smi smil qtl xspf rss";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+static const demuxer_info_t demux_info_flv = {
+ 10 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_DEMUX, 27, "playlist", XINE_VERSION_CODE, &demux_info_flv, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c
index e2b61dcf0..532a11fdc 100644
--- a/src/demuxers/demux_pva.c
+++ b/src/demuxers/demux_pva.c
@@ -39,10 +39,10 @@
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#define PVA_PREAMBLE_SIZE 8
@@ -396,11 +396,6 @@ static int demux_pva_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_pva_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_pva_get_status (demux_plugin_t *this_gen) {
demux_pva_t *this = (demux_pva_t *) this_gen;
@@ -437,7 +432,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_pva_send_headers;
this->demux_plugin.send_chunk = demux_pva_send_chunk;
this->demux_plugin.seek = demux_pva_seek;
- this->demux_plugin.dispose = demux_pva_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_pva_get_status;
this->demux_plugin.get_stream_length = demux_pva_get_stream_length;
this->demux_plugin.get_capabilities = demux_pva_get_capabilities;
@@ -448,19 +443,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -478,39 +461,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "TechnoTrend PVA demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "TechnoTrend PVA";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "pva";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_pva_class_t *this = (demux_pva_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_pva_class_t *this;
this = calloc(1, sizeof(demux_pva_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("TechnoTrend PVA demux plugin");
+ this->demux_class.identifier = "TechnoTrend PVA";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "pva";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -524,6 +485,6 @@ static const demuxer_info_t demux_info_pva = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "pva", XINE_VERSION_CODE, &demux_info_pva, init_plugin },
+ { PLUGIN_DEMUX, 27, "pva", XINE_VERSION_CODE, &demux_info_pva, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index d0fa3fd77..85f802a53 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -43,10 +43,10 @@
#include <ctype.h>
#include <zlib.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "qtpalette.h"
@@ -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,7 +138,9 @@ typedef unsigned int qt_atom;
#define MAX_PTS_DIFF 100000
-/* network bandwidth, cribbed from src/input/input_mms.c */
+/**
+ * @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};
@@ -187,7 +191,7 @@ typedef struct {
} time_to_sample_table_t;
typedef struct {
- unsigned char *url;
+ char *url;
int64_t data_rate;
int qtim_version;
} reference_t;
@@ -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
@@ -644,8 +654,7 @@ static void free_qt_info(qt_info *info) {
for (j = 0; j < info->traks[i].stsd_atoms_count; j++) {
if (info->traks[i].type == MEDIA_AUDIO) {
free(info->traks[i].stsd_atoms[j].audio.properties_atom);
- if (info->traks[i].stsd_atoms[j].audio.wave)
- free(info->traks[i].stsd_atoms[j].audio.wave);
+ free(info->traks[i].stsd_atoms[j].audio.wave);
} else if (info->traks[i].type == MEDIA_VIDEO)
free(info->traks[i].stsd_atoms[j].video.properties_atom);
}
@@ -673,151 +682,42 @@ static void free_qt_info(qt_info *info) {
}
}
-static char *qtl_file_url (input_plugin_t *input, const unsigned char *preview, int len)
-{
- char *url = NULL;
-
- if (len < 64)
- return NULL;
-
- /* skip BOM, if present */
- if (preview[0] == 0xEF && preview[1] == 0xBB && preview[2] == 0xBF)
- {
- preview += 3;
- len -= 3;
- }
-
- xml_node_t *tree = NULL;
- xml_parser_t *xml = xml_parser_init_r (preview, len, XML_PARSER_CASE_INSENSITIVE);
- if (xml_parser_build_tree_r (xml, &tree) < 0)
- return NULL;
-
- xml_node_t *node = tree;
- while (node && strcasecmp (node->name, "embed"))
- node = node->next;
-
- if (!node)
- goto not_qtl;
-
- url = (char *) xml_parser_get_property (node, "src");
- if (url) {
- char *slash = strchr (url, '/');
- char *proto = strstr (url, "://");
- if (proto + 1 == slash)
- /* absolute */
- url = strdup (url);
- else
- { /* relative */
- const char *dir = input->get_mrl (input);
- slash = strrchr (dir, '/');
- if (asprintf (&url, "%.*s/%s",
- slash ? (int)(slash - dir) : 1,
- slash ? dir : ".", url) < 0) {
- url = NULL;
- }
- }
- }
-
-not_qtl:
- xml_parser_free_tree (tree);
- xml_parser_finalize_r (xml);
- return url;
-}
+/* returns 1 if the file is determined to be a QT file, 0 otherwise */
+static int is_qt_file(input_plugin_t *qt_file) {
-/* Simple approach for parsing qtl files. */
-static int demux_qt_parse_references (demux_qt_t *this, int send)
-{
- char *buf = NULL;
- int buf_size = 0;
- int buf_used = 0;
- int len = 0;
-
- off_t pos = this->input->get_current_pos (this->input);
- this->input->seek (this->input, 0, SEEK_SET);
-
- /* Read in a chunk from the file.
- * Hopefully fine since the reference file is small...
- */
- do {
- buf_size += 1024;
- buf = realloc(buf, buf_size+1);
-
- len = this->input->read (this->input, &buf[buf_used], buf_size - buf_used);
-
- if (len > 0)
- buf_used += len;
-
- /* 50K of reference file? Something must be wrong */
- if (buf_used > 50*1024)
- break;
- } while (len > 0);
-
- this->input->seek (this->input, pos, SEEK_SET);
-
- char *url = qtl_file_url (this->input, buf, buf_used);
- if (url && send)
- _x_demux_send_mrl_reference (this->stream, 0, url, NULL, 0, 0);
- free (url);
- free (buf);
-
- return !!url;
-}
-
-/* returns 1 if the file is determined to be a QT file,
- * 2 if it is a QTL file,
- * 0 otherwise
- */
-static int id_qt_file(demux_qt_t *this) {
-
- input_plugin_t *const qt_file = this->input;
off_t moov_atom_offset = -1;
int64_t moov_atom_size = -1;
int i;
- unsigned char atom_preamble[ATOM_PREAMBLE_SIZE];
- unsigned char preview[MAX_PREVIEW_SIZE];
int len;
/* if the input is non-seekable, be much more stringent about qualifying
* a QT file: In this case, the moov must be the first atom in the file */
if ((qt_file->get_capabilities(qt_file) & INPUT_CAP_SEEKABLE) == 0) {
- memset (&preview, 0, MAX_PREVIEW_SIZE);
+ unsigned char preview[MAX_PREVIEW_SIZE] = { 0, };
len = qt_file->get_optional_data(qt_file, preview, INPUT_OPTIONAL_DATA_PREVIEW);
-
- char *url = qtl_file_url (qt_file, preview, len);
- if (url) {
- free (url);
- return 2;
- }
-
if (_X_BE_32(&preview[4]) == MOOV_ATOM)
return 1;
else {
- if (_X_BE_32(&preview[4]) == FTYP_ATOM) {
- /* show some lenience if the first atom is 'ftyp'; the second atom
- * could be 'moov' */
- moov_atom_size = _X_BE_32(&preview[0]);
- /* compute the size of the current atom plus the preamble of the
- * next atom; if the size is within the range on the preview buffer
- * then the next atom's preamble is in the preview buffer */
- i = moov_atom_size + ATOM_PREAMBLE_SIZE;
- if (i >= MAX_PREVIEW_SIZE)
- return 0;
- if (_X_BE_32(&preview[i - 4]) == MOOV_ATOM)
- return 1;
- else
- return 0;
- } else
- return 0;
+ if (_X_BE_32(&preview[4]) != FTYP_ATOM)
+ return 0;
+
+ /* show some lenience if the first atom is 'ftyp'; the second atom
+ * could be 'moov'
+ * compute the size of the current atom plus the preamble of the
+ * next atom; if the size is within the range on the preview buffer
+ * then the next atom's preamble is in the preview buffer */
+ uint64_t ftyp_atom_size = _X_BE_32(&preview[0]) + ATOM_PREAMBLE_SIZE;
+ if (ftyp_atom_size >= MAX_PREVIEW_SIZE)
+ return 0;
+ return _X_BE_32(&preview[ftyp_atom_size - 4]) == MOOV_ATOM;
}
}
- if (demux_qt_parse_references (this, 0))
- return 2;
-
find_moov_atom(qt_file, &moov_atom_offset, &moov_atom_size);
if (moov_atom_offset == -1) {
return 0;
} else {
+ unsigned char atom_preamble[ATOM_PREAMBLE_SIZE];
/* check that the next atom in the chunk contains alphanumeric
* characters in the atom type field; if not, disqualify the file
* as a QT file */
@@ -833,80 +733,124 @@ static int id_qt_file(demux_qt_t *this) {
}
}
+static char *parse_data_atom(const uint8_t *data_atom, uint32_t max_size) {
+ 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];
+
+ if (data_atom_size > max_size)
+ data_atom_size = max_size;
+
+ if (data_atom_size < 8)
+ return NULL; /* too small */
+
+ 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);
+ if (alloc_str) {
+ 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;
- if (string_size <= 0)
- continue;
- info->artist = xine_xmalloc(string_size);
- if (info->artist) {
- 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;
- if (string_size <= 0)
- continue;
- info->name = xine_xmalloc(string_size);
- if (info->name) {
- 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;
- if (string_size <= 0)
- continue;
- info->album = xine_xmalloc(string_size);
- if (info->album) {
- 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;
- if (string_size <= 0)
- continue;
- info->genre = xine_xmalloc(string_size);
- if (info->genre) {
- 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;
- if (string_size <= 0)
- continue;
- info->comment = xine_xmalloc(string_size);
- if (info->comment) {
- 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;
- if (string_size <= 0)
- continue;
- info->composer = xine_xmalloc(string_size);
- if (info->composer) {
- strncpy(info->composer, &meta_atom[i + 20], string_size - 1);
- info->composer[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;
}
- } else if (current_atom == DAY_ATOM) {
- string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1;
- if (string_size <= 0)
- continue;
- info->year = xine_xmalloc(string_size);
- if (info->year) {
- strncpy(info->year, &meta_atom[i + 20], string_size - 1);
- info->year[string_size - 1] = 0;
+
+ 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]);
+ char *const data_atom = parse_data_atom(&sub_atom[8], current_atom_size - j);
+
+ switch(sub_atom_code) {
+ case ART_ATOM:
+ info->artist = data_atom;
+ break;
+ case NAM_ATOM:
+ info->name = data_atom;
+ break;
+ case ALB_ATOM:
+ info->album = data_atom;
+ break;
+ case GEN_ATOM:
+ info->genre = data_atom;
+ break;
+ case CMT_ATOM:
+ info->comment = data_atom;
+ break;
+ case WRT_ATOM:
+ info->composer = data_atom;
+ break;
+ case DAY_ATOM:
+ info->year = data_atom;
+ break;
+ default:
+ debug_meta_load("unknown atom %08x in ilst\n", sub_atom_code);
+ free(data_atom);
+ }
+
+ j += sub_atom_size;
}
}
+ break;
+
+ default:
+ debug_meta_load("unknown atom %08x in meta\n", current_atom_code);
+ }
+
+ i += current_atom_size;
}
}
@@ -948,25 +892,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;
@@ -997,12 +927,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;
}
@@ -1014,13 +945,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 uint32_t current_atom_size = _X_BE_32(&trak_atom[i - 4]);
+ const qt_atom 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;
@@ -1050,17 +983,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");
+ {
+ const int version = trak_atom[i+4];
+ if ( version > 1 ) continue; /* unsupported, undocumented */
- 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);
@@ -1082,13 +1017,23 @@ static qt_error parse_trak_atom (qt_trak *trak,
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]);
if (current_stsd_atom_size < 4) {
last_error = QT_HEADER_TROUBLE;
goto free_trak;
}
if (trak->type == MEDIA_VIDEO) {
+ /* 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;
trak->stsd_atoms[k].video.media_id = k + 1;
trak->stsd_atoms[k].video.properties_offset = properties_offset;
@@ -1389,7 +1334,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))) {
@@ -1443,15 +1388,15 @@ static qt_error parse_trak_atom (qt_trak *trak,
atom_pos += current_stsd_atom_size;
properties_offset += current_stsd_atom_size;
}
+ break;
- } else if (current_atom == ESDS_ATOM) {
-
- uint32_t len;
+ 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 ) {
@@ -1482,17 +1427,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;
@@ -1524,9 +1469,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;
@@ -1553,9 +1498,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;
@@ -1567,8 +1512,7 @@ static qt_error parse_trak_atom (qt_trak *trak,
debug_atom_load(" qt stco atom (32-bit chunk offset atom): %d chunk offsets\n",
trak->chunk_offset_count);
- trak->chunk_offset_table = (int64_t *)calloc(
- trak->chunk_offset_count, sizeof(int64_t));
+ trak->chunk_offset_table = calloc(trak->chunk_offset_count, sizeof(int64_t));
if (!trak->chunk_offset_table) {
last_error = QT_NO_MEMORY;
goto free_trak;
@@ -1581,9 +1525,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;
@@ -1595,8 +1539,7 @@ static qt_error parse_trak_atom (qt_trak *trak,
debug_atom_load(" qt co64 atom (64-bit chunk offset atom): %d chunk offsets\n",
trak->chunk_offset_count);
- trak->chunk_offset_table = (int64_t *)calloc(
- trak->chunk_offset_count, sizeof(int64_t));
+ trak->chunk_offset_table = calloc(trak->chunk_offset_count, sizeof(int64_t));
if (!trak->chunk_offset_table) {
last_error = QT_NO_MEMORY;
goto free_trak;
@@ -1612,9 +1555,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;
@@ -1626,8 +1569,7 @@ static qt_error parse_trak_atom (qt_trak *trak,
debug_atom_load(" qt stsc atom (sample-to-chunk atom): %d entries\n",
trak->sample_to_chunk_count);
- trak->sample_to_chunk_table = (sample_to_chunk_table_t *)calloc(
- trak->sample_to_chunk_count, sizeof(sample_to_chunk_table_t));
+ trak->sample_to_chunk_table = calloc(trak->sample_to_chunk_count, sizeof(sample_to_chunk_table_t));
if (!trak->sample_to_chunk_table) {
last_error = QT_NO_MEMORY;
goto free_trak;
@@ -1647,9 +1589,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
|| current_atom_size < 12 || current_atom_size >= UINT_MAX) {
@@ -1667,8 +1609,7 @@ static qt_error parse_trak_atom (qt_trak *trak,
goto free_trak;
}
- trak->time_to_sample_table = (time_to_sample_table_t *)calloc(
- trak->time_to_sample_count+1, sizeof(time_to_sample_table_t));
+ trak->time_to_sample_table = calloc(trak->time_to_sample_count+1, sizeof(time_to_sample_table_t));
if (!trak->time_to_sample_table) {
last_error = QT_NO_MEMORY;
goto free_trak;
@@ -1715,9 +1656,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]);
if (ref_atom_size >= 0x80000000)
return QT_NOT_A_VALID_FILE;
@@ -1728,17 +1667,17 @@ static qt_error parse_reference_atom (reference_t *ref,
ref->qtim_version = 0;
/* traverse through the atom looking for the key atoms */
- for (i = ATOM_PREAMBLE_SIZE; i + 4 < ref_atom_size; i++) {
-
- current_atom_size = _X_BE_32(&ref_atom[i - 4]);
- current_atom = _X_BE_32(&ref_atom[i]);
+ 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]);
- if (current_atom == RDRF_ATOM) {
+ switch (current_atom) {
+ case RDRF_ATOM: {
size_t string_size = _X_BE_32(&ref_atom[i + 12]);
size_t url_offset = 0;
int http = 0;
- if (string_size >= current_atom_size || string_size >= ref_atom_size - i)
+ if (string_size >= current_atom_size || i + string_size >= ref_atom_size)
return QT_NOT_A_VALID_FILE;
/* if the URL starts with "http://", copy it */
@@ -1764,19 +1703,20 @@ static qt_error parse_reference_atom (reference_t *ref,
memcpy(ref->url + url_offset, &ref_atom[i + 16], _X_BE_32(&ref_atom[i + 12]));
ref->url[string_size] = '\0';
+ }
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
@@ -1799,7 +1739,7 @@ static qt_error parse_reference_atom (reference_t *ref,
* building a frame table. */
#define MAX_DURATION 0x7FFFFFFFFFFFFFFFLL
static void get_next_edit_list_entry(qt_trak *trak,
- int *edit_list_index,
+ unsigned int *edit_list_index,
unsigned int *edit_list_media_time,
int64_t *edit_list_duration,
unsigned int global_timescale) {
@@ -1876,7 +1816,7 @@ static qt_error build_frame_table(qt_trak *trak,
/* in this case, the total number of frames is equal to the number of
* entries in the sample size table */
trak->frame_count = trak->sample_size_count;
- trak->frames = (qt_frame *)calloc(trak->frame_count, sizeof(qt_frame));
+ trak->frames = calloc(trak->frame_count, sizeof(qt_frame));
if (!trak->frames)
return QT_NO_MEMORY;
trak->current_frame = 0;
@@ -1888,7 +1828,7 @@ static qt_error build_frame_table(qt_trak *trak,
pts_index_countdown =
trak->time_to_sample_table[pts_index].count;
- media_id_counts = calloc(trak->stsd_atoms_count, sizeof(int));
+ media_id_counts = xine_xcalloc(trak->stsd_atoms_count, sizeof(int));
if (!media_id_counts)
return QT_NO_MEMORY;
@@ -2025,7 +1965,7 @@ static qt_error build_frame_table(qt_trak *trak,
/* in this case, the total number of frames is equal to the number of
* chunks */
trak->frame_count = trak->chunk_offset_count;
- trak->frames = (qt_frame *)calloc(trak->frame_count, sizeof(qt_frame));
+ trak->frames = calloc(trak->frame_count, sizeof(qt_frame));
if (!trak->frames)
return QT_NO_MEMORY;
@@ -2102,7 +2042,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;
@@ -2117,15 +2056,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,
@@ -2137,44 +2078,50 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom,
info->trak_count--;
return;
}
+ break;
- } else if (current_atom == META_ATOM) {
+ case UDTA_ATOM:
+ parse_meta_atom(info, &moov_atom[i + 4]);
+ if (info->last_error != QT_OK)
+ return;
+ break;
+ 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) {
-
- 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;
-
- } else if (current_atom == 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;
-
- } else if (current_atom == 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;
+ case NAM_ATOM:
+ string_size = _X_BE_16(&moov_atom[i + 4]);
+ info->name = realloc (info->name, string_size + 1);
+ memcpy(info->name, &moov_atom[i + 8], string_size);
+ info->name[string_size] = 0;
+ break;
- } else if (current_atom == CMT_ATOM) {
+ case CPY_ATOM:
+ string_size = _X_BE_16(&moov_atom[i + 4]);
+ info->copyright = realloc (info->copyright, string_size + 1);
+ memcpy(info->copyright, &moov_atom[i + 8], string_size);
+ info->copyright[string_size] = 0;
+ break;
- 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;
+ case DES_ATOM:
+ string_size = _X_BE_16(&moov_atom[i + 4]);
+ info->description = realloc (info->description, string_size + 1);
+ memcpy(info->description, &moov_atom[i + 8], string_size);
+ info->description[string_size] = 0;
+ break;
- } else if (current_atom == RMDA_ATOM ||
- current_atom == RMRA_ATOM) {
+ case CMT_ATOM:
+ string_size = _X_BE_16(&moov_atom[i + 4]);
+ info->comment = realloc (info->comment, string_size + 1);
+ memcpy(info->comment, &moov_atom[i + 8], string_size);
+ info->comment[string_size] = 0;
+ break;
+ case RMDA_ATOM:
+ case RMRA_ATOM:
/* create a new reference structure */
info->reference_count++;
info->references = (reference_t *)realloc(info->references,
@@ -2186,8 +2133,9 @@ static void parse_moov_atom(qt_info *info, unsigned char *moov_atom,
info->last_error = error;
return;
}
+ break;
- } else {
+ default:
debug_atom_load(" qt: unknown atom into the moov atom (0x%08X)\n", current_atom);
}
}
@@ -2263,7 +2211,6 @@ static qt_error open_qt_file(qt_info *info, input_plugin_t *input,
unsigned char *moov_atom = NULL;
off_t moov_atom_offset = -1;
int64_t moov_atom_size = -1;
- unsigned char preview[MAX_PREVIEW_SIZE];
/* zlib stuff */
z_stream z_state;
@@ -2286,7 +2233,7 @@ static qt_error open_qt_file(qt_info *info, input_plugin_t *input,
if ((input->get_capabilities(input) & INPUT_CAP_SEEKABLE))
find_moov_atom(input, &moov_atom_offset, &moov_atom_size);
else {
- memset (&preview, 0, MAX_PREVIEW_SIZE);
+ unsigned char preview[MAX_PREVIEW_SIZE] = { 0, };
input->get_optional_data(input, preview, INPUT_OPTIONAL_DATA_PREVIEW);
if (_X_BE_32(&preview[4]) != MOOV_ATOM) {
/* special case if there is an ftyp atom first */
@@ -2423,13 +2370,6 @@ static int demux_qt_send_chunk(demux_plugin_t *this_gen) {
int dispatch_audio; /* boolean for deciding which trak to dispatch */
int64_t pts_diff;
- /* handle QTL here */
- if (!this->qt) {
- demux_qt_parse_references (this, 1);
- this->status = DEMUX_FINISHED;
- return this->status;
- }
-
/* if this is DRM-protected content, finish playback before it even
* tries to start */
if (this->qt->last_error == QT_DRM_NOT_SUPPORTED) {
@@ -2728,12 +2668,6 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) {
this->status = DEMUX_OK;
- if (!this->qt) {
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 0);
- return;
- }
-
/* figure out where the data begins and ends */
if (this->qt->video_trak != -1) {
video_trak = &this->qt->traks[this->qt->video_trak];
@@ -2778,7 +2712,11 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) {
if( !video_trak->properties->video.codec_buftype &&
video_trak->properties->video.codec_fourcc )
+ {
video_trak->properties->video.codec_buftype = BUF_VIDEO_UNKNOWN;
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE,
+ video_trak->properties->video.codec_fourcc);
+ }
_x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 1);
_x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH,
@@ -2820,7 +2758,11 @@ static void demux_qt_send_headers(demux_plugin_t *this_gen) {
if( !audio_trak->properties->audio.codec_buftype &&
audio_trak->properties->audio.codec_fourcc )
+ {
audio_trak->properties->audio.codec_buftype = BUF_AUDIO_UNKNOWN;
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE,
+ audio_trak->properties->audio.codec_fourcc);
+ }
_x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
_x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_CHANNELS,
@@ -3051,10 +2993,6 @@ static int demux_qt_seek (demux_plugin_t *this_gen,
start_pos = (off_t) ( (double) start_pos / 65535 *
this->data_size );
- /* we could be handling QTL */
- if (!this->qt)
- return this->status = DEMUX_OK;
-
/* short-circuit any attempts to seek in a non-seekable stream, including
* seeking in the forward direction; this may change later */
if ((this->input->get_capabilities(this->input) & INPUT_CAP_SEEKABLE) == 0) {
@@ -3154,7 +3092,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
demux_qt_t *this;
xine_cfg_entry_t entry;
qt_error last_error;
- int type;
if ((input->get_capabilities(input) & INPUT_CAP_BLOCK)) {
return NULL;
@@ -3188,14 +3125,10 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
case METHOD_BY_CONTENT:
- type = id_qt_file(this);
- if (type < 1) {
+ if (!is_qt_file(this->input)) {
free (this);
return NULL;
}
- if (type != 1)
- break;
-
if ((this->qt = create_qt_info()) == NULL) {
free (this);
return NULL;
@@ -3217,35 +3150,13 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const ending = strrchr(mrl, '.');
-
- if (!ending) {
- free (this);
- return NULL;
- }
-
- if (strncasecmp (ending, ".mov", 4) &&
- strncasecmp (ending, ".qt", 3) &&
- strncasecmp (ending, ".qtl", 4) &&
- strncasecmp (ending, ".mp4", 4)) {
- free (this);
- return NULL;
- }
- }
-
- /* we want to fall through here */
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT: {
- type = id_qt_file(this);
- if (type < 1) {
+ if (!is_qt_file(this->input)) {
free (this);
return NULL;
}
- if (type != 1)
- break;
-
if ((this->qt = create_qt_info()) == NULL) {
free (this);
return NULL;
@@ -3268,34 +3179,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Apple Quicktime (MOV) and MPEG-4 demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MOV/MPEG-4";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mov qt qtl mp4 m4a m4b f4a f4v";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/quicktime: mov,qt: Quicktime animation;"
- "video/x-quicktime: mov,qt: Quicktime animation;"
- "audio/x-m4a: m4a,m4b: MPEG-4 audio;"
- "application/x-quicktimeplayer: qtl: Quicktime list;"
- "video/mp4: f4v,mp4,mpg4: MPEG-4 video;"
- "audio/mp4: f4a,mp4,mpg4: MPEG-4 audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_qt_class_t *this = (demux_qt_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_qt_class_t *this;
@@ -3305,11 +3188,16 @@ static void *init_plugin (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Apple Quicktime (MOV) and MPEG-4 demux plugin");
+ this->demux_class.identifier = "MOV/MPEG-4";
+ this->demux_class.mimetypes =
+ "video/quicktime: mov,qt: Quicktime animation;"
+ "video/x-quicktime: mov,qt: Quicktime animation;"
+ "audio/x-m4a: m4a,m4b: MPEG-4 audio;"
+ "video/mp4: f4v,mp4,mpg4: MPEG-4 video;"
+ "audio/mp4: f4a,mp4,mpg4: MPEG-4 audio;";
+ this->demux_class.extensions = "mov qt mp4 m4a m4b f4a f4v";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -3323,6 +3211,6 @@ static const demuxer_info_t demux_info_qt = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "quicktime", XINE_VERSION_CODE, &demux_info_qt, init_plugin },
+ { PLUGIN_DEMUX, 27, "quicktime", XINE_VERSION_CODE, &demux_info_qt, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c
index 968542057..199100a89 100644
--- a/src/demuxers/demux_rawdv.c
+++ b/src/demuxers/demux_rawdv.c
@@ -32,10 +32,10 @@
#include <unistd.h>
#include <string.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#define NTSC_FRAME_SIZE 120000
#define NTSC_FRAME_RATE 29.97
@@ -321,12 +321,6 @@ static int demux_raw_dv_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_raw_dv_dispose (demux_plugin_t *this_gen) {
- demux_raw_dv_t *this = (demux_raw_dv_t *) this_gen;
-
- free (this);
-}
-
static int demux_raw_dv_get_stream_length(demux_plugin_t *this_gen) {
demux_raw_dv_t *this = (demux_raw_dv_t *) this_gen;
@@ -355,7 +349,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_raw_dv_send_headers;
this->demux_plugin.send_chunk = demux_raw_dv_send_chunk;
this->demux_plugin.seek = demux_raw_dv_seek;
- this->demux_plugin.dispose = demux_raw_dv_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_raw_dv_get_status;
this->demux_plugin.get_stream_length = demux_raw_dv_get_stream_length;
this->demux_plugin.get_capabilities = demux_raw_dv_get_capabilities;
@@ -382,19 +376,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
}
break;
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -411,39 +393,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Raw DV Video stream";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "raw_dv";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "dv dif";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_raw_dv_class_t *this = (demux_raw_dv_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_raw_dv_class_t *this;
this = calloc(1, sizeof(demux_raw_dv_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Raw DV Video stream");
+ this->demux_class.identifier = "raw_dv";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "dv dif";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -457,6 +417,6 @@ static const demuxer_info_t demux_info_raw_dv = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "rawdv", XINE_VERSION_CODE, &demux_info_raw_dv, init_plugin },
+ { PLUGIN_DEMUX, 27, "rawdv", XINE_VERSION_CODE, &demux_info_raw_dv, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 9ecf6b622..47d18018e 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -52,10 +52,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "real_common.h"
@@ -287,29 +287,23 @@ static mdpr_t *real_parse_mdpr(const char *data, const unsigned int size)
mdpr->stream_name_size=data[32];
if (size < 38 + mdpr->stream_name_size)
goto fail;
- mdpr->stream_name=malloc(mdpr->stream_name_size+1);
+ mdpr->stream_name=xine_memdup0(&data[33], mdpr->stream_name_size);
if (!mdpr->stream_name)
goto fail;
- memcpy(mdpr->stream_name, &data[33], mdpr->stream_name_size);
- mdpr->stream_name[(int)mdpr->stream_name_size]=0;
mdpr->mime_type_size=data[33+mdpr->stream_name_size];
if (size < 38 + mdpr->stream_name_size + mdpr->mime_type_size)
goto fail;
- mdpr->mime_type=malloc(mdpr->mime_type_size+1);
+ mdpr->mime_type=xine_memdup0(&data[34+mdpr->stream_name_size], mdpr->mime_type_size);
if (!mdpr->mime_type)
goto fail;
- memcpy(mdpr->mime_type, &data[34+mdpr->stream_name_size], mdpr->mime_type_size);
- mdpr->mime_type[(int)mdpr->mime_type_size]=0;
mdpr->type_specific_len=_X_BE_32(&data[34+mdpr->stream_name_size+mdpr->mime_type_size]);
if (size < 38 + mdpr->stream_name_size + mdpr->mime_type_size + mdpr->type_specific_len)
goto fail;
- mdpr->type_specific_data=malloc(mdpr->type_specific_len);
+ mdpr->type_specific_data=xine_memdup(&data[38+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
if (!mdpr->type_specific_data)
goto fail;
- memcpy(mdpr->type_specific_data,
- &data[38+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
lprintf("MDPR: stream number: %i\n", mdpr->stream_number);
lprintf("MDPR: maximal bit rate: %i\n", mdpr->max_bit_rate);
@@ -579,6 +573,9 @@ static void real_parse_headers (demux_real_t *this) {
this->audio_streams[this->num_audio_streams].index = NULL;
this->audio_streams[this->num_audio_streams].mdpr = mdpr;
+ if (!this->audio_streams[this->num_audio_streams].buf_type)
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE, fourcc);
+
real_parse_audio_specific_data (this,
&this->audio_streams[this->num_audio_streams]);
this->num_audio_streams++;
@@ -602,7 +599,10 @@ static void real_parse_headers (demux_real_t *this) {
this->video_streams[this->num_video_streams].index = NULL;
this->video_streams[this->num_video_streams].mdpr = mdpr;
- this->num_video_streams++;
+ this->num_video_streams++;
+
+ if (!this->video_streams[this->num_video_streams].buf_type)
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, fourcc);
} else {
lprintf("unrecognised type specific data\n");
@@ -1734,20 +1734,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
lprintf ("by content accepted.\n");
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const extensions = class_gen->get_extensions (class_gen);
-
- lprintf ("by extension '%s'\n", mrl);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- return NULL;
- }
- lprintf ("by extension accepted.\n");
- }
-
- break;
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -1780,40 +1767,19 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "RealMedia file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Real";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "rm rmvb ram";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-pn-realaudio: ra, rm, ram: Real Media file;"
- "audio/x-pn-realaudio-plugin: rpm: Real Media plugin file;"
- "audio/x-real-audio: ra, rm, ram: Real Media file;"
- "application/vnd.rn-realmedia: ra, rm, ram: Real Media file;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_real_class_t *this = (demux_real_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_real_class_t *const this = calloc(1, sizeof(demux_real_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("RealMedia file demux plugin");
+ this->demux_class.identifier = "Real";
+ this->demux_class.mimetypes =
+ "audio/x-pn-realaudio: ra, rm, ram: Real Media file;"
+ "audio/x-pn-realaudio-plugin: rpm: Real Media plugin file;"
+ "audio/x-real-audio: ra, rm, ram: Real Media file;"
+ "application/vnd.rn-realmedia: ra, rm, ram: Real Media file;";
+ this->demux_class.extensions = "rm rmvb ram";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -1827,6 +1793,6 @@ static const demuxer_info_t demux_info_real = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "real", XINE_VERSION_CODE, &demux_info_real, init_class },
+ { PLUGIN_DEMUX, 27, "real", XINE_VERSION_CODE, &demux_info_real, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c
index 3c18f7ec3..6f29e46d6 100644
--- a/src/demuxers/demux_realaudio.c
+++ b/src/demuxers/demux_realaudio.c
@@ -34,10 +34,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -365,11 +365,8 @@ static int demux_ra_seek (demux_plugin_t *this_gen,
static void demux_ra_dispose (demux_plugin_t *this_gen) {
demux_ra_t *this = (demux_ra_t *) this_gen;
- if(this->header)
- free(this->header);
- if (this->frame_buffer)
- free(this->frame_buffer);
-
+ free(this->header);
+ free(this->frame_buffer);
free(this);
}
@@ -417,19 +414,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -448,39 +433,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "RealAudio file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "RA";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "ra";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-realaudio: ra: RealAudio File;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_ra_class_t *this = (demux_ra_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_realaudio_init_plugin (xine_t *xine, void *data) {
demux_ra_class_t *this;
this = calloc(1, sizeof(demux_ra_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("RealAudio file demux plugin");
+ this->demux_class.identifier = "RA";
+ this->demux_class.mimetypes = "audio/x-realaudio: ra: RealAudio File;";
+ this->demux_class.extensions = "ra";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c
index 346d487aa..9bc0f4e99 100644
--- a/src/demuxers/demux_roq.c
+++ b/src/demuxers/demux_roq.c
@@ -40,10 +40,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -377,11 +377,6 @@ static int demux_roq_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_roq_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_roq_get_status (demux_plugin_t *this_gen) {
demux_roq_t *this = (demux_roq_t *) this_gen;
@@ -418,7 +413,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_roq_send_headers;
this->demux_plugin.send_chunk = demux_roq_send_chunk;
this->demux_plugin.seek = demux_roq_seek;
- this->demux_plugin.dispose = demux_roq_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_roq_get_status;
this->demux_plugin.get_stream_length = demux_roq_get_stream_length;
this->demux_plugin.get_capabilities = demux_roq_get_capabilities;
@@ -429,19 +424,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -460,39 +443,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Id RoQ file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "RoQ";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "roq";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_roq_class_t *this = (demux_roq_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_roq_init_plugin (xine_t *xine, void *data) {
demux_roq_class_t *this;
this = calloc(1, sizeof(demux_roq_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Id RoQ file demux plugin");
+ this->demux_class.identifier = "RoQ";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "roq";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_shn.c b/src/demuxers/demux_shn.c
index b4f7c764b..7e25a7048 100644
--- a/src/demuxers/demux_shn.c
+++ b/src/demuxers/demux_shn.c
@@ -35,10 +35,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -150,12 +150,6 @@ static int demux_shn_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_shn_dispose (demux_plugin_t *this_gen) {
- demux_shn_t *this = (demux_shn_t *) this_gen;
-
- free(this);
-}
-
static int demux_shn_get_status (demux_plugin_t *this_gen) {
demux_shn_t *this = (demux_shn_t *) this_gen;
@@ -189,7 +183,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_shn_send_headers;
this->demux_plugin.send_chunk = demux_shn_send_chunk;
this->demux_plugin.seek = demux_shn_seek;
- this->demux_plugin.dispose = demux_shn_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_shn_get_status;
this->demux_plugin.get_stream_length = demux_shn_get_stream_length;
this->demux_plugin.get_capabilities = demux_shn_get_capabilities;
@@ -199,19 +193,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->status = DEMUX_FINISHED;
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* Falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
if (!open_shn_file(this)) {
@@ -228,39 +210,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Shorten demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "Shorten";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "shn";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_shn_class_t *this = (demux_shn_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_shn_init_plugin (xine_t *xine, void *data) {
demux_shn_class_t *this;
this = calloc(1, sizeof(demux_shn_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Shorten demux plugin");
+ this->demux_class.identifier = "Shorten";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "shn";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c
index de530f224..553089206 100644
--- a/src/demuxers/demux_slave.c
+++ b/src/demuxers/demux_slave.c
@@ -42,10 +42,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#define SCRATCH_SIZE 1024
#define CHECK_VPTS_INTERVAL 2*90000
@@ -334,16 +334,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
-
- if(!strncmp(mrl, "slave://", 8))
- break;
-
- free (this);
- return NULL;
- }
-
case METHOD_BY_CONTENT: {
if (_x_demux_read_header(input, this->scratch, SCRATCH_SIZE) > 0) {
@@ -355,6 +345,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -388,39 +379,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "slave";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_slave_class_t *this = (demux_slave_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_slave_class_t *this;
this = calloc(1, sizeof(demux_slave_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = "";
+ this->demux_class.identifier = "slave";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "slave://";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -434,6 +403,6 @@ static const demuxer_info_t demux_info_slave = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "slave", XINE_VERSION_CODE, &demux_info_slave, init_plugin },
+ { PLUGIN_DEMUX, 27, "slave", XINE_VERSION_CODE, &demux_info_slave, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c
index 04a46fa78..6f0cb3832 100644
--- a/src/demuxers/demux_smjpeg.c
+++ b/src/demuxers/demux_smjpeg.c
@@ -39,10 +39,10 @@
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -141,6 +141,8 @@ static int open_smjpeg_file(demux_smjpeg_t *this) {
this->bih.biHeight = _X_BE_16(&header_chunk[10]);
this->bih.biCompression = *(uint32_t *)&header_chunk[12];
this->video_type = _x_fourcc_to_buf_video(this->bih.biCompression);
+ if (!this->video_type)
+ _x_report_video_fourcc (this->stream->xine, LOG_MODULE, this->bih.biCompression);
break;
case _SND_TAG:
@@ -160,6 +162,8 @@ static int open_smjpeg_file(demux_smjpeg_t *this) {
} else {
audio_codec = *(uint32_t *)&header_chunk[8];
this->audio_type = _x_formattag_to_buf_audio(audio_codec);
+ if (!this->audio_type)
+ _x_report_audio_format_tag (this->stream->xine, LOG_MODULE, audio_codec);
}
break;
@@ -356,12 +360,6 @@ static int demux_smjpeg_seek (demux_plugin_t *this_gen, off_t start_pos, int sta
}
-static void demux_smjpeg_dispose (demux_plugin_t *this_gen) {
- demux_smjpeg_t *this = (demux_smjpeg_t *) this_gen;
-
- free(this);
-}
-
static int demux_smjpeg_get_status (demux_plugin_t *this_gen) {
demux_smjpeg_t *this = (demux_smjpeg_t *) this_gen;
@@ -401,7 +399,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_smjpeg_send_headers;
this->demux_plugin.send_chunk = demux_smjpeg_send_chunk;
this->demux_plugin.seek = demux_smjpeg_seek;
- this->demux_plugin.dispose = demux_smjpeg_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_smjpeg_get_status;
this->demux_plugin.get_stream_length = demux_smjpeg_get_stream_length;
this->demux_plugin.get_capabilities = demux_smjpeg_get_capabilities;
@@ -412,19 +410,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -443,39 +429,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "SMJPEG file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "SMJPEG";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mjpg";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_smjpeg_class_t *this = (demux_smjpeg_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_smjpeg_init_plugin (xine_t *xine, void *data) {
demux_smjpeg_class_t *this;
this = calloc(1, sizeof(demux_smjpeg_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("SMJPEG file demux plugin");
+ this->demux_class.identifier = "SMJPEG";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "mjpg";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c
index 66e2bd543..1b6b7803a 100644
--- a/src/demuxers/demux_snd.c
+++ b/src/demuxers/demux_snd.c
@@ -33,10 +33,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -283,12 +283,6 @@ static int demux_snd_seek (demux_plugin_t *this_gen, off_t start_pos, int start_
return this->status;
}
-static void demux_snd_dispose (demux_plugin_t *this_gen) {
- demux_snd_t *this = (demux_snd_t *) this_gen;
-
- free(this);
-}
-
static int demux_snd_get_status (demux_plugin_t *this_gen) {
demux_snd_t *this = (demux_snd_t *) this_gen;
@@ -323,7 +317,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_snd_send_headers;
this->demux_plugin.send_chunk = demux_snd_send_chunk;
this->demux_plugin.seek = demux_snd_seek;
- this->demux_plugin.dispose = demux_snd_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_snd_get_status;
this->demux_plugin.get_stream_length = demux_snd_get_stream_length;
this->demux_plugin.get_capabilities = demux_snd_get_capabilities;
@@ -334,19 +328,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -365,42 +347,20 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "SND/AU file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "SND/AU";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "snd au";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/basic: snd,au: ULAW (Sun) audio;"
- "audio/x-basic: snd,au: ULAW (Sun) audio;"
- "audio/x-pn-au: snd,au: ULAW (Sun) audio;";
-
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_snd_class_t *this = (demux_snd_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_snd_init_plugin (xine_t *xine, void *data) {
demux_snd_class_t *this;
this = calloc(1, sizeof(demux_snd_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("SND/AU file demux plugin");
+ this->demux_class.identifier = "SND/AU";
+ this->demux_class.mimetypes =
+ "audio/basic: snd,au: ULAW (Sun) audio;"
+ "audio/x-basic: snd,au: ULAW (Sun) audio;"
+ "audio/x-pn-au: snd,au: ULAW (Sun) audio;";
+ this->demux_class.extensions = "snd au";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c
index d88432817..e4c439f2f 100644
--- a/src/demuxers/demux_str.c
+++ b/src/demuxers/demux_str.c
@@ -123,10 +123,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -515,11 +515,6 @@ static int demux_str_seek (demux_plugin_t *this_gen, off_t start_pos, int start_
return this->status;
}
-static void demux_str_dispose (demux_plugin_t *this) {
-
- free(this);
-}
-
static int demux_str_get_status (demux_plugin_t *this_gen) {
demux_str_t *this = (demux_str_t *) this_gen;
@@ -559,7 +554,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_str_send_headers;
this->demux_plugin.send_chunk = demux_str_send_chunk;
this->demux_plugin.seek = demux_str_seek;
- this->demux_plugin.dispose = demux_str_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_str_get_status;
this->demux_plugin.get_stream_length = demux_str_get_stream_length;
this->demux_plugin.get_capabilities = demux_str_get_capabilities;
@@ -570,19 +565,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -600,39 +583,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Sony Playstation STR file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "PSX STR";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- /* also .mov, but we don't want to hijack that extension */
- return "str iki ik2 dps dat xa xa1 xa2 xas xap";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_str_class_t *this = (demux_str_class_t *) this_gen;
- free (this);
-}
-
void *demux_str_init_plugin (xine_t *xine, void *data) {
demux_str_class_t *this;
this = calloc(1, sizeof(demux_str_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Sony Playstation STR file demux plugin");
+ this->demux_class.identifier = "PSX STR";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "str iki ik2 dps dat xa xa1 xa2 xas xap";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c
index 88ccf49f4..86563fbac 100644
--- a/src/demuxers/demux_ts.c
+++ b/src/demuxers/demux_ts.c
@@ -146,6 +146,13 @@
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
+#include <arpa/inet.h>
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <crc.h>
+#else
+# include <libavutil/crc.h>
+#endif
#define LOG_MODULE "demux_ts"
#define LOG_VERBOSE
@@ -153,9 +160,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
/*
#define TS_LOG
@@ -319,6 +326,18 @@ typedef struct {
} demux_ts_audio_track;
typedef struct {
+
+ demux_class_t demux_class;
+
+ /* class-wide, global variables here */
+
+ xine_t *xine;
+ config_values_t *config;
+
+ const AVCRC *av_crc;
+} demux_ts_class_t;
+
+typedef struct {
/*
* The first field must be the "base class" for the plugin!
*/
@@ -334,12 +353,15 @@ typedef struct {
input_plugin_t *input;
unsigned int read_retries;
+ demux_ts_class_t *class;
+
int status;
int hdmv; /* -1 = unknown, 0 = mpeg-ts, 1 = hdmv/m2ts */
int pkt_size; /* TS packet size */
int pkt_offset; /* TS packet offset */
+ int blockSize;
int rate;
unsigned int media_num;
demux_ts_media media[MAX_PIDS];
@@ -352,7 +374,6 @@ typedef struct {
uint32_t pmt_pid[MAX_PMTS];
uint8_t *pmt[MAX_PMTS];
uint8_t *pmt_write_ptr[MAX_PMTS];
- uint32_t crc32_table[256];
uint32_t last_pmt_crc;
/*
* Stuff to do with the transport header. As well as the video
@@ -402,15 +423,6 @@ typedef struct {
} demux_ts_t;
-typedef struct {
-
- demux_class_t demux_class;
-
- /* class-wide, global variables here */
-
- xine_t *xine;
- config_values_t *config;
-} demux_ts_class_t;
static void reset_track_map(fifo_buffer_t *fifo)
{
@@ -611,28 +623,6 @@ static void demux_ts_tbre_update (demux_ts_t *this, unsigned int mode, int64_t n
this->tbre_lasttime = now;
}
-static void demux_ts_build_crc32_table(demux_ts_t*this) {
- uint32_t i, j, k;
-
- for( i = 0 ; i < 256 ; i++ ) {
- k = 0;
- for (j = (i << 24) | 0x800000 ; j != 0x80000000 ; j <<= 1) {
- k = (k << 1) ^ (((k ^ j) & 0x80000000) ? 0x04c11db7 : 0);
- }
- this->crc32_table[i] = k;
- }
-}
-
-static uint32_t demux_ts_compute_crc32(demux_ts_t*this, uint8_t *data,
- int32_t length, uint32_t crc32) {
- int32_t i;
-
- for(i = 0; i < length; i++) {
- crc32 = (crc32 << 8) ^ this->crc32_table[(crc32 >> 24) ^ data[i]];
- }
- return crc32;
-}
-
/* redefine abs as macro to handle 64-bit diffs.
i guess llabs may not be available everywhere */
#define abs(x) ( ((x)<0) ? -(x) : (x) )
@@ -899,8 +889,7 @@ static void demux_ts_parse_pat (demux_ts_t*this, unsigned char *original_pkt,
}
/* Check CRC. */
- calc_crc32 = demux_ts_compute_crc32 (this, pkt+5, section_length+3-4,
- 0xffffffff);
+ calc_crc32 = htonl(av_crc(this->class->av_crc, 0xffffffff, pkt+5, section_length+3-4));
if (crc32 != calc_crc32) {
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
"demux_ts: demux error! PAT with invalid CRC32: packet_crc32: %.8x calc_crc32: %.8x\n",
@@ -1434,7 +1423,7 @@ static void demux_ts_parse_pmt (demux_ts_t *this,
unsigned char *stream;
unsigned int i;
int count;
- char *ptr = NULL;
+ uint8_t *ptr = NULL;
unsigned char len;
unsigned int offset=0;
int mi;
@@ -1555,9 +1544,9 @@ printf("Program Number is %i, looking for %i\n",program_number,this->program_num
crc32 |= (uint32_t) this->pmt[program_count][section_length+3-1] ;
/* Check CRC. */
- calc_crc32 = demux_ts_compute_crc32 (this,
- this->pmt[program_count],
- section_length+3-4, 0xffffffff);
+ calc_crc32 = htonl(av_crc(this->class->av_crc, 0xffffffff,
+ this->pmt[program_count], section_length+3-4));
+
if (crc32 != calc_crc32) {
xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
"demux_ts: demux error! PMT with invalid CRC32: packet_crc32: %#.8x calc_crc32: %#.8x\n",
@@ -2421,8 +2410,6 @@ static void demux_ts_send_headers (demux_plugin_t *this_gen) {
this->send_newpts = 1;
- demux_ts_build_crc32_table (this);
-
this->status = DEMUX_OK ;
this->scrambled_npids = 0;
@@ -2613,39 +2600,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
}
break;
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
-
- if (_x_demux_check_extension (mrl, "m2ts mts"))
- hdmv = 1;
- else
- hdmv = 0;
-
- /* check extension */
- const char *const extensions = class_gen->get_extensions (class_gen);
-
- if (_x_demux_check_extension (mrl, extensions))
- break;
-
- /* accept dvb streams */
- /*
- * Also handle the special dvbs,dvbt and dvbc mrl formats:
- * the content is exactly the same but the input plugin
- * uses a different tuning algorithm [Pragma]
- */
-
- if (!strncasecmp (mrl, "dvb://", 6))
- break;
- if (!strncasecmp (mrl, "dvbs://", 7))
- break;
- if (!strncasecmp (mrl, "dvbc://", 7))
- break;
- if (!strncasecmp (mrl, "dvbt://", 7))
- break;
-
- return NULL;
- }
-
+ case METHOD_BY_MRL:
case METHOD_EXPLICIT:
break;
@@ -2660,6 +2615,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
this = calloc(1, sizeof(*this));
this->stream = stream;
this->input = input;
+ this->class = (demux_ts_class_t*)class_gen;
this->demux_plugin.send_headers = demux_ts_send_headers;
this->demux_plugin.send_chunk = demux_ts_send_chunk;
@@ -2720,30 +2676,6 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
/*
* ts demuxer class
*/
-
-static const char *get_description (demux_class_t *this_gen) {
- return "MPEG Transport Stream demuxer";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "MPEG_TS";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "ts m2t trp m2ts mts";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "video/mp2t: m2t: MPEG2 transport stream;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
-
- demux_ts_class_t *this = (demux_ts_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_ts_class_t *this;
@@ -2753,11 +2685,18 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("MPEG Transport Stream demuxer");
+ this->demux_class.identifier = "MPEG_TS";
+ this->demux_class.mimetypes = "video/mp2t: m2t: MPEG2 transport stream;";
+
+ /* accept dvb streams; also handle the special dvbs,dvbt and dvbc
+ * mrl formats: the content is exactly the same but the input plugin
+ * uses a different tuning algorithm [Pragma]
+ */
+ this->demux_class.extensions = "ts m2t trp m2ts mts dvb:// dvbs:// dvbc:// dvbt://";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ this->av_crc = av_crc_get_table(AV_CRC_32_IEEE);
return this;
}
@@ -2772,7 +2711,7 @@ static const demuxer_info_t demux_info_ts = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "mpeg-ts", XINE_VERSION_CODE, &demux_info_ts, init_class },
+ { PLUGIN_DEMUX, 27, "mpeg-ts", XINE_VERSION_CODE, &demux_info_ts, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c
index cf3745211..1a2f5ca27 100644
--- a/src/demuxers/demux_tta.c
+++ b/src/demuxers/demux_tta.c
@@ -34,12 +34,13 @@
// http://www.true-audio.com/TTA_Lossless_Audio_Codec_-_Format_Description
#define FRAME_TIME 1.04489795918367346939
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
+#include <xine/attributes.h>
typedef struct {
demux_plugin_t demux_plugin;
@@ -75,16 +76,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_is_fourcc(peek, "TTA1") )
+ if ( !_x_is_fourcc(&peek, "TTA1") )
return 0;
if ( this->input->read(this->input, this->header.buffer, sizeof(this->header)) != sizeof(this->header) )
@@ -99,7 +98,7 @@ static int open_tta_file(demux_tta_t *this) {
return 0;
}
- this->seektable = calloc(this->totalframes, sizeof(uint32_t));
+ this->seektable = xine_xcalloc(this->totalframes, sizeof(uint32_t));
this->input->read(this->input, (uint8_t*)this->seektable, sizeof(uint32_t)*this->totalframes);
/* Skip the CRC32 */
@@ -301,19 +300,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* Falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
if (!open_tta_file(this)) {
@@ -330,40 +317,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "True Audio demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "True Audio";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "tta";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-tta: tta: True Audio;"
- "audio/tta: tta: True Audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_tta_class_t *this = (demux_tta_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_tta_init_plugin (xine_t *xine, void *data) {
demux_tta_class_t *this;
this = calloc(1, sizeof(demux_tta_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("True Audio demux plugin");
+ this->demux_class.identifier = "True Audio";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "tta";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_vc1es.c b/src/demuxers/demux_vc1es.c
new file mode 100644
index 000000000..8896ea906
--- /dev/null
+++ b/src/demuxers/demux_vc1es.c
@@ -0,0 +1,406 @@
+/*
+ * Copyright (C) 2008 the xine project
+ * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
+ *
+ * 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, USA
+ */
+
+/*
+ * demultiplexer for wmv9/vc1 elementary streams
+ *
+ *
+ * SMP (.rcv) format:
+ *
+ * ** header ***
+ * le24 number of frames
+ * C5 04 00 00 00
+ * 4 bytes sequence header
+ * le32 height
+ * le32 width
+ * 0C 00 00 00
+ * 8 bytes unknown
+ * le32 fps
+ * ************
+ * le24 frame_size
+ * 80
+ * le32 pts (ms)
+ * frame_size bytes of picture data
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <string.h>
+
+/* #define LOG */
+#define LOG_MODULE "demux_vc1es"
+#define LOG_VERBOSE
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
+#include "bswap.h"
+
+#define SCRATCH_SIZE 36
+#define PRIVATE_SIZE 44
+
+#define MODE_SMP 1
+#define MODE_AP 2
+
+
+
+typedef struct {
+ demux_plugin_t demux_plugin;
+
+ xine_stream_t *stream;
+ fifo_buffer_t *video_fifo;
+ fifo_buffer_t *audio_fifo;
+ input_plugin_t *input;
+ int status;
+ int mode;
+ int first_chunk;
+ uint8_t private[PRIVATE_SIZE];
+ uint32_t video_step;
+
+ uint32_t blocksize;
+} demux_vc1_es_t ;
+
+
+
+typedef struct {
+ demux_class_t demux_class;
+} demux_vc1_es_class_t;
+
+
+
+static int demux_vc1_es_next_smp( demux_vc1_es_t *this )
+{
+ buf_element_t *buf;
+ uint32_t pts=0, frame_size=0;
+ off_t done;
+ uint8_t head[SCRATCH_SIZE];
+ int start_flag = 1;
+
+ if ( this->first_chunk ) {
+ this->input->read( this->input, head, SCRATCH_SIZE );
+ this->first_chunk = 0;
+ }
+
+ done = this->input->read( this->input, head, 8 );
+ frame_size = _X_LE_24( head );
+ pts = _X_LE_32( head+4 );
+
+ done = 0;
+ while ( frame_size>0 ) {
+ buf = this->video_fifo->buffer_pool_alloc(this->video_fifo);
+ off_t read = (frame_size>buf->max_size) ? buf->max_size : frame_size;
+ done = this->input->read( this->input, buf->mem, read );
+ if ( done<=0 ) {
+ buf->free_buffer( buf );
+ this->status = DEMUX_FINISHED;
+ return 0;
+ }
+ buf->size = done;
+ buf->content = buf->mem;
+ buf->type = BUF_VIDEO_WMV9;
+ buf->pts = pts*90;
+ frame_size -= done;
+ if ( start_flag ) {
+ buf->decoder_flags = BUF_FLAG_FRAME_START;
+ start_flag = 0;
+ }
+ if ( !(frame_size>0) )
+ buf->decoder_flags = BUF_FLAG_FRAME_END;
+ this->video_fifo->put(this->video_fifo, buf);
+ }
+
+ return 1;
+}
+
+
+
+static int demux_vc1_es_next_ap( demux_vc1_es_t *this )
+{
+ buf_element_t *buf;
+ uint32_t blocksize;
+ off_t done;
+
+ buf = this->video_fifo->buffer_pool_alloc(this->video_fifo);
+ blocksize = (this->blocksize ? this->blocksize : buf->max_size);
+ done = this->input->read(this->input, buf->mem, blocksize);
+
+ if (done <= 0) {
+ buf->free_buffer (buf);
+ this->status = DEMUX_FINISHED;
+ return 0;
+ }
+
+ buf->size = done;
+ buf->content = buf->mem;
+ buf->pts = 0;
+ buf->type = BUF_VIDEO_VC1;
+
+ if( this->input->get_length (this->input) )
+ buf->extra_info->input_normpos = (int)( (double)this->input->get_current_pos( this->input )*65535/this->input->get_length( this->input ) );
+
+ this->video_fifo->put(this->video_fifo, buf);
+
+ return 1;
+}
+
+
+
+static int demux_vc1_es_send_chunk( demux_plugin_t *this_gen )
+{
+ demux_vc1_es_t *this = (demux_vc1_es_t *) this_gen;
+
+ if ( this->mode==MODE_SMP ) {
+ if (!demux_vc1_es_next_smp(this))
+ this->status = DEMUX_FINISHED;
+ return this->status;
+ }
+
+ if (!demux_vc1_es_next_ap(this))
+ this->status = DEMUX_FINISHED;
+ return this->status;
+}
+
+
+
+static int demux_vc1_es_get_status( demux_plugin_t *this_gen )
+{
+ demux_vc1_es_t *this = (demux_vc1_es_t *) this_gen;
+
+ return this->status;
+}
+
+
+
+static void demux_vc1_es_send_headers( demux_plugin_t *this_gen )
+{
+ demux_vc1_es_t *this = (demux_vc1_es_t *) this_gen;
+
+ this->video_fifo = this->stream->video_fifo;
+ this->audio_fifo = this->stream->audio_fifo;
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 1);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 0);
+ _x_demux_control_start(this->stream);
+ this->blocksize = this->input->get_blocksize(this->input);
+ this->status = DEMUX_OK;
+
+ if ( this->mode==MODE_SMP ) {
+ buf_element_t *buf;
+ buf = this->video_fifo->buffer_pool_alloc(this->video_fifo);
+ xine_fast_memcpy( buf->mem, this->private, PRIVATE_SIZE );
+ buf->size = PRIVATE_SIZE;
+ buf->content = buf->mem;
+ buf->decoder_flags = BUF_FLAG_HEADER|BUF_FLAG_STDHEADER|BUF_FLAG_FRAME_END;
+ if ( this->video_step ) {
+ buf->decoder_flags |= BUF_FLAG_FRAMERATE;
+ buf->decoder_info[0] = 90000/this->video_step;
+ }
+ buf->type = BUF_VIDEO_WMV9;
+ this->video_fifo->put(this->video_fifo, buf);
+ }
+}
+
+
+
+static int demux_vc1_es_seek( demux_plugin_t *this_gen, off_t start_pos, int start_time, int playing )
+{
+ demux_vc1_es_t *this = (demux_vc1_es_t *) this_gen;
+
+ if ( this->mode==MODE_SMP ) {
+ this->status = DEMUX_OK;
+ return this->status;
+ }
+
+ start_pos = (off_t) ( (double) start_pos / 65535 *
+ this->input->get_length (this->input) );
+
+ this->status = DEMUX_OK;
+
+ if (playing)
+ _x_demux_flush_engine(this->stream);
+
+ if (INPUT_IS_SEEKABLE(this->input)) {
+
+ /* FIXME: implement time seek */
+
+ if (start_pos != this->input->seek (this->input, start_pos, SEEK_SET)) {
+ this->status = DEMUX_FINISHED;
+ return this->status;
+ }
+ lprintf ("seeking to %"PRId64"\n", start_pos);
+ }
+
+ /*
+ * now start demuxing
+ */
+ this->status = DEMUX_OK;
+
+ return this->status;
+}
+
+
+
+static void demux_vc1_es_dispose( demux_plugin_t *this )
+{
+ free (this);
+}
+
+
+
+static int demux_vc1_es_get_stream_length( demux_plugin_t *this_gen )
+{
+ return 0 ; /*FIXME: implement */
+}
+
+
+
+static uint32_t demux_vc1_es_get_capabilities( demux_plugin_t *this_gen )
+{
+ return DEMUX_CAP_NOCAP;
+}
+
+
+
+static int demux_vc1_es_get_optional_data( demux_plugin_t *this_gen, void *data, int data_type )
+{
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+}
+
+
+
+static demux_plugin_t *open_plugin( demux_class_t *class_gen, xine_stream_t *stream, input_plugin_t *input )
+{
+
+ demux_vc1_es_t *this;
+ uint8_t scratch[SCRATCH_SIZE];
+ int i, read, found=0;
+
+ switch (stream->content_detection_method) {
+
+ case METHOD_BY_CONTENT: {
+ read = _x_demux_read_header(input, scratch, SCRATCH_SIZE);
+ if (!read)
+ return NULL;
+ lprintf("read size =%d\n",read);
+
+ /* simple and main profiles */
+ if ( read>=SCRATCH_SIZE ) {
+ lprintf("searching for rcv format..\n");
+ if ( scratch[3]==0xc5 && scratch[4]==4 && scratch[5]==0 && scratch[6]==0 && scratch[7]==0 && scratch[20]==0x0c && scratch[21]==0 && scratch[22]==0 && scratch[23]==0 ) {
+ lprintf("rcv format found\n");
+ found = MODE_SMP;
+ }
+ }
+
+ if ( found==0 ) {
+ /* advanced profile */
+ for (i = 0; i < read-4; i++) {
+ lprintf ("%02x %02x %02x %02x\n", scratch[i], scratch[i+1], scratch[i+2], scratch[i+3]);
+ if ((scratch[i] == 0x00) && (scratch[i+1] == 0x00) && (scratch[i+2] == 0x01)) {
+ if (scratch[i+3] == 0x0f) {
+ found = MODE_AP;
+ lprintf ("found header at offset 0x%x\n", i);
+ break;
+ }
+ }
+ }
+ }
+
+ if (found == 0)
+ return NULL;
+ lprintf ("input accepted.\n");
+ }
+ break;
+
+ case METHOD_BY_MRL:
+ case METHOD_EXPLICIT:
+ break;
+
+ default:
+ return NULL;
+ }
+
+ this = calloc(1, sizeof(demux_vc1_es_t));
+ this->mode = found;
+ this->first_chunk = 1;
+ if ( found==MODE_SMP ) {
+ xine_fast_memcpy( this->private+8, scratch+12, 4 ); /* height */
+ xine_fast_memcpy( this->private+4, scratch+16, 4 ); /* width */
+ xine_fast_memcpy( this->private+40, scratch+8, 4 ); /* sequence header */
+ this->video_step = _X_LE_32( scratch+32 );
+ }
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_vc1_es_send_headers;
+ this->demux_plugin.send_chunk = demux_vc1_es_send_chunk;
+ this->demux_plugin.seek = demux_vc1_es_seek;
+ this->demux_plugin.dispose = demux_vc1_es_dispose;
+ this->demux_plugin.get_status = demux_vc1_es_get_status;
+ this->demux_plugin.get_stream_length = demux_vc1_es_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_vc1_es_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_vc1_es_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->status = DEMUX_FINISHED;
+
+ return &this->demux_plugin;
+}
+
+
+
+static void *init_plugin( xine_t *xine, void *data )
+{
+ demux_vc1_es_class_t *this;
+
+ this = calloc(1, sizeof(demux_vc1_es_class_t));
+
+ this->demux_class.open_plugin = open_plugin;
+ this->demux_class.description = N_("VC1 elementary stream demux plugin");
+ this->demux_class.identifier = "VC1_ES";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ return this;
+}
+
+
+/*
+ * exported plugin catalog entry
+ */
+static const demuxer_info_t demux_info_vc1es = {
+ 0 /* priority */
+};
+
+
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_DEMUX, 27, "vc1es", XINE_VERSION_CODE, &demux_info_vc1es, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/demuxers/demux_vmd.c b/src/demuxers/demux_vmd.c
index b3d7c95b8..1bd052c10 100644
--- a/src/demuxers/demux_vmd.c
+++ b/src/demuxers/demux_vmd.c
@@ -45,10 +45,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -389,12 +389,6 @@ static int demux_vmd_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_vmd_dispose (demux_plugin_t *this_gen) {
- demux_vmd_t *this = (demux_vmd_t *) this_gen;
-
- free(this);
-}
-
static int demux_vmd_get_status (demux_plugin_t *this_gen) {
demux_vmd_t *this = (demux_vmd_t *) this_gen;
@@ -428,7 +422,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_vmd_send_headers;
this->demux_plugin.send_chunk = demux_vmd_send_chunk;
this->demux_plugin.seek = demux_vmd_seek;
- this->demux_plugin.dispose = demux_vmd_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_vmd_get_status;
this->demux_plugin.get_stream_length = demux_vmd_get_stream_length;
this->demux_plugin.get_capabilities = demux_vmd_get_capabilities;
@@ -439,19 +433,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -470,39 +452,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Sierra VMD file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "VMD";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "vmd";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_vmd_class_t *this = (demux_vmd_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_vmd_init_plugin (xine_t *xine, void *data) {
demux_vmd_class_t *this;
this = calloc(1, sizeof(demux_vmd_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Sierra VMD file demux plugin");
+ this->demux_class.identifier = "VMD";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "vmd";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c
index 1ddbc1727..0e4b736be 100644
--- a/src/demuxers/demux_voc.c
+++ b/src/demuxers/demux_voc.c
@@ -37,10 +37,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -263,12 +263,6 @@ static int demux_voc_seek (demux_plugin_t *this_gen, off_t start_pos, int start_
return this->status;
}
-static void demux_voc_dispose (demux_plugin_t *this_gen) {
- demux_voc_t *this = (demux_voc_t *) this_gen;
-
- free(this);
-}
-
static int demux_voc_get_status (demux_plugin_t *this_gen) {
demux_voc_t *this = (demux_voc_t *) this_gen;
@@ -303,7 +297,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_voc_send_headers;
this->demux_plugin.send_chunk = demux_voc_send_chunk;
this->demux_plugin.seek = demux_voc_seek;
- this->demux_plugin.dispose = demux_voc_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_voc_get_status;
this->demux_plugin.get_stream_length = demux_voc_get_stream_length;
this->demux_plugin.get_capabilities = demux_voc_get_capabilities;
@@ -314,19 +308,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -345,39 +327,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "VOC file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "VOC";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "voc";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_voc_class_t *this = (demux_voc_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_voc_init_plugin (xine_t *xine, void *data) {
demux_voc_class_t *this;
this = calloc(1, sizeof(demux_voc_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("VOC file demux plugin");
+ this->demux_class.identifier = "VOC";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "voc";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c
index ccf9bf877..2d33952b4 100644
--- a/src/demuxers/demux_vox.c
+++ b/src/demuxers/demux_vox.c
@@ -34,10 +34,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -150,12 +150,6 @@ static int demux_vox_seek (demux_plugin_t *this_gen, off_t start_pos, int start_
return this->status;
}
-static void demux_vox_dispose (demux_plugin_t *this_gen) {
- demux_vox_t *this = (demux_vox_t *) this_gen;
-
- free(this);
-}
-
static int demux_vox_get_status (demux_plugin_t *this_gen) {
demux_vox_t *this = (demux_vox_t *) this_gen;
@@ -187,17 +181,11 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
case METHOD_BY_CONTENT:
- case METHOD_EXPLICIT:
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
+ return NULL;
- if (!_x_demux_check_extension (mrl, extensions))
- return NULL;
- }
- break;
+ case METHOD_EXPLICIT:
+ case METHOD_BY_MRL:
+ break;
default:
return NULL;
@@ -210,7 +198,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_vox_send_headers;
this->demux_plugin.send_chunk = demux_vox_send_chunk;
this->demux_plugin.seek = demux_vox_seek;
- this->demux_plugin.dispose = demux_vox_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_vox_get_status;
this->demux_plugin.get_stream_length = demux_vox_get_stream_length;
this->demux_plugin.get_capabilities = demux_vox_get_capabilities;
@@ -222,39 +210,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Dialogic VOX file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "VOX";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "vox";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_vox_class_t *this = (demux_vox_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_vox_init_plugin (xine_t *xine, void *data) {
demux_vox_class_t *this;
this = calloc(1, sizeof(demux_vox_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Dialogic VOX file demux plugin");
+ this->demux_class.identifier = "VOX";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "vox";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c
index 7582eea0e..6980c6e1a 100644
--- a/src/demuxers/demux_vqa.c
+++ b/src/demuxers/demux_vqa.c
@@ -40,10 +40,10 @@
#include <string.h>
#include <stdlib.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -303,12 +303,6 @@ static int demux_vqa_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_vqa_dispose (demux_plugin_t *this_gen) {
- demux_vqa_t *this = (demux_vqa_t *) this_gen;
-
- free(this);
-}
-
static int demux_vqa_get_status (demux_plugin_t *this_gen) {
demux_vqa_t *this = (demux_vqa_t *) this_gen;
@@ -340,7 +334,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_vqa_send_headers;
this->demux_plugin.send_chunk = demux_vqa_send_chunk;
this->demux_plugin.seek = demux_vqa_seek;
- this->demux_plugin.dispose = demux_vqa_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_vqa_get_status;
this->demux_plugin.get_stream_length = demux_vqa_get_stream_length;
this->demux_plugin.get_capabilities = demux_vqa_get_capabilities;
@@ -351,19 +345,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -382,39 +364,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Westwood Studios VQA file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "VQA";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "vqa";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_vqa_class_t *this = (demux_vqa_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_vqa_init_plugin (xine_t *xine, void *data) {
demux_vqa_class_t *this;
this = calloc(1, sizeof(demux_vqa_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Westwood Studios VQA file demux plugin");
+ this->demux_class.identifier = "VQA";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "vqa";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c
index 99c50ad67..39e96be26 100644
--- a/src/demuxers/demux_wav.c
+++ b/src/demuxers/demux_wav.c
@@ -34,10 +34,10 @@
#include <stdlib.h>
#include <ctype.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#include "bswap.h"
#include "group_audio.h"
@@ -386,19 +386,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -426,42 +414,21 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "WAV file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "WAV";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "wav";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return "audio/x-wav: wav: WAV audio;"
- "audio/wav: wav: WAV audio;"
- "audio/x-pn-wav: wav: WAV audio;"
- "audio/x-pn-windows-acm: wav: WAV audio;";
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_wav_class_t *this = (demux_wav_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_wav_init_plugin (xine_t *xine, void *data) {
demux_wav_class_t *this;
this = calloc(1, sizeof(demux_wav_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("WAV file demux plugin");
+ this->demux_class.identifier = "WAV";
+ this->demux_class.mimetypes =
+ "audio/x-wav: wav: WAV audio;"
+ "audio/wav: wav: WAV audio;"
+ "audio/x-pn-wav: wav: WAV audio;"
+ "audio/x-pn-windows-acm: wav: WAV audio;";
+ this->demux_class.extensions = "wav";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c
index 3b310e90c..db115fe07 100644
--- a/src/demuxers/demux_wc3movie.c
+++ b/src/demuxers/demux_wc3movie.c
@@ -42,10 +42,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#include "group_games.h"
@@ -377,15 +377,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 = calloc(this->number_of_shots, sizeof(off_t));
+ this->shot_offsets = xine_xcalloc(this->number_of_shots, sizeof(off_t));
this->current_shot = 0;
/* skip the SOND chunk */
this->input->seek(this->input, 12, SEEK_CUR);
/* load the palette chunks */
- this->palettes = calloc(this->number_of_shots, PALETTE_SIZE *
- sizeof(palette_entry_t));
+ this->palettes = xine_xcalloc(this->number_of_shots, PALETTE_SIZE *
+ sizeof(palette_entry_t));
if (!this->shot_offsets || !this->palettes) {
free (this->shot_offsets);
@@ -689,19 +689,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *extensions, *mrl;
-
- mrl = input->get_mrl (input);
- extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -720,39 +708,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "Wing Commander III Movie (MVE) demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "WC3 Movie";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "mve";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_mve_class_t *this = (demux_mve_class_t *) this_gen;
-
- free (this);
-}
-
void *demux_wc3movie_init_plugin (xine_t *xine, void *data) {
demux_mve_class_t *this;
this = calloc(1, sizeof(demux_mve_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("Wing Commander III Movie (MVE) demux plugin");
+ this->demux_class.identifier = "WC3 Movie";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "mve";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c
index aa1a4dff6..e8877057c 100644
--- a/src/demuxers/demux_yuv4mpeg2.c
+++ b/src/demuxers/demux_yuv4mpeg2.c
@@ -36,10 +36,10 @@
#include <string.h>
#include <stdlib.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/demux.h>
#include "bswap.h"
#define Y4M_SIGNATURE_SIZE 9
@@ -355,12 +355,6 @@ static int demux_yuv4mpeg2_seek (demux_plugin_t *this_gen,
return this->status;
}
-static void demux_yuv4mpeg2_dispose (demux_plugin_t *this_gen) {
- demux_yuv4mpeg2_t *this = (demux_yuv4mpeg2_t *) this_gen;
-
- free(this);
-}
-
static int demux_yuv4mpeg2_get_status (demux_plugin_t *this_gen) {
demux_yuv4mpeg2_t *this = (demux_yuv4mpeg2_t *) this_gen;
@@ -392,7 +386,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
this->demux_plugin.send_headers = demux_yuv4mpeg2_send_headers;
this->demux_plugin.send_chunk = demux_yuv4mpeg2_send_chunk;
this->demux_plugin.seek = demux_yuv4mpeg2_seek;
- this->demux_plugin.dispose = demux_yuv4mpeg2_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_yuv4mpeg2_get_status;
this->demux_plugin.get_stream_length = demux_yuv4mpeg2_get_stream_length;
this->demux_plugin.get_capabilities = demux_yuv4mpeg2_get_capabilities;
@@ -403,17 +397,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION: {
- const char *const mrl = input->get_mrl (input);
- const char *const extensions = class_gen->get_extensions (class_gen);
-
- if (!_x_demux_check_extension (mrl, extensions)) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
+ case METHOD_BY_MRL:
case METHOD_BY_CONTENT:
case METHOD_EXPLICIT:
@@ -432,39 +416,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return &this->demux_plugin;
}
-static const char *get_description (demux_class_t *this_gen) {
- return "YUV4MPEG2 file demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "YUV4MPEG2";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return "y4m";
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_yuv4mpeg2_class_t *this = (demux_yuv4mpeg2_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
demux_yuv4mpeg2_class_t *this;
this = calloc(1, sizeof(demux_yuv4mpeg2_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("YUV4MPEG2 file demux plugin");
+ this->demux_class.identifier = "YUV4MPEG2";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "y4m";
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -478,6 +440,6 @@ static const demuxer_info_t demux_info_yuv4mpeg2 = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "yuv4mpeg2", XINE_VERSION_CODE, &demux_info_yuv4mpeg2, init_plugin },
+ { PLUGIN_DEMUX, 27, "yuv4mpeg2", XINE_VERSION_CODE, &demux_info_yuv4mpeg2, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c
index 81dd2b03a..e8e893874 100644
--- a/src/demuxers/demux_yuv_frames.c
+++ b/src/demuxers/demux_yuv_frames.c
@@ -39,9 +39,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#define WRAP_THRESHOLD 20000
@@ -167,12 +167,6 @@ static int demux_yuv_frames_get_optional_data(demux_plugin_t *this_gen,
return DEMUX_OPTIONAL_UNSUPPORTED;
}
-static void demux_yuv_frames_dispose (demux_plugin_t *this_gen) {
- demux_yuv_frames_t *this = (demux_yuv_frames_t *) this_gen;
-
- free (this);
-}
-
static demux_plugin_t *open_plugin (demux_class_t *class_gen,
xine_stream_t *stream,
input_plugin_t *input) {
@@ -185,7 +179,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
return NULL;
break;
- case METHOD_BY_EXTENSION: {
+ case METHOD_BY_MRL: {
const char *const mrl = input->get_mrl (input);
if (strncmp (mrl, "v4l:/", 5))
@@ -213,7 +207,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
this->demux_plugin.send_headers = demux_yuv_frames_send_headers;
this->demux_plugin.send_chunk = demux_yuv_frames_send_chunk;
this->demux_plugin.seek = demux_yuv_frames_seek;
- this->demux_plugin.dispose = demux_yuv_frames_dispose;
+ this->demux_plugin.dispose = default_demux_plugin_dispose;
this->demux_plugin.get_status = demux_yuv_frames_get_status;
this->demux_plugin.get_stream_length = demux_yuv_frames_get_stream_length;
this->demux_plugin.get_capabilities = demux_yuv_frames_get_capabilities;
@@ -230,40 +224,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
/*
* demuxer class
*/
-
-static const char *get_description (demux_class_t *this_gen) {
- return "YUV frames dummy demux plugin";
-}
-
-static const char *get_identifier (demux_class_t *this_gen) {
- return "YUV_FRAMES";
-}
-
-static const char *get_extensions (demux_class_t *this_gen) {
- return NULL;
-}
-
-static const char *get_mimetypes (demux_class_t *this_gen) {
- return NULL;
-}
-
-static void class_dispose (demux_class_t *this_gen) {
- demux_yuv_frames_class_t *this = (demux_yuv_frames_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
demux_yuv_frames_class_t *this;
this = calloc(1, sizeof(demux_yuv_frames_class_t));
this->demux_class.open_plugin = open_plugin;
- this->demux_class.get_description = get_description;
- this->demux_class.get_identifier = get_identifier;
- this->demux_class.get_mimetypes = get_mimetypes;
- this->demux_class.get_extensions = get_extensions;
- this->demux_class.dispose = class_dispose;
+ this->demux_class.description = N_("YUV frames dummy demux plugin");
+ this->demux_class.identifier = "YUV_FRAMES";
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = NULL;
+ this->demux_class.dispose = default_demux_class_dispose;
return this;
}
@@ -277,7 +248,7 @@ static const demuxer_info_t demux_info_yuv_frames = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "yuv_frames", XINE_VERSION_CODE, &demux_info_yuv_frames, init_class },
+ { PLUGIN_DEMUX, 27, "yuv_frames", XINE_VERSION_CODE, &demux_info_yuv_frames, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/ebml.c b/src/demuxers/ebml.c
index ce53e6c8a..c979d290d 100644
--- a/src/demuxers/ebml.c
+++ b/src/demuxers/ebml.c
@@ -31,8 +31,8 @@
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#include "ebml.h"
@@ -41,20 +41,10 @@
ebml_parser_t *new_ebml_parser (xine_t *xine, input_plugin_t *input) {
ebml_parser_t *ebml;
- ebml = malloc(sizeof(ebml_parser_t));
+ ebml = xine_xmalloc(sizeof(ebml_parser_t));
ebml->xine = xine;
ebml->input = input;
- ebml->version = 0;
- ebml->read_version = 0;
- ebml->max_id_len = 0;
- ebml->max_size_len = 0;
- ebml->doctype = NULL;
- ebml->doctype_version = 0;
- ebml->doctype_read_version = 0;
-
- ebml->level = 0;
-
return ebml;
}
@@ -185,7 +175,7 @@ static int ebml_read_elem_len(ebml_parser_t *ebml, uint64_t *len) {
}
-static int ebml_read_elem_data(ebml_parser_t *ebml, int8_t *buf, int64_t len) {
+static int ebml_read_elem_data(ebml_parser_t *ebml, void *buf, int64_t len) {
if (ebml->input->read(ebml->input, buf, len) != len) {
off_t pos = ebml->input->get_current_pos(ebml->input);
@@ -243,6 +233,7 @@ int ebml_read_uint(ebml_parser_t *ebml, ebml_elem_t *elem, uint64_t *num) {
return 1;
}
+#if 0
int ebml_read_sint (ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *num) {
uint8_t data[8];
uint64_t size = elem->len;
@@ -269,6 +260,7 @@ int ebml_read_sint (ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *num) {
return 1;
}
+#endif
int ebml_read_float (ebml_parser_t *ebml, ebml_elem_t *elem, double *num) {
@@ -313,9 +305,11 @@ int ebml_read_ascii(ebml_parser_t *ebml, ebml_elem_t *elem, char *str) {
return 1;
}
+#if 0
int ebml_read_utf8 (ebml_parser_t *ebml, ebml_elem_t *elem, char *str) {
return ebml_read_ascii (ebml, elem, str);
}
+#endif
char *ebml_alloc_read_ascii (ebml_parser_t *ebml, ebml_elem_t *elem)
{
@@ -333,41 +327,40 @@ char *ebml_alloc_read_ascii (ebml_parser_t *ebml, ebml_elem_t *elem)
return NULL;
}
+#if 0
int ebml_read_date (ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *date) {
return ebml_read_sint (ebml, elem, date);
}
+#endif
int ebml_read_master (ebml_parser_t *ebml, ebml_elem_t *elem) {
ebml_elem_t *top_elem;
- if (ebml->level >= 0) {
- top_elem = &ebml->elem_stack[ebml->level];
- top_elem->start = elem->start;
- top_elem->len = elem->len;
- top_elem->id = elem->id;
-
- ebml->level++;
- lprintf("id: 0x%x, len: %" PRIu64 ", level: %d\n", elem->id, elem->len, ebml->level);
- if (ebml->level >= EBML_STACK_SIZE) {
- xprintf(ebml->xine, XINE_VERBOSITY_LOG,
- "ebml: max level exceeded\n");
- return 0;
- }
- return 1;
- } else {
+ if (ebml->level < 0) {
xprintf(ebml->xine, XINE_VERBOSITY_LOG,
"ebml: invalid current level\n");
return 0;
}
-}
-int ebml_read_binary(ebml_parser_t *ebml, ebml_elem_t *elem, uint8_t *binary) {
- if (!ebml_read_elem_data(ebml, binary, elem->len))
- return 0;
+ top_elem = &ebml->elem_stack[ebml->level];
+ top_elem->start = elem->start;
+ top_elem->len = elem->len;
+ top_elem->id = elem->id;
+ ebml->level++;
+ lprintf("id: 0x%x, len: %" PRIu64 ", level: %d\n", elem->id, elem->len, ebml->level);
+ if (ebml->level >= EBML_STACK_SIZE) {
+ xprintf(ebml->xine, XINE_VERBOSITY_LOG,
+ "ebml: max level exceeded\n");
+ return 0;
+ }
return 1;
}
+int ebml_read_binary(ebml_parser_t *ebml, ebml_elem_t *elem, void *binary) {
+ return !!ebml_read_elem_data(ebml, binary, elem->len);
+}
+
int ebml_check_header(ebml_parser_t *ebml) {
uint32_t next_level;
ebml_elem_t master;
diff --git a/src/demuxers/ebml.h b/src/demuxers/ebml.h
index 6d750a98c..65db6c229 100644
--- a/src/demuxers/ebml.h
+++ b/src/demuxers/ebml.h
@@ -83,20 +83,26 @@ int ebml_skip(ebml_parser_t *ebml, ebml_elem_t *elem);
/* EBML types */
int ebml_read_uint(ebml_parser_t *ebml, ebml_elem_t *elem, uint64_t *val);
+#if 0
int ebml_read_sint(ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *val);
+#endif
int ebml_read_float(ebml_parser_t *ebml, ebml_elem_t *elem, double *val);
int ebml_read_ascii(ebml_parser_t *ebml, ebml_elem_t *elem, char *str);
+#if 0
int ebml_read_utf8(ebml_parser_t *ebml, ebml_elem_t *elem, char *str);
+#endif
char *ebml_alloc_read_ascii(ebml_parser_t *ebml, ebml_elem_t *elem);
+#if 0
int ebml_read_date(ebml_parser_t *ebml, ebml_elem_t *elem, int64_t *date);
+#endif
int ebml_read_master(ebml_parser_t *ebml, ebml_elem_t *elem);
-int ebml_read_binary(ebml_parser_t *ebml, ebml_elem_t *elem, uint8_t *binary);
+int ebml_read_binary(ebml_parser_t *ebml, ebml_elem_t *elem, void *binary);
#endif /* EBML_H */
diff --git a/src/demuxers/group_audio.c b/src/demuxers/group_audio.c
index f405d0292..fe03b6418 100644
--- a/src/demuxers/group_audio.c
+++ b/src/demuxers/group_audio.c
@@ -24,8 +24,8 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
#include "group_audio.h"
@@ -42,7 +42,7 @@ static const demuxer_info_t demux_info_ac3 = {
};
static const demuxer_info_t demux_info_aud = {
- 10 /* priority */
+ -2 /* priority */
};
static const demuxer_info_t demux_info_aiff = {
@@ -69,12 +69,6 @@ static const demuxer_info_t demux_info_mpc = {
1 /* priority */
};
-#ifdef HAVE_NOSEFART
-static const demuxer_info_t demux_info_nsf = {
- 10 /* priority */
-};
-#endif
-
static const demuxer_info_t demux_info_realaudio = {
10 /* priority */
};
@@ -103,35 +97,23 @@ 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 },
- { PLUGIN_DEMUX, 26, "ac3", XINE_VERSION_CODE, &demux_info_ac3, demux_ac3_init_plugin },
- { PLUGIN_DEMUX, 26, "aud", XINE_VERSION_CODE, &demux_info_aud, demux_aud_init_plugin },
- { PLUGIN_DEMUX, 26, "aiff", XINE_VERSION_CODE, &demux_info_aiff, demux_aiff_init_plugin },
- { PLUGIN_DEMUX, 26, "cdda", XINE_VERSION_CODE, &demux_info_cdda, demux_cdda_init_plugin },
- { PLUGIN_DEMUX, 26, "dts", XINE_VERSION_CODE, &demux_info_dts, demux_dts_init_plugin },
- { 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 },
-#ifdef HAVE_NOSEFART
- { PLUGIN_DEMUX, 26, "nsf", XINE_VERSION_CODE, &demux_info_nsf, demux_nsf_init_plugin },
-#endif
- { 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 },
- { PLUGIN_DEMUX, 26, "tta", XINE_VERSION_CODE, &demux_info_tta, demux_tta_init_plugin },
- { 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_DEMUX, 27, "aac", XINE_VERSION_CODE, &demux_info_aac, demux_aac_init_plugin },
+ { PLUGIN_DEMUX, 27, "ac3", XINE_VERSION_CODE, &demux_info_ac3, demux_ac3_init_plugin },
+ { PLUGIN_DEMUX, 27, "aud", XINE_VERSION_CODE, &demux_info_aud, demux_aud_init_plugin },
+ { PLUGIN_DEMUX, 27, "aiff", XINE_VERSION_CODE, &demux_info_aiff, demux_aiff_init_plugin },
+ { PLUGIN_DEMUX, 27, "cdda", XINE_VERSION_CODE, &demux_info_cdda, demux_cdda_init_plugin },
+ { PLUGIN_DEMUX, 27, "dts", XINE_VERSION_CODE, &demux_info_dts, demux_dts_init_plugin },
+ { PLUGIN_DEMUX, 27, "flac", XINE_VERSION_CODE, &demux_info_flac, demux_flac_init_plugin },
+ { PLUGIN_DEMUX, 27, "mp3", XINE_VERSION_CODE, &demux_info_mpgaudio, demux_mpgaudio_init_class },
+ { PLUGIN_DEMUX, 27, "mpc", XINE_VERSION_CODE, &demux_info_mpc, demux_mpc_init_plugin },
+ { PLUGIN_DEMUX, 27, "realaudio", XINE_VERSION_CODE, &demux_info_realaudio, demux_realaudio_init_plugin },
+ { PLUGIN_DEMUX, 27, "shn", XINE_VERSION_CODE, &demux_info_shn, demux_shn_init_plugin },
+ { PLUGIN_DEMUX, 27, "snd", XINE_VERSION_CODE, &demux_info_snd, demux_snd_init_plugin },
+ { PLUGIN_DEMUX, 27, "tta", XINE_VERSION_CODE, &demux_info_tta, demux_tta_init_plugin },
+ { PLUGIN_DEMUX, 27, "voc", XINE_VERSION_CODE, &demux_info_voc, demux_voc_init_plugin },
+ { PLUGIN_DEMUX, 27, "vox", XINE_VERSION_CODE, &demux_info_vox, demux_vox_init_plugin },
+ { PLUGIN_DEMUX, 27, "wav", XINE_VERSION_CODE, &demux_info_wav, demux_wav_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/group_audio.h b/src/demuxers/group_audio.h
index d2cd91875..6b48a5400 100644
--- a/src/demuxers/group_audio.h
+++ b/src/demuxers/group_audio.h
@@ -21,7 +21,7 @@
#ifndef HAVE_GROUP_AUDIO_H
#define HAVE_GROUP_AUDIO_H
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
void *demux_aac_init_plugin (xine_t *xine, void *data);
void *demux_ac3_init_plugin (xine_t *xine, void *data);
@@ -40,12 +40,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_NOSEFART
-void *demux_nsf_init_plugin (xine_t *xine, void *data);
-#endif
-
-#ifdef HAVE_MODPLUG
-void *demux_mod_init_plugin (xine_t *xine, void *data);
-#endif
-
#endif
diff --git a/src/demuxers/group_games.c b/src/demuxers/group_games.c
index f08e8477d..5eacbfd8f 100644
--- a/src/demuxers/group_games.c
+++ b/src/demuxers/group_games.c
@@ -24,8 +24,8 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
#include "group_games.h"
@@ -79,16 +79,16 @@ static const demuxer_info_t demux_info_vmd = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "wve", XINE_VERSION_CODE, &demux_info_eawve, demux_eawve_init_plugin},
- { PLUGIN_DEMUX, 26, "idcin", XINE_VERSION_CODE, &demux_info_idcin, demux_idcin_init_plugin },
- { PLUGIN_DEMUX, 26, "ipmovie", XINE_VERSION_CODE, &demux_info_ipmovie, demux_ipmovie_init_plugin },
- { PLUGIN_DEMUX, 26, "vqa", XINE_VERSION_CODE, &demux_info_vqa, demux_vqa_init_plugin },
- { PLUGIN_DEMUX, 26, "wc3movie", XINE_VERSION_CODE, &demux_info_wc3movie, demux_wc3movie_init_plugin },
- { PLUGIN_DEMUX, 26, "roq", XINE_VERSION_CODE, &demux_info_roq, demux_roq_init_plugin },
- { PLUGIN_DEMUX, 26, "str", XINE_VERSION_CODE, &demux_info_str, demux_str_init_plugin },
- { PLUGIN_DEMUX, 26, "film", XINE_VERSION_CODE, &demux_info_film, demux_film_init_plugin },
- { PLUGIN_DEMUX, 26, "smjpeg", XINE_VERSION_CODE, &demux_info_smjpeg, demux_smjpeg_init_plugin },
- { PLUGIN_DEMUX, 26, "fourxm", XINE_VERSION_CODE, &demux_info_fourxm, demux_fourxm_init_plugin },
- { PLUGIN_DEMUX, 26, "vmd", XINE_VERSION_CODE, &demux_info_vmd, demux_vmd_init_plugin },
+ { PLUGIN_DEMUX, 27, "wve", XINE_VERSION_CODE, &demux_info_eawve, demux_eawve_init_plugin},
+ { PLUGIN_DEMUX, 27, "idcin", XINE_VERSION_CODE, &demux_info_idcin, demux_idcin_init_plugin },
+ { PLUGIN_DEMUX, 27, "ipmovie", XINE_VERSION_CODE, &demux_info_ipmovie, demux_ipmovie_init_plugin },
+ { PLUGIN_DEMUX, 27, "vqa", XINE_VERSION_CODE, &demux_info_vqa, demux_vqa_init_plugin },
+ { PLUGIN_DEMUX, 27, "wc3movie", XINE_VERSION_CODE, &demux_info_wc3movie, demux_wc3movie_init_plugin },
+ { PLUGIN_DEMUX, 27, "roq", XINE_VERSION_CODE, &demux_info_roq, demux_roq_init_plugin },
+ { PLUGIN_DEMUX, 27, "str", XINE_VERSION_CODE, &demux_info_str, demux_str_init_plugin },
+ { PLUGIN_DEMUX, 27, "film", XINE_VERSION_CODE, &demux_info_film, demux_film_init_plugin },
+ { PLUGIN_DEMUX, 27, "smjpeg", XINE_VERSION_CODE, &demux_info_smjpeg, demux_smjpeg_init_plugin },
+ { PLUGIN_DEMUX, 27, "fourxm", XINE_VERSION_CODE, &demux_info_fourxm, demux_fourxm_init_plugin },
+ { PLUGIN_DEMUX, 27, "vmd", XINE_VERSION_CODE, &demux_info_vmd, demux_vmd_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/demuxers/group_games.h b/src/demuxers/group_games.h
index ea6b00e75..34cb6e208 100644
--- a/src/demuxers/group_games.h
+++ b/src/demuxers/group_games.h
@@ -21,7 +21,7 @@
#ifndef HAVE_GROUP_GAMES_H
#define HAVE_GROUP_GAMES_H
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
void *demux_eawve_init_plugin(xine_t *xine, void *data);
void *demux_idcin_init_plugin (xine_t *xine, void *data);
diff --git a/src/demuxers/id3.c b/src/demuxers/id3.c
index f11e80e8d..2b433f515 100644
--- a/src/demuxers/id3.c
+++ b/src/demuxers/id3.c
@@ -40,8 +40,8 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#include "id3.h"
@@ -229,17 +229,17 @@ static int id3v2_parse_genre(char* dest, char *src, int len) {
return 1;
}
-static int id3v2_parse_header(input_plugin_t *input, uint8_t *mp3_frame_header,
+static int id3v2_parse_header(input_plugin_t *input, uint32_t id3_signature,
id3v2_header_t *tag_header) {
uint8_t buf[6];
- tag_header->id = _X_BE_32(mp3_frame_header);
+ tag_header->id = be2me_32(id3_signature);
if (input->read (input, buf, 6) == 6) {
tag_header->revision = buf[0];
tag_header->flags = buf[1];
tag_header->size = _X_BE_32_synchsafe(&buf[2]);
- lprintf("tag: ID3 v2.%d.%d\n", mp3_frame_header[3], tag_header->revision);
+ lprintf("tag: ID3 v2.%d.%d\n", tag_header->id & 0xFF, tag_header->revision);
lprintf("flags: %d\n", tag_header->flags);
lprintf("size: %zu\n", tag_header->size);
return 1;
@@ -273,17 +273,11 @@ static int id3v22_parse_frame_header(input_plugin_t *input,
static int id3v22_interp_frame(input_plugin_t *input,
xine_stream_t *stream,
id3v22_frame_header_t *frame_header) {
- char *buf;
- int enc;
const size_t bufsize = frame_header->size + 2;
if ( bufsize < 3 ) /* frames has to be _at least_ 1 byte */
return 0;
-
- buf = malloc(bufsize);
- if (buf == NULL) {
- lprintf("malloc error");
- return 0;
- }
+ char buf[bufsize];
+ int enc;
if (input->read (input, buf, frame_header->size) == frame_header->size) {
buf[frame_header->size] = 0;
@@ -293,7 +287,7 @@ static int id3v22_interp_frame(input_plugin_t *input,
enc = 0;
switch (frame_header->id) {
- case ( FOURCC_TAG(0, 'T', 'C', 'O') ):
+ case ( BE_FOURCC(0, 'T', 'C', 'O') ):
{
char tmp[1024];
@@ -303,27 +297,27 @@ static int id3v22_interp_frame(input_plugin_t *input,
}
break;
- case ( FOURCC_TAG(0, 'T', 'T', '2') ):
+ case ( BE_FOURCC(0, 'T', 'T', '2') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_TITLE, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG(0, 'T', 'P', '1') ):
+ case ( BE_FOURCC(0, 'T', 'P', '1') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_ARTIST, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG(0, 'T', 'A', 'L') ):
+ case ( BE_FOURCC(0, 'T', 'A', 'L') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_ALBUM, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG(0, 'T', 'Y', 'E') ):
+ case ( BE_FOURCC(0, 'T', 'Y', 'E') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_YEAR, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG(0, 'C', 'O', 'M') ):
+ case ( BE_FOURCC(0, 'C', 'O', 'M') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_COMMENT, buf + 1 + 3, id3_encoding[enc]);
break;
- case ( FOURCC_TAG(0, 'T', 'R', 'K') ):
+ case ( BE_FOURCC(0, 'T', 'R', 'K') ):
_x_meta_info_set(stream, XINE_META_INFO_TRACK_NUMBER, buf + 1);
break;
@@ -331,24 +325,22 @@ static int id3v22_interp_frame(input_plugin_t *input,
lprintf("unhandled frame\n");
}
- free(buf);
return 1;
} else {
lprintf("read error\n");
- free(buf);
return 0;
}
}
static int id3v22_parse_tag(input_plugin_t *input,
- xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ xine_stream_t *stream,
+ uint32_t id3_signature) {
id3v2_header_t tag_header;
id3v22_frame_header_t tag_frame_header;
int pos = 0;
- if (id3v2_parse_header(input, mp3_frame_header, &tag_header)) {
+ if (id3v2_parse_header(input, id3_signature, &tag_header)) {
if (tag_header.flags & ID3V22_ZERO_FLAG) {
/* invalid flags */
@@ -471,17 +463,11 @@ static int id3v23_parse_frame_ext_header(input_plugin_t *input,
static int id3v23_interp_frame(input_plugin_t *input,
xine_stream_t *stream,
id3v23_frame_header_t *frame_header) {
- char *buf;
- int enc;
const size_t bufsize = frame_header->size + 2;
if ( bufsize < 3 ) /* frames has to be _at least_ 1 byte */
return 0;
-
- buf = malloc(bufsize);
- if (buf == NULL) {
- lprintf("malloc error");
- return 0;
- }
+ char buf[bufsize];
+ int enc;
if (input->read (input, buf, frame_header->size) == frame_header->size) {
buf[frame_header->size] = 0;
@@ -491,7 +477,7 @@ static int id3v23_interp_frame(input_plugin_t *input,
enc = 0;
switch (frame_header->id) {
- case ( FOURCC_TAG('T', 'C', 'O', 'N') ):
+ case ( BE_FOURCC('T', 'C', 'O', 'N') ):
{
char tmp[1024];
@@ -501,31 +487,31 @@ static int id3v23_interp_frame(input_plugin_t *input,
}
break;
- case ( FOURCC_TAG('T', 'I', 'T', '2') ):
+ case ( BE_FOURCC('T', 'I', 'T', '2') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_TITLE, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'P', 'E', '1') ):
+ case ( BE_FOURCC('T', 'P', 'E', '1') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_ARTIST, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'A', 'L', 'B') ):
+ case ( BE_FOURCC('T', 'A', 'L', 'B') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_ALBUM, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'Y', 'E', 'R') ):
+ case ( BE_FOURCC('T', 'Y', 'E', 'R') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_YEAR, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('C', 'O', 'M', 'M') ):
+ case ( BE_FOURCC('C', 'O', 'M', 'M') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_COMMENT, buf + 1 + 3, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'R', 'C', 'K') ):
+ case ( BE_FOURCC('T', 'R', 'C', 'K') ):
_x_meta_info_set(stream, XINE_META_INFO_TRACK_NUMBER, buf + 1);
break;
- case FOURCC_TAG('T', 'P', 'O', 'S'):
+ case BE_FOURCC('T', 'P', 'O', 'S'):
_x_meta_info_set(stream, XINE_META_INFO_DISCNUMBER, buf + 1);
break;
@@ -533,24 +519,22 @@ static int id3v23_interp_frame(input_plugin_t *input,
lprintf("unhandled frame\n");
}
- free(buf);
return 1;
} else {
lprintf("read error\n");
- free(buf);
return 0;
}
}
static int id3v23_parse_tag(input_plugin_t *input,
- xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ xine_stream_t *stream,
+ uint32_t id3_signature) {
id3v2_header_t tag_header;
id3v23_frame_header_t tag_frame_header;
id3v23_frame_ext_header_t tag_frame_ext_header;
int pos = 0;
- if (id3v2_parse_header(input, mp3_frame_header, &tag_header)) {
+ if (id3v2_parse_header(input, id3_signature, &tag_header)) {
if (tag_header.flags & ID3V23_ZERO_FLAG) {
/* invalid flags */
@@ -730,17 +714,11 @@ static int id3v24_parse_ext_header(input_plugin_t *input,
static int id3v24_interp_frame(input_plugin_t *input,
xine_stream_t *stream,
id3v24_frame_header_t *frame_header) {
- char *buf;
- int enc;
const size_t bufsize = frame_header->size + 2;
if ( bufsize < 3 ) /* frames has to be _at least_ 1 byte */
return 0;
-
- buf = malloc(bufsize);
- if (buf == NULL) {
- lprintf("malloc error");
- return 0;
- }
+ char buf[bufsize];
+ int enc;
if (input->read (input, buf, frame_header->size) == frame_header->size) {
buf[frame_header->size] = 0;
@@ -752,7 +730,7 @@ static int id3v24_interp_frame(input_plugin_t *input,
lprintf("data: %s\n", buf+1);
switch (frame_header->id) {
- case ( FOURCC_TAG('T', 'C', 'O', 'N') ):
+ case ( BE_FOURCC('T', 'C', 'O', 'N') ):
{
char tmp[1024];
@@ -762,32 +740,32 @@ static int id3v24_interp_frame(input_plugin_t *input,
}
break;
- case ( FOURCC_TAG('T', 'I', 'T', '2') ):
+ case ( BE_FOURCC('T', 'I', 'T', '2') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_TITLE, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'P', 'E', '1') ):
+ case ( BE_FOURCC('T', 'P', 'E', '1') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_ARTIST, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'A', 'L', 'B') ):
+ case ( BE_FOURCC('T', 'A', 'L', 'B') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_ALBUM, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'Y', 'E', 'R') ):
- case ( FOURCC_TAG('T', 'D', 'R', 'C') ):
+ case ( BE_FOURCC('T', 'Y', 'E', 'R') ):
+ case ( BE_FOURCC('T', 'D', 'R', 'C') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_YEAR, buf + 1, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('C', 'O', 'M', 'M') ):
+ case ( BE_FOURCC('C', 'O', 'M', 'M') ):
_x_meta_info_set_generic(stream, XINE_META_INFO_COMMENT, buf + 1 + 3, id3_encoding[enc]);
break;
- case ( FOURCC_TAG('T', 'R', 'C', 'K') ):
+ case ( BE_FOURCC('T', 'R', 'C', 'K') ):
_x_meta_info_set(stream, XINE_META_INFO_TRACK_NUMBER, buf + 1);
break;
- case FOURCC_TAG('T', 'P', 'O', 'S'):
+ case BE_FOURCC('T', 'P', 'O', 'S'):
_x_meta_info_set(stream, XINE_META_INFO_DISCNUMBER, buf + 1);
break;
@@ -795,24 +773,22 @@ static int id3v24_interp_frame(input_plugin_t *input,
lprintf("unhandled frame\n");
}
- free(buf);
return 1;
} else {
lprintf("read error\n");
- free(buf);
return 0;
}
}
static int id3v24_parse_tag(input_plugin_t *input,
- xine_stream_t *stream,
- int8_t *mp3_frame_header) {
+ xine_stream_t *stream,
+ uint32_t id3_signature) {
id3v2_header_t tag_header;
id3v24_frame_header_t tag_frame_header;
id3v24_frame_ext_header_t tag_frame_ext_header;
int pos = 0;
- if (id3v2_parse_header(input, mp3_frame_header, &tag_header)) {
+ if (id3v2_parse_header(input, id3_signature, &tag_header)) {
if (tag_header.flags & ID3V24_ZERO_FLAG) {
/* invalid flags */
@@ -875,30 +851,25 @@ static 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) {
- _x_assert(mp3_frame_header[0] == 'I' && mp3_frame_header[1] == 'D' && mp3_frame_header[2] == '3');
-
- int result = 0;
+ uint32_t id3_signature) {
+ _x_assert((id3_signature & ID3V2X_MASK) == ID3V2X_TAG);
- switch(mp3_frame_header[3]) {
- case 2:
+ switch(id3_signature) {
+ case ID3V22_TAG:
xprintf(stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": ID3V2.2 tag\n");
- result = id3v22_parse_tag(input, stream, mp3_frame_header);
- break;
+ return id3v22_parse_tag(input, stream, id3_signature);
- case 3:
+ case ID3V23_TAG:
xprintf(stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": ID3V2.3 tag\n");
- result = id3v23_parse_tag(input, stream, mp3_frame_header);
- break;
+ return id3v23_parse_tag(input, stream, id3_signature);
- case 4:
+ case ID3V24_TAG:
xprintf(stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": ID3V2.4 tag\n");
- result = id3v24_parse_tag(input, stream, mp3_frame_header);
- break;
+ return id3v24_parse_tag(input, stream, id3_signature);
default:
- xprintf(stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": Unknown ID3v2 version: 0x%02x.\n", mp3_frame_header[3]);
+ xprintf(stream->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": Unknown ID3v2 signature: 0x%08x.\n", be2me_32(id3_signature));
}
- return result;
+ return 0;
}
diff --git a/src/demuxers/id3.h b/src/demuxers/id3.h
index 41babe2b4..d69642f4a 100644
--- a/src/demuxers/id3.h
+++ b/src/demuxers/id3.h
@@ -25,17 +25,18 @@
#ifndef ID3_H
#define ID3_H
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
/* id3v2 */
-#define FOURCC_TAG BE_FOURCC
-#define ID3V22_TAG FOURCC_TAG('I', 'D', '3', 2) /* id3 v2.2 header tag */
-#define ID3V23_TAG FOURCC_TAG('I', 'D', '3', 3) /* id3 v2.3 header tag */
-#define ID3V24_TAG FOURCC_TAG('I', 'D', '3', 4) /* id3 v2.4 header tag */
-#define ID3V24_FOOTER_TAG FOURCC_TAG('3', 'D', 'I', 0) /* id3 v2.4 footer tag */
+#define ID3V22_TAG ME_FOURCC('I', 'D', '3', 2) /* id3 v2.2 header tag */
+#define ID3V23_TAG ME_FOURCC('I', 'D', '3', 3) /* id3 v2.3 header tag */
+#define ID3V24_TAG ME_FOURCC('I', 'D', '3', 4) /* id3 v2.4 header tag */
+#define ID3V24_FOOTER_TAG ME_FOURCC('3', 'D', 'I', 0) /* id3 v2.4 footer tag */
+#define ID3V2X_TAG ME_FOURCC('I', 'D', '3', 0) /* id3 v2.x header tag */
+#define ID3V2X_MASK ~ME_FOURCC( 0 , 0 , 0 , 0xFF) /* id3 v2.x header mask */
/*
* ID3 v2.2
@@ -163,17 +164,14 @@ int id3v1_parse_tag (input_plugin_t *input, xine_stream_t *stream);
*/
int id3v2_parse_tag(input_plugin_t *input,
xine_stream_t *stream,
- int8_t *mp3_frame_header);
+ uint32_t id3_signature);
/**
* @brief Checks if the given buffer is an ID3 tag preamble
* @param ptr Pointer to the first 10 bytes of the ID3 tag
*/
-static inline int id3v2_istag(uint8_t *ptr) {
- return
- (ptr[0] == 'I') &&
- (ptr[1] == 'D') &&
- (ptr[2] == '3');
+static inline int id3v2_istag(uint32_t id3_signature) {
+ return (id3_signature & ID3V2X_MASK) == ID3V2X_TAG;
}
#if 0
diff --git a/src/demuxers/iff.h b/src/demuxers/iff.h
index 8ac24a697..921963c08 100644
--- a/src/demuxers/iff.h
+++ b/src/demuxers/iff.h
@@ -136,7 +136,7 @@ typedef struct {
uint8_t masking; /* masking technique */
uint8_t compression; /* compression algoithm */
uint8_t pad1; /* UNUSED. For consistency, put 0 here. */
- uint16_t transparentColor; /* transparent "color number" */
+ uint16_t transparentColor; /* transparent "colour number" */
uint8_t xaspect; /* aspect ratio, a rational number x/y */
uint8_t yaspect; /* aspect ratio, a rational number x/y */
int16_t pagewidth; /* source "page" size in pixels */
diff --git a/src/demuxers/matroska.h b/src/demuxers/matroska.h
index 7af9ef121..41b27fa3f 100644
--- a/src/demuxers/matroska.h
+++ b/src/demuxers/matroska.h
@@ -22,9 +22,9 @@
#ifndef MATROSKA_H
#define MATROSKA_H
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "demux.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
#include "ebml.h"
diff --git a/src/dxr3/Makefile.am b/src/dxr3/Makefile.am
index fadb8b736..b904c899a 100644
--- a/src/dxr3/Makefile.am
+++ b/src/dxr3/Makefile.am
@@ -1,18 +1,18 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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
@@ -20,37 +20,33 @@ endif
EXTRA_DIST = compat.c
-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 = $(xineplug_ldflags)
-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 = $(xineplug_ldflags)
xineplug_vo_out_dxr3_la_SOURCES = \
dxr3_mpeg_encoders.c \
+ ffmpeg_encoder.c \
dxr3_spu_encoder.c \
dxr3_scr.c \
video_out_dxr3.c
-xineplug_vo_out_dxr3_la_LIBADD = $(XINE_LIB) $(link_fame) $(link_rte) $(link_x_libs) $(LTLIBINTL) $(DYNAMIC_LD_LIBS) -lm
-xineplug_vo_out_dxr3_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_vo_out_dxr3_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = \
- em8300.h \
- dxr3.h \
- dxr3_scr.h \
- video_out_dxr3.h
+xineplug_vo_out_dxr3_la_CFLAGS = $(AM_CFLAGS) $(AVUTIL_CFLAGS) $(FFMPEG_CFLAGS)
+xineplug_vo_out_dxr3_la_LIBADD = $(XINE_LIB) $(link_fame) $(link_rte) $(link_x_libs) $(LTLIBINTL) $(AVUTIL_LIBS) $(FFMPEG_LIBS) -lm
diff --git a/src/dxr3/dxr3.h b/src/dxr3/dxr3.h
index 78e74a7b4..be151d055 100644
--- a/src/dxr3/dxr3.h
+++ b/src/dxr3/dxr3.h
@@ -23,7 +23,11 @@
#include "em8300.h"
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
+
+#ifndef LOG_VID
+#define LOG_VID 0
+#endif
/* data for the device name config entry */
#define CONF_KEY "dxr3.device_number"
@@ -37,5 +41,19 @@
* (used by decoders to check for dxr3 presence) */
#define DXR3_VO_ID "dxr3"
-#endif
+/* inline helper implementations */
+static inline int dxr3_present(xine_stream_t *stream)
+{
+ int present = 0;
+
+ if (stream->video_driver && stream->video_driver->node &&
+ stream->video_driver->node->plugin_class ) {
+ const video_driver_class_t *const vo_class = (video_driver_class_t *)stream->video_driver->node->plugin_class;
+ if (vo_class->identifier)
+ present = (strcmp(vo_class->identifier, DXR3_VO_ID) == 0);
+ }
+ llprintf(LOG_VID, "dxr3 %s\n", present ? "present" : "not present");
+ return present;
+}
+#endif
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 100ba7674..0dc024253 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -46,9 +46,9 @@
#define LOG_SPU 0
#define LOG_BTN 0
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/buffer.h>
#include "xine-engine/bswap.h"
#ifdef HAVE_DVDNAV
# ifdef HAVE_DVDNAV_NAVTYPES_H
@@ -75,7 +75,7 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void *);
/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_DVD, 0 };
+static const uint32_t supported_types[] = { BUF_SPU_DVD, 0 };
static const decoder_info_t dxr3_spudec_info = {
supported_types, /* supported types */
@@ -84,16 +84,13 @@ static const decoder_info_t dxr3_spudec_info = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 16, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin },
+ { PLUGIN_SPU_DECODER, 17, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
/* plugin class functions */
static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xine_stream_t *stream);
-static char *dxr3_spudec_get_identifier(spu_decoder_class_t *class_gen);
-static char *dxr3_spudec_get_description(spu_decoder_class_t *class_gen);
-static void dxr3_spudec_class_dispose(spu_decoder_class_t *class_gen);
/* plugin instance functions */
static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf);
@@ -156,24 +153,6 @@ static int dxr3_spudec_copy_nav_to_btn(dxr3_spudec_t *this, int32_t mode
static inline void dxr3_swab_clut(int* clut);
/* inline helper implementations */
-static inline int dxr3_present(xine_stream_t *stream)
-{
- plugin_node_t *node;
- video_driver_class_t *vo_class;
- int present = 0;
-
- if (stream->video_driver && stream->video_driver->node) {
- node = (plugin_node_t *)stream->video_driver->node;
- if (node->plugin_class) {
- vo_class = (video_driver_class_t *)node->plugin_class;
- if (vo_class->get_identifier)
- present = (strcmp(vo_class->get_identifier(vo_class), DXR3_VO_ID) == 0);
- }
- }
- llprintf(LOG_SPU, "dxr3 %s\n", present ? "present" : "not present");
- return present;
-}
-
static inline void dxr3_spudec_clear_nav_list(dxr3_spudec_t *this)
{
while (this->pci_cur.next) {
@@ -213,9 +192,9 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void* data)
if (!this) return NULL;
this->spu_decoder_class.open_plugin = dxr3_spudec_open_plugin;
- this->spu_decoder_class.get_identifier = dxr3_spudec_get_identifier;
- this->spu_decoder_class.get_description = dxr3_spudec_get_description;
- this->spu_decoder_class.dispose = dxr3_spudec_class_dispose;
+ this->spu_decoder_class.identifier = "dxr3-spudec";
+ this->spu_decoder_class.description = N_("subtitle decoder plugin using the hardware decoding capabilities of a DXR3 decoder card");
+ this->spu_decoder_class.dispose = default_spu_decoder_class_dispose;
this->instance = 0;
@@ -286,22 +265,6 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi
return &this->spu_decoder;
}
-static char *dxr3_spudec_get_identifier(spu_decoder_class_t *class_gen)
-{
- return "dxr3-spudec";
-}
-
-static char *dxr3_spudec_get_description(spu_decoder_class_t *class_gen)
-{
- return "subtitle decoder plugin using the hardware decoding capabilities of a DXR3 decoder card";
-}
-
-static void dxr3_spudec_class_dispose(spu_decoder_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
{
dxr3_spudec_t *this = (dxr3_spudec_t *)this_gen;
@@ -582,7 +545,7 @@ static void dxr3_spudec_discontinuity(spu_decoder_t *this_gen)
static void dxr3_spudec_dispose(spu_decoder_t *this_gen)
{
- uint8_t empty_spu[] = {
+ static const uint8_t empty_spu[] = {
0x00, 0x26, 0x00, 0x08, 0x80, 0x00, 0x00, 0x80,
0x00, 0x00, 0x00, 0x20, 0x01, 0x03, 0x00, 0x00,
0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x01, 0x00,
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index 71c6b4d1b..ec28b4648 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -44,8 +44,8 @@
#define LOG_VID 0
#define LOG_PTS 0
-#include "xine_internal.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
#include "video_out_dxr3.h"
#include "dxr3.h"
@@ -71,7 +71,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *);
/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
+static const uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
static const decoder_info_t dxr3_video_decoder_info = {
supported_types, /* supported types */
@@ -80,16 +80,13 @@ static const decoder_info_t dxr3_video_decoder_info = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin },
+ { PLUGIN_VIDEO_DECODER, 19, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
/* plugin class functions */
static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_stream_t *stream);
-static char *dxr3_get_identifier(video_decoder_class_t *class_gen);
-static char *dxr3_get_description(video_decoder_class_t *class_gen);
-static void dxr3_class_dispose(video_decoder_class_t *class_gen);
/* plugin instance functions */
static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf);
@@ -152,7 +149,6 @@ typedef struct dxr3_decoder_s {
} dxr3_decoder_t;
/* helper functions */
-static inline int dxr3_present(xine_stream_t *stream);
static inline int dxr3_mvcommand(int fd_control, int command);
static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t *buffer);
static int get_duration(dxr3_decoder_t *this);
@@ -165,24 +161,6 @@ static void dxr3_update_enhanced_mode(void *this_gen, xine_cfg_entry_t *ent
static void dxr3_update_correct_durations(void *this_gen, xine_cfg_entry_t *entry);
/* inline helper implementations */
-static inline int dxr3_present(xine_stream_t *stream)
-{
- plugin_node_t *node;
- video_driver_class_t *vo_class;
- int present = 0;
-
- if (stream->video_driver && stream->video_driver->node) {
- node = (plugin_node_t *)stream->video_driver->node;
- if (node->plugin_class) {
- vo_class = (video_driver_class_t *)node->plugin_class;
- if (vo_class->get_identifier)
- present = (strcmp(vo_class->get_identifier(vo_class), DXR3_VO_ID) == 0);
- }
- }
- llprintf(LOG_VID, "dxr3 %s\n", present ? "present" : "not present");
- return present;
-}
-
static inline int dxr3_mvcommand(int fd_control, int command)
{
em8300_register_t reg;
@@ -203,9 +181,9 @@ static void *dxr3_init_plugin(xine_t *xine, void *data)
if (!this) return NULL;
this->video_decoder_class.open_plugin = dxr3_open_plugin;
- this->video_decoder_class.get_identifier = dxr3_get_identifier;
- this->video_decoder_class.get_description = dxr3_get_description;
- this->video_decoder_class.dispose = dxr3_class_dispose;
+ this->video_decoder_class.identifier = "dxr3-mpeg2";
+ this->video_decoder_class.description = N_("MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 decoder card.");
+ this->video_decoder_class.dispose = default_video_decoder_class_dispose;
this->instance = 0;
@@ -217,7 +195,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *data)
static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_stream_t *stream)
{
- static char *panscan_types[] = { "only when forced", "use MPEG hint", "use DVB hint", NULL };
+ static const char *const panscan_types[] = { "only when forced", "use MPEG hint", "use DVB hint", NULL };
dxr3_decoder_t *this;
dxr3_decoder_class_t *class = (dxr3_decoder_class_t *)class_gen;
config_values_t *cfg;
@@ -305,22 +283,6 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_
return &this->video_decoder;
}
-static char *dxr3_get_identifier(video_decoder_class_t *class_gen)
-{
- return "dxr3-mpeg2";
-}
-
-static char *dxr3_get_description(video_decoder_class_t *class_gen)
-{
- return "MPEGI/II decoder plugin using the hardware decoding capabilities of a DXR3 decoder card.";
-}
-
-static void dxr3_class_dispose(video_decoder_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
{
dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen;
@@ -650,7 +612,7 @@ static void dxr3_flush(video_decoder_t *this_gen)
* (the highlights won't move without), but some dvds have stills
* with no sequence end code. Since it is very likely that flush() is called
* in still situations, we send one here. */
- static uint8_t end_buffer[4] = { 0x00, 0x00, 0x01, 0xb7 };
+ static const uint8_t end_buffer[4] = { 0x00, 0x00, 0x01, 0xb7 };
write(this->fd_video, &end_buffer, 4);
this->sequence_open = 0;
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "dxr3_decode_video: WARNING: added missing end sequence\n");
diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c
index 8ca48c6ae..7e9a0e523 100644
--- a/src/dxr3/dxr3_mpeg_encoders.c
+++ b/src/dxr3/dxr3_mpeg_encoders.c
@@ -44,11 +44,17 @@
#include <math.h>
#include <unistd.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#define LOG_MODULE "dxr3_mpeg_encoder"
/* #define LOG_VERBOSE */
/* #define LOG */
-#include "xineutils.h"
+#include <xine/xineutils.h>
#include "video_out_dxr3.h"
/* buffer size for encoded mpeg1 stream; will hold one intra frame
@@ -99,7 +105,7 @@ typedef struct {
char *buffer; /* temporary buffer for mpeg data */
/* temporary buffer for YUY2->YV12 conversion */
uint8_t *out[3]; /* aligned buffer for YV12 data */
- uint8_t *buf; /* unaligned YV12 buffer */
+ uint8_t *buf; /* base address of YV12 buffer */
} fame_data_t;
/* helper function */
@@ -107,13 +113,6 @@ static int fame_prepare_frame(fame_data_t *this, dxr3_driver_t *drv,
dxr3_frame_t *frame);
#endif
-/* initialization function */
-int dxr3_lavc_init(dxr3_driver_t *drv, plugin_node_t *node);
-
-/* close function from encoder api */
-static int lavc_on_close(dxr3_driver_t *drv);
-
-
#ifdef HAVE_LIBRTE
int dxr3_rte_init(dxr3_driver_t *drv)
{
@@ -337,8 +336,7 @@ static int fame_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
fame_parameters_t init_fp = FAME_PARAMETERS_INITIALIZER;
double fps;
- if (this->buf) free(this->buf);
- this->buf = 0;
+ av_freep(&this->buf);
this->out[0] = this->out[1] = this->out[2] = 0;
/* if YUY2 and dimensions changed, we need to re-allocate the
@@ -346,8 +344,7 @@ static int fame_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
if (frame->vo_frame.format == XINE_IMGFMT_YUY2) {
int image_size = frame->vo_frame.width * frame->oheight;
- this->out[0] = xine_xmalloc_aligned(16, image_size * 3/2,
- (void *)&this->buf);
+ this->out[0] = this->buf = av_mallocz(image_size * 3/2);
this->out[1] = this->out[0] + image_size;
this->out[2] = this->out[1] + image_size/4;
@@ -537,33 +534,3 @@ static int fame_prepare_frame(fame_data_t *this, dxr3_driver_t *drv, dxr3_frame_
return 1;
}
#endif
-
-
-int dxr3_lavc_init(dxr3_driver_t *drv, plugin_node_t *node)
-{
- void *ffmpeg;
- int (*init)(dxr3_driver_t *);
- int result;
-
- ffmpeg = dlopen(node->file->filename, RTLD_LAZY);
- if (!ffmpeg) return 0;
-
- init = dlsym(ffmpeg, "dxr3_encoder_init");
- if (!init) return 0;
-
- result = init(drv);
- /* the close function is implemented here, because it will call dlclose()
- * and that should not be done be the library we are closing... */
- drv->enc->on_close = lavc_on_close;
- drv->enc->handle = ffmpeg;
- return result;
-}
-
-static int lavc_on_close(dxr3_driver_t *drv)
-{
- drv->enc->on_unneeded(drv);
- dlclose(drv->enc->handle);
- free(drv->enc);
- drv->enc = NULL;
- return 1;
-}
diff --git a/src/dxr3/dxr3_scr.h b/src/dxr3/dxr3_scr.h
index 612f16ccb..28e2e0f1b 100644
--- a/src/dxr3/dxr3_scr.h
+++ b/src/dxr3/dxr3_scr.h
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
/* plugin structure */
diff --git a/src/dxr3/ffmpeg_encoder.c b/src/dxr3/ffmpeg_encoder.c
new file mode 100644
index 000000000..4b444a3bc
--- /dev/null
+++ b/src/dxr3/ffmpeg_encoder.c
@@ -0,0 +1,339 @@
+/*
+ * Copyright (C) 2000-2004 the xine project
+ *
+ * This file is part of xine, a unix 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, USA
+ */
+
+/* mpeg encoders for the dxr3 video out plugin. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <math.h>
+
+#define LOG_MODULE "dxr3_mpeg_encoder"
+/* #define LOG_VERBOSE */
+/* #define LOG */
+
+#include "video_out_dxr3.h"
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <avcodec.h>
+#else
+# include <libavcodec/avcodec.h>
+#endif
+
+#include "../combined/ffmpeg/ffmpeg_compat.h"
+
+/* buffer size for encoded mpeg1 stream; will hold one intra frame
+ * at 640x480 typical sizes are <50 kB. 512 kB should be plenty */
+#define DEFAULT_BUFFER_SIZE 512*1024
+
+
+/* functions required by encoder api */
+static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame);
+static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame);
+static int lavc_on_unneeded(dxr3_driver_t *drv);
+
+/*encoder structure*/
+typedef struct lavc_data_s {
+ encoder_data_t encoder_data;
+ AVCodecContext *context; /* handle for encoding */
+ int width, height; /* width and height of the video frame */
+ uint8_t *ffmpeg_buffer; /* lavc buffer */
+ AVFrame *picture; /* picture to be encoded */
+ uint8_t *out[3]; /* aligned buffer for YV12 data */
+ uint8_t *buf; /* base address of YV12 buffer */
+} lavc_data_t;
+
+
+static int dxr3_lavc_close(dxr3_driver_t *drv) {
+ drv->enc->on_unneeded(drv);
+ free(drv->enc);
+ drv->enc = NULL;
+
+ return 1;
+}
+
+int dxr3_lavc_init(dxr3_driver_t *drv, plugin_node_t *plugin)
+{
+ lavc_data_t* this;
+ avcodec_init();
+
+ avcodec_register_all();
+ lprintf("lavc init , version %x\n", avcodec_version());
+ this = calloc(1, sizeof(lavc_data_t));
+ if (!this) return 0;
+
+ this->encoder_data.type = ENC_LAVC;
+ this->encoder_data.on_update_format = lavc_on_update_format;
+ this->encoder_data.on_frame_copy = NULL;
+ this->encoder_data.on_display_frame = lavc_on_display_frame;
+ this->encoder_data.on_unneeded = lavc_on_unneeded;
+ this->context = 0;
+
+ drv->enc = &this->encoder_data;
+ drv->enc->on_close = dxr3_lavc_close;
+ return 1;
+}
+
+/* helper function */
+static int lavc_prepare_frame(lavc_data_t *this, dxr3_driver_t *drv, dxr3_frame_t *frame);
+
+static int lavc_on_update_format(dxr3_driver_t *drv, dxr3_frame_t *frame)
+{
+ lavc_data_t *this = (lavc_data_t *)drv->enc;
+ AVCodec *codec;
+ unsigned char use_quantizer;
+
+ if (this->context) {
+ avcodec_close(this->context);
+ free(this->context);
+ free(this->picture);
+ this->context = NULL;
+ this->picture = NULL;
+ }
+
+ /* if YUY2 and dimensions changed, we need to re-allocate the
+ * internal YV12 buffer */
+ if (frame->vo_frame.format == XINE_IMGFMT_YUY2) {
+ int image_size = frame->vo_frame.pitches[0] * frame->oheight;
+
+ this->out[0] = this->buf = av_mallocz(image_size * 3/2);
+ this->out[1] = this->out[0] + image_size;
+ this->out[2] = this->out[1] + image_size/4;
+
+ /* fill with black (yuv 16,128,128) */
+ memset(this->out[0], 16, image_size);
+ memset(this->out[1], 128, image_size/4);
+ memset(this->out[2], 128, image_size/4);
+ lprintf("Using YUY2->YV12 conversion\n");
+ }
+
+ /* resolution must be a multiple of two */
+ if ((frame->vo_frame.pitches[0] % 2 != 0) || (frame->oheight % 2 != 0)) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: lavc only handles video dimensions which are multiples of 2\n");
+ return 0;
+ }
+
+ /* get mpeg codec handle */
+ codec = avcodec_find_encoder(CODEC_ID_MPEG1VIDEO);
+ if (!codec) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: lavc MPEG1 codec not found\n");
+ return 0;
+ }
+ lprintf("lavc MPEG1 encoder found.\n");
+
+ this->width = frame->vo_frame.pitches[0];
+ this->height = frame->oheight;
+
+ this->context = avcodec_alloc_context();
+ if (!this->context) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: Couldn't start the ffmpeg library\n");
+ return 0;
+ }
+ this->picture = avcodec_alloc_frame();
+ if (!this->picture) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: Couldn't allocate ffmpeg frame\n");
+ return 0;
+ }
+
+ /* mpeg1 encoder only support YUV420P */
+ this->context->pix_fmt = PIX_FMT_YUVJ420P;
+
+ /* put sample parameters */
+ this->context->bit_rate = drv->class->xine->config->register_range(drv->class->xine->config,
+ "dxr3.encoding.lavc_bitrate", 10000, 1000, 20000,
+ _("libavcodec mpeg output bitrate (kbit/s)"),
+ _("The bitrate the libavcodec mpeg encoder should use for DXR3's encoding mode. "
+ "Higher values will increase quality and CPU usage.\n"
+ "This setting is only considered, when constant quality mode is disabled."), 10, NULL, NULL);
+ this->context->bit_rate *= 1000; /* config in kbit/s, libavcodec wants bit/s */
+
+ use_quantizer = drv->class->xine->config->register_bool(drv->class->xine->config,
+ "dxr3.encoding.lavc_quantizer", 1,
+ _("constant quality mode"),
+ _("When enabled, libavcodec will use a constant quality mode by dynamically "
+ "compressing the images based on their complexity. When disabled, libavcodec "
+ "will use constant bitrate mode."), 10, NULL, NULL);
+
+ if (use_quantizer) {
+ this->context->qmin = drv->class->xine->config->register_range(drv->class->xine->config,
+ "dxr3.encoding.lavc_qmin", 1, 1, 10,
+ _("minimum compression"),
+ _("The minimum compression to apply to an image in constant quality mode."),
+ 10, NULL, NULL);
+
+ this->context->qmax = drv->class->xine->config->register_range(drv->class->xine->config,
+ "dxr3.encoding.lavc_qmax", 2, 1, 20,
+ _("maximum quantizer"),
+ _("The maximum compression to apply to an image in constant quality mode."),
+ 10, NULL, NULL);
+ }
+
+ lprintf("lavc -> bitrate %d \n", this->context->bit_rate);
+
+ this->context->width = frame->vo_frame.pitches[0];
+ this->context->height = frame->oheight;
+
+ this->context->gop_size = 0; /*intra frames only */
+ this->context->me_method = ME_ZERO; /*motion estimation type*/
+
+ this->context->time_base.den = 90000;
+ if (frame->vo_frame.duration > 90000 / 24)
+ this->context->time_base.num = 90000 / 24;
+ else if (frame->vo_frame.duration < 90000 / 60)
+ this->context->time_base.num = 90000 / 60;
+ else
+ this->context->time_base.num = frame->vo_frame.duration;
+ /* ffmpeg can complain about illegal framerates, but since this seems no
+ * problem for the DXR3, we just tell ffmpeg to be more lax with */
+ this->context->strict_std_compliance = -1;
+
+ /* open avcodec */
+ if (avcodec_open(this->context, codec) < 0) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG, "dxr3_mpeg_encoder: could not open codec\n");
+ return 0;
+ }
+ lprintf("dxr3_mpeg_encoder: lavc MPEG1 codec opened.\n");
+
+ if (!this->ffmpeg_buffer)
+ this->ffmpeg_buffer = (unsigned char *)malloc(DEFAULT_BUFFER_SIZE); /* why allocate more than needed ?! */
+ if (!this->ffmpeg_buffer) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: Couldn't allocate temp buffer for mpeg data\n");
+ return 0;
+ }
+
+ return 1;
+}
+
+static int lavc_on_display_frame(dxr3_driver_t *drv, dxr3_frame_t *frame)
+{
+ int size;
+ lavc_data_t* this = (lavc_data_t *)drv->enc;
+ ssize_t written;
+
+ if (frame->vo_frame.bad_frame) return 1;
+ /* ignore old frames */
+ if ((frame->vo_frame.pitches[0] != this->context->width) || (frame->oheight != this->context->height)) {
+ frame->vo_frame.free(&frame->vo_frame);
+ lprintf("LAVC ignoring frame !!!\n");
+ return 1;
+ }
+
+ /* prepare frame for conversion, handles YUY2 -> YV12 conversion when necessary */
+ lavc_prepare_frame(this, drv, frame);
+
+ /* do the encoding */
+ size = avcodec_encode_video(this->context, this->ffmpeg_buffer, DEFAULT_BUFFER_SIZE, this->picture);
+
+ frame->vo_frame.free(&frame->vo_frame);
+
+ if (size < 0) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: encoding failed\n");
+ return 0;
+ }
+
+ written = write(drv->fd_video, this->ffmpeg_buffer, size);
+ if (written < 0) {
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: video device write failed (%s)\n", strerror(errno));
+ return 0;
+ }
+ if (written != size)
+ xprintf(drv->class->xine, XINE_VERBOSITY_LOG,
+ "dxr3_mpeg_encoder: Could only write %zd of %d mpeg bytes.\n", written, size);
+ return 1;
+}
+
+static int lavc_on_unneeded(dxr3_driver_t *drv)
+{
+ lavc_data_t *this = (lavc_data_t *)drv->enc;
+ lprintf("flushing buffers\n");
+ if (this->context) {
+ avcodec_close(this->context);
+ free(this->context);
+ free(this->picture);
+ this->context = NULL;
+ this->picture = NULL;
+ }
+ return 1;
+}
+
+static int lavc_prepare_frame(lavc_data_t *this, dxr3_driver_t *drv, dxr3_frame_t *frame)
+{
+ int i, j, w2;
+ uint8_t *yuy2;
+
+ if (frame->vo_frame.bad_frame) return 1;
+
+ if (frame->vo_frame.format == XINE_IMGFMT_YUY2) {
+ /* need YUY2->YV12 conversion */
+ if (!(this->out[0] && this->out[1] && this->out[2]) ) {
+ lprintf("Internal YV12 buffer not created.\n");
+ return 0;
+ }
+ this->picture->data[0] = this->out[0] + frame->vo_frame.pitches[0] * drv->top_bar; /* y */
+ this->picture->data[1] = this->out[1] + (frame->vo_frame.pitches[0] / 2) * (drv->top_bar / 2); /* u */
+ this->picture->data[2] = this->out[2] + (frame->vo_frame.pitches[0] / 2) * (drv->top_bar / 2); /* v */
+ yuy2 = frame->vo_frame.base[0];
+ w2 = frame->vo_frame.pitches[0] / 2;
+ for (i = 0; i < frame->vo_frame.height; i += 2) {
+ for (j = 0; j < w2; j++) {
+ /* packed YUV 422 is: Y[i] U[i] Y[i+1] V[i] */
+ *(this->picture->data[0]++) = *(yuy2++);
+ *(this->picture->data[1]++) = *(yuy2++);
+ *(this->picture->data[0]++) = *(yuy2++);
+ *(this->picture->data[2]++) = *(yuy2++);
+ }
+ /* down sampling */
+ for (j = 0; j < w2; j++) {
+ /* skip every second line for U and V */
+ *(this->picture->data[0]++) = *(yuy2++);
+ yuy2++;
+ *(this->picture->data[0]++) = *(yuy2++);
+ yuy2++;
+ }
+ }
+ /* reset for encoder */
+ this->picture->data[0] = this->out[0];
+ this->picture->data[1] = this->out[1];
+ this->picture->data[2] = this->out[2];
+ }
+ else { /* YV12 **/
+ this->picture->data[0] = frame->real_base[0];
+ this->picture->data[1] = frame->real_base[1];
+ this->picture->data[2] = frame->real_base[2];
+ }
+ this->picture->linesize[0] = this->context->width;
+ this->picture->linesize[1] = this->context->width / 2;
+ this->picture->linesize[2] = this->context->width / 2;
+ return 1;
+}
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index ed5ae4b58..1fd1028a8 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -60,12 +60,18 @@
#define LOG_VID 0
#define LOG_OVR 0
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "video_out.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/video_out.h>
#include "dxr3.h"
#include "video_out_dxr3.h"
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#include "compat.c"
/* the amount of extra time we give the card for decoding */
@@ -94,17 +100,15 @@ static const vo_info_t vo_info_dxr3_aa = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
#ifdef HAVE_X11
- { PLUGIN_VIDEO_OUT, 21, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3_x11, &dxr3_x11_init_plugin },
+ { PLUGIN_VIDEO_OUT, 22, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3_x11, &dxr3_x11_init_plugin },
#endif
- { PLUGIN_VIDEO_OUT, 21, "aadxr3", XINE_VERSION_CODE, &vo_info_dxr3_aa, &dxr3_aa_init_plugin },
+ { PLUGIN_VIDEO_OUT, 22, "aadxr3", XINE_VERSION_CODE, &vo_info_dxr3_aa, &dxr3_aa_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
/* plugin class functions */
static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual);
-static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen);
-static char *dxr3_vo_get_description(video_driver_class_t *class_gen);
static void dxr3_vo_class_dispose(video_driver_class_t *class_gen);
/* plugin instance functions */
@@ -178,8 +182,8 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen)
CONF_KEY, 0, CONF_NAME, CONF_HELP, 10, NULL, NULL);
this->video_driver_class.open_plugin = dxr3_vo_open_plugin;
- this->video_driver_class.get_identifier = dxr3_vo_get_identifier;
- this->video_driver_class.get_description = dxr3_vo_get_description;
+ this->video_driver_class.identifier = DXR3_VO_ID;
+ this->video_driver_class.description = N_("video output plugin displaying images through your DXR3 decoder card");
this->video_driver_class.dispose = dxr3_vo_class_dispose;
this->xine = xine;
@@ -191,16 +195,6 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen)
return this;
}
-static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen)
-{
- return DXR3_VO_ID;
-}
-
-static char *dxr3_vo_get_description(video_driver_class_t *class_gen)
-{
- return "video output plugin displaying images through your DXR3 decoder card";
-}
-
static void dxr3_vo_class_dispose(video_driver_class_t *class_gen)
{
dxr3_driver_class_t *class = (dxr3_driver_class_t *)class_gen;
@@ -222,13 +216,14 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
static char *available_encoders[SUPPORTED_ENCODER_COUNT + 2];
plugin_node_t *node;
+ static const char *const videoout_modes[] = {
+ "letterboxed tv", "widescreen tv",
#ifdef HAVE_X11
- static const char const *videoout_modes[] = { "letterboxed tv", "widescreen tv",
- "letterboxed overlay", "widescreen overlay", NULL };
-#else
- static const char const *videoout_modes[] = { "letterboxed tv", "widescreen tv", NULL };
+ "letterboxed overlay", "widescreen overlay",
#endif
- static const char const *tv_modes[] = { "ntsc", "pal", "pal60" , "default", NULL };
+ NULL
+ };
+ static const char *const tv_modes[] = { "ntsc", "pal", "pal60" , "default", NULL };
int list_id, list_size;
xine_sarray_t *plugin_list;
@@ -299,21 +294,8 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
#if LOG_VID
printf("video_out_dxr3: Supported mpeg encoders: ");
#endif
- /* check, if ffmpeg plugin is available by looking through plugin
- * catalog; catalog mutex is already locked here, since this is open_plugin() */
- node = NULL;
- plugin_list = class->xine->plugin_catalog->plugin_lists[PLUGIN_VIDEO_DECODER - 1];
- list_size = xine_sarray_size(plugin_list);
- for (list_id = 0; list_id < list_size; list_id++) {
- node = xine_sarray_get (plugin_list, list_id);
- if (strcasecmp(node->info->id, "ffmpegvideo") == 0) {
- available_encoders[encoder++] = "libavcodec";
-#if LOG_VID
- printf("libavcodec, ");
-#endif
- break;
- }
- }
+ available_encoders[encoder++] = "libavcodec";
+ printf("libavcodec, ");
#ifdef HAVE_LIBFAME
available_encoders[encoder++] = "fame";
#if LOG_VID
@@ -589,7 +571,7 @@ static void dxr3_frame_dispose(vo_frame_t *frame_gen)
{
dxr3_frame_t *frame = (dxr3_frame_t *)frame_gen;
- if (frame->mem) free(frame->mem);
+ av_free(frame->mem);
pthread_mutex_destroy(&frame_gen->mutex);
free(frame);
}
@@ -629,12 +611,9 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
frame->aspect = XINE_VO_ASPECT_ANAMORPHIC;
frame->pan_scan = flags & VO_PAN_SCAN_FLAG;
- if (frame->mem) {
- free(frame->mem);
- frame->mem = NULL;
- frame->real_base[0] = frame->real_base[1] = frame->real_base[2] = NULL;
- frame_gen->base[0] = frame_gen->base[1] = frame_gen->base[2] = NULL;
- }
+ av_freep(&frame->mem);
+ frame->real_base[0] = frame->real_base[1] = frame->real_base[2] = NULL;
+ frame_gen->base[0] = frame_gen->base[1] = frame_gen->base[2] = NULL;
return;
}
@@ -719,10 +698,7 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
/* if dimensions changed, we need to re-allocate frame memory */
if ((frame->vo_frame.width != width) || (frame->vo_frame.height != height) ||
(frame->oheight != oheight) || (frame->vo_frame.format != format)) {
- if (frame->mem) {
- free (frame->mem);
- frame->mem = NULL;
- }
+ av_freep(&frame->mem);
if (format == XINE_IMGFMT_YUY2) {
int i, image_size;
@@ -733,8 +709,7 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
/* planar format, only base[0] */
/* add one extra line for field swap stuff */
- frame->real_base[0] = xine_xmalloc_aligned(16, image_size + frame->vo_frame.pitches[0],
- &frame->mem);
+ frame->real_base[0] = frame->mem = av_mallocz(image_size + frame->vo_frame.pitches[0]);
/* don't use first line */
frame->real_base[0] += frame->vo_frame.pitches[0];
@@ -761,8 +736,8 @@ static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_ge
image_size_v = frame->vo_frame.pitches[2] * ((oheight + 1) / 2);
/* add one extra line for field swap stuff */
- frame->real_base[0] = xine_xmalloc_aligned(16, image_size_y + frame->vo_frame.pitches[0] +
- image_size_u + image_size_v, &frame->mem);
+ frame->real_base[0] = frame->mem = av_mallocz(image_size_y + frame->vo_frame.pitches[0] +
+ image_size_u + image_size_v);
/* don't use first line */
frame->real_base[0] += frame->vo_frame.pitches[0];
diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h
index 7e24781bf..8158bba8e 100644
--- a/src/dxr3/video_out_dxr3.h
+++ b/src/dxr3/video_out_dxr3.h
@@ -26,8 +26,8 @@
# include <X11/Xlib.h>
#endif
-#include "xine_internal.h"
-#include "vo_scale.h"
+#include <xine/xine_internal.h>
+#include <xine/vo_scale.h>
#include "dxr3_scr.h"
#include "dxr3.h"
diff --git a/src/input/Makefile.am b/src/input/Makefile.am
index 9700f6f58..3fdb15259 100644
--- a/src/input/Makefile.am
+++ b/src/input/Makefile.am
@@ -1,13 +1,10 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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:
@@ -15,57 +12,64 @@ 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
+
+
+noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.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
endif
-if HAVE_V4L2
+if ENABLE_V4L2
in_v4l2 = xineplug_inp_v4l2.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
endif
-if DVB
-in_dvb = xineplug_inp_dvb.la
-endif
-
-if HAVE_LIBBLURAY
+if ENABLE_BLURAY
in_bluray = xineplug_inp_bluray.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_v4l2) \
@@ -85,94 +89,66 @@ 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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
+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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
xineplug_inp_rtp_la_SOURCES = input_rtp.c net_buf_ctrl.c
+xineplug_inp_rtp_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
+xineplug_inp_http_la_LIBADD = $(XINE_LIB) $(NET_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) $(AVUTIL_LIBS)
+xineplug_inp_http_la_CPPFLAGS = $(AM_CPPFLAGS) $(AVUTIL_CFLAGS)
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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
+xineplug_inp_dvb_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_dvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL) $(XDG_BASEDIR_LIBS) $(AVUTIL_LIBS)
+xineplug_inp_dvb_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS) $(AVUTIL_CFLAGS)
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 = $(xineplug_ldflags)
-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 = $(xineplug_ldflags)
+xineplug_inp_cdda_la_SOURCES = input_cdda.c media_helper.c
+xineplug_inp_cdda_la_DEPS = $(XDG_BASEDIR_DEPS)
+xineplug_inp_cdda_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(XDG_BASEDIR_LIBS) $(AVUTIL_LIBS)
+xineplug_inp_cdda_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS) $(AVUTIL_CFLAGS)
xineplug_inp_v4l_la_SOURCES = input_v4l.c
xineplug_inp_v4l_la_LIBADD = $(XINE_LIB) $(ALSA_LIBS) $(LTLIBINTL)
-xineplug_inp_v4l_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_v4l_la_LDFLAGS = $(xineplug_ldflags)
+xineplug_inp_v4l_la_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS)
xineplug_inp_v4l2_la_SOURCES = input_v4l2.c
xineplug_inp_v4l2_la_LIBADD = $(XINE_LIB) $(ALSA_LIBS) $(LTLIBINTL) $(V4L2_LIBS)
-xineplug_inp_v4l2_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) $(V4L2_CFLAGS)
-xineplug_inp_v4l2_la_LDFLAGS = $(xineplug_ldflags)
+xineplug_inp_v4l2_la_CFLAGS = $(AM_CFLAGS) $(ALSA_CFLAGS) $(V4L2_CFLAGS)
+xineplug_inp_v4l2_la_LDFLAGS = -avoid-version -module
xineplug_inp_gnome_vfs_la_SOURCES = input_gnome_vfs.c net_buf_ctrl.c
xineplug_inp_gnome_vfs_la_LIBADD = $(XINE_LIB) $(GNOME_VFS_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_gnome_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_gnome_vfs_la_LDFLAGS = $(xineplug_ldflags)
+xineplug_inp_gnome_vfs_la_CFLAGS = $(AM_CFLAGS) $(GNOME_VFS_CFLAGS)
xineplug_inp_smb_la_SOURCES = input_smb.c
xineplug_inp_smb_la_LIBADD = $(XINE_LIB) $(LIBSMBCLIENT_LIBS) $(LTLIBINTL)
-xineplug_inp_smb_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-xineplug_inp_smb_la_LDFLAGS = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
xineplug_inp_bluray_la_SOURCES = input_bluray.c media_helper.c
xineplug_inp_bluray_la_LIBADD = $(XINE_LIB) $(LIBBLURAY_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_inp_bluray_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) $(LIBBLURAY_CFLAGS)
-xineplug_inp_bluray_la_LDFLAGS = $(xineplug_ldflags)
-
-xineinclude_HEADERS = input_plugin.h
-noinst_HEADERS = net_buf_ctrl.h mms.h mmsh.h pnm.h media_helper.h http_helper.h
-
+xineplug_inp_bluray_la_CFLAGS = $(AM_CFLAGS) $(LIBBLURAY_CFLAGS)
diff --git a/src/input/base64.c b/src/input/base64.c
deleted file mode 100644
index 17fa6f48a..000000000
--- a/src/input/base64.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (C) 2000 Robert Kaye
- *
- * 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, USA
- *
- * Base64 encoding modified for Musicbrainz
- * relicensed under the GNU General Public License for use in xine-lib
- */
-/* --------------------------------------------------------------------------
-
- MusicBrainz -- The Internet music metadatabase
-
- Copyright (C) 2000 Robert Kaye
-
- 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.1 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, USA
-
-----------------------------------------------------------------------------*/
-/*
- * Program: RFC-822 routines (originally from SMTP)
- *
- * Author: Mark Crispin
- * Networks and Distributed Computing
- * Computing & Communications
- * University of Washington
- * Administration Building, AG-44
- * Seattle, WA 98195
- * Internet: MRC@CAC.Washington.EDU
- *
- * Date: 27 July 1988
- * Last Edited: 10 September 1998
- *
- * Sponsorship: The original version of this work was developed in the
- * Symbolic Systems Resources Group of the Knowledge Systems
- * Laboratory at Stanford University in 1987-88, and was funded
- * by the Biomedical Research Technology Program of the National
- * Institutes of Health under grant number RR-00785.
- *
- * Original version Copyright 1988 by The Leland Stanford Junior University
- * Copyright 1998 by the University of Washington
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notices appear in all copies and that both the
- * above copyright notices and this permission notice appear in supporting
- * documentation, and that the name of the University of Washington or The
- * Leland Stanford Junior University not be used in advertising or publicity
- * pertaining to distribution of the software without specific, written prior
- * permission. This software is made available "as is", and
- * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
- * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
- * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY 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, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <ctype.h>
-#include <stdio.h>
-#include <time.h>
-#include <stdlib.h>
-
-#include "base64.h"
-
-
-/* NOTE: This is not true RFC822 anymore. The use of the characters
- '/', '+', and '=' is no bueno when the ID will be used as part of a URL.
- '_', '.', and '-' have been used instead
-*/
-
-/* Convert binary contents to BASE64
- * Accepts: source
- * length of source
- * pointer to return destination length
- * Returns: destination as BASE64
- */
-
-unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len)
-{
- unsigned char *ret,*d;
- unsigned char *s = (unsigned char *) src;
- char *v = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._";
- unsigned long i = ((srcl + 2) / 3) * 4;
- *len = i += 2 * ((i / 60) + 1);
- d = ret = (unsigned char *) malloc ((size_t) ++i);
- for (i = 0; srcl; s += 3) { /* process tuplets */
- *d++ = v[s[0] >> 2]; /* byte 1: high 6 bits (1) */
- /* byte 2: low 2 bits (1), high 4 bits (2) */
- *d++ = v[((s[0] << 4) + (--srcl ? (s[1] >> 4) : 0)) & 0x3f];
- /* byte 3: low 4 bits (2), high 2 bits (3) */
- *d++ = srcl ? v[((s[1] << 2) + (--srcl ? (s[2] >> 6) : 0)) & 0x3f] : '-';
- /* byte 4: low 6 bits (3) */
- *d++ = srcl ? v[s[2] & 0x3f] : '-';
- if (srcl) srcl--; /* count third character if processed */
- if ((++i) == 15) { /* output 60 characters? */
- i = 0; /* restart line break count, insert CRLF */
- *d++ = '\015'; *d++ = '\012';
- }
- }
- *d = '\0'; /* tie off string */
-
- return ret; /* return the resulting string */
-}
diff --git a/src/input/base64.h b/src/input/base64.h
deleted file mode 100644
index 107704a6a..000000000
--- a/src/input/base64.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2000 Robert Kaye
- *
- * 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, USA
- *
- * Base64 encoding modified for Musicbrainz
- * relicensed under the GNU General Public License for use in xine-lib
- */
-/* --------------------------------------------------------------------------
-
- MusicBrainz -- The Internet music metadatabase
-
- Copyright (C) 2000 Robert Kaye
-
- 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.1 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, USA
-
-----------------------------------------------------------------------------*/
-/*
- * Program: RFC-822 routines (originally from SMTP)
- *
- * Author: Mark Crispin
- * Networks and Distributed Computing
- * Computing & Communications
- * University of Washington
- * Administration Building, AG-44
- * Seattle, WA 98195
- * Internet: MRC@CAC.Washington.EDU
- *
- * Date: 27 July 1988
- * Last Edited: 10 September 1998
- *
- * Sponsorship: The original version of this work was developed in the
- * Symbolic Systems Resources Group of the Knowledge Systems
- * Laboratory at Stanford University in 1987-88, and was funded
- * by the Biomedical Research Technology Program of the National
- * Institutes of Health under grant number RR-00785.
- *
- * Original version Copyright 1988 by The Leland Stanford Junior University
- * Copyright 1998 by the University of Washington
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation for any purpose and without fee is hereby granted, provided
- * that the above copyright notices appear in all copies and that both the
- * above copyright notices and this permission notice appear in supporting
- * documentation, and that the name of the University of Washington or The
- * Leland Stanford Junior University not be used in advertising or publicity
- * pertaining to distribution of the software without specific, written prior
- * permission. This software is made available "as is", and
- * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY
- * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE,
- * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF
- * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY 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, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef BASE64_H
-#define BASE64_H
-
-unsigned char *rfc822_binary (void *src,unsigned long srcl,unsigned long *len);
-
-#endif
diff --git a/src/input/dvb/Makefile.am b/src/input/dvb/Makefile.am
deleted file mode 100644
index 84310507c..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 018c7de59..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/http_helper.c b/src/input/http_helper.c
index 90ee63c92..9b3560b22 100644
--- a/src/input/http_helper.c
+++ b/src/input/http_helper.c
@@ -26,9 +26,8 @@
#include <string.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "http_helper.h"
-#include "xineutils.h"
const char *_x_url_user_agent (const char *url)
@@ -235,29 +234,6 @@ error:
return 0;
}
-char *_x_canonicalise_url (const char *base, const char *url) {
-
- size_t base_length;
- char *cut;
-
- if ((cut = strstr (url, "://")))
- return strdup (url);
-
- cut = strstr (base, "://");
- if (url[0] == '/') {
- /* absolute - base up to first '/' after "://", then url */
- cut = strchr (cut + 3, '/');
- }
- else {
- /* relative - base up to & inc. last '/', then url */
- cut = strrchr (cut, '/');
- if (cut)
- ++cut;
- }
- base_length = cut ? (size_t)(cut - base) : strlen (base);
-
- return _x_asprintf ("%.*s%s", (int)base_length, base, url);
-}
#ifdef TEST_URL
/*
diff --git a/src/input/http_helper.h b/src/input/http_helper.h
index fbbe3a6c4..999633113 100644
--- a/src/input/http_helper.h
+++ b/src/input/http_helper.h
@@ -23,7 +23,8 @@
#ifndef HTTP_HELPER_H
#define HTTP_HELPER_H
-#include "attributes.h"
+#include <xine/attributes.h>
+#include <xine/xine_internal.h>
/*
* user agent finder, using modified protcol names
@@ -57,6 +58,28 @@ int _x_parse_url (char *url, char **proto, char** host, int *port,
* the canonicalised URL (caller must free() it)
* NULL if error
*/
-char *_x_canonicalise_url (const char *base, const char *url) XINE_MALLOC;
+static inline XINE_MALLOC char *_x_canonicalise_url (const char *base, const char *url) {
+
+ size_t base_length;
+ char *cut;
+
+ if ((cut = strstr (url, "://")))
+ return strdup (url);
+
+ cut = strstr (base, "://");
+ if (url[0] == '/') {
+ /* absolute - base up to first '/' after "://", then url */
+ cut = strchr (cut + 3, '/');
+ }
+ else {
+ /* relative - base up to & inc. last '/', then url */
+ cut = strrchr (cut, '/');
+ if (cut)
+ ++cut;
+ }
+ base_length = cut ? (size_t)(cut - base) : strlen (base);
+
+ return _x_asprintf ("%.*s%s", (int)base_length, base, url);
+}
#endif /* HTTP_HELPER_H */
diff --git a/src/input/input_bluray.c b/src/input/input_bluray.c
index a05307a4f..293116944 100644
--- a/src/input/input_bluray.c
+++ b/src/input/input_bluray.c
@@ -54,9 +54,10 @@
#define XINE_ENGINE_INTERNAL
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
+
#include "media_helper.h"
/* */
@@ -866,7 +867,7 @@ static uint32_t bluray_plugin_get_capabilities (input_plugin_t *this_gen)
} \
} while (0)
-static off_t bluray_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
+static off_t bluray_plugin_read (input_plugin_t *this_gen, void *buf, off_t len)
{
bluray_input_plugin_t *this = (bluray_input_plugin_t *) this_gen;
off_t result;
@@ -1538,19 +1539,9 @@ static void free_xine_playlist(bluray_input_class_t *this)
this->xine_playlist_size = 0;
}
-static const char *bluray_class_get_description (input_class_t *this_gen)
-{
- return _("BluRay input plugin");
-}
-
-static const char *bluray_class_get_identifier (input_class_t *this_gen)
+static const char * const *bluray_class_get_autoplay_list (input_class_t *this_gen, int *num_files)
{
- return "bluray";
-}
-
-static char **bluray_class_get_autoplay_list (input_class_t *this_gen, int *num_files)
-{
- static char *autoplay_list[] = { "bluray:/", NULL };
+ static const char * const autoplay_list[] = { "bluray:/", NULL };
*num_files = 1;
@@ -1635,13 +1626,14 @@ static void *bluray_init_plugin (xine_t *xine, void *data)
this->xine = xine;
this->input_class.get_instance = bluray_class_get_instance;
- this->input_class.get_identifier = bluray_class_get_identifier;
- this->input_class.get_description = bluray_class_get_description;
this->input_class.get_dir = bluray_class_get_dir;
this->input_class.get_autoplay_list = bluray_class_get_autoplay_list;
this->input_class.dispose = bluray_class_dispose;
this->input_class.eject_media = bluray_class_eject_media;
+ this->input_class.identifier = "bluray";
+ this->input_class.description = _("BluRay input plugin");
+
this->mountpoint =
config->register_filename(config, "media.bluray.mountpoint",
"/mnt/bluray", XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
@@ -1699,19 +1691,9 @@ static void *bluray_init_plugin (xine_t *xine, void *data)
return this;
}
-static const char *bd_class_get_description (input_class_t *this_gen)
+static const char * const *bd_class_get_autoplay_list (input_class_t *this_gen, int *num_files)
{
- return _("BluRay input plugin (using menus)");
-}
-
-static const char *bd_class_get_identifier (input_class_t *this_gen)
-{
- return "bd";
-}
-
-static char **bd_class_get_autoplay_list (input_class_t *this_gen, int *num_files)
-{
- static char *autoplay_list[] = { "bd:/", NULL };
+ static const char * const autoplay_list[] = { "bd:/", NULL };
*num_files = 1;
@@ -1723,8 +1705,9 @@ static void *bd_init_plugin (xine_t *xine, void *data)
bluray_input_class_t *this = bluray_init_plugin(xine, data);
if (this) {
- this->input_class.get_identifier = bd_class_get_identifier;
- this->input_class.get_description = bd_class_get_description;
+ this->input_class.identifier = "bluray";
+ this->input_class.description = _("BluRay input plugin (using menus)");
+
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = bd_class_get_autoplay_list;
}
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 4da456384..6f6f23ef2 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -39,6 +39,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>
@@ -54,17 +57,29 @@
#include <netinet/in.h>
#include <sys/socket.h>
+#include <basedir.h>
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <base64.h>
+# include <sha1.h>
+#else
+# include <libavutil/base64.h>
+# ifdef HAVE_LIBAVUTIL_SHA_H
+# include <libavutil/sha.h>
+# else
+# include <libavutil/sha1.h>
+# endif
+#endif
+
#define LOG_MODULE "input_cdda"
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "sha1.h"
-#include "base64.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "media_helper.h"
#if defined(__sun)
@@ -89,6 +104,15 @@
#define CD_LEADOUT_TRACK 0xAA
#define CD_BLOCK_OFFSET 150
+#if !defined(HAVE_LIBAVUTIL_SHA_H)
+/* old libavutil/sha1.h was found... */
+#define AVSHA AVSHA1
+# define av_sha_init(c,b) av_sha1_init(c)
+# define av_sha_update av_sha1_update
+# define av_sha_final av_sha1_final
+# define av_sha_size av_sha1_size
+#endif
+
typedef struct _cdrom_toc_entry {
int track_mode;
int first_frame;
@@ -129,7 +153,6 @@ typedef struct {
int enabled;
char *server;
int port;
- char *cache_dir;
char *cdiscid;
char *disc_title;
@@ -382,10 +405,10 @@ static cdrom_toc * init_cdrom_toc(void) {
static void free_cdrom_toc(cdrom_toc *toc) {
- if(toc && toc->toc_entries)
+ if ( toc ) {
free(toc->toc_entries);
- if (toc)
- free (toc);
+ free(toc);
+ }
}
#if defined (__linux__)
@@ -986,7 +1009,7 @@ static int parse_url (char *urlbuf, char** host, int *port) {
#endif
static int XINE_FORMAT_PRINTF(4, 5)
-network_command( xine_stream_t *stream, int socket, char *data_buf, char *msg, ...)
+network_command( xine_stream_t *stream, int socket, void *data_buf, const char *msg, ...)
{
char buf[_BUFSIZ];
va_list args;
@@ -1037,11 +1060,11 @@ network_command( xine_stream_t *stream, int socket, char *data_buf, char *msg, .
#ifndef WIN32
static int network_connect(xine_stream_t *stream, const char *got_url )
{
- char *host, *url;
+ char *host;
int port;
int fd;
- url = strdup(got_url);
+ char *url = strdup(got_url);
parse_url(url, &host, &port);
if( !host || !strlen(host) || !port )
@@ -1180,15 +1203,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;
@@ -1291,51 +1305,27 @@ static void _cdda_mkdir_safe(xine_t *xine, char *path) {
}
/*
- * Make recursive directory creation
+ * Make recursive directory creation (given an absolute pathname)
*/
-static void _cdda_mkdir_recursive_safe(xine_t *xine, char *path) {
- char *p, *pp;
- char buf[XINE_PATH_MAX + XINE_NAME_MAX + 1];
- char buf2[XINE_PATH_MAX + XINE_NAME_MAX + 1];
-
- if(path == NULL)
+static void _cdda_mkdir_recursive_safe (xine_t *xine, char *path)
+{
+ if (!path)
return;
- memset(&buf, 0, sizeof(buf));
- memset(&buf2, 0, sizeof(buf2));
-
- snprintf(buf, sizeof(buf), "%s", path);
- pp = buf;
- while((p = xine_strsep(&pp, "/")) != NULL) {
- if(p && strlen(p)) {
-
-#ifdef WIN32
- if (*buf2 != '\0') {
-#endif
- size_t size = strlen(buf2);
- snprintf(buf2 + size, sizeof(buf2) - size, "/%s", p);
-#ifdef WIN32
- }
- else {
- snprintf(buf2, sizeof(buf2), "%s", p);
- }
-#endif /* WIN32 */
-
- _cdda_mkdir_safe(xine, buf2);
- }
- }
-}
-
-/*
- * 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()));
+ char buf[strlen (path) + 1];
+ strcpy (buf, path);
+ char *p = strchr (buf, '/') ? : buf;
- return buf;
+ do
+ {
+ while (*p++ == '/') /**/;
+ p = strchr (p, '/');
+ if (p)
+ *p = 0;
+ _cdda_mkdir_safe (xine, buf);
+ if (p)
+ *p = '/';
+ } while (p);
}
/*
@@ -1504,14 +1494,16 @@ static void _cdda_parse_cddb_info (cdda_input_plugin_t *this, char *buffer, char
* 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];
- size_t cdir_size = 0;
DIR *dir;
+ const char *const xdg_cache_home = xdgCacheHome(&this->stream->xine->basedir_handle);
+
if(this == NULL)
return 0;
- cdir_size = snprintf(cdir, sizeof(cdir), "%s", this->cddb.cache_dir);
+ const size_t cdir_size = strlen(xdg_cache_home) + sizeof("/"PACKAGE"/cddb") + 10 + 1;
+ char *const cdir = alloca(cdir_size);
+ sprintf(cdir, "%s/" PACKAGE "/cddb", xdg_cache_home);
if((dir = opendir(cdir)) != NULL) {
struct dirent *pdir;
@@ -1524,7 +1516,7 @@ static int _cdda_load_cached_cddb_infos(cdda_input_plugin_t *this) {
if(!strcasecmp(pdir->d_name, discid)) {
FILE *fd;
- cdir_size += snprintf(cdir + cdir_size, sizeof(cdir) - cdir_size, "/%s", discid);
+ snprintf(cdir + cdir_size - 12, 10, "/%s", discid);
if((fd = fopen(cdir, "r")) == NULL) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"input_cdda: fopen(%s) failed: %s.\n", cdir, strerror(errno));
@@ -1563,20 +1555,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));
-
- /* Ensure "~/.xine/cddbcache" exist */
- snprintf(cfile, sizeof(cfile), "%s", this->cddb.cache_dir);
+ /* 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 the cache directory exists */
_cdda_mkdir_recursive_safe(this->stream->xine, cfile);
- snprintf(cfile, sizeof(cfile), "%s/%08" PRIx32 , this->cddb.cache_dir, this->cddb.disc_id);
+ sprintf(cfile, "%s/%08" PRIx32, cfile, this->cddb.disc_id);
if((fd = fopen(cfile, "w")) == NULL) {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
@@ -1855,39 +1850,42 @@ static uint32_t _cdda_calc_cddb_id(cdda_input_plugin_t *this) {
*/
static void _cdda_cdindex(cdda_input_plugin_t *this, cdrom_toc *toc) {
char temp[10];
- SHA_INFO sha;
- unsigned char digest[33], *base64;
+ struct AVSHA *sha_ctx = malloc(av_sha_size);
+ unsigned char digest[20];
+ /* We're going to encode 20 bytes in base64, which will become
+ * 6 * 32 / 8 = 24 bytes.
+ * libavutil's base64 encoding functions, though, wants the size to
+ * be at least len * 4 / 3 + 12, so let's use 39.
+ */
+ char base64[39];
int i;
- unsigned long size;
- sha_init(&sha);
+ av_sha_init(sha_ctx, 160);
sprintf(temp, "%02X", toc->first_track);
- sha_update(&sha, (unsigned char*) temp, strlen(temp));
+ av_sha_update(sha_ctx, (unsigned char*) temp, strlen(temp));
sprintf(temp, "%02X", toc->last_track - toc->ignore_last_track);
- sha_update(&sha, (unsigned char*) temp, strlen(temp));
+ av_sha_update(sha_ctx, (unsigned char*) temp, strlen(temp));
sprintf (temp, "%08X", toc->leadout_track.first_frame);// + 150);
- sha_update(&sha, (unsigned char*) temp, strlen(temp));
+ av_sha_update(sha_ctx, (unsigned char*) temp, strlen(temp));
for (i = toc->first_track; i <= toc->last_track - toc->ignore_last_track; i++) {
sprintf(temp, "%08X", toc->toc_entries[i - 1].first_frame);
- sha_update(&sha, (unsigned char*) temp, strlen(temp));
+ av_sha_update(sha_ctx, (unsigned char*) temp, strlen(temp));
}
for (i = toc->last_track - toc->ignore_last_track + 1; i < 100; i++) {
- sha_update(&sha, (unsigned char*) temp, strlen(temp));
+ av_sha_update(sha_ctx, (unsigned char*) temp, strlen(temp));
}
- sha_final(digest, &sha);
+ av_sha_final(sha_ctx, digest);
+ free(sha_ctx);
- base64 = rfc822_binary(digest, 20, &size);
- base64[size] = 0;
+ av_base64_encode(base64, 39, digest, 20);
_x_meta_info_set_utf8(this->stream, XINE_META_INFO_CDINDEX_DISCID, base64);
-
- free (base64);
}
/*
@@ -1910,26 +1908,15 @@ static void _cdda_free_cddb_info(cdda_input_plugin_t *this) {
int t;
for(t = 0; t < this->cddb.num_tracks; t++) {
- if(this->cddb.track[t].title)
- free(this->cddb.track[t].title);
+ free(this->cddb.track[t].title);
}
free(this->cddb.track);
-
- if(this->cddb.cdiscid)
- free(this->cddb.cdiscid);
-
- if(this->cddb.disc_title)
- free(this->cddb.disc_title);
-
- if(this->cddb.disc_artist)
- free(this->cddb.disc_artist);
-
- if(this->cddb.disc_category)
- free(this->cddb.disc_category);
-
- if(this->cddb.disc_year)
- free(this->cddb.disc_year);
+ free(this->cddb.cdiscid);
+ free(this->cddb.disc_title);
+ free(this->cddb.disc_artist);
+ free(this->cddb.disc_category);
+ free(this->cddb.disc_year);
}
}
@@ -2162,7 +2149,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) {
cdda_input_plugin_t *this = (cdda_input_plugin_t *) this_gen;
int err = 0;
@@ -2283,8 +2270,7 @@ static void cdda_plugin_dispose (input_plugin_t *this_gen ) {
free(this->mrl);
- if (this->cdda_device)
- free(this->cdda_device);
+ free(this->cdda_device);
if (this->class) {
cdda_input_class_t *inp = (cdda_input_class_t *) this->class;
inp->ip = NULL;
@@ -2450,127 +2436,6 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
return 1;
}
-static xine_mrl_t** cdda_class_get_dir(input_class_t *this_gen,
- const char *filename,
- int *num_files) {
- cdda_input_class_t *this = (cdda_input_class_t *) this_gen;
- cdda_input_plugin_t *ip;
- cdrom_toc *toc;
- char *base_mrl;
- int len, frame;
- const char * device;
- int fd, i, err = -1;
- int num_tracks;
-
- if (filename && *filename) {
- device = filename;
- if (strncasecmp(device,"cdda:/",6) == 0) {
- device += 6;
- while ('/' == *device)
- device++;
- device--;
- }
- }
- else {
- device = this->cdda_device;
- }
- lprintf("cdda_class_get_dir for >%s<\n", device);
-
- /* get the CD TOC */
- toc = init_cdrom_toc();
-
- fd = -1;
-
- /* we create a new instance because getting a directory of a cd
- * should not affect another cd that might be playing. */
- ip = (cdda_input_plugin_t *)xine_xmalloc(sizeof(cdda_input_plugin_t));
- ip->stream = NULL;
- ip->fd = -1;
- ip->net_fd = -1;
-
-#ifndef WIN32
- if( strchr(device,':') ) {
- fd = network_connect(ip->stream, device);
- if( fd != -1 ) {
- err = network_read_cdrom_toc(ip->stream, fd, toc);
- }
- }
-#endif
-
- if (fd == -1) {
- if (cdda_open(ip, device, toc, &fd) == -1) {
- lprintf("cdda_class_get_dir: opening >%s< failed %s\n",
- device, strerror(errno));
- free(ip);
- return NULL;
- }
-
-#ifndef WIN32
- err = read_cdrom_toc(fd, toc);
-#else
- err = read_cdrom_toc(ip, toc);
-#endif /* WIN32 */
- }
-
-#ifdef LOG
- print_cdrom_toc(toc);
-#endif
-
- cdda_close(ip);
-
- if ( err < 0 ) {
- free(ip);
- return NULL;
- }
-
- num_tracks = toc->last_track - toc->first_track + 1;
-
- /* this could be done in read_cdrom_toc, but it seems other code doesn't use it */
- frame = toc->leadout_track.first_frame;
- for ( i = num_tracks-1 ; i >= 0 ; i--) {
- toc->toc_entries[i].total_frames = frame - toc->toc_entries[i].first_frame;
- frame = toc->toc_entries[i].first_frame;
- }
-
- if (toc->ignore_last_track)
- num_tracks--;
-
- len = strlen(device) + 5;
- base_mrl = xine_xmalloc(len+1);
- sprintf(base_mrl, "cdda:%s", device);
-
- /* allocate space for the mrls's if needed. */
- if (num_tracks+1 > this->mrls_allocated_entries) {
- this->mrls = realloc(this->mrls, (num_tracks+1) * sizeof(xine_mrl_t*));
- }
- for (i = 0 ; i < num_tracks ; i++) {
- if (i < this->mrls_allocated_entries) {
- MRL_ZERO(this->mrls[i]);
- }
- else {
- this->mrls[i] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t));
- this->mrls[i]->link = NULL;
- this->mrls_allocated_entries++;
- }
- this->mrls[i]->origin = strdup(base_mrl);
- this->mrls[i]->mrl = xine_xmalloc(len+4);
- sprintf( this->mrls[i]->mrl, "%s/%d", base_mrl, i+toc->first_track);
- this->mrls[i]->type = mrl_cda | mrl_file_blockdev;
- this->mrls[i]->size = toc->toc_entries[i].total_frames * CD_RAW_FRAME_SIZE;
- }
- /* Clean up */
- while(this->mrls_allocated_entries > num_tracks) {
- MRL_ZERO(this->mrls[this->mrls_allocated_entries - 1]);
- free(this->mrls[this->mrls_allocated_entries--]);
- }
- free_cdrom_toc(toc);
- free(ip);
-
- this->mrls[num_tracks] = NULL;
- *num_files = num_tracks;
- return this->mrls;
-}
-
static void free_autoplay_list(cdda_input_class_t *this)
{
/* free old playlist */
@@ -2586,7 +2451,7 @@ static void free_autoplay_list(cdda_input_class_t *this)
}
}
-static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
+static const char * const * cdda_class_get_autoplay_list (input_class_t *this_gen,
int *num_files) {
cdda_input_class_t *this = (cdda_input_class_t *) this_gen;
@@ -2664,7 +2529,7 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen,
free_cdrom_toc(toc);
if (ip != this->ip) free(ip);
- return this->autoplaylist;
+ return (const char * const *)this->autoplaylist;
}
static input_plugin_t *cdda_class_get_instance (input_class_t *cls_gen, xine_stream_t *stream,
@@ -2673,7 +2538,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;
@@ -2754,24 +2619,12 @@ 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;
}
-static const char *cdda_class_get_identifier (input_class_t *this_gen) {
- return "cdda";
-}
-
-static const char *cdda_class_get_description (input_class_t *this_gen) {
- return _("CD Digital Audio (aka. CDDA)");
-}
-
static void cdda_class_dispose (input_class_t *this_gen) {
cdda_input_class_t *this = (cdda_input_class_t *) this_gen;
config_values_t *config = this->xine->config;
@@ -2780,7 +2633,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
@@ -2815,9 +2667,10 @@ static void *init_plugin (xine_t *xine, void *data) {
config = xine->config;
this->input_class.get_instance = cdda_class_get_instance;
- this->input_class.get_identifier = cdda_class_get_identifier;
- this->input_class.get_description = cdda_class_get_description;
- this->input_class.get_dir = cdda_class_get_dir;
+ this->input_class.identifier = "cdda";
+ this->input_class.description = N_("CD Digital Audio (aka. CDDA)");
+ /* this->input_class.get_dir = cdda_class_get_dir; */
+ this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = cdda_class_get_autoplay_list;
this->input_class.dispose = cdda_class_dispose;
this->input_class.eject_media = cdda_class_eject_media;
@@ -2855,14 +2708,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"),
@@ -2883,7 +2728,7 @@ static void *init_plugin (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "CD", XINE_VERSION_CODE, NULL, init_plugin },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "CD", XINE_VERSION_CODE, NULL, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c
index 9077c221b..6b791d355 100644
--- a/src/input/input_dvb.c
+++ b/src/input/input_dvb.c
@@ -71,7 +71,10 @@
#endif
/* pthread.h must be included first so rest of the headers are imported
- thread safely (on some systems). */
+ 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>
@@ -97,9 +100,17 @@
#endif
#include <ctype.h>
-/* These will eventually be #include <linux/dvb/...> */
-#include "dvb/dmx.h"
-#include "dvb/frontend.h"
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <crc.h>
+#else
+# include <libavutil/crc.h>
+#endif
+
+/* XDG */
+#include <basedir.h>
+
+#include <linux/dvb/dmx.h>
+#include <linux/dvb/frontend.h>
#define LOG_MODULE "input_dvb"
#define LOG_VERBOSE
@@ -108,9 +119,9 @@
#define LOG_READS
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#define BUFSIZE 16384
@@ -229,9 +240,8 @@ typedef struct {
int adapter_num;
- char frontend_device[100];
- char dvr_device[100];
- char demux_device[100];
+ char *dvr_device;
+ char *demux_device;
struct dmx_pes_filter_params pesFilterParams[MAX_FILTERS];
struct dmx_pes_filter_params subFilterParams[MAX_SUBTITLES];
@@ -286,12 +296,13 @@ typedef struct {
xine_t *xine;
- char *mrls[6];
+ const char *mrls[6];
int numchannels;
char *autoplaylist[MAX_AUTOCHANNELS];
- char *default_channels_conf_filename;
+
+ const AVCRC *av_crc;
} dvb_input_class_t;
typedef struct {
@@ -326,15 +337,12 @@ typedef struct {
osd_object_t *background;
xine_event_queue_t *event_queue;
- /* CRC table for PAT rebuilding */
- unsigned long crc32_table[256];
/* 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;
@@ -358,7 +366,7 @@ typedef struct {
} dvb_input_plugin_t;
typedef struct {
- char *name;
+ const char *name;
int value;
} Param;
@@ -436,7 +444,7 @@ static const Param transmissionmode_list [] = {
};
-time_t dvb_mjdtime (char *buf);
+static time_t dvb_mjdtime (uint8_t *buf);
static void load_epg_data(dvb_input_plugin_t *this);
static void show_eit(dvb_input_plugin_t *this);
@@ -452,28 +460,6 @@ static void print_info(const char* estring) {
}
#endif
-static void ts_build_crc32_table(dvb_input_plugin_t *this) {
- uint32_t i, j, k;
-
- for( i = 0 ; i < 256 ; i++ ) {
- k = 0;
- for (j = (i << 24) | 0x800000 ; j != 0x80000000 ; j <<= 1) {
- k = (k << 1) ^ (((k ^ j) & 0x80000000) ? 0x04c11db7 : 0);
- }
- this->crc32_table[i] = k;
- }
-}
-
-static uint32_t ts_compute_crc32(dvb_input_plugin_t *this, uint8_t *data,
- uint32_t length, uint32_t crc32) {
- uint32_t i;
-
- for(i = 0; i < length; i++) {
- crc32 = (crc32 << 8) ^ this->crc32_table[(crc32 >> 24) ^ data[i]];
- }
- return crc32;
-}
-
static unsigned int getbits(unsigned char *buffer, unsigned int bitpos, unsigned int bitcount)
{
@@ -517,7 +503,7 @@ static int find_descriptor(uint8_t tag, const unsigned char *buf, int descriptor
/* Extract UTC time and date encoded in modified julian date format and return it as a time_t.
*/
-time_t dvb_mjdtime (char *buf)
+static time_t dvb_mjdtime (uint8_t *buf)
{
int i;
unsigned int year, month, day, hour, min, sec;
@@ -575,8 +561,9 @@ static void tuner_dispose(tuner_t * this)
if (this->fd_subfilter[x] >= 0)
close(this->fd_subfilter[x]);
- if(this)
- free(this);
+ free(this->dvr_device);
+ free(this->demux_device);
+ free(this);
}
@@ -586,11 +573,10 @@ static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter)
tuner_t *this;
int x;
int test_video;
- char *video_device=malloc(100);
+ char *video_device = NULL;
+ char *frontend_device = NULL;
- _x_assert(video_device != NULL);
-
- this = calloc(1, sizeof(tuner_t));
+ this = (tuner_t *) xine_xmalloc(sizeof(tuner_t));
_x_assert(this != NULL);
@@ -601,21 +587,24 @@ static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter)
this->xine = xine;
this->adapter_num = adapter;
- snprintf(this->frontend_device,100,"/dev/dvb/adapter%i/frontend0",this->adapter_num);
- snprintf(this->demux_device,100,"/dev/dvb/adapter%i/demux0",this->adapter_num);
- snprintf(this->dvr_device,100,"/dev/dvb/adapter%i/dvr0",this->adapter_num);
- snprintf(video_device,100,"/dev/dvb/adapter%i/video0",this->adapter_num);
+ this->demux_device = _x_asprintf("/dev/dvb/adapter%i/demux0",this->adapter_num);
+ this->dvr_device = _x_asprintf("/dev/dvb/adapter%i/dvr0",this->adapter_num);
+ video_device = _x_asprintf("/dev/dvb/adapter%i/video0",this->adapter_num);
- if ((this->fd_frontend = xine_open_cloexec(this->frontend_device, O_RDWR)) < 0) {
+ frontend_device = _x_asprintf("/dev/dvb/adapter%i/frontend0",this->adapter_num);
+ if ((this->fd_frontend = xine_open_cloexec(frontend_device, O_RDWR)) < 0) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "FRONTEND DEVICE: %s\n", strerror(errno));
tuner_dispose(this);
- return NULL;
+ this = NULL;
+ goto exit;
}
+ free(frontend_device); frontend_device = NULL;
if ((ioctl(this->fd_frontend, FE_GET_INFO, &this->feinfo)) < 0) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "FE_GET_INFO: %s\n", strerror(errno));
tuner_dispose(this);
- return NULL;
+ this = NULL;
+ goto exit;
}
for (x = 0; x < MAX_FILTERS; x++) {
@@ -623,7 +612,8 @@ static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter)
if (this->fd_pidfilter[x] < 0) {
xprintf(this->xine, XINE_VERBOSITY_DEBUG, "DEMUX DEVICE PIDfilter: %s\n", strerror(errno));
tuner_dispose(this);
- return NULL;
+ this = NULL;
+ goto exit;
}
}
for (x = 0; x < MAX_SUBTITLES; x++) {
@@ -655,7 +645,9 @@ static tuner_t *XINE_MALLOC tuner_init(xine_t * xine, int adapter)
close(test_video);
}
+ exit:
free(video_device);
+ free(frontend_device);
return this;
}
@@ -889,15 +881,13 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch
FILE *f;
char str[BUFSIZE];
+ char filename[BUFSIZE];
channel_t *channels = NULL;
int num_channels = 0;
int num_alloc = 0;
struct stat st;
- xine_cfg_entry_t channels_conf;
- char *filename;
- xine_config_lookup_entry(xine, "media.dvb.channels_conf", &channels_conf);
- filename = channels_conf.str_value;
+ snprintf(filename, BUFSIZE, "%s/"PACKAGE"/channels.conf", xdgConfigHome(&xine->basedir_handle));
f = fopen(filename, "r");
if (!f) {
@@ -1152,8 +1142,6 @@ static void parse_pmt(dvb_input_plugin_t *this, const unsigned char *buf, int se
switch (buf[0]) {
case 0x01:
case 0x02:
- case 0x10:
- case 0x1b:
if(!has_video) {
xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"input_dvb: Adding VIDEO : PID 0x%04x\n", elementary_pid);
dvb_set_pidfilter(this, VIDFILTER, elementary_pid, DMX_PES_VIDEO, DMX_OUT_TS_TAP);
@@ -1163,8 +1151,6 @@ static void parse_pmt(dvb_input_plugin_t *this, const unsigned char *buf, int se
case 0x03:
case 0x04:
- case 0x0f:
- case 0x11:
if(!has_audio) {
xprintf(this->stream->xine,XINE_VERBOSITY_LOG,"input_dvb: Adding AUDIO : PID 0x%04x\n", elementary_pid);
dvb_set_pidfilter(this, AUDFILTER, elementary_pid, DMX_PES_AUDIO, DMX_OUT_TS_TAP);
@@ -1232,8 +1218,8 @@ static void parse_pmt(dvb_input_plugin_t *this, const unsigned char *buf, int se
static void dvb_parse_si(dvb_input_plugin_t *this) {
- char *tmpbuffer;
- char *bufptr;
+ uint8_t *tmpbuffer;
+ uint8_t *bufptr;
int service_id;
int result;
int section_len;
@@ -1341,8 +1327,8 @@ done:
/* 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;
@@ -1432,8 +1418,8 @@ static void load_epg_data(dvb_input_plugin_t *this)
int section_len = 0;
unsigned int service_id=-1;
int n;
- char *eit = NULL;
- char *foo = NULL;
+ uint8_t *eit = NULL;
+ uint8_t *foo = NULL;
char *seen_channels = NULL;
int text_len;
struct pollfd fd;
@@ -1617,7 +1603,7 @@ static void load_epg_data(dvb_input_plugin_t *this)
case 0x54: { /* Content Descriptor, riveting stuff */
int content_bits = getbits(eit, 8, 4);
- char *content[] = {
+ static const char *const content[] = {
"UNKNOWN","MOVIE","NEWS","ENTERTAINMENT","SPORT",
"CHILDRENS","MUSIC","ARTS/CULTURE","CURRENT AFFAIRS",
"EDUCATIONAL","INFOTAINMENT","SPECIAL","COMEDY","DRAMA",
@@ -2482,12 +2468,12 @@ static void ts_rewrite_packets (dvb_input_plugin_t *this, unsigned char * origin
originalPkt[11]=(this->channels[this->channel].pmtpid >> 8) & 0xff;
originalPkt[12]=this->channels[this->channel].pmtpid & 0xff;
- crc= ts_compute_crc32 (this, originalPkt+1, 12, 0xffffffff);
+ crc = av_crc(this->class->av_crc, 0xffffffff, originalPkt+1, 12);
- originalPkt[13]=(crc>>24) & 0xff;
- originalPkt[14]=(crc>>16) & 0xff;
- originalPkt[15]=(crc>>8) & 0xff;
- originalPkt[16]=crc & 0xff;
+ originalPkt[13]=(crc ) & 0xff;
+ originalPkt[14]=(crc>> 8) & 0xff;
+ originalPkt[15]=(crc>>16) & 0xff;
+ originalPkt[16]=(crc>>24) & 0xff;
memset(originalPkt+17,0xFF,PKT_SIZE-21); /* stuff the remainder */
}
@@ -2500,8 +2486,10 @@ 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;
+ uint8_t *buf = buf_gen;
+
off_t n=0, total=0;
int have_mutex=0;
struct pollfd pfd;
@@ -2845,7 +2833,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
* by numbers...
*/
size_t 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);
@@ -2862,7 +2850,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) {
@@ -3104,8 +3092,6 @@ static int dvb_plugin_open(input_plugin_t * this_gen)
snprintf(str, 256, "%s", this->channels[this->channel].name);
_x_meta_info_set(this->stream, XINE_META_INFO_TITLE, str);
- /* compute CRC table for rebuilding pat */
- ts_build_crc32_table(this);
/* Clear all pids, the pmt will tell us which to use */
for (x = 0; x < MAX_FILTERS; x++){
@@ -3176,22 +3162,11 @@ static input_plugin_t *dvb_class_get_instance (input_class_t *class_gen,
* dvb input plugin class stuff
*/
-static const char *dvb_class_get_description (input_class_t *this_gen) {
- return _("DVB (Digital TV) input plugin");
-}
-
-static const char *dvb_class_get_identifier (input_class_t *this_gen) {
- return "dvb";
-}
-
-
static void dvb_class_dispose(input_class_t * this_gen)
{
dvb_input_class_t *class = (dvb_input_class_t *) this_gen;
int x;
- free(class->default_channels_conf_filename);
-
for(x=0;x<class->numchannels;x++)
free(class->autoplaylist[x]);
@@ -3203,7 +3178,7 @@ static int dvb_class_eject_media (input_class_t *this_gen) {
}
-static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
+static const char * const *dvb_class_get_autoplay_list(input_class_t * this_gen,
int *num_files)
{
dvb_input_class_t *class = (dvb_input_class_t *) this_gen;
@@ -3272,7 +3247,7 @@ static char **dvb_class_get_autoplay_list(input_class_t * this_gen,
*num_files = num_channels + lastchannel_enable.num_value;
class->numchannels = *num_files;
- return class->autoplaylist;
+ return (const char * const *)class->autoplaylist;
}
static void *init_class (xine_t *xine, void *data) {
@@ -3286,8 +3261,8 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = dvb_class_get_instance;
- this->input_class.get_identifier = dvb_class_get_identifier;
- this->input_class.get_description = dvb_class_get_description;
+ this->input_class.identifier = "dvb";
+ this->input_class.description = N_("DVB (Digital TV) input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = dvb_class_get_autoplay_list;
this->input_class.dispose = dvb_class_dispose;
@@ -3300,8 +3275,7 @@ static void *init_class (xine_t *xine, void *data) {
this->mrls[4] = "dvba://";
this->mrls[5] = 0;
- this->default_channels_conf_filename = _x_asprintf("%s/.xine/channels.conf",
- xine_get_homedir());
+ this->av_crc = av_crc_get_table(AV_CRC_32_IEEE);
xprintf(this->xine,XINE_VERBOSITY_DEBUG,"init class succeeded\n");
@@ -3327,6 +3301,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."),
@@ -3335,19 +3316,7 @@ static void *init_class (xine_t *xine, void *data) {
"in your system."),
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);
- /* Override the default channels file */
- config->register_filename(config, "media.dvb.channels_conf",
- this->default_channels_conf_filename,
- XINE_CONFIG_STRING_IS_FILENAME,
- _("DVB Channels config file"),
- _("DVB Channels config file to use instead of the ~/.xine/channels.conf file."),
- 21, NULL, NULL);
+
return this;
}
@@ -3358,6 +3327,6 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "DVB", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "DVB", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 8ad875a41..8bf8ab580 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -93,9 +93,9 @@
#endif
/* Xine includes */
-#include "xineutils.h"
-#include "buffer.h"
-#include "xine_internal.h"
+#include <xine/xineutils.h>
+#include <xine/buffer.h>
+#include <xine/xine_internal.h>
#include "media_helper.h"
/* Print debug messages? */
@@ -157,16 +157,12 @@
# endif /* _MSC_VER */
#endif
-/* Array to hold MRLs returned by get_autoplay_list */
-#define MAX_DIR_ENTRIES 1250
-#define MAX_STR_LEN 255
-
#if defined (__FreeBSD__)
# define off64_t off_t
# define lseek64 lseek
#endif
-static const char *dvdnav_menu_table[] = {
+static const char *const dvdnav_menu_table[] = {
NULL,
NULL,
"Title",
@@ -236,8 +232,6 @@ typedef struct {
int32_t region;
int32_t play_single_chapter;
- char *filelist[MAX_DIR_ENTRIES];
-
} dvd_input_class_t;
static void dvd_handle_events(dvd_input_plugin_t *this);
@@ -343,12 +337,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;
-
+ 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;
@@ -738,13 +731,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) ) {
@@ -858,8 +852,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;
if (len < 4)
return -1;
@@ -1484,7 +1479,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");
@@ -1595,12 +1589,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);
@@ -1625,12 +1622,12 @@ static int dvd_plugin_open (input_plugin_t *this_gen) {
static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_stream_t *stream, const char *data) {
dvd_input_plugin_t *this;
dvd_input_class_t *class = (dvd_input_class_t*)class_gen;
- static char *handled_mrl = "dvd:/";
+ static const char handled_mrl[] = "dvd:/";
trace_print("Called\n");
/* Check we can handle this MRL */
- if (strncasecmp (data, handled_mrl, strlen(handled_mrl) ) != 0)
+ if (strncasecmp (data, handled_mrl, sizeof(handled_mrl)-1 ) != 0)
return NULL;
this = calloc(1, sizeof (dvd_input_plugin_t));
@@ -1687,18 +1684,6 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st
return &this->input_plugin;
}
-static const char *dvd_class_get_description (input_class_t *this_gen) {
- trace_print("Called\n");
-
- return "DVD Navigator";
-}
-
-static const char *dvd_class_get_identifier (input_class_t *this_gen) {
- trace_print("Called\n");
-
- return "DVD";
-}
-
/* FIXME: adapt to new api. */
#if 0
static xine_mrl_t **dvd_class_get_dir (input_class_t *this_gen,
@@ -1718,17 +1703,16 @@ static xine_mrl_t **dvd_class_get_dir (input_class_t *this_gen,
}
#endif
-static char **dvd_class_get_autoplay_list (input_class_t *this_gen,
+static const char * const *dvd_class_get_autoplay_list (input_class_t *this_gen,
int *num_files) {
- dvd_input_class_t *this = (dvd_input_class_t *) this_gen;
+ static const char * const filelist[] = {"dvd:/", NULL};
+
trace_print("get_autoplay_list entered\n");
- this->filelist[0] = "dvd:/";
- this->filelist[1] = NULL;
*num_files = 1;
- return this->filelist;
+ return filelist;
}
static void dvd_class_dispose(input_class_t *this_gen) {
@@ -1756,9 +1740,9 @@ static void *init_class (xine_t *xine, void *data) {
dvd_input_class_t *this;
config_values_t *config = xine->config;
void *dvdcss;
- static const char *skip_modes[] = {"skip program", "skip part", "skip title", NULL};
- static const char *seek_modes[] = {"seek in program chain", "seek in program", NULL};
- static const char *play_single_chapter_modes[] = {"entire dvd", "one chapter", NULL};
+ static const char *const skip_modes[] = {"skip program", "skip part", "skip title", NULL};
+ static const char *const seek_modes[] = {"seek in program chain", "seek in program", NULL};
+ static const char *const play_single_chapter_modes[] = {"entire dvd", "one chapter", NULL};
trace_print("Called\n");
#ifdef INPUT_DEBUG
@@ -1771,8 +1755,8 @@ static void *init_class (xine_t *xine, void *data) {
return NULL;
this->input_class.get_instance = dvd_class_get_instance;
- this->input_class.get_identifier = dvd_class_get_identifier;
- this->input_class.get_description = dvd_class_get_description;
+ this->input_class.identifier = "DVD";
+ this->input_class.description = N_("DVD Navigator");
/*
this->input_class.get_dir = dvd_class_get_dir;
*/
@@ -1802,8 +1786,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",
@@ -1828,21 +1811,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 = _x_asprintf("%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
@@ -1923,6 +1891,6 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "DVD", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "DVD", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 2c56ae232..796c789d6 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -44,10 +44,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/input_plugin.h>
#define MAXFILES 65535
@@ -80,8 +80,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;
@@ -142,7 +142,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;
if (len < 0)
@@ -231,7 +231,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;
@@ -344,9 +344,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");
@@ -395,14 +392,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
@@ -631,14 +630,6 @@ static off_t get_file_size(char *filepathname, char *origin) {
return pstat.st_size;
}
-static const char *file_class_get_description (input_class_t *this_gen) {
- return _("file input plugin");
-}
-
-static const char *file_class_get_identifier (input_class_t *this_gen) {
- return "file";
-}
-
static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
const char *filename, int *nFiles) {
@@ -975,8 +966,8 @@ static void *init_plugin (xine_t *xine, void *data) {
config = xine->config;
this->input_class.get_instance = file_class_get_instance;
- this->input_class.get_identifier = file_class_get_identifier;
- this->input_class.get_description = file_class_get_description;
+ this->input_class.identifier = "file";
+ this->input_class.description = N_("file input plugin");
this->input_class.get_dir = file_class_get_dir;
this->input_class.get_autoplay_list = NULL;
this->input_class.dispose = file_class_dispose;
@@ -1015,6 +1006,6 @@ static void *init_plugin (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "FILE", XINE_VERSION_CODE, NULL, init_plugin },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "FILE", XINE_VERSION_CODE, NULL, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index cf97074ee..b65530912 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -24,9 +24,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#include <libgnomevfs/gnome-vfs.h>
@@ -73,8 +73,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;
@@ -217,18 +218,6 @@ gnomevfs_plugin_get_mrl (input_plugin_t *this_gen)
return this->mrl;
}
-static const char
-*gnomevfs_klass_get_description (input_class_t *this_gen)
-{
- return _("gnome-vfs input plugin as shipped with xine");
-}
-
-static const char
-*gnomevfs_klass_get_identifier (input_class_t *this_gen)
-{
- return "gnomevfs";
-}
-
static int
gnomevfs_plugin_get_optional_data (input_plugin_t *this_gen,
void *data, int data_type)
@@ -309,7 +298,7 @@ gnomevfs_klass_dispose (input_class_t *this_gen)
g_free (this);
}
-static const char *const ignore_scheme[] = { "cdda", "file", "http" };
+static const char ignore_scheme[][8] = { "cdda", "file", "http" };
static input_plugin_t *
gnomevfs_klass_get_instance (input_class_t *klass_gen, xine_stream_t *stream,
@@ -381,8 +370,8 @@ static void
this->xine = xine;
this->input_class.get_instance = gnomevfs_klass_get_instance;
- this->input_class.get_identifier = gnomevfs_klass_get_identifier;
- this->input_class.get_description = gnomevfs_klass_get_description;
+ this->input_class.identifier = "gnomevfs";
+ this->input_class.description = N_("gnome-vfs input plugin as shipped with xine");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
this->input_class.dispose = gnomevfs_klass_dispose;
@@ -395,7 +384,7 @@ static input_info_t input_info_gnomevfs = {
};
const plugin_info_t xine_plugin_info[] EXPORTED = {
- { PLUGIN_INPUT | PLUGIN_NO_UNLOAD, 17, "gnomevfs", XINE_VERSION_CODE,
+ { PLUGIN_INPUT | PLUGIN_NO_UNLOAD, 18, "gnomevfs", XINE_VERSION_CODE,
&input_info_gnomevfs, init_input_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_http.c b/src/input/input_http.c
index aec74bd5d..34437c976 100644
--- a/src/input/input_http.c
+++ b/src/input/input_http.c
@@ -40,15 +40,21 @@
#include <sys/time.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <base64.h>
+#else
+# include <libavutil/base64.h>
+#endif
+
#define LOG_MODULE "input_http"
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#include "http_helper.h"
@@ -69,7 +75,6 @@ typedef struct {
xine_stream_t *stream;
- int fh;
char *mrl;
nbc_t *nbc;
@@ -78,37 +83,33 @@ typedef struct {
off_t contentlength;
char buf[BUFSIZE];
- char proxybuf[BUFSIZE];
- char auth[BUFSIZE];
- char proxyauth[BUFSIZE];
+ char preview[MAX_PREVIEW_SIZE];
+ off_t preview_size;
char *mime_type;
-
+ const char *user_agent;
char *proto;
char *user;
char *password;
char *host;
- int port;
char *uri;
+ int port;
- const char *user_agent;
-
- char preview[MAX_PREVIEW_SIZE];
- off_t preview_size;
+ int fh;
- /* Last.FM streaming server */
- unsigned char is_lastfm;
+ /** 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];
@@ -123,13 +124,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) {
@@ -168,7 +169,7 @@ static void no_proxy_list_change_cb(void *this_gen, xine_cfg_entry_t *cfg) {
*/
static int _x_use_proxy(http_input_class_t *this, const char *host) {
const char *target;
- char *no_proxy, *domain, *ptr;
+ char *no_proxy, *domain, *ptr = NULL;
struct hostent *info;
size_t i = 0, host_len, noprox_len;
@@ -234,51 +235,15 @@ static int _x_use_proxy(http_input_class_t *this, const char *host) {
return 1;
}
-static int http_plugin_basicauth (const char *user, const char *password, char* dest, int len) {
- static char *enctable="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
- char *tmp;
- char *sptr;
- char *dptr;
- size_t count;
- int enclen;
+static void http_plugin_basicauth (const char *user, const char *password, char** dest) {
+ const size_t totlen = strlen(user) + (password ? strlen(password) : 0) + 1;
+ const size_t enclen = ((totlen + 2) * 4 ) / 3 + 12;
+ char tmp[totlen + 1];
- count = asprintf(&tmp, "%s:%s", user, (password != NULL) ? password : "");
+ snprintf(tmp, totlen + 1, "%s:%s", user, password ? : "");
- enclen = ((count + 2) / 3 ) * 4 + 1;
-
- if (len < enclen)
- return -1;
-
- sptr = tmp;
- dptr = dest;
- while (count >= 3) {
- dptr[0] = enctable[(sptr[0] & 0xFC) >> 2];
- dptr[1] = enctable[((sptr[0] & 0x3) << 4) | ((sptr[1] & 0xF0) >> 4)];
- dptr[2] = enctable[((sptr[1] & 0x0F) << 2) | ((sptr[2] & 0xC0) >> 6)];
- dptr[3] = enctable[sptr[2] & 0x3F];
- count -= 3;
- sptr += 3;
- dptr += 4;
- }
-
- if (count > 0) {
- dptr[0] = enctable[(sptr[0] & 0xFC) >> 2];
- dptr[1] = enctable[(sptr[0] & 0x3) << 4];
- dptr[2] = '=';
-
- if (count > 1) {
- dptr[1] = enctable[((sptr[0] & 0x3) << 4) | ((sptr[1] & 0xF0) >> 4)];
- dptr[2] = enctable[(sptr[1] & 0x0F) << 2];
- }
-
- dptr[3] = '=';
- dptr += 4;
- }
-
- dptr[0] = '\0';
-
- free(tmp);
- return 0;
+ *dest = malloc(enclen);
+ av_base64_encode(*dest, enclen, tmp, totlen);
}
static int http_plugin_read_metainf (http_input_plugin_t *this) {
@@ -417,8 +382,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;
@@ -644,7 +610,6 @@ static void http_plugin_dispose (input_plugin_t *this_gen ) {
if (this->user) free(this->user);
if (this->password) free(this->password);
if (this->uri) free(this->uri);
- if (this->mime_type) free(this->mime_type);
free (this);
}
@@ -678,18 +643,6 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
mime_type[0] = 0;
use_proxy = this_class->proxyhost && strlen(this_class->proxyhost);
- if (use_proxy) {
- if (this_class->proxyuser && strlen(this_class->proxyuser)) {
- if (http_plugin_basicauth (this_class->proxyuser,
- this_class->proxypassword,
- this->proxyauth, BUFSIZE)) {
- _x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "proxy error", NULL);
- return 0;
- }
- }
- }
-
-
if (!_x_parse_url(this->mrl, &this->proto, &this->host, &this->port,
&this->user, &this->password, &this->uri,
&this->user_agent)) {
@@ -701,13 +654,6 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
if (this->port == 0)
this->port = DEFAULT_HTTP_PORT;
- if (this->user && strlen(this->user)) {
- if (http_plugin_basicauth (this->user, this->password, this->auth, BUFSIZE)) {
- _x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "basic auth error", NULL);
- return -1;
- }
- }
-
if (this_class->proxyport == 0)
proxyport = DEFAULT_HTTP_PORT;
else
@@ -764,40 +710,54 @@ static int http_plugin_open (input_plugin_t *this_gen ) {
if (use_proxy) {
if (this->port != DEFAULT_HTTP_PORT) {
- buflen = snprintf (this->buf, BUFSIZE, "GET http://%s:%d%s HTTP/1.0\015\012",
- this->host, this->port, this->uri);
+ snprintf (this->buf, BUFSIZE, "GET http://%s:%d%s HTTP/1.0\015\012",
+ this->host, this->port, this->uri);
} else {
- buflen = snprintf (this->buf, BUFSIZE, "GET http://%s%s HTTP/1.0\015\012",
- this->host, this->uri);
+ snprintf (this->buf, BUFSIZE, "GET http://%s%s HTTP/1.0\015\012",
+ this->host, this->uri);
}
}
else
- buflen = snprintf (this->buf, BUFSIZE, "GET %s HTTP/1.0\015\012", this->uri);
+ snprintf (this->buf, BUFSIZE, "GET %s HTTP/1.0\015\012", this->uri);
+ buflen = strlen(this->buf);
if (this->port != DEFAULT_HTTP_PORT)
- buflen += snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s:%d\015\012",
- this->host, this->port);
+ snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s:%d\015\012",
+ this->host, this->port);
else
- buflen += snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s\015\012",
- this->host);
-
- if (this_class->proxyuser && strlen(this_class->proxyuser)) {
- buflen += snprintf (this->buf + buflen, BUFSIZE - buflen,
- "Proxy-Authorization: Basic %s\015\012", this->proxyauth);
+ snprintf (this->buf + buflen, BUFSIZE - buflen, "Host: %s\015\012",
+ this->host);
+
+ buflen = strlen(this->buf);
+ if (use_proxy && this_class->proxyuser && strlen(this_class->proxyuser)) {
+ char *proxyauth;
+ http_plugin_basicauth (this_class->proxyuser, this_class->proxypassword,
+ &proxyauth);
+
+ snprintf (this->buf + buflen, BUFSIZE - buflen,
+ "Proxy-Authorization: Basic %s\015\012", proxyauth);
+ buflen = strlen(this->buf);
+ free(proxyauth);
}
if (this->user && strlen(this->user)) {
- buflen += snprintf (this->buf + buflen, BUFSIZE - buflen,
- "Authorization: Basic %s\015\012", this->auth);
+ char *auth;
+ http_plugin_basicauth (this->user, this->password, &auth);
+
+ snprintf (this->buf + buflen, BUFSIZE - buflen,
+ "Authorization: Basic %s\015\012", auth);
+ buflen = strlen(this->buf);
+ free(auth);
}
- buflen += snprintf(this->buf + buflen, BUFSIZE - buflen,
- "User-Agent: %s%sxine/%s\015\012"
- "Accept: */*\015\012"
- "Icy-MetaData: 1\015\012"
- "\015\012",
- this->user_agent ? this->user_agent : "",
- this->user_agent ? " " : "",
- VERSION);
+ snprintf(this->buf + buflen, BUFSIZE - buflen,
+ "User-Agent: %s%sxine/%s\015\012"
+ "Accept: */*\015\012"
+ "Icy-MetaData: 1\015\012"
+ "\015\012",
+ this->user_agent ? this->user_agent : "",
+ this->user_agent ? " " : "",
+ VERSION);
+ buflen = strlen(this->buf);
if (_x_io_tcp_write (this->stream, this->fh, this->buf, buflen) != buflen) {
_x_message(this->stream, XINE_MSG_CONNECTION_REFUSED, "couldn't send request", NULL);
xprintf(this_class->xine, XINE_VERBOSITY_DEBUG, "input_http: couldn't send request\n");
@@ -859,7 +819,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"),
@@ -896,6 +861,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;
@@ -973,6 +941,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;
@@ -1066,19 +1038,10 @@ static input_plugin_t *http_class_get_instance (input_class_t *cls_gen, xine_str
return &this->input_plugin;
}
-static const char *http_class_get_description (input_class_t *this_gen) {
- return _("http input plugin");
-}
-
-static const char *http_class_get_identifier (input_class_t *this_gen) {
- return "http";
-}
-
static void http_class_dispose (input_class_t *this_gen) {
http_input_class_t *this = (http_input_class_t *) this_gen;
- if(this->proxyhost_env)
- free(this->proxyhost_env);
+ free(this->proxyhost_env);
free (this);
}
@@ -1095,8 +1058,8 @@ static void *init_class (xine_t *xine, void *data) {
config = xine->config;
this->input_class.get_instance = http_class_get_instance;
- this->input_class.get_identifier = http_class_get_identifier;
- this->input_class.get_description = http_class_get_description;
+ this->input_class.identifier = "http";
+ this->input_class.description = N_("http input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
this->input_class.dispose = http_class_dispose;
@@ -1164,6 +1127,6 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "http", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "http", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_mms.c b/src/input/input_mms.c
index 05c6722ed..ec921e106 100644
--- a/src/input/input_mms.c
+++ b/src/input/input_mms.c
@@ -41,9 +41,9 @@
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "mms.h"
#include "mmsh.h"
@@ -57,15 +57,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;
@@ -96,8 +96,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);
@@ -291,9 +292,7 @@ static void mms_plugin_dispose (input_plugin_t *this_gen) {
this->nbc = NULL;
}
- if(this->mrl)
- free(this->mrl);
-
+ free(this->mrl);
free (this);
}
@@ -444,14 +443,6 @@ static input_plugin_t *mms_class_get_instance (input_class_t *cls_gen, xine_stre
* mms input plugin class stuff
*/
-static const char *mms_class_get_description (input_class_t *this_gen) {
- return _("mms streaming input plugin");
-}
-
-static const char *mms_class_get_identifier (input_class_t *this_gen) {
- return "mms";
-}
-
static void mms_class_dispose (input_class_t *this_gen) {
mms_input_class_t *this = (mms_input_class_t *) this_gen;
@@ -472,8 +463,8 @@ static void *init_class (xine_t *xine, void *data) {
this->ip = NULL;
this->input_class.get_instance = mms_class_get_instance;
- this->input_class.get_identifier = mms_class_get_identifier;
- this->input_class.get_description = mms_class_get_description;
+ this->input_class.identifier = "mms";
+ this->input_class.description = N_("mms streaming input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
this->input_class.dispose = mms_class_dispose;
@@ -505,6 +496,6 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "mms", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "mms", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_net.c b/src/input/input_net.c
index 82ab28c1e..801093e96 100644
--- a/src/input/input_net.c
+++ b/src/input/input_net.c
@@ -66,9 +66,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#define NET_BS_LEN 2324
@@ -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);
@@ -522,20 +523,6 @@ static input_plugin_t *net_class_get_instance (input_class_t *cls_gen, xine_stre
* net plugin class
*/
-static const char *net_class_get_description (input_class_t *this_gen) {
- return _("net input plugin as shipped with xine");
-}
-
-static const char *net_class_get_identifier (input_class_t *this_gen) {
- return "TCP";
-}
-
-static void net_class_dispose (input_class_t *this_gen) {
- net_input_class_t *this = (net_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
net_input_class_t *this;
@@ -545,11 +532,11 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = net_class_get_instance;
- this->input_class.get_description = net_class_get_description;
- this->input_class.get_identifier = net_class_get_identifier;
+ this->input_class.description = N_("net input plugin as shipped with xine");
+ this->input_class.identifier = "TCP";
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = net_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return this;
@@ -561,7 +548,7 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT, 17, "tcp", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT, 18, "tcp", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
deleted file mode 100644
index c2cfd6455..000000000
--- a/src/input/input_plugin.h
+++ /dev/null
@@ -1,393 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#ifndef HAVE_INPUT_PLUGIN_H
-#define HAVE_INPUT_PLUGIN_H
-
-#include <sys/types.h>
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-# include "xineutils.h"
-# include "buffer.h"
-# include "configfile.h"
-#else
-# include <xine/os_types.h>
-# include <xine/xineutils.h>
-# include <xine/buffer.h>
-# include <xine/configfile.h>
-#endif
-
-#define INPUT_PLUGIN_IFACE_VERSION 17
-
-typedef struct input_class_s input_class_t ;
-typedef struct input_plugin_s input_plugin_t;
-
-struct input_class_s {
-
- /*
- * create a new instance of this plugin class
- * return NULL if the plugin does'nt handle the given mrl
- */
- input_plugin_t* (*get_instance) (input_class_t *this, xine_stream_t *stream, const char *mrl);
-
- /*
- * return short, human readable identifier for this plugin class
- * The returned string should not be malloc'd as it is not freed.
- */
- const char* (*get_identifier) (input_class_t *this);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- const char* (*get_description) (input_class_t *this);
-
- /*
- * ls function, optional: may be NULL
- * return value: NULL => filename is a file, **char=> filename is a dir
- */
- xine_mrl_t ** (*get_dir) (input_class_t *this, const char *filename, int *nFiles);
-
- /*
- * generate autoplay list, optional: may be NULL
- * return value: list of MRLs
- */
- char ** (*get_autoplay_list) (input_class_t *this, int *num_files);
-
- /*
- * close down, free all resources
- */
- void (*dispose) (input_class_t *this);
-
- /*
- * eject/load the media (if possible), optional: may be NULL
- *
- * returns 0 for temporary failures
- */
- int (*eject_media) (input_class_t *this);
-};
-
-struct input_plugin_s {
-
- /*
- * open the stream
- * return 0 if an error occured
- */
- int (*open) (input_plugin_t *this);
-
- /*
- * return capabilities of the current playable entity. See
- * get_current_pos below for a description of a "playable entity"
- * Capabilities a created by "OR"ing a mask of constants listed
- * below which start "INPUT_CAP".
- *
- * depending on the values set, some of the functions below
- * will or will not get called or should (not) be able to
- * do certain tasks.
- *
- * for example if INPUT_CAP_SEEKABLE is set,
- * the seek() function is expected to work fully at any time.
- * however, if the flag is not set, the seek() function should
- * make a best-effort attempt to seek, e.g. at least
- * relative forward seeking should work.
- */
- uint32_t (*get_capabilities) (input_plugin_t *this);
-
- /*
- * read nlen bytes, return number of bytes read
- * 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);
-
-
- /*
- * read one block, return newly allocated block (or NULL on failure)
- * for blocked input sources len must be == blocksize
- * the fifo parameter is only used to get access to the buffer_pool_alloc function
- */
- buf_element_t *(*read_block)(input_plugin_t *this, fifo_buffer_t *fifo, off_t len);
-
-
- /*
- * seek position, return new position
- *
- * if seeking failed, -1 is returned
- */
- off_t (*seek) (input_plugin_t *this, off_t offset, int origin);
-
-
- /*
- * seek to time position, return new position
- * time_offset is given in miliseconds
- *
- * if seeking failed, -1 is returned
- *
- * note: only SEEK_SET (0) is currently supported as origin
- * note: may be NULL is not supported
- */
- off_t (*seek_time) (input_plugin_t *this, int time_offset, int origin);
-
-
- /*
- * get current position in stream.
- *
- */
- off_t (*get_current_pos) (input_plugin_t *this);
-
-
- /*
- * get current time position in stream in miliseconds.
- *
- * note: may be NULL is not supported
- */
- int (*get_current_time) (input_plugin_t *this);
-
-
- /*
- * return number of bytes in the next playable entity or -1 if the
- * input is unlimited, as would be the case in a network stream.
- *
- * A "playable entity" tends to be the entities listed in a playback
- * list or the units on which playback control generally works on.
- * It might be the number of bytes in a VCD "segment" or "track" (if
- * the track has no "entry" subdivisions), or the number of bytes in
- * a PS (Program Segment or "Chapter") of a DVD. If there are no
- * subdivisions of the input medium and it is considered one
- * indivisible entity, it would be the byte count of that entity;
- * for example, the length in bytes of an MPEG file.
-
- * This length information is used, for example when in setting the
- * absolute or relative play position or possibly calculating the
- * bit rate.
- */
- off_t (*get_length) (input_plugin_t *this);
-
-
- /*
- * return block size in bytes of next complete playable entity (if
- * supported, 0 otherwise). See the description above under
- * get_length for a description of a "complete playable entity".
- *
- * this block size is only used for mpeg streams stored on
- * a block oriented storage media, e.g. DVDs and VCDs, to speed
- * up the demuxing process. only set this (and the INPUT_CAP_BLOCK
- * flag) if this is the case for your input plugin.
- *
- * make this function simply return 0 if unsure.
- */
-
- uint32_t (*get_blocksize) (input_plugin_t *this);
-
-
- /*
- * return current MRL
- */
- const char * (*get_mrl) (input_plugin_t *this);
-
-
- /*
- * request optional data from input plugin.
- */
- int (*get_optional_data) (input_plugin_t *this, void *data, int data_type);
-
-
- /*
- * close stream, free instance resources
- */
- void (*dispose) (input_plugin_t *this);
-
- /*
- * "backward" link to input plugin class struct
- */
-
- input_class_t *input_class;
-
- void *node; /* used by plugin loader */
-
-};
-
-/*
- * possible capabilites an input plugin can have:
- */
-#define INPUT_CAP_NOCAP 0x00000000
-
-/*
- * INPUT_CAP_SEEKABLE:
- * seek () works reliably.
- * even for plugins that do not have this flag set
- * it is a good idea to implement the seek() function
- * in a "best effort" style anyway, so at least
- * throw away data for network streams when seeking forward
- */
-
-#define INPUT_CAP_SEEKABLE 0x00000001
-
-/*
- * INPUT_CAP_BLOCK:
- * means more or less that a block device sits behind
- * this input plugin. get_blocksize must be implemented.
- * will be used for fast and efficient demuxing of
- * mpeg streams (demux_mpeg_block).
- */
-
-#define INPUT_CAP_BLOCK 0x00000002
-
-/*
- * INPUT_CAP_AUDIOLANG:
- * INPUT_CAP_SPULANG:
- * input plugin knows something about audio/spu languages,
- * e.g. knows that audio stream #0 is english,
- * audio stream #1 is german, ...
- * *((int *)data) will provide the requested channel number
- * and awaits the language back in (char *)data
- */
-
-#define INPUT_CAP_AUDIOLANG 0x00000008
-#define INPUT_CAP_SPULANG 0x00000010
-
-/*
- * INPUT_CAP_PREVIEW:
- * get_optional_data can handle INPUT_OPTIONAL_DATA_PREVIEW
- * so a non-seekable stream plugin can povide the first
- * few bytes for demuxers to look at them and decide wheter
- * they can handle the stream or not. the preview data must
- * be buffered and delivered again through subsequent
- * read() calls.
- * caller must provide a buffer allocated with at least
- * MAX_PREVIEW_SIZE bytes.
- */
-
-#define INPUT_CAP_PREVIEW 0x00000040
-
-/*
- * INPUT_CAP_CHAPTERS:
- * The media streams provided by this plugin have an internal
- * structure dividing it into segments usable for navigation.
- * For those plugins, the behaviour of the skip button in UIs
- * should be changed from "next MRL" to "next chapter" by
- * sending XINE_EVENT_INPUT_NEXT.
- */
-
-#define INPUT_CAP_CHAPTERS 0x00000080
-
-/*
- * INPUT_CAP_RIP_FORBIDDEN:
- * means that rip/disk saving must not be used.
- * (probably at author's request)
- */
-
-#define INPUT_CAP_RIP_FORBIDDEN 0x00000100
-
-
-#define INPUT_IS_SEEKABLE(input) (((input)->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0)
-
-#define INPUT_OPTIONAL_UNSUPPORTED 0
-#define INPUT_OPTIONAL_SUCCESS 1
-
-#define INPUT_OPTIONAL_DATA_AUDIOLANG 2
-#define INPUT_OPTIONAL_DATA_SPULANG 3
-#define INPUT_OPTIONAL_DATA_PREVIEW 7
-
-/* buffer is a const char **; the string is freed by the input plugin. */
-#define INPUT_OPTIONAL_DATA_MIME_TYPE 8
-/* buffer is unused; true if the demuxer should be determined by the MIME type */
-#define INPUT_OPTIONAL_DATA_DEMUX_MIME_TYPE 9
-/* buffer is a const char **; the string is static or freed by the input plugin. */
-#define INPUT_OPTIONAL_DATA_DEMUXER 10
-
-#define MAX_MRL_ENTRIES 255
-#define MAX_PREVIEW_SIZE 4096
-
-/* Types of mrls returned by get_dir() */
-#define mrl_unknown (0 << 0)
-#define mrl_dvd (1 << 0)
-#define mrl_vcd (1 << 1)
-#define mrl_net (1 << 2)
-#define mrl_rtp (1 << 3)
-#define mrl_stdin (1 << 4)
-#define mrl_cda (1 << 5)
-#define mrl_file (1 << 6)
-#define mrl_file_fifo (1 << 7)
-#define mrl_file_chardev (1 << 8)
-#define mrl_file_directory (1 << 9)
-#define mrl_file_blockdev (1 << 10)
-#define mrl_file_normal (1 << 11)
-#define mrl_file_symlink (1 << 12)
-#define mrl_file_sock (1 << 13)
-#define mrl_file_exec (1 << 14)
-#define mrl_file_backup (1 << 15)
-#define mrl_file_hidden (1 << 16)
-
-/*
- * Freeing/zeroing all of entries of given mrl.
- */
-#define MRL_ZERO(m) { \
- if((m)) { \
- free((m)->origin); \
- free((m)->mrl); \
- free((m)->link); \
- (m)->origin = NULL; \
- (m)->mrl = NULL; \
- (m)->link = NULL; \
- (m)->type = 0; \
- (m)->size = (off_t) 0; \
- } \
- }
-
-/*
- * Duplicate two mrls entries (s = source, d = destination).
- */
-#define MRL_DUPLICATE(s, d) { \
- _x_assert((s) != NULL); \
- _x_assert((d) != NULL); \
- \
- free((d)->origin); \
- (d)->origin = (s)->origin ? strdup((s)->origin) : NULL; \
- \
- free((d)->mrl); \
- (d)->mrl = (s)->mrl ? strdup((s)->mrl) : NULL; \
- \
- free((d)->link); \
- (d)->link = (s)->link ? strdup((s)->link) : NULL; \
- \
- (d)->type = (s)->type; \
- (d)->size = (s)->size; \
- }
-
-/*
- * Duplicate two arrays of mrls (s = source, d = destination).
- */
-#define MRLS_DUPLICATE(s, d) { \
- int i = 0; \
- \
- _x_assert((s) != NULL); \
- _x_assert((d) != NULL); \
- \
- while((s) != NULL) { \
- d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \
- MRL_DUPLICATE(s[i], d[i]); \
- i++; \
- } \
-}
-
-
-#endif
diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c
index 6d9809a6a..2ee46768b 100644
--- a/src/input/input_pnm.c
+++ b/src/input/input_pnm.c
@@ -41,9 +41,9 @@
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "pnm.h"
#include "net_buf_ctrl.h"
@@ -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);
@@ -270,20 +271,6 @@ static input_plugin_t *pnm_class_get_instance (input_class_t *cls_gen, xine_stre
* pnm input plugin class stuff
*/
-static const char *pnm_class_get_description (input_class_t *this_gen) {
- return _("pnm streaming input plugin");
-}
-
-static const char *pnm_class_get_identifier (input_class_t *this_gen) {
- return "pnm";
-}
-
-static void pnm_class_dispose (input_class_t *this_gen) {
- pnm_input_class_t *this = (pnm_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
pnm_input_class_t *this;
@@ -293,11 +280,11 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = pnm_class_get_instance;
- this->input_class.get_identifier = pnm_class_get_identifier;
- this->input_class.get_description = pnm_class_get_description;
+ this->input_class.identifier = "pnm";
+ this->input_class.description = N_("pnm streaming input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = pnm_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return this;
@@ -309,7 +296,7 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT, 17, "pnm", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT, 18, "pnm", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index 9686feb45..0503316da 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -114,10 +114,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/input_plugin.h>
#define PVR_DEVICE "/dev/video0"
@@ -427,8 +427,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;
if (len < 4)
return -1;
@@ -1537,22 +1538,6 @@ static input_plugin_t *pvr_class_get_instance (input_class_t *cls_gen, xine_stre
/*
* plugin class functions
*/
-
-static const char *pvr_class_get_description (input_class_t *this_gen) {
- return _("WinTV-PVR 250/350 input plugin");
-}
-
-static const char *pvr_class_get_identifier (input_class_t *this_gen) {
- return "pvr";
-}
-
-
-static void pvr_class_dispose (input_class_t *this_gen) {
- pvr_input_class_t *this = (pvr_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_plugin (xine_t *xine, void *data) {
pvr_input_class_t *this;
@@ -1571,11 +1556,11 @@ static void *init_plugin (xine_t *xine, void *data) {
NULL);
this->input_class.get_instance = pvr_class_get_instance;
- this->input_class.get_identifier = pvr_class_get_identifier;
- this->input_class.get_description = pvr_class_get_description;
+ this->input_class.identifier = "pvr";
+ this->input_class.description = N_("WinTV-PVR 250/350 input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = pvr_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return this;
@@ -1587,7 +1572,7 @@ static void *init_plugin (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "pvr", XINE_VERSION_CODE, NULL, init_plugin },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "pvr", XINE_VERSION_CODE, NULL, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c
index a7102fccd..c62c4ce9b 100644
--- a/src/input/input_rtp.c
+++ b/src/input/input_rtp.c
@@ -91,9 +91,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#ifdef __GNUC__
@@ -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;
@@ -776,21 +777,6 @@ static input_plugin_t *rtp_class_get_instance (input_class_t *cls_gen,
/*
* net plugin class
*/
-
-static const char *rtp_class_get_description (input_class_t *this_gen) {
- return _("RTP and UDP input plugin as shipped with xine");
-}
-
-static const char *rtp_class_get_identifier (input_class_t *this_gen) {
- return "RTP/UDP";
-}
-
-static void rtp_class_dispose (input_class_t *this_gen) {
- rtp_input_class_t *this = (rtp_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
rtp_input_class_t *this;
@@ -801,11 +787,11 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = rtp_class_get_instance;
- this->input_class.get_description = rtp_class_get_description;
- this->input_class.get_identifier = rtp_class_get_identifier;
+ this->input_class.description = N_("RTP and UDP input plugin as shipped with xine");
+ this->input_class.identifier = "RTP/UDP";
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = rtp_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return this;
@@ -817,7 +803,7 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT, 17, "rtp", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT, 18, "rtp", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c
index 0b7629767..41885698d 100644
--- a/src/input/input_rtsp.c
+++ b/src/input/input_rtsp.c
@@ -41,9 +41,9 @@
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "librtsp/rtsp_session.h"
#include "net_buf_ctrl.h"
@@ -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;
@@ -290,21 +290,6 @@ static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_str
/*
* rtsp input plugin class stuff
*/
-
-static const char *rtsp_class_get_description (input_class_t *this_gen) {
- return _("rtsp streaming input plugin");
-}
-
-static const char *rtsp_class_get_identifier (input_class_t *this_gen) {
- return "rtsp";
-}
-
-static void rtsp_class_dispose (input_class_t *this_gen) {
- rtsp_input_class_t *this = (rtsp_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
rtsp_input_class_t *this;
@@ -314,11 +299,11 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = rtsp_class_get_instance;
- this->input_class.get_identifier = rtsp_class_get_identifier;
- this->input_class.get_description = rtsp_class_get_description;
+ this->input_class.identifier = "rtsp";
+ this->input_class.description = N_("rtsp streaming input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = rtsp_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return this;
@@ -330,7 +315,7 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT, 17, "rtsp", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT, 18, "rtsp", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index e3ad51eb1..f3c2c035d 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -23,10 +23,10 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "compat.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+#include <xine/input_plugin.h>
#include <libsmbclient.h>
#include <sys/types.h>
@@ -51,7 +51,7 @@ typedef struct {
xine_stream_t *stream;
/* File */
- const char *mrl;
+ char *mrl;
int fd;
} smb_input_t;
@@ -64,9 +64,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;
if (len < 0)
@@ -159,18 +160,6 @@ static uint32_t smb_plugin_get_blocksize (input_plugin_t *this_gen) {
return 0;
}
-static const char
-*smb_class_get_description (input_class_t *this_gen)
-{
- return _("CIFS/SMB input plugin based on libsmbclient");
-}
-
-static const char
-*smb_class_get_identifier (input_class_t *this_gen)
-{
- return "smb";
-}
-
/*
* Sorting function, it comes from GNU fileutils package.
*/
@@ -432,7 +421,7 @@ smb_plugin_dispose (input_plugin_t *this_gen )
if (this->fd>=0)
smbc_close(this->fd);
if (this->mrl)
- free ((char *)this->mrl);
+ free (this->mrl);
free (this);
}
@@ -519,8 +508,8 @@ static void
this->xine = xine;
this->input_class.get_instance = smb_class_get_instance;
- this->input_class.get_identifier = smb_class_get_identifier;
- this->input_class.get_description = smb_class_get_description;
+ this->input_class.identifier = "smb";
+ this->input_class.description = N_("CIFS/SMB input plugin based on libsmbclient");
this->input_class.get_dir = smb_class_get_dir;
this->input_class.get_autoplay_list = NULL;
this->input_class.dispose = smb_class_dispose;
@@ -541,7 +530,7 @@ static const input_info_t input_info_smb = {
};
const plugin_info_t xine_plugin_info[] EXPORTED = {
- { PLUGIN_INPUT, 17, "smb", XINE_VERSION_CODE, &input_info_smb,
+ { PLUGIN_INPUT, 18, "smb", XINE_VERSION_CODE, &input_info_smb,
init_input_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c
index d3a2e83e1..e0aecdc39 100644
--- a/src/input/input_stdin_fifo.c
+++ b/src/input/input_stdin_fifo.c
@@ -36,9 +36,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "net_buf_ctrl.h"
#define BUFSIZE 1024
@@ -79,9 +79,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);
@@ -354,21 +355,6 @@ static input_plugin_t *stdin_class_get_instance (input_class_t *class_gen,
/*
* stdin input plugin class stuff
*/
-
-static const char *stdin_class_get_description (input_class_t *this_gen) {
- return _("stdin streaming input plugin");
-}
-
-static const char *stdin_class_get_identifier (input_class_t *this_gen) {
- return "stdin_fifo";
-}
-
-static void stdin_class_dispose (input_class_t *this_gen) {
- stdin_input_class_t *this = (stdin_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *data) {
stdin_input_class_t *this;
@@ -378,11 +364,11 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = stdin_class_get_instance;
- this->input_class.get_identifier = stdin_class_get_identifier;
- this->input_class.get_description = stdin_class_get_description;
+ this->input_class.identifier = "stdin_fifo";
+ this->input_class.description = N_("stdin streaming input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = stdin_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return this;
@@ -394,6 +380,6 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT, 17, "stdin", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT, 18, "stdin", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index b88c4821d..c91b273e7 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -62,15 +62,35 @@
#define XINE_ENABLE_EXPERIMENTAL_FEATURES
/********** logging **********/
-#define LOG_MODULE "input_v4l"
+/* #define LOG_MODULE "input_v4l" */
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#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/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#define NUM_FRAMES 15
@@ -97,8 +117,12 @@ static const resolution_t resolutions[] = {
#define AUDIO_DEV "plughw:0,0"
#endif
-static char *tv_standard_names[] = { "AUTO", "PAL", "NTSC", "SECAM", "OLD", NULL };
-static int tv_standard_values[] = { VIDEO_MODE_AUTO, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM, -1 };
+static const char *const tv_standard_names[] = { "AUTO", "PAL", "NTSC", "SECAM", "OLD", NULL };
+static const int tv_standard_values[] = { VIDEO_MODE_AUTO, VIDEO_MODE_PAL, VIDEO_MODE_NTSC, VIDEO_MODE_SECAM, -1 };
+
+#if !defined(NDELAY) && defined(O_NDELAY)
+#define FNDELAY O_NDELAY
+#endif
typedef struct pvrscr_s pvrscr_t;
@@ -559,7 +583,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"
@@ -884,6 +909,10 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
_x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
_x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 1);
+ /* Pre-allocate some frames for audio and video so it doesn't have to be
+ * done during capture */
+ allocate_frames(this, 1);
+
/* Unmute audio off video capture device */
unmute_audio(this);
@@ -1217,7 +1246,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;
}
@@ -1865,25 +1894,6 @@ static input_plugin_t *v4l_class_get_radio_instance (input_class_t *cls_gen,
/*
* v4l input plugin class stuff
*/
-
-static const char *v4l_class_get_video_description (input_class_t *this_gen) {
- return _("v4l tv input plugin");
-}
-
-static const char *v4l_class_get_radio_description (input_class_t *this_gen) {
- return _("v4l radio input plugin");
-}
-
-static const char *v4l_class_get_identifier (input_class_t *this_gen) {
- return "v4l";
-}
-
-static void v4l_class_dispose (input_class_t *this_gen) {
- v4l_input_class_t *this = (v4l_input_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_video_class (xine_t *xine, void *data)
{
v4l_input_class_t *this;
@@ -1894,11 +1904,11 @@ static void *init_video_class (xine_t *xine, void *data)
this->xine = xine;
this->input_class.get_instance = v4l_class_get_video_instance;
- this->input_class.get_identifier = v4l_class_get_identifier;
- this->input_class.get_description = v4l_class_get_video_description;
+ this->input_class.identifier = "v4l";
+ this->input_class.description = N_("v4l tv input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = v4l_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
config->register_filename (config, "media.video4linux.video_device",
@@ -1914,7 +1924,7 @@ static void *init_video_class (xine_t *xine, void *data)
"to your Video4Linux video device."),
10, NULL, NULL);
#endif
- config->register_enum (config, "media.video4linux.tv_standard", 4 /* old */,
+ config->register_enum (config, "media.video4linux.tv_standard", 0 /* auto */,
tv_standard_names, _("v4l TV standard"),
_("Selects the TV standard of the input signals. "
"Either: AUTO, PAL, NTSC or SECAM. "), 20, NULL, NULL);
@@ -1932,11 +1942,11 @@ static void *init_radio_class (xine_t *xine, void *data)
this->xine = xine;
this->input_class.get_instance = v4l_class_get_radio_instance;
- this->input_class.get_identifier = v4l_class_get_identifier;
- this->input_class.get_description = v4l_class_get_radio_description;
+ this->input_class.identifier = "v4l";
+ this->input_class.description = N_("v4l radio input plugin");
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = v4l_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
config->register_filename (config, "media.video4linux.radio_device",
@@ -1954,8 +1964,8 @@ static void *init_radio_class (xine_t *xine, void *data)
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "v4l_radio", XINE_VERSION_CODE, NULL, init_radio_class },
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "v4l_tv", XINE_VERSION_CODE, NULL, init_video_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "v4l_radio", XINE_VERSION_CODE, NULL, init_radio_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "v4l_tv", XINE_VERSION_CODE, NULL, init_video_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_v4l2.c b/src/input/input_v4l2.c
index 8411b8cc3..da567e931 100644
--- a/src/input/input_v4l2.c
+++ b/src/input/input_v4l2.c
@@ -29,9 +29,9 @@
/*
#define LOG
*/
-#include "input_plugin.h"
-#include "xine_plugin.h"
-#include "xine_internal.h"
+#include <xine/input_plugin.h>
+#include <xine/xine_plugin.h>
+#include <xine/xine_internal.h>
#include <string.h>
#include <sys/types.h>
@@ -340,7 +340,7 @@ static void v4l2_input_dispose(input_plugin_t *this_gen) {
free(this);
}
-static off_t v4l2_input_read(input_plugin_t *this_gen, char *buf, off_t nlen) {
+static off_t v4l2_input_read(input_plugin_t *this_gen, void *buf, off_t nlen) {
/* Only block reads are supported. */
return 0;
}
@@ -430,28 +430,15 @@ static input_plugin_t *v4l2_class_get_instance(input_class_t *gen_cls, xine_stre
return &this->input_plugin;
}
-static const char *v4l2_class_get_description(input_class_t *this_gen) {
- /* TODO: Translatable with _() */
- return "v4l2 input plugin";
-}
-
-static const char *v4l2_class_get_identifier(input_class_t *this_gen) {
- return "v4l2";
-}
-
-static void v4l2_class_dispose(input_class_t *this_gen) {
- free(this_gen);
-}
-
static void *v4l2_init_class(xine_t *xine, void *data) {
v4l2_input_class_t *this;
- this = malloc(sizeof(v4l2_input_class_t));
+ this = calloc(1, sizeof(v4l2_input_class_t));
this->input_class.get_instance = v4l2_class_get_instance;
- this->input_class.get_description = v4l2_class_get_description;
- this->input_class.get_identifier = v4l2_class_get_identifier;
+ this->input_class.description = N_("v4l2 input plugin");
+ this->input_class.identifier = "v4l2";
this->input_class.get_dir = NULL;
this->input_class.get_autoplay_list = NULL;
- this->input_class.dispose = v4l2_class_dispose;
+ this->input_class.dispose = default_input_class_dispose;
this->input_class.eject_media = NULL;
return &this->input_class;
}
@@ -462,6 +449,6 @@ const input_info_t input_info_v4l2 = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT, 17, "v4l2", XINE_VERSION_CODE, &input_info_v4l2, v4l2_init_class },
+ { PLUGIN_INPUT, 18, "v4l2", XINE_VERSION_CODE, &input_info_v4l2, v4l2_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 3f31c7c9d..6eee5075a 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -46,9 +46,9 @@
#error "you need to add cdrom / VCD support for your platform to input_vcd and configure.in"
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "media_helper.h"
#if defined(__sun)
@@ -338,9 +338,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;
@@ -396,8 +397,9 @@ static off_t vcd_plugin_read (input_plugin_t *this_gen,
}
#elif defined (__FreeBSD_kernel__) || (defined(BSD) && BSD >= 199306)
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;
@@ -420,9 +422,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;
@@ -920,15 +923,6 @@ static input_plugin_t *vcd_class_get_instance (input_class_t *cls_gen, xine_stre
/*
* vcd input plugin class stuff
*/
-
-static const char *vcd_class_get_description (input_class_t *this_gen) {
- return _("Video CD input plugin");
-}
-
-static const char *vcd_class_get_identifier (input_class_t *this_gen) {
- return "vcdo";
-}
-
static void vcd_filelist_dispose(vcd_input_class_t *this) {
if ( this->filelist == NULL ) return;
@@ -1064,7 +1058,7 @@ static char ** vcd_class_get_autoplay_list (input_class_t *this_gen, int *num_fi
/* printf ("%d tracks\n", this->total_tracks); */
- return this->filelist;
+ return (const char * const *)this->filelist;
}
static void *init_class (xine_t *xine, void *data) {
@@ -1077,8 +1071,8 @@ static void *init_class (xine_t *xine, void *data) {
this->xine = xine;
this->input_class.get_instance = vcd_class_get_instance;
- this->input_class.get_identifier = vcd_class_get_identifier;
- this->input_class.get_description = vcd_class_get_description;
+ this->input_class.identifier = "vcdo";
+ this->input_class.description = N_("Video CD input plugin");
this->input_class.get_dir = vcd_class_get_dir;
this->input_class.get_autoplay_list = vcd_class_get_autoplay_list;
this->input_class.dispose = vcd_class_dispose;
@@ -1102,6 +1096,6 @@ static void *init_class (xine_t *xine, void *data) {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, "VCDO", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, "VCDO", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/libdvdnav/Makefile.am b/src/input/libdvdnav/Makefile.am
index 4d355bb4b..b14cd106f 100644
--- a/src/input/libdvdnav/Makefile.am
+++ b/src/input/libdvdnav/Makefile.am
@@ -1,6 +1,9 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 +26,6 @@ libdvdnav_la_SOURCES = \
dvd_input.c \
dvd_udf.c
libdvdnav_la_LIBADD = $(PTHREAD_LIBS)
-libdvdnav_la_CFLAGS = $(VISIBILITY_FLAG)
-libdvdnav_la_LDFLAGS = $(xineplug_ldflags)
noinst_HEADERS = \
decoder.h \
@@ -46,4 +47,4 @@ noinst_HEADERS = \
dvd_reader.h \
dvd_input.h \
dvd_udf.h \
- bswap.h
+ bswap.h
diff --git a/src/input/libdvdnav/diff_against_cvs.patch b/src/input/libdvdnav/diff_against_cvs.patch
index 6df704e2a..c3d69758e 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/dvd_reader.c b/src/input/libdvdnav/dvd_reader.c
index 1e0d3016b..e8e035b10 100644
--- a/src/input/libdvdnav/dvd_reader.c
+++ b/src/input/libdvdnav/dvd_reader.c
@@ -72,7 +72,7 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
#include <mntent.h>
#endif
-#include "compat.h"
+#include <xine/compat.h>
#include "dvd_udf.h"
#include "dvd_input.h"
#include "dvd_reader.h"
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..c3a27ba02 100644
--- a/src/input/libreal/Makefile.am
+++ b/src/input/libreal/Makefile.am
@@ -1,19 +1,12 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 $(AVUTIL_CFLAGS)
-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
+libreal_la_LIBADD = $(AVUTIL_LIBS)
diff --git a/src/input/libreal/asmrp.c b/src/input/libreal/asmrp.c
index 2c02c2f13..070d9cb34 100644
--- a/src/input/libreal/asmrp.c
+++ b/src/input/libreal/asmrp.c
@@ -47,7 +47,7 @@
*/
#include "asmrp.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
#define ASMRP_SYM_NONE 0
#define ASMRP_SYM_EOF 1
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index 9b72c7e57..7ce345717 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -37,8 +37,8 @@
#include "real.h"
#include "asmrp.h"
#include "sdpplin.h"
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#define XOR_TABLE_LEN 37
@@ -317,14 +317,13 @@ void real_calc_response_and_checksum (char *response, char *chksum, char *challe
size_t ch_len, resp_len;
int i;
char *ptr;
- char buf[128];
+ char buf[128] = { 0, };
/* initialize return values */
memset(response, 0, 64);
memset(chksum, 0, 34);
/* initialize buffer */
- memset(buf, 0, 128);
ptr=buf;
_X_BE_32C(ptr, 0xa1e9149d);
ptr+=4;
@@ -354,10 +353,10 @@ void real_calc_response_and_checksum (char *response, char *chksum, char *challe
calc_response_string (response, buf);
/* add tail */
- resp_len = strlen (response);
- strcpy (&response[resp_len], "01d0a8e3");
+ strcat(response, "01d0a8e3");
/* calculate checksum */
+ resp_len = strlen (response);
for (i=0; i<resp_len/4; i++)
chksum[i] = response[i*4];
}
diff --git a/src/input/libreal/rmff.c b/src/input/libreal/rmff.c
index 82554a350..5690eb14b 100644
--- a/src/input/libreal/rmff.c
+++ b/src/input/libreal/rmff.c
@@ -31,7 +31,7 @@
#define LOG
*/
-#include "xineutils.h"
+#include <xine/xineutils.h>
#include "bswap.h"
#include "rmff.h"
@@ -275,7 +275,7 @@ int rmff_dump_header(rmff_header_t *h, void *buf_gen, int max) {
return written;
}
-void rmff_dump_pheader(rmff_pheader_t *h, char *data) {
+void rmff_dump_pheader(rmff_pheader_t *h, uint8_t *data) {
data[0]=(h->object_version>>8) & 0xff;
data[1]=h->object_version & 0xff;
@@ -359,29 +359,23 @@ static rmff_mdpr_t *rmff_scan_mdpr(const char *data)
mdpr->stream_name_size=data[40];
if (mdpr->size < 46 + mdpr->stream_name_size)
goto fail;
- mdpr->stream_name = malloc(mdpr->stream_name_size+1);
+ mdpr->stream_name = xine_memdup0(&data[41], mdpr->stream_name_size);
if (!mdpr->stream_name)
goto fail;
- memcpy(mdpr->stream_name, &data[41], mdpr->stream_name_size);
- mdpr->stream_name[mdpr->stream_name_size]=0;
mdpr->mime_type_size=data[41+mdpr->stream_name_size];
if (mdpr->size < 46 + mdpr->stream_name_size + mdpr->mime_type_size)
goto fail;
- mdpr->mime_type = malloc(mdpr->mime_type_size+1);
+ mdpr->mime_type = xine_memdup0(&data[42+mdpr->stream_name_size], mdpr->mime_type_size);
if (!mdpr->mime_type)
goto fail;
- memcpy(mdpr->mime_type, &data[42+mdpr->stream_name_size], mdpr->mime_type_size);
- mdpr->mime_type[mdpr->mime_type_size]=0;
mdpr->type_specific_len=_X_BE_32(&data[42+mdpr->stream_name_size+mdpr->mime_type_size]);
if (mdpr->size < 46 + mdpr->stream_name_size + mdpr->mime_type_size + mdpr->type_specific_len)
goto fail;
- mdpr->type_specific_data = malloc(mdpr->type_specific_len);
+ mdpr->type_specific_data = xine_memdup(&data[46+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
if (!mdpr->type_specific_data)
goto fail;
- memcpy(mdpr->type_specific_data,
- &data[46+mdpr->stream_name_size+mdpr->mime_type_size], mdpr->type_specific_len);
return mdpr;
@@ -406,24 +400,17 @@ static rmff_cont_t *rmff_scan_cont(const char *data) {
lprintf("warning: unknown object version in CONT: 0x%04x\n", cont->object_version);
}
cont->title_len=_X_BE_16(&data[10]);
- cont->title = malloc(cont->title_len+1);
- memcpy(cont->title, &data[12], cont->title_len);
- cont->title[cont->title_len]=0;
+ cont->title = xine_memdup0(&data[12], cont->title_len);
pos=cont->title_len+12;
cont->author_len=_X_BE_16(&data[pos]);
- cont->author = malloc(cont->author_len+1);
- memcpy(cont->author, &data[pos+2], cont->author_len);
- cont->author[cont->author_len]=0;
+ cont->author = xine_memdup0(&data[pos+2], cont->author_len);
pos=pos+2+cont->author_len;
cont->copyright_len=_X_BE_16(&data[pos]);
- cont->copyright = malloc(cont->copyright_len+1);
- memcpy(cont->copyright, &data[pos+2], cont->copyright_len);
+ cont->copyright = xine_memdup0(&data[pos+2], cont->copyright_len);
cont->copyright[cont->copyright_len]=0;
pos=pos+2+cont->copyright_len;
cont->comment_len=_X_BE_16(&data[pos]);
- cont->comment = malloc(cont->comment_len+1);
- memcpy(cont->comment, &data[pos+2], cont->comment_len);
- cont->comment[cont->comment_len]=0;
+ cont->comment = xine_memdup0(&data[pos+2], cont->comment_len);
return cont;
}
@@ -488,11 +475,8 @@ rmff_header_t *rmff_scan_header(const char *data) {
break;
case MDPR_TAG:
mdpr=rmff_scan_mdpr(ptr);
- if (mdpr) /* FIXME: what to do if NULL? */
- {
- chunk_size=mdpr->size;
- header->streams[mdpr->stream_number]=mdpr;
- }
+ chunk_size=mdpr->size;
+ header->streams[mdpr->stream_number]=mdpr;
break;
case CONT_TAG:
header->cont=rmff_scan_cont(ptr);
@@ -516,6 +500,7 @@ rmff_header_t *rmff_scan_header(const char *data) {
return header;
}
+#if 0
rmff_header_t *rmff_scan_header_stream(int fd) {
rmff_header_t *header;
@@ -566,6 +551,7 @@ void rmff_scan_pheader(rmff_pheader_t *h, char *data) {
h->reserved=(uint8_t)data[10];
h->flags=(uint8_t)data[11];
}
+#endif
rmff_fileheader_t *rmff_new_fileheader(uint32_t num_headers) {
@@ -652,8 +638,7 @@ rmff_mdpr_t *rmff_new_mdpr(
mdpr->mime_type_size=strlen(mime_type);
}
mdpr->type_specific_len=type_specific_len;
- mdpr->type_specific_data = malloc(type_specific_len);
- memcpy(mdpr->type_specific_data,type_specific_data,type_specific_len);
+ mdpr->type_specific_data = xine_memdup(type_specific_data,type_specific_len);
mdpr->mlti_data=NULL;
mdpr->size=mdpr->stream_name_size+mdpr->mime_type_size+mdpr->type_specific_len+46;
@@ -712,6 +697,7 @@ rmff_data_t *rmff_new_dataheader(uint32_t num_packets, uint32_t next_data_header
return data;
}
+#if 0
void rmff_print_header(rmff_header_t *h) {
rmff_mdpr_t **stream;
@@ -778,6 +764,7 @@ void rmff_print_header(rmff_header_t *h) {
printf("next DATA : 0x%08x\n", h->data->next_data_header);
}
}
+#endif
void rmff_fix_header(rmff_header_t *h) {
@@ -886,6 +873,7 @@ void rmff_fix_header(rmff_header_t *h) {
}
}
+#if 0
int rmff_get_header_size(rmff_header_t *h) {
if (!h) return 0;
@@ -925,3 +913,4 @@ void rmff_free_header(rmff_header_t *h) {
}
free(h);
}
+#endif
diff --git a/src/input/libreal/rmff.h b/src/input/libreal/rmff.h
index 20b8b8960..996adc77d 100644
--- a/src/input/libreal/rmff.h
+++ b/src/input/libreal/rmff.h
@@ -35,7 +35,7 @@
#ifndef HAVE_RMFF_H
#define HAVE_RMFF_H
-#include "attributes.h"
+#include <xine/attributes.h>
#define RMFF_HEADER_SIZE 0x12
@@ -222,6 +222,7 @@ rmff_data_t *rmff_new_dataheader(
*/
rmff_header_t *rmff_scan_header(const char *data) XINE_MALLOC;
+#if 0
/*
* scans a data packet header. Notice, that this function does not allocate
* the header struct itself.
@@ -237,30 +238,35 @@ rmff_header_t *rmff_scan_header_stream(int fd) XINE_MALLOC;
* prints header information in human readible form to stdout
*/
void rmff_print_header(rmff_header_t *h);
+#endif
/*
* does some checks and fixes header if possible
*/
void rmff_fix_header(rmff_header_t *h);
+#if 0
/*
* returns the size of the header (incl. first data-header)
*/
int rmff_get_header_size(rmff_header_t *h);
+#endif
/*
* dumps the header <h> to <buffer>. <max> is the size of <buffer>
*/
-int rmff_dump_header(rmff_header_t *h, void *buf_gen, int max);
+int rmff_dump_header(rmff_header_t *h, void *buffer, int max);
/*
* dumps a packet header
*/
-void rmff_dump_pheader(rmff_pheader_t *h, char *data);
+void rmff_dump_pheader(rmff_pheader_t *h, uint8_t *data);
+#if 0
/*
* frees a header struct
*/
void rmff_free_header(rmff_header_t *h);
+#endif
#endif
diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c
index b7e5218cb..c9f5afa93 100644
--- a/src/input/libreal/sdpplin.c
+++ b/src/input/libreal/sdpplin.c
@@ -33,68 +33,13 @@
#include "rmff.h"
#include "rtsp.h"
#include "sdpplin.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
-/*
- * Decodes base64 strings (based upon b64 package)
- */
-
-static char *b64_decode(const char *in, char *out, int *size)
-{
- char dtable[256]; /* Encode / decode table */
- int i,k;
- size_t j;
-
- for (i = 0; i < 255; i++) {
- dtable[i] = 0x80;
- }
- for (i = 'A'; i <= 'Z'; i++) {
- dtable[i] = 0 + (i - 'A');
- }
- for (i = 'a'; i <= 'z'; i++) {
- dtable[i] = 26 + (i - 'a');
- }
- for (i = '0'; i <= '9'; i++) {
- dtable[i] = 52 + (i - '0');
- }
- dtable['+'] = 62;
- dtable['/'] = 63;
- dtable['='] = 0;
-
- k=0;
-
- /*CONSTANTCONDITION*/
- const size_t in_len = strlen(in);
- for (j=0; j<in_len; j+=4)
- {
- char a[4], b[4];
-
- for (i = 0; i < 4; i++) {
- int c = in[i+j];
-
- if (dtable[c] & 0x80) {
- fprintf(stderr, "Illegal character '%c' in input.\n", c);
- *size = 0;
- return NULL;
- }
- a[i] = (char) c;
- b[i] = (char) dtable[c];
- }
- xine_buffer_ensure_size(out, k+3);
- out[k++] = (b[0] << 2) | (b[1] >> 4);
- out[k++] = (b[1] << 4) | (b[2] >> 2);
- out[k++] = (b[2] << 6) | b[3];
- i = a[2] == '=' ? 1 : (a[3] == '=' ? 2 : 3);
- if (i < 3) {
- out[k]=0;
- *size=k;
- return out;
- }
- }
- out[k]=0;
- *size=k;
- return out;
-}
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <base64.h>
+#else
+# include <libavutil/base64.h>
+#endif
static char *nl(char *data) {
@@ -129,7 +74,6 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
sdpplin_stream_t *desc = calloc(1, sizeof(sdpplin_stream_t));
char *buf=xine_buffer_init(32);
- char *decoded=xine_buffer_init(32);
int handled;
if (filter(*data, "m=", &buf)) {
@@ -209,10 +153,10 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
}
if(filter(*data,"a=OpaqueData:buffer;",&buf)) {
- decoded = b64_decode(buf, decoded, &(desc->mlti_data_size));
- if ( decoded != NULL ) {
- desc->mlti_data = malloc(desc->mlti_data_size);
- memcpy(desc->mlti_data, decoded, desc->mlti_data_size);
+ uint8_t decoded[32];
+ desc->mlti_data_size = av_base64_decode(decoded, buf, 32);
+ if ( desc->mlti_data_size > 0 ) {
+ desc->mlti_data = xine_memdup(decoded, desc->mlti_data_size);
handled=1;
*data=nl(*data);
lprintf("mlti_data_size: %i\n", desc->mlti_data_size);
@@ -237,7 +181,6 @@ static sdpplin_stream_t *XINE_MALLOC sdpplin_parse_stream(char **data) {
}
xine_buffer_free(buf);
- xine_buffer_free(decoded);
return desc;
}
@@ -247,9 +190,9 @@ sdpplin_t *sdpplin_parse(char *data) {
sdpplin_t *desc = calloc(1, sizeof(sdpplin_t));
sdpplin_stream_t *stream;
char *buf=xine_buffer_init(32);
- char *decoded=xine_buffer_init(32);
int handled;
int len;
+ uint8_t decoded[32];
desc->stream = NULL;
@@ -272,8 +215,8 @@ sdpplin_t *sdpplin_parse(char *data) {
}
if(filter(data,"a=Title:buffer;",&buf)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
+ len = av_base64_decode(decoded, buf, 32);
+ if ( len > 0 ) {
desc->title=strdup(decoded);
handled=1;
data=nl(data);
@@ -281,8 +224,8 @@ sdpplin_t *sdpplin_parse(char *data) {
}
if(filter(data,"a=Author:buffer;",&buf)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
+ len = av_base64_decode(decoded, buf, 32);
+ if ( len > 0 ) {
desc->author=strdup(decoded);
handled=1;
data=nl(data);
@@ -290,8 +233,8 @@ sdpplin_t *sdpplin_parse(char *data) {
}
if(filter(data,"a=Copyright:buffer;",&buf)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
+ len = av_base64_decode(decoded, buf, 32);
+ if ( len > 0 ) {
desc->copyright=strdup(decoded);
handled=1;
data=nl(data);
@@ -299,8 +242,8 @@ sdpplin_t *sdpplin_parse(char *data) {
}
if(filter(data,"a=Abstract:buffer;",&buf)) {
- decoded=b64_decode(buf, decoded, &len);
- if ( decoded != NULL ) {
+ len = av_base64_decode(decoded, buf, 32);
+ if ( len > 0 ) {
desc->abstract=strdup(decoded);
handled=1;
data=nl(data);
@@ -339,7 +282,6 @@ sdpplin_t *sdpplin_parse(char *data) {
}
xine_buffer_free(buf);
- xine_buffer_free(decoded);
return desc;
}
diff --git a/src/input/librtsp/Makefile.am b/src/input/librtsp/Makefile.am
index 9ff7482af..d6dbfe72f 100644
--- a/src/input/librtsp/Makefile.am
+++ b/src/input/librtsp/Makefile.am
@@ -1,16 +1,11 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 = $(xineplug_ldflags)
+noinst_LTLIBRARIES = librtsp.la
-noinst_HEADERS = \
- rtsp.h \
- rtsp_session.h
+librtsp_la_SOURCES = rtsp.c rtsp_session.c
diff --git a/src/input/librtsp/rtsp.c b/src/input/librtsp/rtsp.c
index 4611378f8..0e65d97d7 100644
--- a/src/input/librtsp/rtsp.c
+++ b/src/input/librtsp/rtsp.c
@@ -25,6 +25,8 @@
#include "config.h"
#endif
+#include <config.h>
+
#include <unistd.h>
#include <stdio.h>
#include <assert.h>
@@ -47,8 +49,8 @@
*/
#include "rtsp.h"
-#include "io_helper.h"
-#include "xineutils.h"
+#include <xine/io_helper.h>
+#include <xine/xineutils.h>
#define BUF_SIZE 4096
#define HEADER_SIZE 1024
@@ -81,7 +83,7 @@ struct rtsp_s {
* constants
*/
-const char rtsp_protocol_version[]="RTSP/1.0";
+static const char rtsp_protocol_version[]="RTSP/1.0";
/* server states */
#define RTSP_CONNECTED 1
@@ -107,8 +109,7 @@ const char rtsp_protocol_version[]="RTSP/1.0";
*/
static char *rtsp_get(rtsp_t *s) {
-
- char *buffer = malloc(BUF_SIZE);
+ char buffer[BUF_SIZE];
char *string = NULL;
if ( _x_io_tcp_read_line(s->stream, s->s, buffer, BUF_SIZE) >= 0 ) {
@@ -116,7 +117,6 @@ static char *rtsp_get(rtsp_t *s) {
string = strdup( buffer );
}
- free(buffer);
return string;
}
@@ -139,8 +139,6 @@ static void rtsp_put(rtsp_t *s, const char *string) {
_x_io_tcp_write(s->stream, s->s, buf, len+2);
lprintf("done.\n");
-
- free(buf);
}
/*
@@ -179,7 +177,7 @@ static void rtsp_send_request(rtsp_t *s, const char *type, const char *what) {
buf = _x_asprintf("%s %s %s",type, what, rtsp_protocol_version);
rtsp_put(s,buf);
- free(buf);
+
if (payload)
while (*payload) {
rtsp_put(s,*payload);
@@ -204,7 +202,6 @@ static void rtsp_schedule_standard(rtsp_t *s) {
char *buf;
buf = _x_asprintf("Session: %s", s->session);
rtsp_schedule_field(s, buf);
- free(buf);
}
}
/*
@@ -362,19 +359,21 @@ int rtsp_request_play(rtsp_t *s, const char *what) {
return rtsp_get_answers(s);
}
+#if 0
int rtsp_request_tearoff(rtsp_t *s, const char *what) {
rtsp_send_request(s,"TEAROFF",what);
return rtsp_get_answers(s);
}
+#endif
/*
* read opaque data from stream
*/
-int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size) {
-
+int rtsp_read_data(rtsp_t *s, void *buffer_gen, unsigned int size) {
+ uint8_t *buffer = buffer_gen;
int i,seq;
if (size>=4) {
@@ -560,6 +559,7 @@ char *rtsp_search_answers(rtsp_t *s, const char *tag) {
return NULL;
}
+#if 0
/*
* session id management
*/
@@ -577,6 +577,7 @@ char *rtsp_get_session(rtsp_t *s) {
return s->session;
}
+#endif
char *rtsp_get_mrl(rtsp_t *s) {
@@ -600,6 +601,7 @@ void rtsp_schedule_field(rtsp_t *s, const char *string) {
s->scheduled[i]=strdup(string);
}
+#if 0
/*
* removes the first scheduled field which prefix matches string.
*/
@@ -620,6 +622,7 @@ void rtsp_unschedule_field(rtsp_t *s, const char *string) {
*(ptr-1)=*ptr;
} while(*ptr);
}
+#endif
/*
* unschedule all fields
diff --git a/src/input/librtsp/rtsp.h b/src/input/librtsp/rtsp.h
index a00035aef..98a87fb80 100644
--- a/src/input/librtsp/rtsp.h
+++ b/src/input/librtsp/rtsp.h
@@ -25,7 +25,7 @@
#define HAVE_RTSP_H
/*#include <inttypes.h> */
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#ifdef __CYGWIN__
#define uint32_t unsigned int
@@ -47,11 +47,13 @@ int rtsp_request_describe(rtsp_t *s, const char *what);
int rtsp_request_setup(rtsp_t *s, const char *what);
int rtsp_request_setparameter(rtsp_t *s, const char *what);
int rtsp_request_play(rtsp_t *s, const char *what);
+#if 0
int rtsp_request_tearoff(rtsp_t *s, const char *what);
+#endif
int rtsp_send_ok(rtsp_t *s);
-int rtsp_read_data(rtsp_t *s, char *buffer, unsigned int size);
+int rtsp_read_data(rtsp_t *s, void *buffer, unsigned int size);
char* rtsp_search_answers(rtsp_t *s, const char *tag);
void rtsp_add_to_payload(char **payload, const char *string);
@@ -61,15 +63,19 @@ void rtsp_free_answers(rtsp_t *this);
int rtsp_read (rtsp_t *this, char *data, int len);
void rtsp_close (rtsp_t *this);
+#if 0
void rtsp_set_session(rtsp_t *s, const char *id);
char *rtsp_get_session(rtsp_t *s);
+#endif
char *rtsp_get_mrl(rtsp_t *s);
/*int rtsp_peek_header (rtsp_t *this, char *data); */
void rtsp_schedule_field(rtsp_t *s, const char *string);
+#if 0
void rtsp_unschedule_field(rtsp_t *s, const char *string);
+#endif
void rtsp_unschedule_all(rtsp_t *s);
#endif
diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c
index 2ae002662..a4b4c83c4 100644
--- a/src/input/librtsp/rtsp_session.c
+++ b/src/input/librtsp/rtsp_session.c
@@ -45,7 +45,7 @@
#include "real.h"
#include "rmff.h"
#include "asmrp.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
#define BUF_SIZE 4096
#define HEADER_SIZE 4096
@@ -69,15 +69,15 @@ struct rtsp_session_s {
};
/* network bandwidth */
-const uint32_t rtsp_bandwidths[]={14400,19200,28800,33600,34430,57600,
- 115200,262200,393216,524300,1544000,10485800};
+static const uint32_t rtsp_bandwidths[]={14400,19200,28800,33600,34430,57600,
+ 115200,262200,393216,524300,1544000,10485800};
-const char *rtsp_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 rtsp_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};
rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) {
@@ -91,7 +91,7 @@ rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) {
uint32_t bandwidth;
bandwidth_id = xine->config->register_enum(xine->config, "media.network.bandwidth", 10,
- (char **)rtsp_bandwidth_strs,
+ rtsp_bandwidth_strs,
_("network bandwidth"),
_("Specify the bandwidth of your internet connection here. "
"This will be used when streaming servers offer different versions "
@@ -199,7 +199,7 @@ int rtsp_session_read (rtsp_session_t *this, char *data, int len) {
int to_copy;
char *dest=data;
- char *source=this->recv + this->recv_read;
+ uint8_t *source=this->recv + this->recv_read;
int fill=this->recv_size - this->recv_read;
if (len < 0)
diff --git a/src/input/media_helper.h b/src/input/media_helper.h
index 7e6303dfd..a8e376fdc 100644
--- a/src/input/media_helper.h
+++ b/src/input/media_helper.h
@@ -22,7 +22,7 @@
#ifndef HAVE_MEDIA_HELPER_H
#define HAVE_MEDIA_HELPER_H
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
int media_eject_media (xine_t *xine, const char *device);
diff --git a/src/input/mms.c b/src/input/mms.c
index c84ce7beb..67f8775a7 100644
--- a/src/input/mms.c
+++ b/src/input/mms.c
@@ -56,8 +56,8 @@
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#include "http_helper.h"
@@ -534,7 +534,7 @@ static int interp_asf_header (mms_t *this) {
return 1;
}
-static const char *const mmst_proto_s[] = { "mms", "mmst", NULL };
+static const char mmst_proto_s[][8] = { "mms", "mmst", "" };
static int mmst_valid_proto (char *proto) {
int i = 0;
@@ -544,7 +544,7 @@ static int mmst_valid_proto (char *proto) {
if (!proto)
return 0;
- while(mmst_proto_s[i]) {
+ while(*(mmst_proto_s[i])) {
if (!strcasecmp(proto, mmst_proto_s[i])) {
return 1;
}
@@ -603,7 +603,7 @@ static int mms_tcp_connect(mms_t *this) {
}
static void mms_gen_guid(char guid[]) {
- static char digit[16] = "0123456789ABCDEF";
+ static const char digit[16] = "0123456789ABCDEF";
int i = 0;
srand(time(NULL));
@@ -744,7 +744,7 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) {
/* TODO: insert network timing request here */
/* command 0x2 */
lprintf("send command 0x02\n");
- string_utf16 (url_conv, &this->scmd_body[8], "\002\000\\\\192.168.0.129\\TCP\\1037\0000", 28);
+ string_utf16 (url_conv, &this->scmd_body[8], (ICONV_CONST char*)"\002\000\\\\192.168.0.129\\TCP\\1037\0000", 28);
memset (this->scmd_body, 0, 8);
if (!send_command (this, 2, 0, 0, 28 * 2 + 8)) {
xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
diff --git a/src/input/mms.h b/src/input/mms.h
index eaf9a46f4..2fdfdac9b 100644
--- a/src/input/mms.h
+++ b/src/input/mms.h
@@ -24,7 +24,7 @@
#define HAVE_MMS_H
#include <inttypes.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
typedef struct mms_s mms_t;
diff --git a/src/input/mmsh.c b/src/input/mmsh.c
index de2d6ebab..2a65dd7d3 100644
--- a/src/input/mmsh.c
+++ b/src/input/mmsh.c
@@ -51,8 +51,8 @@
/*
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
#include "bswap.h"
#include "http_helper.h"
@@ -445,7 +445,7 @@ static int interp_header (mmsh_t *this) {
return 1;
}
-static const char *const mmsh_proto_s[] = { "mms", "mmsh", NULL };
+static const char mmsh_proto_s[][8] = { "mms", "mmsh", "" };
static int mmsh_valid_proto (char *proto) {
int i = 0;
@@ -455,7 +455,7 @@ static int mmsh_valid_proto (char *proto) {
if (!proto)
return 0;
- while(mmsh_proto_s[i]) {
+ while(*(mmsh_proto_s[i])) {
if (!strcasecmp(proto, mmsh_proto_s[i])) {
return 1;
}
diff --git a/src/input/mmsh.h b/src/input/mmsh.h
index 09b305adb..1e337a2d5 100644
--- a/src/input/mmsh.h
+++ b/src/input/mmsh.h
@@ -24,7 +24,7 @@
#define HAVE_MMSH_H
#include <inttypes.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
typedef struct mmsh_s mmsh_t;
diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c
index ecea09dbf..87054bfaa 100644
--- a/src/input/net_buf_ctrl.c
+++ b/src/input/net_buf_ctrl.c
@@ -126,10 +126,6 @@ static void nbc_set_speed_normal (nbc_t *this) {
stream->xine->clock->set_option (stream->xine->clock, CLOCK_SCR_ADJUSTABLE, 1);
}
-void nbc_check_buffers (nbc_t *this) {
- /* Deprecated */
-}
-
static void dvbspeed_init (nbc_t *this) {
const char *mrl;
if (this->stream && this->stream->input_plugin) {
@@ -800,22 +796,3 @@ void nbc_close (nbc_t *this) {
free (this);
xprintf(xine, XINE_VERBOSITY_DEBUG, "\nnet_buf_ctrl: nbc_close: done\n");
}
-
-
-void nbc_set_high_water_mark(nbc_t *this, int value) {
-/*
- Deprecated
- this->high_water_mark = value;
-*/
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "\nnet_buf_ctrl: this method is deprecated, please fix the input plugin\n");
-}
-
-void nbc_set_low_water_mark(nbc_t *this, int value) {
-/*
- Deprecated
- this->low_water_mark = value;
-*/
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "\nnet_buf_ctrl: this method is deprecated, please fix the input plugin\n");
-}
diff --git a/src/input/net_buf_ctrl.h b/src/input/net_buf_ctrl.h
index 6eac63e52..0e5ff3f70 100644
--- a/src/input/net_buf_ctrl.h
+++ b/src/input/net_buf_ctrl.h
@@ -23,18 +23,12 @@
#ifndef HAVE_NET_BUF_CTRL_H
#define HAVE_NET_BUF_CTRL_H
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
typedef struct nbc_s nbc_t;
nbc_t *nbc_init (xine_stream_t *xine) XINE_MALLOC;
-void nbc_check_buffers (nbc_t *this) XINE_DEPRECATED;
-
void nbc_close (nbc_t *this);
-void nbc_set_high_water_mark(nbc_t *this, int value) XINE_DEPRECATED;
-
-void nbc_set_low_water_mark(nbc_t *this, int value) XINE_DEPRECATED;
-
#endif
diff --git a/src/input/pnm.c b/src/input/pnm.c
index 1bbc93fb6..d07d35c7e 100644
--- a/src/input/pnm.c
+++ b/src/input/pnm.c
@@ -25,6 +25,8 @@
# include "config.h"
#endif
+#include <config.h>
+
#include <unistd.h>
#include <stdio.h>
#include <sys/socket.h>
@@ -47,9 +49,9 @@
#include "pnm.h"
#include "libreal/rmff.h"
#include "bswap.h"
-#include "io_helper.h"
-#include "xineutils.h"
-#include "xine_internal.h"
+#include <xine/io_helper.h>
+#include <xine/xineutils.h>
+#include <xine/xine_internal.h>
#define BUF_SIZE 4096
#define HEADER_SIZE 4096
diff --git a/src/input/pnm.h b/src/input/pnm.h
index df1f47290..cf547f505 100644
--- a/src/input/pnm.h
+++ b/src/input/pnm.h
@@ -26,7 +26,7 @@
#ifndef __CYGWIN__
#include <inttypes.h>
#endif
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
typedef struct pnm_s pnm_t;
diff --git a/src/input/sha1.c b/src/input/sha1.c
deleted file mode 100644
index c30825a19..000000000
--- a/src/input/sha1.c
+++ /dev/null
@@ -1,327 +0,0 @@
-/* (PD) 2001 The Bitzi Corporation
- * Please see file COPYING or http://bitzi.com/publicdomain
- * for more info.
- *
- * NIST Secure Hash Algorithm
- * heavily modified by Uwe Hollerbach <uh@alumni.caltech edu>
- * from Peter C. Gutmann's implementation as found in
- * Applied Cryptography by Bruce Schneier
- * Further modifications to include the "UNRAVEL" stuff, below
- *
- * This code is in the public domain
- */
-
-#include <string.h>
-#include "sha1.h"
-
-/* UNRAVEL should be fastest & biggest */
-/* UNROLL_LOOPS should be just as big, but slightly slower */
-/* both undefined should be smallest and slowest */
-
-#define UNRAVEL
-/* #define UNROLL_LOOPS */
-
-/* SHA f()-functions */
-
-#define f1(x,y,z) ((x & y) | (~x & z))
-#define f2(x,y,z) (x ^ y ^ z)
-#define f3(x,y,z) ((x & y) | (x & z) | (y & z))
-#define f4(x,y,z) (x ^ y ^ z)
-
-/* SHA constants */
-
-#define CONST1 0x5a827999L
-#define CONST2 0x6ed9eba1L
-#define CONST3 0x8f1bbcdcL
-#define CONST4 0xca62c1d6L
-
-/* truncate to 32 bits -- should be a null op on 32-bit machines */
-
-#define T32(x) ((x) & 0xffffffffL)
-
-/* 32-bit rotate */
-
-#define R32(x,n) T32(((x << n) | (x >> (32 - n))))
-
-/* the generic case, for when the overall rotation is not unraveled */
-
-#define FG(n) \
- T = T32(R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n); \
- E = D; D = C; C = R32(B,30); B = A; A = T
-
-/* specific cases, for when the overall rotation is unraveled */
-
-#define FA(n) \
- T = T32(R32(A,5) + f##n(B,C,D) + E + *WP++ + CONST##n); B = R32(B,30)
-
-#define FB(n) \
- E = T32(R32(T,5) + f##n(A,B,C) + D + *WP++ + CONST##n); A = R32(A,30)
-
-#define FC(n) \
- D = T32(R32(E,5) + f##n(T,A,B) + C + *WP++ + CONST##n); T = R32(T,30)
-
-#define FD(n) \
- C = T32(R32(D,5) + f##n(E,T,A) + B + *WP++ + CONST##n); E = R32(E,30)
-
-#define FE(n) \
- B = T32(R32(C,5) + f##n(D,E,T) + A + *WP++ + CONST##n); D = R32(D,30)
-
-#define FT(n) \
- A = T32(R32(B,5) + f##n(C,D,E) + T + *WP++ + CONST##n); C = R32(C,30)
-
-/* do SHA transformation */
-
-static void sha_transform(SHA_INFO *sha_info)
-{
- int i;
- SHA_BYTE *dp;
- SHA_LONG T, A, B, C, D, E, W[80], *WP;
-
- dp = sha_info->data;
-
-/*
-the following makes sure that at least one code block below is
-traversed or an error is reported, without the necessity for nested
-preprocessor if/else/endif blocks, which are a great pain in the
-nether regions of the anatomy...
-*/
-#undef SWAP_DONE
-
-#if (SHA_BYTE_ORDER == 1234)
-#define SWAP_DONE
- for (i = 0; i < 16; ++i) {
- T = *((SHA_LONG *) dp);
- dp += 4;
- W[i] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
- ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
- }
-#endif /* SHA_BYTE_ORDER == 1234 */
-
-#if (SHA_BYTE_ORDER == 4321)
-#define SWAP_DONE
- for (i = 0; i < 16; ++i) {
- T = *((SHA_LONG *) dp);
- dp += 4;
- W[i] = T32(T);
- }
-#endif /* SHA_BYTE_ORDER == 4321 */
-
-#if (SHA_BYTE_ORDER == 12345678)
-#define SWAP_DONE
- for (i = 0; i < 16; i += 2) {
- T = *((SHA_LONG *) dp);
- dp += 8;
- W[i] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
- ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
- T >>= 32;
- W[i+1] = ((T << 24) & 0xff000000) | ((T << 8) & 0x00ff0000) |
- ((T >> 8) & 0x0000ff00) | ((T >> 24) & 0x000000ff);
- }
-#endif /* SHA_BYTE_ORDER == 12345678 */
-
-#if (SHA_BYTE_ORDER == 87654321)
-#define SWAP_DONE
- for (i = 0; i < 16; i += 2) {
- T = *((SHA_LONG *) dp);
- dp += 8;
- W[i] = T32(T >> 32);
- W[i+1] = T32(T);
- }
-#endif /* SHA_BYTE_ORDER == 87654321 */
-
-#ifndef SWAP_DONE
-#error Unknown byte order -- you need to add code here
-#endif /* SWAP_DONE */
-
- for (i = 16; i < 80; ++i) {
- W[i] = W[i-3] ^ W[i-8] ^ W[i-14] ^ W[i-16];
-#if (SHA_VERSION == 1)
- W[i] = R32(W[i], 1);
-#endif /* SHA_VERSION */
- }
- A = sha_info->digest[0];
- B = sha_info->digest[1];
- C = sha_info->digest[2];
- D = sha_info->digest[3];
- E = sha_info->digest[4];
- WP = W;
-#ifdef UNRAVEL
- FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1); FC(1); FD(1);
- FE(1); FT(1); FA(1); FB(1); FC(1); FD(1); FE(1); FT(1); FA(1); FB(1);
- FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2); FE(2); FT(2);
- FA(2); FB(2); FC(2); FD(2); FE(2); FT(2); FA(2); FB(2); FC(2); FD(2);
- FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3); FA(3); FB(3);
- FC(3); FD(3); FE(3); FT(3); FA(3); FB(3); FC(3); FD(3); FE(3); FT(3);
- FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4); FC(4); FD(4);
- FE(4); FT(4); FA(4); FB(4); FC(4); FD(4); FE(4); FT(4); FA(4); FB(4);
- sha_info->digest[0] = T32(sha_info->digest[0] + E);
- sha_info->digest[1] = T32(sha_info->digest[1] + T);
- sha_info->digest[2] = T32(sha_info->digest[2] + A);
- sha_info->digest[3] = T32(sha_info->digest[3] + B);
- sha_info->digest[4] = T32(sha_info->digest[4] + C);
-#else /* !UNRAVEL */
-#ifdef UNROLL_LOOPS
- FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1);
- FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1); FG(1);
- FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2);
- FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2); FG(2);
- FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3);
- FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3); FG(3);
- FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4);
- FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4); FG(4);
-#else /* !UNROLL_LOOPS */
- for (i = 0; i < 20; ++i) { FG(1); }
- for (i = 20; i < 40; ++i) { FG(2); }
- for (i = 40; i < 60; ++i) { FG(3); }
- for (i = 60; i < 80; ++i) { FG(4); }
-#endif /* !UNROLL_LOOPS */
- sha_info->digest[0] = T32(sha_info->digest[0] + A);
- sha_info->digest[1] = T32(sha_info->digest[1] + B);
- sha_info->digest[2] = T32(sha_info->digest[2] + C);
- sha_info->digest[3] = T32(sha_info->digest[3] + D);
- sha_info->digest[4] = T32(sha_info->digest[4] + E);
-#endif /* !UNRAVEL */
-}
-
-/* initialize the SHA digest */
-
-void sha_init(SHA_INFO *sha_info)
-{
- sha_info->digest[0] = 0x67452301L;
- sha_info->digest[1] = 0xefcdab89L;
- sha_info->digest[2] = 0x98badcfeL;
- sha_info->digest[3] = 0x10325476L;
- sha_info->digest[4] = 0xc3d2e1f0L;
- sha_info->count_lo = 0L;
- sha_info->count_hi = 0L;
- sha_info->local = 0;
-}
-
-/* update the SHA digest */
-
-void sha_update(SHA_INFO *sha_info, SHA_BYTE *buffer, int count)
-{
- int i;
- SHA_LONG clo;
-
- clo = T32(sha_info->count_lo + ((SHA_LONG) count << 3));
- if (clo < sha_info->count_lo) {
- ++sha_info->count_hi;
- }
- sha_info->count_lo = clo;
- sha_info->count_hi += (SHA_LONG) count >> 29;
- if (sha_info->local) {
- i = SHA_BLOCKSIZE - sha_info->local;
- if (i > count) {
- i = count;
- }
- memcpy(((SHA_BYTE *) sha_info->data) + sha_info->local, buffer, i);
- count -= i;
- buffer += i;
- sha_info->local += i;
- if (sha_info->local == SHA_BLOCKSIZE) {
- sha_transform(sha_info);
- } else {
- return;
- }
- }
- while (count >= SHA_BLOCKSIZE) {
- memcpy(sha_info->data, buffer, SHA_BLOCKSIZE);
- buffer += SHA_BLOCKSIZE;
- count -= SHA_BLOCKSIZE;
- sha_transform(sha_info);
- }
- memcpy(sha_info->data, buffer, count);
- sha_info->local = count;
-}
-
-/* finish computing the SHA digest */
-
-void sha_final(unsigned char digest[20], SHA_INFO *sha_info)
-{
- int count;
- SHA_LONG lo_bit_count, hi_bit_count;
-
- lo_bit_count = sha_info->count_lo;
- hi_bit_count = sha_info->count_hi;
- count = (int) ((lo_bit_count >> 3) & 0x3f);
- ((SHA_BYTE *) sha_info->data)[count++] = 0x80;
- if (count > SHA_BLOCKSIZE - 8) {
- memset(((SHA_BYTE *) sha_info->data) + count, 0, SHA_BLOCKSIZE - count);
- sha_transform(sha_info);
- memset((SHA_BYTE *) sha_info->data, 0, SHA_BLOCKSIZE - 8);
- } else {
- memset(((SHA_BYTE *) sha_info->data) + count, 0,
- SHA_BLOCKSIZE - 8 - count);
- }
- sha_info->data[56] = (unsigned char) ((hi_bit_count >> 24) & 0xff);
- sha_info->data[57] = (unsigned char) ((hi_bit_count >> 16) & 0xff);
- sha_info->data[58] = (unsigned char) ((hi_bit_count >> 8) & 0xff);
- sha_info->data[59] = (unsigned char) ((hi_bit_count >> 0) & 0xff);
- sha_info->data[60] = (unsigned char) ((lo_bit_count >> 24) & 0xff);
- sha_info->data[61] = (unsigned char) ((lo_bit_count >> 16) & 0xff);
- sha_info->data[62] = (unsigned char) ((lo_bit_count >> 8) & 0xff);
- sha_info->data[63] = (unsigned char) ((lo_bit_count >> 0) & 0xff);
- sha_transform(sha_info);
- digest[ 0] = (unsigned char) ((sha_info->digest[0] >> 24) & 0xff);
- digest[ 1] = (unsigned char) ((sha_info->digest[0] >> 16) & 0xff);
- digest[ 2] = (unsigned char) ((sha_info->digest[0] >> 8) & 0xff);
- digest[ 3] = (unsigned char) ((sha_info->digest[0] ) & 0xff);
- digest[ 4] = (unsigned char) ((sha_info->digest[1] >> 24) & 0xff);
- digest[ 5] = (unsigned char) ((sha_info->digest[1] >> 16) & 0xff);
- digest[ 6] = (unsigned char) ((sha_info->digest[1] >> 8) & 0xff);
- digest[ 7] = (unsigned char) ((sha_info->digest[1] ) & 0xff);
- digest[ 8] = (unsigned char) ((sha_info->digest[2] >> 24) & 0xff);
- digest[ 9] = (unsigned char) ((sha_info->digest[2] >> 16) & 0xff);
- digest[10] = (unsigned char) ((sha_info->digest[2] >> 8) & 0xff);
- digest[11] = (unsigned char) ((sha_info->digest[2] ) & 0xff);
- digest[12] = (unsigned char) ((sha_info->digest[3] >> 24) & 0xff);
- digest[13] = (unsigned char) ((sha_info->digest[3] >> 16) & 0xff);
- digest[14] = (unsigned char) ((sha_info->digest[3] >> 8) & 0xff);
- digest[15] = (unsigned char) ((sha_info->digest[3] ) & 0xff);
- digest[16] = (unsigned char) ((sha_info->digest[4] >> 24) & 0xff);
- digest[17] = (unsigned char) ((sha_info->digest[4] >> 16) & 0xff);
- digest[18] = (unsigned char) ((sha_info->digest[4] >> 8) & 0xff);
- digest[19] = (unsigned char) ((sha_info->digest[4] ) & 0xff);
-}
-
-/* compute the SHA digest of a FILE stream */
-
-#define BLOCK_SIZE 8192
-
-void sha_stream(unsigned char digest[20], SHA_INFO *sha_info, FILE *fin)
-{
- int i;
- SHA_BYTE data[BLOCK_SIZE];
-
- sha_init(sha_info);
- while ((i = fread(data, 1, BLOCK_SIZE, fin)) > 0) {
- sha_update(sha_info, data, i);
- }
- sha_final(digest, sha_info);
-}
-
-/* print a SHA digest */
-
-void sha_print(unsigned char digest[20])
-{
- int i, j;
-
- for (j = 0; j < 5; ++j) {
- for (i = 0; i < 4; ++i) {
- printf("%02x", *digest++);
- }
- printf("%c", (j < 4) ? ' ' : '\n');
- }
-}
-
-char *sha_version(void)
-{
-#if (SHA_VERSION == 1)
- static char *version = "SHA-1";
-#else
- static char *version = "SHA";
-#endif
- return(version);
-}
-
diff --git a/src/input/sha1.h b/src/input/sha1.h
deleted file mode 100644
index a81af673b..000000000
--- a/src/input/sha1.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* NIST Secure Hash Algorithm */
-/* heavily modified by Uwe Hollerbach <uh@alumni.caltech edu> */
-/* from Peter C. Gutmann's implementation as found in */
-/* Applied Cryptography by Bruce Schneier */
-/* This code is in the public domain */
-
-#ifndef SHA_H
-#define SHA_H
-
-#include <stdlib.h>
-#include <stdio.h>
-
-/* Useful defines & typedefs */
-typedef unsigned char SHA_BYTE; /* 8-bit quantity */
-typedef unsigned long SHA_LONG; /* 32-or-more-bit quantity */
-
-#define SHA_BLOCKSIZE 64
-#define SHA_DIGESTSIZE 20
-
-typedef struct {
- SHA_LONG digest[5]; /* message digest */
- SHA_LONG count_lo, count_hi; /* 64-bit bit count */
- SHA_BYTE data[SHA_BLOCKSIZE]; /* SHA data buffer */
- int local; /* unprocessed amount in data */
-} SHA_INFO;
-
-void sha_init(SHA_INFO *);
-void sha_update(SHA_INFO *, SHA_BYTE *, int);
-void sha_final(unsigned char [20], SHA_INFO *);
-
-void sha_stream(unsigned char [20], SHA_INFO *, FILE *);
-void sha_print(unsigned char [20]);
-char *sha_version(void);
-
-#define SHA_VERSION 1
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-
-#ifdef WORDS_BIGENDIAN
-# if SIZEOF_LONG == 4
-# define SHA_BYTE_ORDER 4321
-# elif SIZEOF_LONG == 8
-# define SHA_BYTE_ORDER 87654321
-# endif
-#else
-# if SIZEOF_LONG == 4
-# define SHA_BYTE_ORDER 1234
-# elif SIZEOF_LONG == 8
-# define SHA_BYTE_ORDER 12345678
-# endif
-#endif
-
-#else
-
-#define SHA_BYTE_ORDER 1234
-
-#endif
-
-#endif /* SHA_H */
diff --git a/src/input/vcd/Makefile.am b/src/input/vcd/Makefile.am
index e529bb6dc..6364bedc4 100644
--- a/src/input/vcd/Makefile.am
+++ b/src/input/vcd/Makefile.am
@@ -1,25 +1,15 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = libcdio libvcd
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
-vcd_SRCS = xineplug_inp_vcd.c vcdplayer.c vcdio.c xine-extra.c
-
-EXTRA_DIST = $(vcd_SRCS)
+noinst_HEADERS = vcdio.h vcdplayer.h xine-extra.h
-if ENABLE_VCD
xineplug_LTLIBRARIES = xineplug_inp_vcd.la
-AM_CFLAGS = $(LIBCDIO_CFLAGS) $(LIBVCD_CFLAGS)
-
-xineplug_inp_vcd_la_SOURCES = $(vcd_SRCS)
-xineplug_inp_vcd_la_LDFLAGS = $(xineplug_ldflags)
-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
-
-endif
-
-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 bcfe674a5..000000000
--- a/src/input/vcd/libcdio/FreeBSD/freebsd.c
+++ /dev/null
@@ -1,639 +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 <arpa/inet.h>
-#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 bdbad406d..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_kernel_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 e62f8a089..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;
- }
-
- *lpGetSupport = (FARPROC)GetProcAddress( *hASPI,
- "GetASPI32SupportInfo" );
- *lpSendCommand = (FARPROC)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_linux.c b/src/input/vcd/libcdio/_cdio_linux.c
deleted file mode 100644
index acc04a839..000000000
--- a/src/input/vcd/libcdio/_cdio_linux.c
+++ /dev/null
@@ -1,1198 +0,0 @@
-/*
- $Id: _cdio_linux.c,v 1.4 2006/09/26 22:18:44 dgp85 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 Linux-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_linux.c,v 1.4 2006/09/26 22:18:44 dgp85 Exp $";
-
-#include <string.h>
-
-#include <cdio/sector.h>
-#include <cdio/util.h>
-#include <cdio/types.h>
-#include <cdio/scsi_mmc.h>
-#include <cdio/cdtext.h>
-#include "cdtext_private.h"
-#include "cdio_assert.h"
-#include "cdio_private.h"
-
-#ifdef HAVE_LINUX_CDROM
-
-#if defined(HAVE_LINUX_VERSION_H)
-# include <linux/version.h>
-# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,16)
-# define __CDIO_LINUXCD_BUILD
-# else
-# error "You need a kernel greater than 2.2.16 to have CDROM support"
-# endif
-#else
-# error "You need <linux/version.h> to have CDROM support"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <mntent.h>
-#include <limits.h>
-
-#include <linux/cdrom.h>
-#include <scsi/scsi.h>
-#include <scsi/sg.h>
-#include <scsi/scsi_ioctl.h>
-#include <sys/mount.h>
-
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/ioctl.h>
-
-typedef enum {
- _AM_NONE,
- _AM_IOCTL,
- _AM_READ_CD,
- _AM_READ_10
-} 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];
-
- struct cdrom_tochdr tochdr;
-
-} _img_private_t;
-
-/* Some ioctl() errno values which occur when the tray is empty */
-#define ERRNO_TRAYEMPTY(errno) \
- ((errno == EIO) || (errno == ENOENT) || (errno == EINVAL))
-
-/**** prototypes for static functions ****/
-static bool is_cdrom_linux(const char *drive, char *mnttype);
-static bool read_toc_linux (void *p_user_data);
-static int run_scsi_cmd_linux( 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 );
-static access_mode_t
-
-str_to_access_mode_linux(const char *psz_access_mode)
-{
- const access_mode_t default_access_mode = _AM_IOCTL;
-
- if (NULL==psz_access_mode) return default_access_mode;
-
- if (!strcmp(psz_access_mode, "IOCTL"))
- return _AM_IOCTL;
- else if (!strcmp(psz_access_mode, "READ_CD"))
- return _AM_READ_CD;
- else if (!strcmp(psz_access_mode, "READ_10"))
- return _AM_READ_10;
- else {
- cdio_warn ("unknown access type: %s. Default IOCTL used.",
- psz_access_mode);
- return default_access_mode;
- }
-}
-
-static char *
-check_mounts_linux(const char *mtab)
-{
- FILE *mntfp;
- struct mntent *mntent;
-
- mntfp = setmntent(mtab, "r");
- if ( mntfp != NULL ) {
- char *tmp;
- char *mnt_type;
- char *mnt_dev;
-
- while ( (mntent=getmntent(mntfp)) != NULL ) {
- mnt_type = malloc(strlen(mntent->mnt_type) + 1);
- if (mnt_type == NULL)
- continue; /* maybe you'll get lucky next time. */
-
- mnt_dev = malloc(strlen(mntent->mnt_fsname) + 1);
- if (mnt_dev == NULL) {
- free(mnt_type);
- continue;
- }
-
- strcpy(mnt_type, mntent->mnt_type);
- strcpy(mnt_dev, mntent->mnt_fsname);
-
- /* Handle "supermount" filesystem mounts */
- if ( strcmp(mnt_type, "supermount") == 0 ) {
- tmp = strstr(mntent->mnt_opts, "fs=");
- if ( tmp ) {
- free(mnt_type);
- mnt_type = strdup(tmp + strlen("fs="));
- if ( mnt_type ) {
- tmp = strchr(mnt_type, ',');
- if ( tmp ) {
- *tmp = '\0';
- }
- }
- }
- tmp = strstr(mntent->mnt_opts, "dev=");
- if ( tmp ) {
- free(mnt_dev);
- mnt_dev = strdup(tmp + strlen("dev="));
- if ( mnt_dev ) {
- tmp = strchr(mnt_dev, ',');
- if ( tmp ) {
- *tmp = '\0';
- }
- }
- }
- }
- if ( strcmp(mnt_type, "iso9660") == 0 ) {
- if (is_cdrom_linux(mnt_dev, mnt_type) > 0) {
- free(mnt_type);
- endmntent(mntfp);
- return mnt_dev;
- }
- }
- free(mnt_dev);
- free(mnt_type);
- }
- endmntent(mntfp);
- }
- return NULL;
-}
-
-/*!
- Return the value associated with the key "arg".
-*/
-static const char *
-get_arg_linux (void *env, const char key[])
-{
- _img_private_t *_obj = env;
-
- if (!strcmp (key, "source")) {
- return _obj->gen.source_name;
- } else if (!strcmp (key, "access-mode")) {
- switch (_obj->access_mode) {
- case _AM_IOCTL:
- return "ioctl";
- case _AM_READ_CD:
- return "READ_CD";
- case _AM_READ_10:
- return "READ_10";
- case _AM_NONE:
- return "no access method";
- }
- }
- return NULL;
-}
-
-#undef USE_LINUX_CAP
-#ifdef USE_LINUX_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.
-
- */
-static void
-get_drive_cap_linux (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;
- int32_t i_drivetype;
-
- i_drivetype = ioctl (p_env->gen.fd, CDROM_GET_CAPABILITY, CDSL_CURRENT);
-
- if (i_drivetype < 0) {
- *p_read_cap = CDIO_DRIVE_CAP_ERROR;
- *p_write_cap = CDIO_DRIVE_CAP_ERROR;
- *p_misc_cap = CDIO_DRIVE_CAP_ERROR;
- return;
- }
-
- *p_read_cap = 0;
- *p_write_cap = 0;
- *p_misc_cap = 0;
-
- /* Reader */
- if (i_drivetype & CDC_PLAY_AUDIO)
- *p_read_cap |= CDIO_DRIVE_CAP_READ_AUDIO;
- if (i_drivetype & CDC_CD_R)
- *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_R;
- if (i_drivetype & CDC_CD_RW)
- *p_read_cap |= CDIO_DRIVE_CAP_READ_CD_RW;
- if (i_drivetype & CDC_DVD)
- *p_read_cap |= CDIO_DRIVE_CAP_READ_DVD_ROM;
-
- /* Writer */
- if (i_drivetype & CDC_CD_RW)
- *p_read_cap |= CDIO_DRIVE_CAP_WRITE_CD_RW;
- if (i_drivetype & CDC_DVD_R)
- *p_read_cap |= CDIO_DRIVE_CAP_WRITE_DVD_R;
- if (i_drivetype & CDC_DVD_RAM)
- *p_read_cap |= CDIO_DRIVE_CAP_WRITE_DVD_RAM;
-
- /* Misc */
- if (i_drivetype & CDC_CLOSE_TRAY)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_CLOSE_TRAY;
- if (i_drivetype & CDC_OPEN_TRAY)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_EJECT;
- if (i_drivetype & CDC_LOCK)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_LOCK;
- if (i_drivetype & CDC_SELECT_SPEED)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_SELECT_SPEED;
- if (i_drivetype & CDC_SELECT_DISC)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_SELECT_DISC;
- if (i_drivetype & CDC_MULTI_SESSION)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MULTI_SESSION;
- if (i_drivetype & CDC_MEDIA_CHANGED)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_MEDIA_CHANGED;
- if (i_drivetype & CDC_RESET)
- *p_misc_cap |= CDIO_DRIVE_CAP_MISC_RESET;
-}
-#endif
-
-/*!
- 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_linux (const void *p_user_data) {
-
- struct cdrom_mcn mcn;
- const _img_private_t *p_env = p_user_data;
- memset(&mcn, 0, sizeof(mcn));
- 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_linux(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.toc_init) read_toc_linux (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 & CDIO_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_linux(void *p_user_data, track_t i_track)
-{
- _img_private_t *p_env = p_user_data;
-
- if (!p_env->gen.toc_init) read_toc_linux (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 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 i_track LEADOUT_TRACK or the total tracks+1.
- False is returned if there is no track entry.
-*/
-static bool
-get_track_msf_linux(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.toc_init) read_toc_linux (p_user_data) ;
-
- 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_msf0 *msf0=
- &p_env->tocent[i_track-p_env->gen.i_first_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;
- }
-}
-
-/*!
- Eject media in CD drive.
- Return 0 if success and 1 for failure, and 2 if no routine.
- */
-static int
-eject_media_linux (void *p_user_data) {
-
- _img_private_t *p_env = p_user_data;
- int ret=2;
- int status;
- int fd;
-
- if ((fd = open (p_env->gen.source_name, O_RDONLY|O_NONBLOCK)) > -1) {
- if((status = ioctl(fd, CDROM_DRIVE_STATUS, CDSL_CURRENT)) > 0) {
- switch(status) {
- case CDS_TRAY_OPEN:
- if((ret = ioctl(fd, CDROMCLOSETRAY)) != 0) {
- cdio_warn ("ioctl CDROMCLOSETRAY failed: %s\n", strerror(errno));
- ret = 1;
- }
- break;
- case CDS_DISC_OK:
- if((ret = ioctl(fd, CDROMEJECT)) != 0) {
- int eject_error = errno;
- /* Try ejecting the MMC way... */
- ret = scsi_mmc_eject_media(p_env->gen.cdio);
- if (0 != ret) {
- cdio_warn("ioctl CDROMEJECT failed: %s\n",
- strerror(eject_error));
- ret = 1;
- }
- }
- /* force kernel to reread partition table when new disc inserted */
- ret = ioctl(p_env->gen.fd, BLKRRPART);
- break;
- default:
- cdio_warn ("Unknown CD-ROM (%d)\n", status);
- ret = 1;
- }
- } else {
- cdio_warn ("CDROM_DRIVE_STATUS failed: %s\n", strerror(errno));
- ret=1;
- }
- close(fd);
- } else
- ret = 2;
- close(p_env->gen.fd);
- p_env->gen.fd = -1;
- return ret;
-}
-
-/*!
- Get disc type associated with the cd object.
-*/
-static discmode_t
-get_discmode_linux (void *p_user_data)
-{
- _img_private_t *p_env = p_user_data;
-
- int32_t i_discmode;
-
- /* 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 == ioctl (p_env->gen.fd, DVD_READ_STRUCT, &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;
- }
- }
-
- i_discmode = ioctl (p_env->gen.fd, CDROM_DISC_STATUS);
-
- if (i_discmode < 0) return CDIO_DISC_MODE_ERROR;
-
- /* FIXME Need to add getting DVD types. */
- switch(i_discmode) {
- case CDS_AUDIO:
- return CDIO_DISC_MODE_CD_DA;
- case CDS_DATA_1:
- case CDS_DATA_2:
- return CDIO_DISC_MODE_CD_DATA;
- case CDS_MIXED:
- return CDIO_DISC_MODE_CD_MIXED;
- case CDS_XA_2_1:
- case CDS_XA_2_2:
- return CDIO_DISC_MODE_CD_XA;
- case CDS_NO_INFO:
- return CDIO_DISC_MODE_NO_INFO;
- default:
- return CDIO_DISC_MODE_ERROR;
- }
-}
-
-/* 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
-is_cdrom_linux(const 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_NONBLOCK), 0);
- 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, "iso9660") == 0) ) {
- is_cd = true;
- }
- return(is_cd);
-}
-
-/* MMC driver to read audio sectors.
- Can read only up to 25 blocks.
-*/
-static int
-_read_audio_sectors_linux (void *p_user_data, void *buf, lsn_t lsn,
- unsigned int nblocks)
-{
- _img_private_t *p_env = p_user_data;
- return scsi_mmc_read_sectors( p_env->gen.cdio, buf, lsn,
- CDIO_MMC_READ_TYPE_CDDA, nblocks);
-}
-
-/* Packet driver to read mode2 sectors.
- Can read only up to 25 blocks.
-*/
-static int
-_read_mode2_sectors_mmc (_img_private_t *p_env, void *p_buf, lba_t lba,
- unsigned int nblocks, bool b_read_10)
-{
- scsi_mmc_cdb_t cdb = {{0, }};
-
- CDIO_MMC_SET_READ_LBA(cdb.field, lba);
-
- 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 = scsi_mmc_set_blocksize (p_env->gen.cdio, M2RAW_SECTOR_SIZE)))
- return retval;
-
- if ((retval = run_scsi_cmd_linux (p_env, 0,
- scsi_mmc_get_cmd_len(cdb.field[0]),
- &cdb,
- SCSI_MMC_DATA_READ,
- M2RAW_SECTOR_SIZE * nblocks,
- p_buf)))
- {
- scsi_mmc_set_blocksize (p_env->gen.cdio, CDIO_CD_FRAMESIZE);
- return retval;
- }
-
- if ((retval = scsi_mmc_set_blocksize (p_env->gen.cdio, CDIO_CD_FRAMESIZE)))
- return retval;
- } else
-
- cdb.field[1] = 0; /* sector size mode2 */
- cdb.field[9] = 0x58; /* 2336 mode2 */
-
- CDIO_MMC_SET_COMMAND(cdb.field, CDIO_MMC_GPCMD_READ_CD);
- CDIO_MMC_SET_READ_LENGTH24(cdb.field, nblocks);
-
- return run_scsi_cmd_linux (p_env, 0,
- scsi_mmc_get_cmd_len(cdb.field[0]), &cdb,
- SCSI_MMC_DATA_READ,
- M2RAW_SECTOR_SIZE * nblocks, p_buf);
-
- return 0;
-}
-
-static int
-_read_mode2_sectors (_img_private_t *p_env, void *p_buf, lba_t lba,
- unsigned int nblocks, bool b_read_10)
-{
- unsigned int l = 0;
- int retval = 0;
-
- while (nblocks > 0)
- {
- const unsigned nblocks2 = (nblocks > 25) ? 25 : nblocks;
- void *p_buf2 = ((char *)p_buf ) + (l * M2RAW_SECTOR_SIZE);
-
- retval |= _read_mode2_sectors_mmc (p_env, p_buf2, lba + l,
- nblocks2, b_read_10);
-
- if (retval)
- break;
-
- nblocks -= nblocks2;
- l += nblocks2;
- }
-
- return retval;
-}
-
-/*!
- Reads a single mode1 sector from cd device into data starting
- from lsn. Returns 0 if no error.
- */
-static int
-_read_mode1_sector_linux (void *p_user_data, void *p_data, lsn_t lsn,
- bool b_form2)
-{
-
-#if FIXED
- char buf[M2RAW_SECTOR_SIZE] = { 0, };
- struct cdrom_msf *p_msf = (struct cdrom_msf *) &buf;
- msf_t _msf;
-
- _img_private_t *p_env = p_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);
-
- retry:
- switch (p_env->access_mode)
- {
- case _AM_NONE:
- cdio_warn ("no way to read mode1");
- return 1;
- break;
-
- case _AM_IOCTL:
- if (ioctl (p_env->gen.fd, CDROMREADMODE1, &buf) == -1)
- {
- perror ("ioctl()");
- return 1;
- /* exit (EXIT_FAILURE); */
- }
- break;
-
- case _AM_READ_CD:
- case _AM_READ_10:
- if (_read_mode2_sectors (p_env->gen.fd, buf, lsn, 1,
- (p_env->access_mode == _AM_READ_10)))
- {
- perror ("ioctl()");
- if (p_env->access_mode == _AM_READ_CD)
- {
- cdio_info ("READ_CD failed; switching to READ_10 mode...");
- p_env->access_mode = _AM_READ_10;
- goto retry;
- }
- else
- {
- cdio_info ("READ_10 failed; switching to ioctl(CDROMREADMODE2) mode...");
- p_env->access_mode = _AM_IOCTL;
- goto retry;
- }
- return 1;
- }
- break;
- }
-
- memcpy (data, buf + CDIO_CD_SYNC_SIZE + CDIO_CD_HEADER_SIZE,
- b_form2 ? M2RAW_SECTOR_SIZE: CDIO_CD_FRAMESIZE);
-
-#else
- return cdio_generic_read_form1_sector(p_user_data, p_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_linux (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_linux (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_linux (void *p_user_data, void *p_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 = p_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);
-
- retry:
- 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;
-
- case _AM_READ_CD:
- case _AM_READ_10:
- if (_read_mode2_sectors (p_env, buf, lsn, 1,
- (p_env->access_mode == _AM_READ_10)))
- {
- perror ("ioctl()");
- if (p_env->access_mode == _AM_READ_CD)
- {
- cdio_info ("READ_CD failed; switching to READ_10 mode...");
- p_env->access_mode = _AM_READ_10;
- goto retry;
- }
- else
- {
- cdio_info ("READ_10 failed; switching to ioctl(CDROMREADMODE2) mode...");
- p_env->access_mode = _AM_IOCTL;
- goto retry;
- }
- return 1;
- }
- break;
- }
-
- if (b_form2)
- memcpy (p_data, buf, M2RAW_SECTOR_SIZE);
- else
- memcpy (((char *)p_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_linux (void *p_user_data, void *data, lsn_t lsn,
- bool b_form2, unsigned int nblocks)
-{
- _img_private_t *p_env = p_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;
- if ( (retval = _read_mode2_sector_linux (p_env,
- ((char *)data) + (i_blocksize*i),
- lsn + i, b_form2)) )
- return retval;
- }
- 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_linux (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-p_env->gen.i_first_track].cdte_track = i;
- p_env->tocent[i-p_env->gen.i_first_track].cdte_format = CDROM_MSF;
- if ( ioctl(p_env->gen.fd, CDROMREADTOCENTRY,
- &p_env->tocent[i-p_env->gen.i_first_track]) == -1 ) {
- cdio_warn("%s %d: %s\n",
- "error in ioctl CDROMREADTOCENTRY for track",
- i, strerror(errno));
- return false;
- }
- /****
- struct cdrom_msf0 *msf= &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= &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;
-}
-
-/*!
- 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_linux( 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 cdrom_generic_command cgc;
- memset (&cgc, 0, sizeof (struct cdrom_generic_command));
- memcpy(&cgc.cmd, p_cdb, i_cdb);
- cgc.buflen = i_buf;
- cgc.buffer = p_buf;
- cgc.data_direction = (SCSI_MMC_DATA_READ == cgc.data_direction)
- ? CGC_DATA_READ : CGC_DATA_WRITE;
-
-#ifdef HAVE_LINUX_CDROM_TIMEOUT
- cgc.timeout = i_timeout_ms;
-#endif
-
- return ioctl (p_env->gen.fd, CDROM_SEND_PACKET, &cgc);
-}
-
-/*!
- Return the size of the CD in logical block address (LBA) units.
- */
-static uint32_t
-stat_size_linux (void *p_user_data)
-{
- _img_private_t *p_env = p_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 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_linux (void *p_user_data, const char key[], const char value[])
-{
- _img_private_t *p_env = p_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"))
- {
- return str_to_access_mode_linux(value);
- }
- else
- return -1;
-
- return 0;
-}
-
-/* checklist: /dev/cdrom, /dev/dvd /dev/hd?, /dev/scd? /dev/sr? */
-static char checklist1[][40] = {
- {"cdrom"}, {"dvd"}, {""}
-};
-static char checklist2[][40] = {
- {"?a hd?"}, {"?0 scd?"}, {"?0 sr?"}, {""}
-};
-
-#endif /* HAVE_LINUX_CDROM */
-
-/*!
- Return an array of strings giving possible CD devices.
- */
-char **
-cdio_get_devices_linux (void)
-{
-#ifndef HAVE_LINUX_CDROM
- return NULL;
-#else
- unsigned int i;
- char drive[40];
- char *ret_drive;
- bool exists;
- char **drives = NULL;
- unsigned int num_drives=0;
-
- /* Scan the system for CD-ROM drives.
- */
- for ( i=0; strlen(checklist1[i]) > 0; ++i ) {
- sprintf(drive, "/dev/%s", checklist1[i]);
- if ( (exists=is_cdrom_linux(drive, NULL)) > 0 ) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
- }
-
- /* Now check the currently mounted CD drives */
- if (NULL != (ret_drive = check_mounts_linux("/etc/mtab"))) {
- cdio_add_device_list(&drives, ret_drive, &num_drives);
- free(ret_drive);
- }
-
- /* Finally check possible mountable drives in /etc/fstab */
- if (NULL != (ret_drive = check_mounts_linux("/etc/fstab"))) {
- cdio_add_device_list(&drives, ret_drive, &num_drives);
- free(ret_drive);
- }
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
- for ( i=0; strlen(checklist2[i]) > 0; ++i ) {
- unsigned int j;
- char *insert;
- exists = true;
- for ( j=checklist2[i][1]; exists; ++j ) {
- sprintf(drive, "/dev/%s", &checklist2[i][3]);
- insert = strchr(drive, '?');
- if ( insert != NULL ) {
- *insert = j;
- }
- if ( (exists=is_cdrom_linux(drive, NULL)) > 0 ) {
- cdio_add_device_list(&drives, drive, &num_drives);
- }
- }
- }
- cdio_add_device_list(&drives, NULL, &num_drives);
- return drives;
-#endif /*HAVE_LINUX_CDROM*/
-}
-
-/*!
- Return a string containing the default CD device.
- */
-char *
-cdio_get_default_device_linux(void)
-{
-#ifndef HAVE_LINUX_CDROM
- return NULL;
-
-#else
- unsigned int i;
- char drive[40];
- bool exists;
- char *ret_drive;
-
- /* Scan the system for CD-ROM drives.
- */
- for ( i=0; strlen(checklist1[i]) > 0; ++i ) {
- sprintf(drive, "/dev/%s", checklist1[i]);
- if ( (exists=is_cdrom_linux(drive, NULL)) > 0 ) {
- return strdup(drive);
- }
- }
-
- /* Now check the currently mounted CD drives */
- if (NULL != (ret_drive = check_mounts_linux("/etc/mtab")))
- return ret_drive;
-
- /* Finally check possible mountable drives in /etc/fstab */
- if (NULL != (ret_drive = check_mounts_linux("/etc/fstab")))
- return ret_drive;
-
- /* Scan the system for CD-ROM drives.
- Not always 100% reliable, so use the USE_MNTENT code above first.
- */
- for ( i=0; strlen(checklist2[i]) > 0; ++i ) {
- unsigned int j;
- char *insert;
- exists = true;
- for ( j=checklist2[i][1]; exists; ++j ) {
- sprintf(drive, "/dev/%s", &checklist2[i][3]);
- insert = strchr(drive, '?');
- if ( insert != NULL ) {
- *insert = j;
- }
- if ( (exists=is_cdrom_linux(drive, NULL)) > 0 ) {
- return(strdup(drive));
- }
- }
- }
- return NULL;
-#endif /*HAVE_LINUX_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_linux (const char *psz_source_name)
-{
- return cdio_open_am_linux(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_linux (const char *psz_orig_source, const char *access_mode)
-{
-
-#ifdef HAVE_LINUX_CDROM
- CdIo *ret;
- _img_private_t *_data;
- char *psz_source;
-
- cdio_funcs _funcs = {
- .eject_media = eject_media_linux,
- .free = cdio_generic_free,
- .get_arg = get_arg_linux,
- .get_cdtext = get_cdtext_generic,
- .get_default_device = cdio_get_default_device_linux,
- .get_devices = cdio_get_devices_linux,
- .get_discmode = get_discmode_linux,
-#if USE_LINUX_CAP
- .get_drive_cap = get_drive_cap_linux,
-#else
- .get_drive_cap = scsi_mmc_get_drive_cap_generic,
-#endif
- .get_first_track_num= get_first_track_num_generic,
- .get_hwinfo = NULL,
- .get_mcn = get_mcn_linux,
- .get_num_tracks = get_num_tracks_generic,
- .get_track_format = get_track_format_linux,
- .get_track_green = get_track_green_linux,
- .get_track_lba = NULL, /* This could be implemented if need be. */
- .get_track_msf = get_track_msf_linux,
- .lseek = cdio_generic_lseek,
- .read = cdio_generic_read,
- .read_audio_sectors = _read_audio_sectors_linux,
- .read_mode1_sector = _read_mode1_sector_linux,
- .read_mode1_sectors = _read_mode1_sectors_linux,
- .read_mode2_sector = _read_mode2_sector_linux,
- .read_mode2_sectors = _read_mode2_sectors_linux,
- .read_toc = read_toc_linux,
- .run_scsi_mmc_cmd = run_scsi_cmd_linux,
- .set_arg = set_arg_linux,
- .stat_size = stat_size_linux
- };
-
- _data = _cdio_malloc (sizeof (_img_private_t));
-
- _data->access_mode = str_to_access_mode_linux(access_mode);
- _data->gen.init = false;
- _data->gen.toc_init = false;
- _data->gen.fd = -1;
- _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) {
- free(_data);
- return NULL;
- }
- set_arg_linux(_data, "source", psz_source);
- free(psz_source);
- } else {
- if (cdio_is_device_generic(psz_orig_source))
- set_arg_linux(_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
- free(_data);
- return NULL;
- }
- }
-
- ret = cdio_new ((void *)_data, &_funcs);
- if (ret == NULL) return NULL;
-
- if (cdio_generic_init(_data)) {
- return ret;
- } else {
- cdio_generic_free (_data);
- return NULL;
- }
-
-#else
- return NULL;
-#endif /* HAVE_LINUX_CDROM */
-
-}
-
-bool
-cdio_have_linux (void)
-{
-#ifdef HAVE_LINUX_CDROM
- return true;
-#else
- return false;
-#endif /* HAVE_LINUX_CDROM */
-}
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 4f0d53cc8..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 fddbb390f..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/vcdio.c b/src/input/vcd/vcdio.c
index b3194e281..993a9f9ff 100644
--- a/src/input/vcd/vcdio.c
+++ b/src/input/vcd/vcdio.c
@@ -1,22 +1,22 @@
/*
$Id: vcdio.c,v 1.9 2007/03/23 21:47:31 dsalt Exp $
-
+
Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-
+
*/
#ifdef HAVE_CONFIG_H
@@ -63,30 +63,30 @@
#define FREE_AND_NULL(ptr) if (NULL != ptr) free(ptr); ptr = NULL;
-/*! Closes VCD device specified via "this", and also wipes memory of it
+/*! Closes VCD device specified via "this", and also wipes memory of it
from it inside "this". */
int
-vcdio_close(vcdplayer_t *p_vcdplayer)
+vcdio_close(vcdplayer_t *p_vcdplayer)
{
p_vcdplayer->b_opened = false;
FREE_AND_NULL(p_vcdplayer->psz_source);
FREE_AND_NULL(p_vcdplayer->track);
FREE_AND_NULL(p_vcdplayer->segment);
- FREE_AND_NULL(p_vcdplayer->entry);
-
+ FREE_AND_NULL(p_vcdplayer->entry);
+
return vcdinfo_close(p_vcdplayer->vcd);
}
/*! Opens VCD device and initializes things.
- - do nothing if the device had already been open and is the same device.
+ - do nothing if the device had already been open and is the same device.
- if the device had been open and is a different, close it before trying
- to open new device.
+ to open new device.
*/
bool
-vcdio_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device)
+vcdio_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device)
{
vcdinfo_obj_t *p_vcdinfo = p_vcdplayer->vcd;
unsigned int i;
@@ -137,60 +137,60 @@ vcdio_open(vcdplayer_t *p_vcdplayer, char *intended_vcd_device)
}
}
- /*
- Save summary info on tracks, segments and entries...
+ /*
+ Save summary info on tracks, segments and entries...
*/
if ( 0 < (p_vcdplayer->i_tracks = vcdinfo_get_num_tracks(p_vcdinfo)) ) {
- p_vcdplayer->track = (vcdplayer_play_item_info_t *)
+ p_vcdplayer->track = (vcdplayer_play_item_info_t *)
calloc(p_vcdplayer->i_tracks, sizeof(vcdplayer_play_item_info_t));
-
- for (i=0; i<p_vcdplayer->i_tracks; i++) {
+
+ for (i=0; i<p_vcdplayer->i_tracks; i++) {
track_t i_track=i+1;
- p_vcdplayer->track[i].size
+ p_vcdplayer->track[i].size
= vcdinfo_get_track_sect_count(p_vcdinfo, i_track);
- p_vcdplayer->track[i].start_LSN
+ p_vcdplayer->track[i].start_LSN
= vcdinfo_get_track_lsn(p_vcdinfo, i_track);
}
- } else
+ } else
p_vcdplayer->track = NULL;
-
+
if ( 0 < (p_vcdplayer->i_entries = vcdinfo_get_num_entries(p_vcdinfo)) ) {
- p_vcdplayer->entry = (vcdplayer_play_item_info_t *)
+ p_vcdplayer->entry = (vcdplayer_play_item_info_t *)
calloc(p_vcdplayer->i_entries, sizeof(vcdplayer_play_item_info_t));
- for (i=0; i<p_vcdplayer->i_entries; i++) {
+ for (i=0; i<p_vcdplayer->i_entries; i++) {
p_vcdplayer->entry[i].size
= vcdinfo_get_entry_sect_count(p_vcdinfo, i);
- p_vcdplayer->entry[i].start_LSN
+ p_vcdplayer->entry[i].start_LSN
= vcdinfo_get_entry_lsn(p_vcdinfo, i);
}
- } else
+ } else
p_vcdplayer->entry = NULL;
-
+
if ( 0 < (p_vcdplayer->i_segments = vcdinfo_get_num_segments(p_vcdinfo)) ) {
- p_vcdplayer->segment = (vcdplayer_play_item_info_t *)
+ p_vcdplayer->segment = (vcdplayer_play_item_info_t *)
calloc(p_vcdplayer->i_segments, sizeof(vcdplayer_play_item_info_t));
-
- for (i=0; i<p_vcdplayer->i_segments; i++) {
- p_vcdplayer->segment[i].size
+
+ for (i=0; i<p_vcdplayer->i_segments; i++) {
+ p_vcdplayer->segment[i].size
= vcdinfo_get_seg_sector_count(p_vcdinfo, i);
- p_vcdplayer->segment[i].start_LSN
+ p_vcdplayer->segment[i].start_LSN
= vcdinfo_get_seg_lsn(p_vcdinfo, i);
}
- } else
+ } else
p_vcdplayer->segment = NULL;
-
+
return true;
}
/*!
- seek position, return new position
+ seek position, return new position
if seeking failed, -1 is returned
*/
-off_t
-vcdio_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin)
+off_t
+vcdio_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin)
{
switch (origin) {
@@ -198,54 +198,54 @@ vcdio_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin)
{
lsn_t old_lsn = p_vcdplayer->i_lsn;
p_vcdplayer->i_lsn = p_vcdplayer->origin_lsn + (offset / M2F2_SECTOR_SIZE);
-
- dbg_print(INPUT_DBG_SEEK_SET, "seek_set to %ld => %u (start is %u)\n",
+
+ dbg_print(INPUT_DBG_SEEK_SET, "seek_set to %ld => %u (start is %u)\n",
(long int) offset, p_vcdplayer->i_lsn, p_vcdplayer->origin_lsn);
/* Seek was successful. Invalidate entry location by setting
- entry number back to 1. Over time it will adjust upward
+ entry number back to 1. Over time it will adjust upward
to the correct value. */
- if ( !vcdplayer_pbc_is_on(p_vcdplayer)
- && p_vcdplayer->play_item.type != VCDINFO_ITEM_TYPE_TRACK
+ if ( !vcdplayer_pbc_is_on(p_vcdplayer)
+ && p_vcdplayer->play_item.type != VCDINFO_ITEM_TYPE_TRACK
&& p_vcdplayer->i_lsn < old_lsn) {
dbg_print(INPUT_DBG_SEEK_SET, "seek_set entry backwards\n");
p_vcdplayer->next_entry = 1;
}
break;
}
-
- case SEEK_CUR:
+
+ case SEEK_CUR:
{
off_t diff;
if (offset) {
LOG_ERR(p_vcdplayer, "%s: %d\n",
- _("SEEK_CUR not implemented for non-zero offset"),
+ _("SEEK_CUR not implemented for non-zero offset"),
(int) offset);
return (off_t) -1;
}
-
+
if (p_vcdplayer->slider_length == VCDPLAYER_SLIDER_LENGTH_TRACK) {
diff = p_vcdplayer->i_lsn - p_vcdplayer->track_lsn;
- dbg_print(INPUT_DBG_SEEK_CUR,
- "current pos: %u, track diff %ld\n",
+ dbg_print(INPUT_DBG_SEEK_CUR,
+ "current pos: %u, track diff %ld\n",
p_vcdplayer->i_lsn, (long int) diff);
} else {
diff = p_vcdplayer->i_lsn - p_vcdplayer->origin_lsn;
- dbg_print(INPUT_DBG_SEEK_CUR,
- "current pos: %u, entry diff %ld\n",
+ dbg_print(INPUT_DBG_SEEK_CUR,
+ "current pos: %u, entry diff %ld\n",
p_vcdplayer->i_lsn, (long int) diff);
}
-
+
if (diff < 0) {
dbg_print(INPUT_DBG_SEEK_CUR, "Error: diff < 0\n");
return (off_t) 0;
} else {
return (off_t)diff * M2F2_SECTOR_SIZE;
}
-
+
break;
}
-
+
case SEEK_END:
LOG_ERR(p_vcdplayer, "%s\n", _("SEEK_END not implemented yet."));
return (off_t) -1;
@@ -258,7 +258,7 @@ vcdio_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin)
return offset ; /* FIXME */
}
-/*
+/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8
diff --git a/src/input/vcd/vcdio.h b/src/input/vcd/vcdio.h
index 145bb4d7f..854ba5333 100644
--- a/src/input/vcd/vcdio.h
+++ b/src/input/vcd/vcdio.h
@@ -1,22 +1,22 @@
-/*
+/*
$Id: vcdio.h,v 1.3 2005/01/08 15:12:42 rockyb Exp $
Copyright (C) 2002, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-
+
*/
#ifndef _VCDIO_H_
@@ -27,37 +27,37 @@
read nlen bytes, return number of bytes read.
*/
-off_t
+off_t
vcdio_read (vcdplayer_t *p_vcdplayer, char *psz_buf, const off_t nlen);
/*! Opens VCD device and initializes things.
- - do nothing if the device had already been open and is the same device.
+ - do nothing if the device had already been open and is the same device.
- if the device had been open and is a different, close it before trying
- to open new device.
+ to open new device.
*/
bool
vcdio_open(vcdplayer_t *p_vcdplayer, char *psz_device);
-/*! Closes VCD device specified via "this", and also wipes memory of it
+/*! Closes VCD device specified via "this", and also wipes memory of it
from it inside "this". */
/* FIXME Move player stuff to player. */
-int
+int
vcdio_close(vcdplayer_t *p_vcdplayer);
/*!
From xine plugin spec:
- seek position, return new position
+ seek position, return new position
if seeking failed, -1 is returned
*/
-off_t
+off_t
vcdio_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin);
#endif /* _VCDIO_H_ */
-/*
+/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8
diff --git a/src/input/vcd/vcdplayer.c b/src/input/vcd/vcdplayer.c
index 7f9189cba..5e36e125e 100644
--- a/src/input/vcd/vcdplayer.c
+++ b/src/input/vcd/vcdplayer.c
@@ -1,22 +1,22 @@
-/*
+/*
$Id: vcdplayer.c,v 1.20 2007/02/21 23:17:14 dgp85 Exp $
-
+
Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-
+
*/
#ifdef HAVE_CONFIG_H
@@ -64,15 +64,15 @@ static void _vcdplayer_set_origin(vcdplayer_t *p_vcdplayer);
Return true if playback control (PBC) is on
*/
bool
-vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer)
+vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer)
{
- return VCDINFO_INVALID_ENTRY != p_vcdplayer->i_lid;
+ return VCDINFO_INVALID_ENTRY != p_vcdplayer->i_lid;
}
/* Given an itemid, return the size for the object (via information
previously stored when opening the vcd). */
static size_t
-_vcdplayer_get_item_size(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
+_vcdplayer_get_item_size(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
{
switch (itemid.type) {
case VCDINFO_ITEM_TYPE_ENTRY:
@@ -125,17 +125,17 @@ _vcdplayer_get_item_size(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
/*!
Take a format string and expand escape sequences, that is sequences that
- begin with %, with information from the current VCD.
+ begin with %, with information from the current VCD.
The expanded string is returned. Here is a list of escape sequences:
- %A : The album information
+ %A : The album information
%C : The VCD volume count - the number of CD's in the collection.
- %c : The VCD volume num - the number of the CD in the collection.
+ %c : The VCD volume num - the number of the CD in the collection.
%F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD
%I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...
%L : The playlist ID prefixed with " LID" if it exists
%N : The current number of the above - a decimal number
- %P : The publisher ID
+ %P : The publisher ID
%p : The preparer ID
%S : If we are in a segment (menu), the kind of segment
%T : The track number
@@ -174,7 +174,7 @@ vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
saw_control_prefix = !saw_control_prefix;
break;
case 'A':
- add_format_str_info(vcdinfo_strip_trail(vcdinfo_get_album_id(p_vcdinfo),
+ add_format_str_info(vcdinfo_strip_trail(vcdinfo_get_album_id(p_vcdinfo),
MAX_ALBUM_LEN));
break;
@@ -197,19 +197,19 @@ vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
strncat(tp, "Track", TEMP_STR_LEN-(tp-temp_str));
tp += strlen("Track");
break;
- case VCDINFO_ITEM_TYPE_ENTRY:
+ case VCDINFO_ITEM_TYPE_ENTRY:
strncat(tp, "Entry", TEMP_STR_LEN-(tp-temp_str));
tp += strlen("Entry");
break;
- case VCDINFO_ITEM_TYPE_SEGMENT:
+ case VCDINFO_ITEM_TYPE_SEGMENT:
strncat(tp, "Segment", TEMP_STR_LEN-(tp-temp_str));
tp += strlen("Segment");
break;
- case VCDINFO_ITEM_TYPE_LID:
+ case VCDINFO_ITEM_TYPE_LID:
strncat(tp, "List ID", TEMP_STR_LEN-(tp-temp_str));
tp += strlen("List ID");
break;
- case VCDINFO_ITEM_TYPE_SPAREID2:
+ case VCDINFO_ITEM_TYPE_SPAREID2:
strncat(tp, "Navigation", TEMP_STR_LEN-(tp-temp_str));
tp += strlen("Navigation");
break;
@@ -247,7 +247,7 @@ vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
if ( VCDINFO_ITEM_TYPE_SEGMENT==p_vcdplayer->play_item.type ) {
char seg_type_str[30];
- snprintf(seg_type_str, sizeof(seg_type_str), " %s",
+ snprintf(seg_type_str, sizeof(seg_type_str), " %s",
vcdinfo_video_type2str(p_vcdinfo, p_vcdplayer->play_item.num));
strncat(tp, seg_type_str, TEMP_STR_LEN-(tp-temp_str));
tp += strlen(seg_type_str);
@@ -268,7 +268,7 @@ vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
break;
default:
- *tp++ = '%';
+ *tp++ = '%';
*tp++ = format_str[i];
saw_control_prefix = false;
}
@@ -277,7 +277,7 @@ vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[])
}
static void
-_vcdplayer_update_entry(vcdinfo_obj_t *p_vcdinfo, uint16_t ofs,
+_vcdplayer_update_entry(vcdinfo_obj_t *p_vcdinfo, uint16_t ofs,
uint16_t *entry, const char *label)
{
if ( ofs == VCDINFO_INVALID_OFFSET ) {
@@ -293,8 +293,8 @@ _vcdplayer_update_entry(vcdinfo_obj_t *p_vcdinfo, uint16_t ofs,
}
/*!
- Update next/prev/return/default navigation buttons
- (via p_vcdplayer->i_lid). Update size of play-item
+ Update next/prev/return/default navigation buttons
+ (via p_vcdplayer->i_lid). Update size of play-item
(via p_vcdplayer->play_item).
*/
void
@@ -307,51 +307,51 @@ vcdplayer_update_nav(vcdplayer_t *p_vcdplayer)
int max_entry = 0;
if (vcdplayer_pbc_is_on(p_vcdplayer)) {
-
+
vcdinfo_lid_get_pxd(p_vcdinfo, &(p_vcdplayer->pxd), p_vcdplayer->i_lid);
-
+
switch (p_vcdplayer->pxd.descriptor_type) {
case PSD_TYPE_SELECTION_LIST:
case PSD_TYPE_EXT_SELECTION_LIST:
if (p_vcdplayer->pxd.psd == NULL) return;
- _vcdplayer_update_entry(p_vcdinfo,
+ _vcdplayer_update_entry(p_vcdinfo,
vcdinf_psd_get_prev_offset(p_vcdplayer->pxd.psd),
&(p_vcdplayer->prev_entry), "prev");
-
- _vcdplayer_update_entry(p_vcdinfo,
+
+ _vcdplayer_update_entry(p_vcdinfo,
vcdinf_psd_get_next_offset(p_vcdplayer->pxd.psd),
&(p_vcdplayer->next_entry), "next");
-
- _vcdplayer_update_entry(p_vcdinfo,
+
+ _vcdplayer_update_entry(p_vcdinfo,
vcdinf_psd_get_return_offset(p_vcdplayer->pxd.psd),
&(p_vcdplayer->return_entry), "return");
- _vcdplayer_update_entry(p_vcdinfo,
- vcdinfo_get_default_offset(p_vcdinfo,
+ _vcdplayer_update_entry(p_vcdinfo,
+ vcdinfo_get_default_offset(p_vcdinfo,
p_vcdplayer->i_lid),
&(p_vcdplayer->default_entry), "default");
break;
case PSD_TYPE_PLAY_LIST:
if (p_vcdplayer->pxd.pld == NULL) return;
- _vcdplayer_update_entry(p_vcdinfo,
+ _vcdplayer_update_entry(p_vcdinfo,
vcdinf_pld_get_prev_offset(p_vcdplayer->pxd.pld),
&(p_vcdplayer->prev_entry), "prev");
-
- _vcdplayer_update_entry(p_vcdinfo,
+
+ _vcdplayer_update_entry(p_vcdinfo,
vcdinf_pld_get_next_offset(p_vcdplayer->pxd.pld),
&(p_vcdplayer->next_entry), "next");
-
- _vcdplayer_update_entry(p_vcdinfo,
+
+ _vcdplayer_update_entry(p_vcdinfo,
vcdinf_pld_get_return_offset(p_vcdplayer->pxd.pld),
&(p_vcdplayer->return_entry), "return");
p_vcdplayer->default_entry = VCDINFO_INVALID_ENTRY;
break;
case PSD_TYPE_END_LIST:
- p_vcdplayer->origin_lsn = p_vcdplayer->i_lsn = p_vcdplayer->end_lsn
+ p_vcdplayer->origin_lsn = p_vcdplayer->i_lsn = p_vcdplayer->end_lsn
= VCDINFO_NULL_LSN;
/* Fall through */
case PSD_TYPE_COMMAND_LIST:
- p_vcdplayer->next_entry = p_vcdplayer->prev_entry
+ p_vcdplayer->next_entry = p_vcdplayer->prev_entry
= p_vcdplayer->return_entry = VCDINFO_INVALID_ENTRY;
p_vcdplayer->default_entry = VCDINFO_INVALID_ENTRY;
break;
@@ -363,53 +363,53 @@ vcdplayer_update_nav(vcdplayer_t *p_vcdplayer)
}
/* PBC is not on. Set up for simplified next, prev, and return. */
-
+
switch (p_vcdplayer->play_item.type) {
- case VCDINFO_ITEM_TYPE_ENTRY:
- case VCDINFO_ITEM_TYPE_SEGMENT:
- case VCDINFO_ITEM_TYPE_TRACK:
+ case VCDINFO_ITEM_TYPE_ENTRY:
+ case VCDINFO_ITEM_TYPE_SEGMENT:
+ case VCDINFO_ITEM_TYPE_TRACK:
switch (p_vcdplayer->play_item.type) {
- case VCDINFO_ITEM_TYPE_ENTRY:
+ case VCDINFO_ITEM_TYPE_ENTRY:
max_entry = p_vcdplayer->i_entries;
min_entry = 0; /* Can remove when Entries start at 1. */
p_vcdplayer->i_track = vcdinfo_get_track(p_vcdinfo, play_item);
- p_vcdplayer->track_lsn = vcdinfo_get_track_lsn(p_vcdinfo,
+ p_vcdplayer->track_lsn = vcdinfo_get_track_lsn(p_vcdinfo,
p_vcdplayer->i_track);
break;
- case VCDINFO_ITEM_TYPE_SEGMENT:
+ case VCDINFO_ITEM_TYPE_SEGMENT:
max_entry = p_vcdplayer->i_segments;
p_vcdplayer->i_track = VCDINFO_INVALID_TRACK;
-
+
break;
- case VCDINFO_ITEM_TYPE_TRACK:
+ case VCDINFO_ITEM_TYPE_TRACK:
max_entry = p_vcdplayer->i_tracks;
p_vcdplayer->i_track = p_vcdplayer->play_item.num;
- p_vcdplayer->track_lsn = vcdinfo_get_track_lsn(p_vcdinfo,
+ p_vcdplayer->track_lsn = vcdinfo_get_track_lsn(p_vcdinfo,
p_vcdplayer->i_track);
break;
default: ; /* Handle exceptional cases below */
}
-
+
_vcdplayer_set_origin(p_vcdplayer);
/* Set next, prev, return and default to simple and hopefully
useful values.
*/
- if (play_item+1 >= max_entry)
+ if (play_item+1 >= max_entry)
p_vcdplayer->next_entry = VCDINFO_INVALID_ENTRY;
- else
+ else
p_vcdplayer->next_entry = play_item+1;
-
- if (play_item-1 >= min_entry)
+
+ if (play_item-1 >= min_entry)
p_vcdplayer->prev_entry = play_item-1;
- else
+ else
p_vcdplayer->prev_entry = VCDINFO_INVALID_ENTRY;
-
+
p_vcdplayer->default_entry = play_item;
p_vcdplayer->return_entry = min_entry;
break;
- case VCDINFO_ITEM_TYPE_LID:
+ case VCDINFO_ITEM_TYPE_LID:
{
/* Should have handled above. */
break;
@@ -423,9 +423,9 @@ vcdplayer_update_nav(vcdplayer_t *p_vcdplayer)
Set reading to play an entire track.
*/
static void
-_vcdplayer_set_track(vcdplayer_t *p_vcdplayer, unsigned int i_track)
+_vcdplayer_set_track(vcdplayer_t *p_vcdplayer, unsigned int i_track)
{
- if (i_track < 1 || i_track > p_vcdplayer->i_tracks)
+ if (i_track < 1 || i_track > p_vcdplayer->i_tracks)
return;
else {
vcdinfo_obj_t *p_vcdinfo = p_vcdplayer->vcd;
@@ -449,7 +449,7 @@ _vcdplayer_set_track(vcdplayer_t *p_vcdplayer, unsigned int i_track)
Set reading to play an entry
*/
static void
-_vcdplayer_set_entry(vcdplayer_t *p_vcdplayer, unsigned int num)
+_vcdplayer_set_entry(vcdplayer_t *p_vcdplayer, unsigned int num)
{
vcdinfo_obj_t *p_vcdinfo = p_vcdplayer->vcd;
const unsigned int i_entries = vcdinfo_get_num_entries(p_vcdinfo);
@@ -466,14 +466,14 @@ _vcdplayer_set_entry(vcdplayer_t *p_vcdplayer, unsigned int num)
p_vcdplayer->i_lsn = vcdinfo_get_entry_lsn(p_vcdinfo, num);
p_vcdplayer->play_item = itemid;
p_vcdplayer->i_track = vcdinfo_get_track(p_vcdinfo, num);
- p_vcdplayer->track_lsn = vcdinfo_get_track_lsn(p_vcdinfo,
+ p_vcdplayer->track_lsn = vcdinfo_get_track_lsn(p_vcdinfo,
p_vcdplayer->i_track);
- p_vcdplayer->track_end_lsn = p_vcdplayer->track_lsn +
+ p_vcdplayer->track_end_lsn = p_vcdplayer->track_lsn +
p_vcdplayer->track[p_vcdplayer->i_track-1].size;
_vcdplayer_set_origin(p_vcdplayer);
- dbg_print((INPUT_DBG_LSN|INPUT_DBG_PBC), "LSN: %u, track_end LSN: %u\n",
+ dbg_print((INPUT_DBG_LSN|INPUT_DBG_PBC), "LSN: %u, track_end LSN: %u\n",
p_vcdplayer->i_lsn, p_vcdplayer->track_end_lsn);
}
}
@@ -482,7 +482,7 @@ _vcdplayer_set_entry(vcdplayer_t *p_vcdplayer, unsigned int num)
Set reading to play an segment (e.g. still frame)
*/
static void
-_vcdplayer_set_segment(vcdplayer_t *p_vcdplayer, unsigned int num)
+_vcdplayer_set_segment(vcdplayer_t *p_vcdplayer, unsigned int num)
{
vcdinfo_obj_t *p_vcdinfo = p_vcdplayer->vcd;
segnum_t i_segs = vcdinfo_get_num_segments(p_vcdinfo);
@@ -497,17 +497,17 @@ _vcdplayer_set_segment(vcdplayer_t *p_vcdplayer, unsigned int num)
p_vcdplayer->i_track = 0;
if (VCDINFO_NULL_LSN==p_vcdplayer->i_lsn) {
- LOG_ERR(p_vcdplayer, "%s %d\n",
+ LOG_ERR(p_vcdplayer, "%s %d\n",
_("Error in getting current segment number"), num);
return;
}
-
+
itemid.num = num;
itemid.type = VCDINFO_ITEM_TYPE_SEGMENT;
p_vcdplayer->play_item = itemid;
_vcdplayer_set_origin(p_vcdplayer);
-
+
dbg_print(INPUT_DBG_LSN, "LSN: %u\n", p_vcdplayer->i_lsn);
}
}
@@ -519,29 +519,29 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
{
vcdinfo_obj_t *p_vcdinfo = p_vcdplayer->vcd;
- dbg_print(INPUT_DBG_CALL, "called itemid.num: %d, itemid.type: %d\n",
+ dbg_print(INPUT_DBG_CALL, "called itemid.num: %d, itemid.type: %d\n",
itemid.num, itemid.type);
p_vcdplayer->i_still = 0;
switch (itemid.type) {
- case VCDINFO_ITEM_TYPE_SEGMENT:
+ case VCDINFO_ITEM_TYPE_SEGMENT:
{
- vcdinfo_video_segment_type_t segtype
+ vcdinfo_video_segment_type_t segtype
= vcdinfo_get_video_type(p_vcdinfo, itemid.num);
segnum_t i_segs = vcdinfo_get_num_segments(p_vcdinfo);
- dbg_print(INPUT_DBG_PBC, "%s (%d), itemid.num: %d\n",
- vcdinfo_video_type2str(p_vcdinfo, itemid.num),
+ dbg_print(INPUT_DBG_PBC, "%s (%d), itemid.num: %d\n",
+ vcdinfo_video_type2str(p_vcdinfo, itemid.num),
(int) segtype, itemid.num);
if (itemid.num >= i_segs) return;
_vcdplayer_set_segment(p_vcdplayer, itemid.num);
vcdinfo_get_seg_resolution(p_vcdinfo, itemid.num,
- &(p_vcdplayer->max_x),
+ &(p_vcdplayer->max_x),
&(p_vcdplayer->max_y));
-
+
switch (segtype) {
case VCDINFO_FILES_VIDEO_NTSC_STILL:
case VCDINFO_FILES_VIDEO_NTSC_STILL2:
@@ -558,7 +558,7 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
case VCD_TYPE_VCD:
case VCD_TYPE_VCD11:
case VCD_TYPE_VCD2:
- /* aspect ratio for VCD's is known to be 4:3 for any
+ /* aspect ratio for VCD's is known to be 4:3 for any
type of VCD's */
p_vcdplayer->set_aspect_ratio(1);
break;
@@ -566,17 +566,17 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
}
p_vcdplayer->i_still = 0;
}
-
+
break;
}
-
+
case VCDINFO_ITEM_TYPE_TRACK:
dbg_print(INPUT_DBG_PBC, "track %d\n", itemid.num);
if (itemid.num < 1 || itemid.num > p_vcdplayer->i_tracks) return;
_vcdplayer_set_track(p_vcdplayer, itemid.num);
break;
-
- case VCDINFO_ITEM_TYPE_ENTRY:
+
+ case VCDINFO_ITEM_TYPE_ENTRY:
{
unsigned int i_entries = vcdinfo_get_num_entries(p_vcdinfo);
dbg_print(INPUT_DBG_PBC, "entry %d\n", itemid.num);
@@ -584,7 +584,7 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
_vcdplayer_set_entry(p_vcdplayer, itemid.num);
break;
}
-
+
case VCDINFO_ITEM_TYPE_LID:
LOG_ERR(p_vcdplayer, "%s\n", _("Should have converted this above"));
break;
@@ -598,7 +598,7 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
LOG_ERR(p_vcdplayer, "item type %d not implemented.\n", itemid.type);
return;
}
-
+
p_vcdplayer->play_item = itemid;
vcdplayer_update_nav(p_vcdplayer);
@@ -613,7 +613,7 @@ vcdplayer_play_single_item(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
/*
Get the next play-item in the list given in the LIDs. Note play-item
here refers to list of play-items for a single LID It shouldn't be
- confused with a user's list of favorite things to play or the
+ confused with a user's list of favorite things to play or the
"next" field of a LID which moves us to a different LID.
*/
static bool
@@ -626,9 +626,9 @@ _vcdplayer_inc_play_item(vcdplayer_t *p_vcdplayer)
if ( NULL == p_vcdplayer || NULL == p_vcdplayer->pxd.pld ) return false;
noi = vcdinf_pld_get_noi(p_vcdplayer->pxd.pld);
-
+
if ( noi <= 0 ) return false;
-
+
/* Handle delays like autowait or wait here? */
p_vcdplayer->pdi++;
@@ -636,12 +636,12 @@ _vcdplayer_inc_play_item(vcdplayer_t *p_vcdplayer)
if ( p_vcdplayer->pdi < 0 || p_vcdplayer->pdi >= noi ) return false;
else {
- uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcdplayer->pxd.pld,
+ uint16_t trans_itemid_num=vcdinf_pld_get_play_item(p_vcdplayer->pxd.pld,
p_vcdplayer->pdi);
vcdinfo_itemid_t trans_itemid;
if (VCDINFO_INVALID_ITEMID == trans_itemid_num) return false;
-
+
vcdinfo_classify_itemid(trans_itemid_num, &trans_itemid);
dbg_print(INPUT_DBG_PBC, " play-item[%d]: %s\n",
p_vcdplayer->pdi, vcdinfo_pin2str (trans_itemid_num));
@@ -653,7 +653,7 @@ _vcdplayer_inc_play_item(vcdplayer_t *p_vcdplayer)
void
vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
{
- dbg_print(INPUT_DBG_CALL, "called itemid.num: %d itemid.type: %d\n",
+ dbg_print(INPUT_DBG_CALL, "called itemid.num: %d itemid.type: %d\n",
itemid.num, itemid.type);
if (!vcdplayer_pbc_is_on(p_vcdplayer)) {
@@ -667,9 +667,9 @@ vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
p_vcdplayer->i_lid = itemid.num;
vcdinfo_lid_get_pxd(p_vcdinfo, &(p_vcdplayer->pxd), itemid.num);
-
+
switch (p_vcdplayer->pxd.descriptor_type) {
-
+
case PSD_TYPE_SELECTION_LIST:
case PSD_TYPE_EXT_SELECTION_LIST: {
vcdinfo_itemid_t trans_itemid;
@@ -683,29 +683,29 @@ vcdplayer_play(vcdplayer_t *p_vcdplayer, vcdinfo_itemid_t itemid)
vcdplayer_play_single_item(p_vcdplayer, trans_itemid);
break;
}
-
+
case PSD_TYPE_PLAY_LIST: {
if (p_vcdplayer->pxd.pld == NULL) return;
p_vcdplayer->pdi = -1;
_vcdplayer_inc_play_item(p_vcdplayer);
break;
}
-
+
case PSD_TYPE_END_LIST:
case PSD_TYPE_COMMAND_LIST:
-
+
default:
;
}
}
}
-/*
- Set's start origin and size for subsequent seeks.
+/*
+ Set's start origin and size for subsequent seeks.
input: p_vcdplayer->i_lsn, p_vcdplayer->play_item
changed: p_vcdplayer->origin_lsn, p_vcdplayer->end_lsn
*/
-static void
+static void
_vcdplayer_set_origin(vcdplayer_t *p_vcdplayer)
{
size_t size = _vcdplayer_get_item_size(p_vcdplayer, p_vcdplayer->play_item);
@@ -713,7 +713,7 @@ _vcdplayer_set_origin(vcdplayer_t *p_vcdplayer)
p_vcdplayer->end_lsn = p_vcdplayer->i_lsn + size;
p_vcdplayer->origin_lsn = p_vcdplayer->i_lsn;
- dbg_print((INPUT_DBG_CALL|INPUT_DBG_LSN), "end LSN: %u\n",
+ dbg_print((INPUT_DBG_CALL|INPUT_DBG_LSN), "end LSN: %u\n",
p_vcdplayer->end_lsn);
}
@@ -730,29 +730,29 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
/* We are in playback control. */
vcdinfo_itemid_t itemid;
- /* The end of an entry is really the end of the associated
+ /* The end of an entry is really the end of the associated
sequence (or track). */
-
- if ( (VCDINFO_ITEM_TYPE_ENTRY == p_vcdplayer->play_item.type) &&
+
+ if ( (VCDINFO_ITEM_TYPE_ENTRY == p_vcdplayer->play_item.type) &&
(p_vcdplayer->i_lsn < p_vcdplayer->track_end_lsn) ) {
/* Set up to just continue to the next entry */
p_vcdplayer->play_item.num++;
- dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC),
+ dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC),
"continuing into next entry: %u\n", p_vcdplayer->play_item.num);
vcdplayer_play_single_item(p_vcdplayer, p_vcdplayer->play_item);
p_vcdplayer->update_title();
return READ_BLOCK;
}
-
+
switch (p_vcdplayer->pxd.descriptor_type) {
case PSD_TYPE_END_LIST:
return READ_END;
break;
case PSD_TYPE_PLAY_LIST: {
int wait_time = vcdinf_get_wait_time(p_vcdplayer->pxd.pld);
-
+
dbg_print(INPUT_DBG_PBC, "playlist wait_time: %d\n", wait_time);
-
+
if (_vcdplayer_inc_play_item(p_vcdplayer))
return READ_BLOCK;
@@ -773,18 +773,18 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
int wait_time = vcdinf_get_timeout_time(p_vcdplayer->pxd.psd);
uint16_t timeout_offs = vcdinf_get_timeout_offset(p_vcdplayer->pxd.psd);
uint16_t max_loop = vcdinf_get_loop_count(p_vcdplayer->pxd.psd);
- vcdinfo_offset_t *offset_timeout_LID =
+ vcdinfo_offset_t *offset_timeout_LID =
vcdinfo_get_offset_t(p_vcdplayer->vcd, timeout_offs);
-
- dbg_print(INPUT_DBG_PBC, "wait_time: %d, looped: %d, max_loop %d\n",
+
+ dbg_print(INPUT_DBG_PBC, "wait_time: %d, looped: %d, max_loop %d\n",
wait_time, p_vcdplayer->i_loop, max_loop);
-
+
/* Set caller to handle wait time given. */
if (STILL_READING == p_vcdplayer->i_still && wait_time > 0) {
p_vcdplayer->i_still = wait_time;
return READ_STILL_FRAME;
}
-
+
/* Handle any looping given. */
if ( max_loop == 0 || p_vcdplayer->i_loop < max_loop ) {
p_vcdplayer->i_loop++;
@@ -793,10 +793,10 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
if (p_vcdplayer->i_still) p_vcdplayer->force_redisplay();
return READ_BLOCK;
}
-
+
/* Looping finished and wait finished. Move to timeout
entry or next entry, or handle still. */
-
+
if (NULL != offset_timeout_LID) {
/* Handle timeout_LID */
itemid.num = offset_timeout_LID->lid;
@@ -811,12 +811,12 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
unsigned int bsn=vcdinf_get_bsn(p_vcdplayer->pxd.psd);
int rand_selection=bsn +
(int) ((i_selections+0.0)*rand()/(RAND_MAX+1.0));
- lid_t rand_lid=vcdinfo_selection_get_lid(p_vcdplayer->vcd,
+ lid_t rand_lid=vcdinfo_selection_get_lid(p_vcdplayer->vcd,
p_vcdplayer->i_lid,
rand_selection);
itemid.num = rand_lid;
itemid.type = VCDINFO_ITEM_TYPE_LID;
- dbg_print(INPUT_DBG_PBC, "random selection %d, lid: %d\n",
+ dbg_print(INPUT_DBG_PBC, "random selection %d, lid: %d\n",
rand_selection - bsn, rand_lid);
vcdplayer_play(p_vcdplayer, itemid);
return READ_BLOCK;
@@ -825,19 +825,19 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
RETURN_NULL_STILL ;
}
}
-
+
break;
}
- case VCDINFO_ITEM_TYPE_NOTFOUND:
+ case VCDINFO_ITEM_TYPE_NOTFOUND:
LOG_ERR(p_vcdplayer, "NOTFOUND in PBC -- not supposed to happen\n");
break;
- case VCDINFO_ITEM_TYPE_SPAREID2:
+ case VCDINFO_ITEM_TYPE_SPAREID2:
LOG_ERR(p_vcdplayer, "SPAREID2 in PBC -- not supposed to happen\n");
break;
- case VCDINFO_ITEM_TYPE_LID:
+ case VCDINFO_ITEM_TYPE_LID:
LOG_ERR(p_vcdplayer, "LID in PBC -- not supposed to happen\n");
break;
-
+
default:
;
}
@@ -848,8 +848,8 @@ vcdplayer_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
return READ_BLOCK;
}
-/* Handles navigation when NOT in PBC reaching the end of a play item.
- The navigations rules here we are sort of made up, but the intent
+/* Handles navigation when NOT in PBC reaching the end of a play item.
+ The navigations rules here we are sort of made up, but the intent
is to do something that's probably right or helpful.
*/
static vcdplayer_read_status_t
@@ -859,22 +859,22 @@ vcdplayer_non_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
switch (p_vcdplayer->play_item.type) {
case VCDINFO_ITEM_TYPE_TRACK:
case VCDINFO_ITEM_TYPE_ENTRY:
- if (p_vcdplayer->autoadvance
+ if (p_vcdplayer->autoadvance
&& p_vcdplayer->next_entry != VCDINFO_INVALID_ENTRY) {
p_vcdplayer->play_item.num=p_vcdplayer->next_entry;
vcdplayer_update_nav(p_vcdplayer);
- } else
+ } else
return READ_END;
break;
- case VCDINFO_ITEM_TYPE_SPAREID2:
+ case VCDINFO_ITEM_TYPE_SPAREID2:
RETURN_NULL_STILL ;
- case VCDINFO_ITEM_TYPE_NOTFOUND:
+ case VCDINFO_ITEM_TYPE_NOTFOUND:
LOG_ERR(p_vcdplayer, "NOTFOUND outside PBC -- not supposed to happen\n");
return READ_END;
break;
- case VCDINFO_ITEM_TYPE_LID:
+ case VCDINFO_ITEM_TYPE_LID:
LOG_ERR(p_vcdplayer, "LID outside PBC -- not supposed to happen\n");
return READ_END;
break;
@@ -890,26 +890,26 @@ vcdplayer_non_pbc_nav (vcdplayer_t *p_vcdplayer, uint8_t *p_buf)
/*!
Read i_len bytes into buf and return the status back.
- This routine is a bit complicated because on reaching the end of
- a track or entry we may automatically advance to the item, or
+ This routine is a bit complicated because on reaching the end of
+ a track or entry we may automatically advance to the item, or
interpret the next item in the playback-control list.
*/
vcdplayer_read_status_t
-vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf,
- const off_t i_len)
+vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf,
+ const off_t i_len)
{
if ( p_vcdplayer->i_lsn >= p_vcdplayer->end_lsn ) {
vcdplayer_read_status_t read_status;
-
+
/* We've run off of the end of this entry. Do we continue or stop? */
- dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC),
- "end reached, cur: %u, end: %u\n",
+ dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC),
+ "end reached, cur: %u, end: %u\n",
p_vcdplayer->i_lsn, p_vcdplayer->end_lsn);
handle_item_continuation:
- read_status = vcdplayer_pbc_is_on(p_vcdplayer)
- ? vcdplayer_pbc_nav(p_vcdplayer, p_buf)
+ read_status = vcdplayer_pbc_is_on(p_vcdplayer)
+ ? vcdplayer_pbc_nav(p_vcdplayer, p_buf)
: vcdplayer_non_pbc_nav(p_vcdplayer, p_buf);
if (READ_STILL_FRAME == read_status) {
@@ -919,11 +919,11 @@ vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf,
if (READ_BLOCK != read_status) return read_status;
}
- /* Read the next block.
-
+ /* Read the next block.
+
Important note: we probably speed things up by removing "data"
and the memcpy to it by extending vcd_image_source_read_mode2
- to allow a mode to do what's below in addition to its
+ to allow a mode to do what's below in addition to its
"raw" and "block" mode. It also would probably improve the modularity
a little bit as well.
*/
@@ -938,7 +938,7 @@ vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf,
vcdsector_t vcd_sector;
do {
- if (cdio_read_mode2_sector(p_img, &vcd_sector,
+ if (cdio_read_mode2_sector(p_img, &vcd_sector,
p_vcdplayer->i_lsn, true)!=0) {
dbg_print(INPUT_DBG_LSN, "read error\n");
p_vcdplayer->i_lsn++;
@@ -948,36 +948,36 @@ vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf,
if ( p_vcdplayer->i_lsn >= p_vcdplayer->end_lsn ) {
/* We've run off of the end of this entry. Do we continue or stop? */
- dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC),
- "end reached in reading, cur: %u, end: %u\n",
+ dbg_print( (INPUT_DBG_LSN|INPUT_DBG_PBC),
+ "end reached in reading, cur: %u, end: %u\n",
p_vcdplayer->i_lsn, p_vcdplayer->end_lsn);
break;
}
-
+
/* Check header ID for a padding sector and simply discard
these. It is alleged that VCD's put these in to keep the
bitrate constant.
*/
} while((vcd_sector.subheader[2]&~0x01)==0x60);
- if ( p_vcdplayer->i_lsn >= p_vcdplayer->end_lsn )
+ if ( p_vcdplayer->i_lsn >= p_vcdplayer->end_lsn )
/* We've run off of the end of this entry. Do we continue or stop? */
goto handle_item_continuation;
-
+
memcpy (p_buf, vcd_sector.data, M2F2_SECTOR_SIZE);
return READ_BLOCK;
}
}
/* Do if needed */
-void
+void
vcdplayer_send_button_update(vcdplayer_t *p_vcdplayer, const int mode)
{
/* dbg_print(INPUT_DBG_CALL, "Called\n"); */
return;
}
-/*
+/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8
diff --git a/src/input/vcd/vcdplayer.h b/src/input/vcd/vcdplayer.h
index 868ca32e4..8a51ced7b 100644
--- a/src/input/vcd/vcdplayer.h
+++ b/src/input/vcd/vcdplayer.h
@@ -1,22 +1,22 @@
-/*
+/*
$Id: vcdplayer.h,v 1.12 2006/06/10 17:38:47 dgp85 Exp $
Copyright (C) 2002, 2003, 2004, 2005 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
-
+
*/
#ifndef _VCDPLAYER_H_
@@ -70,7 +70,7 @@ extern unsigned long int vcdplayer_debug;
if (vcdplayer_debug & mask) \
fprintf(stderr, "%s: "s, __func__ , ##args)
#else
-#define dbg_print(mask, s, args...)
+#define dbg_print(mask, s, args...)
#endif
/*------------------------------------------------------------------
@@ -83,14 +83,14 @@ extern unsigned long int vcdplayer_debug;
typedef enum {
VCDPLAYER_SLIDER_LENGTH_AUTO,
VCDPLAYER_SLIDER_LENGTH_TRACK,
- VCDPLAYER_SLIDER_LENGTH_ENTRY,
+ VCDPLAYER_SLIDER_LENGTH_ENTRY,
} vcdplayer_slider_length_t;
typedef enum {
VCDPLAYER_AUTOPLAY_TRACK = VCDINFO_ITEM_TYPE_TRACK,
VCDPLAYER_AUTOPLAY_ENTRY = VCDINFO_ITEM_TYPE_ENTRY,
VCDPLAYER_AUTOPLAY_SEGMENT = VCDINFO_ITEM_TYPE_SEGMENT,
- VCDPLAYER_AUTOPLAY_PBC = VCDINFO_ITEM_TYPE_LID,
+ VCDPLAYER_AUTOPLAY_PBC = VCDINFO_ITEM_TYPE_LID,
} vcdplayer_autoplay_t;
typedef struct {
@@ -104,7 +104,7 @@ typedef int (*generic_fn)();
2,000 seconds (33.33 minutes). We'll use a number larger than this
to signal indefinite wait.
*/
-#define STILL_INDEFINITE_WAIT 3000
+#define STILL_INDEFINITE_WAIT 3000
/* Value when we have yet to finish reading blocks of a frame. */
#define STILL_READING -5
@@ -114,7 +114,7 @@ typedef struct vcdplayer_s {
vcdinfo_obj_t *vcd; /* Pointer to libvcd structures. */
/*------------------------------------------------------------------
- User-settable options
+ User-settable options
--------------------------------------------------------------*/
unsigned int i_debug; /* Debugging mask */
unsigned int i_blocks_per_read; /* number of blocks per read */
@@ -122,7 +122,7 @@ typedef struct vcdplayer_s {
/*------------------------------------------------------------------
Callback functions - players and higher-level routines can use
this to customize their behavior when using this player-independent
- code.
+ code.
---------------------------------------------------------------------*/
generic_fn log_msg; /* function to log a message in the player */
@@ -130,36 +130,36 @@ typedef struct vcdplayer_s {
/* Function to flush any audio or video buffers */
- void (*flush_buffers) (void);
+ void (*flush_buffers) (void);
/* Function to force a redisplay. */
- void (*force_redisplay) (void);
+ void (*force_redisplay) (void);
/* Function to set aspect ratio. */
- void (*set_aspect_ratio) (int);
+ void (*set_aspect_ratio) (int);
/* Function to update title of selection. */
void (*update_title) ();
/*-------------------------------------------------------------
- Playback control fields
+ Playback control fields
--------------------------------------------------------------*/
- int i_still; /* 0 if not in still,
+ int i_still; /* 0 if not in still,
STILL_INDEFINITE_WAIT if indefinite time,
STILL_READING if don't have full picture,
else number of seconds yet to wait */
int i_lid; /* LID that play item is in. Implies PBC is.
- on. VCDPLAYER_BAD_ENTRY if not none or
+ on. VCDPLAYER_BAD_ENTRY if not none or
not in PBC */
PsdListDescriptor pxd; /* If PBC is on, the relevant PSD/PLD */
- int pdi; /* current pld index of pxd. -1 if
+ int pdi; /* current pld index of pxd. -1 if
no index*/
vcdinfo_itemid_t play_item; /* play-item, VCDPLAYER_BAD_ENTRY if none */
vcdinfo_itemid_t loop_item; /* Where do we loop back to? Meaningful only
in a selection list */
- int i_loop; /* # of times play-item has been played.
+ int i_loop; /* # of times play-item has been played.
Meaningful only in a selection list.
*/
track_t i_track; /* current track number */
@@ -167,16 +167,16 @@ typedef struct vcdplayer_s {
/*-----------------------------------
Navigation and location fields
------------------------------------*/
- uint16_t next_entry; /* where to go if next is pressed,
+ uint16_t next_entry; /* where to go if next is pressed,
VCDPLAYER_BAD_ENTRY if none */
- uint16_t prev_entry; /* where to fo if prev is pressed,
+ uint16_t prev_entry; /* where to fo if prev is pressed,
VCDPLAYER_BAD_ENTRY if none */
uint16_t return_entry; /* Entry index to use if return is pressed */
uint16_t default_entry; /* Default selection entry. */
lsn_t i_lsn; /* LSN of where we are right now */
lsn_t end_lsn; /* LSN of end of current entry/segment/track.
- entry/segment/track. This block can be read
+ entry/segment/track. This block can be read
(and is not one after the "end"). */
lsn_t origin_lsn; /* LSN of start of seek/slider position. */
@@ -192,8 +192,8 @@ typedef struct vcdplayer_s {
char *psz_source; /* VCD device currently open */
bool b_opened; /* true if initialized */
vcd_type_t vcd_format; /* VCD 2.0, 1,1, SVCD, HQVCD? */
-
- track_t i_tracks; /* # of playable MPEG tracks. This is
+
+ track_t i_tracks; /* # of playable MPEG tracks. This is
generally one less than the number
of CD tracks as the first CD track
is an ISO-9660 track and is not
@@ -213,20 +213,20 @@ typedef struct vcdplayer_s {
---------------------------------------------------------------*/
/* What type to use on autoplay */
- vcdplayer_autoplay_t default_autoplay;
+ vcdplayer_autoplay_t default_autoplay;
- /* When hitting end of entry or track do we advance automatically
+ /* When hitting end of entry or track do we advance automatically
to next entry/track or stop? Only valid if PBC is off. */
- bool autoadvance;
+ bool autoadvance;
- /* Do next/prev wrap around? Only valid if PBC is off. */
- bool wrap_next_prev;
+ /* Do next/prev wrap around? Only valid if PBC is off. */
+ bool wrap_next_prev;
/* Show and be able to select rejected LIDs? */
- bool show_rejected;
+ bool show_rejected;
/* Whether GUI slider is track size or entry size. */
- vcdplayer_slider_length_t slider_length;
+ vcdplayer_slider_length_t slider_length;
} vcdplayer_t;
@@ -240,7 +240,7 @@ typedef enum {
/* ----------------------------------------------------------------------
- Function Prototypes
+ Function Prototypes
-----------------------------------------------------------------------*/
/*!
@@ -250,17 +250,17 @@ bool vcdplayer_pbc_is_on(const vcdplayer_t *p_vcdplayer);
/*!
Take a format string and expand escape sequences, that is sequences that
- begin with %, with information from the current VCD.
+ begin with %, with information from the current VCD.
The expanded string is returned. Here is a list of escape sequences:
- %A : The album information
+ %A : The album information
%C : The VCD volume count - the number of CD's in the collection.
- %c : The VCD volume num - the number of the CD in the collection.
+ %c : The VCD volume num - the number of the CD in the collection.
%F : The VCD Format, e.g. VCD 1.0, VCD 1.1, VCD 2.0, or SVCD
%I : The current entry/segment/playback type, e.g. ENTRY, TRACK, SEGMENT...
%L : The playlist ID prefixed with " LID" if it exists
%N : The current number of the above - a decimal number
- %P : The publisher ID
+ %P : The publisher ID
%p : The preparer ID
%V : The volume set ID
%v : The volume ID
@@ -271,13 +271,13 @@ char *
vcdplayer_format_str(vcdplayer_t *p_vcdplayer, const char format_str[]);
/*!
- Update next/prev/return/default navigation buttons.
+ Update next/prev/return/default navigation buttons.
*/
void
vcdplayer_update_nav(vcdplayer_t *p_vcdplayer);
/*! Update the player title text. */
-void
+void
vcdplayer_update_title_display(vcdplayer_t *p_vcdplayer);
/*! Play title part. If part is -1, use the first title. */
@@ -294,22 +294,22 @@ vcdplayer_read_status_t
vcdplayer_read (vcdplayer_t *p_vcdplayer, uint8_t *p_buf, const off_t nlen);
/*!
- seek position, return new position
+ seek position, return new position
if seeking failed, -1 is returned
*/
-off_t
+off_t
vcdplayer_seek (vcdplayer_t *p_vcdplayer, off_t offset, int origin);
/*!
Get the number of tracks or titles of the VCD. The result is stored
in "titles".
*/
-void
+void
vcdplayer_send_button_update(vcdplayer_t *p_vcdplayer, int mode);
#endif /* _VCDPLAYER_H_ */
-/*
+/*
* Local variables:
* c-file-style: "gnu"
* tab-width: 8
diff --git a/src/input/vcd/xine-extra.h b/src/input/vcd/xine-extra.h
index 8acf1f291..5037e68ad 100644
--- a/src/input/vcd/xine-extra.h
+++ b/src/input/vcd/xine-extra.h
@@ -36,9 +36,9 @@
#endif
/* Xine includes */
-#include "xine_internal.h"
-#include "input_plugin.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/input_plugin.h>
+#include <xine/xineutils.h>
/*!
This routine is like xine_log, except it takes a va_list instead of
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index 70fcfe7ae..1f6a885db 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -52,8 +52,8 @@
#define xine_config_entry_t xine_cfg_entry_t
/* Xine includes */
-#include "xineutils.h"
-#include "input_plugin.h"
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
#include "xine-extra.h"
@@ -274,7 +274,7 @@ vcd_add_mrl_slot(vcd_input_class_t *this, const char *mrl, off_t size,
this->mrls[*i]->mrl = strdup(mrl);
if (NULL==this->mrls[*i]->mrl) {
- LOG_ERR("Can't malloc %zu bytes for MRL name %s", sizeof(xine_mrl_t), mrl);
+ LOG_ERR("Can't strndup %zu bytes for MRL name %s", strlen(mrl), mrl);
}
(*i)++;
}
@@ -1000,31 +1000,6 @@ vcd_plugin_get_mrl (input_plugin_t *this_gen)
}
}
-/*!
- From xine plugin spec:
-
- return human readable (verbose = 1 line) description for this plugin
-*/
-static const char *
-vcd_class_get_description (input_class_t *this_gen)
-{
- dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n");
- return _("Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... ");
-}
-
-/*!
- From xine plugin spec:
-
- return short, human readable identifier for this plugin
- this is used for GUI buttons, The identifier must have max. 4 characters
- characters (max. 5 including terminating \0)
-*/
-static const char *
-vcd_class_get_identifier (input_class_t *this_gen) {
- dbg_print((INPUT_DBG_CALL|INPUT_DBG_EXT), "called\n");
- return SHORT_PLUGIN_NAME;
-}
-
/*
Handle all queued keyboard/mouse events. Return TRUE if this causes
a change in the play item.
@@ -1778,8 +1753,8 @@ vcd_init (xine_t *xine, void *data)
class->mrls = NULL;
class->input_class.get_instance = vcd_class_get_instance;
- class->input_class.get_identifier = vcd_class_get_identifier;
- class->input_class.get_description = vcd_class_get_description;
+ class->input_class.identifier = SHORT_PLUGIN_NAME;
+ class->input_class.description = N_("Video CD plugin with PBC and support for: (X)VCD, (X)SVCD, HQVCD, CVD ... ");
class->input_class.get_dir = vcd_class_get_dir;
class->input_class.get_autoplay_list = vcd_class_get_autoplay_list;
class->input_class.dispose = vcd_class_dispose;
@@ -1823,13 +1798,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 =
@@ -2015,7 +1990,7 @@ _("For tracking down bugs in the VCD plugin. Mask values are:\n"
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 17, (char *) SHORT_PLUGIN_NAME,
+ { PLUGIN_INPUT | PLUGIN_MUST_PRELOAD, 18, (char *) SHORT_PLUGIN_NAME,
XINE_VERSION_CODE, NULL, vcd_init },
{ PLUGIN_NONE, 0, (char *) "", 0, NULL, NULL }
};
diff --git a/src/liba52/Makefile.am b/src/liba52/Makefile.am
deleted file mode 100644
index b13170076..000000000
--- a/src/liba52/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-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/bit_allocate.c b/src/liba52/bit_allocate.c
deleted file mode 100644
index 9da1661dc..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 b645cb79f..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 59f91cc0e..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 ac7666a90..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/imdct.c b/src/liba52/imdct.c
deleted file mode 100644
index 672b54c2e..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 c7531ec61..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 = calloc(1, 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/xine_a52_decoder.c b/src/liba52/xine_a52_decoder.c
deleted file mode 100644
index b4b628c81..000000000
--- a/src/liba52/xine_a52_decoder.c
+++ /dev/null
@@ -1,875 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * stuff needed to turn liba52 into a xine decoder plugin
- */
-
-#ifndef __sun
-/* required for swab() */
-#define _XOPEN_SOURCE 500
-#endif
-/* avoid compiler warnings */
-#define _BSD_SOURCE 1
-
-#include "config.h"
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#define LOG_MODULE "a52_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-#define LOG_PTS
-*/
-
-#include "xine_internal.h"
-#include "audio_out.h"
-
-#ifdef HAVE_A52DEC_A52_H
-# include <a52dec/a52.h>
-#else
-# include "a52.h"
-#endif
-
-#include "buffer.h"
-#include "xineutils.h"
-
-#include "crc.c"
-
-#undef DEBUG_A52
-#ifdef DEBUG_A52
-int a52file;
-#endif
-
-typedef struct {
- audio_decoder_class_t decoder_class;
- config_values_t *config;
-
- float a52_level;
- int disable_dynrng_compress;
- int enable_surround_downmix;
-
-} a52dec_class_t;
-
-typedef struct a52dec_decoder_s {
- audio_decoder_t audio_decoder;
-
- a52dec_class_t *class;
- xine_stream_t *stream;
- int64_t pts;
- int64_t pts_list[5];
- int32_t pts_list_position;
-
- uint8_t frame_buffer[3840];
- uint8_t *frame_ptr;
- int sync_state;
- int frame_length, frame_todo;
- uint16_t syncword;
-
- a52_state_t *a52_state;
- int a52_flags;
- int a52_bit_rate;
- int a52_sample_rate;
- int have_lfe;
-
- int a52_flags_map[11];
- int ao_flags_map[11];
-
- int audio_caps;
- int bypass_mode;
- int output_sampling_rate;
- int output_open;
- int output_mode;
-
-} a52dec_decoder_t;
-
-struct frmsize_s
-{
- uint16_t bit_rate;
- uint16_t frm_size[3];
-};
-
-static const struct frmsize_s frmsizecod_tbl[64] =
-{
- { 32 ,{64 ,69 ,96 } },
- { 32 ,{64 ,70 ,96 } },
- { 40 ,{80 ,87 ,120 } },
- { 40 ,{80 ,88 ,120 } },
- { 48 ,{96 ,104 ,144 } },
- { 48 ,{96 ,105 ,144 } },
- { 56 ,{112 ,121 ,168 } },
- { 56 ,{112 ,122 ,168 } },
- { 64 ,{128 ,139 ,192 } },
- { 64 ,{128 ,140 ,192 } },
- { 80 ,{160 ,174 ,240 } },
- { 80 ,{160 ,175 ,240 } },
- { 96 ,{192 ,208 ,288 } },
- { 96 ,{192 ,209 ,288 } },
- { 112 ,{224 ,243 ,336 } },
- { 112 ,{224 ,244 ,336 } },
- { 128 ,{256 ,278 ,384 } },
- { 128 ,{256 ,279 ,384 } },
- { 160 ,{320 ,348 ,480 } },
- { 160 ,{320 ,349 ,480 } },
- { 192 ,{384 ,417 ,576 } },
- { 192 ,{384 ,418 ,576 } },
- { 224 ,{448 ,487 ,672 } },
- { 224 ,{448 ,488 ,672 } },
- { 256 ,{512 ,557 ,768 } },
- { 256 ,{512 ,558 ,768 } },
- { 320 ,{640 ,696 ,960 } },
- { 320 ,{640 ,697 ,960 } },
- { 384 ,{768 ,835 ,1152 } },
- { 384 ,{768 ,836 ,1152 } },
- { 448 ,{896 ,975 ,1344 } },
- { 448 ,{896 ,976 ,1344 } },
- { 512 ,{1024 ,1114 ,1536 } },
- { 512 ,{1024 ,1115 ,1536 } },
- { 576 ,{1152 ,1253 ,1728 } },
- { 576 ,{1152 ,1254 ,1728 } },
- { 640 ,{1280 ,1393 ,1920 } },
- { 640 ,{1280 ,1394 ,1920 } }
-};
-
-/* config callbacks */
-static void a52_level_change_cb(void *this_gen, xine_cfg_entry_t *entry);
-static void dynrng_compress_change_cb(void *this_gen, xine_cfg_entry_t *entry);
-static void surround_downmix_change_cb(void *this_gen, xine_cfg_entry_t *entry);
-
-
-static void a52dec_reset (audio_decoder_t *this_gen) {
-
- a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
-
- this->syncword = 0;
- this->sync_state = 0;
- this->pts = 0;
- this->pts_list[0] = 0;
- this->pts_list_position = 0;
-}
-
-static void a52dec_discontinuity (audio_decoder_t *this_gen) {
-
- a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
-
- this->pts = 0;
- this->pts_list[0] = 0;
- this->pts_list_position = 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 inline void mute_channel (int16_t * s16, int num_channels) {
- int i;
-
- for (i = 0; i < 256; i++) {
- s16[num_channels*i] = 0;
- }
-}
-
-static void a52dec_decode_frame (a52dec_decoder_t *this, int64_t pts, int preview_mode) {
-
- int output_mode = AO_CAP_MODE_STEREO;
-
- /*
- * do we want to decode this frame in software?
- */
-#ifdef LOG_PTS
- printf("a52dec:decode_frame:pts=%lld\n",pts);
-#endif
- if (!this->bypass_mode) {
-
- int a52_output_flags, i;
- sample_t level = this->class->a52_level;
- audio_buffer_t *buf;
- int16_t *int_samples;
- sample_t *samples = a52_samples(this->a52_state);
-
- /*
- * oki, decode this frame in software
- */
-
- /* determine output mode */
-
- a52_output_flags = this->a52_flags_map[this->a52_flags & A52_CHANNEL_MASK];
-
- if (a52_frame (this->a52_state,
- this->frame_buffer,
- &a52_output_flags,
- &level, 384)) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: a52_frame error\n");
- return;
- }
-
- if (this->class->disable_dynrng_compress)
- a52_dynrng (this->a52_state, NULL, NULL);
-
- this->have_lfe = a52_output_flags & A52_LFE;
- if (this->have_lfe)
- if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
- output_mode = AO_CAP_MODE_5_1CHANNEL;
- } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
- output_mode = AO_CAP_MODE_4_1CHANNEL;
- } else {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: WHAT DO I DO!!!\n");
- output_mode = this->ao_flags_map[a52_output_flags];
- }
- else
- output_mode = this->ao_flags_map[a52_output_flags];
- /*
- * (re-)open output device
- */
-
- if (!this->output_open
- || (this->a52_sample_rate != this->output_sampling_rate)
- || (output_mode != this->output_mode)) {
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
-
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream, 16,
- this->a52_sample_rate,
- output_mode) ;
- this->output_sampling_rate = this->a52_sample_rate;
- this->output_mode = output_mode;
- }
-
-
- if (!this->output_open || preview_mode)
- return;
-
-
- /*
- * decode a52 and convert/interleave samples
- */
-
- buf = this->stream->audio_out->get_buffer (this->stream->audio_out);
- int_samples = buf->mem;
- buf->num_frames = 256*6;
-
- for (i = 0; i < 6; i++) {
- if (a52_block (this->a52_state)) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: a52_block error on audio channel %d\n", i);
-#if 0
- for(n=0;n<2000;n++) {
- printf("%02x ",this->frame_buffer[n]);
- if ((n % 32) == 0) printf("\n");
- }
- printf("\n");
-#endif
- buf->num_frames = 0;
- break;
- }
-
- switch (output_mode) {
- case AO_CAP_MODE_MONO:
- float_to_int (&samples[0], int_samples+(i*256), 1);
- break;
- case AO_CAP_MODE_STEREO:
- float_to_int (&samples[0*256], int_samples+(i*256*2), 2);
- float_to_int (&samples[1*256], int_samples+(i*256*2)+1, 2);
- break;
- case AO_CAP_MODE_4CHANNEL:
- float_to_int (&samples[0*256], int_samples+(i*256*4), 4); /* L */
- float_to_int (&samples[1*256], int_samples+(i*256*4)+1, 4); /* R */
- float_to_int (&samples[2*256], int_samples+(i*256*4)+2, 4); /* RL */
- float_to_int (&samples[3*256], int_samples+(i*256*4)+3, 4); /* RR */
- break;
- case AO_CAP_MODE_4_1CHANNEL:
- float_to_int (&samples[0*256], int_samples+(i*256*6)+5, 6); /* LFE */
- float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
- float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
- float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
- float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
- mute_channel ( int_samples+(i*256*6)+4, 6); /* C */
- break;
- case AO_CAP_MODE_5CHANNEL:
- float_to_int (&samples[0*256], int_samples+(i*256*6)+0, 6); /* L */
- float_to_int (&samples[1*256], int_samples+(i*256*6)+4, 6); /* C */
- float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
- float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
- float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
- mute_channel ( int_samples+(i*256*6)+5, 6); /* LFE */
- break;
- case AO_CAP_MODE_5_1CHANNEL:
- float_to_int (&samples[0*256], int_samples+(i*256*6)+5, 6); /* lfe */
- float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
- float_to_int (&samples[2*256], int_samples+(i*256*6)+4, 6); /* C */
- float_to_int (&samples[3*256], int_samples+(i*256*6)+1, 6); /* R */
- float_to_int (&samples[4*256], int_samples+(i*256*6)+2, 6); /* RL */
- float_to_int (&samples[5*256], int_samples+(i*256*6)+3, 6); /* RR */
- break;
- default:
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52: help - unsupported mode %08x\n", output_mode);
- }
- }
-
- lprintf ("%d frames output\n", buf->num_frames);
-
- /* output decoded samples */
-
- buf->vpts = pts;
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, buf, this->stream);
-
- } else {
-
- /*
- * loop through a52 data
- */
-
- if (!this->output_open) {
-
- int sample_rate, bit_rate, flags;
-
- a52_syncinfo (this->frame_buffer, &flags, &sample_rate, &bit_rate);
-
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream, 16,
- sample_rate,
- AO_CAP_MODE_A52) ;
- this->output_mode = AO_CAP_MODE_A52;
- }
-
- if (this->output_open && !preview_mode) {
- /* SPDIF Passthrough
- * Build SPDIF Header and encaps the A52 audio data in it.
- */
- uint32_t syncword, crc1, fscod,frmsizecod,bsid,bsmod,frame_size;
- uint8_t *data_out,*data_in;
- audio_buffer_t *buf = this->stream->audio_out->get_buffer (this->stream->audio_out);
- data_in=(uint8_t *) this->frame_buffer;
- data_out=(uint8_t *) buf->mem;
- syncword = data_in[0] | (data_in[1] << 8);
- crc1 = data_in[2] | (data_in[3] << 8);
- fscod = (data_in[4] >> 6) & 0x3;
- frmsizecod = data_in[4] & 0x3f;
- bsid = (data_in[5] >> 3) & 0x1f;
- bsmod = data_in[5] & 0x7; /* bsmod, stream = 0 */
- frame_size = frmsizecod_tbl[frmsizecod].frm_size[fscod] ;
-
- data_out[0] = 0x72; data_out[1] = 0xf8; /* spdif syncword */
- data_out[2] = 0x1f; data_out[3] = 0x4e; /* .............. */
- data_out[4] = 0x01; /* AC3 data */
- data_out[5] = bsmod; /* bsmod, stream = 0 */
- data_out[6] = (frame_size << 4) & 0xff; /* frame_size * 16 */
- data_out[7] = ((frame_size ) >> 4) & 0xff;
- swab(data_in, &data_out[8], frame_size * 2 );
-
- buf->num_frames = 1536;
- buf->vpts = pts;
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, buf, this->stream);
-
- }
- }
-}
-
-static void a52dec_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
- uint8_t *current = buf->content;
- uint8_t *sync_start=current + 1;
- uint8_t *end = buf->content + buf->size;
- uint8_t byte;
- int32_t n;
- uint16_t crc16;
- uint16_t crc16_result;
-
- lprintf ("decode data %d bytes of type %08x, pts=%"PRId64"\n",
- buf->size, buf->type, buf->pts);
- lprintf ("decode data decoder_info=%d, %d\n",buf->decoder_info[1],buf->decoder_info[2]);
-
- if (buf->decoder_flags & BUF_FLAG_HEADER)
- return;
-
- /* swap byte pairs if this is RealAudio DNET data */
- if (buf->type == BUF_AUDIO_DNET) {
-
- lprintf ("byte-swapping dnet\n");
-
- while (current != end) {
- byte = *current++;
- *(current - 1) = *current;
- *current++ = byte;
- }
-
- /* reset */
- current = buf->content;
- end = buf->content + buf->size;
- }
-
- /* A52 packs come from the DVD in blocks of about 2048 bytes.
- * Only 1 PTS values can be assigned to each block.
- * An A52 frame is about 1700 bytes long.
- * So, a single A52 packs can contain 2 A52 frames (or the beginning of an A52 frame at least).
- * If we have a PTS value, which A52 frame does it apply to? The A52 pack tells us that.
- * So, the info about which A52 frame the PTS applies to is contained in decoder_info sent from the demuxer.
- *
- * The PTS value from the A52 pack (DVD sector) can only be applied at the start of an A52 frame.
- * We call the start of an A52 frame a frame header.
- * So, if a A52 pack has 2 "Number of frame headers" is means that the A52 pack contains 2 A52 frame headers.
- * The "First access unit" then tells us which A52 frame the PTS value applies to.
- *
- * Take the following example: -
- * PACK1: PTS = 10. Contains the entire A52 frame1, followed by the beginning of the frame2. PTS applies to frame1.
- * PACK2: PTS = 1000, Contains the rest of frame2, and the whole of frame3. and the start of frame4. PTS applies to frame4.
- * PACK3: PTS = 0 (none), Contains the rest of frame4.
- *
- * Output should be: -
- * frame1, PTS=10
- * frame2, PTS=0
- * frame3, PTS=0
- * frame4, PTS=1000
- *
- * So, we have to keep track of PTS values from previous A52 packs here, otherwise they get put on the wrong frame.
- */
-
-
- /* FIXME: the code here does not match the explanation above */
- if (buf->pts) {
- int32_t info;
- info = buf->decoder_info[1];
- this->pts = buf->pts;
- this->pts_list[this->pts_list_position]=buf->pts;
- this->pts_list_position++;
- if( this->pts_list_position > 3 )
- this->pts_list_position = 3;
- if (info == 2) {
- this->pts_list[this->pts_list_position]=0;
- this->pts_list_position++;
- if( this->pts_list_position > 3 )
- this->pts_list_position = 3;
- }
- }
-#if 0
- for(n=0;n < buf->size;n++) {
- if ((n % 32) == 0) printf("\n");
- printf("%x ", current[n]);
- }
- printf("\n");
-#endif
-
- lprintf ("processing...state %d\n", this->sync_state);
-
- while (current < end) {
- switch (this->sync_state) {
- case 0: /* Looking for sync header */
- this->syncword = (this->syncword << 8) | *current++;
- if (this->syncword == 0x0b77) {
-
- this->frame_buffer[0] = 0x0b;
- this->frame_buffer[1] = 0x77;
-
- this->sync_state = 1;
- this->frame_ptr = this->frame_buffer+2;
- }
- break;
-
- case 1: /* Looking for enough bytes for sync_info. */
- sync_start = current - 1;
- *this->frame_ptr++ = *current++;
- if ((this->frame_ptr - this->frame_buffer) > 16) {
- int a52_flags_old = this->a52_flags;
- int a52_sample_rate_old = this->a52_sample_rate;
- int a52_bit_rate_old = this->a52_bit_rate;
-
- this->frame_length = a52_syncinfo (this->frame_buffer,
- &this->a52_flags,
- &this->a52_sample_rate,
- &this->a52_bit_rate);
-
- if (this->frame_length < 80) { /* Invalid a52 frame_length */
- this->syncword = 0;
- current = sync_start;
- this->sync_state = 0;
- break;
- }
-
- lprintf("Frame length = %d\n",this->frame_length);
-
- this->frame_todo = this->frame_length - 17;
- this->sync_state = 2;
- if (!_x_meta_info_get(this->stream, XINE_META_INFO_AUDIOCODEC) ||
- a52_flags_old != this->a52_flags ||
- a52_sample_rate_old != this->a52_sample_rate ||
- a52_bit_rate_old != this->a52_bit_rate) {
-
- switch (this->a52_flags & A52_CHANNEL_MASK) {
- case A52_3F2R:
- if (this->a52_flags & A52_LFE)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 5.1");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 5.0");
- break;
- case A52_3F1R:
- case A52_2F2R:
- if (this->a52_flags & A52_LFE)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 4.1");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 4.0");
- break;
- case A52_2F1R:
- case A52_3F:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 3.0");
- break;
- case A52_STEREO:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 2.0 (stereo)");
- break;
- case A52_DOLBY:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 2.0 (dolby)");
- break;
- case A52_MONO:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52 1.0");
- break;
- default:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "A/52");
- break;
- }
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, this->a52_bit_rate);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->a52_sample_rate);
- }
- }
- break;
-
- case 2: /* Filling frame_buffer with sync_info bytes */
- *this->frame_ptr++ = *current++;
- this->frame_todo--;
- if (this->frame_todo < 1) {
- this->sync_state = 3;
- } else break;
-
- case 3: /* Ready for decode */
- crc16 = (uint16_t) ((this->frame_buffer[2] << 8) | this->frame_buffer[3]) ;
- crc16_result = crc16_block(&this->frame_buffer[2], this->frame_length - 2) ; /* frame_length */
- if (crc16_result != 0) { /* CRC16 failed */
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "liba52:a52 frame failed crc16 checksum.\n");
- current = sync_start;
- this->pts = 0;
- this->syncword = 0;
- this->sync_state = 0;
- break;
- }
-#if 0
- a52dec_decode_frame (this, this->pts_list[0], buf->decoder_flags & BUF_FLAG_PREVIEW);
-#else
- a52dec_decode_frame (this, this->pts, buf->decoder_flags & BUF_FLAG_PREVIEW);
-#endif
- for(n=0;n<4;n++) {
- this->pts_list[n] = this->pts_list[n+1];
- }
- this->pts_list_position--;
- if( this->pts_list_position < 0 )
- this->pts_list_position = 0;
-#if 0
- printf("liba52: pts_list = %lld, %lld, %lld\n",
- this->pts_list[0],
- this->pts_list[1],
- this->pts_list[2]);
-#endif
- case 4: /* Clear up ready for next frame */
- this->pts = 0;
- this->syncword = 0;
- this->sync_state = 0;
- break;
- default: /* No come here */
- break;
- }
- }
-
-#ifdef DEBUG_A52
- write (a52file, this->frame_buffer, this->frame_length);
-#endif
-}
-
-static void a52dec_dispose (audio_decoder_t *this_gen) {
-
- a52dec_decoder_t *this = (a52dec_decoder_t *) this_gen;
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
- this->output_open = 0;
-
- a52_free(this->a52_state);
- this->a52_state = NULL;
-
-#ifdef DEBUG_A52
- close (a52file);
-#endif
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- a52dec_decoder_t *this ;
-
- lprintf ("open_plugin called\n");
-
- this = calloc(1, sizeof (a52dec_decoder_t));
-
- this->audio_decoder.decode_data = a52dec_decode_data;
- this->audio_decoder.reset = a52dec_reset;
- this->audio_decoder.discontinuity = a52dec_discontinuity;
- this->audio_decoder.dispose = a52dec_dispose;
- this->stream = stream;
- this->class = (a52dec_class_t *) class_gen;
-
- /* int i; */
-
- this->audio_caps = stream->audio_out->get_capabilities(stream->audio_out);
- this->syncword = 0;
- this->sync_state = 0;
- this->output_open = 0;
- this->pts = 0;
- this->pts_list[0] = 0;
- this->pts_list_position = 0;
-
- if( !this->a52_state ) {
- this->a52_state =
-#ifdef HAVE_A52DEC_A52_H /* External liba52 */
- /* When using external liba52, enable _all_ capabilities, even
- if that might break stuff if they add some new capability
- that depends on CPU's caps.
- At the moment the only capability is DJBFFT, which is tested
- only if djbfft is being used at compile time.
-
- The actual question would be: why don't they check for
- capabilities themselves?
- */
-#warning "Enabling all external liba52 capabilities."
- a52_init (0xFFFFFFFF)
-#else
- a52_init (xine_mm_accel())
-#endif
- ;
- }
-
- /*
- * find out if this driver supports a52 output
- * or, if not, how many channels we've got
- */
-
- if (this->audio_caps & AO_CAP_MODE_A52)
- this->bypass_mode = 1;
- else {
- this->bypass_mode = 0;
-
- this->a52_flags_map[A52_MONO] = A52_MONO;
- this->a52_flags_map[A52_STEREO] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
- this->a52_flags_map[A52_3F] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
- this->a52_flags_map[A52_2F1R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
- this->a52_flags_map[A52_3F1R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
- this->a52_flags_map[A52_2F2R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
- this->a52_flags_map[A52_3F2R] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
- this->a52_flags_map[A52_DOLBY] = ((this->class->enable_surround_downmix ? A52_DOLBY : A52_STEREO));
-
- this->ao_flags_map[A52_MONO] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_STEREO] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[A52_3F] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[A52_2F1R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[A52_3F1R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[A52_DOLBY] = AO_CAP_MODE_STEREO;
-
- /* find best mode */
- if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
-
- this->a52_flags_map[A52_2F2R] = A52_2F2R;
- this->a52_flags_map[A52_3F2R] = A52_3F2R | A52_LFE;
- this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_5CHANNEL;
-
- } else if (this->audio_caps & AO_CAP_MODE_5CHANNEL) {
-
- this->a52_flags_map[A52_2F2R] = A52_2F2R;
- this->a52_flags_map[A52_3F2R] = A52_3F2R;
- this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_5CHANNEL;
-
- } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
-
- this->a52_flags_map[A52_2F2R] = A52_2F2R;
- this->a52_flags_map[A52_3F2R] = A52_2F2R | A52_LFE;
- this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_4CHANNEL;
-
- } else if (this->audio_caps & AO_CAP_MODE_4CHANNEL) {
-
- this->a52_flags_map[A52_2F2R] = A52_2F2R;
- this->a52_flags_map[A52_3F2R] = A52_2F2R;
-
- this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_4CHANNEL;
-
- /* else if (this->audio_caps & AO_CAP_MODE_STEREO)
- defaults are ok */
- } else if (!(this->audio_caps & AO_CAP_MODE_STEREO)) {
- xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("HELP! a mono-only audio driver?!\n"));
-
- this->a52_flags_map[A52_MONO] = A52_MONO;
- this->a52_flags_map[A52_STEREO] = A52_MONO;
- this->a52_flags_map[A52_3F] = A52_MONO;
- this->a52_flags_map[A52_2F1R] = A52_MONO;
- this->a52_flags_map[A52_3F1R] = A52_MONO;
- this->a52_flags_map[A52_2F2R] = A52_MONO;
- this->a52_flags_map[A52_3F2R] = A52_MONO;
- this->a52_flags_map[A52_DOLBY] = A52_MONO;
-
- this->ao_flags_map[A52_MONO] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_STEREO] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_3F] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_2F1R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_3F1R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_2F2R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_3F2R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[A52_DOLBY] = AO_CAP_MODE_MONO;
- }
- }
-
- /*
- for (i = 0; i<8; i++)
- this->a52_flags_map[i] |= A52_ADJUST_LEVEL;
- */
-#ifdef DEBUG_A52
- a52file = open ("test.a52", O_CREAT | O_WRONLY | O_TRUNC, 0644);
-#endif
- return &this->audio_decoder;
-}
-
-static char *get_identifier (audio_decoder_class_t *this) {
- lprintf ("get_identifier called\n");
- return "a/52dec";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- lprintf ("get_description called\n");
- return "liba52 based a52 audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- lprintf ("dispose_class called\n");
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- a52dec_class_t *this;
- config_values_t *cfg;
-
- this = calloc(1, sizeof (a52dec_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- cfg = this->config = xine->config;
-
- this->a52_level = (float) cfg->register_range (cfg, "audio.a52.level", 100,
- 0, 200,
- _("A/52 volume"),
- _("With A/52 audio, you can modify the volume "
- "at the decoder level. This has the advantage "
- "of the audio being already decoded for the "
- "specified volume, so later operations like "
- "channel downmixing will work on an audio stream "
- "of the given volume."),
- 10, a52_level_change_cb, this) / 100.0;
- this->disable_dynrng_compress = !cfg->register_bool (cfg, "audio.a52.dynamic_range", 0,
- _("use A/52 dynamic range compression"),
- _("Dynamic range compression limits the dynamic "
- "range of the audio. This means making the loud "
- "sounds softer, and the soft sounds louder, so you can "
- "more easily listen to the audio in a noisy "
- "environment without disturbing anyone."),
- 0, dynrng_compress_change_cb, this);
- this->enable_surround_downmix = cfg->register_bool (cfg, "audio.a52.surround_downmix", 0,
- _("downmix audio to 2 channel surround stereo"),
- _("When you want to listen to multichannel surround "
- "sound, but you have only two speakers or a "
- "surround decoder or amplifier which does some "
- "sort of matrix surround decoding like prologic, "
- "you should enable this option so that the "
- "additional channels are mixed into the stereo "
- "signal."),
- 0, surround_downmix_change_cb, this);
- lprintf ("init_plugin called\n");
- return this;
-}
-
-static void a52_level_change_cb(void *this_gen, xine_cfg_entry_t *entry)
-{
- ((a52dec_class_t *)this_gen)->a52_level = entry->num_value / 100.0;
-}
-
-static void dynrng_compress_change_cb(void *this_gen, xine_cfg_entry_t *entry)
-{
- ((a52dec_class_t *)this_gen)->disable_dynrng_compress = !entry->num_value;
-}
-
-static void surround_downmix_change_cb(void *this_gen, xine_cfg_entry_t *entry)
-{
- ((a52dec_class_t *)this_gen)->enable_surround_downmix = entry->num_value;
-}
-
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_A52,
- BUF_AUDIO_DNET,
- 0
- };
-
-static const decoder_info_t dec_info_audio = {
- 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 | PLUGIN_MUST_PRELOAD, 15, "a/52", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libdts/Makefile.am b/src/libdts/Makefile.am
deleted file mode 100644
index e5fafd80b..000000000
--- a/src/libdts/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-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 d8f8267e7..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 ec7aa3c9a..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 447d6a8d0..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 9c81505fa..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/libdts/xine_dts_decoder.c b/src/libdts/xine_dts_decoder.c
deleted file mode 100644
index a3c2eebf0..000000000
--- a/src/libdts/xine_dts_decoder.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- * Copyright (C) 2000-2005 the xine project
- *
- * This file is part of xine, a unix 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, USA
- *
- * 04-09-2001 DTS passtrough (C) Joachim Koenig
- * 09-12-2001 DTS passthrough inprovements (C) James Courtier-Dutton
- */
-
-#ifndef __sun
-/* required for swab() */
-#define _XOPEN_SOURCE 500
-#endif
-/* avoid compiler warnings */
-#define _BSD_SOURCE 1
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <assert.h>
-
-#define LOG_MODULE "libdts"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "buffer.h"
-
-#ifdef HAVE_DTS_H
-# include <dts.h>
-#else
-# include "internal-dts.h"
-#endif
-
-#define MAX_AC5_FRAME 4096
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} dts_class_t;
-
-typedef struct {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
- audio_decoder_class_t *class;
-
- dts_state_t *dts_state;
- int64_t pts;
-
- int audio_caps;
- int sync_state;
- int ac5_length, ac5_pcm_length, frame_todo;
- uint32_t syncdword;
- uint8_t frame_buffer[MAX_AC5_FRAME];
- uint8_t *frame_ptr;
-
- int output_open;
-
- int bypass_mode;
- int dts_flags;
- int dts_sample_rate;
- int dts_bit_rate;
- int dts_flags_map[11]; /* Convert from stream dts_flags to the dts_flags we want from the dts downmixer */
- int ao_flags_map[11]; /* Convert from the xine AO_CAP's to dts_flags. */
- int have_lfe;
-
-
-} 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) {
-}
-
-#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]);
- }
-}
-#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;
- /* printf("samples[%d] = %f, %d\n", i, _f[i], s16[num_channels*i]); */
- }
-}
-
-static inline void mute_channel (int16_t * s16, int num_channels) {
- int i;
-
- for (i = 0; i < 256; i++) {
- s16[num_channels*i] = 0;
- }
-}
-
-static void dts_decode_frame (dts_decoder_t *this, int64_t pts) {
-
- 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;
-
- lprintf("decode_frame\n");
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- audio_buffer->vpts = pts;
-
- if(this->bypass_mode) {
- /* SPDIF digital output */
- if (!this->output_open) {
- this->output_open = ((this->stream->audio_out->open) (this->stream->audio_out, this->stream,
- 16, this->dts_sample_rate,
- AO_CAP_MODE_AC5));
- }
-
- if (!this->output_open)
- return;
-
- data_out=(uint8_t *) audio_buffer->mem;
- if (this->ac5_length > 8191) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: ac5_length too long\n");
- this->ac5_pcm_length = 0;
- }
-
- switch (this->ac5_pcm_length) {
- case 512:
- ac5_spdif_type = 0x0b; /* DTS-1 (512-sample bursts) */
- break;
- case 1024:
- ac5_spdif_type = 0x0c; /* DTS-1 (1024-sample bursts) */
- break;
- case 2048:
- ac5_spdif_type = 0x0d; /* DTS-1 (2048-sample bursts) */
- break;
- default:
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libdts: DTS %i-sample bursts not supported\n", this->ac5_pcm_length);
- return;
- }
-
-#ifdef LOG_DEBUG
- {
- int i;
- printf("libdts: DTS frame type=%d\n",data_in[4] >> 7);
- printf("libdts: DTS deficit frame count=%d\n",(data_in[4] & 0x7f) >> 2);
- printf("libdts: DTS AC5 PCM samples=%d\n",ac5_pcm_samples);
- printf("libdts: DTS AC5 length=%d\n",this->ac5_length);
- printf("libdts: DTS AC5 bitrate=%d\n",((data_in[8] & 0x03) << 4) | (data_in[8] >> 4));
- printf("libdts: DTS AC5 spdif type=%d\n", ac5_spdif_type);
-
- printf("libdts: ");
- for(i=2000;i<2048;i++) {
- printf("%02x ",data_in[i]);
- }
- printf("\n");
- }
-#endif
-
- lprintf("length=%d pts=%"PRId64"\n",this->ac5_pcm_length,audio_buffer->vpts);
-
- audio_buffer->num_frames = this->ac5_pcm_length;
-
- // Checking if AC5 data plus IEC958 header will fit into frames samples data
- if ( this->ac5_length + 8 <= this->ac5_pcm_length * 2 * 2 ) {
- data_out[0] = 0x72; data_out[1] = 0xf8; /* spdif syncword */
- data_out[2] = 0x1f; data_out[3] = 0x4e; /* .............. */
- data_out[4] = ac5_spdif_type; /* DTS data */
- data_out[5] = 0; /* Unknown */
- data_out[6] = (this->ac5_length << 3) & 0xff; /* ac5_length * 8 */
- data_out[7] = ((this->ac5_length ) >> 5) & 0xff;
-
- if( this->ac5_pcm_length ) {
- if( this->ac5_pcm_length % 2) {
- swab(data_in, &data_out[8], this->ac5_length );
- } else {
- swab(data_in, &data_out[8], this->ac5_length + 1);
- }
- }
- // Transmit it without header otherwise, receivers will autodetect DTS
- } else {
- lprintf("AC5 data is too large (%i > %i), sending without IEC958 header\n",
- this->ac5_length + 8, this->ac5_pcm_length * 2 * 2);
- memcpy(data_out, data_in, this->ac5_length);
- }
- } else {
- /* Software decode */
- int i, dts_output_flags;
- int16_t *int_samples = audio_buffer->mem;
- int number_of_dts_blocks;
-
- level_t level = 1.0;
- sample_t *samples;
-
- dts_output_flags = this->dts_flags_map[this->dts_flags & DTS_CHANNEL_MASK];
-
- if(dts_frame(this->dts_state, data_in, &dts_output_flags, &level, 0)) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: dts_frame error\n");
- return;
- }
-
- this->have_lfe = dts_output_flags & DTS_LFE;
- if (this->have_lfe)
- if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
- output_mode = AO_CAP_MODE_5_1CHANNEL;
- } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
- output_mode = AO_CAP_MODE_4_1CHANNEL;
- } else {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: WHAT DO I DO!!!\n");
- output_mode = this->ao_flags_map[dts_output_flags & DTS_CHANNEL_MASK];
- }
- else
- output_mode = this->ao_flags_map[dts_output_flags & DTS_CHANNEL_MASK];
-
- if (!this->output_open) {
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream,
- 16, this->dts_sample_rate,
- output_mode);
- }
-
- if (!this->output_open)
- return;
- number_of_dts_blocks = dts_blocks_num (this->dts_state);
- audio_buffer->num_frames = 256*number_of_dts_blocks;
- for(i = 0; i < number_of_dts_blocks; i++) {
- if(dts_block(this->dts_state)) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libdts: dts_block error on audio channel %d\n", i);
- audio_buffer->num_frames = 0;
- break;
- }
-
- samples = dts_samples(this->dts_state);
- switch (output_mode) {
- case AO_CAP_MODE_MONO:
- float_to_int (&samples[0], int_samples+(i*256), 1);
- break;
- case AO_CAP_MODE_STEREO:
- /* Tested, working. */
- float_to_int (&samples[0*256], int_samples+(i*256*2), 2); /* L */
- float_to_int (&samples[1*256], int_samples+(i*256*2)+1, 2); /* R */
- break;
- case AO_CAP_MODE_4CHANNEL:
- /* Tested, working */
- float_to_int (&samples[0*256], int_samples+(i*256*4), 4); /* L */
- float_to_int (&samples[1*256], int_samples+(i*256*4)+1, 4); /* R */
- float_to_int (&samples[2*256], int_samples+(i*256*4)+2, 4); /* RL */
- float_to_int (&samples[3*256], int_samples+(i*256*4)+3, 4); /* RR */
- break;
- case AO_CAP_MODE_4_1CHANNEL:
- /* Tested, working */
- float_to_int (&samples[0*256], int_samples+(i*256*6)+0, 6); /* L */
- float_to_int (&samples[1*256], int_samples+(i*256*6)+1, 6); /* R */
- float_to_int (&samples[2*256], int_samples+(i*256*6)+2, 6); /* RL */
- float_to_int (&samples[3*256], int_samples+(i*256*6)+3, 6); /* RR */
- float_to_int (&samples[4*256], int_samples+(i*256*6)+5, 6); /* LFE */
- mute_channel ( int_samples+(i*256*6)+4, 6); /* C */
- break;
- case AO_CAP_MODE_5CHANNEL:
- /* Tested, working */
- float_to_int (&samples[0*256], int_samples+(i*256*6)+4, 6); /* C */
- float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
- float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
- float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
- float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
- mute_channel ( int_samples+(i*256*6)+5, 6); /* LFE */
- break;
- case AO_CAP_MODE_5_1CHANNEL:
- float_to_int (&samples[0*256], int_samples+(i*256*6)+4, 6); /* C */
- float_to_int (&samples[1*256], int_samples+(i*256*6)+0, 6); /* L */
- float_to_int (&samples[2*256], int_samples+(i*256*6)+1, 6); /* R */
- float_to_int (&samples[3*256], int_samples+(i*256*6)+2, 6); /* RL */
- float_to_int (&samples[4*256], int_samples+(i*256*6)+3, 6); /* RR */
- float_to_int (&samples[5*256], int_samples+(i*256*6)+5, 6); /* LFE */ /* Not working yet */
- break;
- default:
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libdts: help - unsupported mode %08x\n", output_mode);
- }
- }
- }
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
-
-}
-
-static void dts_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- dts_decoder_t *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;
-
- lprintf("decode_data\n");
-
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
- if (buf->decoder_flags & BUF_FLAG_STDHEADER)
- return;
-
- lprintf ("processing...state %d\n", this->sync_state);
-
- while (current < end) {
- switch (this->sync_state) {
- case 0: /* Looking for sync header */
- this->syncdword = (this->syncdword << 8) | *current++;
-/*
- if ((this->syncdword == 0xff1f00e8) ||
- (this->syncdword == 0x1fffe800) ||
- (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)) {
-
- 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;
-
- this->sync_state = 1;
- this->frame_ptr = this->frame_buffer+4;
- this->pts = buf->pts;
- break;
- }
- break;
-
- case 1: /* Looking for enough bytes for sync_info. */
- 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;
-
- this->ac5_length = dts_syncinfo (this->dts_state, this->frame_buffer,
- &this->dts_flags,
- &this->dts_sample_rate,
- &this->dts_bit_rate, &(this->ac5_pcm_length));
- lprintf("ac5_length=%d\n",this->ac5_length);
- lprintf("dts_sample_rate=%d\n",this->dts_sample_rate);
-
- if ( (this->ac5_length < 80) || (this->ac5_length > MAX_AC5_FRAME) ) { /* Invalid dts ac5_pcm_length */
- this->syncdword = 0;
- current = sync_start;
- this->sync_state = 0;
- break;
- }
-
- lprintf("Frame length = %d\n",this->ac5_pcm_length);
-
- this->frame_todo = this->ac5_length - 20;
- this->sync_state = 2;
- if (!_x_meta_info_get(this->stream, XINE_META_INFO_AUDIOCODEC) ||
- old_dts_flags != this->dts_flags ||
- old_dts_sample_rate != this->dts_sample_rate ||
- old_dts_bit_rate != this->dts_bit_rate) {
-
- switch (this->dts_flags & DTS_CHANNEL_MASK) {
- case DTS_3F2R:
- if (this->dts_flags & DTS_LFE)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 5.1");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 5.0");
- break;
- case DTS_3F1R:
- case DTS_2F2R:
- if (this->dts_flags & DTS_LFE)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 4.1");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 4.0");
- break;
- case DTS_2F1R:
- case DTS_3F:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 3.0");
- break;
- case DTS_STEREO:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 2.0 (stereo)");
- break;
- case DTS_MONO:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS 1.0");
- break;
- default:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "DTS");
- break;
- }
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, this->dts_bit_rate);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE, this->dts_sample_rate);
- }
- }
- break;
-
- case 2: /* Filling frame_buffer with sync_info bytes */
- *this->frame_ptr++ = *current++;
- this->frame_todo--;
- if (this->frame_todo < 1) {
- this->sync_state = 3;
- } else break;
-
- case 3: /* Ready for decode */
-#if 0
- dtsdec_decode_frame (this, this->pts_list[0]);
-#else
- dts_decode_frame (this, this->pts);
-#endif
- case 4: /* Clear up ready for next frame */
- this->pts = 0;
- this->syncdword = 0;
- this->sync_state = 0;
- break;
- default: /* No come here */
- break;
- }
- }
-}
-
-static void dts_dispose (audio_decoder_t *this_gen) {
- dts_decoder_t *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);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
- dts_decoder_t *this ;
-
- lprintf("open_plugin\n");
-
- this = calloc(1, sizeof (dts_decoder_t));
-
- this->audio_decoder.decode_data = dts_decode_data;
- this->audio_decoder.reset = dts_reset;
- this->audio_decoder.discontinuity = dts_discontinuity;
- this->audio_decoder.dispose = dts_dispose;
-
- this->dts_state = dts_init(0);
- this->audio_caps = stream->audio_out->get_capabilities(stream->audio_out);
- if(this->audio_caps & AO_CAP_MODE_AC5)
- this->bypass_mode = 1;
- 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;
- this->dts_flags_map[DTS_2F1R] = DTS_STEREO;
- this->dts_flags_map[DTS_3F1R] = DTS_STEREO;
- this->dts_flags_map[DTS_2F2R] = DTS_STEREO;
- this->dts_flags_map[DTS_3F2R] = DTS_STEREO;
-
- this->ao_flags_map[DTS_MONO] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_STEREO] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[DTS_3F] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[DTS_2F1R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[DTS_3F1R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_STEREO;
- this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_STEREO;
-
- /* find best mode */
- if (this->audio_caps & AO_CAP_MODE_5_1CHANNEL) {
-
- this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
- this->dts_flags_map[DTS_3F2R] = DTS_3F2R | DTS_LFE;
- this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_5CHANNEL;
-
- } else if (this->audio_caps & AO_CAP_MODE_5CHANNEL) {
-
- this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
- this->dts_flags_map[DTS_3F2R] = DTS_3F2R;
- this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_5CHANNEL;
-
- } else if (this->audio_caps & AO_CAP_MODE_4_1CHANNEL) {
-
- this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
- this->dts_flags_map[DTS_3F2R] = DTS_2F2R | DTS_LFE;
- this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_4CHANNEL;
-
- } else if (this->audio_caps & AO_CAP_MODE_4CHANNEL) {
-
- this->dts_flags_map[DTS_2F2R] = DTS_2F2R;
- this->dts_flags_map[DTS_3F2R] = DTS_2F2R;
-
- this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_4CHANNEL;
- this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_4CHANNEL;
-
- /* else if (this->audio_caps & AO_CAP_MODE_STEREO)
- defaults are ok */
- } else if (!(this->audio_caps & AO_CAP_MODE_STEREO)) {
- xprintf (this->stream->xine, XINE_VERBOSITY_LOG, _("HELP! a mono-only audio driver?!\n"));
-
- this->dts_flags_map[DTS_MONO] = DTS_MONO;
- this->dts_flags_map[DTS_STEREO] = DTS_MONO;
- this->dts_flags_map[DTS_3F] = DTS_MONO;
- this->dts_flags_map[DTS_2F1R] = DTS_MONO;
- this->dts_flags_map[DTS_3F1R] = DTS_MONO;
- this->dts_flags_map[DTS_2F2R] = DTS_MONO;
- this->dts_flags_map[DTS_3F2R] = DTS_MONO;
-
- this->ao_flags_map[DTS_MONO] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_STEREO] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_3F] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_2F1R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_3F1R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_2F2R] = AO_CAP_MODE_MONO;
- this->ao_flags_map[DTS_3F2R] = AO_CAP_MODE_MONO;
- }
- }
- this->stream = stream;
- this->class = class_gen;
- this->output_open = 0;
-
- return &this->audio_decoder;
-}
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "DTS";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "DTS passthru audio format decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- lprintf("dispose_class\n");
-
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
- dts_class_t *this ;
-
- lprintf("init_plugin\n");
-
- this = calloc(1, sizeof (dts_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_DTS, 0
- };
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "dts", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libfaad/Makefile.am b/src/libfaad/Makefile.am
deleted file mode 100644
index 92bab83fb..000000000
--- a/src/libfaad/Makefile.am
+++ /dev/null
@@ -1,132 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-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:
-
-if EXTERNAL_LIBFAAD
-libfaad_sources =
-else
-libfaad_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
-endif
-
-xineplug_decode_faad_la_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS) -fno-strict-aliasing
-xineplug_decode_faad_la_SOURCES = \
- $(libfaad_sources) \
- xine_faad_decoder.c
-
-xineplug_decode_faad_la_LDFLAGS = $(xineplug_ldflags)
-if EXTERNAL_LIBFAAD
-xineplug_decode_faad_la_LIBADD = $(XINE_LIB) -lfaad -lm $(LTLIBINTL)
-else
-xineplug_decode_faad_la_LIBADD = $(XINE_LIB) -lm $(LTLIBINTL)
-endif
-
-
-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 \
- codebook/hcb.h \
- codebook/hcb_1.h \
- codebook/hcb_2.h \
- codebook/hcb_3.h \
- codebook/hcb_4.h \
- codebook/hcb_5.h \
- codebook/hcb_6.h \
- codebook/hcb_7.h \
- codebook/hcb_8.h \
- codebook/hcb_9.h \
- codebook/hcb_10.h \
- codebook/hcb_11.h \
- codebook/hcb_sf.h
diff --git a/src/libfaad/codebook/Makefile.am b/src/libfaad/codebook/Makefile.am
deleted file mode 100644
index 63d225b2d..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/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/xine_faad_decoder.c b/src/libfaad/xine_faad_decoder.c
deleted file mode 100644
index 86dc7d6d3..000000000
--- a/src/libfaad/xine_faad_decoder.c
+++ /dev/null
@@ -1,517 +0,0 @@
-/*
- * Copyright (C) 2000-2005 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, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#define LOG_MODULE "libfaad"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#ifdef HAVE_FAAD_H
-#include <faad.h>
-#else
-#include "common.h"
-#include "structs.h"
-#include "decoder.h"
-#include "syntax.h"
-#endif
-
-#define FAAD_MIN_STREAMSIZE 768 /* 6144 bits/channel */
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} faad_class_t;
-
-typedef struct faad_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- /* faad2 stuff */
- NeAACDecHandle faac_dec;
- NeAACDecConfigurationPtr faac_cfg;
- NeAACDecFrameInfo faac_finfo;
- int faac_failed;
-
- int raw_mode;
-
- unsigned char *buf;
- int size;
- int rec_audio_src_size;
- int max_audio_src_size;
- int64_t pts;
-
- unsigned char *dec_config;
- int dec_config_size;
-
- uint32_t rate;
- int bits_per_sample;
- unsigned char num_channels;
- int sbr;
- uint32_t ao_cap_mode;
-
- int output_open;
-
- unsigned long total_time;
- unsigned long total_data;
-} faad_decoder_t;
-
-
-static void faad_reset (audio_decoder_t *this_gen) {
-
- faad_decoder_t *this = (faad_decoder_t *) this_gen;
- this->size = 0;
-}
-
-static void faad_meta_info_set ( faad_decoder_t *this ) {
- switch (this->num_channels) {
- case 1:
- if (this->faac_finfo.sbr == SBR_UPSAMPLED)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "HE-AAC 1.0 (libfaad)");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "AAC 1.0 (libfaad)");
- break;
- case 2:
- /* check if this is downmixed 5.1 */
- if (!this->faac_cfg || !this->faac_cfg->downMatrix) {
- if (this->faac_finfo.sbr == SBR_UPSAMPLED)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "HE-AAC 2.0 (libfaad)");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "AAC 2.0 (libfaad)");
- break;
- }
- case 6:
- if (this->faac_finfo.sbr == SBR_UPSAMPLED)
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "HE-AAC 5.1 (libfaad)");
- else
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "AAC 5.1 (libfaad)");
- break;
- }
-}
-
-static int faad_open_dec( faad_decoder_t *this ) {
- int used;
-
- this->faac_dec = NeAACDecOpen();
- if( !this->faac_dec ) {
- xprintf( this->stream->xine, XINE_VERBOSITY_LOG,
- _("libfaad: libfaad NeAACDecOpen() failed.\n"));
- this->faac_failed++;
- } else {
- if( this->dec_config ) {
- used = NeAACDecInit2(this->faac_dec, this->dec_config, this->dec_config_size,
- &this->rate, &this->num_channels);
-
- if( used < 0 ) {
- xprintf( this->stream->xine, XINE_VERBOSITY_LOG,
- _("libfaad: libfaad NeAACDecInit2 failed.\n"));
- this->faac_failed++;
- } else
- lprintf( "NeAACDecInit2 returned rate=%"PRId32" channels=%d\n",
- this->rate, this->num_channels );
- } else {
- used = NeAACDecInit(this->faac_dec, this->buf, this->size,
- &this->rate, &this->num_channels);
-
- if( used < 0 ) {
- xprintf ( this->stream->xine, XINE_VERBOSITY_LOG,
- _("libfaad: libfaad NeAACDecInit failed.\n"));
- this->faac_failed++;
- } else {
- lprintf( "NeAACDecInit() returned rate=%"PRId32" channels=%d (used=%d)\n",
- this->rate, this->num_channels, used);
-
- this->size -= used;
- memmove( this->buf, &this->buf[used], this->size );
- }
- }
- }
-
- if( !this->bits_per_sample )
- this->bits_per_sample = 16;
-
- if( this->faac_failed ) {
- if( this->faac_dec ) {
- NeAACDecClose( this->faac_dec );
- this->faac_dec = NULL;
- }
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
- } else {
- faad_meta_info_set(this);
- }
-
- return this->faac_failed;
-}
-
-static int faad_open_output( faad_decoder_t *this ) {
- 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;
- 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;
- break;
- } else {
- this->faac_cfg = NeAACDecGetCurrentConfiguration(this->faac_dec);
- this->faac_cfg->downMatrix = 1;
- NeAACDecSetConfiguration(this->faac_dec, this->faac_cfg);
- this->num_channels = 2;
- }
- case 2:
- this->ao_cap_mode=AO_CAP_MODE_STEREO;
- break;
- default:
- return 0;
- }
-
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream,
- this->bits_per_sample,
- this->rate,
- this->ao_cap_mode) ;
- return this->output_open;
-}
-
-static void faad_decode_audio ( faad_decoder_t *this, int end_frame ) {
- int used, decoded, outsize;
- uint8_t *sample_buffer;
- uint8_t *inbuf;
- audio_buffer_t *audio_buffer;
- int sample_size = this->size;
-
- if( !this->faac_dec )
- return;
-
- inbuf = this->buf;
- while( (!this->raw_mode && end_frame && this->size >= 10) ||
- (this->raw_mode && this->size >= this->rec_audio_src_size) ) {
-
- sample_buffer = NeAACDecDecode(this->faac_dec,
- &this->faac_finfo, inbuf, sample_size);
-
- if( !sample_buffer ) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libfaad: %s\n", NeAACDecGetErrorMessage(this->faac_finfo.error));
- used = 1;
- } else {
- used = this->faac_finfo.bytesconsumed;
-
- /* raw AAC parameters might only be known after decoding the first frame */
- if( !this->dec_config &&
- (this->num_channels != this->faac_finfo.channels ||
- this->rate != this->faac_finfo.samplerate) ) {
-
- this->num_channels = this->faac_finfo.channels;
- this->rate = this->faac_finfo.samplerate;
-
- lprintf("faacDecDecode() returned rate=%"PRId32" channels=%d used=%d\n",
- this->rate, this->num_channels, used);
-
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
- this->output_open = 0;
- faad_open_output( this );
-
- faad_meta_info_set( this );
- }
-
- /* faad doesn't tell us about sbr until after the first frame */
- if (this->sbr != this->faac_finfo.sbr) {
- this->sbr = this->faac_finfo.sbr;
- faad_meta_info_set( this );
- }
-
- /* estimate bitrate */
- this->total_time += (1000*this->faac_finfo.samples/(this->rate*this->num_channels));
- this->total_data += 8*used;
-
- if ((this->total_time > LONG_MAX) || (this->total_data > LONG_MAX)) {
- this->total_time >>= 2;
- this->total_data >>= 2;
- }
-
- if (this->total_time)
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
- 1000*(this->total_data/this->total_time));
-
- decoded = this->faac_finfo.samples * 2; /* 1 sample = 2 bytes */
-
- lprintf("decoded %d/%d output %ld\n",
- used, this->size, this->faac_finfo.samples );
-
- /* Performing necessary channel reordering because aac uses a different
- * layout than alsa:
- *
- * aac 5.1 channel layout: c l r ls rs lfe
- * alsa 5.1 channel layout: l r ls rs c lfe
- *
- * Reordering is only necessary for 5.0 and above. Currently only 5.0
- * and 5.1 is being taken care of, the rest will stay in the wrong order
- * for now.
- *
- * WARNING: the following needs a output format of 16 bits per sample.
- * TODO: - reorder while copying (in the while() loop) and optimizing
- */
- if(this->num_channels == 5 || this->num_channels == 6)
- {
- int i = 0;
- uint16_t* buf = (uint16_t*)(sample_buffer);
-
- for(; i < this->faac_finfo.samples; i += this->num_channels) {
- uint16_t center = buf[i];
- *((uint64_t*)(buf + i)) = *((uint64_t*)(buf + i + 1));
- buf[i + 4] = center;
- }
- }
-
- while( decoded ) {
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
-
- if( decoded < audio_buffer->mem_size )
- outsize = decoded;
- else
- outsize = audio_buffer->mem_size;
-
- xine_fast_memcpy( audio_buffer->mem, sample_buffer, outsize );
-
- audio_buffer->num_frames = outsize / (this->num_channels*2);
- audio_buffer->vpts = this->pts;
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
- this->pts = 0;
- decoded -= outsize;
- sample_buffer += outsize;
- }
- }
-
- if(used >= this->size){
- this->size = 0;
- } else {
- this->size -= used;
- inbuf += used;
- }
-
- if( !this->raw_mode )
- this->size = 0;
- }
-
- if( this->size )
- memmove( this->buf, inbuf, this->size);
-
-}
-
-static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- faad_decoder_t *this = (faad_decoder_t *) this_gen;
-
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- /* store config information from ESDS mp4/qt atom */
- if( !this->faac_dec && (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
- buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG ) {
-
- this->dec_config = malloc(buf->decoder_info[2]);
- this->dec_config_size = buf->decoder_info[2];
- memcpy(this->dec_config, buf->decoder_info_ptr[2], buf->decoder_info[2]);
-
- if( faad_open_dec(this) )
- return;
-
- this->raw_mode = 0;
- }
-
- /* get audio parameters from file header
- (may be overwritten by libfaad returned parameters) */
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
- this->rate=buf->decoder_info[1];
- this->bits_per_sample=buf->decoder_info[2] ;
- this->num_channels=buf->decoder_info[3] ;
-
- if( buf->size > sizeof(xine_waveformatex) ) {
- xine_waveformatex *wavex = (xine_waveformatex *) buf->content;
-
- if( wavex->cbSize > 0 ) {
- this->dec_config = malloc(wavex->cbSize);
- this->dec_config_size = wavex->cbSize;
- memcpy(this->dec_config, buf->content + sizeof(xine_waveformatex),
- wavex->cbSize);
-
- if( faad_open_dec(this) )
- return;
-
- this->raw_mode = 0;
- }
- }
- } else {
-
- lprintf ("decoding %d data bytes...\n", buf->size);
-
- if( (int)buf->size <= 0 || this->faac_failed )
- return;
-
- if( !this->size )
- this->pts = buf->pts;
-
- if( this->size + buf->size > this->max_audio_src_size ) {
- this->max_audio_src_size = this->size + 2 * buf->size;
- this->buf = realloc( this->buf, this->max_audio_src_size );
- }
-
- memcpy (&this->buf[this->size], buf->content, buf->size);
- this->size += buf->size;
-
- if( !this->faac_dec && faad_open_dec(this) )
- return;
-
- /* open audio device as needed */
- if (!this->output_open) {
- faad_open_output( this );
- }
-
- faad_decode_audio(this, buf->decoder_flags & BUF_FLAG_FRAME_END );
- }
-}
-
-static void faad_discontinuity (audio_decoder_t *this_gen) {
-}
-
-static void faad_dispose (audio_decoder_t *this_gen) {
-
- faad_decoder_t *this = (faad_decoder_t *) this_gen;
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
- this->output_open = 0;
-
- if( this->buf )
- free(this->buf);
- this->buf = NULL;
- this->size = 0;
- this->max_audio_src_size = 0;
-
- if( this->dec_config )
- free(this->dec_config);
- this->dec_config = NULL;
- this->dec_config_size = 0;
-
- if( this->faac_dec )
- NeAACDecClose(this->faac_dec);
- this->faac_dec = NULL;
- this->faac_failed = 0;
-
- free (this);
-}
-
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- faad_decoder_t *this ;
-
- this = calloc(1, sizeof (faad_decoder_t));
-
- this->audio_decoder.decode_data = faad_decode_data;
- this->audio_decoder.reset = faad_reset;
- this->audio_decoder.discontinuity = faad_discontinuity;
- this->audio_decoder.dispose = faad_dispose;
-
- this->stream = stream;
- this->output_open = 0;
- this->raw_mode = 1;
- this->faac_dec = NULL;
- this->faac_failed = 0;
- this->buf = NULL;
- this->size = 0;
- this->max_audio_src_size = 0;
- this->dec_config = NULL;
- this->dec_config_size = 0;
- this->total_time = 0;
- this->total_data = 0;
-
- this->rate = 0;
-
- return &this->audio_decoder;
-}
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "FAAD";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "Freeware Advanced Audio Decoder";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- faad_class_t *this ;
-
- this = calloc(1, sizeof (faad_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_AAC, 0
- };
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "faad", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libffmpeg/Makefile.am b/src/libffmpeg/Makefile.am
deleted file mode 100644
index 9af34df26..000000000
--- a/src/libffmpeg/Makefile.am
+++ /dev/null
@@ -1,12 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-DEFAULT_INCLUDES = -I.
-
-if HAVE_FFMPEG
-else
-SUBDIRS = libavcodec libavutil
-endif
-
-EXTRA_DIST = diff_to_ffmpeg_cvs.txt
-
-INTERNAL_DOCS = diff_to_ffmpeg_cvs.txt
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/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 09c539b62..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 38979bc95..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 039c50d61..000000000
--- a/src/libffmpeg/libavcodec/i386/Makefile.am
+++ /dev/null
@@ -1,57 +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/')
-if ARCH_X86_32
-dsputil_mmx.o dsputil_mmx.lo: CFLAGS+=-prefer-non-pic
-endif
-
-# 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 27c0c678c..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 a047bb8cd..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 d3b430f84..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 56339cc72..000000000
--- a/src/libmad/Makefile.am
+++ /dev/null
@@ -1,58 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-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 cd0fe4904..000000000
--- a/src/libmad/bit.c
+++ /dev/null
@@ -1,238 +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>
-# endif
-# ifndef CHAR_BIT
-# 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 d1465fd57..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 76def1189..000000000
--- a/src/libmad/layer12.c
+++ /dev/null
@@ -1,535 +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>
-# endif
-#ifndef CHAR_BIT
-# 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 899102e0d..000000000
--- a/src/libmad/layer3.c
+++ /dev/null
@@ -1,2699 +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>
-#endif
-# ifndef CHAR_BIT
-# 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 64a8278d7..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/libmad/xine_mad_decoder.c b/src/libmad/xine_mad_decoder.c
deleted file mode 100644
index 6fb56dbd1..000000000
--- a/src/libmad/xine_mad_decoder.c
+++ /dev/null
@@ -1,459 +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
- *
- * stuff needed to turn libmad into a xine decoder plugin
- */
-
-#include <stdlib.h>
-#include <string.h>
-#include "config.h"
-
-#ifdef HAVE_MAD_H
-#include <mad.h>
-#endif
-
-#define LOG_MODULE "mad_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-
-#ifdef HAVE_MAD_H
-# include <mad.h>
-#else
-# include "frame.h"
-# include "synth.h"
-#endif
-
-#define INPUT_BUF_SIZE 16384
-
-/* According to Rob Leslie (libmad author) :
- * The absolute theoretical maximum frame size is 2881 bytes: MPEG 2.5 Layer II,
- * 8000 Hz @ 160 kbps, with a padding slot. (Such a frame is unlikely, but it was
- * a useful exercise to compute all possible frame sizes.) Add to this an 8 byte
- * MAD_BUFFER_GUARD, and the minimum buffer size you should be streaming to
- * libmad in the general case is 2889 bytes.
-
- * Theoretical frame sizes for Layer III range from 24 to 1441 bytes, but there
- * is a "soft" limit imposed by the standard of 960 bytes. Nonetheless MAD can
- * decode frames of any size as long as they fit entirely in the buffer you pass,
- * not including the MAD_BUFFER_GUARD bytes.
- */
-#define MAD_MIN_SIZE 2889
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} mad_class_t;
-
-typedef struct mad_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *xstream;
-
- int64_t pts;
-
- struct mad_synth synth;
- struct mad_stream stream;
- struct mad_frame frame;
-
- int output_sampling_rate;
- int output_open;
- int output_mode;
-
- uint8_t buffer[INPUT_BUF_SIZE];
- int bytes_in_buffer;
- int preview_mode;
- int start_padding;
- int end_padding;
- int needs_more_data;
-
-} mad_decoder_t;
-
-static void mad_reset (audio_decoder_t *this_gen) {
-
- mad_decoder_t *this = (mad_decoder_t *) this_gen;
-
- mad_synth_finish (&this->synth);
- mad_frame_finish (&this->frame);
- mad_stream_finish(&this->stream);
-
- this->pts = 0;
- this->bytes_in_buffer = 0;
- this->preview_mode = 0;
- this->start_padding = 0;
- this->end_padding = 0;
- this->needs_more_data = 0;
-
- mad_synth_init (&this->synth);
- mad_stream_init (&this->stream);
- this->stream.options = MAD_OPTION_IGNORECRC;
- mad_frame_init (&this->frame);
-}
-
-
-static void mad_discontinuity (audio_decoder_t *this_gen) {
-
- mad_decoder_t *this = (mad_decoder_t *) this_gen;
-
- this->pts = 0;
-}
-
-/* utility to scale and round samples to 16 bits */
-
-static inline
-signed int scale(mad_fixed_t sample)
-{
- /* round */
- sample += (1L << (MAD_F_FRACBITS - 16));
-
- /* clip */
- if (sample >= MAD_F_ONE)
- sample = MAD_F_ONE - 1;
- else if (sample < -MAD_F_ONE)
- sample = -MAD_F_ONE;
-
- /* quantize */
- return sample >> (MAD_F_FRACBITS + 1 - 16);
-}
-
-/*
-static int head_check(mad_decoder_t *this) {
-
- if( (this->header & 0xffe00000) != 0xffe00000)
- return 0;
- if(!((this->header>>17)&3))
- return 0;
- if( ((this->header>>12)&0xf) == 0xf)
- return 0;
- if( ((this->header>>10)&0x3) == 0x3 )
- return 0;
- return 1;
-}
-*/
-
-static void mad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- mad_decoder_t *this = (mad_decoder_t *) this_gen;
- int bytes_in_buffer_at_pts;
-
- lprintf ("decode data, size: %d, decoder_flags: %d\n", buf->size, buf->decoder_flags);
-
- if (buf->size>(INPUT_BUF_SIZE-this->bytes_in_buffer)) {
- xprintf (this->xstream->xine, XINE_VERBOSITY_DEBUG,
- "libmad: ALERT input buffer too small (%d bytes, %d avail)!\n",
- buf->size, INPUT_BUF_SIZE-this->bytes_in_buffer);
- buf->size = INPUT_BUF_SIZE-this->bytes_in_buffer;
- }
-
- if ((buf->decoder_flags & BUF_FLAG_HEADER) == 0) {
-
- /* reset decoder on leaving preview mode */
- if ((buf->decoder_flags & BUF_FLAG_PREVIEW) == 0) {
- if (this->preview_mode) {
- mad_reset (this_gen);
- }
- } else {
- this->preview_mode = 1;
- }
-
- bytes_in_buffer_at_pts = this->bytes_in_buffer;
-
- xine_fast_memcpy (&this->buffer[this->bytes_in_buffer],
- buf->content, buf->size);
- this->bytes_in_buffer += buf->size;
-
- /*
- printf ("libmad: decode data - doing it\n");
- */
-
- mad_stream_buffer (&this->stream, this->buffer,
- this->bytes_in_buffer);
-
- if (this->bytes_in_buffer < MAD_MIN_SIZE && buf->pts == 0)
- return;
-
- if (!this->needs_more_data) {
- this->pts = buf->pts;
- if (buf->decoder_flags & BUF_FLAG_AUDIO_PADDING) {
- this->start_padding = buf->decoder_info[1];
- this->end_padding = buf->decoder_info[2];
- } else {
- this->start_padding = 0;
- this->end_padding = 0;
- }
- }
-
- while (1) {
-
- if (mad_frame_decode (&this->frame, &this->stream) != 0) {
-
- if (this->stream.next_frame) {
- int num_bytes =
- this->buffer + this->bytes_in_buffer - this->stream.next_frame;
-
- /* printf("libmad: MAD_ERROR_BUFLEN\n"); */
-
- memmove(this->buffer, this->stream.next_frame, num_bytes);
- this->bytes_in_buffer = num_bytes;
- }
-
- switch (this->stream.error) {
-
- case MAD_ERROR_BUFLEN:
- /* libmad wants more data */
- this->needs_more_data = 1;
- return;
-
- default:
- lprintf ("error 0x%04X, mad_stream_buffer %d bytes\n", this->stream.error, this->bytes_in_buffer);
- mad_stream_buffer (&this->stream, this->buffer,
- this->bytes_in_buffer);
- }
-
- } else {
- int mode = (this->frame.header.mode == MAD_MODE_SINGLE_CHANNEL) ? AO_CAP_MODE_MONO : AO_CAP_MODE_STEREO;
-
- if (!this->output_open
- || (this->output_sampling_rate != this->frame.header.samplerate)
- || (this->output_mode != mode)) {
-
- lprintf ("audio sample rate %d mode %08x\n", this->frame.header.samplerate, mode);
-
- /* the mpeg audio demuxer can set audio bitrate */
- if (! _x_stream_info_get(this->xstream, XINE_STREAM_INFO_AUDIO_BITRATE)) {
- _x_stream_info_set(this->xstream, XINE_STREAM_INFO_AUDIO_BITRATE,
- this->frame.header.bitrate);
- }
-
- /* the mpeg audio demuxer can set this meta info */
- if (! _x_meta_info_get(this->xstream, XINE_META_INFO_AUDIOCODEC)) {
- switch (this->frame.header.layer) {
- case MAD_LAYER_I:
- _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
- "MPEG audio layer 1 (lib: MAD)");
- break;
- case MAD_LAYER_II:
- _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
- "MPEG audio layer 2 (lib: MAD)");
- break;
- case MAD_LAYER_III:
- _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
- "MPEG audio layer 3 (lib: MAD)");
- break;
- default:
- _x_meta_info_set_utf8(this->xstream, XINE_META_INFO_AUDIOCODEC,
- "MPEG audio (lib: MAD)");
- }
- }
-
- if (this->output_open) {
- this->xstream->audio_out->close (this->xstream->audio_out, this->xstream);
- this->output_open = 0;
- }
- if (!this->output_open) {
- this->output_open = (this->xstream->audio_out->open) (this->xstream->audio_out,
- this->xstream, 16,
- this->frame.header.samplerate,
- mode) ;
- }
- if (!this->output_open) {
- return;
- }
- this->output_sampling_rate = this->frame.header.samplerate;
- this->output_mode = mode;
- }
-
- mad_synth_frame (&this->synth, &this->frame);
-
- if ( (buf->decoder_flags & BUF_FLAG_PREVIEW) == 0 ) {
-
- unsigned int nchannels, nsamples;
- mad_fixed_t const *left_ch, *right_ch;
- struct mad_pcm *pcm = &this->synth.pcm;
- audio_buffer_t *audio_buffer;
- uint16_t *output;
- int bitrate;
- int pts_offset;
-
- audio_buffer = this->xstream->audio_out->get_buffer (this->xstream->audio_out);
- output = audio_buffer->mem;
-
- nchannels = pcm->channels;
- nsamples = pcm->length;
- left_ch = pcm->samples[0];
- right_ch = pcm->samples[1];
-
- /* padding */
- if (this->start_padding || this->end_padding) {
- /* check padding validity */
- if (nsamples < (this->start_padding + this->end_padding)) {
- lprintf("invalid padding data");
- this->start_padding = 0;
- this->end_padding = 0;
- }
- lprintf("nsamples=%d, start_padding=%d, end_padding=%d\n",
- nsamples, this->start_padding, this->end_padding);
- nsamples -= this->start_padding + this->end_padding;
- left_ch += this->start_padding;
- right_ch += this->start_padding;
- }
- audio_buffer->num_frames = nsamples;
- audio_buffer->vpts = this->pts;
-
- while (nsamples--) {
- /* output sample(s) in 16-bit signed little-endian PCM */
-
- *output++ = scale(*left_ch++);
-
- if (nchannels == 2)
- *output++ = scale(*right_ch++);
-
- }
-
- audio_buffer->num_frames = pcm->length;
-
- /* pts computing */
- if (this->frame.header.bitrate > 0) {
- bitrate = this->frame.header.bitrate;
- } else {
- bitrate = _x_stream_info_get(this->xstream, XINE_STREAM_INFO_AUDIO_BITRATE);
- lprintf("offset %d bps\n", bitrate);
- }
- audio_buffer->vpts = buf->pts;
- if (audio_buffer->vpts && (bitrate > 0)) {
- pts_offset = (bytes_in_buffer_at_pts * 8 * 90) / (bitrate / 1000);
- lprintf("pts: %"PRId64", offset: %d pts, %d bytes\n", buf->pts, pts_offset, bytes_in_buffer_at_pts);
- if (audio_buffer->vpts < pts_offset)
- pts_offset = audio_buffer->vpts;
- audio_buffer->vpts -= pts_offset;
- }
-
- this->xstream->audio_out->put_buffer (this->xstream->audio_out, audio_buffer, this->xstream);
-
- this->pts = buf->pts;
- buf->pts = 0;
- if (buf->decoder_flags & BUF_FLAG_AUDIO_PADDING) {
- this->start_padding = buf->decoder_info[1];
- this->end_padding = buf->decoder_info[2];
- buf->decoder_info[1] = 0;
- buf->decoder_info[2] = 0;
- } else {
- this->start_padding = 0;
- this->end_padding = 0;
- }
- }
- lprintf ("decode worked\n");
- }
- }
- }
-}
-
-static void mad_dispose (audio_decoder_t *this_gen) {
-
- mad_decoder_t *this = (mad_decoder_t *) this_gen;
-
- mad_synth_finish (&this->synth);
- mad_frame_finish (&this->frame);
- mad_stream_finish(&this->stream);
-
- if (this->output_open) {
- this->xstream->audio_out->close (this->xstream->audio_out, this->xstream);
- this->output_open = 0;
- }
-
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- mad_decoder_t *this ;
-
- this = (mad_decoder_t *) calloc(1, sizeof(mad_decoder_t));
-
- this->audio_decoder.decode_data = mad_decode_data;
- this->audio_decoder.reset = mad_reset;
- this->audio_decoder.discontinuity = mad_discontinuity;
- this->audio_decoder.dispose = mad_dispose;
-
- this->output_open = 0;
- this->bytes_in_buffer = 0;
- this->preview_mode = 0;
-
- this->xstream = stream;
-
- mad_synth_init (&this->synth);
- mad_stream_init (&this->stream);
- mad_frame_init (&this->frame);
-
- this->stream.options = MAD_OPTION_IGNORECRC;
-
- lprintf ("init\n");
-
- return &this->audio_decoder;
-}
-
-/*
- * mad plugin class
- */
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "mad";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "libmad based mpeg audio layer 1/2/3 decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- mad_class_t *this;
-
- this = (mad_class_t *) calloc(1, sizeof(mad_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_MPEG, 0
-};
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 8 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libmpeg2/Makefile.am b/src/libmpeg2/Makefile.am
deleted file mode 100644
index 849e56363..000000000
--- a/src/libmpeg2/Makefile.am
+++ /dev/null
@@ -1,31 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-xineplug_LTLIBRARIES = xineplug_decode_mpeg2.la
-
-xineplug_decode_mpeg2_la_SOURCES = \
- cpu_state.c \
- decode.c \
- header.c \
- idct.c \
- idct_altivec.c \
- idct_mlib.c \
- idct_mmx.c \
- motion_comp.c \
- motion_comp_altivec.c \
- motion_comp_mmx.c \
- motion_comp_mlib.c \
- motion_comp_vis.c \
- slice.c \
- slice_xvmc.c \
- slice_xvmc_vld.c \
- stats.c \
- xine_mpeg2_decoder.c \
- libmpeg2_accel.c
-
-xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) $(LTLIBINTL) -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
diff --git a/src/libmpeg2/cpu_state.c b/src/libmpeg2/cpu_state.c
deleted file mode 100644
index 07b4c5b7e..000000000
--- a/src/libmpeg2/cpu_state.c
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- * cpu_state.c
- * 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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 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 <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
-void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-static void state_restore_mmx (cpu_state_t * state)
-{
- emms ();
-}
-#endif
-
-#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
-
-#ifndef HOST_OS_DARWIN
-
-static void state_save_altivec (cpu_state_t * state)
-{
- asm (" \n"
- " li %r9, 16 \n"
- " stvx %v20, 0, %r3 \n"
- " li %r11, 32 \n"
- " stvx %v21, %r9, %r3 \n"
- " li %r9, 48 \n"
- " stvx %v22, %r11, %r3 \n"
- " li %r11, 64 \n"
- " stvx %v23, %r9, %r3 \n"
- " li %r9, 80 \n"
- " stvx %v24, %r11, %r3 \n"
- " li %r11, 96 \n"
- " stvx %v25, %r9, %r3 \n"
- " li %r9, 112 \n"
- " stvx %v26, %r11, %r3 \n"
- " li %r11, 128 \n"
- " stvx %v27, %r9, %r3 \n"
- " li %r9, 144 \n"
- " stvx %v28, %r11, %r3 \n"
- " li %r11, 160 \n"
- " stvx %v29, %r9, %r3 \n"
- " li %r9, 176 \n"
- " stvx %v30, %r11, %r3 \n"
- " stvx %v31, %r9, %r3 \n"
- );
-}
-
-static void state_restore_altivec (cpu_state_t * state)
-{
- asm (" \n"
- " li %r9, 16 \n"
- " lvx %v20, 0, %r3 \n"
- " li %r11, 32 \n"
- " lvx %v21, %r9, %r3 \n"
- " li %r9, 48 \n"
- " lvx %v22, %r11, %r3 \n"
- " li %r11, 64 \n"
- " lvx %v23, %r9, %r3 \n"
- " li %r9, 80 \n"
- " lvx %v24, %r11, %r3 \n"
- " li %r11, 96 \n"
- " lvx %v25, %r9, %r3 \n"
- " li %r9, 112 \n"
- " lvx %v26, %r11, %r3 \n"
- " li %r11, 128 \n"
- " lvx %v27, %r9, %r3 \n"
- " li %r9, 144 \n"
- " lvx %v28, %r11, %r3 \n"
- " li %r11, 160 \n"
- " lvx %v29, %r9, %r3 \n"
- " li %r9, 176 \n"
- " lvx %v30, %r11, %r3 \n"
- " lvx %v31, %r9, %r3 \n"
- );
-}
-
-#else /* HOST_OS_DARWIN */
-
-#define LI(a,b) "li r" #a "," #b "\n\t"
-#define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
-#define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t"
-#define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t"
-#define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t"
-
-static void state_save_altivec (cpu_state_t * state)
-{
- asm (LI (9, 16)
- STVX0 (20, 0, 3)
- LI (11, 32)
- STVX (21, 9, 3)
- LI (9, 48)
- STVX (22, 11, 3)
- LI (11, 64)
- STVX (23, 9, 3)
- LI (9, 80)
- STVX (24, 11, 3)
- LI (11, 96)
- STVX (25, 9, 3)
- LI (9, 112)
- STVX (26, 11, 3)
- LI (11, 128)
- STVX (27, 9, 3)
- LI (9, 144)
- STVX (28, 11, 3)
- LI (11, 160)
- STVX (29, 9, 3)
- LI (9, 176)
- STVX (30, 11, 3)
- STVX (31, 9, 3));
-}
-
-static void state_restore_altivec (cpu_state_t * state)
-{
- asm (LI (9, 16)
- LVX0 (20, 0, 3)
- LI (11, 32)
- LVX (21, 9, 3)
- LI (9, 48)
- LVX (22, 11, 3)
- LI (11, 64)
- LVX (23, 9, 3)
- LI (9, 80)
- LVX (24, 11, 3)
- LI (11, 96)
- LVX (25, 9, 3)
- LI (9, 112)
- LVX (26, 11, 3)
- LI (11, 128)
- LVX (27, 9, 3)
- LI (9, 144)
- LVX (28, 11, 3)
- LI (11, 160)
- LVX (29, 9, 3)
- LI (9, 176)
- LVX (30, 11, 3)
- LVX (31, 9, 3));
-}
-#endif /* HOST_OS_DARWIN */
-
-#endif /* defined (ARCH_PPC) && defined (ENABLE_ALTIVEC) */
-
-void mpeg2_cpu_state_init (uint32_t mm_accel)
-{
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- if (mm_accel & MM_ACCEL_X86_MMX) {
- mpeg2_cpu_state_restore = state_restore_mmx;
- }
-#endif
-#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
- if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
- mpeg2_cpu_state_save = state_save_altivec;
- mpeg2_cpu_state_restore = state_restore_altivec;
- }
-#endif
-}
-
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
deleted file mode 100644
index c66b18691..000000000
--- a/src/libmpeg2/decode.c
+++ /dev/null
@@ -1,1010 +0,0 @@
-/*
- * decode.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * xine-specific version by G. Bartsch
- *
- */
-
-#include "config.h"
-#include <stdio.h>
-#include <string.h> /* memcpy/memset, try to remove */
-#include <stdlib.h>
-#include <inttypes.h>
-#include <math.h>
-
-#define LOG_MODULE "decode"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "mpeg2.h"
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-#include "libmpeg2_accel.h"
-
-/*
-#define LOG_PAN_SCAN
-*/
-
-/* #define BUFFER_SIZE (224 * 1024) */
-#define BUFFER_SIZE (1194 * 1024) /* new buffer size for mpeg2dec 0.2.1 */
-
-static void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer);
-
-void mpeg2_init (mpeg2dec_t * mpeg2dec,
- xine_video_port_t * output)
-{
- static int do_init = 1;
- uint32_t mm_accel;
-
- if (do_init) {
- do_init = 0;
- mm_accel = xine_mm_accel();
- mpeg2_cpu_state_init (mm_accel);
- mpeg2_idct_init (mm_accel);
- mpeg2_mc_init (mm_accel);
- libmpeg2_accel_scan(&mpeg2dec->accel, mpeg2_scan_norm, mpeg2_scan_alt);
- }
-
- if( !mpeg2dec->chunk_buffer )
- mpeg2dec->chunk_buffer = xine_xmalloc_aligned (16, BUFFER_SIZE + 4,
- &mpeg2dec->chunk_base);
- if( !mpeg2dec->picture )
- mpeg2dec->picture = xine_xmalloc_aligned (16, sizeof (picture_t),
- &mpeg2dec->picture_base);
-
- mpeg2dec->shift = 0xffffff00;
- mpeg2dec->new_sequence = 0;
- mpeg2dec->is_sequence_needed = 1;
- mpeg2dec->is_wait_for_ip_frames = 2;
- mpeg2dec->frames_to_drop = 0;
- mpeg2dec->drop_frame = 0;
- mpeg2dec->in_slice = 0;
- mpeg2dec->output = output;
- mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
- mpeg2dec->code = 0xb4;
- mpeg2dec->seek_mode = 0;
-
- /* initialize AFD storage */
- mpeg2dec->afd_value_seen = XINE_VIDEO_AFD_NOT_PRESENT;
- mpeg2dec->afd_value_reported = (XINE_VIDEO_AFD_NOT_PRESENT - 1);
-
- memset (mpeg2dec->picture, 0, sizeof (picture_t));
-
- /* initialize substructures */
- mpeg2_header_state_init (mpeg2dec->picture);
-
- if ( output->get_capabilities(output) & VO_CAP_XXMC) {
- printf("libmpeg2: output port has XxMC capability\n");
- mpeg2dec->frame_format = XINE_IMGFMT_XXMC;
- } else if( output->get_capabilities(output) & VO_CAP_XVMC_MOCOMP) {
- printf("libmpeg2: output port has XvMC capability\n");
- mpeg2dec->frame_format = XINE_IMGFMT_XVMC;
- } else {
- mpeg2dec->frame_format = XINE_IMGFMT_YV12;
- }
-}
-
-static inline void get_frame_duration (mpeg2dec_t * mpeg2dec, vo_frame_t *frame)
-{
- static const double durations[] = {
- 0, /* invalid */
- 3753.75, /* 23.976 fps */
- 3750, /* 24 fps */
- 3600, /* 25 fps */
- 3003, /* 29.97 fps */
- 3000, /* 30 fps */
- 1800, /* 50 fps */
- 1501.5, /* 59.94 fps */
- 1500, /* 60 fps */
- };
- double duration = ((unsigned) mpeg2dec->picture->frame_rate_code > 8u)
- ? 0 : durations[mpeg2dec->picture->frame_rate_code];
-
- duration = duration * (mpeg2dec->picture->frame_rate_ext_n + 1.0) /
- (mpeg2dec->picture->frame_rate_ext_d + 1.0);
-
- /* this should be used to detect any special rff pattern */
- mpeg2dec->rff_pattern = mpeg2dec->rff_pattern << 1;
- mpeg2dec->rff_pattern |= !!frame->repeat_first_field;
-
- if( ((mpeg2dec->rff_pattern & 0xff) == 0xaa ||
- (mpeg2dec->rff_pattern & 0xff) == 0x55) &&
- !mpeg2dec->picture->progressive_sequence ) {
- /* special case for ntsc 3:2 pulldown */
- duration *= 5.0 / 4.0;
- }
- else
- {
- if( frame->repeat_first_field ) {
- if( !mpeg2dec->picture->progressive_sequence &&
- frame->progressive_frame ) {
- /* decoder should output 3 fields, so adjust duration to
- count on this extra field time */
- duration *= 3.0 / 2.0;
- } else if( mpeg2dec->picture->progressive_sequence ) {
- /* for progressive sequences the output should repeat the
- frame 1 or 2 times depending on top_field_first flag. */
- duration *= (frame->top_field_first) ? 3 : 2;
- }
- }
- }
-
- frame->duration = (int) ceil (duration);
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, frame->duration);
- /*printf("mpeg2dec: rff=%u\n",frame->repeat_first_field);*/
-}
-
-static double get_aspect_ratio(mpeg2dec_t *mpeg2dec)
-{
- double ratio;
- picture_t * picture = mpeg2dec->picture;
- double mpeg1_pel_ratio[16] = {1.0 /* forbidden */,
- 1.0, 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, 1.0 /*reserved*/ };
-
- /* TODO: For slower machines the value of this function should be computed
- * once and cached!
- */
-
- if( !picture->mpeg1 ) {
- /* these hardcoded values are defined on mpeg2 standard for
- * aspect ratio. other values are reserved or forbidden. */
- switch(picture->aspect_ratio_information) {
- case 2:
- ratio = 4.0/3.0;
- break;
- case 3:
- ratio = 16.0/9.0;
- break;
- case 4:
- ratio = 2.11/1.0;
- break;
- case 1:
- default:
- ratio = (double)picture->coded_picture_width/(double)picture->coded_picture_height;
- break;
- }
- } else {
- /* mpeg1 constants refer to pixel aspect ratio */
- ratio = (double)picture->coded_picture_width/(double)picture->coded_picture_height;
- ratio /= mpeg1_pel_ratio[picture->aspect_ratio_information];
- }
-
- return ratio;
-}
-
-static void remember_metainfo (mpeg2dec_t *mpeg2dec) {
-
- picture_t * picture = mpeg2dec->picture;
-
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_WIDTH, picture->display_width);
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, picture->display_height);
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_RATIO,
- ((double)10000 * get_aspect_ratio(mpeg2dec)));
-
- switch (mpeg2dec->picture->frame_rate_code) {
- case 1: /* 23.976 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3913);
- break;
- case 2: /* 24 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3750);
- break;
- case 3: /* 25 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3600);
- break;
- case 4: /* 29.97 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3003);
- break;
- case 5: /* 30 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3000);
- break;
- case 6: /* 50 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 1800);
- break;
- case 7: /* 59.94 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 1525);
- break;
- case 8: /* 60 fps */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 1509);
- break;
- default:
- /* printf ("invalid/unknown frame rate code : %d \n",
- frame->frame_rate_code); */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3000);
- }
-
- _x_meta_info_set_utf8(mpeg2dec->stream, XINE_META_INFO_VIDEOCODEC, "MPEG (libmpeg2)");
-}
-
-static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
- uint8_t * buffer, int next_code)
-{
- picture_t * picture;
- int is_frame_done;
- double ratio;
-
- /* wait for sequence_header_code */
- if (mpeg2dec->is_sequence_needed) {
- if (code != 0xb3) {
- /* printf ("libmpeg2: waiting for sequence header\n"); */
- mpeg2dec->pts = 0;
- return 0;
- }
- }
- if (mpeg2dec->is_frame_needed) {
- /* printf ("libmpeg2: waiting for frame start\n"); */
- mpeg2dec->pts = 0;
- if (mpeg2dec->picture->current_frame)
- mpeg2dec->picture->current_frame->bad_frame = 1;
- }
-
- mpeg2_stats (code, buffer);
-
- picture = mpeg2dec->picture;
- is_frame_done = mpeg2dec->in_slice && ((!code) || (code >= 0xb0));
-
- if (is_frame_done)
- mpeg2dec->in_slice = 0;
-
- if (is_frame_done && picture->current_frame != NULL) {
-
- libmpeg2_accel_frame_completion(&mpeg2dec->accel, mpeg2dec->frame_format,
- picture, code);
-
- if (((picture->picture_structure == FRAME_PICTURE) ||
- (picture->second_field)) ) {
-
- if (mpeg2dec->drop_frame)
- picture->current_frame->bad_frame = 1;
-
- if (picture->picture_coding_type == B_TYPE) {
- if( picture->current_frame && !picture->current_frame->drawn ) {
-
- /* hack against wrong mpeg1 pts */
- if (picture->mpeg1)
- picture->current_frame->pts = 0;
-
- get_frame_duration(mpeg2dec, picture->current_frame);
- mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame, mpeg2dec->stream);
- picture->current_frame->drawn = 1;
- }
- } else if (picture->forward_reference_frame && !picture->forward_reference_frame->drawn) {
- get_frame_duration(mpeg2dec, picture->forward_reference_frame);
- mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame,
- mpeg2dec->stream);
- picture->forward_reference_frame->drawn = 1;
- }
- }
- }
-
- switch (code) {
- case 0x00: /* picture_start_code */
- if (mpeg2_header_picture (picture, buffer)) {
- fprintf (stderr, "bad picture header\n");
- abort();
- }
-
- mpeg2dec->is_frame_needed=0;
-
- if (!picture->second_field) {
- /* find out if we want to skip this frame */
- mpeg2dec->drop_frame = 0;
-
- /* picture->skip_non_intra_dct = (mpeg2dec->frames_to_drop>0) ; */
-
- switch (picture->picture_coding_type) {
- case B_TYPE:
-
- lprintf ("B-Frame\n");
-
- if (mpeg2dec->frames_to_drop>1) {
- lprintf ("dropping b-frame because frames_to_drop==%d\n",
- mpeg2dec->frames_to_drop);
- mpeg2dec->drop_frame = 1;
- } else if (!picture->forward_reference_frame || picture->forward_reference_frame->bad_frame
- || !picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) {
-#ifdef LOG
- printf ("libmpeg2: dropping b-frame because ref is bad (");
- if (picture->forward_reference_frame)
- printf ("fw ref frame %d, bad %d;", picture->forward_reference_frame->id,
- picture->forward_reference_frame->bad_frame);
- else
- printf ("fw ref frame not there;");
- if (picture->backward_reference_frame)
- printf ("bw ref frame %d, bad %d)\n", picture->backward_reference_frame->id,
- picture->backward_reference_frame->bad_frame);
- else
- printf ("fw ref frame not there)\n");
-#endif
- mpeg2dec->drop_frame = 1;
- } else if (mpeg2dec->is_wait_for_ip_frames > 0) {
- lprintf("dropping b-frame because refs are invalid\n");
- mpeg2dec->drop_frame = 1;
- }
- break;
-
- case P_TYPE:
-
- lprintf ("P-Frame\n");
-
- if (mpeg2dec->frames_to_drop>2) {
- mpeg2dec->drop_frame = 1;
- lprintf ("dropping p-frame because frames_to_drop==%d\n",
- mpeg2dec->frames_to_drop);
- } else if (!picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) {
- mpeg2dec->drop_frame = 1;
-#ifdef LOG
- if (!picture->backward_reference_frame)
- printf ("libmpeg2: dropping p-frame because no ref frame\n");
- else
- printf ("libmpeg2: dropping p-frame because ref %d is bad\n", picture->backward_reference_frame->id);
-#endif
- } else if (mpeg2dec->is_wait_for_ip_frames > 1) {
- lprintf("dropping p-frame because ref is invalid\n");
- mpeg2dec->drop_frame = 1;
- } else if (mpeg2dec->is_wait_for_ip_frames)
- mpeg2dec->is_wait_for_ip_frames--;
-
- break;
-
- case I_TYPE:
- lprintf ("I-Frame\n");
- /* for the sake of dvd menus, never drop i-frames
- if (mpeg2dec->frames_to_drop>4) {
- mpeg2dec->drop_frame = 1;
- }
- */
-
- if (mpeg2dec->is_wait_for_ip_frames)
- mpeg2dec->is_wait_for_ip_frames--;
-
- break;
- }
- }
-
- break;
-
- case 0xb2: /* user data code */
- process_userdata(mpeg2dec, buffer);
- break;
-
- case 0xb3: /* sequence_header_code */
- if (mpeg2_header_sequence (picture, buffer)) {
- fprintf (stderr, "bad sequence header\n");
- /* abort(); */
- break;
- }
-
- /* reset AFD value to detect absence */
- mpeg2dec->afd_value_seen = XINE_VIDEO_AFD_NOT_PRESENT;
-
- /* according to ISO/IEC 13818-2, an extension start code will follow.
- * Otherwise the stream follows ISO/IEC 11172-2 which means MPEG1 */
- picture->mpeg1 = (next_code != 0xb5);
-
- if (mpeg2dec->force_aspect) picture->aspect_ratio_information = mpeg2dec->force_aspect;
-
- if (mpeg2dec->is_sequence_needed ) {
- mpeg2dec->new_sequence = 1;
- }
-
- if (mpeg2dec->is_sequence_needed
- || (picture->aspect_ratio_information != picture->saved_aspect_ratio)
- || (picture->frame_width != picture->coded_picture_width)
- || (picture->frame_height != picture->coded_picture_height)) {
- xine_event_t event;
- xine_format_change_data_t data;
-
- remember_metainfo (mpeg2dec);
- event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
- event.stream = mpeg2dec->stream;
- event.data = &data;
- event.data_length = sizeof(data);
- data.width = picture->coded_picture_width;
- data.height = picture->coded_picture_height;
- data.aspect = picture->aspect_ratio_information;
- data.pan_scan = mpeg2dec->force_pan_scan;
- xine_event_send(mpeg2dec->stream, &event);
-
- _x_stream_info_set(mpeg2dec->stream,XINE_STREAM_INFO_VIDEO_WIDTH,
- picture->display_width);
- _x_stream_info_set(mpeg2dec->stream,XINE_STREAM_INFO_VIDEO_HEIGHT,
- picture->display_height);
-
- if (picture->forward_reference_frame &&
- picture->forward_reference_frame != picture->current_frame &&
- picture->forward_reference_frame != picture->backward_reference_frame)
- picture->forward_reference_frame->free (picture->forward_reference_frame);
-
- if (picture->backward_reference_frame &&
- picture->backward_reference_frame != picture->current_frame)
- picture->backward_reference_frame->free (picture->backward_reference_frame);
-
- mpeg2dec->is_sequence_needed = 0;
- picture->forward_reference_frame = NULL;
- picture->backward_reference_frame = NULL;
-
- picture->frame_width = picture->coded_picture_width;
- picture->frame_height = picture->coded_picture_height;
- picture->saved_aspect_ratio = picture->aspect_ratio_information;
- }
- break;
-
- case 0xb5: /* extension_start_code */
- if (mpeg2_header_extension (picture, buffer)) {
- fprintf (stderr, "bad extension\n");
- abort();
- }
- break;
-
- case 0xb7: /* sequence end code */
- mpeg2_flush(mpeg2dec);
- mpeg2dec->is_sequence_needed = 1;
- break;
-
- case 0xb8: /* group of pictures start code */
- if (mpeg2_header_group_of_pictures (picture, buffer)) {
- printf ("libmpeg2: bad group of pictures\n");
- abort();
- }
- default:
- if ((code >= 0xb9) && (code != 0xe4)) {
- printf("Not multiplexed? 0x%x\n",code);
- }
- if (code >= 0xb0)
- break;
-
- /* check for AFD change once per picture */
- if (mpeg2dec->afd_value_reported != mpeg2dec->afd_value_seen) {
- /* AFD data should better be stored in current_frame to have it */
- /* ready and synchronous with other data like width or height. */
- /* An AFD change should then be detected when a new frame is emitted */
- /* from the decoder to report the AFD change in display order and not */
- /* in decoding order like it happens below for now. */
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_AFD, mpeg2dec->afd_value_seen);
- lprintf ("AFD changed from %d to %d\n", mpeg2dec->afd_value_reported, mpeg2dec->afd_value_seen);
- mpeg2dec->afd_value_reported = mpeg2dec->afd_value_seen;
- }
-
- if (!(mpeg2dec->in_slice)) {
- mpeg2dec->in_slice = 1;
-
- if (picture->second_field) {
- if (picture->current_frame)
- picture->current_frame->field(picture->current_frame,
- picture->picture_structure);
- else
- mpeg2dec->drop_frame = 1;
- } else {
- int flags = picture->picture_structure;
-
- if (!picture->mpeg1) flags |= VO_INTERLACED_FLAG;
- if (mpeg2dec->force_pan_scan) flags |= VO_PAN_SCAN_FLAG;
- if (mpeg2dec->new_sequence) flags |= VO_NEW_SEQUENCE_FLAG;
-
- if ( picture->current_frame &&
- picture->current_frame != picture->backward_reference_frame &&
- picture->current_frame != picture->forward_reference_frame ) {
- picture->current_frame->free (picture->current_frame);
- }
- if (picture->picture_coding_type == B_TYPE) {
- ratio = get_aspect_ratio(mpeg2dec);
- picture->current_frame =
- mpeg2dec->stream->video_out->get_frame (mpeg2dec->stream->video_out,
- picture->coded_picture_width,
- picture->coded_picture_height,
- ratio,
- mpeg2dec->frame_format,
- flags);
- libmpeg2_accel_new_frame( &mpeg2dec->accel, mpeg2dec->frame_format,
- picture, ratio, flags);
- } else {
- ratio = get_aspect_ratio(mpeg2dec);
- picture->current_frame =
- mpeg2dec->stream->video_out->get_frame (mpeg2dec->stream->video_out,
- picture->coded_picture_width,
- picture->coded_picture_height,
- ratio,
- mpeg2dec->frame_format,
- flags);
-
- libmpeg2_accel_new_frame( &mpeg2dec->accel, mpeg2dec->frame_format,
- picture, ratio, flags);
-
- if (picture->forward_reference_frame &&
- picture->forward_reference_frame != picture->backward_reference_frame)
- picture->forward_reference_frame->free (picture->forward_reference_frame);
-
- picture->forward_reference_frame =
- picture->backward_reference_frame;
- picture->backward_reference_frame = picture->current_frame;
- }
-
- if(mpeg2dec->new_sequence)
- mpeg2dec->new_sequence =
- libmpeg2_accel_new_sequence(&mpeg2dec->accel, mpeg2dec->frame_format,
- picture);
-
- picture->current_frame->bad_frame = 1;
- picture->current_frame->drawn = 0;
- picture->current_frame->pts = mpeg2dec->pts;
- picture->current_frame->top_field_first = picture->top_field_first;
- picture->current_frame->repeat_first_field = picture->repeat_first_field;
- picture->current_frame->progressive_frame = picture->progressive_frame;
- picture->current_frame->crop_right = picture->coded_picture_width - picture->display_width;
- picture->current_frame->crop_bottom = picture->coded_picture_height - picture->display_height;
-
- switch( picture->picture_coding_type ) {
- case I_TYPE:
- picture->current_frame->picture_coding_type = XINE_PICT_I_TYPE;
- break;
- case P_TYPE:
- picture->current_frame->picture_coding_type = XINE_PICT_P_TYPE;
- break;
- case B_TYPE:
- picture->current_frame->picture_coding_type = XINE_PICT_B_TYPE;
- break;
- case D_TYPE:
- picture->current_frame->picture_coding_type = XINE_PICT_D_TYPE;
- break;
- }
-
- lprintf ("decoding frame %d, type %s\n",
- picture->current_frame->id, picture->picture_coding_type == I_TYPE ? "I" :
- picture->picture_coding_type == P_TYPE ? "P" : "B");
- mpeg2dec->pts = 0;
- /*printf("Starting to decode frame %d\n",picture->current_frame->id);*/
- }
- }
-
- if (!mpeg2dec->drop_frame && picture->current_frame != NULL) {
-#ifdef DEBUG_LOG
- printf("slice target %08x past %08x future %08x\n",picture->current_frame,picture->forward_reference_frame,picture->backward_reference_frame);
- fflush(stdout);
-#endif
- libmpeg2_accel_slice(&mpeg2dec->accel, picture, code, buffer, mpeg2dec->chunk_size,
- mpeg2dec->chunk_buffer);
-
- if( picture->v_offset > picture->limit_y ||
- picture->v_offset + 16 > picture->display_height ) {
- picture->current_frame->bad_frame = 0;
- }
- }
- }
-
- /* printf ("libmpeg2: parse_chunk %d completed\n", code); */
- return is_frame_done;
-}
-
-static inline int find_start_code (mpeg2dec_t * mpeg2dec,
- uint8_t ** current, uint8_t * limit)
-{
- uint8_t * p;
-
- if (*current >= limit)
- return 0;
- if (mpeg2dec->shift == 0x00000100)
- return 1;
-
- mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
-
- if (*current >= limit)
- return 0;
- if (mpeg2dec->shift == 0x00000100)
- return 1;
-
- mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
-
- if (*current >= limit)
- return 0;
- if (mpeg2dec->shift == 0x00000100)
- return 1;
-
- limit--;
-
- if (*current >= limit) {
- mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
- return 0;
- }
-
- p = *current;
-
- while (p < limit && (p = (uint8_t *)memchr(p, 0x01, limit - p))) {
- if (p[-2] || p[-1])
- p += 3;
- else {
- *current = ++p;
- return 1;
- }
- }
-
- *current = ++limit;
- p = limit - 3;
- mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
- mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
- mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
-
- return 0;
-}
-
-static inline uint8_t * copy_chunk (mpeg2dec_t * mpeg2dec,
- uint8_t * current, uint8_t * end)
-{
- uint8_t * limit;
- uint8_t * data = current;
- int found, bite;
-
- /* sequence end code 0xb7 doesn't have any data and there might be the case
- * that no start code will follow this code for quite some time (e. g. in case
- * of a still image.
- * Therefore, return immediately with a chunk_size of 0. Setting code to 0xb4
- * will eat up any trailing garbage next time.
- */
- if (mpeg2dec->code == 0xb7) {
- mpeg2dec->code = 0xb4;
- mpeg2dec->chunk_size = 0;
- return current;
- }
-
- limit = current + (mpeg2dec->chunk_buffer + BUFFER_SIZE - mpeg2dec->chunk_ptr);
- if (limit > end)
- limit = end;
-
- found = find_start_code(mpeg2dec, &current, limit);
- bite = current - data;
- if (bite) {
- xine_fast_memcpy(mpeg2dec->chunk_ptr, data, bite);
- mpeg2dec->chunk_ptr += bite;
- }
-
- if (found) {
- mpeg2dec->code = *current++;
- mpeg2dec->chunk_size = mpeg2dec->chunk_ptr - mpeg2dec->chunk_buffer - 3;
- mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
- mpeg2dec->shift = 0xffffff00;
- return current;
- }
-
- if (current == end)
- return NULL;
-
- /* we filled the chunk buffer without finding a start code */
- mpeg2dec->code = 0xb4; /* sequence_error_code */
- mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
- return current;
-}
-
-int mpeg2_decode_data (mpeg2dec_t * mpeg2dec, uint8_t * current, uint8_t * end,
- uint64_t pts)
-{
- int ret;
- uint8_t code;
-
- ret = 0;
- if (mpeg2dec->seek_mode) {
- mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
- mpeg2dec->code = 0xb4;
- mpeg2dec->seek_mode = 0;
- mpeg2dec->shift = 0xffffff00;
- mpeg2dec->is_frame_needed = 1;
- }
-
- if (pts)
- mpeg2dec->pts = pts;
-
- while (current != end || mpeg2dec->code == 0xb7) {
- code = mpeg2dec->code;
- current = copy_chunk (mpeg2dec, current, end);
- if (current == NULL)
- break;
- ret += parse_chunk (mpeg2dec, code, mpeg2dec->chunk_buffer, mpeg2dec->code);
- }
-
- libmpeg2_accel_frame_completion(&mpeg2dec->accel, mpeg2dec->frame_format,
- mpeg2dec->picture, 0xff);
-
- return ret;
-}
-
-void mpeg2_discontinuity (mpeg2dec_t * mpeg2dec) {
- picture_t *picture = mpeg2dec->picture;
-
- if( !picture )
- return;
-
- mpeg2dec->in_slice = 0;
- mpeg2dec->pts = 0;
- if ( picture->current_frame )
- picture->current_frame->pts = 0;
- if ( picture->forward_reference_frame )
- picture->forward_reference_frame->pts = 0;
- if ( picture->backward_reference_frame )
- picture->backward_reference_frame->pts = 0;
-
- libmpeg2_accel_discontinuity(&mpeg2dec->accel, mpeg2dec->frame_format, picture);
-}
-
-void mpeg2_reset (mpeg2dec_t * mpeg2dec) {
-
- picture_t *picture = mpeg2dec->picture;
-
- if( !picture )
- return;
-
- mpeg2_discontinuity(mpeg2dec);
-
- if( !picture->mpeg1 ) {
- mpeg2dec->is_wait_for_ip_frames = 2;
-
- /* mark current frames as bad so they won't make to screen */
- if ( picture->current_frame )
- picture->current_frame->bad_frame=1;
- if (picture->forward_reference_frame )
- picture->forward_reference_frame->bad_frame=1;
- if (picture->backward_reference_frame)
- picture->backward_reference_frame->bad_frame=1;
-
- } else {
- /* to free reference frames one also needs to fix slice.c to
- * abort when they are NULL. unfortunately it seems to break
- * DVD menus.
- *
- * ...so let's do this for mpeg-1 only :)
- */
- if ( picture->current_frame &&
- picture->current_frame != picture->backward_reference_frame &&
- picture->current_frame != picture->forward_reference_frame )
- picture->current_frame->free (picture->current_frame);
- picture->current_frame = NULL;
-
- if (picture->forward_reference_frame &&
- picture->forward_reference_frame != picture->backward_reference_frame)
- picture->forward_reference_frame->free (picture->forward_reference_frame);
- picture->forward_reference_frame = NULL;
-
- if (picture->backward_reference_frame)
- picture->backward_reference_frame->free (picture->backward_reference_frame);
- picture->backward_reference_frame = NULL;
- }
-
- mpeg2dec->in_slice = 0;
- mpeg2dec->seek_mode = 1;
-
-}
-
-void mpeg2_flush (mpeg2dec_t * mpeg2dec) {
-
- picture_t *picture = mpeg2dec->picture;
-
- if (!picture)
- return;
-
- if (picture->current_frame && !picture->current_frame->drawn &&
- !picture->current_frame->bad_frame) {
-
- lprintf ("blasting out current frame %d on flush\n",
- picture->current_frame->id);
-
- picture->current_frame->drawn = 1;
- get_frame_duration(mpeg2dec, picture->current_frame);
-
- picture->current_frame->pts = 0;
- picture->current_frame->draw(picture->current_frame, mpeg2dec->stream);
- }
-
-}
-
-void mpeg2_close (mpeg2dec_t * mpeg2dec)
-{
- picture_t *picture = mpeg2dec->picture;
-
- /*
- {
- static uint8_t finalizer[] = {0,0,1,0xb4};
- mpeg2_decode_data (mpeg2dec, finalizer, finalizer+4, 0);
- }
- */
-
- /*
- dont remove any picture->*->free() below. doing so will cause buffer
- leak, and we only have about 15 of them.
- */
-
- if ( picture->current_frame ) {
- if( !picture->current_frame->drawn ) {
- lprintf ("blasting out current frame on close\n");
- picture->current_frame->pts = 0;
- get_frame_duration(mpeg2dec, picture->current_frame);
- picture->current_frame->draw (picture->current_frame, mpeg2dec->stream);
- picture->current_frame->drawn = 1;
- }
-
- if( picture->current_frame != picture->backward_reference_frame &&
- picture->current_frame != picture->forward_reference_frame ) {
- picture->current_frame->free (picture->current_frame);
- }
- picture->current_frame = NULL;
- }
-
- if (picture->forward_reference_frame &&
- picture->forward_reference_frame != picture->backward_reference_frame) {
- picture->forward_reference_frame->free (picture->forward_reference_frame);
- picture->forward_reference_frame = NULL;
- }
-
- if (picture->backward_reference_frame) {
- if( !picture->backward_reference_frame->drawn) {
- lprintf ("blasting out backward reference frame on close\n");
- picture->backward_reference_frame->pts = 0;
- get_frame_duration(mpeg2dec, picture->backward_reference_frame);
- picture->backward_reference_frame->draw (picture->backward_reference_frame, mpeg2dec->stream);
- picture->backward_reference_frame->drawn = 1;
- }
- picture->backward_reference_frame->free (picture->backward_reference_frame);
- picture->backward_reference_frame = NULL;
- }
-
- if ( mpeg2dec->chunk_buffer ) {
- free (mpeg2dec->chunk_base);
- mpeg2dec->chunk_buffer = NULL;
- }
-
- if ( mpeg2dec->picture ) {
- free (mpeg2dec->picture_base);
- mpeg2dec->picture = NULL;
- }
-
- if ( mpeg2dec->cc_dec) {
- /* dispose the closed caption decoder */
- mpeg2dec->cc_dec->dispose(mpeg2dec->cc_dec);
- mpeg2dec->cc_dec = NULL;
- }
-}
-
-void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
- uint8_t * current, uint8_t * end){
-
- uint8_t code, next_code;
- picture_t *picture = mpeg2dec->picture;
-
- mpeg2dec->seek_mode = 1;
-
- while (current != end) {
- code = mpeg2dec->code;
- current = copy_chunk (mpeg2dec, current, end);
- if (current == NULL)
- return ;
- next_code = mpeg2dec->code;
-
- /* printf ("looking for sequence header... %02x\n", code); */
-
- mpeg2_stats (code, mpeg2dec->chunk_buffer);
-
- if (code == 0xb3) { /* sequence_header_code */
- if (mpeg2_header_sequence (picture, mpeg2dec->chunk_buffer)) {
- printf ("libmpeg2: bad sequence header\n");
- continue;
- }
-
- /* according to ISO/IEC 13818-2, an extension start code will follow.
- * Otherwise the stream follows ISO/IEC 11172-2 which means MPEG1 */
- picture->mpeg1 = (next_code != 0xb5);
-
- if (mpeg2dec->force_aspect) picture->aspect_ratio_information = mpeg2dec->force_aspect;
-
- if (mpeg2dec->is_sequence_needed) {
- xine_event_t event;
- xine_format_change_data_t data;
-
- mpeg2dec->new_sequence = 1;
-
- mpeg2dec->is_sequence_needed = 0;
- picture->frame_width = picture->coded_picture_width;
- picture->frame_height = picture->coded_picture_height;
-
- remember_metainfo (mpeg2dec);
-
- event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
- event.stream = mpeg2dec->stream;
- event.data = &data;
- event.data_length = sizeof(data);
- data.width = picture->coded_picture_width;
- data.height = picture->coded_picture_height;
- data.aspect = picture->aspect_ratio_information;
- data.pan_scan = mpeg2dec->force_pan_scan;
- xine_event_send(mpeg2dec->stream, &event);
-
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_WIDTH,
- picture->display_width);
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_HEIGHT,
- picture->display_height);
- }
- } else if (code == 0xb5) { /* extension_start_code */
- if (mpeg2_header_extension (picture, mpeg2dec->chunk_buffer)) {
- printf ("libmpeg2: bad extension\n");
- continue ;
- }
- }
- }
-}
-
-/* Find the end of the userdata field in an MPEG-2 stream */
-static uint8_t *find_end(uint8_t *buffer)
-{
- uint8_t *current = buffer;
- while(1) {
- if (current[0] == 0 && current[1] == 0 && current[2] == 1)
- break;
- current++;
- }
- return current;
-}
-
-static void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer)
-{
- /* check if user data denotes closed captions */
- if (buffer[0] == 'C' && buffer[1] == 'C') {
-
- if (!mpeg2dec->cc_dec) {
- xine_event_t event;
- xine_format_change_data_t data;
-
- /* open the closed caption decoder first */
- mpeg2dec->cc_dec = _x_get_spu_decoder(mpeg2dec->stream, (BUF_SPU_CC >> 16) & 0xff);
-
- /* send a frame format event so that the CC decoder knows the initial image size */
- event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
- event.stream = mpeg2dec->stream;
- event.data = &data;
- event.data_length = sizeof(data);
- data.width = mpeg2dec->picture->coded_picture_width;
- data.height = mpeg2dec->picture->coded_picture_height;
- data.aspect = mpeg2dec->picture->aspect_ratio_information;
- data.pan_scan = mpeg2dec->force_pan_scan;
- xine_event_send(mpeg2dec->stream, &event);
-
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_WIDTH,
- mpeg2dec->picture->display_width);
- _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_HEIGHT,
- mpeg2dec->picture->display_height);
- }
-
- if (mpeg2dec->cc_dec) {
- buf_element_t buf;
-
- buf.type = BUF_SPU_CC;
- buf.content = &buffer[2];
- buf.pts = mpeg2dec->pts;
- buf.size = find_end(buffer) - &buffer[2];
- buf.decoder_flags = 0;
-
- mpeg2dec->cc_dec->decode_data(mpeg2dec->cc_dec, &buf);
- }
- }
- /* check Active Format Description ETSI TS 101 154 V1.5.1 */
- else if (buffer[0] == 0x44 && buffer[1] == 0x54 && buffer[2] == 0x47 && buffer[3] == 0x31)
- mpeg2dec->afd_value_seen = (buffer[4] & 0x40) ? (buffer[5] & 0x0f) : XINE_VIDEO_AFD_NOT_PRESENT;
-}
diff --git a/src/libmpeg2/header.c b/src/libmpeg2/header.c
deleted file mode 100644
index c0df02c7f..000000000
--- a/src/libmpeg2/header.c
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * header.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/*
-#define LOG_PAN_SCAN
-*/
-
-#include "config.h"
-
-#include <stdio.h> /* For printf debugging */
-#include <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "attributes.h"
-
-/* default intra quant matrix, in zig-zag order */
-static const uint8_t default_intra_quantizer_matrix[64] ATTR_ALIGN(16) = {
- 8,
- 16, 16,
- 19, 16, 19,
- 22, 22, 22, 22,
- 22, 22, 26, 24, 26,
- 27, 27, 27, 26, 26, 26,
- 26, 27, 27, 27, 29, 29, 29,
- 34, 34, 34, 29, 29, 29, 27, 27,
- 29, 29, 32, 32, 34, 34, 37,
- 38, 37, 35, 35, 34, 35,
- 38, 38, 40, 40, 40,
- 48, 48, 46, 46,
- 56, 56, 58,
- 69, 69,
- 83
-};
-
-uint8_t mpeg2_scan_norm[64] ATTR_ALIGN(16) =
-{
- /* Zig-Zag scan pattern */
- 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
-};
-
-uint8_t mpeg2_scan_alt[64] ATTR_ALIGN(16) =
-{
- /* Alternate scan pattern */
- 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
-};
-
-/* count must be between 1 and 32 */
-static uint32_t get_bits(uint8_t *buffer, uint32_t count, uint32_t *bit_position) {
- uint32_t byte_offset;
- uint32_t bit_offset;
- uint32_t bit_mask;
- uint32_t bit_bite;
- uint32_t result=0;
- if (count == 0) return 0;
- do {
- byte_offset = *bit_position >> 3; /* Div 8 */
- bit_offset = 8 - (*bit_position & 0x7); /* Bits got 87654321 */
- bit_mask = ((1 << (bit_offset)) - 1);
- bit_bite = bit_offset;
- if (count < bit_offset) {
- bit_mask ^= ((1 << (bit_offset-count)) - 1);
- bit_bite = count;
- }
- /*
- printf("Byte=0x%02x Bitmask=0x%04x byte_offset=%u bit_offset=%u bit_byte=%u count=%u\n",buffer[byte_offset], bit_mask, byte_offset, bit_offset, bit_bite,count);
- */
- result = (result << bit_bite) | ((buffer[byte_offset] & bit_mask) >> (bit_offset-bit_bite));
- *bit_position+=bit_bite;
- count-=bit_bite;
- } while ((count > 0) && (byte_offset<50) );
- return result;
-}
-
-static int32_t get_bits_signed(uint8_t *buffer, uint32_t count, uint32_t *bit_position) {
- uint32_t value = get_bits(buffer, count, bit_position);
- uint32_t sign_mask = (uint32_t)(-1 << (count - 1));
- if (value & sign_mask)
- value |= sign_mask; /* sign-extend value */
- return (int32_t)value;
-}
-
-void mpeg2_header_state_init (picture_t * picture)
-{
- picture->scan = mpeg2_scan_norm;
- picture->load_intra_quantizer_matrix = 1;
- picture->load_non_intra_quantizer_matrix = 1;
-}
-
-int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer)
-{
- int width, height;
- int i;
-
- if ((buffer[6] & 0x20) != 0x20)
- return 1; /* missing marker_bit */
-
- height = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2];
-
- picture->display_width = width = (height >> 12);
- picture->display_height = height = (height & 0xfff);
-
- width = (width + 15) & ~15;
- height = (height + 15) & ~15;
-
- if ((width > 1920) || (height > 1152))
- return 1; /* size restrictions for MP@HL */
-
- picture->coded_picture_width = width;
- picture->coded_picture_height = height;
-
- /* this is not used by the decoder */
- picture->aspect_ratio_information = buffer[3] >> 4;
- picture->frame_rate_code = buffer[3] & 15;
- picture->bitrate = (buffer[4]<<10)|(buffer[5]<<2)|(buffer[6]>>6);
-
- if (buffer[7] & 2) {
- for (i = 0; i < 64; i++)
- picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
- (buffer[i+7] << 7) | (buffer[i+8] >> 1);
- buffer += 64;
- } else
- for (i = 0; i < 64; i++)
- picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
- default_intra_quantizer_matrix [i];
-
- if (buffer[7] & 1)
- for (i = 0; i < 64; i++)
- picture->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
- buffer[i+8];
- else
- for (i = 0; i < 64; i++)
- picture->non_intra_quantizer_matrix[i] = 16;
- picture->load_intra_quantizer_matrix = 1;
- picture->load_non_intra_quantizer_matrix = 1;
- /* MPEG1 - for testing only */
- picture->mpeg1 = 1;
- picture->intra_dc_precision = 0;
- picture->frame_pred_frame_dct = 1;
- picture->q_scale_type = 0;
- picture->concealment_motion_vectors = 0;
- /* picture->alternate_scan = 0; */
- picture->picture_structure = FRAME_PICTURE;
- /* picture->second_field = 0; */
-
- return 0;
-}
-
-static int sequence_extension (picture_t * picture, uint8_t * buffer)
-{
- /* check chroma format, size extensions, marker bit */
- if (((buffer[1] & 0x07) != 0x02) || (buffer[2] & 0xe0) ||
- ((buffer[3] & 0x01) != 0x01))
- return 1;
-
- /* this is not used by the decoder */
- picture->progressive_sequence = (buffer[1] >> 3) & 1;
-
- picture->low_delay = buffer[5] & 0x80;
-
- if (!picture->progressive_sequence)
- picture->coded_picture_height =
- (picture->coded_picture_height + 31) & ~31;
-
-
- /* printf ("libmpeg2: low_delay : %d\n", picture->low_delay); */
-
-/*
- printf ("libmpeg2: sequence extension+5 : %08x (%d)\n",
- buffer[5], buffer[5] % 0x80);
- */
-
- picture->frame_rate_ext_n = buffer[5] & 0x31;
- picture->frame_rate_ext_d = (buffer[5] >> 2) & 0x03;
-
- /* MPEG1 - for testing only */
- picture->mpeg1 = 0;
-
- return 0;
-}
-
-static int quant_matrix_extension (picture_t * picture, uint8_t * buffer)
-{
- int i;
-
- if (buffer[0] & 8) {
- for (i = 0; i < 64; i++)
- picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
- (buffer[i] << 5) | (buffer[i+1] >> 3);
- buffer += 64;
- }
-
- if (buffer[0] & 4)
- for (i = 0; i < 64; i++)
- picture->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
- (buffer[i] << 6) | (buffer[i+1] >> 2);
-
- return 0;
-}
-
-static int picture_coding_extension (picture_t * picture, uint8_t * buffer)
-{
- /* pre subtract 1 for use later in compute_motion_vector */
- picture->f_motion.f_code[0] = (buffer[0] & 15) - 1;
- picture->f_motion.f_code[1] = (buffer[1] >> 4) - 1;
- picture->b_motion.f_code[0] = (buffer[1] & 15) - 1;
- picture->b_motion.f_code[1] = (buffer[2] >> 4) - 1;
-
- picture->intra_dc_precision = (buffer[2] >> 2) & 3;
- picture->picture_structure = buffer[2] & 3;
- picture->frame_pred_frame_dct = (buffer[3] >> 6) & 1;
- picture->concealment_motion_vectors = (buffer[3] >> 5) & 1;
- picture->q_scale_type = (buffer[3] >> 4) & 1;
- picture->intra_vlc_format = (buffer[3] >> 3) & 1;
-
- if (buffer[3] & 4) /* alternate_scan */
- picture->scan = mpeg2_scan_alt;
- else
- picture->scan = mpeg2_scan_norm;
-
- /* these are not used by the decoder */
- picture->top_field_first = buffer[3] >> 7;
- picture->repeat_first_field = (buffer[3] >> 1) & 1;
- picture->progressive_frame = buffer[4] >> 7;
-
- return 0;
-}
-
-static int sequence_display_extension (picture_t * picture, uint8_t * buffer) {
- /* FIXME: implement. */
- uint32_t bit_position;
- uint32_t padding;
-
- bit_position = 0;
- padding = get_bits(buffer, 4, &bit_position);
- picture->video_format = get_bits(buffer, 3, &bit_position);
- picture->colour_description = get_bits(buffer, 1, &bit_position);
- if(picture->colour_description) {
- picture->colour_primatives = get_bits(buffer, 8, &bit_position);
- picture->transfer_characteristics = get_bits(buffer, 8, &bit_position);
- picture->matrix_coefficients = get_bits(buffer, 8, &bit_position);
- }
- picture->display_horizontal_size = get_bits(buffer, 14, &bit_position);
- padding = get_bits(buffer, 1, &bit_position);
- picture->display_vertical_size = get_bits(buffer, 14, &bit_position);
-
-#ifdef LOG_PAN_SCAN
- printf("Sequence_display_extension\n");
- printf(" video_format: %u\n", picture->video_format);
- printf(" colour_description: %u\n", picture->colour_description);
- if(picture->colour_description) {
- printf(" colour_primatives: %u\n", picture->colour_primatives);
- printf(" transfer_characteristics %u\n", picture->transfer_characteristics);
- printf(" matrix_coefficients %u\n", picture->matrix_coefficients);
- }
- printf(" display_horizontal_size %u\n", picture->display_horizontal_size);
- printf(" display_vertical_size %u\n", picture->display_vertical_size);
-#endif
-
- return 0;
-}
-
-static int picture_display_extension (picture_t * picture, uint8_t * buffer) {
- uint32_t bit_position;
- uint32_t padding;
-
-#ifdef LOG_PAN_SCAN
- printf ("libmpeg2: picture_display_extension\n");
-#endif
-
- bit_position = 0;
- padding = get_bits(buffer, 4, &bit_position);
- picture->frame_centre_horizontal_offset = get_bits_signed(buffer, 16, &bit_position);
- padding = get_bits(buffer, 1, &bit_position);
- picture->frame_centre_vertical_offset = get_bits_signed(buffer, 16, &bit_position);
- padding = get_bits(buffer, 1, &bit_position);
-
-#ifdef LOG_PAN_SCAN
- printf("Pan & Scan centre (x,y) = (%d, %d)\n",
- picture->frame_centre_horizontal_offset,
- picture->frame_centre_vertical_offset);
-#endif
-
- return 0;
-}
-
-int mpeg2_header_extension (picture_t * picture, uint8_t * buffer)
-{
- switch (buffer[0] & 0xf0) {
- case 0x00: /* reserved */
- return 0;
-
- case 0x10: /* sequence extension */
- return sequence_extension (picture, buffer);
-
- case 0x20: /* sequence display extension for Pan & Scan */
- return sequence_display_extension (picture, buffer);
-
- case 0x30: /* quant matrix extension */
- return quant_matrix_extension (picture, buffer);
-
- case 0x40: /* copyright extension */
- return 0;
-
- case 0x50: /* sequence scalable extension */
- return 0;
-
- case 0x60: /* reserved */
- return 0;
-
- case 0x70: /* picture display extension for Pan & Scan */
- return picture_display_extension (picture, buffer);
-
- case 0x80: /* picture coding extension */
- return picture_coding_extension (picture, buffer);
-
- case 0x90: /* picture spacial scalable extension */
- return 0;
-
- case 0xA0: /* picture temporal scalable extension */
- return 0;
-
- case 0xB0: /* camera parameters extension */
- return 0;
-
- case 0xC0: /* ITU-T extension */
- return 0;
-
- case 0xD0: /* reserved */
- return 0;
-
- case 0xE0: /* reserved */
- return 0;
-
- case 0xF0: /* reserved */
- return 0;
- }
-
- return 0;
-}
-
-int mpeg2_header_group_of_pictures (picture_t * picture, uint8_t * buffer) {
- uint32_t bit_position;
- uint32_t padding;
- bit_position = 0;
-
- picture->drop_frame_flag = get_bits(buffer, 1, &bit_position);
- picture->time_code_hours = get_bits(buffer, 5, &bit_position);
- picture->time_code_minutes = get_bits(buffer, 6, &bit_position);
- padding = get_bits(buffer, 1, &bit_position);
- picture->time_code_seconds = get_bits(buffer, 6, &bit_position);
- picture->time_code_pictures = get_bits(buffer, 6, &bit_position);
- picture->closed_gop = get_bits(buffer, 1, &bit_position);
- picture->broken_link = get_bits(buffer, 1, &bit_position);
-
-#ifdef LOG_PAN_SCAN
- printf("Group of pictures\n");
- printf(" drop_frame_flag: %u\n", picture->drop_frame_flag);
- printf(" time_code: HH:MM:SS:Pictures %02u:%02u:%02u:%02u\n",
- picture->time_code_hours,
- picture->time_code_minutes,
- picture->time_code_seconds,
- picture->time_code_pictures);
- printf(" closed_gop: %u\n", picture->closed_gop);
- printf(" bloken_link: %u\n", picture->broken_link);
-#endif
-
- return 0;
-}
-
-int mpeg2_header_picture (picture_t * picture, uint8_t * buffer)
-{
- picture->picture_coding_type = (buffer [1] >> 3) & 7;
- picture->vbv_delay = ((buffer[1] << 13) | (buffer[2] << 5) |
- (buffer[3] >> 3)) & 0xffff;
-
- /* forward_f_code and backward_f_code - used in mpeg1 only */
- picture->f_motion.f_code[1] = (buffer[3] >> 2) & 1;
- picture->f_motion.f_code[0] =
- (((buffer[3] << 1) | (buffer[4] >> 7)) & 7) - 1;
- picture->b_motion.f_code[1] = (buffer[4] >> 6) & 1;
- picture->b_motion.f_code[0] = ((buffer[4] >> 3) & 7) - 1;
-
- /* move in header_process_picture_header */
- picture->second_field =
- (picture->picture_structure != FRAME_PICTURE) &&
- !(picture->second_field);
-
- return 0;
-}
diff --git a/src/libmpeg2/idct.c b/src/libmpeg2/idct.c
deleted file mode 100644
index 157beea31..000000000
--- a/src/libmpeg2/idct.c
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * idct.c
- * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
- * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * Portions of this code are from the MPEG software simulation group
- * idct implementation. This code will be replaced with a new
- * implementation soon.
- *
- * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/**********************************************************/
-/* inverse two dimensional DCT, Chen-Wang algorithm */
-/* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */
-/* 32-bit integer arithmetic (8 bit coefficients) */
-/* 11 mults, 29 adds per DCT */
-/* sE, 18.8.91 */
-/**********************************************************/
-/* coefficients extended to 12 bit for IEEE1180-1990 */
-/* compliance sE, 2.1.94 */
-/**********************************************************/
-
-/* this code assumes >> to be a two's-complement arithmetic */
-/* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */
-
-#include "config.h"
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-#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 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) */
-
-/* idct main entry points */
-void (* mpeg2_idct_copy) (int16_t * block, uint8_t * dest, int stride);
-void (* mpeg2_idct_add) (int16_t * block, uint8_t * dest, int stride);
-void (* mpeg2_idct) (int16_t * block);
-void (* mpeg2_zero_block) (int16_t * block);
-
-static uint8_t clip_lut[1024];
-#define CLIP(i) ((clip_lut+384)[ (i)])
-
-/* row (horizontal) IDCT
- *
- * 7 pi 1
- * dst[k] = sum c[l] * src[l] * cos ( -- * ( k + - ) * l )
- * l=0 8 2
- *
- * where: c[0] = 128
- * c[1..7] = 128*sqrt (2)
- */
-
-static void inline idct_row (int16_t * block)
-{
- int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- x1 = block[4] << 11;
- x2 = block[6];
- x3 = block[2];
- x4 = block[1];
- x5 = block[7];
- x6 = block[5];
- x7 = block[3];
-
- /* shortcut */
- if (! (x1 | x2 | x3 | x4 | x5 | x6 | x7 )) {
- block[0] = block[1] = block[2] = block[3] = block[4] =
- block[5] = block[6] = block[7] = block[0]<<3;
- return;
- }
-
- x0 = (block[0] << 11) + 128; /* for proper rounding in the fourth stage */
-
- /* first stage */
- x8 = W7 * (x4 + x5);
- x4 = x8 + (W1 - W7) * x4;
- x5 = x8 - (W1 + W7) * x5;
- x8 = W3 * (x6 + x7);
- x6 = x8 - (W3 - W5) * x6;
- x7 = x8 - (W3 + W5) * x7;
-
- /* second stage */
- x8 = x0 + x1;
- x0 -= x1;
- x1 = W6 * (x3 + x2);
- x2 = x1 - (W2 + W6) * x2;
- x3 = x1 + (W2 - W6) * x3;
- x1 = x4 + x6;
- x4 -= x6;
- x6 = x5 + x7;
- x5 -= x7;
-
- /* third stage */
- x7 = x8 + x3;
- x8 -= x3;
- x3 = x0 + x2;
- x0 -= x2;
- x2 = (181 * (x4 + x5) + 128) >> 8;
- x4 = (181 * (x4 - x5) + 128) >> 8;
-
- /* fourth stage */
- block[0] = (x7 + x1) >> 8;
- block[1] = (x3 + x2) >> 8;
- block[2] = (x0 + x4) >> 8;
- block[3] = (x8 + x6) >> 8;
- block[4] = (x8 - x6) >> 8;
- block[5] = (x0 - x4) >> 8;
- block[6] = (x3 - x2) >> 8;
- block[7] = (x7 - x1) >> 8;
-}
-
-/* column (vertical) IDCT
- *
- * 7 pi 1
- * dst[8*k] = sum c[l] * src[8*l] * cos ( -- * ( k + - ) * l )
- * l=0 8 2
- *
- * where: c[0] = 1/1024
- * c[1..7] = (1/1024)*sqrt (2)
- */
-
-static void inline idct_col (int16_t *block)
-{
- int x0, x1, x2, x3, x4, x5, x6, x7, x8;
-
- /* shortcut */
- x1 = block [8*4] << 8;
- x2 = block [8*6];
- x3 = block [8*2];
- x4 = block [8*1];
- x5 = block [8*7];
- x6 = block [8*5];
- x7 = block [8*3];
-
-#if 0
- if (! (x1 | x2 | x3 | x4 | x5 | x6 | x7 )) {
- block[8*0] = block[8*1] = block[8*2] = block[8*3] = block[8*4] =
- block[8*5] = block[8*6] = block[8*7] = (block[8*0] + 32) >> 6;
- return;
- }
-#endif
-
- x0 = (block[8*0] << 8) + 8192;
-
- /* first stage */
- x8 = W7 * (x4 + x5) + 4;
- x4 = (x8 + (W1 - W7) * x4) >> 3;
- x5 = (x8 - (W1 + W7) * x5) >> 3;
- x8 = W3 * (x6 + x7) + 4;
- x6 = (x8 - (W3 - W5) * x6) >> 3;
- x7 = (x8 - (W3 + W5) * x7) >> 3;
-
- /* second stage */
- x8 = x0 + x1;
- x0 -= x1;
- x1 = W6 * (x3 + x2) + 4;
- x2 = (x1 - (W2 + W6) * x2) >> 3;
- x3 = (x1 + (W2 - W6) * x3) >> 3;
- x1 = x4 + x6;
- x4 -= x6;
- x6 = x5 + x7;
- x5 -= x7;
-
- /* third stage */
- x7 = x8 + x3;
- x8 -= x3;
- x3 = x0 + x2;
- x0 -= x2;
- x2 = (181 * (x4 + x5) + 128) >> 8;
- x4 = (181 * (x4 - x5) + 128) >> 8;
-
- /* fourth stage */
- block[8*0] = (x7 + x1) >> 14;
- block[8*1] = (x3 + x2) >> 14;
- block[8*2] = (x0 + x4) >> 14;
- block[8*3] = (x8 + x6) >> 14;
- block[8*4] = (x8 - x6) >> 14;
- block[8*5] = (x0 - x4) >> 14;
- block[8*6] = (x3 - x2) >> 14;
- block[8*7] = (x7 - x1) >> 14;
-}
-
-static void mpeg2_idct_copy_c (int16_t * block, uint8_t * dest, int stride)
-{
- int i;
-
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
-
- for (i = 0; i < 8; i++)
- idct_col (block + i);
-
- i = 8;
- do {
- dest[0] = CLIP (block[0]);
- dest[1] = CLIP (block[1]);
- dest[2] = CLIP (block[2]);
- dest[3] = CLIP (block[3]);
- dest[4] = CLIP (block[4]);
- dest[5] = CLIP (block[5]);
- dest[6] = CLIP (block[6]);
- dest[7] = CLIP (block[7]);
-
- block[0] = 0; block[1] = 0; block[2] = 0; block[3] = 0;
- block[4] = 0; block[5] = 0; block[6] = 0; block[7] = 0;
-
- dest += stride;
- block += 8;
- } while (--i);
-}
-
-static void mpeg2_idct_add_c (int16_t * block, uint8_t * dest, int stride)
-{
- int i;
-
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
-
- for (i = 0; i < 8; i++)
- idct_col (block + i);
-
- i = 8;
- do {
- dest[0] = CLIP (block[0] + dest[0]);
- dest[1] = CLIP (block[1] + dest[1]);
- dest[2] = CLIP (block[2] + dest[2]);
- dest[3] = CLIP (block[3] + dest[3]);
- dest[4] = CLIP (block[4] + dest[4]);
- dest[5] = CLIP (block[5] + dest[5]);
- dest[6] = CLIP (block[6] + dest[6]);
- dest[7] = CLIP (block[7] + dest[7]);
-
- block[0] = 0; block[1] = 0; block[2] = 0; block[3] = 0;
- block[4] = 0; block[5] = 0; block[6] = 0; block[7] = 0;
-
- dest += stride;
- block += 8;
- } while (--i);
-}
-
-static void mpeg2_idct_c (int16_t * block)
-{
- int i;
-
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
-
- for (i = 0; i < 8; i++)
- idct_col (block + i);
-}
-
-static void mpeg2_zero_block_c (int16_t * wblock)
-{
- memset( wblock, 0, sizeof(int16_t) * 64 );
-}
-
-void mpeg2_idct_init (uint32_t mm_accel)
-{
- mpeg2_zero_block = mpeg2_zero_block_c;
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- if (mm_accel & MM_ACCEL_X86_MMXEXT) {
-#ifdef LOG
- fprintf (stderr, "Using MMXEXT for IDCT transform\n");
-#endif
- mpeg2_idct_copy = mpeg2_idct_copy_mmxext;
- mpeg2_idct_add = mpeg2_idct_add_mmxext;
- mpeg2_idct = mpeg2_idct_mmxext;
- mpeg2_zero_block = mpeg2_zero_block_mmx;
- mpeg2_idct_mmx_init ();
- } else if (mm_accel & MM_ACCEL_X86_MMX) {
-#ifdef LOG
- fprintf (stderr, "Using MMX for IDCT transform\n");
-#endif
- mpeg2_idct_copy = mpeg2_idct_copy_mmx;
- mpeg2_idct_add = mpeg2_idct_add_mmx;
- mpeg2_idct = mpeg2_idct_mmx;
- mpeg2_zero_block = mpeg2_zero_block_mmx;
- mpeg2_idct_mmx_init ();
- } else
-#endif
-#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
- if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
-#ifdef LOG
- fprintf (stderr, "Using altivec for IDCT transform\n");
-#endif
- mpeg2_idct_copy = mpeg2_idct_copy_altivec;
- mpeg2_idct_add = mpeg2_idct_add_altivec;
- mpeg2_idct_altivec_init ();
- mpeg2_idct = mpeg2_idct_c;
- } else
-#endif
-#ifdef LIBMPEG2_MLIB
- if (mm_accel & MM_ACCEL_MLIB) {
- char * env_var;
-
- env_var = getenv ("MLIB_NON_IEEE");
-
- mpeg2_idct = mpeg2_idct_mlib;
- if (env_var == NULL) {
-#ifdef LOG
- fprintf (stderr, "Using mlib for IDCT transform\n");
-#endif
- mpeg2_idct_add = mpeg2_idct_add_mlib;
- } else {
- fprintf (stderr, "Using non-IEEE mlib for IDCT transform\n");
- mpeg2_idct_add = mpeg2_idct_add_mlib_non_ieee;
- }
- mpeg2_idct_copy = mpeg2_idct_copy_mlib_non_ieee;
- } else
-#endif
- {
- int i;
-
-#ifdef LOG
- fprintf (stderr, "No accelerated IDCT transform found\n");
-#endif
- mpeg2_idct_copy = mpeg2_idct_copy_c;
- mpeg2_idct_add = mpeg2_idct_add_c;
- mpeg2_idct = mpeg2_idct_c;
- for (i = -384; i < 640; i++)
- clip_lut[i+384] = (i < 0) ? 0 : ((i > 255) ? 255 : i);
- }
-}
diff --git a/src/libmpeg2/idct_altivec.c b/src/libmpeg2/idct_altivec.c
deleted file mode 100644
index ed8b58cfd..000000000
--- a/src/libmpeg2/idct_altivec.c
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- * idct_altivec.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
-
-#include <altivec.h>
-
-#include <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-#define vector_s16_t 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);
-
-#if defined( __APPLE_CC__ ) && defined( __APPLE_ALTIVEC__ ) /* apple */
-#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h)
-#else /* gnu */
-#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) {a, b, c, d, e, f, g, h}
-#endif
-
-static vector_s16_t constants[5] = {
- VEC_S16(23170, 13573, 6518, 21895, -23170, -21895, 32, 31),
- VEC_S16(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725),
- VEC_S16(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521),
- VEC_S16(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692),
- VEC_S16(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722)
-};
-
-void mpeg2_idct_copy_altivec (vector_s16_t * block, unsigned char * dest,
- int stride)
-{
- vector_u8_t tmp;
-
- 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)
- memset (block, 0, 64 * sizeof (signed short));
-}
-
-void mpeg2_idct_add_altivec (vector_s16_t * block, unsigned char * dest,
- int stride)
-{
- vector_u8_t tmp;
- vector_s16_t tmp2, tmp3;
- vector_u8_t perm0;
- vector_u8_t perm1;
- vector_u8_t p0, p1, p;
-
- 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)
- memset (block, 0, 64 * sizeof (signed short));
-}
-
-void mpeg2_idct_altivec_init (void)
-{
- int i, j;
-
- /* the altivec idct uses a transposed input, so we patch scan tables */
- for (i = 0; i < 64; i++) {
- j = mpeg2_scan_norm[i];
- mpeg2_scan_norm[i] = (j >> 3) | ((j & 7) << 3);
- j = mpeg2_scan_alt[i];
- mpeg2_scan_alt[i] = (j >> 3) | ((j & 7) << 3);
- }
-}
-
-#endif /* ARCH_PPC && ENABLED_ALTIVEC */
-
diff --git a/src/libmpeg2/idct_mmx.c b/src/libmpeg2/idct_mmx.c
deleted file mode 100644
index ce4bd064b..000000000
--- a/src/libmpeg2/idct_mmx.c
+++ /dev/null
@@ -1,740 +0,0 @@
-/*
- * idct_mmx.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-
-#include <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-#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, 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 (int16_t * table, 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, 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, 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 (int16_t * table, 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, 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 short _T1[] ATTR_ALIGN(8) = {T1,T1,T1,T1};
- static short _T2[] ATTR_ALIGN(8) = {T2,T2,T2,T2};
- static short _T3[] ATTR_ALIGN(8) = {T3,T3,T3,T3};
- static 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
-}
-
-
-static int32_t rounder0[] ATTR_ALIGN(8) =
- rounder ((1 << (COL_SHIFT - 1)) - 0.5);
-static int32_t rounder4[] ATTR_ALIGN(8) = rounder (0);
-static int32_t rounder1[] ATTR_ALIGN(8) =
- rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */
-static int32_t rounder7[] ATTR_ALIGN(8) =
- rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */
-static int32_t rounder2[] ATTR_ALIGN(8) =
- rounder (0.60355339059); /* C2 * (C6+C2)/2 */
-static int32_t rounder6[] ATTR_ALIGN(8) =
- rounder (-0.25); /* C2 * (C6-C2)/2 */
-static int32_t rounder3[] ATTR_ALIGN(8) =
- rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */
-static int32_t rounder5[] ATTR_ALIGN(8) =
- rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */
-
-
-#define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \
-static inline void idct (int16_t * block) \
-{ \
- static int16_t table04[] ATTR_ALIGN(16) = \
- table (22725, 21407, 19266, 16384, 12873, 8867, 4520); \
- static int16_t table17[] ATTR_ALIGN(16) = \
- table (31521, 29692, 26722, 22725, 17855, 12299, 6270); \
- static int16_t table26[] ATTR_ALIGN(16) = \
- table (29692, 27969, 25172, 21407, 16819, 11585, 5906); \
- static 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); \
-}
-
-
-#define COPY_MMX(offset,r0,r1,r2) \
-do { \
- movq_m2r (*(block+offset), r0); \
- dest += stride; \
- movq_m2r (*(block+offset+4), r1); \
- movq_r2m (r2, *dest); \
- packuswb_r2r (r1, r0); \
-} while (0)
-
-static void block_copy (int16_t * block, uint8_t * dest, int stride)
-{
- movq_m2r (*(block+0*8), mm0);
- movq_m2r (*(block+0*8+4), mm1);
- movq_m2r (*(block+1*8), mm2);
- packuswb_r2r (mm1, mm0);
- movq_m2r (*(block+1*8+4), mm3);
- movq_r2m (mm0, *dest);
- packuswb_r2r (mm3, mm2);
- COPY_MMX (2*8, mm0, mm1, mm2);
- COPY_MMX (3*8, mm2, mm3, mm0);
- COPY_MMX (4*8, mm0, mm1, mm2);
- COPY_MMX (5*8, mm2, mm3, mm0);
- COPY_MMX (6*8, mm0, mm1, mm2);
- COPY_MMX (7*8, mm2, mm3, mm0);
- movq_r2m (mm2, *(dest+stride));
-}
-
-
-#define ADD_MMX(offset,r1,r2,r3,r4) \
-do { \
- movq_m2r (*(dest+2*stride), r1); \
- packuswb_r2r (r4, r3); \
- movq_r2r (r1, r2); \
- dest += stride; \
- movq_r2m (r3, *dest); \
- punpcklbw_r2r (mm0, r1); \
- paddsw_m2r (*(block+offset), r1); \
- punpckhbw_r2r (mm0, r2); \
- paddsw_m2r (*(block+offset+4), r2); \
-} while (0)
-
-static void block_add (int16_t * block, uint8_t * dest, int stride)
-{
- movq_m2r (*dest, mm1);
- pxor_r2r (mm0, mm0);
- movq_m2r (*(dest+stride), mm3);
- movq_r2r (mm1, mm2);
- punpcklbw_r2r (mm0, mm1);
- movq_r2r (mm3, mm4);
- paddsw_m2r (*(block+0*8), mm1);
- punpckhbw_r2r (mm0, mm2);
- paddsw_m2r (*(block+0*8+4), mm2);
- punpcklbw_r2r (mm0, mm3);
- paddsw_m2r (*(block+1*8), mm3);
- packuswb_r2r (mm2, mm1);
- punpckhbw_r2r (mm0, mm4);
- movq_r2m (mm1, *dest);
- paddsw_m2r (*(block+1*8+4), mm4);
- ADD_MMX (2*8, mm1, mm2, mm3, mm4);
- ADD_MMX (3*8, mm3, mm4, mm1, mm2);
- ADD_MMX (4*8, mm1, mm2, mm3, mm4);
- ADD_MMX (5*8, mm3, mm4, mm1, mm2);
- ADD_MMX (6*8, mm1, mm2, mm3, mm4);
- ADD_MMX (7*8, mm3, mm4, mm1, mm2);
- packuswb_r2r (mm4, mm3);
- movq_r2m (mm3, *(dest+stride));
-}
-
-static inline void block_zero (int16_t * block) {
- pxor_r2r (mm0, mm0);
- movq_r2m (mm0, *(block+0*4));
- movq_r2m (mm0, *(block+1*4));
- movq_r2m (mm0, *(block+2*4));
- movq_r2m (mm0, *(block+3*4));
- movq_r2m (mm0, *(block+4*4));
- movq_r2m (mm0, *(block+5*4));
- movq_r2m (mm0, *(block+6*4));
- movq_r2m (mm0, *(block+7*4));
- movq_r2m (mm0, *(block+8*4));
- movq_r2m (mm0, *(block+9*4));
- movq_r2m (mm0, *(block+10*4));
- movq_r2m (mm0, *(block+11*4));
- movq_r2m (mm0, *(block+12*4));
- movq_r2m (mm0, *(block+13*4));
- movq_r2m (mm0, *(block+14*4));
- movq_r2m (mm0, *(block+15*4));
-}
-
-declare_idct (mmxext_idct, mmxext_table,
- mmxext_row_head, mmxext_row, mmxext_row_tail, mmxext_row_mid)
-
-void mpeg2_idct_copy_mmxext (int16_t * block, uint8_t * dest, int stride)
-{
- mmxext_idct (block);
- block_copy (block, dest, stride);
- block_zero (block);
-}
-
-void mpeg2_idct_add_mmxext (int16_t * block, uint8_t * dest, int stride)
-{
- mmxext_idct (block);
- block_add (block, dest, stride);
- block_zero (block);
-}
-
-void mpeg2_idct_mmxext (int16_t * block)
-{
- mmxext_idct (block);
-}
-
-declare_idct (mmx_idct, mmx_table,
- mmx_row_head, mmx_row, mmx_row_tail, mmx_row_mid)
-
-void mpeg2_idct_copy_mmx (int16_t * block, uint8_t * dest, int stride)
-{
- mmx_idct (block);
- block_copy (block, dest, stride);
- block_zero (block);
-}
-
-void mpeg2_idct_add_mmx (int16_t * block, uint8_t * dest, int stride)
-{
- mmx_idct (block);
- block_add (block, dest, stride);
- block_zero (block);
-}
-
-void mpeg2_idct_mmx (int16_t * block)
-{
- mmx_idct (block);
-}
-
-void mpeg2_zero_block_mmx (int16_t * block)
-{
- block_zero (block);
-}
-
-void mpeg2_idct_mmx_init (void)
-{
- int i, j;
-
- /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */
-
- for (i = 0; i < 64; i++) {
- j = mpeg2_scan_norm[i];
- mpeg2_scan_norm[i] = (j & 0x38) | ((j & 6) >> 1) | ((j & 1) << 2);
- j = mpeg2_scan_alt[i];
- mpeg2_scan_alt[i] = (j & 0x38) | ((j & 6) >> 1) | ((j & 1) << 2);
- }
-}
-
-#endif
diff --git a/src/libmpeg2/libmpeg2_accel.c b/src/libmpeg2/libmpeg2_accel.c
deleted file mode 100644
index 63c7b1b9b..000000000
--- a/src/libmpeg2/libmpeg2_accel.c
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * libmpeg2_accel.c
- * Copyright (C) 2004 The Unichrome Project.
- * Copyright (C) 2005 Thomas Hellstrom.
- *
- * 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
- */
-
-#include "xine_internal.h"
-#include "mpeg2.h"
-#include "mpeg2_internal.h"
-#include "xvmc_vld.h"
-#include "libmpeg2_accel.h"
-
-
-void
-libmpeg2_accel_scan( mpeg2dec_accel_t *accel, uint8_t *scan_norm, uint8_t *scan_alt)
-{
- xvmc_setup_scan_ptable();
-}
-
-
-int
-libmpeg2_accel_discontinuity(mpeg2dec_accel_t *accel, uint32_t frame_format, picture_t *picture)
-{
- accel->xvmc_last_slice_code=-1;
- if ( !picture->current_frame )
- return 0;
- if (frame_format == XINE_IMGFMT_XXMC) {
- xine_xxmc_t *xxmc = (xine_xxmc_t *)
- picture->current_frame->accel_data;
- switch(xxmc->acceleration) {
- case XINE_XVMC_ACCEL_VLD:
- case XINE_XVMC_ACCEL_IDCT:
- case XINE_XVMC_ACCEL_MOCOMP:
- xxmc->proc_xxmc_flush( picture->current_frame );
- break;
- default:
- break;
- }
- }
- return 0;
-}
-
-int
-libmpeg2_accel_new_sequence(mpeg2dec_accel_t *accel, uint32_t frame_format, picture_t *picture)
-{
- switch(frame_format) {
- case XINE_IMGFMT_XXMC:
- case XINE_IMGFMT_XVMC: {
- xine_xvmc_t *xvmc = (xine_xvmc_t *)
- picture->current_frame->accel_data;
- picture->mc = xvmc->macroblocks;
- return 0;
- }
- default:
- break;
- }
- return 1;
-}
-
-int
-libmpeg2_accel_new_frame(mpeg2dec_accel_t *accel, uint32_t frame_format,
- picture_t *picture, double ratio, uint32_t flags)
-{
- if (picture->current_frame) {
- if (XINE_IMGFMT_XXMC == frame_format) {
- xine_xxmc_t *xxmc = (xine_xxmc_t *)
- picture->current_frame->accel_data;
-
- /*
- * Make a request for acceleration type and mpeg coding from
- * the output plugin.
- */
-
- xxmc->fallback_format = XINE_IMGFMT_YV12;
- xxmc->acceleration = XINE_XVMC_ACCEL_VLD| XINE_XVMC_ACCEL_IDCT
- | XINE_XVMC_ACCEL_MOCOMP ;
-
- /*
- * Standard MOCOMP / IDCT XvMC implementation for interlaced streams
- * is buggy. The bug is inherited from the old XvMC driver. Don't use it until
- * it has been fixed. (A volunteer ?)
- */
-
- if ( picture->picture_structure != 3 ) {
- picture->top_field_first = (picture->picture_structure == 1);
- xxmc->acceleration &= ~( XINE_XVMC_ACCEL_IDCT | XINE_XVMC_ACCEL_MOCOMP );
- }
-
- xxmc->mpeg = (picture->mpeg1) ? XINE_XVMC_MPEG_1:XINE_XVMC_MPEG_2;
- xxmc->proc_xxmc_update_frame (picture->current_frame->driver,
- picture->current_frame,
- picture->coded_picture_width,
- picture->coded_picture_height,
- ratio,
- XINE_IMGFMT_XXMC, flags);
- }
- }
- return 0;
-}
-
-void
-libmpeg2_accel_frame_completion(mpeg2dec_accel_t * accel, uint32_t frame_format, picture_t *picture,
- int code)
-{
-
- if ( !picture->current_frame ) return;
-
- if (frame_format == XINE_IMGFMT_XXMC) {
- xine_xxmc_t *xxmc = (xine_xxmc_t *)
- picture->current_frame->accel_data;
- if (!xxmc->decoded) {
- switch(picture->current_frame->format) {
- case XINE_IMGFMT_XXMC:
- switch(xxmc->acceleration) {
- case XINE_XVMC_ACCEL_VLD:
- mpeg2_xxmc_vld_frame_complete(accel, picture, code);
- break;
- case XINE_XVMC_ACCEL_IDCT:
- case XINE_XVMC_ACCEL_MOCOMP:
- xxmc->decoded = !picture->current_frame->bad_frame;
- xxmc->proc_xxmc_flush( picture->current_frame );
- break;
- default:
- break;
- }
- default:
- break;
- }
- }
- }
-}
-
-
-int
-libmpeg2_accel_slice(mpeg2dec_accel_t *accel, picture_t *picture, int code, char * buffer,
- uint32_t chunk_size, uint8_t *chunk_buffer)
-{
- /*
- * Don't reference frames of other formats. They are invalid. This may happen if the
- * xxmc plugin suddenly falls back to software decoding.
- */
-
- if (( picture->current_frame->picture_coding_type == XINE_PICT_P_TYPE ) ||
- ( picture->current_frame->picture_coding_type == XINE_PICT_B_TYPE )) {
- if (! picture->forward_reference_frame) return 1;
- if (picture->forward_reference_frame->format != picture->current_frame->format) {
- picture->v_offset = 0;
- return 1;
- }
- }
-
- if ( picture->current_frame->picture_coding_type == XINE_PICT_B_TYPE ) {
- if (! picture->backward_reference_frame) return 1;
- if (picture->backward_reference_frame->format != picture->current_frame->format) {
- picture->v_offset = 0;
- return 1;
- }
- }
-
- switch( picture->current_frame->format ) {
-
- case XINE_IMGFMT_XXMC:
- {
- xine_xxmc_t *xxmc = (xine_xxmc_t *)
- picture->current_frame->accel_data;
-
- if ( xxmc->proc_xxmc_lock_valid( picture->current_frame,
- picture->forward_reference_frame,
- picture->backward_reference_frame,
- picture->current_frame->picture_coding_type)) {
- picture->v_offset = 0;
- return 1;
- }
-
- switch(picture->current_frame->format) {
- case XINE_IMGFMT_XXMC:
- switch(xxmc->acceleration) {
- case XINE_XVMC_ACCEL_VLD:
- mpeg2_xxmc_slice(accel, picture, code, buffer, chunk_size, chunk_buffer);
- break;
- case XINE_XVMC_ACCEL_IDCT:
- case XINE_XVMC_ACCEL_MOCOMP:
- mpeg2_xvmc_slice (accel, picture, code, buffer);
- break;
- default:
- mpeg2_slice (picture, code, buffer);
- break;
- }
- break;
- default:
- mpeg2_slice (picture, code, buffer);
- break;
- }
- xxmc->proc_xxmc_unlock(picture->current_frame->driver);
- break;
- }
-
- case XINE_IMGFMT_XVMC:
- mpeg2_xvmc_slice (accel, picture, code, buffer);
- break;
-
- default:
- mpeg2_slice (picture, code, buffer);
- break;
- }
- return 0;
-}
diff --git a/src/libmpeg2/motion_comp.c b/src/libmpeg2/motion_comp.c
deleted file mode 100644
index f8faa3ee5..000000000
--- a/src/libmpeg2/motion_comp.c
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * motion_comp.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 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 <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-mpeg2_mc_t mpeg2_mc;
-
-void mpeg2_mc_init (uint32_t mm_accel)
-{
-#ifdef LIBMPEG2_MLIB
- if (mm_accel & MM_ACCEL_MLIB) {
-#ifdef LOG
- fprintf (stderr, "Using mediaLib for motion compensation\n");
-#endif
- mpeg2_mc = mpeg2_mc_mlib;
- }
-#endif
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
- if (mm_accel & MM_ACCEL_X86_MMXEXT) {
-#ifdef LOG
- fprintf (stderr, "Using MMXEXT for motion compensation\n");
-#endif
- mpeg2_mc = mpeg2_mc_mmxext;
- } else if (mm_accel & MM_ACCEL_X86_3DNOW) {
-#ifdef LOG
- fprintf (stderr, "Using 3DNOW for motion compensation\n");
-#endif
- mpeg2_mc = mpeg2_mc_3dnow;
- } else if (mm_accel & MM_ACCEL_X86_MMX) {
-#ifdef LOG
- fprintf (stderr, "Using MMX for motion compensation\n");
-#endif
- mpeg2_mc = mpeg2_mc_mmx;
- } else
-#endif
-#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
- if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
-#ifdef LOG
- fprintf (stderr, "Using altivec for motion compensation\n");
-#endif
- mpeg2_mc = mpeg2_mc_altivec;
- } else
-#endif
-#if defined(ARCH_SPARC) && defined(ENABLE_VIS)
- if (mm_accel & MM_ACCEL_SPARC_VIS) {
-#ifdef LOG
- fprintf (stderr, "Using VIS for motion compensation\n");
-#endif
- mpeg2_mc = mpeg2_mc_vis;
- } else
-#endif
- {
-#ifdef LOG
- fprintf (stderr, "No accelerated motion compensation found\n");
-#endif
- mpeg2_mc = mpeg2_mc_c;
- }
-}
-
-#define avg2(a,b) ((a+b+1)>>1)
-#define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
-
-#define predict_o(i) (ref[i])
-#define predict_x(i) (avg2 (ref[i], ref[i+1]))
-#define predict_y(i) (avg2 (ref[i], (ref+stride)[i]))
-#define predict_xy(i) (avg4 (ref[i], ref[i+1], \
- (ref+stride)[i], (ref+stride)[i+1]))
-
-#define put(predictor,i) dest[i] = predictor (i)
-#define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i])
-
-/* mc function template */
-
-#define MC_FUNC(op,xy) \
-static void MC_##op##_##xy##_16_c (uint8_t * dest, uint8_t * ref, \
- int stride, int height) \
-{ \
- do { \
- op (predict_##xy, 0); \
- op (predict_##xy, 1); \
- op (predict_##xy, 2); \
- op (predict_##xy, 3); \
- op (predict_##xy, 4); \
- op (predict_##xy, 5); \
- op (predict_##xy, 6); \
- op (predict_##xy, 7); \
- op (predict_##xy, 8); \
- op (predict_##xy, 9); \
- op (predict_##xy, 10); \
- op (predict_##xy, 11); \
- op (predict_##xy, 12); \
- op (predict_##xy, 13); \
- op (predict_##xy, 14); \
- op (predict_##xy, 15); \
- ref += stride; \
- dest += stride; \
- } while (--height); \
-} \
-static void MC_##op##_##xy##_8_c (uint8_t * dest, uint8_t * ref, \
- int stride, int height) \
-{ \
- do { \
- op (predict_##xy, 0); \
- op (predict_##xy, 1); \
- op (predict_##xy, 2); \
- op (predict_##xy, 3); \
- op (predict_##xy, 4); \
- op (predict_##xy, 5); \
- op (predict_##xy, 6); \
- op (predict_##xy, 7); \
- ref += stride; \
- dest += stride; \
- } while (--height); \
-}
-
-/* definitions of the actual mc functions */
-
-MC_FUNC (put,o)
-MC_FUNC (avg,o)
-MC_FUNC (put,x)
-MC_FUNC (avg,x)
-MC_FUNC (put,y)
-MC_FUNC (avg,y)
-MC_FUNC (put,xy)
-MC_FUNC (avg,xy)
-
-MPEG2_MC_EXTERN (c)
diff --git a/src/libmpeg2/motion_comp_mmx.c b/src/libmpeg2/motion_comp_mmx.c
deleted file mode 100644
index 80a53685a..000000000
--- a/src/libmpeg2/motion_comp_mmx.c
+++ /dev/null
@@ -1,1012 +0,0 @@
-/*
- * motion_comp_mmx.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#if defined(ARCH_X86) || defined(ARCH_X86_64)
-
-#include <inttypes.h>
-
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-#define CPU_MMXEXT 0
-#define CPU_3DNOW 1
-
-
-/* MMX code - needs a rewrite */
-
-/* some rounding constants */
-static mmx_t round1 = {0x0001000100010001LL};
-static mmx_t round4 = {0x0002000200020002LL};
-
-/*
- * This code should probably be compiled with loop unrolling
- * (ie, -funroll-loops in gcc)becuase some of the loops
- * use a small static number of iterations. This was written
- * with the assumption the compiler knows best about when
- * unrolling will help
- */
-
-static inline void mmx_zero_reg ()
-{
- /* load 0 into mm0 */
- pxor_r2r (mm0, mm0);
-}
-
-static inline void mmx_average_2_U8 (uint8_t * dest,
- uint8_t * src1, uint8_t * src2)
-{
- /* *dest = (*src1 + *src2 + 1)/ 2; */
-
- movq_m2r (*src1, mm1); // load 8 src1 bytes
- movq_r2r (mm1, mm2); // copy 8 src1 bytes
-
- movq_m2r (*src2, mm3); // load 8 src2 bytes
- movq_r2r (mm3, mm4); // copy 8 src2 bytes
-
- punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes
- punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes
- punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes
-
- paddw_r2r (mm3, mm1); // add lows to mm1
- paddw_m2r (round1, mm1);
- psraw_i2r (1, mm1); // /2
-
- paddw_r2r (mm4, mm2); // add highs to mm2
- paddw_m2r (round1, mm2);
- psraw_i2r (1, mm2); // /2
-
- packuswb_r2r (mm2, mm1); // pack (w/ saturation)
- movq_r2m (mm1, *dest); // store result in dest
-}
-
-static inline void mmx_interp_average_2_U8 (uint8_t * dest,
- uint8_t * src1, uint8_t * src2)
-{
- /* *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; */
-
- movq_m2r (*dest, mm1); // load 8 dest bytes
- movq_r2r (mm1, mm2); // copy 8 dest bytes
-
- movq_m2r (*src1, mm3); // load 8 src1 bytes
- movq_r2r (mm3, mm4); // copy 8 src1 bytes
-
- movq_m2r (*src2, mm5); // load 8 src2 bytes
- movq_r2r (mm5, mm6); // copy 8 src2 bytes
-
- punpcklbw_r2r (mm0, mm1); // unpack low dest bytes
- punpckhbw_r2r (mm0, mm2); // unpack high dest bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low src1 bytes
- punpckhbw_r2r (mm0, mm4); // unpack high src1 bytes
-
- punpcklbw_r2r (mm0, mm5); // unpack low src2 bytes
- punpckhbw_r2r (mm0, mm6); // unpack high src2 bytes
-
- paddw_r2r (mm5, mm3); // add lows
- paddw_m2r (round1, mm3);
- psraw_i2r (1, mm3); // /2
-
- paddw_r2r (mm6, mm4); // add highs
- paddw_m2r (round1, mm4);
- psraw_i2r (1, mm4); // /2
-
- paddw_r2r (mm3, mm1); // add lows
- paddw_m2r (round1, mm1);
- psraw_i2r (1, mm1); // /2
-
- paddw_r2r (mm4, mm2); // add highs
- paddw_m2r (round1, mm2);
- psraw_i2r (1, mm2); // /2
-
- packuswb_r2r (mm2, mm1); // pack (w/ saturation)
- movq_r2m (mm1, *dest); // store result in dest
-}
-
-static inline void mmx_average_4_U8 (uint8_t * dest,
- uint8_t * src1, uint8_t * src2,
- uint8_t * src3, uint8_t * src4)
-{
- /* *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; */
-
- movq_m2r (*src1, mm1); // load 8 src1 bytes
- movq_r2r (mm1, mm2); // copy 8 src1 bytes
-
- punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes
- punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes
-
- movq_m2r (*src2, mm3); // load 8 src2 bytes
- movq_r2r (mm3, mm4); // copy 8 src2 bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes
- punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes
-
- paddw_r2r (mm3, mm1); // add lows
- paddw_r2r (mm4, mm2); // add highs
-
- /* now have partials in mm1 and mm2 */
-
- movq_m2r (*src3, mm3); // load 8 src3 bytes
- movq_r2r (mm3, mm4); // copy 8 src3 bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low src3 bytes
- punpckhbw_r2r (mm0, mm4); // unpack high src3 bytes
-
- paddw_r2r (mm3, mm1); // add lows
- paddw_r2r (mm4, mm2); // add highs
-
- movq_m2r (*src4, mm5); // load 8 src4 bytes
- movq_r2r (mm5, mm6); // copy 8 src4 bytes
-
- punpcklbw_r2r (mm0, mm5); // unpack low src4 bytes
- punpckhbw_r2r (mm0, mm6); // unpack high src4 bytes
-
- paddw_r2r (mm5, mm1); // add lows
- paddw_r2r (mm6, mm2); // add highs
-
- /* now have subtotal in mm1 and mm2 */
-
- paddw_m2r (round4, mm1);
- psraw_i2r (2, mm1); // /4
- paddw_m2r (round4, mm2);
- psraw_i2r (2, mm2); // /4
-
- packuswb_r2r (mm2, mm1); // pack (w/ saturation)
- movq_r2m (mm1, *dest); // store result in dest
-}
-
-static inline void mmx_interp_average_4_U8 (uint8_t * dest,
- uint8_t * src1, uint8_t * src2,
- uint8_t * src3, uint8_t * src4)
-{
- /* *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; */
-
- movq_m2r (*src1, mm1); // load 8 src1 bytes
- movq_r2r (mm1, mm2); // copy 8 src1 bytes
-
- punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes
- punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes
-
- movq_m2r (*src2, mm3); // load 8 src2 bytes
- movq_r2r (mm3, mm4); // copy 8 src2 bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes
- punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes
-
- paddw_r2r (mm3, mm1); // add lows
- paddw_r2r (mm4, mm2); // add highs
-
- /* now have partials in mm1 and mm2 */
-
- movq_m2r (*src3, mm3); // load 8 src3 bytes
- movq_r2r (mm3, mm4); // copy 8 src3 bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low src3 bytes
- punpckhbw_r2r (mm0, mm4); // unpack high src3 bytes
-
- paddw_r2r (mm3, mm1); // add lows
- paddw_r2r (mm4, mm2); // add highs
-
- movq_m2r (*src4, mm5); // load 8 src4 bytes
- movq_r2r (mm5, mm6); // copy 8 src4 bytes
-
- punpcklbw_r2r (mm0, mm5); // unpack low src4 bytes
- punpckhbw_r2r (mm0, mm6); // unpack high src4 bytes
-
- paddw_r2r (mm5, mm1); // add lows
- paddw_r2r (mm6, mm2); // add highs
-
- paddw_m2r (round4, mm1);
- psraw_i2r (2, mm1); // /4
- paddw_m2r (round4, mm2);
- psraw_i2r (2, mm2); // /4
-
- /* now have subtotal/4 in mm1 and mm2 */
-
- movq_m2r (*dest, mm3); // load 8 dest bytes
- movq_r2r (mm3, mm4); // copy 8 dest bytes
-
- punpcklbw_r2r (mm0, mm3); // unpack low dest bytes
- punpckhbw_r2r (mm0, mm4); // unpack high dest bytes
-
- paddw_r2r (mm3, mm1); // add lows
- paddw_r2r (mm4, mm2); // add highs
-
- paddw_m2r (round1, mm1);
- psraw_i2r (1, mm1); // /2
- paddw_m2r (round1, mm2);
- psraw_i2r (1, mm2); // /2
-
- /* now have end value in mm1 and mm2 */
-
- packuswb_r2r (mm2, mm1); // pack (w/ saturation)
- movq_r2m (mm1,*dest); // store result in dest
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_avg_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- mmx_zero_reg ();
-
- do {
- mmx_average_2_U8 (dest, dest, ref);
-
- if (width == 16)
- mmx_average_2_U8 (dest+8, dest+8, ref+8);
-
- dest += stride;
- ref += stride;
- } while (--height);
-}
-
-static void MC_avg_o_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_avg_o_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_put_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- mmx_zero_reg ();
-
- do {
- movq_m2r (* ref, mm1); // load 8 ref bytes
- movq_r2m (mm1,* dest); // store 8 bytes at curr
-
- if (width == 16)
- {
- movq_m2r (* (ref+8), mm1); // load 8 ref bytes
- movq_r2m (mm1,* (dest+8)); // store 8 bytes at curr
- }
-
- dest += stride;
- ref += stride;
- } while (--height);
-}
-
-static void MC_put_o_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_put_o_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-/* Half pixel interpolation in the x direction */
-static inline void MC_avg_x_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- mmx_zero_reg ();
-
- do {
- mmx_interp_average_2_U8 (dest, ref, ref+1);
-
- if (width == 16)
- mmx_interp_average_2_U8 (dest+8, ref+8, ref+9);
-
- dest += stride;
- ref += stride;
- } while (--height);
-}
-
-static void MC_avg_x_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_x_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_avg_x_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_x_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_put_x_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- mmx_zero_reg ();
-
- do {
- mmx_average_2_U8 (dest, ref, ref+1);
-
- if (width == 16)
- mmx_average_2_U8 (dest+8, ref+8, ref+9);
-
- dest += stride;
- ref += stride;
- } while (--height);
-}
-
-static void MC_put_x_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_x_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_put_x_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_x_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_avg_xy_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- uint8_t * ref_next = ref+stride;
-
- mmx_zero_reg ();
-
- do {
- mmx_interp_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
-
- if (width == 16)
- mmx_interp_average_4_U8 (dest+8, ref+8, ref+9,
- ref_next+8, ref_next+9);
-
- dest += stride;
- ref += stride;
- ref_next += stride;
- } while (--height);
-}
-
-static void MC_avg_xy_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_xy_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_avg_xy_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_xy_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_put_xy_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- uint8_t * ref_next = ref+stride;
-
- mmx_zero_reg ();
-
- do {
- mmx_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
-
- if (width == 16)
- mmx_average_4_U8 (dest+8, ref+8, ref+9, ref_next+8, ref_next+9);
-
- dest += stride;
- ref += stride;
- ref_next += stride;
- } while (--height);
-}
-
-static void MC_put_xy_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_xy_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_put_xy_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_xy_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_avg_y_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- uint8_t * ref_next = ref+stride;
-
- mmx_zero_reg ();
-
- do {
- mmx_interp_average_2_U8 (dest, ref, ref_next);
-
- if (width == 16)
- mmx_interp_average_2_U8 (dest+8, ref+8, ref_next+8);
-
- dest += stride;
- ref += stride;
- ref_next += stride;
- } while (--height);
-}
-
-static void MC_avg_y_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_y_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_avg_y_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg_y_mmx (8, height, dest, ref, stride);
-}
-
-/*-----------------------------------------------------------------------*/
-
-static inline void MC_put_y_mmx (int width, int height,
- uint8_t * dest, uint8_t * ref, int stride)
-{
- uint8_t * ref_next = ref+stride;
-
- mmx_zero_reg ();
-
- do {
- mmx_average_2_U8 (dest, ref, ref_next);
-
- if (width == 16)
- mmx_average_2_U8 (dest+8, ref+8, ref_next+8);
-
- dest += stride;
- ref += stride;
- ref_next += stride;
- } while (--height);
-}
-
-static void MC_put_y_16_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_y_mmx (16, height, dest, ref, stride);
-}
-
-static void MC_put_y_8_mmx (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put_y_mmx (8, height, dest, ref, stride);
-}
-
-
-MPEG2_MC_EXTERN (mmx)
-
-
-
-
-
-
-
-/* CPU_MMXEXT/CPU_3DNOW adaptation layer */
-
-#define pavg_r2r(src,dest) \
-do { \
- if (cpu == CPU_MMXEXT) \
- pavgb_r2r (src, dest); \
- else \
- pavgusb_r2r (src, dest); \
-} while (0)
-
-#define pavg_m2r(src,dest) \
-do { \
- if (cpu == CPU_MMXEXT) \
- pavgb_m2r (src, dest); \
- else \
- pavgusb_m2r (src, dest); \
-} while (0)
-
-
-/* CPU_MMXEXT code */
-
-
-static inline void MC_put1_8 (int height, uint8_t * dest, uint8_t * ref,
- int stride)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_r2m (mm0, *dest);
- ref += stride;
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_put1_16 (int height, uint8_t * dest, uint8_t * ref,
- int stride)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+8), mm1);
- ref += stride;
- movq_r2m (mm0, *dest);
- movq_r2m (mm1, *(dest+8));
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_avg1_8 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- pavg_m2r (*dest, mm0);
- ref += stride;
- movq_r2m (mm0, *dest);
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_avg1_16 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+8), mm1);
- pavg_m2r (*dest, mm0);
- pavg_m2r (*(dest+8), mm1);
- movq_r2m (mm0, *dest);
- ref += stride;
- movq_r2m (mm1, *(dest+8));
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_put2_8 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int offset, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- pavg_m2r (*(ref+offset), mm0);
- ref += stride;
- movq_r2m (mm0, *dest);
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_put2_16 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int offset, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+8), mm1);
- pavg_m2r (*(ref+offset), mm0);
- pavg_m2r (*(ref+offset+8), mm1);
- movq_r2m (mm0, *dest);
- ref += stride;
- movq_r2m (mm1, *(dest+8));
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_avg2_8 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int offset, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- pavg_m2r (*(ref+offset), mm0);
- pavg_m2r (*dest, mm0);
- ref += stride;
- movq_r2m (mm0, *dest);
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_avg2_16 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int offset, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+8), mm1);
- pavg_m2r (*(ref+offset), mm0);
- pavg_m2r (*(ref+offset+8), mm1);
- pavg_m2r (*dest, mm0);
- pavg_m2r (*(dest+8), mm1);
- ref += stride;
- movq_r2m (mm0, *dest);
- movq_r2m (mm1, *(dest+8));
- dest += stride;
- } while (--height);
-}
-
-static mmx_t mask_one = {0x0101010101010101LL};
-
-static inline void MC_put4_8 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int cpu)
-{
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+1), mm1);
- movq_r2r (mm0, mm7);
- pxor_r2r (mm1, mm7);
- pavg_r2r (mm1, mm0);
- ref += stride;
-
- do {
- movq_m2r (*ref, mm2);
- movq_r2r (mm0, mm5);
-
- movq_m2r (*(ref+1), mm3);
- movq_r2r (mm2, mm6);
-
- pxor_r2r (mm3, mm6);
- pavg_r2r (mm3, mm2);
-
- por_r2r (mm6, mm7);
- pxor_r2r (mm2, mm5);
-
- pand_r2r (mm5, mm7);
- pavg_r2r (mm2, mm0);
-
- pand_m2r (mask_one, mm7);
-
- psubusb_r2r (mm7, mm0);
-
- ref += stride;
- movq_r2m (mm0, *dest);
- dest += stride;
-
- movq_r2r (mm6, mm7); // unroll !
- movq_r2r (mm2, mm0); // unroll !
- } while (--height);
-}
-
-static inline void MC_put4_16 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+stride+1), mm1);
- movq_r2r (mm0, mm7);
- movq_m2r (*(ref+1), mm2);
- pxor_r2r (mm1, mm7);
- movq_m2r (*(ref+stride), mm3);
- movq_r2r (mm2, mm6);
- pxor_r2r (mm3, mm6);
- pavg_r2r (mm1, mm0);
- pavg_r2r (mm3, mm2);
- por_r2r (mm6, mm7);
- movq_r2r (mm0, mm6);
- pxor_r2r (mm2, mm6);
- pand_r2r (mm6, mm7);
- pand_m2r (mask_one, mm7);
- pavg_r2r (mm2, mm0);
- psubusb_r2r (mm7, mm0);
- movq_r2m (mm0, *dest);
-
- movq_m2r (*(ref+8), mm0);
- movq_m2r (*(ref+stride+9), mm1);
- movq_r2r (mm0, mm7);
- movq_m2r (*(ref+9), mm2);
- pxor_r2r (mm1, mm7);
- movq_m2r (*(ref+stride+8), mm3);
- movq_r2r (mm2, mm6);
- pxor_r2r (mm3, mm6);
- pavg_r2r (mm1, mm0);
- pavg_r2r (mm3, mm2);
- por_r2r (mm6, mm7);
- movq_r2r (mm0, mm6);
- pxor_r2r (mm2, mm6);
- pand_r2r (mm6, mm7);
- pand_m2r (mask_one, mm7);
- pavg_r2r (mm2, mm0);
- psubusb_r2r (mm7, mm0);
- ref += stride;
- movq_r2m (mm0, *(dest+8));
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_avg4_8 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+stride+1), mm1);
- movq_r2r (mm0, mm7);
- movq_m2r (*(ref+1), mm2);
- pxor_r2r (mm1, mm7);
- movq_m2r (*(ref+stride), mm3);
- movq_r2r (mm2, mm6);
- pxor_r2r (mm3, mm6);
- pavg_r2r (mm1, mm0);
- pavg_r2r (mm3, mm2);
- por_r2r (mm6, mm7);
- movq_r2r (mm0, mm6);
- pxor_r2r (mm2, mm6);
- pand_r2r (mm6, mm7);
- pand_m2r (mask_one, mm7);
- pavg_r2r (mm2, mm0);
- psubusb_r2r (mm7, mm0);
- movq_m2r (*dest, mm1);
- pavg_r2r (mm1, mm0);
- ref += stride;
- movq_r2m (mm0, *dest);
- dest += stride;
- } while (--height);
-}
-
-static inline void MC_avg4_16 (int height, uint8_t * dest, uint8_t * ref,
- int stride, int cpu)
-{
- do {
- movq_m2r (*ref, mm0);
- movq_m2r (*(ref+stride+1), mm1);
- movq_r2r (mm0, mm7);
- movq_m2r (*(ref+1), mm2);
- pxor_r2r (mm1, mm7);
- movq_m2r (*(ref+stride), mm3);
- movq_r2r (mm2, mm6);
- pxor_r2r (mm3, mm6);
- pavg_r2r (mm1, mm0);
- pavg_r2r (mm3, mm2);
- por_r2r (mm6, mm7);
- movq_r2r (mm0, mm6);
- pxor_r2r (mm2, mm6);
- pand_r2r (mm6, mm7);
- pand_m2r (mask_one, mm7);
- pavg_r2r (mm2, mm0);
- psubusb_r2r (mm7, mm0);
- movq_m2r (*dest, mm1);
- pavg_r2r (mm1, mm0);
- movq_r2m (mm0, *dest);
-
- movq_m2r (*(ref+8), mm0);
- movq_m2r (*(ref+stride+9), mm1);
- movq_r2r (mm0, mm7);
- movq_m2r (*(ref+9), mm2);
- pxor_r2r (mm1, mm7);
- movq_m2r (*(ref+stride+8), mm3);
- movq_r2r (mm2, mm6);
- pxor_r2r (mm3, mm6);
- pavg_r2r (mm1, mm0);
- pavg_r2r (mm3, mm2);
- por_r2r (mm6, mm7);
- movq_r2r (mm0, mm6);
- pxor_r2r (mm2, mm6);
- pand_r2r (mm6, mm7);
- pand_m2r (mask_one, mm7);
- pavg_r2r (mm2, mm0);
- psubusb_r2r (mm7, mm0);
- movq_m2r (*(dest+8), mm1);
- pavg_r2r (mm1, mm0);
- ref += stride;
- movq_r2m (mm0, *(dest+8));
- dest += stride;
- } while (--height);
-}
-
-static void MC_avg_o_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg1_16 (height, dest, ref, stride, CPU_MMXEXT);
-}
-
-static void MC_avg_o_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg1_8 (height, dest, ref, stride, CPU_MMXEXT);
-}
-
-static void MC_put_o_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put1_16 (height, dest, ref, stride);
-}
-
-static void MC_put_o_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put1_8 (height, dest, ref, stride);
-}
-
-static void MC_avg_x_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
-}
-
-static void MC_avg_x_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
-}
-
-static void MC_put_x_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
-}
-
-static void MC_put_x_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
-}
-
-static void MC_avg_y_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
-}
-
-static void MC_avg_y_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
-}
-
-static void MC_put_y_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
-}
-
-static void MC_put_y_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
-}
-
-static void MC_avg_xy_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg4_16 (height, dest, ref, stride, CPU_MMXEXT);
-}
-
-static void MC_avg_xy_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg4_8 (height, dest, ref, stride, CPU_MMXEXT);
-}
-
-static void MC_put_xy_16_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put4_16 (height, dest, ref, stride, CPU_MMXEXT);
-}
-
-static void MC_put_xy_8_mmxext (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put4_8 (height, dest, ref, stride, CPU_MMXEXT);
-}
-
-
-MPEG2_MC_EXTERN (mmxext)
-
-
-
-static void MC_avg_o_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg1_16 (height, dest, ref, stride, CPU_3DNOW);
-}
-
-static void MC_avg_o_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg1_8 (height, dest, ref, stride, CPU_3DNOW);
-}
-
-static void MC_put_o_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put1_16 (height, dest, ref, stride);
-}
-
-static void MC_put_o_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put1_8 (height, dest, ref, stride);
-}
-
-static void MC_avg_x_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
-}
-
-static void MC_avg_x_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_8 (height, dest, ref, stride, 1, CPU_3DNOW);
-}
-
-static void MC_put_x_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
-}
-
-static void MC_put_x_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_8 (height, dest, ref, stride, 1, CPU_3DNOW);
-}
-
-static void MC_avg_y_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_16 (height, dest, ref, stride, stride, CPU_3DNOW);
-}
-
-static void MC_avg_y_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg2_8 (height, dest, ref, stride, stride, CPU_3DNOW);
-}
-
-static void MC_put_y_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_16 (height, dest, ref, stride, stride, CPU_3DNOW);
-}
-
-static void MC_put_y_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put2_8 (height, dest, ref, stride, stride, CPU_3DNOW);
-}
-
-static void MC_avg_xy_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg4_16 (height, dest, ref, stride, CPU_3DNOW);
-}
-
-static void MC_avg_xy_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_avg4_8 (height, dest, ref, stride, CPU_3DNOW);
-}
-
-static void MC_put_xy_16_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put4_16 (height, dest, ref, stride, CPU_3DNOW);
-}
-
-static void MC_put_xy_8_3dnow (uint8_t * dest, uint8_t * ref,
- int stride, int height)
-{
- MC_put4_8 (height, dest, ref, stride, CPU_3DNOW);
-}
-
-
-MPEG2_MC_EXTERN (3dnow)
-
-#endif
diff --git a/src/libmpeg2/mpeg2_internal.h b/src/libmpeg2/mpeg2_internal.h
deleted file mode 100644
index 345e73080..000000000
--- a/src/libmpeg2/mpeg2_internal.h
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * mpeg2_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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef MPEG2_INTERNAL_H
-#define MPEG2_INTERNAL_H
-
-#include "video_out.h"
-#include "accel_xvmc.h"
-
-#ifdef ENABLE_ALTIVEC
-#include <altivec.h>
-#endif
-
-/* macroblock modes */
-#define MACROBLOCK_INTRA XINE_MACROBLOCK_INTRA
-#define MACROBLOCK_PATTERN XINE_MACROBLOCK_PATTERN
-#define MACROBLOCK_MOTION_BACKWARD XINE_MACROBLOCK_MOTION_BACKWARD
-#define MACROBLOCK_MOTION_FORWARD XINE_MACROBLOCK_MOTION_FORWARD
-#define MACROBLOCK_QUANT XINE_MACROBLOCK_QUANT
-#define DCT_TYPE_INTERLACED XINE_MACROBLOCK_DCT_TYPE_INTERLACED
-
-/* motion_type */
-#define MOTION_TYPE_MASK (3*64)
-#define MOTION_TYPE_BASE 64
-#define MC_FIELD (1*64)
-#define MC_FRAME (2*64)
-#define MC_16X8 (2*64)
-#define MC_DMV (3*64)
-
-/* picture structure */
-#define TOP_FIELD VO_TOP_FIELD
-#define BOTTOM_FIELD VO_BOTTOM_FIELD
-#define FRAME_PICTURE VO_BOTH_FIELDS
-
-/* picture coding type (mpeg2 header) */
-#define I_TYPE 1
-#define P_TYPE 2
-#define B_TYPE 3
-#define D_TYPE 4
-
-typedef struct motion_s {
- uint8_t * ref[2][3];
- uint8_t ** ref2[2];
- int pmv[2][2];
- int f_code[2];
-} motion_t;
-
-typedef struct picture_s {
- /* first, state that carries information from one macroblock to the */
- /* next inside a slice, and is never used outside of mpeg2_slice() */
-
- /* DCT coefficients - should be kept aligned ! */
- int16_t DCTblock[64];
-
- /* XvMC DCT block and macroblock data for XvMC acceleration */
- xine_macroblocks_t *mc;
- int XvMC_mb_type;
- int XvMC_mv_field_sel[2][2];
- int XvMC_x;
- int XvMC_y;
- int XvMC_motion_type;
- int XvMC_dmvector[2];
- int XvMC_cbp;
- int XvMC_dct_type;
-
- /* bit parsing stuff */
- uint32_t bitstream_buf; /* current 32 bit working set of buffer */
- int bitstream_bits; /* used bits in working set */
- uint8_t * bitstream_ptr; /* buffer with stream data */
-
- uint8_t * dest[3];
- int pitches[3];
- int offset;
- unsigned int limit_x;
- unsigned int limit_y_16;
- unsigned int limit_y_8;
- unsigned int limit_y;
-
- /* Motion vectors */
- /* The f_ and b_ correspond to the forward and backward motion */
- /* predictors */
- motion_t b_motion;
- motion_t f_motion;
-
- /* predictor for DC coefficients in intra blocks */
- int16_t dc_dct_pred[3];
-
- int quantizer_scale; /* remove */
- int current_field; /* remove */
- int dmv_offset; /* remove */
- unsigned int v_offset; /* remove */
-
-
- /* now non-slice-specific information */
-
- /* sequence header stuff */
- uint8_t intra_quantizer_matrix [64];
- uint8_t non_intra_quantizer_matrix [64];
- int load_intra_quantizer_matrix;
- int load_non_intra_quantizer_matrix;
-
- /* The width and height of the picture snapped to macroblock units */
- int coded_picture_width;
- int coded_picture_height;
-
- /* The width and height as it appears on header sequence */
- unsigned int display_width, display_height;
-
- /* picture header stuff */
-
- /* what type of picture this is (I, P, B, D) */
- int picture_coding_type;
-
- int vbv_delay;
- int low_delay;
-
- /* picture coding extension stuff */
-
- /* quantization factor for intra dc coefficients */
- int intra_dc_precision;
- /* top/bottom/both fields */
- int picture_structure;
- /* bool to indicate all predictions are frame based */
- int frame_pred_frame_dct;
- /* bool to indicate whether intra blocks have motion vectors */
- /* (for concealment) */
- int concealment_motion_vectors;
- /* bit to indicate which quantization table to use */
- int q_scale_type;
- /* bool to use different vlc tables */
- int intra_vlc_format;
- /* used for DMV MC */
- int top_field_first;
-
- /* stuff derived from bitstream */
-
- /* pointer to the zigzag scan we're supposed to be using */
- uint8_t * scan;
-
- struct vo_frame_s * current_frame;
- struct vo_frame_s * forward_reference_frame;
- struct vo_frame_s * backward_reference_frame;
-
- int frame_width, frame_height;
-
- int second_field;
-
- int mpeg1;
-
- int skip_non_intra_dct;
-
- /* these things are not needed by the decoder */
- /* this is a temporary interface, we will build a better one later. */
- int aspect_ratio_information;
- int saved_aspect_ratio;
- int frame_rate_code;
- int progressive_sequence;
- int repeat_first_field;
- int progressive_frame;
- int32_t frame_centre_horizontal_offset;
- int32_t frame_centre_vertical_offset;
- uint32_t video_format;
- uint32_t colour_description;
- uint32_t colour_primatives;
- uint32_t transfer_characteristics;
- uint32_t matrix_coefficients;
- uint32_t display_horizontal_size;
- uint32_t display_vertical_size;
- uint32_t drop_frame_flag;
- uint32_t time_code_hours;
- uint32_t time_code_minutes;
- uint32_t time_code_seconds;
- uint32_t time_code_pictures;
- uint32_t closed_gop;
- uint32_t broken_link;
-
- int bitrate;
- int frame_rate_ext_n;
- int frame_rate_ext_d;
-
-} picture_t;
-
-typedef struct cpu_state_s {
-#ifdef ARCH_PPC
- uint8_t regv[12*16];
-#endif
- int dummy;
-} cpu_state_t;
-
-/* cpu_state.c */
-extern void (* mpeg2_cpu_state_save) (cpu_state_t * state);
-extern void (* mpeg2_cpu_state_restore) (cpu_state_t * state);
-void mpeg2_cpu_state_init (uint32_t mm_accel);
-
-/* header.c */
-extern uint8_t mpeg2_scan_norm[64];
-extern uint8_t mpeg2_scan_alt[64];
-void mpeg2_header_state_init (picture_t * picture);
-int mpeg2_header_picture (picture_t * picture, uint8_t * buffer);
-int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer);
-int mpeg2_header_extension (picture_t * picture, uint8_t * buffer);
-int mpeg2_header_group_of_pictures (picture_t * picture, uint8_t * buffer);
-
-/* idct.c */
-extern void (* mpeg2_idct_copy) (int16_t * block, uint8_t * dest, int stride);
-extern void (* mpeg2_idct_add) (int16_t * block, uint8_t * dest, int stride);
-extern void (* mpeg2_idct) (int16_t * block);
-extern void (* mpeg2_zero_block) (int16_t * block);
-void mpeg2_idct_init (uint32_t mm_accel);
-
-/* idct_mlib.c */
-void mpeg2_idct_add_mlib (int16_t * block, uint8_t * dest, int stride);
-void mpeg2_idct_copy_mlib_non_ieee (int16_t * block, uint8_t * dest,
- int stride);
-void mpeg2_idct_add_mlib_non_ieee (int16_t * block, uint8_t * dest,
- int stride);
-void mpeg2_idct_mlib (int16_t * block);
-
-/* idct_mmx.c */
-void mpeg2_idct_copy_mmxext (int16_t * block, uint8_t * dest, int stride);
-void mpeg2_idct_add_mmxext (int16_t * block, uint8_t * dest, int stride);
-void mpeg2_idct_mmxext (int16_t * block);
-void mpeg2_idct_copy_mmx (int16_t * block, uint8_t * dest, int stride);
-void mpeg2_idct_add_mmx (int16_t * block, uint8_t * dest, int stride);
-void mpeg2_idct_mmx (int16_t * block);
-void mpeg2_zero_block_mmx (int16_t * block);
-void mpeg2_idct_mmx_init (void);
-
-/* idct_altivec.c */
-# ifdef ENABLE_ALTIVEC
-void mpeg2_idct_copy_altivec (vector signed short * block, unsigned char * dest,
- int stride);
-void mpeg2_idct_add_altivec (vector signed short * block, unsigned char * dest,
- int stride);
-# else /* ! ENABLE_ALTIVEC */
-void mpeg2_idct_copy_altivec (signed short * block, unsigned char * dest,
- int stride);
-void mpeg2_idct_add_altivec (signed short * block, unsigned char * dest,
- int stride);
-# endif /* ENABLE_ALTIVEC */
-void mpeg2_idct_altivec_init (void);
-
-/* motion_comp.c */
-void mpeg2_mc_init (uint32_t mm_accel);
-
-typedef struct mpeg2_mc_s {
- void (* put [8]) (uint8_t * dst, uint8_t *, int32_t, int32_t);
- void (* avg [8]) (uint8_t * dst, uint8_t *, int32_t, int32_t);
-} mpeg2_mc_t;
-
-#define MPEG2_MC_EXTERN(x) mpeg2_mc_t mpeg2_mc_##x = { \
- {MC_put_o_16_##x, MC_put_x_16_##x, MC_put_y_16_##x, MC_put_xy_16_##x, \
- MC_put_o_8_##x, MC_put_x_8_##x, MC_put_y_8_##x, MC_put_xy_8_##x}, \
- {MC_avg_o_16_##x, MC_avg_x_16_##x, MC_avg_y_16_##x, MC_avg_xy_16_##x, \
- MC_avg_o_8_##x, MC_avg_x_8_##x, MC_avg_y_8_##x, MC_avg_xy_8_##x} \
-};
-
-extern mpeg2_mc_t mpeg2_mc;
-extern mpeg2_mc_t mpeg2_mc_c;
-extern mpeg2_mc_t mpeg2_mc_mmx;
-extern mpeg2_mc_t mpeg2_mc_mmxext;
-extern mpeg2_mc_t mpeg2_mc_3dnow;
-extern mpeg2_mc_t mpeg2_mc_altivec;
-extern mpeg2_mc_t mpeg2_mc_mlib;
-extern mpeg2_mc_t mpeg2_mc_vis;
-
-/* slice.c */
-void mpeg2_slice (picture_t * picture, int code, uint8_t * buffer);
-
-/* stats.c */
-void mpeg2_stats (int code, uint8_t * buffer);
-
-
-#endif
diff --git a/src/libmpeg2/slice.c b/src/libmpeg2/slice.c
deleted file mode 100644
index 91a4c47b1..000000000
--- a/src/libmpeg2/slice.c
+++ /dev/null
@@ -1,1833 +0,0 @@
-/*
- * slice.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 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 "xine_internal.h"
-#include "video_out.h"
-#include "mpeg2_internal.h"
-#include "attributes.h"
-
-#include "vlc.h"
-
-static const int non_linear_quantizer_scale [] = {
- 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
-};
-
-static inline int get_macroblock_modes (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int macroblock_modes;
- const MBtab * tab;
-
- switch (picture->picture_coding_type) {
- case I_TYPE:
-
- tab = MB_I + UBITS (bit_buf, 1);
- DUMPBITS (bit_buf, bits, tab->len);
- macroblock_modes = tab->modes;
-
- if ((! (picture->frame_pred_frame_dct)) &&
- (picture->picture_structure == FRAME_PICTURE)) {
- macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
- DUMPBITS (bit_buf, bits, 1);
- }
-
- return macroblock_modes;
-
- case P_TYPE:
-
- tab = MB_P + UBITS (bit_buf, 5);
- DUMPBITS (bit_buf, bits, tab->len);
- macroblock_modes = tab->modes;
-
- if (picture->picture_structure != FRAME_PICTURE) {
- if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- }
- return macroblock_modes;
- } else if (picture->frame_pred_frame_dct) {
- if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
- macroblock_modes |= MC_FRAME;
- return macroblock_modes;
- } else {
- if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- }
- if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
- macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
- DUMPBITS (bit_buf, bits, 1);
- }
- return macroblock_modes;
- }
-
- case B_TYPE:
-
- tab = MB_B + UBITS (bit_buf, 6);
- DUMPBITS (bit_buf, bits, tab->len);
- macroblock_modes = tab->modes;
-
- if (picture->picture_structure != FRAME_PICTURE) {
- if (! (macroblock_modes & MACROBLOCK_INTRA)) {
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- }
- return macroblock_modes;
- } else if (picture->frame_pred_frame_dct) {
- /* if (! (macroblock_modes & MACROBLOCK_INTRA)) */
- macroblock_modes |= MC_FRAME;
- return macroblock_modes;
- } else {
- if (macroblock_modes & MACROBLOCK_INTRA)
- goto intra;
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
- intra:
- macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
- DUMPBITS (bit_buf, bits, 1);
- }
- return macroblock_modes;
- }
-
- case D_TYPE:
-
- DUMPBITS (bit_buf, bits, 1);
- return MACROBLOCK_INTRA;
-
- default:
- return 0;
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_quantizer_scale (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- int quantizer_scale_code;
-
- quantizer_scale_code = UBITS (bit_buf, 5);
- DUMPBITS (bit_buf, bits, 5);
-
- if (picture->q_scale_type)
- return non_linear_quantizer_scale [quantizer_scale_code];
- else
- return quantizer_scale_code << 1;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_motion_delta (picture_t * picture, int f_code)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- int delta;
- int sign;
- const MVtab * tab;
-
- if (bit_buf & 0x80000000) {
- DUMPBITS (bit_buf, bits, 1);
- return 0;
- } else if (bit_buf >= 0x0c000000) {
-
- tab = MV_4 + UBITS (bit_buf, 4);
- delta = (tab->delta << f_code) + 1;
- bits += tab->len + f_code + 1;
- bit_buf <<= tab->len;
-
- sign = SBITS (bit_buf, 1);
- bit_buf <<= 1;
-
- if (f_code)
- delta += UBITS (bit_buf, f_code);
- bit_buf <<= f_code;
-
- return (delta ^ sign) - sign;
-
- } else {
-
- tab = MV_10 + UBITS (bit_buf, 10);
- delta = (tab->delta << f_code) + 1;
- bits += tab->len + 1;
- bit_buf <<= tab->len;
-
- sign = SBITS (bit_buf, 1);
- bit_buf <<= 1;
-
- if (f_code) {
- NEEDBITS (bit_buf, bits, bit_ptr);
- delta += UBITS (bit_buf, f_code);
- DUMPBITS (bit_buf, bits, f_code);
- }
-
- return (delta ^ sign) - sign;
-
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int bound_motion_vector (int vec, int f_code)
-{
-#if 1
- unsigned int limit;
- int sign;
-
- limit = 16 << f_code;
-
- if ((unsigned int)(vec + limit) < 2 * limit)
- return vec;
- else {
- sign = ((int32_t)vec) >> 31;
- return vec - ((2 * limit) ^ sign) + sign;
- }
-#else
- return ((int32_t)vector << (27 - f_code)) >> (27 - f_code);
-#endif
-}
-
-static inline int get_dmv (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- const DMVtab * tab;
-
- tab = DMV_2 + UBITS (bit_buf, 2);
- DUMPBITS (bit_buf, bits, tab->len);
- return tab->dmv;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_coded_block_pattern (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- const CBPtab * tab;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- if (bit_buf >= 0x20000000) {
-
- tab = CBP_7 + (UBITS (bit_buf, 7) - 16);
- DUMPBITS (bit_buf, bits, tab->len);
- return tab->cbp;
-
- } else {
-
- tab = CBP_9 + UBITS (bit_buf, 9);
- DUMPBITS (bit_buf, bits, tab->len);
- return tab->cbp;
- }
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_luma_dc_dct_diff (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- const DCtab * tab;
- int size;
- int dc_diff;
-
- if (bit_buf < 0xf8000000) {
- tab = DC_lum_5 + UBITS (bit_buf, 5);
- size = tab->size;
- if (size) {
- bits += tab->len + size;
- bit_buf <<= tab->len;
- dc_diff =
- UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- bit_buf <<= size;
- return dc_diff;
- } else {
- DUMPBITS (bit_buf, bits, 3);
- return 0;
- }
- } else {
- tab = DC_long + (UBITS (bit_buf, 9) - 0x1e0);
- size = tab->size;
- DUMPBITS (bit_buf, bits, tab->len);
- NEEDBITS (bit_buf, bits, bit_ptr);
- dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- DUMPBITS (bit_buf, bits, size);
- return dc_diff;
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_chroma_dc_dct_diff (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- const DCtab * tab;
- int size;
- int dc_diff;
-
- if (bit_buf < 0xf8000000) {
- tab = DC_chrom_5 + UBITS (bit_buf, 5);
- size = tab->size;
- if (size) {
- bits += tab->len + size;
- bit_buf <<= tab->len;
- dc_diff =
- UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- bit_buf <<= size;
- return dc_diff;
- } else {
- DUMPBITS (bit_buf, bits, 2);
- return 0;
- }
- } else {
- tab = DC_long + (UBITS (bit_buf, 10) - 0x3e0);
- size = tab->size;
- DUMPBITS (bit_buf, bits, tab->len + 1);
- NEEDBITS (bit_buf, bits, bit_ptr);
- dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- DUMPBITS (bit_buf, bits, size);
- return dc_diff;
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-#define SATURATE(val) \
-do { \
- if ((uint32_t)(val + 2048) > 4095) \
- val = (val > 0) ? 2047 : -2048; \
-} while (0)
-
-static void get_intra_block_B14 (picture_t * picture)
-{
- int i;
- int j;
- int val;
- uint8_t * scan = picture->scan;
- uint8_t * quant_matrix = picture->intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- int mismatch;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- dest = picture->DCTblock;
- i = 0;
- mismatch = ~dest[0];
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- j = scan[i];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = (tab->level * quantizer_scale * quant_matrix[j]) >> 4;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- j = scan[i];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = (SBITS (bit_buf, 12) *
- quantizer_scale * quant_matrix[j]) / 16;
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- dest[63] ^= mismatch & 1;
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_intra_block_B15 (picture_t * picture)
-{
- int i;
- int j;
- int val;
- uint8_t * scan = picture->scan;
- uint8_t * quant_matrix = picture->intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- int mismatch;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- dest = picture->DCTblock;
- i = 0;
- mismatch = ~dest[0];
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- while (1) {
- if (bit_buf >= 0x04000000) {
-
- tab = DCT_B15_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64) {
-
- normal_code:
- j = scan[i];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = (tab->level * quantizer_scale * quant_matrix[j]) >> 4;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else {
-
- /* end of block. I commented out this code because if we */
- /* dont exit here we will still exit at the later test :) */
-
- /* if (i >= 128) break; */ /* end of block */
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check against buffer overflow */
-
- j = scan[i];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = (SBITS (bit_buf, 12) *
- quantizer_scale * quant_matrix[j]) / 16;
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- }
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B15_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- dest[63] ^= mismatch & 1;
- DUMPBITS (bit_buf, bits, 4); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_non_intra_block (picture_t * picture)
-{
- int i;
- int j;
- int val;
- uint8_t * scan = picture->scan;
- uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- int mismatch;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- i = -1;
- mismatch = 1;
- dest = picture->DCTblock;
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- if (bit_buf >= 0x28000000) {
- tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
- goto entry_1;
- } else
- goto entry_2;
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- entry_1:
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- j = scan[i];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = ((2*tab->level+1) * quantizer_scale * quant_matrix[j]) >> 5;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- }
-
- entry_2:
- if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- j = scan[i];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = 2 * (SBITS (bit_buf, 12) + SBITS (bit_buf, 1)) + 1;
- val = (val * quantizer_scale * quant_matrix[j]) / 32;
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- dest[63] ^= mismatch & 1;
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_mpeg1_intra_block (picture_t * picture)
-{
- int i;
- int j;
- int val;
- uint8_t * scan = picture->scan;
- uint8_t * quant_matrix = picture->intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- i = 0;
- dest = picture->DCTblock;
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- j = scan[i];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = (tab->level * quantizer_scale * quant_matrix[j]) >> 4;
-
- /* oddification */
- val = (val - 1) | 1;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- j = scan[i];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = SBITS (bit_buf, 8);
- if (! (val & 0x7f)) {
- DUMPBITS (bit_buf, bits, 8);
- val = UBITS (bit_buf, 8) + 2 * val;
- }
- val = (val * quantizer_scale * quant_matrix[j]) / 16;
-
- /* oddification */
- val = (val + ~SBITS (val, 1)) | 1;
-
- SATURATE (val);
- dest[j] = val;
-
- DUMPBITS (bit_buf, bits, 8);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_mpeg1_non_intra_block (picture_t * picture)
-{
- int i;
- int j;
- int val;
- uint8_t * scan = picture->scan;
- uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- i = -1;
- dest = picture->DCTblock;
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- if (bit_buf >= 0x28000000) {
- tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
- goto entry_1;
- } else
- goto entry_2;
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- entry_1:
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- j = scan[i];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = ((2*tab->level+1) * quantizer_scale * quant_matrix[j]) >> 5;
-
- /* oddification */
- val = (val - 1) | 1;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- }
-
- entry_2:
- if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- j = scan[i];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = SBITS (bit_buf, 8);
- if (! (val & 0x7f)) {
- DUMPBITS (bit_buf, bits, 8);
- val = UBITS (bit_buf, 8) + 2 * val;
- }
- val = 2 * (val + SBITS (val, 1)) + 1;
- val = (val * quantizer_scale * quant_matrix[j]) / 32;
-
- /* oddification */
- val = (val + ~SBITS (val, 1)) | 1;
-
- SATURATE (val);
- dest[j] = val;
-
- DUMPBITS (bit_buf, bits, 8);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static inline void slice_intra_DCT (picture_t * picture, int cc,
- uint8_t * dest, int stride)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- NEEDBITS (bit_buf, bits, bit_ptr);
- /* Get the intra DC coefficient and inverse quantize it */
- if (cc == 0)
- picture->dc_dct_pred[0] += get_luma_dc_dct_diff (picture);
- else
- picture->dc_dct_pred[cc] += get_chroma_dc_dct_diff (picture);
- picture->DCTblock[0] =
- picture->dc_dct_pred[cc] << (3 - picture->intra_dc_precision);
-
- if (picture->mpeg1) {
- if (picture->picture_coding_type != D_TYPE)
- get_mpeg1_intra_block (picture);
- } else if (picture->intra_vlc_format)
- get_intra_block_B15 (picture);
- else
- get_intra_block_B14 (picture);
- mpeg2_idct_copy (picture->DCTblock, dest, stride);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline void slice_non_intra_DCT (picture_t * picture, uint8_t * dest,
- int stride)
-{
- if (picture->mpeg1)
- get_mpeg1_non_intra_block (picture);
- else
- get_non_intra_block (picture);
- mpeg2_idct_add (picture->DCTblock, dest, stride);
-}
-
-#define MOTION(table,ref,motion_x,motion_y,size,y) \
- pos_x = 2 * picture->offset + motion_x; \
- pos_y = 2 * picture->v_offset + motion_y + 2 * y; \
- if (pos_x > picture->limit_x) { \
- pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x; \
- motion_x = pos_x - 2 * picture->offset; \
- } \
- if (pos_y > picture->limit_y_ ## size){ \
- pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y_ ## size; \
- motion_y = pos_y - 2 * picture->v_offset - 2 * y; \
- } \
- xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \
- table[xy_half] (picture->dest[0] + y * picture->pitches[0] + \
- picture->offset, ref[0] + (pos_x >> 1) + \
- (pos_y >> 1) * picture->pitches[0], picture->pitches[0], \
- size); \
- motion_x /= 2; motion_y /= 2; \
- xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \
- table[4+xy_half] (picture->dest[1] + y/2 * picture->pitches[1] + \
- (picture->offset >> 1), ref[1] + \
- (((picture->offset + motion_x) >> 1) + \
- ((((picture->v_offset + motion_y) >> 1) + y/2) * \
- picture->pitches[1])), picture->pitches[1], size/2); \
- table[4+xy_half] (picture->dest[2] + y/2 * picture->pitches[2] + \
- (picture->offset >> 1), ref[2] + \
- (((picture->offset + motion_x) >> 1) + \
- ((((picture->v_offset + motion_y) >> 1) + y/2) * \
- picture->pitches[2])), picture->pitches[2], size/2) \
-
-#define MOTION_FIELD(table,ref,motion_x,motion_y,dest_field,op,src_field) \
- pos_x = 2 * picture->offset + motion_x; \
- pos_y = picture->v_offset + motion_y; \
- if (pos_x > picture->limit_x) { \
- pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x; \
- motion_x = pos_x - 2 * picture->offset; \
- } \
- if (pos_y > picture->limit_y){ \
- pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y; \
- motion_y = pos_y - picture->v_offset; \
- } \
- xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \
- table[xy_half] (picture->dest[0] + dest_field * picture->pitches[0] + \
- picture->offset, \
- (ref[0] + (pos_x >> 1) + \
- ((pos_y op) + src_field) * picture->pitches[0]), \
- 2 * picture->pitches[0], 8); \
- motion_x /= 2; motion_y /= 2; \
- xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \
- table[4+xy_half] (picture->dest[1] + dest_field * picture->pitches[1] + \
- (picture->offset >> 1), ref[1] + \
- (((picture->offset + motion_x) >> 1) + \
- (((picture->v_offset >> 1) + \
- (motion_y op) + src_field) * picture->pitches[1])), \
- 2 * picture->pitches[1], 4); \
- table[4+xy_half] (picture->dest[2] + dest_field * picture->pitches[2] + \
- (picture->offset >> 1), ref[2] + \
- (((picture->offset + motion_x) >> 1) + \
- (((picture->v_offset >> 1) + \
- (motion_y op) + src_field) * picture->pitches[2])), \
- 2 * picture->pitches[2], 4)
-
-static void motion_mp1 (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
- unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = (motion->pmv[0][0] +
- (get_motion_delta (picture,
- motion->f_code[0]) << motion->f_code[1]));
- motion_x = bound_motion_vector (motion_x,
- motion->f_code[0] + motion->f_code[1]);
- motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = (motion->pmv[0][1] +
- (get_motion_delta (picture,
- motion->f_code[0]) << motion->f_code[1]));
- motion_y = bound_motion_vector (motion_y,
- motion->f_code[0] + motion->f_code[1]);
- motion->pmv[0][1] = motion_y;
-
- MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fr_frame (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
- unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = motion->pmv[0][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[0][1] + get_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
-
- MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fr_field (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y, field;
- unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- field = UBITS (bit_buf, 1);
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[0][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = (motion->pmv[0][1] >> 1) + get_motion_delta (picture,
- motion->f_code[1]);
- /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
- motion->pmv[0][1] = motion_y << 1;
-
- MOTION_FIELD (table, motion->ref[0], motion_x, motion_y, 0, & ~1, field);
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- field = UBITS (bit_buf, 1);
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[1][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = (motion->pmv[1][1] >> 1) + get_motion_delta (picture,
- motion->f_code[1]);
- /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
- motion->pmv[1][1] = motion_y << 1;
-
- MOTION_FIELD (table, motion->ref[0], motion_x, motion_y, 1, & ~1, field);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fr_dmv (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y, dmv_x, dmv_y, m, other_x, other_y;
- unsigned int pos_x, pos_y, xy_half, offset;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = motion->pmv[0][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
- NEEDBITS (bit_buf, bits, bit_ptr);
- dmv_x = get_dmv (picture);
-
- motion_y = (motion->pmv[0][1] >> 1) + get_motion_delta (picture,
- motion->f_code[1]);
- /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y << 1;
- dmv_y = get_dmv (picture);
-
- m = picture->top_field_first ? 1 : 3;
- other_x = ((motion_x * m + (motion_x > 0)) >> 1) + dmv_x;
- other_y = ((motion_y * m + (motion_y > 0)) >> 1) + dmv_y - 1;
- MOTION_FIELD (mpeg2_mc.put, motion->ref[0], other_x, other_y, 0, | 1, 0);
-
- m = picture->top_field_first ? 3 : 1;
- other_x = ((motion_x * m + (motion_x > 0)) >> 1) + dmv_x;
- other_y = ((motion_y * m + (motion_y > 0)) >> 1) + dmv_y + 1;
- MOTION_FIELD (mpeg2_mc.put, motion->ref[0], other_x, other_y, 1, & ~1, 0);
-
- pos_x = 2 * picture->offset + motion_x;
- pos_y = picture->v_offset + motion_y;
- if(pos_x > picture->limit_x){
- pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x;
- motion_x = pos_x - 2 * picture->offset;
- }
- if(pos_y > picture->limit_y){
- pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y;
- motion_y = pos_y - picture->v_offset;
- }
- xy_half = ((pos_y & 1) << 1) | (pos_x & 1);
- offset = (pos_x >> 1) + (pos_y & ~1) * picture->pitches[0];
- mpeg2_mc.avg[xy_half]
- (picture->dest[0] + picture->offset,
- motion->ref[0][0] + offset, 2 * picture->pitches[0], 8);
- mpeg2_mc.avg[xy_half]
- (picture->dest[0] + picture->pitches[0] + picture->offset,
- motion->ref[0][0] + picture->pitches[0] + offset,
- 2 * picture->pitches[0], 8);
- motion_x /= 2; motion_y /= 2;
- xy_half = ((motion_y & 1) << 1) | (motion_x & 1);
- offset = (((picture->offset + motion_x) >> 1) +
- (((picture->v_offset >> 1) + (motion_y & ~1)) *
- picture->pitches[1]));
- mpeg2_mc.avg[4+xy_half]
- (picture->dest[1] + (picture->offset >> 1),
- motion->ref[0][1] + offset, 2 * picture->pitches[1], 4);
- mpeg2_mc.avg[4+xy_half]
- (picture->dest[1] + picture->pitches[1] + (picture->offset >> 1),
- motion->ref[0][1] + picture->pitches[1] + offset,
- 2 * picture->pitches[1], 4);
- offset = (((picture->offset + motion_x) >> 1) +
- (((picture->v_offset >> 1) + (motion_y & ~1)) *
- picture->pitches[2]));
- mpeg2_mc.avg[4+xy_half]
- (picture->dest[2] + (picture->offset >> 1),
- motion->ref[0][2] + offset, 2 * picture->pitches[2], 4);
- mpeg2_mc.avg[4+xy_half]
- (picture->dest[2] + picture->pitches[2] + (picture->offset >> 1),
- motion->ref[0][2] + picture->pitches[2] + offset,
- 2 * picture->pitches[2], 4);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_reuse (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
- int motion_x, motion_y;
- unsigned int pos_x, pos_y, xy_half;
-
- motion_x = motion->pmv[0][0];
- motion_y = motion->pmv[0][1];
-
- MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0);
-}
-
-static void motion_zero (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
- table[0] (picture->dest[0] + picture->offset,
- (motion->ref[0][0] + picture->offset +
- picture->v_offset * picture->pitches[0]),
- picture->pitches[0], 16);
-
- table[4] (picture->dest[1] + (picture->offset >> 1),
- motion->ref[0][1] + (picture->offset >> 1) +
- (picture->v_offset >> 1) * picture->pitches[1],
- picture->pitches[1], 8);
- table[4] (picture->dest[2] + (picture->offset >> 1),
- motion->ref[0][2] + (picture->offset >> 1) +
- (picture->v_offset >> 1) * picture->pitches[2],
- picture->pitches[2], 8);
-}
-
-/* like motion_frame, but parsing without actual motion compensation */
-static void motion_fr_conceal (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- tmp = (picture->f_motion.pmv[0][0] +
- get_motion_delta (picture, picture->f_motion.f_code[0]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- tmp = (picture->f_motion.pmv[0][1] +
- get_motion_delta (picture, picture->f_motion.f_code[1]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
- picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
-
- DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_field (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
- uint8_t ** ref_field;
- unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- ref_field = motion->ref2[UBITS (bit_buf, 1)];
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[0][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[0][1] + get_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
-
- MOTION (table, ref_field, motion_x, motion_y, 16, 0);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_16x8 (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
- uint8_t ** ref_field;
- unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- ref_field = motion->ref2[UBITS (bit_buf, 1)];
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[0][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[0][1] + get_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[0][1] = motion_y;
-
- MOTION (table, ref_field, motion_x, motion_y, 8, 0);
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- ref_field = motion->ref2[UBITS (bit_buf, 1)];
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[1][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[1][1] + get_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion_y;
-
- MOTION (table, ref_field, motion_x, motion_y, 8, 8);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_dmv (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y, other_x, other_y;
- unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = motion->pmv[0][0] + get_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
- NEEDBITS (bit_buf, bits, bit_ptr);
- other_x = ((motion_x + (motion_x > 0)) >> 1) + get_dmv (picture);
-
- motion_y = motion->pmv[0][1] + get_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
- other_y = (((motion_y + (motion_y > 0)) >> 1) + get_dmv (picture) +
- picture->dmv_offset);
-
- MOTION (mpeg2_mc.put, motion->ref[0], motion_x, motion_y, 16, 0);
- MOTION (mpeg2_mc.avg, motion->ref[1], other_x, other_y, 16, 0);
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_conceal (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- DUMPBITS (bit_buf, bits, 1); /* remove field_select */
-
- tmp = (picture->f_motion.pmv[0][0] +
- get_motion_delta (picture, picture->f_motion.f_code[0]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- tmp = (picture->f_motion.pmv[0][1] +
- get_motion_delta (picture, picture->f_motion.f_code[1]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
- picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
-
- DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-#define MOTION_CALL(routine,direction) \
-do { \
- if ((direction) & MACROBLOCK_MOTION_FORWARD) \
- routine (picture, &(picture->f_motion), mpeg2_mc.put); \
- if ((direction) & MACROBLOCK_MOTION_BACKWARD) \
- routine (picture, &(picture->b_motion), \
- ((direction) & MACROBLOCK_MOTION_FORWARD ? \
- mpeg2_mc.avg : mpeg2_mc.put)); \
-} while (0)
-
-#define NEXT_MACROBLOCK \
-do { \
- picture->offset += 16; \
- if (picture->offset == picture->coded_picture_width) { \
- do { /* just so we can use the break statement */ \
- if (picture->current_frame->proc_slice) { \
- picture->current_frame->proc_slice (picture->current_frame, \
- picture->dest); \
- } \
- picture->dest[0] += 16 * picture->pitches[0]; \
- picture->dest[1] += 8 * picture->pitches[1]; \
- picture->dest[2] += 8 * picture->pitches[2]; \
- } while (0); \
- picture->v_offset += 16; \
- if (picture->v_offset > picture->limit_y) { \
- if (mpeg2_cpu_state_restore) \
- mpeg2_cpu_state_restore (&cpu_state); \
- return; \
- } \
- picture->offset = 0; \
- } \
-} while (0)
-
-static inline int slice_init (picture_t * picture, int code)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int offset, height;
- struct vo_frame_s * forward_reference_frame;
- struct vo_frame_s * backward_reference_frame;
- const MBAtab * mba;
-
- offset = picture->picture_structure == BOTTOM_FIELD;
- picture->pitches[0] = picture->current_frame->pitches[0];
- picture->pitches[1] = picture->current_frame->pitches[1];
- picture->pitches[2] = picture->current_frame->pitches[2];
-
- if( picture->forward_reference_frame ) {
- forward_reference_frame = picture->forward_reference_frame;
- }
- else {
- /* return 1; */
- forward_reference_frame = picture->current_frame;
- }
-
- if( picture->backward_reference_frame ) {
- backward_reference_frame = picture->backward_reference_frame;
- }
- else {
- /* return 1; */
- backward_reference_frame = picture->current_frame;
- }
-
- picture->f_motion.ref[0][0] =
- forward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
- picture->f_motion.ref[0][1] =
- forward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
- picture->f_motion.ref[0][2] =
- forward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
-
- picture->b_motion.ref[0][0] =
- backward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
- picture->b_motion.ref[0][1] =
- backward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
- picture->b_motion.ref[0][2] =
- backward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
-
- if (picture->picture_structure != FRAME_PICTURE) {
- uint8_t ** forward_ref;
- int bottom_field;
-
- bottom_field = (picture->picture_structure == BOTTOM_FIELD);
- picture->dmv_offset = bottom_field ? 1 : -1;
- picture->f_motion.ref2[0] = picture->f_motion.ref[bottom_field];
- picture->f_motion.ref2[1] = picture->f_motion.ref[!bottom_field];
- picture->b_motion.ref2[0] = picture->b_motion.ref[bottom_field];
- picture->b_motion.ref2[1] = picture->b_motion.ref[!bottom_field];
-
- forward_ref = forward_reference_frame->base;
- if (picture->second_field && (picture->picture_coding_type != B_TYPE))
- forward_ref = picture->current_frame->base;
-
- picture->f_motion.ref[1][0] = forward_ref[0] + (bottom_field ? 0 : picture->pitches[0]);
- picture->f_motion.ref[1][1] = forward_ref[1] + (bottom_field ? 0 : picture->pitches[1]);
- picture->f_motion.ref[1][2] = forward_ref[2] + (bottom_field ? 0 : picture->pitches[2]);
-
- picture->b_motion.ref[1][0] =
- backward_reference_frame->base[0] + (bottom_field ? 0 : picture->pitches[0]);
- picture->b_motion.ref[1][1] =
- backward_reference_frame->base[1] + (bottom_field ? 0 : picture->pitches[1]);
- picture->b_motion.ref[1][2] =
- backward_reference_frame->base[2] + (bottom_field ? 0 : picture->pitches[2]);
- }
-
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
- picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
- picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
-
- picture->v_offset = (code - 1) * 16;
- offset = (code - 1);
- if (picture->picture_structure != FRAME_PICTURE)
- offset = 2 * offset;
-
- picture->dest[0] = picture->current_frame->base[0] + picture->pitches[0] * offset * 16;
- picture->dest[1] = picture->current_frame->base[1] + picture->pitches[1] * offset * 8;
- picture->dest[2] = picture->current_frame->base[2] + picture->pitches[2] * offset * 8;
-
- height = picture->coded_picture_height;
- switch (picture->picture_structure) {
- case BOTTOM_FIELD:
- picture->dest[0] += picture->pitches[0];
- picture->dest[1] += picture->pitches[1];
- picture->dest[2] += picture->pitches[2];
- /* follow thru */
- case TOP_FIELD:
- picture->pitches[0] <<= 1;
- picture->pitches[1] <<= 1;
- picture->pitches[2] <<= 1;
- height >>= 1;
- }
- picture->limit_x = 2 * picture->coded_picture_width - 32;
- picture->limit_y_16 = 2 * height - 32;
- picture->limit_y_8 = 2 * height - 16;
- picture->limit_y = height - 16;
-
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 1 << (picture->intra_dc_precision + 7);
-
- picture->quantizer_scale = get_quantizer_scale (picture);
-
- /* ignore intra_slice and all the extra data */
- while (bit_buf & 0x80000000) {
- DUMPBITS (bit_buf, bits, 9);
- NEEDBITS (bit_buf, bits, bit_ptr);
- }
-
- /* decode initial macroblock address increment */
- offset = 0;
- while (1) {
- if (bit_buf >= 0x08000000) {
- mba = MBA_5 + (UBITS (bit_buf, 6) - 2);
- break;
- } else if (bit_buf >= 0x01800000) {
- mba = MBA_11 + (UBITS (bit_buf, 12) - 24);
- break;
- } else switch (UBITS (bit_buf, 12)) {
- case 8: /* macroblock_escape */
- offset += 33;
- DUMPBITS (bit_buf, bits, 11);
- NEEDBITS (bit_buf, bits, bit_ptr);
- continue;
- case 15: /* macroblock_stuffing (MPEG1 only) */
- bit_buf &= 0xfffff;
- DUMPBITS (bit_buf, bits, 11);
- NEEDBITS (bit_buf, bits, bit_ptr);
- continue;
- default: /* error */
- return 1;
- }
- }
- DUMPBITS (bit_buf, bits, mba->len + 1);
- picture->offset = (offset + mba->mba) << 4;
-
- while (picture->offset - picture->coded_picture_width >= 0) {
- picture->offset -= picture->coded_picture_width;
- if ((picture->current_frame->proc_slice == NULL) ||
- (picture->picture_coding_type != B_TYPE)) {
- picture->dest[0] += 16 * picture->pitches[0];
- picture->dest[1] += 8 * picture->pitches[1];
- picture->dest[2] += 8 * picture->pitches[2];
- }
- picture->v_offset += 16;
- }
- if (picture->v_offset > picture->limit_y)
- return 1;
-
- return 0;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-void mpeg2_slice (picture_t * picture, int code, uint8_t * buffer)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- cpu_state_t cpu_state;
-
- bitstream_init (picture, buffer);
-
- if (slice_init (picture, code))
- return;
-
- if (mpeg2_cpu_state_save)
- mpeg2_cpu_state_save (&cpu_state);
-
- while (1) {
- int macroblock_modes;
- int mba_inc;
- const MBAtab * mba;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- macroblock_modes = get_macroblock_modes (picture);
-
- /* maybe integrate MACROBLOCK_QUANT test into get_macroblock_modes ? */
- if (macroblock_modes & MACROBLOCK_QUANT)
- picture->quantizer_scale = get_quantizer_scale (picture);
-
- if (macroblock_modes & MACROBLOCK_INTRA) {
-
- int DCT_offset, DCT_stride;
- int offset;
- uint8_t * dest_y;
-
- if (picture->concealment_motion_vectors) {
- if (picture->picture_structure == FRAME_PICTURE)
- motion_fr_conceal (picture);
- else
- motion_fi_conceal (picture);
- } else {
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
- picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
- picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
- }
-
- if (macroblock_modes & DCT_TYPE_INTERLACED) {
- DCT_offset = picture->pitches[0];
- DCT_stride = picture->pitches[0] * 2;
- } else {
- DCT_offset = picture->pitches[0] * 8;
- DCT_stride = picture->pitches[0];
- }
-
- offset = picture->offset;
- dest_y = picture->dest[0] + offset;
- slice_intra_DCT (picture, 0, dest_y, DCT_stride);
- slice_intra_DCT (picture, 0, dest_y + 8, DCT_stride);
- slice_intra_DCT (picture, 0, dest_y + DCT_offset, DCT_stride);
- slice_intra_DCT (picture, 0, dest_y + DCT_offset + 8, DCT_stride);
- slice_intra_DCT (picture, 1, picture->dest[1] + (offset >> 1),
- picture->pitches[1]);
- slice_intra_DCT (picture, 2, picture->dest[2] + (offset >> 1),
- picture->pitches[2]);
-
- if (picture->picture_coding_type == D_TYPE) {
- NEEDBITS (bit_buf, bits, bit_ptr);
- DUMPBITS (bit_buf, bits, 1);
- }
- } else {
-
- if (picture->picture_structure == FRAME_PICTURE)
- switch (macroblock_modes & MOTION_TYPE_MASK) {
- case MC_FRAME:
- if (picture->mpeg1)
- MOTION_CALL (motion_mp1, macroblock_modes);
- else
- MOTION_CALL (motion_fr_frame, macroblock_modes);
- break;
-
- case MC_FIELD:
- MOTION_CALL (motion_fr_field, macroblock_modes);
- break;
-
- case MC_DMV:
- MOTION_CALL (motion_fr_dmv, MACROBLOCK_MOTION_FORWARD);
- break;
-
- case 0:
- /* non-intra mb without forward mv in a P picture */
- picture->f_motion.pmv[0][0] = 0;
- picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = 0;
- picture->f_motion.pmv[1][1] = 0;
- MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
- break;
- }
- else
- switch (macroblock_modes & MOTION_TYPE_MASK) {
- case MC_FIELD:
- MOTION_CALL (motion_fi_field, macroblock_modes);
- break;
-
- case MC_16X8:
- MOTION_CALL (motion_fi_16x8, macroblock_modes);
- break;
-
- case MC_DMV:
- MOTION_CALL (motion_fi_dmv, MACROBLOCK_MOTION_FORWARD);
- break;
-
- case 0:
- /* non-intra mb without forward mv in a P picture */
- picture->f_motion.pmv[0][0] = 0;
- picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = 0;
- picture->f_motion.pmv[1][1] = 0;
- MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
- break;
- }
-
- if (macroblock_modes & MACROBLOCK_PATTERN) {
- int coded_block_pattern;
- int DCT_offset, DCT_stride;
- int offset;
- uint8_t * dest_y;
-
- if (macroblock_modes & DCT_TYPE_INTERLACED) {
- DCT_offset = picture->pitches[0];
- DCT_stride = picture->pitches[0] * 2;
- } else {
- DCT_offset = picture->pitches[0] * 8;
- DCT_stride = picture->pitches[0];
- }
-
- coded_block_pattern = get_coded_block_pattern (picture);
-
- offset = picture->offset;
- dest_y = picture->dest[0] + offset;
- if (coded_block_pattern & 0x20)
- slice_non_intra_DCT (picture, dest_y, DCT_stride);
- if (coded_block_pattern & 0x10)
- slice_non_intra_DCT (picture, dest_y + 8, DCT_stride);
- if (coded_block_pattern & 0x08)
- slice_non_intra_DCT (picture, dest_y + DCT_offset,
- DCT_stride);
- if (coded_block_pattern & 0x04)
- slice_non_intra_DCT (picture, dest_y + DCT_offset + 8,
- DCT_stride);
- if (coded_block_pattern & 0x2)
- slice_non_intra_DCT (picture,
- picture->dest[1] + (offset >> 1),
- picture->pitches[1]);
- if (coded_block_pattern & 0x1)
- slice_non_intra_DCT (picture,
- picture->dest[2] + (offset >> 1),
- picture->pitches[2]);
- }
-
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
- }
-
- NEXT_MACROBLOCK;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- mba_inc = 0;
- while (1) {
- if (bit_buf >= 0x10000000) {
- mba = MBA_5 + (UBITS (bit_buf, 5) - 2);
- break;
- } else if (bit_buf >= 0x03000000) {
- mba = MBA_11 + (UBITS (bit_buf, 11) - 24);
- break;
- } else switch (UBITS (bit_buf, 11)) {
- case 8: /* macroblock_escape */
- mba_inc += 33;
- /* pass through */
- case 15: /* macroblock_stuffing (MPEG1 only) */
- DUMPBITS (bit_buf, bits, 11);
- NEEDBITS (bit_buf, bits, bit_ptr);
- continue;
- default: /* end of slice, or error */
- if (mpeg2_cpu_state_restore)
- mpeg2_cpu_state_restore (&cpu_state);
- return;
- }
- }
- DUMPBITS (bit_buf, bits, mba->len);
- mba_inc += mba->mba;
-
- if (mba_inc) {
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
-
- if (picture->picture_coding_type == P_TYPE) {
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
-
- do {
- MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
- NEXT_MACROBLOCK;
- } while (--mba_inc);
- } else {
- do {
- MOTION_CALL (motion_reuse, macroblock_modes);
- NEXT_MACROBLOCK;
- } while (--mba_inc);
- }
- }
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
diff --git a/src/libmpeg2/slice_xvmc.c b/src/libmpeg2/slice_xvmc.c
deleted file mode 100644
index e21b1eb98..000000000
--- a/src/libmpeg2/slice_xvmc.c
+++ /dev/null
@@ -1,1988 +0,0 @@
-/*
- * slice_xvmc.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 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 <string.h> /* memcpy/memset, try to remove */
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "mpeg2_internal.h"
-#include "xineutils.h"
-
-#include "attributes.h"
-#include "accel_xvmc.h"
-#include "xvmc.h"
-
-
-#define MOTION_ACCEL XINE_VO_MOTION_ACCEL
-#define IDCT_ACCEL XINE_VO_IDCT_ACCEL
-#define SIGNED_INTRA XINE_VO_SIGNED_INTRA
-#define ACCEL (MOTION_ACCEL | IDCT_ACCEL)
-
-#include "vlc.h"
-/* original (non-patched) scan tables */
-
-static const uint8_t mpeg2_scan_norm_orig[64] ATTR_ALIGN(16) =
-{
- /* Zig-Zag scan pattern */
- 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
-};
-
-static const uint8_t mpeg2_scan_alt_orig[64] ATTR_ALIGN(16) =
-{
- /* Alternate scan pattern */
- 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
-};
-
-static uint8_t mpeg2_scan_alt_ptable[64] ATTR_ALIGN(16);
-static uint8_t mpeg2_scan_norm_ptable[64] ATTR_ALIGN(16);
-static uint8_t mpeg2_scan_orig_ptable[64] ATTR_ALIGN(16);
-
-void xvmc_setup_scan_ptable( void )
-{
- int i;
- for (i=0; i<64; ++i) {
- mpeg2_scan_norm_ptable[mpeg2_scan_norm_orig[i]] = mpeg2_scan_norm[i];
- mpeg2_scan_alt_ptable[mpeg2_scan_alt_orig[i]] = mpeg2_scan_alt[i];
- mpeg2_scan_orig_ptable[i] = i;
- }
-}
-
-
-static const int non_linear_quantizer_scale [] = {
- 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
-};
-
-static inline int get_xvmc_macroblock_modes (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int macroblock_modes;
- const MBtab * tab;
-
- switch (picture->picture_coding_type) {
- case I_TYPE:
-
- tab = MB_I + UBITS (bit_buf, 1);
- DUMPBITS (bit_buf, bits, tab->len);
- macroblock_modes = tab->modes;
-
- if ((! (picture->frame_pred_frame_dct)) &&
- (picture->picture_structure == FRAME_PICTURE)) {
- macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
- DUMPBITS (bit_buf, bits, 1);
- }
-
- return macroblock_modes;
-
- case P_TYPE:
-
- tab = MB_P + UBITS (bit_buf, 5);
- DUMPBITS (bit_buf, bits, tab->len);
- macroblock_modes = tab->modes;
-
- if (picture->picture_structure != FRAME_PICTURE) {
- if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- }
- return macroblock_modes;
- } else if (picture->frame_pred_frame_dct) {
- if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
- macroblock_modes |= MC_FRAME;
- return macroblock_modes;
- } else {
- if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- }
- if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
- macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
- DUMPBITS (bit_buf, bits, 1);
- }
- return macroblock_modes;
- }
-
- case B_TYPE:
-
- tab = MB_B + UBITS (bit_buf, 6);
- DUMPBITS (bit_buf, bits, tab->len);
- macroblock_modes = tab->modes;
-
- if (picture->picture_structure != FRAME_PICTURE) {
- if (! (macroblock_modes & MACROBLOCK_INTRA)) {
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- }
- return macroblock_modes;
- } else if (picture->frame_pred_frame_dct) {
- /* if (! (macroblock_modes & MACROBLOCK_INTRA)) */
- macroblock_modes |= MC_FRAME;
- return macroblock_modes;
- } else {
- if (macroblock_modes & MACROBLOCK_INTRA)
- goto intra;
- macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
- DUMPBITS (bit_buf, bits, 2);
- if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
- intra:
- macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
- DUMPBITS (bit_buf, bits, 1);
- }
- return macroblock_modes;
- }
-
- case D_TYPE:
-
- DUMPBITS (bit_buf, bits, 1);
- return MACROBLOCK_INTRA;
-
- default:
- return 0;
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_xvmc_quantizer_scale (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- int quantizer_scale_code;
-
- quantizer_scale_code = UBITS (bit_buf, 5);
- DUMPBITS (bit_buf, bits, 5);
-
- if (picture->q_scale_type)
- return non_linear_quantizer_scale [quantizer_scale_code];
- else
- return quantizer_scale_code << 1;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_xvmc_motion_delta (picture_t * picture, int f_code)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- int delta;
- int sign;
- const MVtab * tab;
-
- if (bit_buf & 0x80000000) {
- DUMPBITS (bit_buf, bits, 1);
- return 0;
- } else if (bit_buf >= 0x0c000000) {
-
- tab = MV_4 + UBITS (bit_buf, 4);
- delta = (tab->delta << f_code) + 1;
- bits += tab->len + f_code + 1;
- bit_buf <<= tab->len;
-
- sign = SBITS (bit_buf, 1);
- bit_buf <<= 1;
-
- if (f_code)
- delta += UBITS (bit_buf, f_code);
- bit_buf <<= f_code;
-
- return (delta ^ sign) - sign;
-
- } else {
-
- tab = MV_10 + UBITS (bit_buf, 10);
- delta = (tab->delta << f_code) + 1;
- bits += tab->len + 1;
- bit_buf <<= tab->len;
-
- sign = SBITS (bit_buf, 1);
- bit_buf <<= 1;
-
- if (f_code) {
- NEEDBITS (bit_buf, bits, bit_ptr);
- delta += UBITS (bit_buf, f_code);
- DUMPBITS (bit_buf, bits, f_code);
- }
-
- return (delta ^ sign) - sign;
-
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int bound_motion_vector (int vec, int f_code)
-{
-#if 1
- unsigned int limit;
- int sign;
-
- limit = 16 << f_code;
-
- if ((unsigned int)(vec + limit) < 2 * limit)
- return vec;
- else {
- sign = ((int32_t)vec) >> 31;
- return vec - ((2 * limit) ^ sign) + sign;
- }
-#else
- return ((int32_t)vec << (27 - f_code)) >> (27 - f_code);
-#endif
-}
-
-static inline int get_xvmc_dmv (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- const DMVtab * tab;
-
- tab = DMV_2 + UBITS (bit_buf, 2);
- DUMPBITS (bit_buf, bits, tab->len);
- return tab->dmv;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_xvmc_coded_block_pattern (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
-
- const CBPtab * tab;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- if (bit_buf >= 0x20000000) {
-
- tab = CBP_7 + (UBITS (bit_buf, 7) - 16);
- DUMPBITS (bit_buf, bits, tab->len);
- return tab->cbp;
-
- } else {
-
- tab = CBP_9 + UBITS (bit_buf, 9);
- DUMPBITS (bit_buf, bits, tab->len);
- return tab->cbp;
- }
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_xvmc_luma_dc_dct_diff (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- const DCtab * tab;
- int size;
- int dc_diff;
-
- if (bit_buf < 0xf8000000) {
- tab = DC_lum_5 + UBITS (bit_buf, 5);
- size = tab->size;
- if (size) {
- bits += tab->len + size;
- bit_buf <<= tab->len;
- dc_diff =
- UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- bit_buf <<= size;
- return dc_diff;
- } else {
- DUMPBITS (bit_buf, bits, 3);
- return 0;
- }
- } else {
- tab = DC_long + (UBITS (bit_buf, 9) - 0x1e0);
- size = tab->size;
- DUMPBITS (bit_buf, bits, tab->len);
- NEEDBITS (bit_buf, bits, bit_ptr);
- dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- DUMPBITS (bit_buf, bits, size);
- return dc_diff;
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline int get_xvmc_chroma_dc_dct_diff (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- const DCtab * tab;
- int size;
- int dc_diff;
-
- if (bit_buf < 0xf8000000) {
- tab = DC_chrom_5 + UBITS (bit_buf, 5);
- size = tab->size;
- if (size) {
- bits += tab->len + size;
- bit_buf <<= tab->len;
- dc_diff =
- UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- bit_buf <<= size;
- return dc_diff;
- } else {
- DUMPBITS (bit_buf, bits, 2);
- return 0;
- }
- } else {
- tab = DC_long + (UBITS (bit_buf, 10) - 0x3e0);
- size = tab->size;
- DUMPBITS (bit_buf, bits, tab->len + 1);
- NEEDBITS (bit_buf, bits, bit_ptr);
- dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
- DUMPBITS (bit_buf, bits, size);
- return dc_diff;
- }
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-#define SATURATE(val) \
-do { \
- if ((uint32_t)(val + 2048) > 4095) \
- val = (val > 0) ? 2047 : -2048; \
-} while (0)
-
-static void get_xvmc_intra_block_B14 (picture_t * picture)
-{
- int i;
- int j;
- int l;
- int val;
- const uint8_t * scan = picture->scan;
- uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
- uint8_t * quant_matrix = picture->intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- int mismatch;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- dest = picture->mc->blockptr;
-
- if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
- if ( scan == mpeg2_scan_norm ) {
- scan = mpeg2_scan_norm_orig;
- scan_ptable = mpeg2_scan_norm_ptable;
- } else {
- scan = mpeg2_scan_alt_orig;
- scan_ptable = mpeg2_scan_alt_ptable;
- }
- }
-
- i = 0;
- mismatch = ~dest[0];
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- l = scan_ptable[j = scan[i]];
-
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = (tab->level * quantizer_scale * quant_matrix[l]) >> 4;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- l = scan_ptable[j = scan[i]];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = (SBITS (bit_buf, 12) *
- quantizer_scale * quant_matrix[l]) / 16;
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
-
- dest[63] ^= mismatch & 1;
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_xvmc_intra_block_B15 (picture_t * picture)
-{
- int i;
- int j;
- int l;
- int val;
- const uint8_t * scan = picture->scan;
- uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
- uint8_t * quant_matrix = picture->intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- int mismatch;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- dest = picture->mc->blockptr;
-
- if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
- if ( scan == mpeg2_scan_norm ) {
- scan = mpeg2_scan_norm_orig;
- scan_ptable = mpeg2_scan_norm_ptable;
- } else {
- scan = mpeg2_scan_alt_orig;
- scan_ptable = mpeg2_scan_alt_ptable;
- }
- }
-
- i = 0;
- mismatch = ~dest[0];
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- while (1) {
- if (bit_buf >= 0x04000000) {
-
- tab = DCT_B15_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64) {
-
- normal_code:
- l = scan_ptable[j = scan[i]];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = (tab->level * quantizer_scale * quant_matrix[l]) >> 4;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else {
-
- /* end of block. I commented out this code because if we */
- /* dont exit here we will still exit at the later test :) */
-
- /* if (i >= 128) break; */ /* end of block */
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check against buffer overflow */
-
- l = scan_ptable[j = scan[i]];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = (SBITS (bit_buf, 12) *
- quantizer_scale * quant_matrix[l]) / 16;
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- }
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B15_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
-
- dest[63] ^= mismatch & 1;
- DUMPBITS (bit_buf, bits, 4); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_xvmc_non_intra_block (picture_t * picture)
-{
- int i;
- int j;
- int l;
- int val;
- const uint8_t * scan = picture->scan;
- uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
- uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- int mismatch;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- i = -1;
- mismatch = 1;
-
- dest = picture->mc->blockptr;
-
- if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
- if ( scan == mpeg2_scan_norm ) {
- scan = mpeg2_scan_norm_orig;
- scan_ptable = mpeg2_scan_norm_ptable;
- } else {
- scan = mpeg2_scan_alt_orig;
- scan_ptable = mpeg2_scan_alt_ptable;
- }
- }
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- if (bit_buf >= 0x28000000) {
- tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
- goto entry_1;
- } else
- goto entry_2;
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- entry_1:
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- l = scan_ptable[j = scan[i]];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = ((2*tab->level+1) * quantizer_scale * quant_matrix[l]) >> 5;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- }
-
- entry_2:
- if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- l = scan_ptable[j = scan[i]];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = 2 * (SBITS (bit_buf, 12) + SBITS (bit_buf, 1)) + 1;
- val = (val * quantizer_scale * quant_matrix[l]) / 32;
-
- SATURATE (val);
- dest[j] = val;
- mismatch ^= val;
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- dest[63] ^= mismatch & 1;
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_xvmc_mpeg1_intra_block (picture_t * picture)
-{
- int i;
- int j;
- int l;
- int val;
- const uint8_t * scan = picture->scan;
- uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
- uint8_t * quant_matrix = picture->intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- i = 0;
-
- dest = picture->mc->blockptr;
-
- if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
- if ( scan == mpeg2_scan_norm ) {
- scan = mpeg2_scan_norm_orig;
- scan_ptable = mpeg2_scan_norm_ptable;
- } else {
- scan = mpeg2_scan_alt_orig;
- scan_ptable = mpeg2_scan_alt_ptable;
- }
- }
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- l = scan_ptable[j = scan[i]];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = (tab->level * quantizer_scale * quant_matrix[l]) >> 4;
-
- /* oddification */
- val = (val - 1) | 1;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- l = scan_ptable[j = scan[i]];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = SBITS (bit_buf, 8);
- if (! (val & 0x7f)) {
- DUMPBITS (bit_buf, bits, 8);
- val = UBITS (bit_buf, 8) + 2 * val;
- }
- val = (val * quantizer_scale * quant_matrix[l]) / 16;
-
- /* oddification */
- val = (val + ~SBITS (val, 1)) | 1;
-
- SATURATE (val);
- dest[j] = val;
-
- DUMPBITS (bit_buf, bits, 8);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static void get_xvmc_mpeg1_non_intra_block (picture_t * picture)
-{
- int i;
- int j;
- int l;
- int val;
- const uint8_t * scan = picture->scan;
- uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
- uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
- int quantizer_scale = picture->quantizer_scale;
- const DCTtab * tab;
- uint32_t bit_buf;
- int bits;
- uint8_t * bit_ptr;
- int16_t * dest;
-
- i = -1;
-
- dest = picture->mc->blockptr;
-
- if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
- if ( scan == mpeg2_scan_norm ) {
- scan = mpeg2_scan_norm_orig;
- scan_ptable = mpeg2_scan_norm_ptable;
- } else {
- scan = mpeg2_scan_alt_orig;
- scan_ptable = mpeg2_scan_alt_ptable;
- }
- }
-
- bit_buf = picture->bitstream_buf;
- bits = picture->bitstream_bits;
- bit_ptr = picture->bitstream_ptr;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- if (bit_buf >= 0x28000000) {
- tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
- goto entry_1;
- } else
- goto entry_2;
-
- while (1) {
- if (bit_buf >= 0x28000000) {
-
- tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
-
- entry_1:
- i += tab->run;
- if (i >= 64)
- break; /* end of block */
-
- normal_code:
- l = scan_ptable[j = scan[i]];
- bit_buf <<= tab->len;
- bits += tab->len + 1;
- val = ((2*tab->level+1) * quantizer_scale * quant_matrix[l]) >> 5;
-
- /* oddification */
- val = (val - 1) | 1;
-
- /* if (bitstream_get (1)) val = -val; */
- val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
-
- SATURATE (val);
- dest[j] = val;
-
- bit_buf <<= 1;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- }
-
- entry_2:
- if (bit_buf >= 0x04000000) {
-
- tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
-
- i += tab->run;
- if (i < 64)
- goto normal_code;
-
- /* escape code */
-
- i += UBITS (bit_buf << 6, 6) - 64;
- if (i >= 64)
- break; /* illegal, check needed to avoid buffer overflow */
-
- l = scan_ptable[j = scan[i]];
-
- DUMPBITS (bit_buf, bits, 12);
- NEEDBITS (bit_buf, bits, bit_ptr);
- val = SBITS (bit_buf, 8);
- if (! (val & 0x7f)) {
- DUMPBITS (bit_buf, bits, 8);
- val = UBITS (bit_buf, 8) + 2 * val;
- }
- val = 2 * (val + SBITS (val, 1)) + 1;
- val = (val * quantizer_scale * quant_matrix[l]) / 32;
-
- /* oddification */
- val = (val + ~SBITS (val, 1)) | 1;
-
- SATURATE (val);
- dest[j] = val;
-
- DUMPBITS (bit_buf, bits, 8);
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- continue;
-
- } else if (bit_buf >= 0x02000000) {
- tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00800000) {
- tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else if (bit_buf >= 0x00200000) {
- tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- } else {
- tab = DCT_16 + UBITS (bit_buf, 16);
- bit_buf <<= 16;
- GETWORD (bit_buf, bits + 16, bit_ptr);
- i += tab->run;
- if (i < 64)
- goto normal_code;
- }
- break; /* illegal, check needed to avoid buffer overflow */
- }
- DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
- picture->bitstream_buf = bit_buf;
- picture->bitstream_bits = bits;
- picture->bitstream_ptr = bit_ptr;
-}
-
-static inline void slice_xvmc_intra_DCT (picture_t * picture, int cc,
- uint8_t * dest, int stride)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- NEEDBITS (bit_buf, bits, bit_ptr);
- /* Get the intra DC coefficient and inverse quantize it */
-
- // printf("slice: slice_xvmc_intra_DCT cc=%d pred[0]=%d\n",cc,picture->dc_dct_pred[0]);
- if (cc == 0)
- picture->dc_dct_pred[0] += get_xvmc_luma_dc_dct_diff (picture);
- else
- picture->dc_dct_pred[cc] += get_xvmc_chroma_dc_dct_diff (picture);
- //TODO conversion to signed format
- // printf("slice: pred[0]=%d presision=%d\n",picture->dc_dct_pred[0],
- // picture->intra_dc_precision);
-
- mpeg2_zero_block(picture->mc->blockptr);
-
- picture->mc->blockptr[0] = picture->dc_dct_pred[cc] << (3 - picture->intra_dc_precision);
-
- if (picture->mpeg1) {
- if (picture->picture_coding_type != D_TYPE)
- get_xvmc_mpeg1_intra_block (picture);
- } else if (picture->intra_vlc_format)
- get_xvmc_intra_block_B15 (picture);
- else
- get_xvmc_intra_block_B14 (picture);
-
- if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) {
- //motion_comp only no idct acceleration so do it in software
- mpeg2_idct (picture->mc->blockptr);
- }
- picture->mc->blockptr += 64;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static inline void slice_xvmc_non_intra_DCT (picture_t * picture, uint8_t * dest,
- int stride)
-{
- mpeg2_zero_block(picture->mc->blockptr);
-
- if (picture->mpeg1)
- get_xvmc_mpeg1_non_intra_block (picture);
- else
- get_xvmc_non_intra_block (picture);
-
- if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) {
- // motion comp only no idct acceleration so do it in sw
- mpeg2_idct (picture->mc->blockptr);
- }
- picture->mc->blockptr += 64;
-}
-
-static void motion_mp1 (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = (motion->pmv[0][0] +
- (get_xvmc_motion_delta (picture,
- motion->f_code[0]) << motion->f_code[1]));
- motion_x = bound_motion_vector (motion_x,
- motion->f_code[0] + motion->f_code[1]);
- motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = (motion->pmv[0][1] +
- (get_xvmc_motion_delta (picture,
- motion->f_code[0]) << motion->f_code[1]));
- motion_y = bound_motion_vector (motion_y,
- motion->f_code[0] + motion->f_code[1]);
- motion->pmv[0][1] = motion_y;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fr_frame (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fr_field (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int),
- int dir)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y, field;
- // unsigned int pos_x, pos_y, xy_half;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- field = UBITS (bit_buf, 1);
- picture->XvMC_mv_field_sel[0][dir] = field;
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = (motion->pmv[0][1] >> 1) + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
- motion->pmv[0][1] = motion_y << 1;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- field = UBITS (bit_buf, 1);
- //TODO look at field select need bob (weave ok)
- picture->XvMC_mv_field_sel[1][dir] = field;
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[1][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = (motion->pmv[1][1] >> 1) + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
- motion->pmv[1][1] = motion_y << 1;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fr_dmv (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
-
- // TODO field select ?? possible need to be 0
- picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- motion_y = (motion->pmv[0][1] >> 1) + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y << 1;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_reuse (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
- int motion_x, motion_y;
-
- motion_x = motion->pmv[0][0];
- motion_y = motion->pmv[0][1];
-
-}
-
-/* like motion_frame, but parsing without actual motion compensation */
-static void motion_fr_conceal (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- tmp = (picture->f_motion.pmv[0][0] +
- get_xvmc_motion_delta (picture, picture->f_motion.f_code[0]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- tmp = (picture->f_motion.pmv[0][1] +
- get_xvmc_motion_delta (picture, picture->f_motion.f_code[1]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
- picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
-
- DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_field (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
- uint8_t ** ref_field;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- ref_field = motion->ref2[UBITS (bit_buf, 1)];
-
- // TODO field select may need to do something here for bob (weave ok)
- picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
-
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_16x8 (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
- uint8_t ** ref_field;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- ref_field = motion->ref2[UBITS (bit_buf, 1)];
-
- // TODO field select may need to do something here bob (weave ok)
- picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
-
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[0][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[0][1] = motion_y;
-
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- ref_field = motion->ref2[UBITS (bit_buf, 1)];
-
- // TODO field select may need to do something here for bob (weave ok)
- picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
-
- DUMPBITS (bit_buf, bits, 1);
-
- motion_x = motion->pmv[1][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion_x;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_y = motion->pmv[1][1] + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion_y;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-static void motion_fi_dmv (picture_t * picture, motion_t * motion,
- void (** table) (uint8_t *, uint8_t *, int, int))
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int motion_x, motion_y;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
- motion->f_code[0]);
- motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
- motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
- motion->f_code[1]);
- motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
- motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
-
- // TODO field select may need to do something here for bob (weave ok)
- picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
-
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-
-static void motion_fi_conceal (picture_t * picture)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- DUMPBITS (bit_buf, bits, 1); /* remove field_select */
-
- tmp = (picture->f_motion.pmv[0][0] +
- get_xvmc_motion_delta (picture, picture->f_motion.f_code[0]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- tmp = (picture->f_motion.pmv[0][1] +
- get_xvmc_motion_delta (picture, picture->f_motion.f_code[1]));
- tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
- picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
-
- DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-#define MOTION_CALL(routine,direction) \
-do { \
- if ((direction) & MACROBLOCK_MOTION_FORWARD) \
- routine (picture, &(picture->f_motion), mpeg2_mc.put); \
- if ((direction) & MACROBLOCK_MOTION_BACKWARD) \
- routine (picture, &(picture->b_motion), \
- ((direction) & MACROBLOCK_MOTION_FORWARD ? \
- mpeg2_mc.avg : mpeg2_mc.put)); \
-} while (0)
-
-#define NEXT_MACROBLOCK \
-do { \
- picture->offset += 16; \
- if (picture->offset == picture->coded_picture_width) { \
- do { /* just so we can use the break statement */ \
- if (picture->current_frame->proc_slice) { \
- picture->current_frame->proc_slice (picture->current_frame, \
- picture->dest); \
- if (picture->picture_coding_type == B_TYPE) \
- break; \
- } \
- picture->dest[0] += 16 * picture->pitches[0]; \
- picture->dest[1] += 8 * picture->pitches[1]; \
- picture->dest[2] += 8 * picture->pitches[2]; \
- } while (0); \
- picture->v_offset += 16; \
- if (picture->v_offset > picture->limit_y) { \
- if (mpeg2_cpu_state_restore) \
- mpeg2_cpu_state_restore (&cpu_state); \
- return; \
- } \
- picture->offset = 0; \
- } \
-} while (0)
-
-static inline int slice_xvmc_init (picture_t * picture, int code)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- int offset, height;
- struct vo_frame_s * forward_reference_frame;
- struct vo_frame_s * backward_reference_frame;
- const MBAtab * mba;
-
- offset = picture->picture_structure == BOTTOM_FIELD;
- picture->pitches[0] = picture->current_frame->pitches[0];
- picture->pitches[1] = picture->current_frame->pitches[1];
- picture->pitches[2] = picture->current_frame->pitches[2];
-
- if( picture->forward_reference_frame ) {
- forward_reference_frame = picture->forward_reference_frame;
- }
- else {
- /* return 1; */
- forward_reference_frame = picture->current_frame;
- }
-
- if( picture->backward_reference_frame ) {
- backward_reference_frame = picture->backward_reference_frame;
- }
- else {
- /* return 1; */
- backward_reference_frame = picture->current_frame;
- }
-
- picture->f_motion.ref[0][0] =
- forward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
- picture->f_motion.ref[0][1] =
- forward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
- picture->f_motion.ref[0][2] =
- forward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
-
- picture->b_motion.ref[0][0] =
- backward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
- picture->b_motion.ref[0][1] =
- backward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
- picture->b_motion.ref[0][2] =
- backward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
-
- if (picture->picture_structure != FRAME_PICTURE) {
- uint8_t ** forward_ref;
- int bottom_field;
-
- bottom_field = (picture->picture_structure == BOTTOM_FIELD);
- picture->dmv_offset = bottom_field ? 1 : -1;
- picture->f_motion.ref2[0] = picture->f_motion.ref[bottom_field];
- picture->f_motion.ref2[1] = picture->f_motion.ref[!bottom_field];
- picture->b_motion.ref2[0] = picture->b_motion.ref[bottom_field];
- picture->b_motion.ref2[1] = picture->b_motion.ref[!bottom_field];
-
- forward_ref = forward_reference_frame->base;
- if (picture->second_field && (picture->picture_coding_type != B_TYPE))
- forward_ref = picture->current_frame->base;
-
- picture->f_motion.ref[1][0] = forward_ref[0] + (bottom_field ? 0 : picture->pitches[0]);
- picture->f_motion.ref[1][1] = forward_ref[1] + (bottom_field ? 0 : picture->pitches[1]);
- picture->f_motion.ref[1][2] = forward_ref[2] + (bottom_field ? 0 : picture->pitches[2]);
-
- picture->b_motion.ref[1][0] =
- backward_reference_frame->base[0] + (bottom_field ? 0 : picture->pitches[0]);
- picture->b_motion.ref[1][1] =
- backward_reference_frame->base[1] + (bottom_field ? 0 : picture->pitches[1]);
- picture->b_motion.ref[1][2] =
- backward_reference_frame->base[2] + (bottom_field ? 0 : picture->pitches[2]);
- }
-
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
- picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
- picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
-
- picture->v_offset = (code - 1) * 16;
- offset = (code - 1);
- if (picture->current_frame->proc_slice && picture->picture_coding_type == B_TYPE)
- offset = 0;
- else if (picture->picture_structure != FRAME_PICTURE)
- offset = 2 * offset;
-
- picture->dest[0] = picture->current_frame->base[0] + picture->pitches[0] * offset * 16;
- picture->dest[1] = picture->current_frame->base[1] + picture->pitches[1] * offset * 8;
- picture->dest[2] = picture->current_frame->base[2] + picture->pitches[2] * offset * 8;
-
- height = picture->coded_picture_height;
- switch (picture->picture_structure) {
- case BOTTOM_FIELD:
- picture->dest[0] += picture->pitches[0];
- picture->dest[1] += picture->pitches[1];
- picture->dest[2] += picture->pitches[2];
- /* follow thru */
- case TOP_FIELD:
- picture->pitches[0] <<= 1;
- picture->pitches[1] <<= 1;
- picture->pitches[2] <<= 1;
- height >>= 1;
- }
- picture->limit_x = 2 * picture->coded_picture_width - 32;
- picture->limit_y_16 = 2 * height - 32;
- picture->limit_y_8 = 2 * height - 16;
- picture->limit_y = height - 16;
-
- //TODO conversion to signed format signed format
- if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL &&
- !(picture->mc->xvmc_accel & SIGNED_INTRA)) {
- //Motion Comp only unsigned intra
- // original:
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 1 << (picture->intra_dc_precision + 7);
- } else {
- //Motion Comp only signed intra MOTION_ACCEL+SIGNED_INTRA
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 0;
- }
-
- picture->quantizer_scale = get_xvmc_quantizer_scale (picture);
-
- /* ignore intra_slice and all the extra data */
- while (bit_buf & 0x80000000) {
- DUMPBITS (bit_buf, bits, 9);
- NEEDBITS (bit_buf, bits, bit_ptr);
- }
-
- /* decode initial macroblock address increment */
- offset = 0;
- while (1) {
- if (bit_buf >= 0x08000000) {
- mba = MBA_5 + (UBITS (bit_buf, 6) - 2);
- break;
- } else if (bit_buf >= 0x01800000) {
- mba = MBA_11 + (UBITS (bit_buf, 12) - 24);
- break;
- } else switch (UBITS (bit_buf, 12)) {
- case 8: /* macroblock_escape */
- offset += 33;
- DUMPBITS (bit_buf, bits, 11);
- NEEDBITS (bit_buf, bits, bit_ptr);
- continue;
- case 15: /* macroblock_stuffing (MPEG1 only) */
- bit_buf &= 0xfffff;
- DUMPBITS (bit_buf, bits, 11);
- NEEDBITS (bit_buf, bits, bit_ptr);
- continue;
- default: /* error */
- return 1;
- }
- }
- DUMPBITS (bit_buf, bits, mba->len + 1);
- picture->offset = (offset + mba->mba) << 4;
-
- while (picture->offset - picture->coded_picture_width >= 0) {
- picture->offset -= picture->coded_picture_width;
- if ((picture->current_frame->proc_slice == NULL) ||
- (picture->picture_coding_type != B_TYPE)) {
- picture->dest[0] += 16 * picture->pitches[0];
- picture->dest[1] += 8 * picture->pitches[1];
- picture->dest[2] += 8 * picture->pitches[2];
- }
- picture->v_offset += 16;
- }
- if (picture->v_offset > picture->limit_y)
- return 1;
-
- return 0;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
-void mpeg2_xvmc_slice (mpeg2dec_accel_t *accel, picture_t * picture, int code, uint8_t * buffer)
-{
-#define bit_buf (picture->bitstream_buf)
-#define bits (picture->bitstream_bits)
-#define bit_ptr (picture->bitstream_ptr)
- cpu_state_t cpu_state;
- xine_xvmc_t *xvmc = (xine_xvmc_t *) picture->current_frame->accel_data;
-
- if (1 == code) {
- accel->xvmc_last_slice_code = 0;
- }
- if ((code != accel->xvmc_last_slice_code + 1) &&
- (code != accel->xvmc_last_slice_code))
- return;
-
- bitstream_init (picture, buffer);
-
- if (slice_xvmc_init (picture, code))
- return;
-
- if (mpeg2_cpu_state_save)
- mpeg2_cpu_state_save (&cpu_state);
-
- while (1) {
- int macroblock_modes;
- int mba_inc;
- const MBAtab * mba;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
-
- macroblock_modes = get_xvmc_macroblock_modes (picture); //macroblock_modes()
- picture->XvMC_mb_type = macroblock_modes & 0x1F;
- picture->XvMC_dct_type = (macroblock_modes & DCT_TYPE_INTERLACED)>>5;
- picture->XvMC_motion_type = (macroblock_modes & MOTION_TYPE_MASK)>>6;
-
- picture->XvMC_x = picture->offset/16;
- picture->XvMC_y = picture->v_offset/16;
-
- if((picture->XvMC_x == 0) && (picture->XvMC_y == 0)) {
- picture->XvMC_mv_field_sel[0][0] =
- picture->XvMC_mv_field_sel[1][0] =
- picture->XvMC_mv_field_sel[0][1] =
- picture->XvMC_mv_field_sel[1][1] = 0;
- }
-
- picture->XvMC_cbp = 0x3f; //TODO set for intra 4:2:0 6 blocks yyyyuv all enabled
-
- /* maybe integrate MACROBLOCK_QUANT test into get_xvmc_macroblock_modes ? */
- if (macroblock_modes & MACROBLOCK_QUANT)
- picture->quantizer_scale = get_xvmc_quantizer_scale (picture);
- if (macroblock_modes & MACROBLOCK_INTRA) {
-
- int DCT_offset, DCT_stride;
- int offset;
- uint8_t * dest_y;
-
- if (picture->concealment_motion_vectors) {
- if (picture->picture_structure == FRAME_PICTURE)
- motion_fr_conceal (picture);
- else
- motion_fi_conceal (picture);
- } else {
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
- picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
- picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
- }
-
- if (macroblock_modes & DCT_TYPE_INTERLACED) {
- DCT_offset = picture->pitches[0];
- DCT_stride = picture->pitches[0] * 2;
- } else {
- DCT_offset = picture->pitches[0] * 8;
- DCT_stride = picture->pitches[0];
- }
- offset = picture->offset;
- dest_y = picture->dest[0] + offset;
- // unravaled loop of 6 block(i) calls in macroblock()
- slice_xvmc_intra_DCT (picture, 0, dest_y, DCT_stride);
- slice_xvmc_intra_DCT (picture, 0, dest_y + 8, DCT_stride);
- slice_xvmc_intra_DCT (picture, 0, dest_y + DCT_offset, DCT_stride);
- slice_xvmc_intra_DCT (picture, 0, dest_y + DCT_offset + 8, DCT_stride);
- slice_xvmc_intra_DCT (picture, 1, picture->dest[1] + (offset >> 1),
- picture->pitches[1]);
- slice_xvmc_intra_DCT (picture, 2, picture->dest[2] + (offset >> 1),
- picture->pitches[2]);
-
- if (picture->picture_coding_type == D_TYPE) {
- NEEDBITS (bit_buf, bits, bit_ptr);
- DUMPBITS (bit_buf, bits, 1);
- }
- } else {
- picture->XvMC_cbp = 0;
-
- if (picture->picture_structure == FRAME_PICTURE)
- switch (macroblock_modes & MOTION_TYPE_MASK) {
- case MC_FRAME:
- if (picture->mpeg1) {
- MOTION_CALL (motion_mp1, macroblock_modes);
- } else {
- MOTION_CALL (motion_fr_frame, macroblock_modes);
- }
- break;
-
- case MC_FIELD:
- //MOTION_CALL (motion_fr_field, macroblock_modes);
-
- if ((macroblock_modes) & MACROBLOCK_MOTION_FORWARD)
- motion_fr_field(picture, &(picture->f_motion),
- mpeg2_mc.put,0);
- if ((macroblock_modes) & MACROBLOCK_MOTION_BACKWARD)
- motion_fr_field(picture, &(picture->b_motion),
- ((macroblock_modes) & MACROBLOCK_MOTION_FORWARD ?
- mpeg2_mc.avg : mpeg2_mc.put),1);
-
- break;
-
- case MC_DMV:
- MOTION_CALL (motion_fr_dmv, MACROBLOCK_MOTION_FORWARD);
- break;
-
- case 0:
- /* non-intra mb without forward mv in a P picture */
- picture->f_motion.pmv[0][0] = 0;
- picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = 0;
- picture->f_motion.pmv[1][1] = 0;
- // MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
- break;
- }
- else
- switch (macroblock_modes & MOTION_TYPE_MASK) {
- case MC_FIELD:
- MOTION_CALL (motion_fi_field, macroblock_modes);
- break;
-
- case MC_16X8:
- MOTION_CALL (motion_fi_16x8, macroblock_modes);
- break;
-
- case MC_DMV:
- MOTION_CALL (motion_fi_dmv, MACROBLOCK_MOTION_FORWARD);
- break;
-
- case 0:
- /* non-intra mb without forward mv in a P picture */
- picture->f_motion.pmv[0][0] = 0;
- picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = 0;
- picture->f_motion.pmv[1][1] = 0;
- // MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
- break;
- }
-
- if (macroblock_modes & MACROBLOCK_PATTERN) {
- int coded_block_pattern;
- int DCT_offset, DCT_stride;
- int offset;
- uint8_t * dest_y;
-
- if (macroblock_modes & DCT_TYPE_INTERLACED) {
- DCT_offset = picture->pitches[0];
- DCT_stride = picture->pitches[0] * 2;
- } else {
- DCT_offset = picture->pitches[0] * 8;
- DCT_stride = picture->pitches[0];
- }
-
- picture->XvMC_cbp = coded_block_pattern = get_xvmc_coded_block_pattern (picture);
- offset = picture->offset;
- dest_y = picture->dest[0] + offset;
- // TODO optimize not fully used for idct accel only mc.
- if (coded_block_pattern & 0x20)
- slice_xvmc_non_intra_DCT (picture, dest_y, DCT_stride); // cc0 luma 0
- if (coded_block_pattern & 0x10)
- slice_xvmc_non_intra_DCT (picture, dest_y + 8, DCT_stride); // cc0 luma 1
- if (coded_block_pattern & 0x08)
- slice_xvmc_non_intra_DCT (picture, dest_y + DCT_offset,
- DCT_stride); // cc0 luma 2
- if (coded_block_pattern & 0x04)
- slice_xvmc_non_intra_DCT (picture, dest_y + DCT_offset + 8,
- DCT_stride); // cc0 luma 3
- if (coded_block_pattern & 0x2)
- slice_xvmc_non_intra_DCT (picture,
- picture->dest[1] + (offset >> 1),
- picture->pitches[1]); // cc1 croma
- if (coded_block_pattern & 0x1)
- slice_xvmc_non_intra_DCT (picture,
- picture->dest[2] + (offset >> 1),
- picture->pitches[2]); // cc2 croma
- }
-
- if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL &&
- !(picture->mc->xvmc_accel & SIGNED_INTRA)) {
- // original:
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
-
- } else { // MOTION_ACCEL+SIGNED_INTRA
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 0;
- }
-
- }
- xvmc->proc_macro_block(picture->XvMC_x, picture->XvMC_y,
- picture->XvMC_mb_type,
- picture->XvMC_motion_type,
- picture->XvMC_mv_field_sel,
- picture->XvMC_dmvector,
- picture->XvMC_cbp,
- picture->XvMC_dct_type,
- picture->current_frame,
- picture->forward_reference_frame,
- picture->backward_reference_frame,
- picture->picture_structure,
- picture->second_field,
- picture->f_motion.pmv,
- picture->b_motion.pmv);
-
-
- NEXT_MACROBLOCK;
-
- NEEDBITS (bit_buf, bits, bit_ptr);
- mba_inc = 0;
- while (1) {
- if (bit_buf >= 0x10000000) {
- mba = MBA_5 + (UBITS (bit_buf, 5) - 2);
- break;
- } else if (bit_buf >= 0x03000000) {
- mba = MBA_11 + (UBITS (bit_buf, 11) - 24);
- break;
- } else switch (UBITS (bit_buf, 11)) {
- case 8: /* macroblock_escape */
- mba_inc += 33;
- /* pass through */
- case 15: /* macroblock_stuffing (MPEG1 only) */
- DUMPBITS (bit_buf, bits, 11);
- NEEDBITS (bit_buf, bits, bit_ptr);
- continue;
- default: /* end of slice, or error */
- if (mpeg2_cpu_state_restore)
- mpeg2_cpu_state_restore (&cpu_state);
- accel->xvmc_last_slice_code = code;
- return;
- }
- }
- DUMPBITS (bit_buf, bits, mba->len);
- mba_inc += mba->mba;
- if (mba_inc) {
- //TODO conversion to signed format signed format
- if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL &&
- !(picture->mc->xvmc_accel & SIGNED_INTRA)) {
- // original:
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
- } else { // MOTION_ACCEL+SIGNED_INTRA
- picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
- picture->dc_dct_pred[2] = 0;
- }
-
- picture->XvMC_cbp = 0;
- if (picture->picture_coding_type == P_TYPE) {
- picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
- picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
-
- do {
- if(picture->mc->xvmc_accel) {
-
- /* derive motion_type */
- if(picture->picture_structure == FRAME_PICTURE) {
- picture->XvMC_motion_type = XINE_MC_FRAME;
- } else {
- picture->XvMC_motion_type = XINE_MC_FIELD;
- /* predict from field of same parity */
- picture->XvMC_mv_field_sel[0][0] =
- picture->XvMC_mv_field_sel[0][1] =
- (picture->picture_structure==BOTTOM_FIELD);
- }
- picture->XvMC_mb_type = macroblock_modes & 0x1E;
- picture->XvMC_x = picture->offset/16;
- picture->XvMC_y = picture->v_offset/16;
-
- xvmc->proc_macro_block(picture->XvMC_x,picture->XvMC_y,
- picture->XvMC_mb_type,
- picture->XvMC_motion_type,
- picture->XvMC_mv_field_sel,
- picture->XvMC_dmvector,
- picture->XvMC_cbp,
- picture->XvMC_dct_type,
- picture->current_frame,
- picture->forward_reference_frame,
- picture->backward_reference_frame,
- picture->picture_structure,
- picture->second_field,
- picture->f_motion.pmv,
- picture->b_motion.pmv);
- } else {
- // MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
- }
- NEXT_MACROBLOCK;
- } while (--mba_inc);
- } else {
- do {
- if(picture->mc->xvmc_accel) {
-
- /* derive motion_type */
- if(picture->picture_structure == FRAME_PICTURE) {
- picture->XvMC_motion_type = XINE_MC_FRAME;
- } else {
- picture->XvMC_motion_type = XINE_MC_FIELD;
- /* predict from field of same parity */
- picture->XvMC_mv_field_sel[0][0] =
- picture->XvMC_mv_field_sel[0][1] =
- (picture->picture_structure==BOTTOM_FIELD);
- }
-
- picture->XvMC_mb_type = macroblock_modes & 0x1E;
- picture->XvMC_x = picture->offset/16;
- picture->XvMC_y = picture->v_offset/16;
-
- xvmc->proc_macro_block(picture->XvMC_x,picture->XvMC_y,
- picture->XvMC_mb_type,
- picture->XvMC_motion_type,
- picture->XvMC_mv_field_sel,
- picture->XvMC_dmvector,
- picture->XvMC_cbp,
- picture->XvMC_dct_type,
- picture->current_frame,
- picture->forward_reference_frame,
- picture->backward_reference_frame,
- picture->picture_structure,
- picture->second_field,
- picture->f_motion.pmv,
- picture->b_motion.pmv);
- } else {
- MOTION_CALL (motion_reuse, macroblock_modes);
- }
- NEXT_MACROBLOCK;
- } while (--mba_inc);
- }
- }
- }
- accel->xvmc_last_slice_code = code;
-#undef bit_buf
-#undef bits
-#undef bit_ptr
-}
-
diff --git a/src/libmpeg2/slice_xvmc_vld.c b/src/libmpeg2/slice_xvmc_vld.c
deleted file mode 100644
index cd4eca0a2..000000000
--- a/src/libmpeg2/slice_xvmc_vld.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (c) 2004 The Unichrome project. All rights reserved.
- *
- * 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, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTIES OR REPRESENTATIONS; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public 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 "xine_internal.h"
-#include "video_out.h"
-#include "mpeg2.h"
-#include "mpeg2_internal.h"
-#include "xvmc_vld.h"
-
-static const uint8_t zig_zag_scan[64] ATTR_ALIGN(16) =
-{
- /* Zig-Zag scan pattern */
- 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
-};
-
-static const uint8_t alternate_scan [64] ATTR_ALIGN(16) =
-{
- /* Alternate scan pattern */
- 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
-};
-
-void mpeg2_xxmc_slice( mpeg2dec_accel_t *accel, picture_t *picture,
- int code, uint8_t *buffer, uint32_t chunk_size,
- uint8_t *chunk_buffer)
-
-{
- vo_frame_t
- *frame = picture->current_frame;
- xine_xxmc_t
- *xxmc = (xine_xxmc_t *) frame->accel_data;
- xine_vld_frame_t
- *vft = &xxmc->vld_frame;
- unsigned
- mb_frame_height;
- int
- i;
- const uint8_t *
- scan_pattern;
- float
- ms_per_slice;
-
- if (1 == code && accel->xvmc_last_slice_code != 1) {
- frame->bad_frame = 1;
- accel->slices_per_row = 1;
- accel->row_slice_count = 1;
-
- /*
- * Check that first field went through OK. Otherwise,
- * indicate bad frame.
- */
-
- if (picture->second_field) {
- accel->xvmc_last_slice_code = (xxmc->decoded) ? 0 : -1;
- xxmc->decoded = 0;
- } else {
- accel->xvmc_last_slice_code = 0;
- }
-
- mb_frame_height =
- (!(picture->mpeg1) && (picture->progressive_sequence)) ?
- 2*((picture->coded_picture_height+31) >> 5) :
- (picture->coded_picture_height+15) >> 4;
- accel->xxmc_mb_pic_height = (picture->picture_structure == FRAME_PICTURE ) ?
- mb_frame_height : mb_frame_height >> 1;
-
- ms_per_slice = 1000. / (90000. * mb_frame_height) * frame->duration;
- xxmc->sleep = 1. / (ms_per_slice * 0.45);
- if (xxmc->sleep < 1.) xxmc->sleep = 1.;
-
- if (picture->mpeg1) {
- vft->mv_ranges[0][0] = picture->b_motion.f_code[0];
- vft->mv_ranges[0][1] = picture->b_motion.f_code[0];
- vft->mv_ranges[1][0] = picture->f_motion.f_code[0];
- vft->mv_ranges[1][1] = picture->f_motion.f_code[0];
- } else {
- vft->mv_ranges[0][0] = picture->b_motion.f_code[0];
- vft->mv_ranges[0][1] = picture->b_motion.f_code[1];
- vft->mv_ranges[1][0] = picture->f_motion.f_code[0];
- vft->mv_ranges[1][1] = picture->f_motion.f_code[1];
- }
-
- vft->picture_structure = picture->picture_structure;
- vft->picture_coding_type = picture->picture_coding_type;
- vft->mpeg_coding = (picture->mpeg1) ? 0 : 1;
- vft->progressive_sequence = picture->progressive_sequence;
- vft->scan = (picture->scan == mpeg2_scan_alt);
- vft->pred_dct_frame = picture->frame_pred_frame_dct;
- vft->concealment_motion_vectors =
- picture->concealment_motion_vectors;
- vft->q_scale_type = picture->q_scale_type;
- vft->intra_vlc_format = picture->intra_vlc_format;
- vft->intra_dc_precision = picture->intra_dc_precision;
- vft->second_field = picture->second_field;
-
- /*
- * Translation of libmpeg2's Q-matrix layout to VLD XvMC's.
- * Errors here will give
- * blocky artifacts and sometimes wrong colors.
- */
-
- scan_pattern = (vft->scan) ? alternate_scan : zig_zag_scan;
-
- if ((vft->load_intra_quantizer_matrix = picture->load_intra_quantizer_matrix)) {
- for (i=0; i<64; ++i) {
- vft->intra_quantizer_matrix[scan_pattern[i]] =
- picture->intra_quantizer_matrix[picture->scan[i]];
- }
- }
-
- if ((vft->load_non_intra_quantizer_matrix = picture->load_non_intra_quantizer_matrix)) {
- for (i=0; i<64; ++i) {
- vft->non_intra_quantizer_matrix[scan_pattern[i]] =
- picture->non_intra_quantizer_matrix[picture->scan[i]];
- }
- }
-
- picture->load_intra_quantizer_matrix = 0;
- picture->load_non_intra_quantizer_matrix = 0;
- vft->forward_reference_frame = picture->forward_reference_frame;
- vft->backward_reference_frame = picture->backward_reference_frame;
- xxmc->proc_xxmc_begin( frame );
- if (xxmc->result != 0) {
- accel->xvmc_last_slice_code=-1;
- }
- }
-
- if (((code == accel->xvmc_last_slice_code + 1) ||
- (code == accel->xvmc_last_slice_code))) {
-
- /*
- * Send this slice to the output plugin. May stall for a long
- * time in proc_slice;
- */
-
- frame->bad_frame = 1;
- xxmc->slice_data_size = chunk_size;
- xxmc->slice_data = chunk_buffer;
- xxmc->slice_code = code;
-
- xxmc->proc_xxmc_slice( frame );
-
- if (xxmc->result != 0) {
- accel->xvmc_last_slice_code=-1;
- return;
- }
- /*
- * Keep track of slices.
- */
-
- accel->row_slice_count = (accel->xvmc_last_slice_code == code) ?
- accel->row_slice_count + 1 : 1;
- accel->slices_per_row = (accel->row_slice_count > accel->slices_per_row) ?
- accel->row_slice_count:accel->slices_per_row;
- accel->xvmc_last_slice_code = code;
-
- } else {
-
- /*
- * An error has occured.
- */
-
- lprintf("libmpeg2: VLD XvMC: Slice error.\n");
- accel->xvmc_last_slice_code = -1;
- return;
- }
-}
-
-void mpeg2_xxmc_vld_frame_complete(mpeg2dec_accel_t *accel, picture_t *picture, int code)
-{
- vo_frame_t
- *frame = picture->current_frame;
- xine_xxmc_t
- *xxmc = (xine_xxmc_t *) frame->accel_data;
-
- if (xxmc->decoded) return;
- if (accel->xvmc_last_slice_code == -1) {
- xxmc->proc_xxmc_flush( frame );
- return;
- }
-
- if ((code != 0xff) || ((accel->xvmc_last_slice_code ==
- accel->xxmc_mb_pic_height) &&
- accel->slices_per_row == accel->row_slice_count)) {
-
- xxmc->proc_xxmc_flush( frame );
-
- if (xxmc->result) {
- accel->xvmc_last_slice_code=-1;
- frame->bad_frame = 1;
- return;
- }
- xxmc->decoded = 1;
- accel->xvmc_last_slice_code = 0;
- if (picture->picture_structure == 3 || picture->second_field) {
- if (xxmc->result == 0)
- frame->bad_frame = 0;
- }
- }
-}
diff --git a/src/libmpeg2/stats.c b/src/libmpeg2/stats.c
deleted file mode 100644
index 04de526f1..000000000
--- a/src/libmpeg2/stats.c
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * stats.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 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 <inttypes.h>
-
-#include "mpeg2_internal.h"
-
-static int debug_level = -1;
-
-/* Determine is debug output is required. */
-/* We could potentially have multiple levels of debug info */
-static int debug_is_on (void)
-{
- char * env_var;
-
- if (debug_level < 0) {
- env_var = getenv ("MPEG2_DEBUG");
-
- if (env_var)
- debug_level = 1;
- else
- debug_level = 0;
- }
-
- return debug_level;
-}
-
-static void stats_picture (uint8_t * buffer)
-{
- static char * picture_coding_type_str [8] = {
- "Invalid picture type",
- "I-type",
- "P-type",
- "B-type",
- "D (very bad)",
- "Invalid","Invalid","Invalid"
- };
-
- int picture_coding_type;
- int temporal_reference;
- int vbv_delay;
-
- temporal_reference = (buffer[0] << 2) | (buffer[1] >> 6);
- picture_coding_type = (buffer [1] >> 3) & 7;
- vbv_delay = ((buffer[1] << 13) | (buffer[2] << 5) |
- (buffer[3] >> 3)) & 0xffff;
-
- fprintf (stderr, " (picture) %s temporal_reference %d, vbv_delay %d\n",
- picture_coding_type_str [picture_coding_type],
- temporal_reference, vbv_delay);
-}
-
-static void stats_user_data (uint8_t * buffer)
-{
- fprintf (stderr, " (user_data)\n");
-}
-
-static void stats_sequence (uint8_t * buffer)
-{
- static char * aspect_ratio_information_str[8] = {
- "Invalid Aspect Ratio",
- "1:1",
- "4:3",
- "16:9",
- "2.21:1",
- "Invalid Aspect Ratio",
- "Invalid Aspect Ratio",
- "Invalid Aspect Ratio"
- };
- static char * frame_rate_str[16] = {
- "Invalid frame_rate_code",
- "23.976", "24", "25" , "29.97",
- "30" , "50", "59.94", "60" ,
- "Invalid frame_rate_code", "Invalid frame_rate_code",
- "Invalid frame_rate_code", "Invalid frame_rate_code",
- "Invalid frame_rate_code", "Invalid frame_rate_code",
- "Invalid frame_rate_code"
- };
-
- int horizontal_size;
- int vertical_size;
- int aspect_ratio_information;
- int frame_rate_code;
- int bit_rate_value;
- int vbv_buffer_size_value;
- int constrained_parameters_flag;
- int load_intra_quantizer_matrix;
- int load_non_intra_quantizer_matrix;
-
- vertical_size = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2];
- horizontal_size = vertical_size >> 12;
- vertical_size &= 0xfff;
- aspect_ratio_information = buffer[3] >> 4;
- frame_rate_code = buffer[3] & 15;
- bit_rate_value = (buffer[4] << 10) | (buffer[5] << 2) | (buffer[6] >> 6);
- vbv_buffer_size_value = ((buffer[6] << 5) | (buffer[7] >> 3)) & 0x3ff;
- constrained_parameters_flag = buffer[7] & 4;
- load_intra_quantizer_matrix = buffer[7] & 2;
- if (load_intra_quantizer_matrix)
- buffer += 64;
- load_non_intra_quantizer_matrix = buffer[7] & 1;
-
- fprintf (stderr, " (seq) %dx%d %s, %s fps, %5.0f kbps, VBV %d kB%s%s%s\n",
- horizontal_size, vertical_size,
- aspect_ratio_information_str [aspect_ratio_information],
- frame_rate_str [frame_rate_code],
- bit_rate_value * 400.0 / 1000.0,
- 2 * vbv_buffer_size_value,
- constrained_parameters_flag ? " , CP":"",
- load_intra_quantizer_matrix ? " , Custom Intra Matrix":"",
- load_non_intra_quantizer_matrix ? " , Custom Non-Intra Matrix":"");
-}
-
-static void stats_sequence_error (uint8_t * buffer)
-{
- fprintf (stderr, " (sequence_error)\n");
-}
-
-static void stats_sequence_end (uint8_t * buffer)
-{
- fprintf (stderr, " (sequence_end)\n");
-}
-
-static void stats_group (uint8_t * buffer)
-{
- fprintf (stderr, " (group)%s%s\n",
- (buffer[4] & 0x40) ? " closed_gop" : "",
- (buffer[4] & 0x20) ? " broken_link" : "");
-}
-
-static void stats_slice (int code, uint8_t * buffer)
-{
- /* fprintf (stderr, " (slice %d)\n", code); */
-}
-
-static void stats_sequence_extension (uint8_t * buffer)
-{
- static char * chroma_format_str[4] = {
- "Invalid Chroma Format",
- "4:2:0 Chroma",
- "4:2:2 Chroma",
- "4:4:4 Chroma"
- };
-
- int progressive_sequence;
- int chroma_format;
-
- progressive_sequence = (buffer[1] >> 3) & 1;
- chroma_format = (buffer[1] >> 1) & 3;
-
- fprintf (stderr, " (seq_ext) progressive_sequence %d, %s\n",
- progressive_sequence, chroma_format_str [chroma_format]);
-}
-
-static void stats_sequence_display_extension (uint8_t * buffer)
-{
- fprintf (stderr, " (sequence_display_extension)\n");
-}
-
-static void stats_quant_matrix_extension (uint8_t * buffer)
-{
- fprintf (stderr, " (quant_matrix_extension)\n");
-}
-
-static void stats_copyright_extension (uint8_t * buffer)
-{
- fprintf (stderr, " (copyright_extension)\n");
-}
-
-
-static void stats_sequence_scalable_extension (uint8_t * buffer)
-{
- fprintf (stderr, " (sequence_scalable_extension)\n");
-}
-
-static void stats_picture_display_extension (uint8_t * buffer)
-{
- fprintf (stderr, " (picture_display_extension)\n");
-}
-
-static void stats_picture_coding_extension (uint8_t * buffer)
-{
- static char * picture_structure_str[4] = {
- "Invalid Picture Structure",
- "Top field",
- "Bottom field",
- "Frame Picture"
- };
-
- int f_code[2][2];
- int intra_dc_precision;
- int picture_structure;
- int top_field_first;
- int frame_pred_frame_dct;
- int concealment_motion_vectors;
- int q_scale_type;
- int intra_vlc_format;
- int alternate_scan;
- int repeat_first_field;
- int progressive_frame;
-
- f_code[0][0] = buffer[0] & 15;
- f_code[0][1] = buffer[1] >> 4;
- f_code[1][0] = buffer[1] & 15;
- f_code[1][1] = buffer[2] >> 4;
- intra_dc_precision = (buffer[2] >> 2) & 3;
- picture_structure = buffer[2] & 3;
- top_field_first = buffer[3] >> 7;
- frame_pred_frame_dct = (buffer[3] >> 6) & 1;
- concealment_motion_vectors = (buffer[3] >> 5) & 1;
- q_scale_type = (buffer[3] >> 4) & 1;
- intra_vlc_format = (buffer[3] >> 3) & 1;
- alternate_scan = (buffer[3] >> 2) & 1;
- repeat_first_field = (buffer[3] >> 1) & 1;
- progressive_frame = buffer[4] >> 7;
-
- fprintf (stderr,
- " (pic_ext) %s\n", picture_structure_str [picture_structure]);
- fprintf (stderr,
- " (pic_ext) forward horizontal f_code % d, forward vertical f_code % d\n",
- f_code[0][0], f_code[0][1]);
- fprintf (stderr,
- " (pic_ext) backward horizontal f_code % d, backward vertical f_code % d\n",
- f_code[1][0], f_code[1][1]);
- fprintf (stderr,
- " (pic_ext) intra_dc_precision %d, top_field_first %d, frame_pred_frame_dct %d\n",
- intra_dc_precision, top_field_first, frame_pred_frame_dct);
- fprintf (stderr,
- " (pic_ext) concealment_motion_vectors %d, q_scale_type %d, intra_vlc_format %d\n",
- concealment_motion_vectors, q_scale_type, intra_vlc_format);
- fprintf (stderr,
- " (pic_ext) alternate_scan %d, repeat_first_field %d, progressive_frame %d\n",
- alternate_scan, repeat_first_field, progressive_frame);
-}
-
-void mpeg2_stats (int code, uint8_t * buffer)
-{
- if (! (debug_is_on ()))
- return;
-
- switch (code) {
- case 0x00:
- stats_picture (buffer);
- break;
- case 0xb2:
- stats_user_data (buffer);
- break;
- case 0xb3:
- stats_sequence (buffer);
- break;
- case 0xb4:
- stats_sequence_error (buffer);
- break;
- case 0xb5:
- switch (buffer[0] >> 4) {
- case 1:
- stats_sequence_extension (buffer);
- break;
- case 2:
- stats_sequence_display_extension (buffer);
- break;
- case 3:
- stats_quant_matrix_extension (buffer);
- break;
- case 4:
- stats_copyright_extension (buffer);
- break;
- case 5:
- stats_sequence_scalable_extension (buffer);
- break;
- case 7:
- stats_picture_display_extension (buffer);
- break;
- case 8:
- stats_picture_coding_extension (buffer);
- break;
- default:
- fprintf (stderr, " (unknown extension %#x)\n", buffer[0] >> 4);
- }
- break;
- case 0xb7:
- stats_sequence_end (buffer);
- break;
- case 0xb8:
- stats_group (buffer);
- break;
- default:
- if (code < 0xb0)
- stats_slice (code, buffer);
- else
- fprintf (stderr, " (unknown start code %#02x)\n", code);
- }
-}
diff --git a/src/libmpeg2/xine_mpeg2_decoder.c b/src/libmpeg2/xine_mpeg2_decoder.c
deleted file mode 100644
index 75bc829c9..000000000
--- a/src/libmpeg2/xine_mpeg2_decoder.c
+++ /dev/null
@@ -1,186 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * stuff needed to turn libmpeg2 into a xine decoder plugin
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#define LOG_MODULE "mpeg2_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "mpeg2.h"
-#include "mpeg2_internal.h"
-#include "buffer.h"
-
-typedef struct {
- video_decoder_class_t decoder_class;
-} mpeg2_class_t;
-
-
-typedef struct mpeg2dec_decoder_s {
- video_decoder_t video_decoder;
- mpeg2dec_t mpeg2;
- mpeg2_class_t *class;
- xine_stream_t *stream;
-} mpeg2dec_decoder_t;
-
-static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
- mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
-
- lprintf ("decode_data, flags=0x%08x ...\n", buf->decoder_flags);
-
- /* handle aspect hints from xine-dvdnav */
- if (buf->decoder_flags & BUF_FLAG_SPECIAL) {
- if (buf->decoder_info[1] == BUF_SPECIAL_ASPECT) {
- this->mpeg2.force_aspect = buf->decoder_info[2];
- if (buf->decoder_info[3] == 0x1 && buf->decoder_info[2] == 3)
- /* letterboxing is denied, we have to do pan&scan */
- this->mpeg2.force_pan_scan = 1;
- else
- this->mpeg2.force_pan_scan = 0;
- }
- return;
- }
-
- if (buf->decoder_flags & BUF_FLAG_PREVIEW) {
- mpeg2_find_sequence_header (&this->mpeg2, buf->content, buf->content + buf->size);
- } else {
-
- mpeg2_decode_data (&this->mpeg2, buf->content, buf->content + buf->size,
- buf->pts);
- }
-
- lprintf ("decode_data...done\n");
-}
-
-static void mpeg2dec_flush (video_decoder_t *this_gen) {
- mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
-
- lprintf ("flush\n");
-
- mpeg2_flush (&this->mpeg2);
-}
-
-static void mpeg2dec_reset (video_decoder_t *this_gen) {
- mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
-
- mpeg2_reset (&this->mpeg2);
-}
-
-static void mpeg2dec_discontinuity (video_decoder_t *this_gen) {
- mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
-
- mpeg2_discontinuity (&this->mpeg2);
-}
-
-static void mpeg2dec_dispose (video_decoder_t *this_gen) {
-
- mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
-
- lprintf ("close\n");
-
- mpeg2_close (&this->mpeg2);
-
- this->stream->video_out->close(this->stream->video_out, this->stream);
-
- free (this);
-}
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
- mpeg2dec_decoder_t *this ;
-
- this = (mpeg2dec_decoder_t *) calloc(1, sizeof(mpeg2dec_decoder_t));
-
- this->video_decoder.decode_data = mpeg2dec_decode_data;
- this->video_decoder.flush = mpeg2dec_flush;
- this->video_decoder.reset = mpeg2dec_reset;
- this->video_decoder.discontinuity = mpeg2dec_discontinuity;
- this->video_decoder.dispose = mpeg2dec_dispose;
- this->stream = stream;
- this->class = (mpeg2_class_t *) class_gen;
- this->mpeg2.stream = stream;
-
- mpeg2_init (&this->mpeg2, stream->video_out);
- (stream->video_out->open) (stream->video_out, stream);
- this->mpeg2.force_aspect = this->mpeg2.force_pan_scan = 0;
-
- return &this->video_decoder;
-}
-
-/*
- * mpeg2 plugin class
- */
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "mpeg2dec";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "mpeg2 based video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- mpeg2_class_t *this;
-
- this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-/*
- * exported plugin catalog entry
- */
-
-static uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
-
-static const decoder_info_t dec_info_mpeg2 = {
- supported_types, /* supported types */
- 7 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libmpeg2new/Makefile.am b/src/libmpeg2new/Makefile.am
deleted file mode 100644
index 924a9c661..000000000
--- a/src/libmpeg2new/Makefile.am
+++ /dev/null
@@ -1,18 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-SUBDIRS = include libmpeg2
-
-if ENABLE_MPEG2NEW
-mpeg2new_module = xineplug_decode_mpeg2new.la
-endif
-
-xineplug_LTLIBRARIES = $(mpeg2new_module)
-
-xineplug_decode_mpeg2new_la_SOURCES = \
- xine_mpeg2new_decoder.c
-
-xineplug_decode_mpeg2new_la_CFLAGS = $(VISIBILITY_FLAG) $(LIBMPEG2_CFLAGS)
-xineplug_decode_mpeg2new_la_LIBADD = $(XINE_LIB) libmpeg2/libmpeg2.la
-xineplug_decode_mpeg2new_la_LDFLAGS = $(xineplug_ldflags)
-
diff --git a/src/libmpeg2new/include/Makefile.am b/src/libmpeg2new/include/Makefile.am
deleted file mode 100644
index 91d5575ee..000000000
--- a/src/libmpeg2new/include/Makefile.am
+++ /dev/null
@@ -1,4 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = video_out.h mmx.h alpha_asm.h vis.h attributes.h tendra.h mpeg2.h mpeg2convert.h
diff --git a/src/libmpeg2new/include/attributes.h b/src/libmpeg2new/include/attributes.h
deleted file mode 100644
index 92db86e7e..000000000
--- a/src/libmpeg2new/include/attributes.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * attributes.h
- * 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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* use gcc attribs to align critical data structures */
-#include "../../xine-utils/attributes.h"
-
-#ifdef HAVE_BUILTIN_EXPECT
-#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
diff --git a/src/libmpeg2new/libmpeg2/Makefile.am b/src/libmpeg2new/libmpeg2/Makefile.am
deleted file mode 100644
index 0bfeda1ce..000000000
--- a/src/libmpeg2new/libmpeg2/Makefile.am
+++ /dev/null
@@ -1,20 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-if ENABLE_MPEG2NEW
-mpeg2new_libs = libmpeg2.la libmpeg2arch.la
-endif
-
-noinst_LTLIBRARIES = $(mpeg2new_libs)
-
-libmpeg2_la_SOURCES = alloc.c header.c decode.c slice.c motion_comp.c idct.c
-libmpeg2_la_LIBADD = libmpeg2arch.la
-
-AM_CPPFLAGS = -I$(srcdir)/../include
-
-libmpeg2arch_la_SOURCES = motion_comp_mmx.c idct_mmx.c \
- motion_comp_altivec.c idct_altivec.c \
- motion_comp_alpha.c idct_alpha.c \
- motion_comp_vis.c \
- cpu_accel.c cpu_state.c
-
-EXTRA_DIST = mpeg2_internal.h vlc.h
diff --git a/src/libmpeg2new/libmpeg2/idct_alpha.c b/src/libmpeg2new/libmpeg2/idct_alpha.c
deleted file mode 100644
index 8f9beaf22..000000000
--- a/src/libmpeg2new/libmpeg2/idct_alpha.c
+++ /dev/null
@@ -1,379 +0,0 @@
-/*
- * idct_alpha.c
- * Copyright (C) 2002-2003 Falk Hueffner <falk@debian.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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#ifdef ARCH_ALPHA
-
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "mpeg2.h"
-#include "attributes.h"
-#include "mpeg2_internal.h"
-#include "alpha_asm.h"
-
-#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 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) */
-
-extern uint8_t mpeg2_clip[3840 * 2 + 256];
-#define CLIP(i) ((mpeg2_clip + 3840)[i])
-
-#if 0
-#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \
-do { \
- t0 = W0 * d0 + W1 * d1; \
- t1 = W0 * d1 - W1 * d0; \
-} while (0)
-#else
-#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \
-do { \
- int_fast32_t tmp = W0 * (d0 + d1); \
- t0 = tmp + (W1 - W0) * d1; \
- t1 = tmp - (W1 + W0) * d0; \
-} while (0)
-#endif
-
-static void inline idct_row (int16_t * const block)
-{
- uint64_t l, r;
- int_fast32_t d0, d1, d2, d3;
- int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
- int_fast32_t t0, t1, t2, t3;
-
- l = ldq (block);
- r = ldq (block + 4);
-
- /* shortcut */
- if (likely (!((l & ~0xffffUL) | r))) {
- uint64_t tmp = (uint16_t) (l >> 1);
- tmp |= tmp << 16;
- tmp |= tmp << 32;
- ((int32_t *)block)[0] = tmp;
- ((int32_t *)block)[1] = tmp;
- ((int32_t *)block)[2] = tmp;
- ((int32_t *)block)[3] = tmp;
- return;
- }
-
- d0 = (sextw (l) << 11) + 2048;
- d1 = sextw (extwl (l, 2));
- d2 = sextw (extwl (l, 4)) << 11;
- d3 = sextw (extwl (l, 6));
- t0 = d0 + d2;
- t1 = d0 - d2;
- BUTTERFLY (t2, t3, W6, W2, d3, d1);
- a0 = t0 + t2;
- a1 = t1 + t3;
- a2 = t1 - t3;
- a3 = t0 - t2;
-
- d0 = sextw (r);
- d1 = sextw (extwl (r, 2));
- d2 = sextw (extwl (r, 4));
- d3 = sextw (extwl (r, 6));
- BUTTERFLY (t0, t1, W7, W1, d3, d0);
- BUTTERFLY (t2, t3, W3, W5, d1, d2);
- b0 = t0 + t2;
- b3 = t1 + t3;
- t0 -= t2;
- t1 -= t3;
- b1 = ((t0 + t1) >> 8) * 181;
- b2 = ((t0 - t1) >> 8) * 181;
-
- block[0] = (a0 + b0) >> 12;
- block[1] = (a1 + b1) >> 12;
- block[2] = (a2 + b2) >> 12;
- block[3] = (a3 + b3) >> 12;
- block[4] = (a3 - b3) >> 12;
- block[5] = (a2 - b2) >> 12;
- block[6] = (a1 - b1) >> 12;
- block[7] = (a0 - b0) >> 12;
-}
-
-static void inline idct_col (int16_t * const block)
-{
- int_fast32_t d0, d1, d2, d3;
- int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
- int_fast32_t t0, t1, t2, t3;
-
- d0 = (block[8*0] << 11) + 65536;
- d1 = block[8*1];
- d2 = block[8*2] << 11;
- d3 = block[8*3];
- t0 = d0 + d2;
- t1 = d0 - d2;
- BUTTERFLY (t2, t3, W6, W2, d3, d1);
- a0 = t0 + t2;
- a1 = t1 + t3;
- a2 = t1 - t3;
- a3 = t0 - t2;
-
- d0 = block[8*4];
- d1 = block[8*5];
- d2 = block[8*6];
- d3 = block[8*7];
- BUTTERFLY (t0, t1, W7, W1, d3, d0);
- BUTTERFLY (t2, t3, W3, W5, d1, d2);
- b0 = t0 + t2;
- b3 = t1 + t3;
- t0 -= t2;
- t1 -= t3;
- b1 = ((t0 + t1) >> 8) * 181;
- b2 = ((t0 - t1) >> 8) * 181;
-
- block[8*0] = (a0 + b0) >> 17;
- block[8*1] = (a1 + b1) >> 17;
- block[8*2] = (a2 + b2) >> 17;
- block[8*3] = (a3 + b3) >> 17;
- block[8*4] = (a3 - b3) >> 17;
- block[8*5] = (a2 - b2) >> 17;
- block[8*6] = (a1 - b1) >> 17;
- block[8*7] = (a0 - b0) >> 17;
-}
-
-void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride)
-{
- uint64_t clampmask;
- int i;
-
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
-
- for (i = 0; i < 8; i++)
- idct_col (block + i);
-
- clampmask = zap (-1, 0xaa); /* 0x00ff00ff00ff00ff */
- do {
- uint64_t shorts0, shorts1;
-
- shorts0 = ldq (block);
- shorts0 = maxsw4 (shorts0, 0);
- shorts0 = minsw4 (shorts0, clampmask);
- stl (pkwb (shorts0), dest);
-
- shorts1 = ldq (block + 4);
- shorts1 = maxsw4 (shorts1, 0);
- shorts1 = minsw4 (shorts1, clampmask);
- stl (pkwb (shorts1), dest + 4);
-
- stq (0, block);
- stq (0, block + 4);
-
- dest += stride;
- block += 8;
- } while (--i);
-}
-
-void mpeg2_idct_add_mvi (const int last, int16_t * block,
- uint8_t * dest, const int stride)
-{
- uint64_t clampmask;
- uint64_t signmask;
- int i;
-
- if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) {
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
- for (i = 0; i < 8; i++)
- idct_col (block + i);
- clampmask = zap (-1, 0xaa); /* 0x00ff00ff00ff00ff */
- 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 (dest));
- /* 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 (dest + 4));
- signs1 = shorts1 & signmask;
- shorts1 &= ~signmask;
- shorts1 += pix1;
- shorts1 ^= signs1;
- shorts1 = maxsw4 (shorts1, 0);
- shorts1 = minsw4 (shorts1, clampmask);
-
- stl (pkwb (shorts0), dest);
- stl (pkwb (shorts1), dest + 4);
- stq (0, block);
- stq (0, block + 4);
-
- dest += stride;
- block += 8;
- } while (--i);
- } else {
- int DC;
- uint64_t p0, p1, p2, p3, p4, p5, p6, p7;
- uint64_t DCs;
-
- DC = (block[0] + 64) >> 7;
- block[0] = block[63] = 0;
-
- p0 = ldq (dest + 0 * stride);
- p1 = ldq (dest + 1 * stride);
- p2 = ldq (dest + 2 * stride);
- p3 = ldq (dest + 3 * stride);
- p4 = ldq (dest + 4 * stride);
- p5 = ldq (dest + 5 * stride);
- p6 = ldq (dest + 6 * stride);
- p7 = ldq (dest + 7 * stride);
-
- if (DC > 0) {
- DCs = BYTE_VEC (likely (DC <= 255) ? DC : 255);
- p0 += minub8 (DCs, ~p0);
- p1 += minub8 (DCs, ~p1);
- p2 += minub8 (DCs, ~p2);
- p3 += minub8 (DCs, ~p3);
- p4 += minub8 (DCs, ~p4);
- p5 += minub8 (DCs, ~p5);
- p6 += minub8 (DCs, ~p6);
- p7 += minub8 (DCs, ~p7);
- } else {
- DCs = BYTE_VEC (likely (-DC <= 255) ? -DC : 255);
- p0 -= minub8 (DCs, p0);
- p1 -= minub8 (DCs, p1);
- p2 -= minub8 (DCs, p2);
- p3 -= minub8 (DCs, p3);
- p4 -= minub8 (DCs, p4);
- p5 -= minub8 (DCs, p5);
- p6 -= minub8 (DCs, p6);
- p7 -= minub8 (DCs, p7);
- }
-
- stq (p0, dest + 0 * stride);
- stq (p1, dest + 1 * stride);
- stq (p2, dest + 2 * stride);
- stq (p3, dest + 3 * stride);
- stq (p4, dest + 4 * stride);
- stq (p5, dest + 5 * stride);
- stq (p6, dest + 6 * stride);
- stq (p7, dest + 7 * stride);
- }
-}
-
-void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
-{
- int i;
-
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
- for (i = 0; i < 8; i++)
- idct_col (block + i);
- do {
- dest[0] = CLIP (block[0]);
- dest[1] = CLIP (block[1]);
- dest[2] = CLIP (block[2]);
- dest[3] = CLIP (block[3]);
- dest[4] = CLIP (block[4]);
- dest[5] = CLIP (block[5]);
- dest[6] = CLIP (block[6]);
- dest[7] = CLIP (block[7]);
-
- stq(0, block);
- stq(0, block + 4);
-
- dest += stride;
- block += 8;
- } while (--i);
-}
-
-void mpeg2_idct_add_alpha (const int last, int16_t * block,
- uint8_t * dest, const int stride)
-{
- int i;
-
- if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) {
- for (i = 0; i < 8; i++)
- idct_row (block + 8 * i);
- for (i = 0; i < 8; i++)
- idct_col (block + i);
- do {
- dest[0] = CLIP (block[0] + dest[0]);
- dest[1] = CLIP (block[1] + dest[1]);
- dest[2] = CLIP (block[2] + dest[2]);
- dest[3] = CLIP (block[3] + dest[3]);
- dest[4] = CLIP (block[4] + dest[4]);
- dest[5] = CLIP (block[5] + dest[5]);
- dest[6] = CLIP (block[6] + dest[6]);
- dest[7] = CLIP (block[7] + dest[7]);
-
- stq(0, block);
- stq(0, block + 4);
-
- dest += stride;
- block += 8;
- } while (--i);
- } else {
- int DC;
-
- DC = (block[0] + 64) >> 7;
- block[0] = block[63] = 0;
- i = 8;
- do {
- dest[0] = CLIP (DC + dest[0]);
- dest[1] = CLIP (DC + dest[1]);
- dest[2] = CLIP (DC + dest[2]);
- dest[3] = CLIP (DC + dest[3]);
- dest[4] = CLIP (DC + dest[4]);
- dest[5] = CLIP (DC + dest[5]);
- dest[6] = CLIP (DC + dest[6]);
- dest[7] = CLIP (DC + dest[7]);
- dest += stride;
- } while (--i);
- }
-}
-
-void mpeg2_idct_alpha_init (void)
-{
- extern uint8_t mpeg2_scan_norm[64];
- extern uint8_t mpeg2_scan_alt[64];
- int i, j;
-
- for (i = 0; i < 64; i++) {
- j = mpeg2_scan_norm[i];
- mpeg2_scan_norm[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2);
- j = mpeg2_scan_alt[i];
- mpeg2_scan_alt[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2);
- }
-}
-
-#endif /* ARCH_ALPHA */
diff --git a/src/libmpeg2new/libmpeg2/idct_altivec.c b/src/libmpeg2new/libmpeg2/idct_altivec.c
deleted file mode 100644
index 6b1b8586c..000000000
--- a/src/libmpeg2new/libmpeg2/idct_altivec.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * idct_altivec.c
- * 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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#ifdef ARCH_PPC
-
-#ifdef HAVE_ALTIVEC_H
-#include <altivec.h>
-#endif
-#include <inttypes.h>
-
-#include "mpeg2.h"
-#include "attributes.h"
-#include "mpeg2_internal.h"
-
-typedef vector signed char vector_s8_t;
-typedef vector unsigned char vector_u8_t;
-typedef vector signed short vector_s16_t;
-typedef vector unsigned short vector_u16_t;
-typedef vector signed int vector_s32_t;
-typedef vector unsigned int vector_u32_t;
-
-#if defined(HAVE_ALTIVEC_H) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
-/* work around gcc <3.3 vec_mergel bug */
-static inline vector_s16_t my_vec_mergel (vector_s16_t const A,
- vector_s16_t const B)
-{
- static const vector_u8_t mergel = {
- 0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b,
- 0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f
- };
- return vec_perm (A, B, mergel);
-}
-#undef vec_mergel
-#define vec_mergel my_vec_mergel
-#endif
-
-#ifdef HAVE_ALTIVEC_H /* gnu */
-#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h}
-#else /* apple */
-#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h)
-#endif
-
-static const vector_s16_t constants ATTR_ALIGN(16) =
- VEC_S16 (23170, 13573, 6518, 21895, -23170, -21895, 32, 31);
-static const vector_s16_t constants_1 ATTR_ALIGN(16) =
- VEC_S16 (16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725);
-static const vector_s16_t constants_2 ATTR_ALIGN(16) =
- VEC_S16 (16069, 22289, 20995, 18895, 16069, 18895, 20995, 22289);
-static const vector_s16_t constants_3 ATTR_ALIGN(16) =
- VEC_S16 (21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692);
-static const vector_s16_t constants_4 ATTR_ALIGN(16) =
- VEC_S16 (13623, 18895, 17799, 16019, 13623, 16019, 17799, 18895);
-
-#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); \
- a0 = vec_splat (constants, 1); \
- a1 = vec_splat (constants, 2); \
- a2 = vec_splat (constants, 3); \
- mc4 = vec_splat (constants, 4); \
- ma2 = vec_splat (constants, 5); \
- bias = (vector_s16_t)vec_splat ((vector_s32_t)constants, 3); \
- \
- zero = vec_splat_s16 (0); \
- \
- vx0 = vec_adds (block[0], block[4]); \
- vx4 = vec_subs (block[0], block[4]); \
- t5 = vec_mradds (vx0, constants_1, zero); \
- t0 = vec_mradds (vx4, constants_1, zero); \
- \
- vx1 = vec_mradds (a1, block[7], block[1]); \
- vx7 = vec_mradds (a1, block[1], vec_subs (zero, block[7])); \
- t1 = vec_mradds (vx1, constants_2, zero); \
- t8 = vec_mradds (vx7, constants_2, zero); \
- \
- vx2 = vec_mradds (a0, block[6], block[2]); \
- vx6 = vec_mradds (a0, block[2], vec_subs (zero, block[6])); \
- t2 = vec_mradds (vx2, constants_3, zero); \
- t4 = vec_mradds (vx6, constants_3, zero); \
- \
- vx3 = vec_mradds (block[3], constants_4, zero); \
- vx5 = vec_mradds (block[5], constants_4, zero); \
- t7 = vec_mradds (a2, vx5, vx3); \
- t3 = vec_mradds (ma2, vx3, vx5); \
- \
- t6 = vec_adds (t8, t3); \
- t3 = vec_subs (t8, t3); \
- t8 = vec_subs (t1, t7); \
- t1 = vec_adds (t1, t7); \
- t6 = vec_mradds (a0, t6, t6); /* a0+1 == 2*c4 */ \
- t1 = vec_mradds (a0, t1, t1); /* a0+1 == 2*c4 */ \
- \
- 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); \
- \
- vy0 = vec_adds (t7, t1); \
- vy7 = vec_subs (t7, t1); \
- vy1 = vec_adds (t5, t3); \
- vy6 = vec_subs (t5, t3); \
- vy2 = vec_adds (t0, t4); \
- vy5 = vec_subs (t0, t4); \
- vy3 = vec_adds (t2, t6); \
- vy4 = vec_subs (t2, t6); \
- \
- 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_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); \
- \
- vx0 = vec_adds (vx0, bias); \
- t5 = vec_adds (vx0, vx4); \
- t0 = vec_subs (vx0, vx4); \
- \
- t1 = vec_mradds (a1, vx7, vx1); \
- t8 = vec_mradds (a1, vx1, vec_subs (zero, vx7)); \
- \
- t2 = vec_mradds (a0, vx6, vx2); \
- t4 = vec_mradds (a0, vx2, vec_subs (zero, vx6)); \
- \
- t7 = vec_mradds (a2, vx5, vx3); \
- t3 = vec_mradds (ma2, vx3, vx5); \
- \
- t6 = vec_adds (t8, t3); \
- t3 = vec_subs (t8, t3); \
- t8 = vec_subs (t1, t7); \
- t1 = vec_adds (t1, t7); \
- \
- 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); \
- \
- 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); \
- \
- 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);
-
-void mpeg2_idct_copy_altivec (int16_t * const _block, uint8_t * dest,
- const int stride)
-{
- vector_s16_t * const block = (vector_s16_t *)_block;
- vector_u8_t tmp;
-
- 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)
-
- block[0] = block[1] = block[2] = block[3] = zero;
- block[4] = block[5] = block[6] = block[7] = zero;
-}
-
-void mpeg2_idct_add_altivec (const int last, int16_t * const _block,
- uint8_t * dest, const int stride)
-{
- vector_s16_t * const block = (vector_s16_t *)_block;
- vector_u8_t tmp;
- vector_s16_t tmp2, tmp3;
- vector_u8_t perm0;
- vector_u8_t perm1;
- vector_u8_t p0, p1, p;
-
- 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)
-
- block[0] = block[1] = block[2] = block[3] = zero;
- block[4] = block[5] = block[6] = block[7] = zero;
-}
-
-void mpeg2_idct_altivec_init (void)
-{
- extern uint8_t mpeg2_scan_norm[64];
- extern uint8_t mpeg2_scan_alt[64];
- int i, j;
-
- /* the altivec idct uses a transposed input, so we patch scan tables */
- for (i = 0; i < 64; i++) {
- j = mpeg2_scan_norm[i];
- mpeg2_scan_norm[i] = (j >> 3) | ((j & 7) << 3);
- j = mpeg2_scan_alt[i];
- mpeg2_scan_alt[i] = (j >> 3) | ((j & 7) << 3);
- }
-}
-
-#endif
diff --git a/src/libmpeg2new/libmpeg2/rgb.c b/src/libmpeg2new/libmpeg2/rgb.c
deleted file mode 100644
index 8863b0b9f..000000000
--- a/src/libmpeg2new/libmpeg2/rgb.c
+++ /dev/null
@@ -1,598 +0,0 @@
-/*
- * rgb.c
- * 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 mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 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 "attributes.h"
-
-#include <inttypes.h>
-
-#include "mpeg2.h"
-#include "mpeg2convert.h"
-#include "convert_internal.h"
-
-static int matrix_coefficients = 6;
-
-static const int Inverse_Table_6_9[8][4] = {
- {117504, 138453, 13954, 34903}, /* no sequence_display_extension */
- {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */
- {104597, 132201, 25675, 53279}, /* unspecified */
- {104597, 132201, 25675, 53279}, /* reserved */
- {104448, 132798, 24759, 53109}, /* FCC */
- {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */
- {104597, 132201, 25675, 53279}, /* SMPTE 170M */
- {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */
-};
-
-static const uint8_t dither[] ATTR_ALIGN(32) = {
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
- 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
- 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
- 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
- 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
- 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
- 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
- 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
- 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
- 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
- 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
- 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
- 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
- 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
- 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
- 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
- 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
- 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
- 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
- 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
- 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
- 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
- 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
- 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
- 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
- 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
- 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
- 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
- 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
- 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35
-};
-
-static const uint8_t dither_temporal[64] = {
- 0x00, 0x20, 0x21, 0x01, 0x40, 0x60, 0x61, 0x41,
- 0x42, 0x62, 0x63, 0x43, 0x02, 0x22, 0x23, 0x03,
- 0x80, 0xa0, 0xa1, 0x81, 0xc0, 0xe0, 0xe1, 0xc1,
- 0xc2, 0xe2, 0xe3, 0xc3, 0x82, 0xa2, 0xa3, 0x83,
- 0x84, 0xa4, 0xa5, 0x85, 0xc4, 0xe4, 0xe5, 0xc5,
- 0xc6, 0xe6, 0xe7, 0xc7, 0x86, 0xa6, 0xa7, 0x87,
- 0x04, 0x24, 0x25, 0x05, 0x44, 0x64, 0x65, 0x45,
- 0x46, 0x66, 0x67, 0x47, 0x06, 0x26, 0x27, 0x07
-};
-
-typedef struct {
- convert_rgb_t base;
- void * table_rV[256];
- void * table_gU[256];
- int table_gV[256];
- void * table_bU[256];
-} convert_rgb_c_t;
-
-#define RGB(type,i) \
- U = pu[i]; \
- V = pv[i]; \
- r = (type *) id->table_rV[V]; \
- g = (type *) (((uint8_t *)id->table_gU[U]) + id->table_gV[V]); \
- b = (type *) id->table_bU[U];
-
-#define DST(py,dst,i,j) \
- Y = py[i]; \
- dst[i] = r[Y] + g[Y] + b[Y];
-
-#define DSTRGB(py,dst,i,j) \
- Y = py[i]; \
- dst[3*i] = r[Y]; dst[3*i+1] = g[Y]; dst[3*i+2] = b[Y];
-
-#define DSTBGR(py,dst,i,j) \
- Y = py[i]; \
- dst[3*i] = b[Y]; dst[3*i+1] = g[Y]; dst[3*i+2] = r[Y];
-
-#define DSTDITHER(py,dst,i,j) \
- Y = py[i]; \
- dst[i] = r[Y+pd[2*i+96*j]] + g[Y-pd[2*i+96*j]] + b[Y+pd[2*i+1+96*j]];
-
-#define DO(x) x
-#define SKIP(x)
-
-#define DECLARE_420(func,type,num,DST,DITHER) \
-static void func (void * _id, uint8_t * const * src, \
- unsigned int v_offset) \
-{ \
- const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \
- type * dst_1; \
- const uint8_t * py_1, * pu, * pv; \
- int i; \
- DITHER(uint8_t dithpos = id->base.dither_offset;) \
- \
- dst_1 = (type *)(id->base.rgb_ptr + id->base.rgb_slice * v_offset); \
- py_1 = src[0]; pu = src[1]; pv = src[2]; \
- \
- i = 8; \
- do { \
- const uint8_t * py_2; \
- int j, U, V, Y; \
- const type * r, * g, * b; \
- type * dst_2; \
- DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \
- \
- dst_2 = (type *)((char *)dst_1 + id->base.rgb_stride); \
- py_2 = py_1 + id->base.y_stride; \
- j = id->base.width; \
- do { \
- RGB (type, 0) \
- DST (py_1, dst_1, 0, 0) \
- DST (py_1, dst_1, 1, 0) \
- DST (py_2, dst_2, 0, 1) \
- DST (py_2, dst_2, 1, 1) \
- \
- RGB (type, 1) \
- DST (py_2, dst_2, 2, 1) \
- DST (py_2, dst_2, 3, 1) \
- DST (py_1, dst_1, 2, 0) \
- DST (py_1, dst_1, 3, 0) \
- \
- RGB (type, 2) \
- DST (py_1, dst_1, 4, 0) \
- DST (py_1, dst_1, 5, 0) \
- DST (py_2, dst_2, 4, 1) \
- DST (py_2, dst_2, 5, 1) \
- \
- RGB (type, 3) \
- DST (py_2, dst_2, 6, 1) \
- DST (py_2, dst_2, 7, 1) \
- DST (py_1, dst_1, 6, 0) \
- DST (py_1, dst_1, 7, 0) \
- \
- pu += 4; \
- pv += 4; \
- py_1 += 8; \
- py_2 += 8; \
- dst_1 += 8 * num; \
- dst_2 += 8 * num; \
- } while (--j); \
- if (--i == id->base.field) { \
- dst_1 = (type *)(id->base.rgb_ptr + \
- id->base.rgb_slice * (v_offset + 1)); \
- py_1 = src[0] + id->base.y_stride_frame; \
- pu = src[1] + id->base.uv_stride_frame; \
- pv = src[2] + id->base.uv_stride_frame; \
- } else { \
- py_1 += id->base.y_increm; \
- pu += id->base.uv_increm; \
- pv += id->base.uv_increm; \
- dst_1 = (type *)((char *)dst_1 + id->base.rgb_increm); \
- DITHER(dithpos += id->base.dither_stride;) \
- } \
- } while (i); \
-}
-
-DECLARE_420 (rgb_c_32_420, uint32_t, 1, DST, SKIP)
-DECLARE_420 (rgb_c_24_rgb_420, uint8_t, 3, DSTRGB, SKIP)
-DECLARE_420 (rgb_c_24_bgr_420, uint8_t, 3, DSTBGR, SKIP)
-DECLARE_420 (rgb_c_16_420, uint16_t, 1, DST, SKIP)
-DECLARE_420 (rgb_c_8_420, uint8_t, 1, DSTDITHER, DO)
-
-#define DECLARE_422(func,type,num,DST,DITHER) \
-static void func (void * _id, uint8_t * const * src, \
- unsigned int v_offset) \
-{ \
- const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \
- type * dst; \
- const uint8_t * py, * pu, * pv; \
- int i; \
- DITHER(uint8_t dithpos = id->base.dither_offset;) \
- \
- dst = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset); \
- py = src[0]; pu = src[1]; pv = src[2]; \
- \
- i = 16; \
- do { \
- int j, U, V, Y; \
- const type * r, * g, * b; \
- DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \
- \
- j = id->base.width; \
- do { \
- RGB (type, 0) \
- DST (py, dst, 0, 0) \
- DST (py, dst, 1, 0) \
- \
- RGB (type, 1) \
- DST (py, dst, 2, 0) \
- DST (py, dst, 3, 0) \
- \
- RGB (type, 2) \
- DST (py, dst, 4, 0) \
- DST (py, dst, 5, 0) \
- \
- RGB (type, 3) \
- DST (py, dst, 6, 0) \
- DST (py, dst, 7, 0) \
- \
- pu += 4; \
- pv += 4; \
- py += 8; \
- dst += 8 * num; \
- } while (--j); \
- py += id->base.y_increm; \
- pu += id->base.uv_increm; \
- pv += id->base.uv_increm; \
- dst = (type *)((char *)dst + id->base.rgb_increm); \
- DITHER(dithpos += id->base.dither_stride;) \
- } while (--i); \
-}
-
-DECLARE_422 (rgb_c_32_422, uint32_t, 1, DST, SKIP)
-DECLARE_422 (rgb_c_24_rgb_422, uint8_t, 3, DSTRGB, SKIP)
-DECLARE_422 (rgb_c_24_bgr_422, uint8_t, 3, DSTBGR, SKIP)
-DECLARE_422 (rgb_c_16_422, uint16_t, 1, DST, SKIP)
-DECLARE_422 (rgb_c_8_422, uint8_t, 1, DSTDITHER, DO)
-
-#define DECLARE_444(func,type,num,DST,DITHER) \
-static void func (void * _id, uint8_t * const * src, \
- unsigned int v_offset) \
-{ \
- const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \
- type * dst; \
- const uint8_t * py, * pu, * pv; \
- int i; \
- DITHER(uint8_t dithpos = id->base.dither_offset;) \
- \
- dst = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset); \
- py = src[0]; pu = src[1]; pv = src[2]; \
- \
- i = 16; \
- do { \
- int j, U, V, Y; \
- const type * r, * g, * b; \
- DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \
- \
- j = id->base.width; \
- do { \
- RGB (type, 0) \
- DST (py, dst, 0, 0) \
- RGB (type, 1) \
- DST (py, dst, 1, 0) \
- RGB (type, 2) \
- DST (py, dst, 2, 0) \
- RGB (type, 3) \
- DST (py, dst, 3, 0) \
- RGB (type, 4) \
- DST (py, dst, 4, 0) \
- RGB (type, 5) \
- DST (py, dst, 5, 0) \
- RGB (type, 6) \
- DST (py, dst, 6, 0) \
- RGB (type, 7) \
- DST (py, dst, 7, 0) \
- \
- pu += 8; \
- pv += 8; \
- py += 8; \
- dst += 8 * num; \
- } while (--j); \
- py += id->base.y_increm; \
- pu += id->base.y_increm; \
- pv += id->base.y_increm; \
- dst = (type *)((char *)dst + id->base.rgb_increm); \
- DITHER(dithpos += id->base.dither_stride;) \
- } while (--i); \
-}
-
-DECLARE_444 (rgb_c_32_444, uint32_t, 1, DST, SKIP)
-DECLARE_444 (rgb_c_24_rgb_444, uint8_t, 3, DSTRGB, SKIP)
-DECLARE_444 (rgb_c_24_bgr_444, uint8_t, 3, DSTBGR, SKIP)
-DECLARE_444 (rgb_c_16_444, uint16_t, 1, DST, SKIP)
-DECLARE_444 (rgb_c_8_444, uint8_t, 1, DSTDITHER, DO)
-
-static void rgb_start (void * _id, const mpeg2_fbuf_t * fbuf,
- const mpeg2_picture_t * picture,
- const mpeg2_gop_t * gop)
-{
- convert_rgb_t * id = (convert_rgb_t *) _id;
- int uv_stride = id->uv_stride_frame;
- id->y_stride = id->y_stride_frame;
- id->rgb_ptr = fbuf->buf[0];
- id->rgb_slice = id->rgb_stride = id->rgb_stride_frame;
- id->dither_stride = 32;
- id->dither_offset = dither_temporal[picture->temporal_reference & 63];
- id->field = 0;
- if ((picture->nb_fields == 1) ||
- (id->chroma420 && !(picture->flags & PIC_FLAG_PROGRESSIVE_FRAME))) {
- uv_stride <<= 1;
- id->y_stride <<= 1;
- id->rgb_stride <<= 1;
- id->dither_stride <<= 1;
- id->dither_offset += 16;
- if (picture->nb_fields == 1) {
- id->rgb_slice <<= 1;
- if (!(picture->flags & PIC_FLAG_TOP_FIELD_FIRST)) {
- id->rgb_ptr += id->rgb_stride_frame;
- id->dither_offset += 32;
- }
- } else
- id->field = 8 >> id->convert420;
- }
- id->y_increm = (id->y_stride << id->convert420) - id->y_stride_frame;
- id->uv_increm = uv_stride - id->uv_stride_frame;
- id->rgb_increm = (id->rgb_stride << id->convert420) - id->rgb_stride_min;
- id->dither_stride <<= id->convert420;
-}
-
-static inline int div_round (int dividend, int divisor)
-{
- if (dividend > 0)
- return (dividend + (divisor>>1)) / divisor;
- else
- return -((-dividend + (divisor>>1)) / divisor);
-}
-
-static unsigned int rgb_c_init (convert_rgb_c_t * id,
- mpeg2convert_rgb_order_t order,
- unsigned int bpp)
-{
- int i;
- uint8_t table_Y[1024];
- uint32_t * table_32 = 0;
- uint16_t * table_16 = 0;
- uint8_t * table_8 = 0;
- uint8_t * table_332 = 0;
- int entry_size = 0;
- void * table_r = 0;
- void * table_g = 0;
- void * table_b = 0;
-
- int crv = Inverse_Table_6_9[matrix_coefficients][0];
- int cbu = Inverse_Table_6_9[matrix_coefficients][1];
- int cgu = -Inverse_Table_6_9[matrix_coefficients][2];
- int cgv = -Inverse_Table_6_9[matrix_coefficients][3];
-
- for (i = 0; i < 1024; i++) {
- int j;
-
- j = (76309 * (i - 384 - 16) + 32768) >> 16;
- table_Y[i] = (j < 0) ? 0 : ((j > 255) ? 255 : j);
- }
-
- switch (bpp) {
- case 32:
- if (!id)
- return (197 + 2*682 + 256 + 132) * sizeof (uint32_t);
- table_32 = (uint32_t *) (id + 1);
- entry_size = sizeof (uint32_t);
- table_r = table_32 + 197;
- table_b = table_32 + 197 + 685;
- table_g = table_32 + 197 + 2*682;
-
- for (i = -197; i < 256+197; i++)
- ((uint32_t *) table_r)[i] =
- table_Y[i+384] << ((order == MPEG2CONVERT_RGB) ? 16 : 0);
- for (i = -132; i < 256+132; i++)
- ((uint32_t *) table_g)[i] = table_Y[i+384] << 8;
- for (i = -232; i < 256+232; i++)
- ((uint32_t *) table_b)[i] =
- table_Y[i+384] << ((order == MPEG2CONVERT_RGB) ? 0 : 16);
- break;
-
- case 24:
- if (!id)
- return (256 + 2*232) * sizeof (uint8_t);
- table_8 = (uint8_t *) (id + 1);
- entry_size = sizeof (uint8_t);
- table_r = table_g = table_b = table_8 + 232;
-
- for (i = -232; i < 256+232; i++)
- ((uint8_t * )table_b)[i] = table_Y[i+384];
- break;
-
- case 15:
- case 16:
- if (!id)
- return (197 + 2*682 + 256 + 132) * sizeof (uint16_t);
- table_16 = (uint16_t *) (id + 1);
- entry_size = sizeof (uint16_t);
- table_r = table_16 + 197;
- table_b = table_16 + 197 + 685;
- table_g = table_16 + 197 + 2*682;
-
- for (i = -197; i < 256+197; i++) {
- int j = table_Y[i+384] >> 3;
-
- if (order == MPEG2CONVERT_RGB)
- j <<= ((bpp==16) ? 11 : 10);
-
- ((uint16_t *)table_r)[i] = j;
- }
- for (i = -132; i < 256+132; i++) {
- int j = table_Y[i+384] >> ((bpp==16) ? 2 : 3);
-
- ((uint16_t *)table_g)[i] = j << 5;
- }
- for (i = -232; i < 256+232; i++) {
- int j = table_Y[i+384] >> 3;
-
- if (order == MPEG2CONVERT_BGR)
- j <<= ((bpp==16) ? 11 : 10);
-
- ((uint16_t *)table_b)[i] = j;
- }
- break;
-
- case 8:
- if (!id)
- return (197 + 2*682 + 256 + 232 + 71) * sizeof (uint8_t);
- table_332 = (uint8_t *) (id + 1);
- entry_size = sizeof (uint8_t);
- table_r = table_332 + 197;
- table_g = table_332 + 197 + 682 + 30;
- table_b = table_332 + 197 + 2*682;
-
- for (i = -197; i < 256+197+30; i++)
- ((uint8_t *)table_r)[i] = ((table_Y[i+384] * 7 / 255) <<
- (order == MPEG2CONVERT_RGB ? 5 : 0));
- for (i = -132; i < 256+132+30; i++)
- ((uint8_t *)table_g)[i-30] = ((table_Y[i+384] * 7 / 255) <<
- (order == MPEG2CONVERT_RGB ? 2 : 3));
- for (i = -232; i < 256+232+71; i++)
- ((uint8_t *)table_b)[i] = ((table_Y[i+384] / 85) <<
- (order == MPEG2CONVERT_RGB ? 0 : 6));
- break;
- }
-
- for (i = 0; i < 256; i++) {
- id->table_rV[i] = (((uint8_t *)table_r) +
- entry_size * div_round (crv * (i-128), 76309));
- id->table_gU[i] = (((uint8_t *)table_g) +
- entry_size * div_round (cgu * (i-128), 76309));
- id->table_gV[i] = entry_size * div_round (cgv * (i-128), 76309);
- id->table_bU[i] = (((uint8_t *)table_b) +
- entry_size * div_round (cbu * (i-128), 76309));
- }
-
- return 0;
-}
-
-static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp,
- int stage, void * _id, const mpeg2_sequence_t * seq,
- int stride, uint32_t accel, void * arg,
- mpeg2_convert_init_t * result)
-{
- convert_rgb_t * id = (convert_rgb_t *) _id;
- mpeg2convert_copy_t * copy = (mpeg2convert_copy_t *) 0;
- unsigned int id_size = sizeof (convert_rgb_t);
- int chroma420 = (seq->chroma_height < seq->height);
- int convert420 = 0;
- int rgb_stride_min = ((bpp + 7) >> 3) * seq->width;
-
-#ifdef ARCH_X86
- if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) {
- convert420 = 0;
- copy = mpeg2convert_rgb_mmxext (order, bpp, seq);
- }
- if (!copy && (accel & MPEG2_ACCEL_X86_MMX)) {
- convert420 = 0;
- copy = mpeg2convert_rgb_mmx (order, bpp, seq);
- }
-#endif
-#ifdef ARCH_SPARC
- if (!copy && (accel & MPEG2_ACCEL_SPARC_VIS)) {
- convert420 = chroma420;
- copy = mpeg2convert_rgb_vis (order, bpp, seq);
- }
-#endif
- if (!copy) {
- int src, dest;
- static void (* rgb_c[3][5]) (void *, uint8_t * const *,
- unsigned int) =
- {{rgb_c_24_bgr_420, rgb_c_8_420, rgb_c_16_420,
- rgb_c_24_rgb_420, rgb_c_32_420},
- {rgb_c_24_bgr_422, rgb_c_8_422, rgb_c_16_422,
- rgb_c_24_rgb_422, rgb_c_32_422},
- {rgb_c_24_bgr_444, rgb_c_8_444, rgb_c_16_444,
- rgb_c_24_rgb_444, rgb_c_32_444}};
-
- convert420 = chroma420;
- id_size = (sizeof (convert_rgb_c_t) +
- rgb_c_init ((convert_rgb_c_t *) id, order, bpp));
- src = ((seq->chroma_width == seq->width) +
- (seq->chroma_height == seq->height));
- dest = ((bpp == 24 && order == MPEG2CONVERT_BGR) ? 0 : (bpp + 7) >> 3);
- copy = rgb_c[src][dest];
- }
-
- result->id_size = id_size;
-
- if (stride < rgb_stride_min)
- stride = rgb_stride_min;
-
- if (stage == MPEG2_CONVERT_STRIDE)
- return stride;
- else if (stage == MPEG2_CONVERT_START) {
- id->width = seq->width >> 3;
- id->y_stride_frame = seq->width;
- id->uv_stride_frame = seq->chroma_width;
- id->rgb_stride_frame = stride;
- id->rgb_stride_min = rgb_stride_min;
- id->chroma420 = chroma420;
- id->convert420 = convert420;
- result->buf_size[0] = stride * seq->height;
- result->buf_size[1] = result->buf_size[2] = 0;
- result->start = rgb_start;
- result->copy = copy;
- }
- return 0;
-}
-
-#define DECLARE(func,order,bpp) \
-int func (int stage, void * id, \
- const mpeg2_sequence_t * sequence, int stride, \
- uint32_t accel, void * arg, mpeg2_convert_init_t * result) \
-{ \
- return rgb_internal (order, bpp, stage, id, sequence, stride, \
- accel, arg, result); \
-}
-
-DECLARE (mpeg2convert_rgb32, MPEG2CONVERT_RGB, 32)
-DECLARE (mpeg2convert_rgb24, MPEG2CONVERT_RGB, 24)
-DECLARE (mpeg2convert_rgb16, MPEG2CONVERT_RGB, 16)
-DECLARE (mpeg2convert_rgb15, MPEG2CONVERT_RGB, 15)
-DECLARE (mpeg2convert_rgb8, MPEG2CONVERT_RGB, 8)
-DECLARE (mpeg2convert_bgr32, MPEG2CONVERT_BGR, 32)
-DECLARE (mpeg2convert_bgr24, MPEG2CONVERT_BGR, 24)
-DECLARE (mpeg2convert_bgr16, MPEG2CONVERT_BGR, 16)
-DECLARE (mpeg2convert_bgr15, MPEG2CONVERT_BGR, 15)
-DECLARE (mpeg2convert_bgr8, MPEG2CONVERT_BGR, 8)
-
-mpeg2_convert_t * mpeg2convert_rgb (mpeg2convert_rgb_order_t order,
- unsigned int bpp)
-{
- static mpeg2_convert_t * table[5][2] =
- {{mpeg2convert_rgb15, mpeg2convert_bgr15},
- {mpeg2convert_rgb8, mpeg2convert_bgr8},
- {mpeg2convert_rgb16, mpeg2convert_bgr16},
- {mpeg2convert_rgb24, mpeg2convert_bgr24},
- {mpeg2convert_rgb32, mpeg2convert_bgr32}};
-
- if (order == MPEG2CONVERT_RGB || order == MPEG2CONVERT_BGR) {
- if (bpp == 15)
- return table[0][order == MPEG2CONVERT_BGR];
- else if (bpp >= 8 && bpp <= 32 && (bpp & 7) == 0)
- return table[bpp >> 3][order == MPEG2CONVERT_BGR];
- }
- return (mpeg2_convert_t *) 0;
-}
diff --git a/src/libmpeg2new/libmpeg2/rgb_mmx.c b/src/libmpeg2new/libmpeg2/rgb_mmx.c
deleted file mode 100644
index 912291c6a..000000000
--- a/src/libmpeg2new/libmpeg2/rgb_mmx.c
+++ /dev/null
@@ -1,321 +0,0 @@
-/*
- * rgb_mmx.c
- * Copyright (C) 2000-2003 Silicon Integrated System Corp.
- * All Rights Reserved.
- *
- * Author: Olie Lho <ollie@sis.com.tw>
- *
- * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#ifdef ARCH_X86
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "mpeg2.h"
-#include "mpeg2convert.h"
-#include "convert_internal.h"
-#include "attributes.h"
-#include "mmx.h"
-
-#define CPU_MMXEXT 0
-#define CPU_MMX 1
-
-/* CPU_MMXEXT/CPU_MMX adaptation layer */
-
-#define movntq(src,dest) \
-do { \
- if (cpu == CPU_MMXEXT) \
- movntq_r2m (src, dest); \
- else \
- movq_r2m (src, dest); \
-} while (0)
-
-static inline void mmx_yuv2rgb (uint8_t * py, uint8_t * pu, uint8_t * pv)
-{
- static mmx_t mmx_80w = {0x0080008000800080LL};
- static mmx_t mmx_U_green = {0xf37df37df37df37dLL};
- static mmx_t mmx_U_blue = {0x4093409340934093LL};
- static mmx_t mmx_V_red = {0x3312331233123312LL};
- static mmx_t mmx_V_green = {0xe5fce5fce5fce5fcLL};
- static mmx_t mmx_10w = {0x1010101010101010LL};
- static mmx_t mmx_00ffw = {0x00ff00ff00ff00ffLL};
- static mmx_t mmx_Y_coeff = {0x253f253f253f253fLL};
-
- movd_m2r (*pu, mm0); /* mm0 = 00 00 00 00 u3 u2 u1 u0 */
- movd_m2r (*pv, mm1); /* mm1 = 00 00 00 00 v3 v2 v1 v0 */
- movq_m2r (*py, mm6); /* mm6 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */
- pxor_r2r (mm4, mm4); /* mm4 = 0 */
- /* XXX might do cache preload for image here */
-
- /*
- * Do the multiply part of the conversion for even and odd pixels
- * register usage:
- * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels
- * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd pixels
- * mm6 -> Y even, mm7 -> Y odd
- */
-
- punpcklbw_r2r (mm4, mm0); /* mm0 = u3 u2 u1 u0 */
- punpcklbw_r2r (mm4, mm1); /* mm1 = v3 v2 v1 v0 */
- psubsw_m2r (mmx_80w, mm0); /* u -= 128 */
- psubsw_m2r (mmx_80w, mm1); /* v -= 128 */
- psllw_i2r (3, mm0); /* promote precision */
- psllw_i2r (3, mm1); /* promote precision */
- movq_r2r (mm0, mm2); /* mm2 = u3 u2 u1 u0 */
- movq_r2r (mm1, mm3); /* mm3 = v3 v2 v1 v0 */
- pmulhw_m2r (mmx_U_green, mm2); /* mm2 = u * u_green */
- pmulhw_m2r (mmx_V_green, mm3); /* mm3 = v * v_green */
- pmulhw_m2r (mmx_U_blue, mm0); /* mm0 = chroma_b */
- pmulhw_m2r (mmx_V_red, mm1); /* mm1 = chroma_r */
- paddsw_r2r (mm3, mm2); /* mm2 = chroma_g */
-
- psubusb_m2r (mmx_10w, mm6); /* Y -= 16 */
- movq_r2r (mm6, mm7); /* mm7 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */
- pand_m2r (mmx_00ffw, mm6); /* mm6 = Y6 Y4 Y2 Y0 */
- psrlw_i2r (8, mm7); /* mm7 = Y7 Y5 Y3 Y1 */
- psllw_i2r (3, mm6); /* promote precision */
- psllw_i2r (3, mm7); /* promote precision */
- pmulhw_m2r (mmx_Y_coeff, mm6); /* mm6 = luma_rgb even */
- pmulhw_m2r (mmx_Y_coeff, mm7); /* mm7 = luma_rgb odd */
-
- /*
- * Do the addition part of the conversion for even and odd pixels
- * register usage:
- * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels
- * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd pixels
- * mm6 -> Y even, mm7 -> Y odd
- */
-
- movq_r2r (mm0, mm3); /* mm3 = chroma_b */
- movq_r2r (mm1, mm4); /* mm4 = chroma_r */
- movq_r2r (mm2, mm5); /* mm5 = chroma_g */
- paddsw_r2r (mm6, mm0); /* mm0 = B6 B4 B2 B0 */
- paddsw_r2r (mm7, mm3); /* mm3 = B7 B5 B3 B1 */
- paddsw_r2r (mm6, mm1); /* mm1 = R6 R4 R2 R0 */
- paddsw_r2r (mm7, mm4); /* mm4 = R7 R5 R3 R1 */
- paddsw_r2r (mm6, mm2); /* mm2 = G6 G4 G2 G0 */
- paddsw_r2r (mm7, mm5); /* mm5 = G7 G5 G3 G1 */
- packuswb_r2r (mm0, mm0); /* saturate to 0-255 */
- packuswb_r2r (mm1, mm1); /* saturate to 0-255 */
- packuswb_r2r (mm2, mm2); /* saturate to 0-255 */
- packuswb_r2r (mm3, mm3); /* saturate to 0-255 */
- packuswb_r2r (mm4, mm4); /* saturate to 0-255 */
- packuswb_r2r (mm5, mm5); /* saturate to 0-255 */
- punpcklbw_r2r (mm3, mm0); /* mm0 = B7 B6 B5 B4 B3 B2 B1 B0 */
- punpcklbw_r2r (mm4, mm1); /* mm1 = R7 R6 R5 R4 R3 R2 R1 R0 */
- punpcklbw_r2r (mm5, mm2); /* mm2 = G7 G6 G5 G4 G3 G2 G1 G0 */
-}
-
-static inline void mmx_unpack_16rgb (uint8_t * image, const int cpu)
-{
- static mmx_t mmx_bluemask = {0xf8f8f8f8f8f8f8f8LL};
- static mmx_t mmx_greenmask = {0xfcfcfcfcfcfcfcfcLL};
- static mmx_t mmx_redmask = {0xf8f8f8f8f8f8f8f8LL};
-
- /*
- * convert RGB plane to RGB 16 bits
- * mm0 -> B, mm1 -> R, mm2 -> G
- * mm4 -> GB, mm5 -> AR pixel 4-7
- * mm6 -> GB, mm7 -> AR pixel 0-3
- */
-
- pand_m2r (mmx_bluemask, mm0); /* mm0 = b7b6b5b4b3______ */
- pand_m2r (mmx_greenmask, mm2); /* mm2 = g7g6g5g4g3g2____ */
- pand_m2r (mmx_redmask, mm1); /* mm1 = r7r6r5r4r3______ */
- psrlq_i2r (3, mm0); /* mm0 = ______b7b6b5b4b3 */
- pxor_r2r (mm4, mm4); /* mm4 = 0 */
- movq_r2r (mm0, mm5); /* mm5 = ______b7b6b5b4b3 */
- movq_r2r (mm2, mm7); /* mm7 = g7g6g5g4g3g2____ */
-
- punpcklbw_r2r (mm4, mm2);
- punpcklbw_r2r (mm1, mm0);
- psllq_i2r (3, mm2);
- por_r2r (mm2, mm0);
- movntq (mm0, *image);
-
- punpckhbw_r2r (mm4, mm7);
- punpckhbw_r2r (mm1, mm5);
- psllq_i2r (3, mm7);
- por_r2r (mm7, mm5);
- movntq (mm5, *(image+8));
-}
-
-static inline void mmx_unpack_32rgb (uint8_t * image, const int cpu)
-{
- /*
- * convert RGB plane to RGB packed format,
- * mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> 0,
- * mm4 -> GB, mm5 -> AR pixel 4-7,
- * mm6 -> GB, mm7 -> AR pixel 0-3
- */
-
- pxor_r2r (mm3, mm3);
- movq_r2r (mm0, mm6);
- movq_r2r (mm1, mm7);
- movq_r2r (mm0, mm4);
- movq_r2r (mm1, mm5);
- punpcklbw_r2r (mm2, mm6);
- punpcklbw_r2r (mm3, mm7);
- punpcklwd_r2r (mm7, mm6);
- movntq (mm6, *image);
- movq_r2r (mm0, mm6);
- punpcklbw_r2r (mm2, mm6);
- punpckhwd_r2r (mm7, mm6);
- movntq (mm6, *(image+8));
- punpckhbw_r2r (mm2, mm4);
- punpckhbw_r2r (mm3, mm5);
- punpcklwd_r2r (mm5, mm4);
- movntq (mm4, *(image+16));
- movq_r2r (mm0, mm4);
- punpckhbw_r2r (mm2, mm4);
- punpckhwd_r2r (mm5, mm4);
- movntq (mm4, *(image+24));
-}
-
-static inline void rgb16 (void * const _id, uint8_t * const * src,
- const unsigned int v_offset, const int cpu)
-{
- convert_rgb_t * const id = (convert_rgb_t *) _id;
- uint8_t * dst;
- uint8_t * py, * pu, * pv;
- int i, j;
-
- dst = id->rgb_ptr + id->rgb_slice * v_offset;
- py = src[0]; pu = src[1]; pv = src[2];
-
- i = 16;
- do {
- j = id->width;
- do {
- mmx_yuv2rgb (py, pu, pv);
- mmx_unpack_16rgb (dst, cpu);
- py += 8;
- pu += 4;
- pv += 4;
- dst += 16;
- } while (--j);
-
- dst += id->rgb_increm;
- py += id->y_increm;
- if (--i == id->field) {
- dst = id->rgb_ptr + id->rgb_slice * (v_offset + 1);
- py = src[0] + id->y_stride_frame;
- pu = src[1] + id->uv_stride_frame;
- pv = src[2] + id->uv_stride_frame;
- } else if (! (i & id->chroma420)) {
- pu += id->uv_increm;
- pv += id->uv_increm;
- } else {
- pu -= id->uv_stride_frame;
- pv -= id->uv_stride_frame;
- }
- } while (i);
-}
-
-static inline void argb32 (void * const _id, uint8_t * const * src,
- const unsigned int v_offset, const int cpu)
-{
- convert_rgb_t * const id = (convert_rgb_t *) _id;
- uint8_t * dst;
- uint8_t * py, * pu, * pv;
- int i, j;
-
- dst = id->rgb_ptr + id->rgb_slice * v_offset;
- py = src[0]; pu = src[1]; pv = src[2];
-
- i = 16;
- do {
- j = id->width;
- do {
- mmx_yuv2rgb (py, pu, pv);
- mmx_unpack_32rgb (dst, cpu);
- py += 8;
- pu += 4;
- pv += 4;
- dst += 32;
- } while (--j);
-
- dst += id->rgb_increm;
- py += id->y_increm;
- if (--i == id->field) {
- dst = id->rgb_ptr + id->rgb_slice * (v_offset + 1);
- py = src[0] + id->y_stride_frame;
- pu = src[1] + id->uv_stride_frame;
- pv = src[2] + id->uv_stride_frame;
- } else if (! (i & id->chroma420)) {
- pu += id->uv_increm;
- pv += id->uv_increm;
- } else {
- pu -= id->uv_stride_frame;
- pv -= id->uv_stride_frame;
- }
- } while (i);
-}
-
-static void mmxext_rgb16 (void * id, uint8_t * const * src,
- unsigned int v_offset)
-{
- rgb16 (id, src, v_offset, CPU_MMXEXT);
-}
-
-static void mmxext_argb32 (void * id, uint8_t * const * src,
- unsigned int v_offset)
-{
- argb32 (id, src, v_offset, CPU_MMXEXT);
-}
-
-static void mmx_rgb16 (void * id, uint8_t * const * src, unsigned int v_offset)
-{
- rgb16 (id, src, v_offset, CPU_MMX);
-}
-
-static void mmx_argb32 (void * id, uint8_t * const * src,
- unsigned int v_offset)
-{
- argb32 (id, src, v_offset, CPU_MMX);
-}
-
-mpeg2convert_copy_t * mpeg2convert_rgb_mmxext (int order, int bpp,
- const mpeg2_sequence_t * seq)
-{
- if (order == MPEG2CONVERT_RGB && seq->chroma_width < seq->width) {
- if (bpp == 16)
- return mmxext_rgb16;
- else if (bpp == 32)
- return mmxext_argb32;
- }
- return NULL; /* Fallback to C */
-}
-
-mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int order, int bpp,
- const mpeg2_sequence_t * seq)
-{
- if (order == MPEG2CONVERT_RGB && seq->chroma_width < seq->width) {
- if (bpp == 16)
- return mmx_rgb16;
- else if (bpp == 32)
- return mmx_argb32;
- }
- return NULL; /* Fallback to C */
-}
-#endif
diff --git a/src/libmpeg2new/libmpeg2/rgb_vis.c b/src/libmpeg2new/libmpeg2/rgb_vis.c
deleted file mode 100644
index 49d8d1d7c..000000000
--- a/src/libmpeg2new/libmpeg2/rgb_vis.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * rgb_vis.c
- * Copyright (C) 2003 David S. Miller <davem@redhat.com>
- *
- * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
- * See http://libmpeg2.sourceforge.net/ for updates.
- *
- * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "config.h"
-
-#ifdef ARCH_SPARC
-
-#include <stddef.h>
-#include <inttypes.h>
-
-#include "mpeg2.h"
-#include "mpeg2convert.h"
-#include "convert_internal.h"
-#include "attributes.h"
-#include "vis.h"
-
-/* Based partially upon the MMX yuv2rgb code, see there for credits.
- *
- * The difference here is that since we have enough registers we
- * process both even and odd scanlines in one pass.
- */
-
-static const uint16_t const_2048[] ATTR_ALIGN(8) = {2048, 2048, 2048, 2048};
-static const uint16_t const_1024[] ATTR_ALIGN(8) = {1024, 1024, 1024, 1024};
-static const uint16_t const_128[] ATTR_ALIGN(8) = {128, 128, 128, 128};
-static const uint8_t const_Ugreen[] ATTR_ALIGN(8) =
- {0xf3, 0x00, 0xf3, 0x00, 0xf3, 0x00, 0xf3, 0x00};
-static const uint8_t const_Vgreen[] ATTR_ALIGN(8) =
- {0xe6, 0x00, 0xe6, 0x00, 0xe6, 0x00, 0xe6, 0x00};
-static const uint8_t const_Ublue_Vred[] ATTR_ALIGN(8) =
- {0x41, 0x41, 0x41, 0x41, 0x33, 0x33, 0x33, 0x33};
-static const uint8_t const_Ycoeff[] ATTR_ALIGN(4) = {0x25, 0x25, 0x25, 0x25};
-
-#define TMP0 0
-#define TMP1 1
-#define TMP2 2
-#define TMP3 3
-#define TMP4 4
-#define TMP5 5
-#define TMP6 6
-#define TMP7 7
-#define TMP8 8
-#define TMP9 9
-#define TMP10 10
-#define TMP11 11
-#define TMP12 12
-#define TMP13 13
-
-#define CONST_UBLUE 14
-#define CONST_VRED 15
-#define CONST_2048 16
-
-#define BLUE8_EVEN 18
-#define BLUE8_ODD 19
-#define RED8_EVEN 20
-#define RED8_ODD 21
-#define GREEN8_EVEN 22
-#define GREEN8_ODD 23
-
-#define BLUE8_2_EVEN 24
-#define BLUE8_2_ODD 25
-#define RED8_2_EVEN 26
-#define RED8_2_ODD 27
-#define GREEN8_2_EVEN 28
-#define GREEN8_2_ODD 29
-
-#define CONST_YCOEFF 30
-#define ZEROS 31
-
-#define PU_0 32
-#define PU_2 34
-#define PV_0 36
-#define PV_2 38
-#define PY_0 40
-#define PY_2 42
-#define PY_4 44
-#define PY_6 46
-
-#define CONST_128 56
-#define CONST_1024 58
-#define CONST_VGREEN 60
-#define CONST_UGREEN 62
-
-static inline void vis_init_consts(void)
-{
- vis_set_gsr(7 << VIS_GSR_SCALEFACT_SHIFT);
-
- vis_ld64(const_2048[0], CONST_2048);
- vis_ld64(const_1024[0], CONST_1024);
- vis_ld64(const_Ugreen[0], CONST_UGREEN);
- vis_ld64(const_Vgreen[0], CONST_VGREEN);
- vis_fzeros(ZEROS);
- vis_ld64(const_Ublue_Vred[0], CONST_UBLUE);
- vis_ld32(const_Ycoeff[0], CONST_YCOEFF);
- vis_ld64(const_128[0], CONST_128);
-}
-
-static inline void vis_yuv2rgb(uint8_t *py, uint8_t *pu, uint8_t *pv,
- int y_stride)
-{
- vis_ld32(pu[0], TMP0);
-
- vis_ld32(pv[0], TMP2);
-
- vis_ld64(py[0], TMP4);
- vis_mul8x16au(TMP0, CONST_2048, PU_0);
-
- vis_ld64_2(py, y_stride, TMP8);
- vis_mul8x16au(TMP2, CONST_2048, PV_0);
-
- vis_pmerge(TMP4, TMP5, TMP6);
-
- vis_pmerge(TMP6, TMP7, TMP4);
-
- vis_pmerge(TMP8, TMP9, TMP10);
-
- vis_pmerge(TMP10, TMP11, TMP8);
- vis_mul8x16au(TMP4, CONST_2048, PY_0);
-
- vis_psub16(PU_0, CONST_1024, PU_0);
- vis_mul8x16au(TMP5, CONST_2048, PY_2);
-
- vis_psub16(PV_0, CONST_1024, PV_0);
- vis_mul8x16au(TMP8, CONST_2048, PY_4);
-
- vis_psub16(PY_0, CONST_128, PY_0);
- vis_mul8x16au(TMP9, CONST_2048, PY_6);
-
- vis_psub16(PY_2, CONST_128, PY_2);
- vis_mul8x16(CONST_YCOEFF, PY_0, PY_0);
-
- vis_psub16(PY_4, CONST_128, PY_4);
- vis_mul8x16(CONST_YCOEFF, PY_2, PY_2);
-
- vis_psub16(PY_6, CONST_128, PY_6);
- vis_mul8x16(CONST_YCOEFF, PY_4, PY_4);
-
- vis_mul8x16(CONST_YCOEFF, PY_6, PY_6);
-
- vis_mul8sux16(CONST_UGREEN, PU_0, TMP0);
-
- vis_mul8sux16(CONST_VGREEN, PV_0, TMP2);
-
- vis_mul8x16(CONST_UBLUE, PU_0, TMP4);
-
- vis_mul8x16(CONST_VRED, PV_0, TMP6);
- vis_padd16(TMP0, TMP2, TMP10);
-
- vis_padd16(PY_0, TMP4, TMP0);
-
- vis_padd16(PY_2, TMP4, TMP2);
- vis_pack16(TMP0, BLUE8_EVEN);
-
- vis_padd16(PY_4, TMP4, TMP0);
- vis_pack16(TMP2, BLUE8_ODD);
-
- vis_padd16(PY_6, TMP4, TMP2);
- vis_pack16(TMP0, BLUE8_2_EVEN);
-
- vis_padd16(PY_0, TMP6, TMP0);
- vis_pack16(TMP2, BLUE8_2_ODD);
-
- vis_padd16(PY_2, TMP6, TMP2);
- vis_pack16(TMP0, RED8_EVEN);
-
- vis_padd16(PY_4, TMP6, TMP0);
- vis_pack16(TMP2, RED8_ODD);
-
- vis_padd16(PY_6, TMP6, TMP2);
- vis_pack16(TMP0, RED8_2_EVEN);
-
- vis_padd16(PY_0, TMP10, TMP0);
- vis_pack16(TMP2, RED8_2_ODD);
-
- vis_padd16(PY_2, TMP10, TMP2);
- vis_pack16(TMP0, GREEN8_EVEN);
-
- vis_padd16(PY_4, TMP10, TMP0);
- vis_pack16(TMP2, GREEN8_ODD);
-
- vis_padd16(PY_6, TMP10, TMP2);
- vis_pack16(TMP0, GREEN8_2_EVEN);
-
- vis_pack16(TMP2, GREEN8_2_ODD);
- vis_pmerge(BLUE8_EVEN, BLUE8_ODD, BLUE8_EVEN);
-
- vis_pmerge(BLUE8_2_EVEN, BLUE8_2_ODD, BLUE8_2_EVEN);
-
- vis_pmerge(RED8_EVEN, RED8_ODD, RED8_EVEN);
-
- vis_pmerge(RED8_2_EVEN, RED8_2_ODD, RED8_2_EVEN);
-
- vis_pmerge(GREEN8_EVEN, GREEN8_ODD, GREEN8_EVEN);
-
- vis_pmerge(GREEN8_2_EVEN, GREEN8_2_ODD, GREEN8_2_EVEN);
-}
-
-static inline void vis_unpack_32rgb(uint8_t *image, int stride)
-{
- vis_pmerge(ZEROS, GREEN8_EVEN, TMP0);
- vis_pmerge(RED8_EVEN, BLUE8_EVEN, TMP2);
-
- vis_pmerge(TMP0, TMP2, TMP4);
- vis_st64(TMP4, image[0]);
-
- vis_pmerge(TMP1, TMP3, TMP6);
- vis_st64_2(TMP6, image, 8);
-
- vis_pmerge(ZEROS, GREEN8_ODD, TMP8);
- vis_pmerge(RED8_ODD, BLUE8_ODD, TMP10);
-
- vis_pmerge(TMP8, TMP10, TMP0);
- vis_st64_2(TMP0, image, 16);
-
- vis_pmerge(TMP9, TMP11, TMP2);
- vis_st64_2(TMP2, image, 24);
-
- image += stride;
-
- vis_pmerge(ZEROS, GREEN8_2_EVEN, TMP0);
- vis_pmerge(RED8_2_EVEN, BLUE8_2_EVEN, TMP2);
-
- vis_pmerge(TMP0, TMP2, TMP4);
- vis_st64(TMP4, image[0]);
-
- vis_pmerge(TMP1, TMP3, TMP6);
- vis_st64_2(TMP6, image, 8);
-
- vis_pmerge(ZEROS, GREEN8_2_ODD, TMP8);
- vis_pmerge(RED8_2_ODD, BLUE8_2_ODD, TMP10);
-
- vis_pmerge(TMP8, TMP10, TMP0);
- vis_st64_2(TMP0, image, 16);
-
- vis_pmerge(TMP9, TMP11, TMP2);
- vis_st64_2(TMP2, image, 24);
-}
-
-static inline void vis_unpack_32bgr(uint8_t *image, int stride)
-{
- vis_pmerge(ZEROS, GREEN8_EVEN, TMP0);
- vis_pmerge(BLUE8_EVEN, RED8_EVEN, TMP2);
-
- vis_pmerge(TMP0, TMP2, TMP4);
- vis_st64(TMP4, image[0]);
-
- vis_pmerge(TMP1, TMP3, TMP6);
- vis_st64_2(TMP6, image, 8);
-
- vis_pmerge(ZEROS, GREEN8_ODD, TMP8);
- vis_pmerge(BLUE8_ODD, RED8_ODD, TMP10);
-
- vis_pmerge(TMP8, TMP10, TMP0);
- vis_st64_2(TMP0, image, 16);
-
- vis_pmerge(TMP9, TMP11, TMP2);
- vis_st64_2(TMP2, image, 24);
-
- image += stride;
-
- vis_pmerge(ZEROS, GREEN8_2_EVEN, TMP0);
- vis_pmerge(BLUE8_2_EVEN, RED8_2_EVEN, TMP2);
-
- vis_pmerge(TMP0, TMP2, TMP4);
- vis_st64(TMP4, image[0]);
-
- vis_pmerge(TMP1, TMP3, TMP6);
- vis_st64_2(TMP6, image, 8);
-
- vis_pmerge(ZEROS, GREEN8_2_ODD, TMP8);
- vis_pmerge(BLUE8_2_ODD, RED8_2_ODD, TMP10);
-
- vis_pmerge(TMP8, TMP10, TMP0);
- vis_st64_2(TMP0, image, 16);
-
- vis_pmerge(TMP9, TMP11, TMP2);
- vis_st64_2(TMP2, image, 24);
-}
-
-static inline void vis_yuv420_argb32(uint8_t *image,
- uint8_t *py, uint8_t *pu, uint8_t *pv,
- int width, int height, int rgb_stride,
- int y_stride, int uv_stride)
-{
- height >>= 1;
- uv_stride -= width >> 1;
- do {
- int i = width >> 3;
- do {
- vis_yuv2rgb(py, pu, pv, y_stride);
- vis_unpack_32rgb(image, rgb_stride);
- py += 8;
- pu += 4;
- pv += 4;
- image += 32;
- } while (--i);
-
- py += (y_stride << 1) - width;
- image += (rgb_stride << 1) - 4 * width;
- pu += uv_stride;
- pv += uv_stride;
- } while (--height);
-}
-
-static inline void vis_yuv420_abgr32(uint8_t *image,
- uint8_t *py, uint8_t *pu, uint8_t *pv,
- int width, int height, int rgb_stride,
- int y_stride, int uv_stride)
-{
- height >>= 1;
- uv_stride -= width >> 1;
- do {
- int i = width >> 3;
- do {
- vis_yuv2rgb(py, pu, pv, y_stride);
- vis_unpack_32bgr(image, rgb_stride);
- py += 8;
- pu += 4;
- pv += 4;
- image += 32;
- } while (--i);
-
- py += (y_stride << 1) - width;
- image += (rgb_stride << 1) - 4 * width;
- pu += uv_stride;
- pv += uv_stride;
- } while (--height);
-}
-
-static void vis_argb32(void *_id, uint8_t * const *src,
- unsigned int v_offset)
-{
- convert_rgb_t *id = (convert_rgb_t *) _id;
-
- vis_init_consts();
- vis_yuv420_argb32(id->rgb_ptr + id->rgb_stride * v_offset,
- src[0], src[1], src[2], id->width, 16,
- id->rgb_stride, id->y_stride, id->y_stride >> 1);
-}
-
-static void vis_abgr32(void *_id, uint8_t * const *src,
- unsigned int v_offset)
-{
- convert_rgb_t *id = (convert_rgb_t *) _id;
-
- vis_init_consts();
- vis_yuv420_abgr32(id->rgb_ptr + id->rgb_stride * v_offset,
- src[0], src[1], src[2], id->width, 16,
- id->rgb_stride, id->y_stride, id->y_stride >> 1);
-}
-
-mpeg2convert_copy_t *mpeg2convert_rgb_vis(int order, int bpp,
- const mpeg2_sequence_t * seq)
-{
- if (bpp == 32 && seq->chroma_height < seq->height) {
- if (order == MPEG2CONVERT_RGB)
- return vis_argb32;
- if (order == MPEG2CONVERT_BGR)
- return vis_abgr32;
- }
-
- return NULL; /* Fallback to C */
-}
-
-#endif /* ARCH_SPARC */
diff --git a/src/libmpeg2new/xine_mpeg2new_decoder.c b/src/libmpeg2new/xine_mpeg2new_decoder.c
deleted file mode 100644
index 252cfcc54..000000000
--- a/src/libmpeg2new/xine_mpeg2new_decoder.c
+++ /dev/null
@@ -1,525 +0,0 @@
-/*
- * 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
- *
- * stuff needed to turn libmpeg2 into a xine decoder plugin
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <assert.h>
-
-#include "./include/mpeg2.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-
-/*
-#define LOG
-#define LOG_FRAME_ALLOC_FREE
-#define LOG_ENTRY
-#define LOG_FRAME_COUNTER
-*/
-
-#define _x_abort() do {} while (0)
-
-typedef struct {
- video_decoder_class_t decoder_class;
-} mpeg2_class_t;
-
-typedef struct {
- uint32_t id;
- vo_frame_t * img;
-} img_state_t;
-
-typedef struct mpeg2_video_decoder_s {
- video_decoder_t video_decoder;
- mpeg2dec_t *mpeg2dec;
- mpeg2_class_t *class;
- xine_stream_t *stream;
- int32_t force_aspect;
- int force_pan_scan;
- double ratio;
- img_state_t img_state[30];
- uint32_t frame_number;
- uint32_t rff_pattern;
-
-} mpeg2_video_decoder_t;
-
-#ifndef LOG_FRAME_ALLOC_FREE
-inline static void mpeg2_video_print_bad_state(img_state_t * img_state) {}
-#else
-static void mpeg2_video_print_bad_state(img_state_t * img_state) {
- int32_t n,m;
- m=0;
- for(n=0;n<30;n++) {
- if (img_state[n].id>0) {
- printf("%d = %u\n",n, img_state[n].id);
- m++;
- }
- }
- if (m > 3) _x_abort();
- if (m == 0) printf("NO FRAMES\n");
-}
-#endif
-
-static void mpeg2_video_free_all(img_state_t * img_state) {
- int32_t n,m;
- vo_frame_t * img;
- printf("libmpeg2new:free_all\n");
- for(n=0;n<30;n++) {
- if (img_state[n].id>0) {
- img = img_state[n].img;
- img->free(img);
- img_state[n].id = 0;
- }
- }
-}
-
-
-static void mpeg2_video_print_fbuf(const mpeg2_fbuf_t * fbuf) {
- printf("%p",fbuf);
- vo_frame_t * img;
- if (fbuf) {
- img = (vo_frame_t *) fbuf->id;
- if (img) {
- printf (", img=%p, (id=%d)\n",
- img, img->id);
- } else {
- printf (", img=NULL\n");
- }
- } else {
- printf ("\n");
- }
-}
-
-static void mpeg2_video_decode_data (video_decoder_t *this_gen, buf_element_t *buf_element) {
- mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
- uint8_t * current = buf_element->content;
- uint8_t * end = buf_element->content + buf_element->size;
- const mpeg2_info_t * info;
- mpeg2_state_t state;
- vo_frame_t * img;
- uint32_t picture_structure;
- int32_t frame_skipping;
-
- /* handle aspect hints from xine-dvdnav */
- if (buf_element->decoder_flags & BUF_FLAG_SPECIAL) {
- if (buf_element->decoder_info[1] == BUF_SPECIAL_ASPECT) {
- this->force_aspect = buf_element->decoder_info[2];
- if (buf_element->decoder_info[3] == 0x1 && buf_element->decoder_info[2] == 3)
- /* letterboxing is denied, we have to do pan&scan */
- this->force_pan_scan = 1;
- else
- this->force_pan_scan = 0;
- }
-
- return;
- }
-
- if (buf_element->decoder_flags != 0) return;
-
-#ifdef LOG_ENTRY
- printf ("libmpeg2: decode_data: enter\n");
-#endif
-
- mpeg2_buffer (this->mpeg2dec, current, end);
-
- info = mpeg2_info (this->mpeg2dec);
-
- while ((state = mpeg2_parse (this->mpeg2dec)) != STATE_BUFFER) {
- switch (state) {
- case STATE_SEQUENCE:
- /* might set nb fbuf, convert format, stride */
- /* might set fbufs */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_BITRATE, info->sequence->byte_rate * 8);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, info->sequence->picture_width);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, info->sequence->picture_height);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, info->sequence->frame_period / 300);
- if (this->force_aspect) ((mpeg2_sequence_t *)info->sequence)->pixel_width = this->force_aspect; /* ugly... */
- switch (info->sequence->pixel_width) {
- case 3:
- this->ratio = 16.0 / 9.0;
- break;
- case 4:
- this->ratio = 2.11;
- break;
- case 2:
- this->ratio = 4.0 / 3.0;
- break;
- case 1:
- default:
- this->ratio = (double)info->sequence->picture_width/(double)info->sequence->picture_height;
- break;
- }
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, (int)(10000*this->ratio));
-
- if (info->sequence->flags & SEQ_FLAG_MPEG2) {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MPEG 2 (libmpeg2new)");
- } else {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MPEG 1 (libmpeg2new)");
- }
-
- break;
- case STATE_PICTURE:
- /* might skip */
- /* might set fbuf */
- if (info->current_picture->nb_fields == 1) {
- picture_structure = info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST ? VO_TOP_FIELD : VO_BOTTOM_FIELD;
- } else {
- picture_structure = VO_BOTH_FIELDS;
- }
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- info->sequence->picture_width,
- info->sequence->picture_height,
- this->ratio,
- XINE_IMGFMT_YV12,
- picture_structure);
- this->frame_number++;
-#ifdef LOG_FRAME_COUNTER
- printf("libmpeg2:frame_number=%d\n",this->frame_number);
-#endif
- img->top_field_first = info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST ? 1 : 0;
- img->repeat_first_field = (info->current_picture->nb_fields > 2) ? 1 : 0;
- img->duration=info->sequence->frame_period / 300;
- if( ((this->rff_pattern & 0xff) == 0xaa ||
- (this->rff_pattern & 0xff) == 0x55) ) {
- /* special case for ntsc 3:2 pulldown */
- img->duration += img->duration/4;
- } else {
- if( img->repeat_first_field ) {
- img->duration = (img->duration * info->current_picture->nb_fields) / 2;
- }
- }
-
- if ((info->current_picture->flags & 7) == 1) {
- img->pts=buf_element->pts; /* If an I frame, use PTS */
- } else {
- img->pts=0;
- }
-
-
-#ifdef LOG_FRAME_ALLOC_FREE
- printf ("libmpeg2:decode_data:get_frame xine=%p (id=%d)\n", img,img->id);
-#endif
- if (this->img_state[img->id].id != 0) {
- printf ("libmpeg2:decode_data:get_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id].id);
- _x_abort();
- }
-
- this->img_state[img->id].id = 1;
- this->img_state[img->id].img = img;
-
- mpeg2_set_buf (this->mpeg2dec, img->base, img);
- break;
- case STATE_SLICE:
- case STATE_END:
-#if 0
- printf("libmpeg2:decode_data:current_fbuf=");
- mpeg2_video_print_fbuf(info->current_fbuf);
- printf("libmpeg2:decode_data:display_fbuf=");
- mpeg2_video_print_fbuf(info->display_fbuf);
- printf("libmpeg2:decode_data:discard_fbuf=");
- mpeg2_video_print_fbuf(info->discard_fbuf);
-#endif
- /* draw current picture */
- /* might free frame buffer */
- if (info->display_fbuf && info->display_fbuf->id) {
- img = (vo_frame_t *) info->display_fbuf->id;
- /* this should be used to detect any special rff pattern */
- this->rff_pattern = this->rff_pattern << 1;
- this->rff_pattern |= img->repeat_first_field;
-
-#ifdef LOG_FRAME_ALLOC_FREE
- printf ("libmpeg2:decode_data:draw_frame xine=%p, fbuf=%p, id=%d \n", img, info->display_fbuf, img->id);
-#endif
- if (this->img_state[img->id].id != 1) {
- printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id].id);
- _x_abort();
- }
- if (this->img_state[img->id].id == 1) {
- frame_skipping = img->draw (img, this->stream);
- /* FIXME: Handle skipping */
- this->img_state[img->id].id = 2;
- }
-
- }
- if (info->discard_fbuf && !info->discard_fbuf->id) {
- printf ("libmpeg2:decode_data:BAD free_frame discard: xine=%p, fbuf=%p\n", info->discard_fbuf->id, info->discard_fbuf);
- //_x_abort();
- }
- if (info->discard_fbuf && info->discard_fbuf->id) {
- img = (vo_frame_t *) info->discard_fbuf->id;
-#ifdef LOG_FRAME_ALLOC_FREE
- printf ("libmpeg2:decode_data:free_frame xine=%p, fbuf=%p,id=%d\n", img, info->discard_fbuf, img->id);
-#endif
- if (this->img_state[img->id].id != 2) {
- printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id].id);
- _x_abort();
- }
- if (this->img_state[img->id].id == 2) {
- img->free(img);
- this->img_state[img->id].id = 0;
- }
- }
-#ifdef LOG_FRAME_ALLOC_FREE
- mpeg2_video_print_bad_state(this->img_state);
-#endif
- break;
- case STATE_GOP:
- break;
- default:
- printf("libmpeg2new: STATE unknown %d\n",state);
- break;
- }
-
- }
-#ifdef LOG_ENTRY
- printf ("libmpeg2: decode_data: exit\n");
-#endif
-
-}
-
-static void mpeg2_video_flush (video_decoder_t *this_gen) {
- mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
-
-#ifdef LOG_ENTRY
- printf ("libmpeg2: flush\n");
-#endif
-
-/* mpeg2_flush (&this->mpeg2); */
-}
-
-static void mpeg2_video_reset (video_decoder_t *this_gen) {
- mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
- int32_t state;
- const mpeg2_info_t * info;
- vo_frame_t * img;
- int32_t frame_skipping;
-
-#ifdef LOG_ENTRY
- printf ("libmpeg2: reset\n");
-#endif
- mpeg2_reset (this->mpeg2dec, 1); /* 1 for full reset */
- mpeg2_video_free_all(this->img_state);
-
-
-#if 0 /* This bit of code does not work yet. */
- info = mpeg2_info (this->mpeg2dec);
- state = mpeg2_reset (this->mpeg2dec);
- printf("reset state1:%d\n",state);
- if (info->display_fbuf && info->display_fbuf->id) {
- img = (vo_frame_t *) info->display_fbuf->id;
-
- if (this->img_state[img->id] != 1) {
- printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- _x_abort();
- }
- if (this->img_state[img->id] == 1) {
- frame_skipping = img->draw (img, this->stream);
- /* FIXME: Handle skipping */
- this->img_state[img->id] = 2;
- }
- }
-
- if (info->discard_fbuf && !info->discard_fbuf->id) {
- printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- _x_abort();
- }
- if (info->discard_fbuf && info->discard_fbuf->id) {
- img = (vo_frame_t *) info->discard_fbuf->id;
- if (this->img_state[img->id] != 2) {
- printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- _x_abort();
- }
- if (this->img_state[img->id] == 2) {
- img->free(img);
- this->img_state[img->id] = 0;
- }
- }
- state = mpeg2_parse (this->mpeg2dec);
- printf("reset state2:%d\n",state);
- if (info->display_fbuf && info->display_fbuf->id) {
- img = (vo_frame_t *) info->display_fbuf->id;
-
- if (this->img_state[img->id] != 1) {
- printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- _x_abort();
- }
- if (this->img_state[img->id] == 1) {
- frame_skipping = img->draw (img, this->stream);
- /* FIXME: Handle skipping */
- this->img_state[img->id] = 2;
- }
- }
-
- if (info->discard_fbuf && !info->discard_fbuf->id) {
- printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- _x_abort();
- }
- if (info->discard_fbuf && info->discard_fbuf->id) {
- img = (vo_frame_t *) info->discard_fbuf->id;
- if (this->img_state[img->id] != 2) {
- printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- _x_abort();
- }
- if (this->img_state[img->id] == 2) {
- img->free(img);
- this->img_state[img->id] = 0;
- }
- }
- state = mpeg2_parse (this->mpeg2dec);
- printf("reset state3:%d\n",state);
- if (info->display_fbuf && info->display_fbuf->id) {
- img = (vo_frame_t *) info->display_fbuf->id;
-
- if (this->img_state[img->id] != 1) {
- printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- _x_abort();
- }
- if (this->img_state[img->id] == 1) {
- frame_skipping = img->draw (img, this->stream);
- /* FIXME: Handle skipping */
- this->img_state[img->id] = 2;
- }
- }
-
- if (info->discard_fbuf && !info->discard_fbuf->id) {
- printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- _x_abort();
- }
- if (info->discard_fbuf && info->discard_fbuf->id) {
- img = (vo_frame_t *) info->discard_fbuf->id;
- if (this->img_state[img->id] != 2) {
- printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- _x_abort();
- }
- if (this->img_state[img->id] == 2) {
- img->free(img);
- this->img_state[img->id] = 0;
- }
- }
-#endif
-
-}
-
-static void mpeg2_video_discontinuity (video_decoder_t *this_gen) {
- mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
-
-#ifdef LOG_ENTRY
- printf ("libmpeg2: dicontinuity\n");
-#endif
-/* mpeg2_discontinuity (&this->mpeg2dec); */
-}
-
-static void mpeg2_video_dispose (video_decoder_t *this_gen) {
-
- mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
-
-#ifdef LOG_ENTRY
- printf ("libmpeg2: close\n");
-#endif
-
- mpeg2_close (this->mpeg2dec);
-
- this->stream->video_out->close(this->stream->video_out, this->stream);
-
- free (this);
-}
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
- mpeg2_video_decoder_t *this ;
- int32_t n;
-
- this = (mpeg2_video_decoder_t *) calloc(1, sizeof(mpeg2_video_decoder_t));
-
- this->video_decoder.decode_data = mpeg2_video_decode_data;
- this->video_decoder.flush = mpeg2_video_flush;
- this->video_decoder.reset = mpeg2_video_reset;
- this->video_decoder.discontinuity = mpeg2_video_discontinuity;
- this->video_decoder.dispose = mpeg2_video_dispose;
- this->stream = stream;
- this->class = (mpeg2_class_t *) class_gen;
- this->frame_number=0;
- this->rff_pattern=0;
-
- this->mpeg2dec = mpeg2_init ();
- mpeg2_custom_fbuf (this->mpeg2dec, 1); /* <- Force libmpeg2 to use xine frame buffers. */
- (stream->video_out->open) (stream->video_out, stream);
- this->force_aspect = this->force_pan_scan = 0;
- for(n=0;n<30;n++) this->img_state[n].id=0;
-
- return &this->video_decoder;
-}
-
-/*
- * mpeg2 plugin class
- */
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "mpeg2new";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "mpeg2 based video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- mpeg2_class_t *this;
-
- this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-/*
- * exported plugin catalog entry
- */
-
-static const uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
-
-static const decoder_info_t dec_info_mpeg2 = {
- supported_types, /* supported types */
- 6 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "mpeg2new", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libmusepack/Makefile.am b/src/libmusepack/Makefile.am
deleted file mode 100644
index 252e3d6ad..000000000
--- a/src/libmusepack/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-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/libmusepack/xine_musepack_decoder.c b/src/libmusepack/xine_musepack_decoder.c
deleted file mode 100644
index 52973c751..000000000
--- a/src/libmusepack/xine_musepack_decoder.c
+++ /dev/null
@@ -1,547 +0,0 @@
-/*
- * Copyright (C) 2005 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, USA
- *
- * xine interface to libmusepack by James Stembridge <jstembridge@gmail.com>
- *
- * TODO:
- * 32bit float output
- * Seeking??
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define LOG_MODULE "mpc_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-
-#ifdef HAVE_MPCDEC_MPCDEC_H
-# include <mpcdec/mpcdec.h>
-#elif defined(HAVE_MPC_MPCDEC_H)
-# include <mpc/mpcdec.h>
-#else
-# include "musepack/musepack.h"
-#endif
-
-#define MPC_DECODER_MEMSIZE 65536
-#define MPC_DECODER_MEMSIZE2 (MPC_DECODER_MEMSIZE/2)
-
-#define INIT_BUFSIZE (MPC_DECODER_MEMSIZE*2)
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} mpc_class_t;
-
-typedef struct mpc_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- int sample_rate; /* audio sample rate */
- int bits_per_sample; /* bits/sample, usually 8 or 16 */
- int channels; /* 1 or 2, usually */
-
- int output_open; /* flag to indicate audio is ready */
-
- unsigned char *buf; /* data accumulation buffer */
- unsigned int buf_max; /* maximum size of buf */
- unsigned int read; /* size of accum. data already read */
- unsigned int size; /* size of accumulated data in buf */
-
- mpc_reader reader;
- mpc_streaminfo streaminfo;
-#ifndef HAVE_MPC_MPCDEC_H
- mpc_decoder decoder;
-#else
- mpc_demux *decoder;
-#endif
-
- int decoder_ok;
- unsigned int current_frame;
-
- int32_t file_size;
-
-} mpc_decoder_t;
-
-
-/**************************************************************************
- * musepack specific functions
- *************************************************************************/
-
-/* Reads size bytes of data into buffer at ptr. */
-#ifndef HAVE_MPC_MPCDEC_H
-static int32_t mpc_reader_read(void *data, void *ptr, int size) {
- mpc_decoder_t *this = (mpc_decoder_t *) data;
-#else
-static int32_t mpc_reader_read(mpc_reader *data, void *ptr, int size) {
- mpc_decoder_t *this = (mpc_decoder_t *) data->data;
-#endif
-
- lprintf("mpc_reader_read: size=%d\n", size);
-
- /* Don't try to read more data than we have */
- if (size > (this->size - this->read))
- size = this->size - this->read;
-
- /* Copy the data */
- xine_fast_memcpy(ptr, &this->buf[this->read], size);
-
- /* Update our position in the data buffer */
- this->read += size;
-
- return size;
-}
-
-/* Seeks to byte position offset. */
-#ifndef HAVE_MPC_MPCDEC_H
-static mpc_bool_t mpc_reader_seek(void *data, int32_t offset) {
- mpc_decoder_t *this = (mpc_decoder_t *) data;
-#else
-static mpc_bool_t mpc_reader_seek(mpc_reader *data, int32_t offset) {
- mpc_decoder_t *this = (mpc_decoder_t *) data->data;
-#endif
-
- lprintf("mpc_reader_seek: offset=%d\n", offset);
-
- /* seek is only called when reading the header so we can assume
- * that the buffer starts at the start of the file */
- this->read = offset;
-
-#ifndef HAVE_MPC_MPCDEC_H
- return TRUE;
-#else
- return MPC_TRUE;
-#endif
-}
-
-/* Returns the current byte offset in the stream. */
-#ifndef HAVE_MPC_MPCDEC_H
-static int32_t mpc_reader_tell(void *data) {
-#else
-static int32_t mpc_reader_tell(mpc_reader *data) {
-#endif
- lprintf("mpc_reader_tell\n");
-
- /* Tell isn't used so just return 0 */
- return 0;
-}
-
-/* Returns the total length of the source stream, in bytes. */
-#ifndef HAVE_MPC_MPCDEC_H
-static int32_t mpc_reader_get_size(void *data) {
- mpc_decoder_t *this = (mpc_decoder_t *) data;
-#else
-static int32_t mpc_reader_get_size(mpc_reader *data) {
- mpc_decoder_t *this = (mpc_decoder_t *) data->data;
-#endif
-
- lprintf("mpc_reader_get_size\n");
-
- return this->file_size;
-}
-
-/* True if the stream is a seekable stream. */
-#ifndef HAVE_MPC_MPCDEC_H
-static mpc_bool_t mpc_reader_canseek(void *data) {
- lprintf("mpc_reader_canseek\n");
-
- return TRUE;
-#else
-static mpc_bool_t mpc_reader_canseek(mpc_reader *data) {
-
- lprintf("mpc_reader_canseek\n");
- return MPC_TRUE;
-#endif
-}
-
-/* Convert 32bit float samples into 16bit int samples */
-static inline void float_to_int(float *_f, int16_t *s16, 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;
- /* printf("samples[%d] = %f, %d\n", i, _f[i], s16[num_channels*i]); */
- }
-}
-
-/* Decode a musepack frame */
-static int mpc_decode_frame (mpc_decoder_t *this) {
- float buffer[MPC_DECODER_BUFFER_LENGTH];
- uint32_t frames;
-#ifdef HAVE_MPC_MPCDEC_H
- mpc_frame_info frame;
-#endif
-
- lprintf("mpd_decode_frame\n");
-
-#ifndef HAVE_MPC_MPCDEC_H
- frames = mpc_decoder_decode(&this->decoder, buffer, 0, 0);
-#else
- frame.buffer = buffer;
- mpc_demux_decode(this->decoder, &frame);
- frames = frame.samples;
-#endif
-
- if (frames > 0) {
- audio_buffer_t *audio_buffer;
- int16_t *int_samples;
-
- lprintf("got %d samples\n", frames);
-
- /* Get audio buffer */
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- audio_buffer->vpts = 0;
- audio_buffer->num_frames = frames;
-
- /* Convert samples */
- int_samples = (int16_t *) audio_buffer->mem;
- float_to_int(buffer, int_samples, frames*this->channels);
-
- /* Output converted samples */
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
- }
-
- return frames;
-}
-
-/**************************************************************************
- * xine audio plugin functions
- *************************************************************************/
-
-static void mpc_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
- mpc_decoder_t *this = (mpc_decoder_t *) this_gen;
- int err;
-
- lprintf("mpc_decode_data\n");
-
- if (!_x_stream_info_get(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED))
- return;
-
- /* We don't handle special buffers */
- if (buf->decoder_flags & BUF_FLAG_SPECIAL)
- return;
-
- /* Read header */
- if (buf->decoder_flags & BUF_FLAG_HEADER) {
-
- lprintf("header\n");
-
- /* File size is in decoder_info[0] */
- this->file_size = buf->decoder_info[0];
-
- /* Initialise the data accumulation buffer */
- this->buf = calloc(1, INIT_BUFSIZE);
- this->buf_max = INIT_BUFSIZE;
- this->read = 0;
- this->size = 0;
-
- /* Initialise the reader */
- this->reader.read = mpc_reader_read;
- this->reader.seek = mpc_reader_seek;
- this->reader.tell = mpc_reader_tell;
- this->reader.get_size = mpc_reader_get_size;
- this->reader.canseek = mpc_reader_canseek;
- this->reader.data = this;
-
- /* Copy header to buffer */
- xine_fast_memcpy(this->buf, buf->content, buf->size);
- this->size = buf->size;
-
-#ifdef HAVE_MPC_MPCDEC_H
- this->decoder = mpc_demux_init(&this->reader);
- if (!this->decoder) {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("libmusepack: mpc_demux_init failed.\n"));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
- return;
- }
- mpc_demux_get_info(this->decoder, &this->streaminfo);
-#else
- /* Initialise and read stream info */
- mpc_streaminfo_init(&this->streaminfo);
-
- if ((err = mpc_streaminfo_read(&this->streaminfo, &this->reader))) {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("libmusepack: mpc_streaminfo_read failed: %d\n"), err);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
- return;
- }
-#endif
-
- this->sample_rate = this->streaminfo.sample_freq;
- this->channels = this->streaminfo.channels;
- this->bits_per_sample = 16;
-
- /* After the header the demuxer starts sending data from an offset
- * of 28 bytes */
- this->size = 28;
-
- /* We need to keep track of the current frame so we now when we've
- * reached the end of the stream */
- this->current_frame = 0;
-
- /* Setup the decoder */
-#ifndef HAVE_MPC_MPCDEC_H
- mpc_decoder_setup(&this->decoder, &this->reader);
-#endif
- this->decoder_ok = 0;
-
- /* Take this opportunity to initialize stream/meta information */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "Musepack (libmusepack)");
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
- (int) this->streaminfo.average_bitrate);
-
- return;
- }
-
- lprintf("data: %u size=%u read=%u\n", buf->size, this->size, this->read);
-
- /* if the audio output is not open yet, open the audio output */
- 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,
- _x_ao_channels2mode(this->channels));
-
- /* if the audio still isn't open, do not go any further with the decode */
- if (!this->output_open)
- return;
- }
-
- /* If we run out of space in our internal buffer we discard what's
- * already been read */
- if (((this->size + buf->size) > this->buf_max) && this->read) {
- lprintf("discarding read data\n");
- this->size -= this->read;
- memmove(this->buf, &this->buf[this->read], this->size);
- this->read = 0;
- }
-
- /* If there still isn't space we have to increase the size of the
- * internal buffer */
- if ((this->size + buf->size) > this->buf_max) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libmusepack: increasing internal buffer size\n");
- this->buf_max += 2*buf->size;
- this->buf = realloc(this->buf, this->buf_max);
- }
-
- /* Copy data */
- xine_fast_memcpy(&this->buf[this->size], buf->content, buf->size);
- this->size += buf->size;
-
- /* Time to decode */
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
- /* Increment frame count */
-#ifndef HAVE_MPC_MPCDEC_H
- if (this->current_frame++ == this->streaminfo.frames) {
-#else
- if (this->current_frame++ == this->streaminfo.samples) {
-#endif
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("libmusepack: data after last frame ignored\n"));
- return;
- }
-
- if (!this->decoder_ok) {
- /* We require MPC_DECODER_MEMSIZE bytes to initialise the decoder */
- if ((this->size - this->read) >= MPC_DECODER_MEMSIZE) {
- lprintf("initialise");
-
-#ifndef HAVE_MPC_MPCDEC_H
- if (!mpc_decoder_initialize(&this->decoder, &this->streaminfo)) {
-#else
- if (!this->decoder) {
-#endif
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("libmusepack: mpc_decoder_initialise failed\n"));
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
- return;
- }
-
- this->decoder_ok = 1;
- } else {
- /* Not enough data yet */
- return;
- }
- }
-
- /* mpc_decoder_decode may cause a read of MPC_DECODER_MEMSIZE/2 bytes so
- * make sure we have enough data available */
- if ((this->size - this->read) >= MPC_DECODER_MEMSIZE2) {
- lprintf("decoding\n");
-
- if ((err = mpc_decode_frame(this)) < 0) {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("libmusepack: mpc_decoder_decode failed: %d\n"), err);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_HANDLED, 0);
- return;
- }
- }
-
- /* If we are at the end of the stream we decode the remaining frames as we
- * know we'll have enough data */
-#ifndef HAVE_MPC_MPCDEC_H
- if (this->current_frame == this->streaminfo.frames) {
-#else
- if (this->current_frame == this->streaminfo.samples) {
-#endif
- lprintf("flushing buffers\n");
-
- do {
- if ((err = mpc_decode_frame(this)) < 0) {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("libmusepack: mpc_decoder_decode failed: %d\n"), err);
- }
- } while (err > 0);
-
- lprintf("buffers flushed\n");
- }
- }
-}
-
-static void mpc_reset (audio_decoder_t *this_gen) {
- mpc_decoder_t *this = (mpc_decoder_t *) this_gen;
-
- this->size = 0;
- this->read = 0;
-}
-
-static void mpc_discontinuity (audio_decoder_t *this_gen) {
- /* mpc_decoder_t *this = (mpc_decoder_t *) this_gen; */
-}
-
-static void mpc_dispose (audio_decoder_t *this_gen) {
-
- mpc_decoder_t *this = (mpc_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);
-#ifdef HAVE_MPC_MPCDEC_H
- if (this->decoder)
- mpc_demux_exit(this->decoder);
-#endif
-
- free(this);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- mpc_decoder_t *this ;
-
- this = (mpc_decoder_t *) calloc(1, sizeof(mpc_decoder_t));
-
- /* connect the member functions */
- this->audio_decoder.decode_data = mpc_decode_data;
- this->audio_decoder.reset = mpc_reset;
- this->audio_decoder.discontinuity = mpc_discontinuity;
- this->audio_decoder.dispose = mpc_dispose;
-
- /* connect the stream */
- this->stream = stream;
-
- /* audio output is not open at the start */
- this->output_open = 0;
-
- /* no buffer yet */
- this->buf = NULL;
-
- /* initialize the basic audio parameters */
- this->channels = 0;
- this->sample_rate = 0;
- this->bits_per_sample = 0;
-
- /* return the newly-initialized audio decoder */
- return &this->audio_decoder;
-}
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "mpc";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "mpc: musepack audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this_gen) {
-
- mpc_class_t *this = (mpc_class_t *)this_gen;
-
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- mpc_class_t *this ;
-
- this = (mpc_class_t *) calloc(1, sizeof(mpc_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_MPC,
- 0
-};
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 5 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* { type, API version, "name", version, special_info, init_function }, */
- { PLUGIN_AUDIO_DECODER, 15, "mpc", XINE_VERSION_CODE, &dec_info_audio, &init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/libreal/Makefile.am b/src/libreal/Makefile.am
index 90e47a63c..31c48a48b 100644
--- a/src/libreal/Makefile.am
+++ b/src/libreal/Makefile.am
@@ -1,13 +1,15 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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/libreal/real_common.c b/src/libreal/real_common.c
index bcdd7ff00..c7ba38105 100644
--- a/src/libreal/real_common.c
+++ b/src/libreal/real_common.c
@@ -186,7 +186,7 @@ void *_x_real_codec_open(xine_stream_t *const stream, const char *const path,
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "realvdec", XINE_VERSION_CODE, &dec_info_realvideo, init_realvdec },
- { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "realadec", XINE_VERSION_CODE, &dec_info_realaudio, init_realadec },
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "realvdec", XINE_VERSION_CODE, &dec_info_realvideo, init_realvdec },
+ { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 16, "realadec", XINE_VERSION_CODE, &dec_info_realaudio, init_realadec },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/libreal/real_common.h b/src/libreal/real_common.h
index 3c77eda5f..fb1e103df 100644
--- a/src/libreal/real_common.h
+++ b/src/libreal/real_common.h
@@ -23,7 +23,7 @@
#ifndef __REAL_COMMON_H__
#define __REAL_COMMON_H__
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
/*
* some fake functions to make real codecs happy
diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c
index aa53bbb8d..50c5268da 100644
--- a/src/libreal/xine_real_audio_decoder.c
+++ b/src/libreal/xine_real_audio_decoder.c
@@ -42,10 +42,10 @@
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "real_common.h"
@@ -498,19 +498,6 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
/*
* real plugin class
*/
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "realadec";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "real binary-only codec based audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
void *init_realadec (xine_t *xine, void *data) {
real_class_t *this;
@@ -518,9 +505,9 @@ void *init_realadec (xine_t *xine, void *data) {
this = (real_class_t *) calloc(1, sizeof(real_class_t));
this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
+ this->decoder_class.identifier = "realadec";
+ this->decoder_class.description = N_("real binary-only codec based audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
_x_real_codecs_init(xine);
@@ -531,7 +518,7 @@ void *init_realadec (xine_t *xine, void *data) {
* exported plugin catalog entry
*/
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_COOK, BUF_AUDIO_ATRK, /* BUF_AUDIO_14_4, BUF_AUDIO_28_8, */ BUF_AUDIO_SIPRO, 0
};
diff --git a/src/libreal/xine_real_video_decoder.c b/src/libreal/xine_real_video_decoder.c
index c2909f57c..ce717fe81 100644
--- a/src/libreal/xine_real_video_decoder.c
+++ b/src/libreal/xine_real_video_decoder.c
@@ -41,10 +41,10 @@
#define LOG
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "real_common.h"
@@ -521,19 +521,6 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
/*
* real plugin class
*/
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "realvdec";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "real binary-only codec based video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
void *init_realvdec (xine_t *xine, void *data) {
real_class_t *this;
@@ -541,9 +528,9 @@ void *init_realvdec (xine_t *xine, void *data) {
this = (real_class_t *) calloc(1, sizeof(real_class_t));
this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
+ this->decoder_class.identifier = "realvdec";
+ this->decoder_class.description = N_("real binary-only codec based video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
_x_real_codecs_init(xine);
@@ -554,7 +541,7 @@ void *init_realvdec (xine_t *xine, void *data) {
* exported plugin catalog entry
*/
-static uint32_t supported_types[] = { BUF_VIDEO_RV30,
+static const uint32_t supported_types[] = { BUF_VIDEO_RV30,
BUF_VIDEO_RV40,
0 };
diff --git a/src/libspucc/Makefile.am b/src/libspucc/Makefile.am
deleted file mode 100644
index cde6ecf05..000000000
--- a/src/libspucc/Makefile.am
+++ /dev/null
@@ -1,11 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-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 = $(xineplug_ldflags)
-
-noinst_HEADERS = cc_decoder.h
diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c
deleted file mode 100644
index 00300adc2..000000000
--- a/src/libspucc/cc_decoder.c
+++ /dev/null
@@ -1,1486 +0,0 @@
-/*
- * Copyright (C) 2000-2003 the xine project
- *
- * Copyright (C) Christian Vogler
- * cvogler@gradient.cis.upenn.edu - December 2001
- *
- * 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, USA
- *
- * stuff needed to provide closed captioning decoding and display
- *
- * Some small bits and pieces of the EIA-608 captioning decoder were
- * adapted from CCDecoder 0.9.1 by Mike Baker. The latest version is
- * available at http://sourceforge.net/projects/ccdecoder/.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/time.h>
-
-#include <inttypes.h>
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "xineutils.h"
-#include "osd.h"
-#include "cc_decoder.h"
-#include "osd.h"
-
-/*
-#define LOG_DEBUG 3
-*/
-
-/* at 29.97 fps, each NTSC frame takes 3003 metronom ticks on the average. */
-#define NTSC_FRAME_DURATION 3003
-
-#define CC_ROWS 15
-#define CC_COLUMNS 32
-#define CC_CHANNELS 2
-
-/* 1 is the caption background color index in the OSD palettes. */
-#define CAP_BG_COL 1
-
-/* number of text colors specified by EIA-608 standard */
-#define NUM_FG_COL 7
-
-#ifndef WIN32
-/* colors specified by the EIA 608 standard */
-enum { WHITE, GREEN, BLUE, CYAN, RED, YELLOW, MAGENTA, BLACK, TRANSPARENT };
-#else
-/* colors specified by the EIA 608 standard */
-enum { WHITE, GREEN, BLUE, CYAN, RED, YELLOW, MAGENTA, BLACK };
-#endif
-
-
-
-/* color mapping to OSD text color indices */
-static const int text_colormap[NUM_FG_COL] = {
- OSD_TEXT1, OSD_TEXT2, OSD_TEXT3, OSD_TEXT4, OSD_TEXT5, OSD_TEXT6, OSD_TEXT7
-};
-
-
-/* -------------------- caption text colors -----------------------------*/
-/* FIXME: The colors look fine on an XShm display, but they look *terrible*
- with the Xv display on the NVidia driver on a GeForce 3. The colors bleed
- into each other more than I'd expect from the downsampling into YUV
- colorspace.
- At this moment, it looks like a problem in the Xv YUV blending functions.
-*/
-typedef struct colorinfo_s {
- clut_t bgcol; /* text background color */
- clut_t bordercol; /* text border color */
- clut_t textcol; /* text color */
-} colorinfo_t;
-
-
-static const colorinfo_t cc_text_trans[NUM_FG_COL] = {
- /* white, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80)
- },
-
- /* green, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x90, 0x22, 0x35)
- },
-
- /* blue, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x29, 0x6e, 0xff)
- },
-
- /* cyan, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xaa, 0x10, 0xa6)
- },
-
- /* red, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x52, 0xf0, 0x5a)
- },
-
- /* yellow, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xd4, 0x92, 0x10)
- },
-
- /* magenta, black border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x6b, 0xde, 0xca)
- }
-};
-
-static const colorinfo_t cc_text_solid[NUM_FG_COL] = {
- /* white, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80)
- },
-
- /* green, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x90, 0x22, 0x35)
- },
-
- /* blue, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x29, 0x6e, 0xff)
- },
-
- /* cyan, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xaa, 0x10, 0xa6)
- },
-
- /* red, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x52, 0xf0, 0x5a)
- },
-
- /* yellow, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xd4, 0x92, 0x10)
- },
-
- /* magenta, black border, solid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x6b, 0xde, 0xca)
- }
-};
-
-
-static const uint8_t cc_text_trans_alpha[TEXT_PALETTE_SIZE] = {
- 0, 8, 9, 10, 11, 12, 15, 15, 15, 15, 15
-};
-
-static const uint8_t cc_text_solid_alpha[TEXT_PALETTE_SIZE] = {
- 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
-};
-
-
-static const colorinfo_t *const cc_text_palettes[NUM_CC_PALETTES] = {
- cc_text_trans,
- cc_text_solid
-};
-
-static const uint8_t *const cc_alpha_palettes[NUM_CC_PALETTES] = {
- cc_text_trans_alpha,
- cc_text_solid_alpha
-};
-
-/* --------------------- misc. EIA 608 definitions -------------------*/
-
-#define TRANSP_SPACE 0x19 /* code for transparent space, essentially
- arbitrary */
-
-/* mapping from PAC row code to actual CC row */
-static const int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6,
- 7, 8, 9};
-/* FIXME: do real â„¢ (U+2122) */
-/* Code 182 must be mapped as a musical note ('♪', U+266A) in the caption font */
-static const char specialchar[] = {
- 174 /* ® */, 176 /* ° */, 189 /* ½ */, 191 /* ¿ */,
- 'T' /* ™ */, 162 /* ¢ */, 163 /* £ */, 182 /* ¶ => ♪ */,
- 224 /* à */, TRANSP_SPACE,232 /* è */, 226 /* â */,
- 234 /* ê */, 238 /* î */, 244 /* ô */, 251 /* û */
-};
-
-/* character translation table - EIA 608 codes are not all the same as ASCII */
-static char chartbl[128];
-
-/* CC codes use odd parity for error detection, since they originally were */
-/* transmitted via noisy video signals */
-static int parity_table[256];
-
-
-/*---------------- decoder data structures -----------------------*/
-
-/* CC renderer */
-struct cc_renderer_s {
- int video_width; /* video dimensions */
- int video_height;
-
- int x; /* coordinates of the captioning area */
- int y;
- int width;
- int height;
- int max_char_height; /* captioning font properties */
- int max_char_width;
-
- osd_renderer_t *osd_renderer; /* active OSD renderer */
- osd_object_t *cap_display; /* caption display object */
- int displayed; /* true when caption currently is displayed */
-
- /* the next variable is a hack: hiding a caption with vpts 0 doesn't seem
- to work if the caption has been registered in the SPU event queue, but
- not yet displayed. So we remember the vpts of the show event, and use
- that as the vpts of the hide event upon an osd free.
- */
-/*FIXME: bug in OSD or SPU?*/
- int64_t display_vpts; /* vpts of currently displayed caption */
-
- /* this variable is an even worse hack: in some rare cases, the pts
- information on the DVD gets out of sync with the caption information.
- If this happens, the vpts of a hide caption event can actually be
- slightly higher than the vpts of the following show caption event.
- For this reason, we remember the vpts of the hide event and force
- the next show event's vpts to be at least equal to the hide event's
- vpts.
- */
- int64_t last_hide_vpts;
-
- /* caption palette and alpha channel */
- uint32_t cc_palette[OVL_PALETTE_SIZE];
- uint8_t cc_trans[OVL_PALETTE_SIZE];
-
- metronom_t *metronom; /* the active xine metronom */
-
- cc_state_t *cc_state; /* captioning configuration */
-};
-
-
-/* CC attribute */
-typedef struct cc_attribute_s {
- uint8_t italic;
- uint8_t underline;
- uint8_t foreground;
- uint8_t background;
-} cc_attribute_t;
-
-/* CC character cell */
-typedef struct cc_char_cell_s {
- uint8_t c; /* character code, not the same as ASCII */
- cc_attribute_t attributes; /* attributes of this character, if changed */
- /* here */
- int midrow_attr; /* true if this cell changes an attribute */
-} cc_char_cell_t;
-
-/* a single row in the closed captioning memory */
-typedef struct cc_row_s {
- cc_char_cell_t cells[CC_COLUMNS];
- int pos; /* position of the cursor */
- int num_chars; /* how many characters in the row are data */
- int attr_chg; /* true if midrow attr. change at cursor pos */
- int pac_attr_chg; /* true if attribute has changed via PAC */
- cc_attribute_t pac_attr; /* PAC attr. that hasn't been applied yet */
-} cc_row_t;
-
-/* closed captioning memory for a single channel */
-typedef struct cc_buffer_s {
- cc_row_t rows[CC_ROWS];
- int rowpos; /* row cursor position */
-} cc_buffer_t;
-
-/* captioning memory for all channels */
-typedef struct cc_memory_s {
- cc_buffer_t channel[CC_CHANNELS];
- int channel_no; /* currently active channel */
-} cc_memory_t;
-
-/* The closed captioning decoder data structure */
-struct cc_decoder_s {
- /* CC decoder buffer - one onscreen, one offscreen */
- cc_memory_t buffer[2];
- /* onscreen, offscreen buffer ptrs */
- cc_memory_t *on_buf;
- cc_memory_t *off_buf;
- /* which buffer is active for receiving data */
- cc_memory_t **active;
-
- /* for logging and debugging purposes, captions are assigned increasing */
- /* unique ids. */
- uint32_t capid;
-
- /* the last captioning code seen (control codes are often sent twice
- in a row, but should be processed only once) */
- uint32_t lastcode;
-
- /* The PTS and SCR at which the captioning chunk started */
- int64_t pts;
- /* holds the NTSC frame offset to last known pts/scr */
- uint32_t f_offset;
-
- /* active OSD renderer */
- osd_renderer_t *renderer;
- /* true when caption currently is displayed */
- int displayed;
-
- /* configuration and intrinsics of CC decoder */
- cc_state_t *cc_state;
-
- metronom_t *metronom;
-};
-
-
-/*---------------- general utility functions ---------------------*/
-
-static void get_font_metrics(osd_renderer_t *renderer,
- const char *fontname, int font_size,
- int *maxw, int *maxh)
-{
- int c;
- osd_object_t *testc = renderer->new_object(renderer, 640, 480);
-
- *maxw = 0;
- *maxh = 0;
-
- renderer->set_font(testc, (char *) fontname, font_size);
- renderer->set_encoding(testc, "iso-8859-1");
- for (c = 32; c < 256; c++) {
- int tw, th;
- char buf[2];
-
- buf[0] = (char)c;
- buf[1] = '\0';
-
- renderer->get_text_size(testc, buf, &tw, &th);
- *maxw = MAX(*maxw, tw);
- *maxh = MAX(*maxh, th);
- }
- renderer->free_object(testc);
-}
-
-
-static int parity(uint8_t byte)
-{
- int i;
- int ones = 0;
-
- for (i = 0; i < 7; i++) {
- if (byte & (1 << i))
- ones++;
- }
-
- return ones & 1;
-}
-
-
-static void build_parity_table(void)
-{
- uint8_t byte;
- int parity_v;
- for (byte = 0; byte <= 127; byte++) {
- parity_v = parity(byte);
- /* CC uses odd parity (i.e., # of 1's in byte is odd.) */
- parity_table[byte] = parity_v;
- parity_table[byte | 0x80] = !parity_v;
- }
-}
-
-
-static int good_parity(uint16_t data)
-{
- int ret = parity_table[data & 0xff] && parity_table[(data & 0xff00) >> 8];
- if (! ret)
- printf("Bad parity in EIA-608 data (%x)\n", data);
- return ret;
-}
-
-
-static void build_char_table(void)
-{
- int i;
- /* first the normal ASCII codes */
- for (i = 0; i < 128; i++)
- chartbl[i] = (char) i;
- /* now the special codes */
- chartbl[0x2a] = 225; /* á */
- chartbl[0x5c] = 233; /* é */
- chartbl[0x5e] = 237; /* í */
- chartbl[0x5f] = 243; /* ó */
- chartbl[0x60] = 250; /* ú */
- chartbl[0x7b] = 231; /* ç */
- chartbl[0x7c] = 247; /* ÷ */
- chartbl[0x7d] = 209; /* Ñ */
- chartbl[0x7e] = 241; /* ñ */
- chartbl[0x7f] = 164; /* ¤ FIXME: should be a solid block ('█'; U+2588) */
-}
-
-
-static clut_t interpolate_color(clut_t src, clut_t dest, int steps,
- int current_step)
-{
- int diff_y = ((int) dest.y) - ((int) src.y);
- int diff_cr = ((int) dest.cr) - ((int) src.cr);
- int diff_cb = ((int) dest.cb) - ((int) src.cb);
- int res_y = ((int) src.y) + (diff_y * current_step / (steps + 1));
- int res_cr = ((int) src.cr) + (diff_cr * current_step / (steps + 1));
- int res_cb = ((int) src.cb) + (diff_cb * current_step / (steps + 1));
-#if __SUNPRO_C
- /*
- * Sun's Forte compiler refuses to initialize automatic structure
- * variable with bitfields, so we use explicit assignments for now.
- */
- clut_t res;
- res.y = res_y;
- res.cr = res_cr;
- res.cb = res_cb;
- res.foo = 0;
-#else
- clut_t res = CLUT_Y_CR_CB_INIT((uint8_t) res_y, (uint8_t) res_cr,
- (uint8_t) res_cb);
-#endif
- return res;
-}
-
-/*----------------- cc_row_t methods --------------------------------*/
-
-static void ccrow_fill_transp(cc_row_t *rowbuf){
- int i;
-
-#ifdef LOG_DEBUG
- printf("cc_decoder: ccrow_fill_transp: Filling in %d transparent spaces.\n",
- rowbuf->pos - rowbuf->num_chars);
-#endif
- for (i = rowbuf->num_chars; i < rowbuf->pos; i++) {
- rowbuf->cells[i].c = TRANSP_SPACE;
- rowbuf->cells[i].midrow_attr = 0;
- }
-}
-
-
-static int ccrow_find_next_text_part(cc_row_t *this, int pos)
-{
- while (pos < this->num_chars && this->cells[pos].c == TRANSP_SPACE)
- pos++;
- return pos;
-}
-
-
-static int ccrow_find_end_of_text_part(cc_row_t *this, int pos)
-{
- while (pos < this->num_chars && this->cells[pos].c != TRANSP_SPACE)
- pos++;
- return pos;
-}
-
-
-static int ccrow_find_current_attr(cc_row_t *this, int pos)
-{
- while (pos > 0 && !this->cells[pos].midrow_attr)
- pos--;
- return pos;
-}
-
-
-static int ccrow_find_next_attr_change(cc_row_t *this, int pos, int lastpos)
-{
- pos++;
- while (pos < lastpos && !this->cells[pos].midrow_attr)
- pos++;
- return pos;
-}
-
-
-static void ccrow_set_attributes(cc_renderer_t *renderer, cc_row_t *this,
- int pos)
-{
- const cc_attribute_t *attr = &this->cells[pos].attributes;
- const char *fontname;
- cc_config_t *cap_info = renderer->cc_state->cc_cfg;
-
- if (attr->italic)
- fontname = cap_info->italic_font;
- else
- fontname = cap_info->font;
- renderer->osd_renderer->set_font(renderer->cap_display, (char *) fontname,
- cap_info->font_size);
-}
-
-
-static void ccrow_render(cc_renderer_t *renderer, cc_row_t *this, int rownum)
-{
- char buf[CC_COLUMNS + 1];
- int base_y;
- int pos = ccrow_find_next_text_part(this, 0);
- cc_config_t *cap_info = renderer->cc_state->cc_cfg;
- osd_renderer_t *osd_renderer = renderer->osd_renderer;
-
- /* find y coordinate of caption */
- if (cap_info->center) {
- /* find y-center of the desired row; the next line computes */
- /* cap_info->height * (rownum + 0.5) / CC_ROWS */
- /* in integer arithmetic for this purpose. */
- base_y = (renderer->height * rownum * 100 + renderer->height * 50) /
- (CC_ROWS * 100);
- }
- else
- base_y = renderer->height * rownum / CC_ROWS;
-
- /* break down captions into parts separated by transparent space, and */
- /* center each part individually along the x axis */
- while (pos < this->num_chars) {
- int endpos = ccrow_find_end_of_text_part(this, pos);
- int seg_begin = pos;
- int seg_end;
- int i;
- int text_w = 0, text_h = 0;
- int x, y;
- int seg_w, seg_h;
- int seg_pos[CC_COLUMNS + 1];
- int seg_attr[CC_COLUMNS];
- int cumulative_seg_width[CC_COLUMNS + 1];
- int num_seg = 0;
- int seg;
-
- /* break down each part into segments bounded by attribute changes and */
- /* find text metrics of the parts */
- seg_pos[0] = seg_begin;
- cumulative_seg_width[0] = 0;
- while (seg_begin < endpos) {
- int attr_pos = ccrow_find_current_attr(this, seg_begin);
- seg_end = ccrow_find_next_attr_change(this, seg_begin, endpos);
-
- /* compute text size of segment */
- for (i = seg_begin; i < seg_end; i++)
- buf[i - seg_begin] = this->cells[i].c;
- buf[seg_end - seg_begin] = '\0';
- ccrow_set_attributes(renderer, this, attr_pos);
- osd_renderer->get_text_size(renderer->cap_display, buf,
- &seg_w, &seg_h);
-
- /* update cumulative segment statistics */
- text_w += seg_w;
- text_h += seg_h;
- seg_pos[num_seg + 1] = seg_end;
- seg_attr[num_seg] = attr_pos;
- cumulative_seg_width[num_seg + 1] = text_w;
- num_seg++;
-
- seg_begin = seg_end;
- }
-
- /* compute x coordinate of part */
- if (cap_info->center) {
- int cell_width = renderer->width / CC_COLUMNS;
- x = (renderer->width * (pos + endpos) / 2) / CC_COLUMNS;
- x -= text_w / 2;
- /* clamp x coordinate to nearest character cell */
- x = ((x + cell_width / 2) / CC_COLUMNS) * CC_COLUMNS + cell_width;
- y = base_y - (renderer->max_char_height + 1) / 2;
- }
- else {
- x = renderer->width * pos / CC_COLUMNS;
- y = base_y;
- }
-
-#ifdef LOG_DEBUG
- printf("text_w, text_h = %d, %d\n", text_w, text_h);
- printf("cc from %d to %d; text plotting from %d, %d (basey = %d)\n", pos, endpos, x, y, base_y);
-#endif
-
- /* render text part by rendering each attributed text segment */
- for (seg = 0; seg < num_seg; seg++) {
- int textcol = text_colormap[this->cells[seg_attr[seg]].attributes.foreground];
- int box_x1 = x + cumulative_seg_width[seg];
- int box_x2 = x + cumulative_seg_width[seg + 1];
-
-#ifdef LOG_DEBUG
- printf("ccrow_render: rendering segment %d from %d to %d / %d to %d\n",
- seg, seg_pos[seg], seg_pos[seg + 1],
- x + cumulative_seg_width[seg], x + cumulative_seg_width[seg + 1]);
-#endif
- /* make caption background a uniform box. Without this line, the */
- /* background is uneven for superscript characters. */
- /* Also pad left & right ends of caption to make it more readable */
-/*FIXME: There may be off-by one errors in the rendering - check with Miguel*/
- if (seg == 0)
- box_x1 -= renderer->max_char_width;
- if (seg == num_seg - 1)
- box_x2 += renderer->max_char_width;
- osd_renderer->filled_rect(renderer->cap_display, box_x1, y, box_x2,
- y + renderer->max_char_height,
- textcol + CAP_BG_COL);
-
- for (i = seg_pos[seg]; i < seg_pos[seg + 1]; i++)
- buf[i - seg_pos[seg]] = this->cells[i].c;
- buf[seg_pos[seg + 1] - seg_pos[seg]] = '\0';
- ccrow_set_attributes(renderer, this, seg_attr[seg]);
-
- /* text is already mapped from EIA-608 into iso-8859-1 */
- osd_renderer->render_text(renderer->cap_display,
- x + cumulative_seg_width[seg], y, buf,
- textcol);
- }
-
- pos = ccrow_find_next_text_part(this, endpos);
- }
-}
-
-
-/*----------------- cc_buffer_t methods --------------------------------*/
-
-static int ccbuf_has_displayable(cc_buffer_t *this)
-{
- int i;
- int found = 0;
- for (i = 0; !found && i < CC_ROWS; i++) {
- if (this->rows[i].num_chars > 0)
- found = 1;
- }
- return found;
-}
-
-
-static void ccbuf_add_char(cc_buffer_t *this, uint8_t c)
-{
- cc_row_t *rowbuf = &this->rows[this->rowpos];
- int pos = rowbuf->pos;
- int left_displayable = (pos > 0) && (pos <= rowbuf->num_chars);
-
-#if LOG_DEBUG > 2
- printf("cc_decoder: ccbuf_add_char: %c @ %d/%d\n", c, this->rowpos, pos);
-#endif
-
- if (pos >= CC_COLUMNS) {
- printf("cc_decoder: ccbuf_add_char: row buffer overflow\n");
- return;
- }
-
- if (pos > rowbuf->num_chars) {
- /* fill up to indented position with transparent spaces, if necessary */
- ccrow_fill_transp(rowbuf);
- }
-
- /* midrow PAC attributes are applied only if there is no displayable */
- /* character to the immediate left. This makes the implementation rather */
- /* complicated, but this is what the EIA-608 standard specifies. :-( */
- if (rowbuf->pac_attr_chg && !rowbuf->attr_chg && !left_displayable) {
- rowbuf->attr_chg = 1;
- rowbuf->cells[pos].attributes = rowbuf->pac_attr;
-#ifdef LOG_DEBUG
- printf("cc_decoder: ccbuf_add_char: Applying midrow PAC.\n");
-#endif
- }
-
- rowbuf->cells[pos].c = c;
- rowbuf->cells[pos].midrow_attr = rowbuf->attr_chg;
- rowbuf->pos++;
-
- if (rowbuf->num_chars < rowbuf->pos)
- rowbuf->num_chars = rowbuf->pos;
-
- rowbuf->attr_chg = 0;
- rowbuf->pac_attr_chg = 0;
-}
-
-
-static void ccbuf_set_cursor(cc_buffer_t *this, int row, int column,
- int underline, int italics, int color)
-{
- cc_row_t *rowbuf = &this->rows[row];
- cc_attribute_t attr;
-
- attr.italic = italics;
- attr.underline = underline;
- attr.foreground = color;
- attr.background = BLACK;
-
- rowbuf->pac_attr = attr;
- rowbuf->pac_attr_chg = 1;
-
- this->rowpos = row;
- rowbuf->pos = column;
- rowbuf->attr_chg = 0;
-}
-
-
-static void ccbuf_apply_attribute(cc_buffer_t *this, cc_attribute_t *attr)
-{
- cc_row_t *rowbuf = &this->rows[this->rowpos];
- int pos = rowbuf->pos;
-
- rowbuf->attr_chg = 1;
- rowbuf->cells[pos].attributes = *attr;
- /* A midrow attribute always counts as a space */
- ccbuf_add_char(this, chartbl[(unsigned int) ' ']);
-}
-
-
-static void ccbuf_tab(cc_buffer_t *this, int tabsize)
-{
- cc_row_t *rowbuf = &this->rows[this->rowpos];
- rowbuf->pos += tabsize;
- if (rowbuf->pos > CC_COLUMNS) {
-#ifdef LOG_DEBUG
- printf("cc_decoder: ccbuf_tab: row buffer overflow\n");
-#endif
- rowbuf->pos = CC_COLUMNS;
- return;
- }
- /* tabs have no effect on pending PAC attribute changes */
-}
-
-
-static void ccbuf_render(cc_renderer_t *renderer, cc_buffer_t *this)
-{
- int row;
-
-#ifdef LOG_DEBUG
- printf("cc_decoder: ccbuf_render\n");
-#endif
-
- for (row = 0; row < CC_ROWS; ++row) {
- if (this->rows[row].num_chars > 0)
- ccrow_render(renderer, &this->rows[row], row);
- }
-}
-
-
-/*----------------- cc_memory_t methods --------------------------------*/
-
-static void ccmem_clear(cc_memory_t *this)
-{
-#ifdef LOG_DEBUG
- printf("cc_decoder.c: ccmem_clear: Clearing CC memory\n");
-#endif
- memset(this, 0, sizeof (cc_memory_t));
-}
-
-
-static void ccmem_init(cc_memory_t *this)
-{
- ccmem_clear(this);
-}
-
-
-static void ccmem_exit(cc_memory_t *this)
-{
-/*FIXME: anything to deallocate?*/
-}
-
-
-/*----------------- cc_renderer_t methods -------------------------------*/
-
-static void cc_renderer_build_palette(cc_renderer_t *this)
-{
- int i, j;
- const colorinfo_t *cc_text = cc_text_palettes[this->cc_state->cc_cfg->cc_scheme];
- const uint8_t *cc_alpha = cc_alpha_palettes[this->cc_state->cc_cfg->cc_scheme];
-
- memset(this->cc_palette, 0, sizeof (this->cc_palette));
- memset(this->cc_trans, 0, sizeof (this->cc_trans));
- for (i = 0; i < NUM_FG_COL; i++) {
- /* background color */
- this->cc_palette[i * TEXT_PALETTE_SIZE + 1 + OSD_TEXT1] =
- *(uint32_t *) &cc_text[i].bgcol;
- /* background -> border */
- for (j = 2; j <= 5; j++) {
- clut_t col = interpolate_color(cc_text[i].bgcol,
- cc_text[i].bordercol, 4, j - 1);
- this->cc_palette[i * TEXT_PALETTE_SIZE + j + OSD_TEXT1] =
- *(uint32_t *) &col;
- }
- /* border color */
- this->cc_palette[i * TEXT_PALETTE_SIZE + 6 + OSD_TEXT1] =
- *(uint32_t *) &cc_text[i].bordercol;
- /* border -> foreground */
- for (j = 7; j <= 9; j++) {
- clut_t col = interpolate_color(cc_text[i].bordercol,
- cc_text[i].textcol, 3, j - 6);
- this->cc_palette[i * TEXT_PALETTE_SIZE + j + OSD_TEXT1] =
- *(uint32_t *) &col;
- }
- /* foreground color */
- this->cc_palette[i * TEXT_PALETTE_SIZE + 10 + OSD_TEXT1] =
- *(uint32_t *) &cc_text[i].textcol;
-
- /* alpha values */
- for (j = 0; j <= 10; j++)
- this->cc_trans[i * TEXT_PALETTE_SIZE + j + OSD_TEXT1] = cc_alpha[j];
- }
-}
-
-
-static int64_t cc_renderer_calc_vpts(cc_renderer_t *this, int64_t pts,
- uint32_t ntsc_frame_offset)
-{
- metronom_t *metronom = this->metronom;
- int64_t vpts = metronom->got_spu_packet(metronom, pts);
- return vpts + ntsc_frame_offset * NTSC_FRAME_DURATION;
-}
-
-
-/* returns true if a caption is on display */
-static int cc_renderer_on_display(cc_renderer_t *this)
-{
- return this->displayed;
-}
-
-
-static void cc_renderer_hide_caption(cc_renderer_t *this, int64_t vpts)
-{
- if (this->displayed) {
- this->osd_renderer->hide(this->cap_display, vpts);
- this->displayed = 0;
- this->last_hide_vpts = vpts;
- }
-}
-
-
-static void cc_renderer_show_caption(cc_renderer_t *this, cc_buffer_t *buf,
- int64_t vpts)
-{
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: show\n");
-#endif
-
- if (this->displayed) {
- cc_renderer_hide_caption(this, vpts);
- printf("spucc: cc_renderer: show: OOPS - caption was already displayed!\n");
- }
-
- this->osd_renderer->clear(this->cap_display);
- ccbuf_render(this, buf);
- this->osd_renderer->set_position(this->cap_display,
- this->x,
- this->y);
- vpts = MAX(vpts, this->last_hide_vpts);
- this->osd_renderer->show(this->cap_display, vpts);
-
- this->displayed = 1;
- this->display_vpts = vpts;
-}
-
-
-static void cc_renderer_free_osd_object(cc_renderer_t *this)
-{
- /* hide and free old displayed caption object if necessary */
- if (this->cap_display) {
- cc_renderer_hide_caption(this, this->display_vpts);
- this->osd_renderer->free_object(this->cap_display);
- this->cap_display = NULL;
- }
-}
-
-
-static void cc_renderer_adjust_osd_object(cc_renderer_t *this)
-{
- cc_renderer_free_osd_object(this);
-
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: adjust_osd_object: creating %dx%d OSD object\n",
- this->width, this->height);
-#endif
-
- /* create display object */
- this->cap_display = this->osd_renderer->new_object(this->osd_renderer,
- this->width,
- this->height);
- this->osd_renderer->set_palette(this->cap_display, this->cc_palette,
- this->cc_trans);
- this->osd_renderer->set_encoding(this->cap_display, "iso-8859-1");
-}
-
-
-cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer,
- metronom_t *metronom, cc_state_t *cc_state,
- int video_width, int video_height)
-{
- cc_renderer_t *this = calloc(1, sizeof (cc_renderer_t));
-
- this->osd_renderer = osd_renderer;
- this->metronom = metronom;
- this->cc_state = cc_state;
- cc_renderer_update_cfg(this, video_width, video_height);
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: open\n");
-#endif
- return this;
-}
-
-
-void cc_renderer_close(cc_renderer_t *this_obj)
-{
- cc_renderer_free_osd_object(this_obj);
- free(this_obj);
-
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: close\n");
-#endif
-}
-
-
-void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width,
- int video_height)
-{
- int fontw, fonth;
- int required_w, required_h;
-
- this_obj->video_width = video_width;
- this_obj->video_height = video_height;
-
- /* fill in text palette */
- cc_renderer_build_palette(this_obj);
-
- /* calculate preferred captioning area, as per the EIA-608 standard */
- this_obj->x = this_obj->video_width * 10 / 100;
- this_obj->y = this_obj->video_height * 10 / 100;
- this_obj->width = this_obj->video_width * 80 / 100;
- this_obj->height = this_obj->video_height * 80 / 100;
-
- /* find maximum text width and height for normal & italic captioning */
- /* font */
- get_font_metrics(this_obj->osd_renderer, this_obj->cc_state->cc_cfg->font,
- this_obj->cc_state->cc_cfg->font_size, &fontw, &fonth);
- this_obj->max_char_width = fontw;
- this_obj->max_char_height = fonth;
- get_font_metrics(this_obj->osd_renderer, this_obj->cc_state->cc_cfg->italic_font,
- this_obj->cc_state->cc_cfg->font_size, &fontw, &fonth);
- this_obj->max_char_width = MAX(fontw, this_obj->max_char_width);
- this_obj->max_char_height = MAX(fonth, this_obj->max_char_height);
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: update config: max text extents: %d, %d\n",
- this_obj->max_char_width, this_obj->max_char_height);
-#endif
-
- /* need to adjust captioning area to accommodate font? */
- required_w = CC_COLUMNS * (this_obj->max_char_width + 1);
- required_h = CC_ROWS * (this_obj->max_char_height + 1);
- if (required_w > this_obj->width) {
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: update config: adjusting cap area width: %d\n",
- required_w);
-#endif
- this_obj->width = required_w;
- this_obj->x = (this_obj->video_width - required_w) / 2;
- }
- if (required_h > this_obj->height) {
-#ifdef LOG_DEBUG
- printf("spucc: cc_renderer: update config: adjusting cap area height: %d\n",
- required_h);
-#endif
- this_obj->height = required_h;
- this_obj->y = (this_obj->video_height - required_h) / 2;
- }
-
- if (required_w <= this_obj->video_width &&
- required_h <= this_obj->video_height) {
- this_obj->cc_state->can_cc = 1;
- cc_renderer_adjust_osd_object(this_obj);
- }
- else {
- this_obj->cc_state->can_cc = 0;
- cc_renderer_free_osd_object(this_obj);
- printf("spucc: required captioning area %dx%d exceeds screen %dx%d!\n"
- " Captions disabled. Perhaps you should choose a smaller"
- " font?\n",
- required_w, required_h, this_obj->video_width,
- this_obj->video_height);
- }
-}
-
-
-/*----------------- cc_decoder_t methods --------------------------------*/
-
-static void cc_set_channel(cc_decoder_t *this, int channel)
-{
- (*this->active)->channel_no = channel;
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_set_channel: selecting channel %d\n", channel);
-#endif
-}
-
-
-static cc_buffer_t *active_ccbuffer(cc_decoder_t *this)
-{
- cc_memory_t *mem = *this->active;
- return &mem->channel[mem->channel_no];
-}
-
-
-static int cc_onscreen_displayable(cc_decoder_t *this)
-{
- return ccbuf_has_displayable(&this->on_buf->channel[this->on_buf->channel_no]);
-}
-
-
-static void cc_hide_displayed(cc_decoder_t *this)
-{
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_hide_displayed\n");
-#endif
-
- if (cc_renderer_on_display(this->cc_state->renderer)) {
- int64_t vpts = cc_renderer_calc_vpts(this->cc_state->renderer, this->pts,
- this->f_offset);
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_hide_displayed: hiding caption %u at vpts %u\n", this->capid, vpts);
-#endif
- cc_renderer_hide_caption(this->cc_state->renderer, vpts);
- }
-}
-
-
-static void cc_show_displayed(cc_decoder_t *this)
-{
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_show_displayed\n");
-#endif
-
- if (cc_onscreen_displayable(this)) {
- int64_t vpts = cc_renderer_calc_vpts(this->cc_state->renderer, this->pts,
- this->f_offset);
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_show_displayed: showing caption %u at vpts %u\n", this->capid, vpts);
-#endif
- this->capid++;
- cc_renderer_show_caption(this->cc_state->renderer,
- &this->on_buf->channel[this->on_buf->channel_no],
- vpts);
- }
-}
-
-
-static void cc_swap_buffers(cc_decoder_t *this)
-{
- cc_memory_t *temp;
-
- /* hide caption in displayed memory */
- cc_hide_displayed(this);
-
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_swap_buffers: swapping caption memory\n");
-#endif
- temp = this->on_buf;
- this->on_buf = this->off_buf;
- this->off_buf = temp;
-
- /* show new displayed memory */
- cc_show_displayed(this);
-}
-
-static void cc_decode_standard_char(cc_decoder_t *this, uint8_t c1, uint8_t c2)
-{
- cc_buffer_t *buf = active_ccbuffer(this);
- /* c1 always is a valid character */
- ccbuf_add_char(buf, chartbl[c1]);
- /* c2 might not be a printable character, even if c1 was */
- if (c2 & 0x60)
- ccbuf_add_char(buf, chartbl[c2]);
-}
-
-
-static void cc_decode_PAC(cc_decoder_t *this, int channel,
- uint8_t c1, uint8_t c2)
-{
- cc_buffer_t *buf;
- int row, column = 0;
- int underline, italics = 0, color;
-
- /* There is one invalid PAC code combination. Ignore it. */
- if (c1 == 0x10 && c2 > 0x5f)
- return;
-
- cc_set_channel(this, channel);
- buf = active_ccbuffer(this);
-
- row = rowdata[((c1 & 0x07) << 1) | ((c2 & 0x20) >> 5)];
- if (c2 & 0x10) {
- column = ((c2 & 0x0e) >> 1) * 4; /* preamble indentation */
- color = WHITE; /* indented lines have white color */
- }
- else if ((c2 & 0x0e) == 0x0e) {
- italics = 1; /* italics, they are always white */
- color = WHITE;
- }
- else
- color = (c2 & 0x0e) >> 1;
- underline = c2 & 0x01;
-
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_decode_PAC: row %d, col %d, ul %d, it %d, clr %d\n",
- row, column, underline, italics, color);
-#endif
-
- ccbuf_set_cursor(buf, row, column, underline, italics, color);
-}
-
-
-static void cc_decode_ext_attribute(cc_decoder_t *this, int channel,
- uint8_t c1, uint8_t c2)
-{
- cc_set_channel(this, channel);
-}
-
-
-static void cc_decode_special_char(cc_decoder_t *this, int channel,
- uint8_t c1, uint8_t c2)
-{
- cc_buffer_t *buf;
-
- cc_set_channel(this, channel);
- buf = active_ccbuffer(this);
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_decode_special_char: Mapping %x to %x\n", c2, specialchar[c2 & 0xf]);
-#endif
- ccbuf_add_char(buf, specialchar[c2 & 0xf]);
-}
-
-
-static void cc_decode_midrow_attr(cc_decoder_t *this, int channel,
- uint8_t c1, uint8_t c2)
-{
- cc_buffer_t *buf;
- cc_attribute_t attr;
-
- cc_set_channel(this, channel);
- buf = active_ccbuffer(this);
- if (c2 < 0x2e) {
- attr.italic = 0;
- attr.foreground = (c2 & 0xe) >> 1;
- }
- else {
- attr.italic = 1;
- attr.foreground = WHITE;
- }
- attr.underline = c2 & 0x1;
- attr.background = BLACK;
-#ifdef LOG_DEBUG
- printf("cc_decoder: cc_decode_midrow_attr: attribute %x\n", c2);
- printf("cc_decoder: cc_decode_midrow_attr: ul %d, it %d, clr %d\n",
- attr.underline, attr.italic, attr.foreground);
-#endif
-
- ccbuf_apply_attribute(buf, &attr);
-}
-
-
-static void cc_decode_misc_control_code(cc_decoder_t *this, int channel,
- uint8_t c1, uint8_t c2)
-{
-#ifdef LOG_DEBUG
- printf("cc_decoder: decode_misc: decoding %x %x\n", c1, c2);
-#endif
-
- cc_set_channel(this, channel);
-
- switch (c2) { /* 0x20 <= c2 <= 0x2f */
-
- case 0x20: /* RCL */
- break;
-
- case 0x21: /* backspace */
-#ifdef LOG_DEBUG
- printf("cc_decoder: backspace\n");
-#endif
- break;
-
- case 0x24: /* DER */
- break;
-
- case 0x25: /* RU2 */
- break;
-
- case 0x26: /* RU3 */
- break;
-
- case 0x27: /* RU4 */
- break;
-
- case 0x28: /* FON */
- break;
-
- case 0x29: /* RDC */
- break;
-
- case 0x2a: /* TR */
- break;
-
- case 0x2b: /* RTD */
- break;
-
- case 0x2c: /* EDM - erase displayed memory */
- cc_hide_displayed(this);
- ccmem_clear(this->on_buf);
- break;
-
- case 0x2d: /* carriage return */
- break;
-
- case 0x2e: /* ENM - erase non-displayed memory */
- ccmem_clear(this->off_buf);
- break;
-
- case 0x2f: /* EOC - swap displayed and non displayed memory */
- cc_swap_buffers(this);
- break;
- }
-}
-
-
-static void cc_decode_tab(cc_decoder_t *this, int channel,
- uint8_t c1, uint8_t c2)
-{
- cc_buffer_t *buf;
-
- cc_set_channel(this, channel);
- buf = active_ccbuffer(this);
- ccbuf_tab(buf, c2 & 0x3);
-}
-
-
-static void cc_decode_EIA608(cc_decoder_t *this, uint16_t data)
-{
- uint8_t c1 = data & 0x7f;
- uint8_t c2 = (data >> 8) & 0x7f;
-
-#if LOG_DEBUG >= 3
- printf("decoding %x %x\n", c1, c2);
-#endif
-
- if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */
- cc_decode_standard_char(this, c1, c2);
- }
- else if (c1 & 0x10) { /* control code or special character */
- /* 0x10 <= c1 <= 0x1f */
- int channel = (c1 & 0x08) >> 3;
- c1 &= ~0x08;
-
- /* control sequences are often repeated. In this case, we should */
- /* evaluate it only once. */
- if (data != this->lastcode) {
-
- if (c2 & 0x40) { /* preamble address code: 0x40 <= c2 <= 0x7f */
- cc_decode_PAC(this, channel, c1, c2);
- }
- else {
- switch (c1) {
-
- case 0x10: /* extended background attribute code */
- cc_decode_ext_attribute(this, channel, c1, c2);
- break;
-
- case 0x11: /* attribute or special character */
- if ((c2 & 0x30) == 0x30) { /* special char: 0x30 <= c2 <= 0x3f */
- cc_decode_special_char(this, channel, c1, c2);
- }
- else if (c2 & 0x20) { /* midrow attribute: 0x20 <= c2 <= 0x2f */
- cc_decode_midrow_attr(this, channel, c1, c2);
- }
- break;
-
- case 0x14: /* possibly miscellaneous control code */
- cc_decode_misc_control_code(this, channel, c1, c2);
- break;
-
- case 0x17: /* possibly misc. control code TAB offset */
- /* 0x21 <= c2 <= 0x23 */
- if (c2 >= 0x21 && c2 <= 0x23) {
- cc_decode_tab(this, channel, c1, c2);
- }
- break;
- }
- }
- }
- }
-
- this->lastcode = data;
-}
-
-
-void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len,
- int64_t pts)
-{
- /* The first number may denote a channel number. I don't have the
- * EIA-708 standard, so it is hard to say.
- * From what I could figure out so far, the general format seems to be:
- *
- * repeat
- *
- * 0xfe starts 2 byte sequence of unknown purpose. It might denote
- * field #2 in line 21 of the VBI. We'll ignore it for the
- * time being.
- *
- * 0xff starts 2 byte EIA-608 sequence, field #1 in line 21 of the VBI.
- * Followed by a 3-code triplet that starts either with 0xff or
- * 0xfe. In either case, the following triplet needs to be ignored
- * for line 21, field 1.
- *
- * 0x00 is padding, followed by 2 more 0x00.
- *
- * 0x01 always seems to appear at the beginning, always seems to
- * be followed by 0xf8, 8-bit number.
- * The lower 7 bits of this 8-bit number seem to denote the
- * number of code triplets that follow.
- * The most significant bit denotes whether the Line 21 field 1
- * captioning information is at odd or even triplet offsets from this
- * beginning triplet. 1 denotes odd offsets, 0 denotes even offsets.
- *
- * Most captions are encoded with odd offsets, so this is what we
- * will assume.
- *
- * until end of packet
- */
- uint8_t *current = buffer;
- uint32_t curbytes = 0;
- uint8_t data1, data2;
- uint8_t cc_code;
- int odd_offset = 1;
-
- this->f_offset = 0;
- this->pts = pts;
-
-#if LOG_DEBUG >= 2
- printf("libspucc: decode_cc: got pts %u\n", pts);
- {
- uint8_t *cur_d = buffer;
- printf("libspucc: decode_cc: codes: ");
- while (cur_d < buffer + buf_len) {
- printf("0x%0x ", *cur_d++);
- }
- printf("\n");
- }
-#endif
-
- while (curbytes < buf_len) {
- int skip = 2;
-
- cc_code = *current++;
- curbytes++;
-
- if (buf_len - curbytes < 2) {
-#ifdef LOG_DEBUG
- fprintf(stderr, "Not enough data for 2-byte CC encoding\n");
-#endif
- break;
- }
-
- data1 = *current;
- data2 = *(current + 1);
-
- switch (cc_code) {
- case 0xfe:
- /* expect 2 byte encoding (perhaps CC3, CC4?) */
- /* ignore for time being */
- skip = 2;
- break;
-
- case 0xff:
- /* expect EIA-608 CC1/CC2 encoding */
- if (good_parity(data1 | (data2 << 8))) {
- cc_decode_EIA608(this, data1 | (data2 << 8));
- this->f_offset++;
- }
- skip = 5;
- break;
-
- case 0x00:
- /* This seems to be just padding */
- skip = 2;
- break;
-
- case 0x01:
- odd_offset = data2 & 0x80;
- if (odd_offset)
- skip = 2;
- else
- skip = 5;
- break;
-
- default:
-#ifdef LOG_DEBUG
- fprintf(stderr, "Unknown CC encoding: %x\n", cc_code);
-#endif
- skip = 2;
- break;
- }
- current += skip;
- curbytes += skip;
- }
-}
-
-
-
-cc_decoder_t *cc_decoder_open(cc_state_t *cc_state)
-{
- cc_decoder_t *this = calloc(1, sizeof (cc_decoder_t));
- /* configfile stuff */
- this->cc_state = cc_state;
-
- ccmem_init(&this->buffer[0]);
- ccmem_init(&this->buffer[1]);
- this->on_buf = &this->buffer[0];
- this->off_buf = &this->buffer[1];
- this->active = &this->off_buf;
-
- this->lastcode = 0;
- this->capid = 0;
-
- this->pts = this->f_offset = 0;
-
-#ifdef LOG_DEBUG
- printf("spucc: cc_decoder_open\n");
-#endif
- return this;
-}
-
-
-void cc_decoder_close(cc_decoder_t *this)
-{
- ccmem_exit(&this->buffer[0]);
- ccmem_exit(&this->buffer[1]);
-
- free(this);
-
-#ifdef LOG_DEBUG
- printf("spucc: cc_decoder_close\n");
-#endif
-}
-
-
-/*--------------- initialization methods --------------------------*/
-
-void cc_decoder_init(void)
-{
- build_parity_table();
- build_char_table();
-}
-
diff --git a/src/libspucc/cc_decoder.h b/src/libspucc/cc_decoder.h
deleted file mode 100644
index 6ee6d860b..000000000
--- a/src/libspucc/cc_decoder.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2000-2008 the xine project
- *
- * Copyright (C) Christian Vogler
- * cvogler@gradient.cis.upenn.edu - December 2001
- *
- * 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, USA
- *
- * stuff needed to provide closed captioning decoding and display
- *
- * Some small bits and pieces of the EIA-608 captioning decoder were
- * adapted from CCDecoder 0.9.1 by Mike Baker. The latest version is
- * available at http://sourceforge.net/projects/ccdecoder/.
- */
-
-typedef struct cc_decoder_s cc_decoder_t;
-typedef struct cc_renderer_s cc_renderer_t;
-
-#define NUM_CC_PALETTES 2
-extern const char *cc_schemes[];
-
-#define CC_FONT_MAX 256
-
-typedef struct cc_config_s {
- int cc_enabled; /* true if closed captions are enabled */
- char font[CC_FONT_MAX]; /* standard captioning font & size */
- int font_size;
- char italic_font[CC_FONT_MAX]; /* italic captioning font & size */
- int center; /* true if captions should be centered */
- /* according to text width */
- int cc_scheme; /* which captioning scheme to use */
-
- int config_version; /* the decoder should be updated when this is increased */
-} cc_config_t;
-
-typedef struct spucc_class_s {
- spu_decoder_class_t spu_class;
- cc_config_t cc_cfg;
-} spucc_class_t;
-
-typedef struct cc_state_s {
- cc_config_t *cc_cfg;
- /* the following variables are not controlled by configuration files; they */
- /* are intrinsic to the properties of the configuration options and the */
- /* currently played video */
- int can_cc; /* true if captions can be displayed */
- /* (e.g., font fits on screen) */
- cc_renderer_t *renderer; /* closed captioning renderer */
-} cc_state_t;
-
-cc_decoder_t *cc_decoder_open(cc_state_t *cc_state);
-void cc_decoder_close(cc_decoder_t *this_obj);
-void cc_decoder_init(void);
-
-void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len,
- int64_t pts);
-
-/* Instantiates a new closed captioning renderer. */
-cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer,
- metronom_t *metronom, cc_state_t *cc_state,
- int video_width, int video_height);
-
-/* Destroys a closed captioning renderer. */
-void cc_renderer_close(cc_renderer_t *this_obj);
-
-/* Updates the renderer configuration variables */
-void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width,
- int video_height);
-
diff --git a/src/libspucc/xine_cc_decoder.c b/src/libspucc/xine_cc_decoder.c
deleted file mode 100644
index 47c1d1f2f..000000000
--- a/src/libspucc/xine_cc_decoder.c
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- * Copyright (C) 2000-2008 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, USA
- *
- * closed caption spu decoder. receive data by events.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "buffer.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "cc_decoder.h"
-
-/*
-#define LOG_DEBUG 1
-*/
-
-const char *cc_schemes[NUM_CC_PALETTES + 1] = {
- "White/Gray/Translucent",
- "White/Black/Solid",
- NULL
-};
-
-typedef struct spucc_decoder_s {
- spu_decoder_t spu_decoder;
-
- xine_stream_t *stream;
-
- /* closed captioning decoder state */
- cc_decoder_t *ccdec;
- /* true if ccdec has been initialized */
- int cc_open;
-
- /* closed captioning decoder configuration and intrinsics */
- cc_state_t cc_state;
- /* this is to detect configuration changes */
- int config_version;
-
- /* video dimensions captured in frame change events */
- int video_width;
- int video_height;
-
- /* events will be sent here */
- xine_event_queue_t *queue;
-
-} spucc_decoder_t;
-
-
-/*------------------- general utility functions ----------------------------*/
-
-static void copy_str(char *d, const char *s, size_t maxbytes)
-{
- strncpy(d, s, maxbytes - 1);
- d[maxbytes - 1] = '\0';
-}
-
-
-/*------------------- private methods --------------------------------------*/
-
-static void spucc_update_intrinsics(spucc_decoder_t *this)
-{
-#ifdef LOG_DEBUG
- printf("spucc: update_intrinsics\n");
-#endif
-
- if (this->cc_open)
- cc_renderer_update_cfg(this->cc_state.renderer, this->video_width,
- this->video_height);
-}
-
-static void spucc_do_close(spucc_decoder_t *this)
-{
- if (this->cc_open) {
-#ifdef LOG_DEBUG
- printf("spucc: close\n");
-#endif
- cc_decoder_close(this->ccdec);
- cc_renderer_close(this->cc_state.renderer);
- this->cc_open = 0;
- }
-}
-
-static void spucc_do_init (spucc_decoder_t *this)
-{
- if (! this->cc_open) {
-#ifdef LOG_DEBUG
- printf("spucc: init\n");
-#endif
- /* initialize caption renderer */
- this->cc_state.renderer = cc_renderer_open(this->stream->osd_renderer,
- this->stream->metronom,
- &this->cc_state,
- this->video_width,
- this->video_height);
- spucc_update_intrinsics(this);
- /* initialize CC decoder */
- this->ccdec = cc_decoder_open(&this->cc_state);
- this->cc_open = 1;
- }
-}
-
-
-/*----------------- configuration listeners --------------------------------*/
-
-static void spucc_cfg_enable_change(void *this_gen, xine_cfg_entry_t *value)
-{
- spucc_class_t *this = (spucc_class_t *) this_gen;
- cc_config_t *cc_cfg = &this->cc_cfg;
-
- cc_cfg->cc_enabled = value->num_value;
-#ifdef LOG_DEBUG
- printf("spucc: closed captions are now %s.\n", cc_cfg->cc_enabled?
- "enabled" : "disabled");
-#endif
- cc_cfg->config_version++;
-}
-
-
-static void spucc_cfg_scheme_change(void *this_gen, xine_cfg_entry_t *value)
-{
- spucc_class_t *this = (spucc_class_t *) this_gen;
- cc_config_t *cc_cfg = &this->cc_cfg;
-
- cc_cfg->cc_scheme = value->num_value;
-#ifdef LOG_DEBUG
- printf("spucc: closed captioning scheme is now %s.\n",
- cc_schemes[cc_cfg->cc_scheme]);
-#endif
- cc_cfg->config_version++;
-}
-
-
-static void spucc_font_change(void *this_gen, xine_cfg_entry_t *value)
-{
- spucc_class_t *this = (spucc_class_t *) this_gen;
- cc_config_t *cc_cfg = &this->cc_cfg;
- char *font;
-
- if (strcmp(value->key, "subtitles.closedcaption.font") == 0)
- font = cc_cfg->font;
- else
- font = cc_cfg->italic_font;
-
- copy_str(font, value->str_value, CC_FONT_MAX);
-#ifdef LOG_DEBUG
- printf("spucc: changing %s to font %s\n", value->key, font);
-#endif
- cc_cfg->config_version++;
-}
-
-
-static void spucc_num_change(void *this_gen, xine_cfg_entry_t *value)
-{
- spucc_class_t *this = (spucc_class_t *) this_gen;
- cc_config_t *cc_cfg = &this->cc_cfg;
- int *num;
-
- if (strcmp(value->key, "subtitles.closedcaption.font_size") == 0)
- num = &cc_cfg->font_size;
- else
- num = &cc_cfg->center;
-
- *num = value->num_value;
-#ifdef LOG_DEBUG
- printf("spucc: changing %s to %d\n", value->key, *num);
-#endif
- cc_cfg->config_version++;
-}
-
-
-static void spucc_register_cfg_vars(spucc_class_t *this,
- config_values_t *xine_cfg) {
- cc_config_t *cc_vars = &this->cc_cfg;
-
- cc_vars->cc_enabled = xine_cfg->register_bool(xine_cfg,
- "subtitles.closedcaption.enabled", 0,
- _("display closed captions in MPEG-2 streams"),
- _("Closed Captions are subtitles mostly meant "
- "to help the hearing impaired."),
- 0, spucc_cfg_enable_change, this);
-
- cc_vars->cc_scheme = xine_cfg->register_enum(xine_cfg,
- "subtitles.closedcaption.scheme", 0,
- (char **)cc_schemes,
- _("closed-captioning foreground/background scheme"),
- _("Choose your favourite rendering of the closed "
- "captions."),
- 10, spucc_cfg_scheme_change, this);
-
- copy_str(cc_vars->font,
- xine_cfg->register_string(xine_cfg, "subtitles.closedcaption.font", "cc",
- _("standard closed captioning font"),
- _("Choose the font for standard closed captions text."),
- 20, spucc_font_change, this),
- CC_FONT_MAX);
-
- copy_str(cc_vars->italic_font,
- xine_cfg->register_string(xine_cfg, "subtitles.closedcaption.italic_font", "cci",
- _("italic closed captioning font"),
- _("Choose the font for italic closed captions text."),
- 20, spucc_font_change, this),
- CC_FONT_MAX);
-
- cc_vars->font_size = xine_cfg->register_num(xine_cfg, "subtitles.closedcaption.font_size",
- 24,
- _("closed captioning font size"),
- _("Choose the font size for closed captions text."),
- 10, spucc_num_change, this);
-
- cc_vars->center = xine_cfg->register_bool(xine_cfg, "subtitles.closedcaption.center", 1,
- _("center-adjust closed captions"),
- _("When enabled, closed captions will be positioned "
- "by the center of the individual lines."),
- 20, spucc_num_change, this);
-}
-
-
-/* called when the video frame size changes */
-static void spucc_notify_frame_change(spucc_decoder_t *this,
- int width, int height) {
-#ifdef LOG_DEBUG
- printf("spucc: new frame size: %dx%d\n", width, height);
-#endif
-
- this->video_width = width;
- this->video_height = height;
- spucc_update_intrinsics(this);
-}
-
-
-/*------------------- implementation of spudec interface -------------------*/
-
-static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
- spucc_decoder_t *this = (spucc_decoder_t *) this_gen;
- xine_event_t *event;
-
- while ((event = xine_event_get(this->queue))) {
- switch (event->type) {
- case XINE_EVENT_FRAME_FORMAT_CHANGE:
- {
- xine_format_change_data_t *frame_change =
- (xine_format_change_data_t *)event->data;
-
- spucc_notify_frame_change(this, frame_change->width,
- frame_change->height);
- }
- break;
- }
- xine_event_free(event);
- }
-
- if (buf->decoder_flags & BUF_FLAG_PREVIEW) {
- } else {
-
- if (this->cc_state.cc_cfg->config_version > this->config_version) {
- spucc_update_intrinsics(this);
- if (!this->cc_state.cc_cfg->cc_enabled)
- spucc_do_close(this);
- this->config_version = this->cc_state.cc_cfg->config_version;
- }
-
- if (this->cc_state.cc_cfg->cc_enabled) {
- if( !this->cc_open )
- spucc_do_init (this);
- if(this->cc_state.can_cc) {
- decode_cc(this->ccdec, buf->content, buf->size,
- buf->pts);
- }
- }
- }
-}
-
-static void spudec_reset (spu_decoder_t *this_gen) {
-}
-
-static void spudec_discontinuity (spu_decoder_t *this_gen) {
-}
-
-static void spudec_dispose (spu_decoder_t *this_gen) {
- spucc_decoder_t *this = (spucc_decoder_t *) this_gen;
-
- spucc_do_close(this);
- xine_event_dispose_queue(this->queue);
- free (this);
-}
-
-
-static spu_decoder_t *spudec_open_plugin (spu_decoder_class_t *class, xine_stream_t *stream) {
-
- spucc_decoder_t *this ;
-
- this = (spucc_decoder_t *) calloc(1, sizeof(spucc_decoder_t));
-
- this->spu_decoder.decode_data = spudec_decode_data;
- this->spu_decoder.reset = spudec_reset;
- this->spu_decoder.discontinuity = spudec_discontinuity;
- this->spu_decoder.dispose = spudec_dispose;
- this->spu_decoder.get_interact_info = NULL;
- this->spu_decoder.set_button = NULL;
-
- this->stream = stream;
- this->queue = xine_event_new_queue(stream);
- this->cc_state.cc_cfg = &((spucc_class_t *)class)->cc_cfg;
- this->config_version = 0;
- this->cc_open = 0;
-
- cc_decoder_init();
-
- return &this->spu_decoder;
-}
-
-static char *spudec_get_identifier(spu_decoder_class_t *class) {
- return "spucc";
-}
-
-static char *spudec_get_description(spu_decoder_class_t *class) {
- return "closed caption decoder plugin";
-}
-
-static void spudec_class_dispose(spu_decoder_class_t *class) {
- free(class);
-}
-
-
-static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
-
- spucc_class_t *this ;
-
- this = (spucc_class_t *) calloc(1, sizeof(spucc_class_t));
-
- this->spu_class.open_plugin = spudec_open_plugin;
- this->spu_class.get_identifier = spudec_get_identifier;
- this->spu_class.get_description = spudec_get_description;
- this->spu_class.dispose = spudec_class_dispose;
-
- spucc_register_cfg_vars(this, xine->config);
- this->cc_cfg.config_version = 0;
-
- return &this->spu_class;
-}
-
-/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_CC, 0 };
-
-static const decoder_info_t spudec_info = {
- supported_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 16, "spucc", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libspucmml/Makefile.am b/src/libspucmml/Makefile.am
deleted file mode 100644
index 53a980b57..000000000
--- a/src/libspucmml/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-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/libspucmml/xine_cmml_decoder.c b/src/libspucmml/xine_cmml_decoder.c
deleted file mode 100644
index 87edcfbfe..000000000
--- a/src/libspucmml/xine_cmml_decoder.c
+++ /dev/null
@@ -1,537 +0,0 @@
-/*
- * Copyright (C) 2000-2008 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, USA
- */
-
-#define LOG_MODULE "libspucmml"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-#define LOG_OSD 0
-#define LOG_SCHEDULING 0
-#define LOG_WIDTH 0
-
-#define SUB_BUFSIZE 1024
-#define SUB_MAX_TEXT 5
-
-#include "xine_internal.h"
-
-typedef enum {
- SUBTITLE_SIZE_SMALL = 0,
- SUBTITLE_SIZE_NORMAL,
- SUBTITLE_SIZE_LARGE,
-
- SUBTITLE_SIZE_NUM /* number of values in enum */
-} subtitle_size;
-
-
-typedef struct spucmml_class_s {
- spu_decoder_class_t class;
- char *src_encoding; /* encoding of subtitle file */
- xine_t *xine;
-
-} spucmml_class_t;
-
-
-typedef struct cmml_anchor_s {
- char *text;
- char *href;
-} cmml_anchor_t;
-
-
-typedef struct spucmml_decoder_s {
- spu_decoder_t spu_decoder;
-
- spucmml_class_t *class;
- xine_stream_t *stream;
-
- xine_event_queue_t *event_queue;
-
- int lines;
- char text[SUB_MAX_TEXT][SUB_BUFSIZE];
-
- int cached_width; /* frame width */
- int cached_height; /* frame height */
- int64_t cached_img_duration;
- int font_size;
- int line_height;
- int master_started;
- int slave_started;
-
- char *font; /* subtitle font */
- subtitle_size subtitle_size; /* size of subtitles */
- int vertical_offset;
-
- osd_object_t *osd;
-
- cmml_anchor_t current_anchor;
-} spucmml_decoder_t;
-
-
-static void video_frame_format_change_callback (void *user_data, const xine_event_t *event);
-
-
-static void update_font_size (spucmml_decoder_t *this) {
- static const int sizes[SUBTITLE_SIZE_NUM][4] = {
- { 16, 16, 16, 20 }, /* SUBTITLE_SIZE_SMALL */
- { 16, 16, 20, 24 }, /* SUBTITLE_SIZE_NORMAL */
- { 16, 20, 24, 32 }, /* SUBTITLE_SIZE_LARGE */
- };
-
- const int *const vec = sizes[this->subtitle_size];
-
- if( this->cached_width >= 512 )
- this->font_size = vec[3];
- else if( this->cached_width >= 384 )
- this->font_size = vec[2];
- else if( this->cached_width >= 320 )
- this->font_size = vec[1];
- else
- this->font_size = vec[0];
-
- this->line_height = this->font_size + 10;
-
- int y = this->cached_height - (SUB_MAX_TEXT * this->line_height) - 5;
-
- if(((y - this->vertical_offset) >= 0) && ((y - this->vertical_offset) <= this->cached_height))
- y -= this->vertical_offset;
-
- /* TODO: we should move this stuff below into another function */
-
- if (this->osd)
- this->stream->osd_renderer->free_object (this->osd);
-
- llprintf (LOG_OSD,
- "pre new_object: osd=%p, osd_renderer=%p, width=%d, height=%d\n",
- this->osd,
- this->stream->osd_renderer,
- this->cached_width,
- SUB_MAX_TEXT * this->line_height);
-
- this->osd = this->stream->osd_renderer->new_object (this->stream->osd_renderer,
- this->cached_width, SUB_MAX_TEXT * this->line_height);
-
- llprintf (LOG_OSD, "post new_object: osd is %p\n", this->osd);
-
- if(this->stream->osd_renderer) {
- this->stream->osd_renderer->set_font (this->osd, this->font, this->font_size);
- this->stream->osd_renderer->set_position (this->osd, 0, y);
- }
-}
-
-static int get_width(spucmml_decoder_t *this, char* text) {
- int width=0;
-
- while (1)
- switch (*text) {
- case '\0':
- llprintf(LOG_WIDTH, "get_width returning width of %d\n", width);
- return width;
-
- case '<':
- if (!strncmp("<b>", text, 3)) {
- /*Do somethink to enable BOLD typeface*/
- text += 3;
- break;
- } else if (!strncmp("</b>", text, 3)) {
- /*Do somethink to disable BOLD typeface*/
- text += 4;
- break;
- } else if (!strncmp("<i>", text, 3)) {
- /*Do somethink to enable italics typeface*/
- text += 3;
- break;
- } else if (!strncmp("</i>", text, 3)) {
- /*Do somethink to disable italics typeface*/
- text += 4;
- break;
- } else if (!strncmp("<font>", text, 3)) {
- /*Do somethink to disable typing
- fixme - no teststreams*/
- text += 6;
- break;
- } else if (!strncmp("</font>", text, 3)) {
- /*Do somethink to enable typing
- fixme - no teststreams*/
- text += 7;
- break;
- }
- default:
- {
- int w, dummy;
- const char letter[2] = { *text, '\0' };
- this->stream->osd_renderer->get_text_size(this->osd, letter, &w, &dummy);
- width += w;
- text++;
- }
- }
-}
-
-static void render_line(spucmml_decoder_t *this, int x, int y, char* text) {
- while (*text != '\0') {
- int w, dummy;
- const char letter[2] = { *text, '\0' };
-
- this->stream->osd_renderer->render_text(this->osd, x, y, letter, OSD_TEXT1);
- this->stream->osd_renderer->get_text_size(this->osd, letter, &w, &dummy);
- x += w;
- text++;
- }
-}
-
-static void draw_subtitle(spucmml_decoder_t *this, int64_t sub_start) {
-
- this->stream->osd_renderer->filled_rect (this->osd, 0, 0,
- this->cached_width-1, this->line_height * SUB_MAX_TEXT - 1, 0);
-
- const int y = (SUB_MAX_TEXT - this->lines) * this->line_height;
- int font_size = this->font_size;
- this->stream->osd_renderer->set_encoding(this->osd, this->class->src_encoding);
-
- int line;
-
- for (line=0; line<this->lines; line++) {
- int x;
- while(1) {
- const int w = get_width( this, this->text[line]);
- x = (this->cached_width - w) / 2;
-
- if( w > this->cached_width && font_size > 16 ) {
- font_size -= 4;
- this->stream->osd_renderer->set_font (this->osd, this->font, font_size);
- } else {
- break;
- }
- }
- render_line(this, x, y + line*this->line_height, this->text[line]);
- }
-
- if( font_size != this->font_size )
- this->stream->osd_renderer->set_font (this->osd, this->font, this->font_size);
-
-
- this->stream->osd_renderer->set_text_palette (this->osd, -1, OSD_TEXT1);
- this->stream->osd_renderer->show (this->osd, sub_start);
-
- llprintf (LOG_SCHEDULING,
- "spucmml: scheduling subtitle >%s< at %"PRId64", current time is %"PRId64"\n",
- this->text[0], sub_start,
- this->stream->xine->clock->get_current_time (this->stream->xine->clock));
-}
-
-static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
-
- spucmml_decoder_t *this = (spucmml_decoder_t *) this_gen;
-
- xml_parser_t *xml_parser;
- xml_node_t *packet_xml_root;
- char * anchor_text = NULL;
-
- lprintf("CMML packet seen\n");
-
- char *str = (char *) buf->content;
-
- /* parse the CMML */
-
- xml_parser = xml_parser_init_r (str, strlen (str), XML_PARSER_CASE_INSENSITIVE);
- if (xml_parser_build_tree_r(xml_parser, &packet_xml_root) != XML_PARSER_OK) {
- lprintf ("warning: invalid XML packet detected in CMML track\n");
- xml_parser_finalize_r(xml_parser);
- return;
- }
-
- xml_parser_finalize_r(xml_parser);
-
- if (strcasecmp(packet_xml_root->name, "head") == 0) {
- /* found a <head>...</head> packet: need to parse the title */
-
- xml_node_t *title_node;
-
- /* iterate through children trying to find the title node */
-
- for (title_node = packet_xml_root->child; title_node != NULL; title_node = title_node->next) {
-
- if (title_node->data &&
- strcasecmp (title_node->name, "title") == 0) {
- /* found a title node */
-
- xine_ui_data_t data = {
- .str_len = strlen(title_node->data) + 1
- };
- xine_event_t uevent = {
- .type = XINE_EVENT_UI_SET_TITLE,
- .stream = this->stream,
- .data = &data,
- .data_length = sizeof(data),
- };
- strncpy(data.str, title_node->data, sizeof(data.str)-1);
-
- /* found a non-empty title */
- lprintf ("found title: \"%s\"\n", data.str);
-
- /* set xine meta-info */
- _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, strdup(data.str));
-
- /* and push out a new event signifying the title update on the event
- * queue */
- xine_event_send(this->stream, &uevent);
- }
- }
- } else if (strcasecmp(packet_xml_root->name, "clip") == 0) {
- /* found a <clip>...</clip> packet: search for the <a href="..."> in it */
- xml_node_t *clip_node;
-
- /* iterate through each tag contained in the <clip> tag to look for <a> */
-
- for (clip_node = packet_xml_root->child; clip_node != NULL; clip_node = clip_node->next) {
-
- if (strcasecmp (clip_node->name, "a") == 0) {
- xml_property_t *href_property;
-
- /* found the <a> tag: grab its value and its href property */
-
- if (clip_node->data)
- anchor_text = strdup (clip_node->data);
-
- for (href_property = clip_node->props; href_property != NULL; href_property = href_property->next) {
- if (strcasecmp (href_property->name, "href") == 0) {
- /* found the href property */
- char *href = href_property->value;
-
- if (href) {
- lprintf ("found href: \"%s\"\n", href);
- this->current_anchor.href = strdup(href);
- }
- }
- }
- }
- }
- }
-
- /* finish here if we don't have to process any anchor text */
- if (!anchor_text)
- return;
-
- /* how many lines does the anchor text take up? */
- this->lines=0;
- {
- int i = 0, index = 0;
- while (anchor_text[index]) {
- if (anchor_text[index] == '\r' || anchor_text[index] == '\n') {
- if (i) {
- /* match a newline and there are chars on the current line ... */
- this->text[ this->lines ][i] = '\0';
- this->lines++;
- i = 0;
- }
- } else {
- /* found a normal (non-line-ending) character */
- this->text[ this->lines ][i] = anchor_text[index];
- if (i<SUB_BUFSIZE-1)
- i++;
- }
- index++;
- }
-
- /* always NULL-terminate the string */
- if (i) {
- this->text[ this->lines ][i] = '\0';
- this->lines++;
- }
- }
- free (anchor_text);
-
- /* initialize decoder if needed */
- if( !this->cached_width || !this->cached_height || !this->cached_img_duration || !this->osd ) {
- if( this->stream->video_out->status(this->stream->video_out, NULL,
- &this->cached_width, &this->cached_height, &this->cached_img_duration )) {
- if( this->cached_width && this->cached_height && this->cached_img_duration ) {
- lprintf("this->stream->osd_renderer is %p\n", this->stream->osd_renderer);
- }
- }
- }
-
- update_font_size (this);
-
- if( this->osd ) {
- draw_subtitle(this, buf->pts);
- return;
- } else {
- lprintf ("libspucmml: no osd\n");
- }
-
- return;
-}
-
-static void video_frame_format_change_callback (void *user_data, const xine_event_t *event)
-{
- /* this doesn't do anything for now: it's a start at attempting to display
- * CMML clips which occur at 0 seconds into the track. see
- *
- * http://marc.theaimsgroup.com/?l=xine-devel&m=109202443013890&w=2
- *
- * for a description of the problem. */
-
- switch (event->type) {
- case XINE_EVENT_FRAME_FORMAT_CHANGE:
- lprintf("video_frame_format_change_callback called!\n");
- break;
- default:
- lprintf("video_frame_format_change_callback called with unknown event %d\n", event->type);
- break;
- }
-}
-
-static void spudec_reset (spu_decoder_t *this_gen) {
- spucmml_decoder_t *this = (spucmml_decoder_t *) this_gen;
-
- this->cached_width = this->cached_height = 0;
-}
-
-static void spudec_discontinuity (spu_decoder_t *this_gen) {
- /* do nothing */
-}
-
-static void spudec_dispose (spu_decoder_t *this_gen) {
- spucmml_decoder_t *this = (spucmml_decoder_t *) this_gen;
-
- if (this->event_queue)
- xine_event_dispose_queue (this->event_queue);
-
- if (this->osd) {
- this->stream->osd_renderer->free_object (this->osd);
- this->osd = NULL;
- }
- free(this);
-}
-
-static void update_vertical_offset(void *this_gen, xine_cfg_entry_t *entry)
-{
- spucmml_decoder_t *this = (spucmml_decoder_t *)this_gen;
-
- this->vertical_offset = entry->num_value;
- update_font_size(this);
-}
-
-static void update_osd_font(void *this_gen, xine_cfg_entry_t *entry)
-{
- spucmml_decoder_t *this = (spucmml_decoder_t *)this_gen;
-
- this->font = entry->str_value;
-
- if( this->stream->osd_renderer )
- this->stream->osd_renderer->set_font (this->osd, this->font, this->font_size);
-}
-
-static spu_decoder_t *spucmml_class_open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream) {
- spucmml_class_t *class = (spucmml_class_t *)class_gen;
- spucmml_decoder_t *this = (spucmml_decoder_t *) calloc(1, sizeof(spucmml_decoder_t));
-
- this->spu_decoder.decode_data = spudec_decode_data;
- this->spu_decoder.reset = spudec_reset;
- this->spu_decoder.discontinuity = spudec_discontinuity;
- this->spu_decoder.dispose = spudec_dispose;
- this->spu_decoder.get_interact_info = NULL;
- this->spu_decoder.set_button = NULL;
- this->spu_decoder.dispose = spudec_dispose;
-
- this->class = class;
- this->stream = stream;
-
- this->event_queue = xine_event_new_queue (this->stream);
- xine_event_create_listener_thread (this->event_queue,
- video_frame_format_change_callback,
- this);
-
- this->font_size = 24;
- this->subtitle_size = 1;
-
- this->font = class->xine->config->register_string(class->xine->config,
- "subtitles.separate.font",
- "sans",
- _("font for external subtitles"),
- NULL, 0, update_osd_font, this);
-
- this->vertical_offset = class->xine->config->register_num(class->xine->config,
- "subtitles.separate.vertical_offset",
- 0,
- _("subtitle vertical offset (relative window size)"),
- NULL, 0, update_vertical_offset, this);
-
- this->current_anchor.href = NULL;
-
- lprintf ("video_out is at %p\n", this->stream->video_out);
-
- return (spu_decoder_t *) this;
-}
-
-static void spucmml_class_dispose (spu_decoder_class_t *this) {
- free (this);
-}
-
-static char *spucmml_class_get_identifier (spu_decoder_class_t *this) {
- return "spucmml";
-}
-
-static char *spucmml_class_get_description (spu_decoder_class_t *this) {
- return "CMML subtitle decoder plugin";
-}
-
-static void update_src_encoding(void *this_gen, xine_cfg_entry_t *entry)
-{
- spucmml_class_t *this = (spucmml_class_t *)this_gen;
-
- this->src_encoding = entry->str_value;
- printf("libspucmml: spu_src_encoding = %s\n", this->src_encoding );
-}
-
-static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
- spucmml_class_t *this = (spucmml_class_t *) calloc(1, sizeof(spucmml_class_t));
-
- this->class.open_plugin = spucmml_class_open_plugin;
- this->class.get_identifier = spucmml_class_get_identifier;
- this->class.get_description = spucmml_class_get_description;
- this->class.dispose = spucmml_class_dispose;
-
- this->xine = xine;
-
- this->src_encoding = xine->config->register_string(xine->config,
- "subtitles.separate.src_encoding",
- "iso-8859-1",
- _("encoding of subtitles"),
- NULL, 10, update_src_encoding, this);
-
- return &this->class;
-}
-
-
-/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_CMML, 0 };
-
-static const decoder_info_t spudec_info = {
- supported_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 16, "spucmml", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/libspudec/Makefile.am b/src/libspudec/Makefile.am
deleted file mode 100644
index 061bd7731..000000000
--- a/src/libspudec/Makefile.am
+++ /dev/null
@@ -1,27 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-xineplug_LTLIBRARIES = xineplug_decode_spu.la
-
-if HAVE_DVDNAV
-
-xineplug_decode_spu_la_SOURCES = \
- spu.c \
- xine_spu_decoder.c
-xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(DVDNAV_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-
-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) $(LTLIBINTL)
-
-endif
-
-xineplug_decode_spu_la_CFLAGS = $(DVDNAV_CFLAGS) $(VISIBILITY_FLAG)
-xineplug_decode_spu_la_LDFLAGS = $(xineplug_ldflags)
-
-noinst_HEADERS = spu.h
diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c
deleted file mode 100644
index 80d1eeaf5..000000000
--- a/src/libspudec/spu.c
+++ /dev/null
@@ -1,1035 +0,0 @@
-/*
- * Copyright (C) 2002-2004 the xine project
- *
- * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
- *
- * spu.c - converts DVD subtitles to an XPM image
- *
- * Mostly based on hard work by:
- *
- * Copyright (C) 2000 Samuel Hocevar <sam@via.ecp.fr>
- * and Michel Lespinasse <walken@via.ecp.fr>
- *
- * Lots of rearranging by:
- * Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- * Thomas Mirlacher <dent@cosy.sbg.ac.at>
- * implemented reassembling
- * cleaner implementation of SPU are saving
- * overlaying (proof of concept for now)
- * ... and yes, it works now with oms
- * added tranparency (provided by the SPU hdr)
- * changed structures for easy porting to MGAs DVD mode
- * This file is part of xine
- * This file was originally part of the OMS program.
- *
- * 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, 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; see the file COPYING. If not, write to
- * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <unistd.h>
-#include <string.h>
-#include <inttypes.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "spu.h"
-#include "buffer.h"
-#include "xine-engine/bswap.h"
-#ifdef HAVE_DVDNAV
-# ifdef HAVE_DVDNAV_NAVTYPES_H
-# include <dvdnav/nav_read.h>
-# include <dvdnav/nav_print.h>
-# else
-# include <dvdread/nav_read.h>
-# include <dvdread/nav_print.h>
-# endif
-#else
-# include "nav_read.h"
-# include "nav_print.h"
-#endif
-
-
-/*
-#define LOG_DEBUG 1
-#define LOG_BUTTON 1
-#define LOG_NAV 1
-*/
-
-static void spudec_do_commands (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl);
-static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl);
-static void spudec_discover_clut (xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl);
-#ifdef LOG_DEBUG
-static void spudec_print_overlay( vo_overlay_t *overlay );
-#endif
-
-void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) {
- uint8_t *p;
- uint32_t packet_len;
- uint32_t stream_id;
- uint32_t header_len;
- pci_t pci;
- dsi_t dsi;
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
-
- p = buf->content;
- if (p[0] || p[1] || (p[2] != 1)) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libspudec:spudec_decode_nav:nav demux error! %02x %02x %02x (should be 0x000001) \n",p[0],p[1],p[2]);
- return;
- }
-
- packet_len = p[4] << 8 | p[5];
- stream_id = p[3];
-
- header_len = 6;
- p += header_len;
-
- if (stream_id == 0xbf) { /* Private stream 2 */
-/* int i;
- * for(i=0;i<80;i++) {
- * printf("%02x ",p[i]);
- * }
- * printf("\n p[0]=0x%02x\n",p[0]);
- */
- if(p[0] == 0x00) {
-#ifdef LOG_NAV
- printf("libspudec:nav_PCI\n");
-#endif
- navRead_PCI(&pci, p+1);
-#ifdef LOG_NAV
- printf("libspudec:nav:hli_ss=%u, hli_s_ptm=%u, hli_e_ptm=%u, btn_sl_e_ptm=%u pts=%lli\n",
- pci.hli.hl_gi.hli_ss,
- pci.hli.hl_gi.hli_s_ptm,
- pci.hli.hl_gi.hli_e_ptm,
- pci.hli.hl_gi.btn_se_e_ptm,
- buf->pts);
- printf("libspudec:nav:btn_sn/ofn=%u, btn_ns=%u, fosl_btnn=%u, foac_btnn=%u\n",
- pci.hli.hl_gi.btn_ofn, pci.hli.hl_gi.btn_ns,
- pci.hli.hl_gi.fosl_btnn, pci.hli.hl_gi.foac_btnn);
- printf("btngr_ns %d\n", pci.hli.hl_gi.btngr_ns);
- printf("btngr%d_dsp_ty 0x%02x\n", 1, pci.hli.hl_gi.btngr1_dsp_ty);
- printf("btngr%d_dsp_ty 0x%02x\n", 2, pci.hli.hl_gi.btngr2_dsp_ty);
- printf("btngr%d_dsp_ty 0x%02x\n", 3, pci.hli.hl_gi.btngr3_dsp_ty);
- //navPrint_PCI(&pci);
- //navPrint_PCI_GI(&pci.pci_gi);
- //navPrint_NSML_AGLI(&pci.nsml_agli);
- //navPrint_HLI(&pci.hli);
- //navPrint_HL_GI(&pci.hli.hl_gi, & btngr_ns, & btn_ns);
-#endif
- }
-
- p += packet_len;
-
- /* We should now have a DSI packet. */
- /* We don't need anything from the DSI packet here. */
- if(p[6] == 0x01) {
- packet_len = p[4] << 8 | p[5];
- p += 6;
-#ifdef LOG_NAV
- printf("NAV DSI packet\n");
-#endif
- navRead_DSI(&dsi, p+1);
-
-// self->vobu_start = self->dsi.dsi_gi.nv_pck_lbn;
-// self->vobu_length = self->dsi.dsi_gi.vobu_ea;
- }
- }
-
- /* NAV packets contain start and end presentation timestamps, which tell the
- * application, when the highlight information in the NAV is supposed to be valid.
- * We handle these timestamps only in a very stripped-down way: We keep a list
- * of NAV packets (or better: the PCI part of them), tagged with a VPTS timestamp
- * telling, when the NAV should be processed. However, we only enqueue a new node
- * into this list, when we receive new highlight information during an already
- * showing menu. This happens very rarerly on common DVDs, so it is of low impact.
- * And we only check for processing of queued entries at some prominent
- * locations in this SPU decoder. Since presentation timestamps rarely solve a real
- * purpose on most DVDs, this is ok compared to the full-blown solution, which would
- * require a separate thread managing the queue all the time. */
- pthread_mutex_lock(&this->nav_pci_lock);
- switch (pci.hli.hl_gi.hli_ss) {
- case 0:
- /* No Highlight information for this VOBU */
- if ( this->pci_cur.pci.hli.hl_gi.hli_ss == 1) {
- /* Hide menu spu between menus */
-#ifdef LOG_BUTTON
- printf("libspudec:nav:SHOULD HIDE SPU here\n");
-#endif
- if( this->menu_handle < 0 ) {
- this->menu_handle = ovl_manager->get_handle(ovl_manager,1);
- }
- if( this->menu_handle >= 0 ) {
- this->event.object.handle = this->menu_handle;
- this->event.event_type = OVERLAY_EVENT_HIDE;
- /* hide menu right now */
- this->event.vpts = 0;
- ovl_manager->add_event(ovl_manager, (void *)&this->event);
- } else {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: No video_overlay handles left for menu\n");
- }
- }
- spudec_clear_nav_list(this);
- xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t));
- /* incoming SPUs will be plain subtitles */
- this->event.object.object_type = 0;
- if (this->button_filter) {
- /* we possibly had buttons before, so we update the UI info */
- xine_event_t event;
- xine_ui_data_t data;
-
- event.type = XINE_EVENT_UI_NUM_BUTTONS;
- event.data = &data;
- event.data_length = sizeof(data);
- data.num_buttons = 0;
-
- xine_event_send(this->stream, &event);
- }
- this->button_filter=0;
-
- break;
- case 1:
- /* All New Highlight information for this VOBU */
- if (this->pci_cur.pci.hli.hl_gi.hli_ss != 0 &&
- pci.hli.hl_gi.hli_s_ptm > this->pci_cur.pci.hli.hl_gi.hli_s_ptm) {
- pci_node_t *node = &this->pci_cur;
-#ifdef LOG_DEBUG
- printf("libspudec: allocating new PCI node for hli_s_ptm %d\n", pci.hli.hl_gi.hli_s_ptm);
-#endif
- /* append PCI at the end of the list */
- while (node->next) node = node->next;
- node->next = malloc(sizeof(pci_node_t));
- node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm);
- node->next->next = NULL;
- xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t));
- } else {
- spudec_clear_nav_list(this);
- /* menu ahead, remember PCI for later use */
- xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t));
- spudec_process_nav(this);
- }
- break;
- case 2:
- /* Use Highlight information from previous VOBU */
- if (this->pci_cur.next) {
- /* apply changes to last enqueued NAV */
- pci_node_t *node = this->pci_cur.next;
- while (node->next) node = node->next;
- node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
- node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
- node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
- spudec_update_nav(this);
- } else {
- this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
- this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
- this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
- }
- break;
- case 3:
- /* Use Highlight information from previous VOBU except commands, which come from this VOBU */
- if (this->pci_cur.next) {
- /* apply changes to last enqueued NAV */
- pci_node_t *node = this->pci_cur.next;
- while (node->next) node = node->next;
- node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
- node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
- node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
- /* FIXME: Add command copying here */
- spudec_update_nav(this);
- } else {
- this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
- this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
- this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
- /* FIXME: Add command copying here */
- }
- break;
- default:
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libspudec: unknown pci.hli.hl_gi.hli_ss = %d\n", pci.hli.hl_gi.hli_ss );
- break;
- }
- pthread_mutex_unlock(&this->nav_pci_lock);
- return;
-}
-
-void spudec_clear_nav_list(spudec_decoder_t *this)
-{
- while (this->pci_cur.next) {
- pci_node_t *node = this->pci_cur.next->next;
- free(this->pci_cur.next);
- this->pci_cur.next = node;
- }
- /* invalidate current timestamp */
- this->pci_cur.pci.hli.hl_gi.hli_s_ptm = (uint32_t)-1;
-}
-
-void spudec_update_nav(spudec_decoder_t *this)
-{
- metronom_clock_t *clock = this->stream->xine->clock;
-
- if (this->pci_cur.next && this->pci_cur.next->vpts <= clock->get_current_time(clock)) {
- pci_node_t *node = this->pci_cur.next;
- xine_fast_memcpy(&this->pci_cur, this->pci_cur.next, sizeof(pci_node_t));
- spudec_process_nav(this);
- free(node);
- }
-}
-
-void spudec_process_nav(spudec_decoder_t *this)
-{
- /* incoming SPUs will be menus */
- this->event.object.object_type = 1;
- if (!this->button_filter) {
- /* we possibly entered a menu, so we update the UI button info */
- xine_event_t event;
- xine_ui_data_t data;
-
- event.type = XINE_EVENT_UI_NUM_BUTTONS;
- event.data = &data;
- event.data_length = sizeof(data);
- data.num_buttons = this->pci_cur.pci.hli.hl_gi.btn_ns;
-
- xine_event_send(this->stream, &event);
- }
- this->button_filter=1;
-}
-
-void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len)
-{
-#ifdef LOG_DEBUG
- printf ("libspudec: seq->complete = %d\n", seq->complete);
- printf("libspudec:1: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n",
- seq->ra_offs,
- seq->seq_len,
- seq->buf_len,
- seq->buf);
-#endif
- if (seq->complete) {
- seq->seq_len = (((uint32_t)pkt_data[0])<<8) | pkt_data[1];
- seq->cmd_offs = (((uint32_t)pkt_data[2])<<8) | pkt_data[3];
- if (seq->cmd_offs >= seq->seq_len) {
- xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n");
- seq->broken = 1;
- }
- if (seq->buf_len < seq->seq_len) {
- seq->buf_len = seq->seq_len;
-#ifdef LOG_DEBUG
- printf ("spu: MALLOC1: seq->buf %p, len=%d\n", seq->buf,seq->buf_len);
-#endif
- if (seq->buf) {
- free(seq->buf);
- seq->buf = NULL;
- }
- seq->buf = malloc(seq->buf_len);
-#ifdef LOG_DEBUG
- printf ("spu: MALLOC2: seq->buf %p, len=%d\n", seq->buf,seq->buf_len);
-#endif
-
- }
- seq->ra_offs = 0;
-
-#ifdef LOG_DEBUG
- printf ("spu: buf_len: %d\n", seq->buf_len);
- printf ("spu: cmd_off: %d\n", seq->cmd_offs);
-#endif
- }
-
-#ifdef LOG_DEBUG
- printf("libspudec:2: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n",
- seq->ra_offs,
- seq->seq_len,
- seq->buf_len,
- seq->buf);
-#endif
- if (seq->ra_offs < seq->seq_len) {
- if (seq->ra_offs + pkt_len > seq->seq_len)
- pkt_len = seq->seq_len - seq->ra_offs;
- memcpy (seq->buf + seq->ra_offs, pkt_data, pkt_len);
- seq->ra_offs += pkt_len;
- } else {
- xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n");
- seq->broken = 1;
- }
-
- if (seq->ra_offs == seq->seq_len) {
- seq->finished = 0;
- seq->complete = 1;
- return; /* sequence ready */
- }
- seq->complete = 0;
- return;
-}
-
-void spudec_process (spudec_decoder_t *this, int stream_id) {
- spudec_seq_t *cur_seq;
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
- int pending = 1;
- cur_seq = &this->spudec_stream_state[stream_id].ra_seq;
-
-#ifdef LOG_DEBUG
- printf ("spu: Found SPU from stream %d pts=%lli vpts=%lli\n",stream_id,
- this->spudec_stream_state[stream_id].pts,
- this->spudec_stream_state[stream_id].vpts);
-#endif
- this->state.cmd_ptr = cur_seq->buf + cur_seq->cmd_offs;
- this->state.modified = 1; /* Only draw picture if = 1 on first event of SPU */
- this->state.visible = OVERLAY_EVENT_SHOW;
- this->state.forced_display = 0; /* 0 - No value, 1 - Forced Display. */
- this->state.delay = 0;
- cur_seq->finished=0;
-
- do {
- if (!(cur_seq->finished) ) {
- pci_node_t *node;
-
- /* spu_channel is now set based on whether we are in the menu or not. */
- /* Bit 7 is set if only forced display SPUs should be shown */
- if ( (this->stream->spu_channel & 0x1f) != stream_id ) {
-#ifdef LOG_DEBUG
- printf ("spu: Dropping SPU channel %d. Not selected stream_id\n", stream_id);
-#endif
- return;
- }
- /* parse SPU command sequence, this will update forced_display, so it must come
- * before the check for it */
- spudec_do_commands(this->stream->xine, &this->state, cur_seq, &this->overlay);
- /* FIXME: Check for Forced-display or subtitle stream
- * For subtitles, open event.
- * For menus, store it for later.
- */
- if (cur_seq->broken) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: dropping broken SPU\n");
- cur_seq->broken = 0;
- return;
- }
- if ( (this->state.forced_display == 0) && (this->stream->spu_channel & 0x80) ) {
-#ifdef LOG_DEBUG
- printf ("spu: Dropping SPU channel %d. Only allow forced display SPUs\n", stream_id);
-#endif
- return;
- }
-
-#ifdef LOG_DEBUG
- spudec_print_overlay( &this->overlay );
- printf ("spu: forced display:%s\n", this->state.forced_display ? "Yes" : "No" );
-#endif
- pthread_mutex_lock(&this->nav_pci_lock);
- /* search for a PCI that matches this SPU's PTS */
- for (node = &this->pci_cur; node; node = node->next)
- if (node->pci.hli.hl_gi.hli_s_ptm == this->spudec_stream_state[stream_id].pts)
- break;
- if (node) {
- if (this->state.visible == OVERLAY_EVENT_HIDE) {
- /* menus are hidden via nav packet decoding, not here */
- /* FIXME: James is not sure about this solution and may want to look this over.
- * I'm commiting it, because I haven't found a disc it breaks, but it fixes
- * some instead. Michael Roitzsch */
- pthread_mutex_unlock(&this->nav_pci_lock);
- continue;
- }
- if (node->pci.hli.hl_gi.fosl_btnn > 0) {
- xine_event_t event;
-
- this->buttonN = node->pci.hli.hl_gi.fosl_btnn;
- event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
- event.stream = this->stream;
- event.data = &this->buttonN;
- event.data_length = sizeof(this->buttonN);
- xine_event_send(this->stream, &event);
- }
-#ifdef LOG_BUTTON
- fprintf(stderr, "libspudec:Full Overlay\n");
-#endif
- if (!spudec_copy_nav_to_overlay(this->stream->xine,
- &node->pci, this->state.clut,
- this->buttonN, 0, &this->overlay, &this->overlay)) {
- /* current button does not exist -> use another one */
- xine_event_t event;
-
- if (this->buttonN > node->pci.hli.hl_gi.btn_ns)
- this->buttonN = node->pci.hli.hl_gi.btn_ns;
- else
- this->buttonN = 1;
- event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
- event.stream = this->stream;
- event.data = &this->buttonN;
- event.data_length = sizeof(this->buttonN);
- xine_event_send(this->stream, &event);
- spudec_copy_nav_to_overlay(this->stream->xine,
- &node->pci, this->state.clut,
- this->buttonN, 0, &this->overlay, &this->overlay);
- }
- } else {
- /* Subtitle and not a menu button */
- int i;
- for (i = 0;i < 4; i++) {
- this->overlay.hili_color[i] = this->overlay.color[i];
- this->overlay.hili_trans[i] = this->overlay.trans[i];
- }
- }
- pthread_mutex_unlock(&this->nav_pci_lock);
-
- if ((this->state.modified) ) {
- spudec_draw_picture(this->stream->xine, &this->state, cur_seq, &this->overlay);
- }
-
- if (this->state.need_clut) {
- spudec_discover_clut(this->stream->xine, &this->state, &this->overlay);
- }
-
- if (this->state.vobsub) {
- int width, height;
- int64_t duration;
-
- /*
- * vobsubs are usually played with a scaled-down stream (not full DVD
- * resolution), therefore we should try to realign it.
- */
-
- this->stream->video_out->status(this->stream->video_out, NULL,
- &width, &height, &duration );
-
- this->overlay.x = (width - this->overlay.width) / 2;
- this->overlay.y = height - this->overlay.height;
- }
-
- /* Subtitle */
- if( this->menu_handle < 0 ) {
- this->menu_handle = ovl_manager->get_handle(ovl_manager,1);
- }
-
- if( this->menu_handle < 0 ) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libspudec: No video_overlay handles left for menu\n");
- return;
- }
- this->event.object.handle = this->menu_handle;
- this->event.object.pts = this->spudec_stream_state[stream_id].pts;
-
- xine_fast_memcpy(this->event.object.overlay,
- &this->overlay,
- sizeof(vo_overlay_t));
- this->overlay.rle=NULL;
- /* For force display menus */
- //if ( !(this->state.visible) ) {
- // this->state.visible = OVERLAY_EVENT_SHOW;
- //}
-
- this->event.event_type = this->state.visible;
- /*
- printf("spu event %d handle: %d vpts: %lli\n", this->event.event_type,
- this->event.object.handle, this->event.vpts );
- */
-
- this->event.vpts = this->spudec_stream_state[stream_id].vpts+(this->state.delay*1000);
-
- /* Keep all the events in the correct order. */
- /* This corrects for errors during estimation around discontinuity */
- if( this->event.vpts < this->last_event_vpts ) {
- this->event.vpts = this->last_event_vpts + 1;
- }
- this->last_event_vpts = this->event.vpts;
-
-#ifdef LOG_BUTTON
- fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n",
- this->event.event_type,
- this->stream->xine->clock->get_current_time(this->stream->xine->clock),
- this->event.vpts);
-#endif
- ovl_manager->add_event(ovl_manager, (void *)&this->event);
- } else {
- pending = 0;
- }
- } while (pending);
-
-}
-
-#define CMD_SPU_FORCE_DISPLAY 0x00
-#define CMD_SPU_SHOW 0x01
-#define CMD_SPU_HIDE 0x02
-#define CMD_SPU_SET_PALETTE 0x03
-#define CMD_SPU_SET_ALPHA 0x04
-#define CMD_SPU_SET_SIZE 0x05
-#define CMD_SPU_SET_PXD_OFFSET 0x06
-#define CMD_SPU_WIPE 0x07 /* Not currently implemented */
-#define CMD_SPU_EOF 0xff
-
-static void spudec_do_commands(xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl)
-{
- uint8_t *buf = state->cmd_ptr;
- uint8_t *next_seq;
- int32_t param_length;
-
-#ifdef LOG_DEBUG
- printf ("spu: SPU DO COMMANDS\n");
-#endif
-
- state->delay = (buf[0] << 8) + buf[1];
-#ifdef LOG_DEBUG
- printf ("spu: \tdelay=%d\n",state->delay);
-#endif
- next_seq = seq->buf + (buf[2] << 8) + buf[3];
- buf += 4;
-#ifdef LOG_DEBUG
- printf ("spu: \tnext_seq=%d\n",next_seq - seq->buf);
-#endif
-
-/* if next equals current, this is the last one
- */
- if (state->cmd_ptr >= next_seq)
- next_seq = seq->buf + seq->seq_len; /* allow to run until end */
-
- state->cmd_ptr = next_seq;
-
- while (buf < next_seq && *buf != CMD_SPU_EOF) {
- switch (*buf) {
- case CMD_SPU_SHOW: /* show subpicture */
-#ifdef LOG_DEBUG
- printf ("spu: \tshow subpicture\n");
-#endif
- state->visible = OVERLAY_EVENT_SHOW;
- buf++;
- break;
-
- case CMD_SPU_HIDE: /* hide subpicture */
-#ifdef LOG_DEBUG
- printf ("spu: \thide subpicture\n");
-#endif
- state->visible = OVERLAY_EVENT_HIDE;
- buf++;
- break;
-
- case CMD_SPU_SET_PALETTE: { /* CLUT */
- spudec_clut_t *clut = (spudec_clut_t *) (buf+1);
-
- state->cur_colors[3] = clut->entry0;
- state->cur_colors[2] = clut->entry1;
- state->cur_colors[1] = clut->entry2;
- state->cur_colors[0] = clut->entry3;
-
-/* This is a bit out of context for now */
- ovl->color[3] = state->clut[clut->entry0];
- ovl->color[2] = state->clut[clut->entry1];
- ovl->color[1] = state->clut[clut->entry2];
- ovl->color[0] = state->clut[clut->entry3];
-
-#ifdef LOG_DEBUG
- printf ("spu: \tclut [%x %x %x %x]\n",
- ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]);
- printf ("spu: \tclut base [%x %x %x %x]\n",
- clut->entry0, clut->entry1, clut->entry2, clut->entry3);
-#endif
- state->modified = 1;
- buf += 3;
- break;
- }
- case CMD_SPU_SET_ALPHA: { /* transparency palette */
- spudec_clut_t *trans = (spudec_clut_t *) (buf+1);
-/* This should go into state for now */
-
- ovl->trans[3] = trans->entry0;
- ovl->trans[2] = trans->entry1;
- ovl->trans[1] = trans->entry2;
- ovl->trans[0] = trans->entry3;
-
-#ifdef LOG_DEBUG
- printf ("spu: \ttrans [%d %d %d %d]\n",
- ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]);
-#endif
- state->modified = 1;
- buf += 3;
- break;
- }
-
- case CMD_SPU_SET_SIZE: /* image coordinates */
-/* state->o_left = (buf[1] << 4) | (buf[2] >> 4);
- state->o_right = (((buf[2] & 0x0f) << 8) | buf[3]);
-
- state->o_top = (buf[4] << 4) | (buf[5] >> 4);
- state->o_bottom = (((buf[5] & 0x0f) << 8) | buf[6]);
- */
- ovl->x = (buf[1] << 4) | (buf[2] >> 4);
- ovl->y = (buf[4] << 4) | (buf[5] >> 4);
- ovl->width = (((buf[2] & 0x0f) << 8) | buf[3]) - ovl->x + 1;
- ovl->height = (((buf[5] & 0x0f) << 8) | buf[6]) - ovl->y + 1;
- ovl->hili_top = -1;
- ovl->hili_bottom = -1;
- ovl->hili_left = -1;
- ovl->hili_right = -1;
-
-#ifdef LOG_DEBUG
- printf ("spu: \tx = %d y = %d width = %d height = %d\n",
- ovl->x, ovl->y, ovl->width, ovl->height );
-#endif
- state->modified = 1;
- buf += 7;
- break;
-
- case CMD_SPU_SET_PXD_OFFSET: /* image top[0] field / image bottom[1] field*/
- state->field_offs[0] = (((u_int)buf[1]) << 8) | buf[2];
- state->field_offs[1] = (((u_int)buf[3]) << 8) | buf[4];
-
-#ifdef LOG_DEBUG
- printf ("spu: \toffset[0] = %d offset[1] = %d\n",
- state->field_offs[0], state->field_offs[1]);
-#endif
-
- if ((state->field_offs[0] >= seq->seq_len) ||
- (state->field_offs[1] >= seq->seq_len)) {
- xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n");
- seq->broken = 1;
- }
- state->modified = 1;
- buf += 5;
- break;
-
- case CMD_SPU_WIPE:
-#ifdef LOG_DEBUG
- printf ("libspudec: \tSPU_WIPE not implemented yet\n");
-#endif
- param_length = (buf[1] << 8) | (buf[2]);
- buf += 1 + param_length;
- break;
-
- case CMD_SPU_FORCE_DISPLAY:
-#ifdef LOG_DEBUG
- printf ("libspudec: \tForce Display/Menu\n");
-#endif
- state->forced_display = 1;
- buf++;
- break;
-
- default:
- xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec: unknown seqence command (%02x)\n", buf[0]);
- /* FIXME: SPU should be dropped, and buffers resynced */
- buf = next_seq;
- seq->broken = 1;
- break;
- }
- }
-
- if (next_seq >= seq->buf + seq->seq_len)
- seq->finished = 1; /* last sub-sequence */
-}
-
-/* FIXME: Get rid of all these static values */
-static uint8_t *bit_ptr[2];
-static int field; // which field we are currently decoding
-static int put_x, put_y;
-
-static u_int get_bits (u_int bits)
-{
- static u_int data;
- static u_int bits_left;
- u_int ret = 0;
-
- if (!bits) { /* for realignment to next byte */
- bits_left = 0;
- }
-
- while (bits) {
- if (bits > bits_left) {
- ret |= data << (bits - bits_left);
- bits -= bits_left;
-
- data = *bit_ptr[field]++;
- bits_left = 8;
- } else {
- bits_left -= bits;
- ret |= data >> (bits_left);
- data &= (1 << bits_left) - 1;
- bits = 0;
- }
- }
-
- return ret;
-}
-
-static int spudec_next_line (vo_overlay_t *spu)
-{
- get_bits (0); // byte align rle data
-
- put_x = 0;
- put_y++;
- field ^= 1; // Toggle fields
-
- if (put_y >= spu->height) {
-#ifdef LOG_DEBUG
- printf ("spu: put_y >= spu->height\n");
-#endif
- return -1;
- }
- return 0;
-}
-
-static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl)
-{
- rle_elem_t *rle;
- field = 0;
- bit_ptr[0] = seq->buf + state->field_offs[0];
- bit_ptr[1] = seq->buf + state->field_offs[1];
- put_x = put_y = 0;
- get_bits (0); /* Reset/init bit code */
-
-/* ovl->x = state->o_left;
- * ovl->y = state->o_top;
- * ovl->width = state->o_right - state->o_left + 1;
- * ovl->height = state->o_bottom - state->o_top + 1;
-
- * ovl->hili_top = 0;
- * ovl->hili_bottom = ovl->height - 1;
- * ovl->hili_left = 0;
- * ovl->hili_right = ovl->width - 1;
- */
-
- /* allocate for the worst case:
- * - both fields running to the very end
- * - 2 RLE elements per byte meaning single pixel RLE
- */
- ovl->data_size = ((seq->cmd_offs - state->field_offs[0]) +
- (seq->cmd_offs - state->field_offs[1])) * 2 * sizeof(rle_elem_t);
-
- if (ovl->rle) {
- xprintf (xine, XINE_VERBOSITY_DEBUG,
- "libspudec: spudec_draw_picture: ovl->rle is not empty!!!! It should be!!! "
- "You should never see this message.\n");
- free(ovl->rle);
- ovl->rle=NULL;
- }
- ovl->rle = malloc(ovl->data_size);
-
- state->modified = 0; /* mark as already processed */
- rle = ovl->rle;
-#ifdef LOG_DEBUG
- printf ("libspudec: Draw RLE=%p\n",rle);
-#endif
-
- while (bit_ptr[1] < seq->buf + seq->cmd_offs) {
- u_int len;
- u_int vlc;
-
- vlc = get_bits (4);
- if (vlc < 0x0004) {
- vlc = (vlc << 4) | get_bits (4);
- if (vlc < 0x0010) {
- vlc = (vlc << 4) | get_bits (4);
- if (vlc < 0x0040) {
- vlc = (vlc << 4) | get_bits (4);
- }
- }
- }
-
- len = vlc >> 2;
-
- /* if len == 0 -> end sequence - fill to end of line */
- if (len == 0)
- len = ovl->width - put_x;
-
- rle->len = len;
- rle->color = vlc & 0x03;
- rle++;
- put_x += len;
-
- if (put_x >= ovl->width) {
- if (spudec_next_line (ovl) < 0)
- break;
- }
- }
-
- ovl->num_rle = rle - ovl->rle;
- ovl->rgb_clut = 0;
- ovl->unscaled = 0;
-#ifdef LOG_DEBUG
- printf ("spu: Num RLE=%d\n",ovl->num_rle);
- printf ("spu: Date size=%d\n",ovl->data_size);
- printf ("spu: sizeof RLE=%d\n",sizeof(rle_elem_t));
-#endif
-}
-
-/* Heuristic to discover the colors used by the subtitles
- and assign a "readable" pallete to them.
- Currently looks for sequence of border-fg-border or
- border1-border2-fg-border2-border1.
- MINFOUND is the number of ocurrences threshold.
-*/
-#define MINFOUND 20
-static void spudec_discover_clut(xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl)
-{
- int bg,c;
- int seqcolor[10];
- int n,i;
- rle_elem_t *rle;
-
- int found[2][16];
-
- static clut_t text_clut[] = {
- CLUT_Y_CR_CB_INIT(0x80, 0x90, 0x80),
- CLUT_Y_CR_CB_INIT(0x00, 0x90, 0x00),
- CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00)
- };
-
- memset(found,0,sizeof(found));
- rle = ovl->rle;
-
- /* this seems to be a problem somewhere else,
- why rle is null? */
- if( !rle )
- return;
-
- /* suppose the first and last pixels are bg */
- if( rle[0].color != rle[ovl->num_rle-1].color )
- return;
-
- bg = rle[0].color;
-
- i = 0;
- for( n = 0; n < ovl->num_rle; n++ )
- {
- c = rle[n].color;
-
- if( c == bg )
- {
- if( i == 3 && seqcolor[1] == seqcolor[3] )
- {
- found[0][seqcolor[2]]++;
- if( found[0][seqcolor[2]] > MINFOUND )
- {
- memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[1],
- sizeof(clut_t));
- memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[2],
- sizeof(clut_t));
- ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]];
- ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]];
- state->need_clut = 0;
- break;
- }
- }
- if( i == 5 && seqcolor[1] == seqcolor[5]
- && seqcolor[2] == seqcolor[4] )
- {
- found[1][seqcolor[3]]++;
- if( found[1][seqcolor[3]] > MINFOUND )
- {
- memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[0],
- sizeof(clut_t));
- memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[1],
- sizeof(clut_t));
- memcpy(&state->clut[state->cur_colors[seqcolor[3]]], &text_clut[2],
- sizeof(clut_t));
- ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]];
- ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]];
- ovl->color[seqcolor[3]] = state->clut[state->cur_colors[seqcolor[3]]];
- state->need_clut = 0;
- break;
- }
- }
- i = 0;
- seqcolor[i] = c;
- }
- else if ( i < 6 )
- {
- i++;
- seqcolor[i] = c;
- }
- }
-}
-
-#ifdef LOG_DEBUG
-static void spudec_print_overlay( vo_overlay_t *ovl ) {
- printf ("spu: OVERLAY to show\n");
- printf ("spu: \tx = %d y = %d width = %d height = %d\n",
- ovl->x, ovl->y, ovl->width, ovl->height );
- printf ("spu: \tclut [%x %x %x %x]\n",
- ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]);
- printf ("spu: \ttrans [%d %d %d %d]\n",
- ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]);
- printf ("spu: \tclip top=%d bottom=%d left=%d right=%d\n",
- ovl->hili_top, ovl->hili_bottom, ovl->hili_left, ovl->hili_right);
- printf ("spu: \tclip_clut [%x %x %x %x]\n",
- ovl->hili_color[0], ovl->hili_color[1], ovl->hili_color[2], ovl->hili_color[3]);
- printf ("spu: \thili_trans [%d %d %d %d]\n",
- ovl->hili_trans[0], ovl->hili_trans[1], ovl->hili_trans[2], ovl->hili_trans[3]);
- return;
-}
-#endif
-
-int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut,
- int32_t button, int32_t mode, vo_overlay_t * overlay, vo_overlay_t * base ) {
- btni_t *button_ptr = NULL;
- unsigned int btns_per_group;
- int i;
-
- if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns))
- return 0;
-
- btns_per_group = 36 / nav_pci->hli.hl_gi.btngr_ns;
-
- /* choose button group: we can always use a normal 4:3 or widescreen button group
- * as long as xine blends the overlay before scaling the image to its aspect */
- if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 1 && !(nav_pci->hli.hl_gi.btngr1_dsp_ty & 6))
- button_ptr = &nav_pci->hli.btnit[0 * btns_per_group + button - 1];
- if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 2 && !(nav_pci->hli.hl_gi.btngr2_dsp_ty & 6))
- button_ptr = &nav_pci->hli.btnit[1 * btns_per_group + button - 1];
- if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 3 && !(nav_pci->hli.hl_gi.btngr3_dsp_ty & 6))
- button_ptr = &nav_pci->hli.btnit[2 * btns_per_group + button - 1];
- if (!button_ptr) {
- xprintf(xine, XINE_VERBOSITY_DEBUG,
- "libspudec: No suitable menu button group found, using group 1.\n");
- button_ptr = &nav_pci->hli.btnit[button - 1];
- }
-
- /* button areas in the nav packet are in screen coordinates,
- * overlay clipping areas are in overlay coordinates;
- * therefore we must subtract the display coordinates of the underlying overlay */
- overlay->hili_left = (button_ptr->x_start > base->x) ? (button_ptr->x_start - base->x) : 0;
- overlay->hili_top = (button_ptr->y_start > base->y) ? (button_ptr->y_start - base->y) : 0;
- overlay->hili_right = (button_ptr->x_end > base->x) ? (button_ptr->x_end - base->x) : 0;
- overlay->hili_bottom = (button_ptr->y_end > base->y) ? (button_ptr->y_end - base->y) : 0;
- if(button_ptr->btn_coln != 0) {
-#ifdef LOG_BUTTON
- fprintf(stderr, "libspudec: normal button clut\n");
-#endif
- for (i = 0;i < 4; i++) {
- overlay->hili_color[i] = clut[0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (16 + 4*i))];
- overlay->hili_trans[i] = 0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (4*i));
- }
- } else {
-#ifdef LOG_BUTTON
- fprintf(stderr, "libspudec: abnormal button clut\n");
-#endif
- for (i = 0;i < 4; i++) {
-#ifdef LOG_BUTTON
- printf("libspudec:btn_coln = 0, hili_color = color\n");
-#endif
- overlay->hili_color[i] = overlay->color[i];
- overlay->hili_trans[i] = overlay->trans[i];
- }
- }
-
- /* spudec_print_overlay( overlay ); */
-#ifdef LOG_BUTTON
- printf("libspudec:xine_decoder.c:NAV to SPU pts match!\n");
-#endif
-
- return 1;
-}
diff --git a/src/libspudec/spu.h b/src/libspudec/spu.h
deleted file mode 100644
index a1bc5b971..000000000
--- a/src/libspudec/spu.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (C) 2000-2004 the xine project
- *
- * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
- *
- * 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, USA
- *
- * This file was originally part of the OMS program.
- */
-
-#ifndef __SPU_H__
-#define __SPU_H__
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <inttypes.h>
-#include "video_out.h"
-#include "video_overlay.h"
-#ifdef HAVE_DVDNAV
-# ifdef HAVE_DVDNAV_NAVTYPES_H
-# include <dvdnav/nav_types.h>
-# else
-# include <dvdread/nav_types.h>
-# endif
-#else
-# include "nav_types.h"
-#endif
-
-#define NUM_SEQ_BUFFERS 50
-#define MAX_STREAMS 32
-
-typedef struct spudec_clut_struct {
-#ifdef WORDS_BIGENDIAN
- uint8_t entry0 : 4;
- uint8_t entry1 : 4;
- uint8_t entry2 : 4;
- uint8_t entry3 : 4;
-#else
- uint8_t entry1 : 4;
- uint8_t entry0 : 4;
- uint8_t entry3 : 4;
- uint8_t entry2 : 4;
-#endif
-} spudec_clut_t;
-
-typedef struct {
- uint8_t *buf;
- uint32_t ra_offs; /* reassembly offset */
- uint32_t seq_len;
- uint32_t buf_len;
- uint32_t cmd_offs;
- int64_t pts; /* Base PTS of this sequence */
- int32_t finished; /* Has this control sequence been finished? */
- uint32_t complete; /* Has this reassembly been finished? */
- uint32_t broken; /* this SPU is broken and should be dropped */
-} spudec_seq_t;
-
-typedef struct {
- uint8_t *cmd_ptr;
-
- uint32_t field_offs[2];
- int32_t b_top, o_top;
- int32_t b_bottom, o_bottom;
- int32_t b_left, o_left;
- int32_t b_right, o_right;
-
- int32_t modified; /* Was the sub-picture modified? */
- int32_t visible; /* Must the sub-picture be shown? */
- int32_t forced_display; /* This overlay is a menu */
- int32_t delay; /* Delay in 90Khz / 1000 */
- int32_t need_clut; /* doesn't have the right clut yet */
- int32_t cur_colors[4];/* current 4 colors been used */
- int32_t vobsub; /* vobsub must be aligned to bottom */
-
- uint32_t clut[16];
-} spudec_state_t;
-
-typedef struct spudec_stream_state_s {
- spudec_seq_t ra_seq;
- spudec_state_t state;
- int64_t vpts;
- int64_t pts;
- int32_t overlay_handle;
-} spudec_stream_state_t;
-
-typedef struct {
- spu_decoder_class_t decoder_class;
-} spudec_class_t;
-
-typedef struct pci_node_s pci_node_t;
-struct pci_node_s {
- pci_t pci;
- uint64_t vpts;
- pci_node_t *next;
-};
-
-typedef struct spudec_decoder_s {
- spu_decoder_t spu_decoder;
-
- spudec_class_t *class;
- xine_stream_t *stream;
- spudec_stream_state_t spudec_stream_state[MAX_STREAMS];
-
- video_overlay_event_t event;
- video_overlay_object_t object;
- int32_t menu_handle;
-
- spudec_state_t state;
-
- vo_overlay_t overlay;
- int ovl_caps;
- int output_open;
- pthread_mutex_t nav_pci_lock;
- pci_node_t pci_cur;
- uint32_t buttonN; /* Current button number for highlights */
- int32_t button_filter; /* Allow highlight changes or not */
- int64_t last_event_vpts;
-} spudec_decoder_t;
-
-void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len);
-void spudec_process( spudec_decoder_t *this, int stream_id);
-/* the nav functions must be called with the nav_pci_lock held */
-void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf);
-void spudec_clear_nav_list(spudec_decoder_t *this);
-void spudec_update_nav(spudec_decoder_t *this);
-void spudec_process_nav(spudec_decoder_t *this);
-int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode,
- vo_overlay_t * overlay, vo_overlay_t * base );
-
-#endif
diff --git a/src/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c
deleted file mode 100644
index 3d23bba21..000000000
--- a/src/libspudec/xine_spu_decoder.c
+++ /dev/null
@@ -1,407 +0,0 @@
-/*
- * Copyright (C) 2000-2008 the xine project
- *
- * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
- *
- * This file is part of xine, a unix 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, USA
- *
- * stuff needed to turn libspu into a xine decoder plugin
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-
-#include "xine_internal.h"
-#include "buffer.h"
-#include "xine-engine/bswap.h"
-#include "xineutils.h"
-#include "spu.h"
-#ifdef HAVE_DVDNAV
-# ifdef HAVE_DVDNAV_NAVTYPES_H
-# include <dvdnav/nav_types.h>
-# include <dvdnav/nav_read.h>
-# else
-# include <dvdread/nav_types.h>
-# include <dvdread/nav_read.h>
-# endif
-#else
-# include "nav_read.h"
-# include "nav_types.h"
-#endif
-
-/*
-#define LOG_DEBUG 1
-#define LOG_BUTTON 1
-*/
-
-static const clut_t default_clut[] = {
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef),
- CLUT_Y_CR_CB_INIT(0x51, 0xef, 0x5a),
- CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x36, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef),
- CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x51, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef),
- CLUT_Y_CR_CB_INIT(0x5c, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x1c, 0x80, 0x80),
- CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef)
-};
-
-static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
- spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
- const uint8_t stream_id = buf->type & 0x1f ;
-
-#ifdef LOG_DEBUG
- printf("libspudec:got buffer type = %x\n", buf->type);
-#endif
-
- /* check, if we need to process the next PCI from the list */
- pthread_mutex_lock(&this->nav_pci_lock);
- spudec_update_nav(this);
- pthread_mutex_unlock(&this->nav_pci_lock);
-
- if ( (buf->type & 0xffff0000) != BUF_SPU_DVD ||
- !(buf->decoder_flags & BUF_FLAG_SPECIAL) ||
- buf->decoder_info[1] != BUF_SPECIAL_SPU_DVD_SUBTYPE )
- return;
-
- if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_CLUT ) {
-#ifdef LOG_DEBUG
- printf("libspudec: SPU CLUT\n");
-#endif
- if (buf->content[0]) { /* cheap endianess detection */
- xine_fast_memcpy(this->state.clut, buf->content, sizeof(uint32_t)*16);
- } else {
- int i;
- uint32_t *clut = (uint32_t*) buf->content;
- for (i = 0; i < 16; i++)
- this->state.clut[i] = bswap_32(clut[i]);
- }
- this->state.need_clut = 0;
- return;
- }
-
- if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_NAV ) {
-#ifdef LOG_DEBUG
- printf("libspudec:got nav packet 1\n");
-#endif
- spudec_decode_nav(this,buf);
- return;
- }
-
- if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_VOBSUB_PACKAGE ) {
- this->state.vobsub = 1;
- }
-
-#ifdef LOG_DEBUG
- printf("libspudec:got buffer type = %x\n", buf->type);
-#endif
- if (buf->decoder_flags & BUF_FLAG_PREVIEW) /* skip preview data */
- return;
-
- if (buf->pts) {
- metronom_t *metronom = this->stream->metronom;
- int64_t vpts = metronom->got_spu_packet(metronom, buf->pts);
-
- this->spudec_stream_state[stream_id].vpts = vpts; /* Show timer */
- this->spudec_stream_state[stream_id].pts = buf->pts; /* Required to match up with NAV packets */
- }
-
- spudec_reassembly(this->stream->xine,
- &this->spudec_stream_state[stream_id].ra_seq, buf->content, buf->size);
- if(this->spudec_stream_state[stream_id].ra_seq.complete == 1) {
- if(this->spudec_stream_state[stream_id].ra_seq.broken) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: dropping broken SPU\n");
- this->spudec_stream_state[stream_id].ra_seq.broken = 0;
- } else
- spudec_process(this,stream_id);
- }
-}
-
-static void spudec_reset (spu_decoder_t *this_gen) {
- spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
- int i;
-
- if( this->menu_handle >= 0 )
- ovl_manager->free_handle(ovl_manager,
- this->menu_handle);
- this->menu_handle = -1;
-
- for (i=0; i < MAX_STREAMS; i++) {
- if( this->spudec_stream_state[i].overlay_handle >= 0 )
- ovl_manager->free_handle(ovl_manager,
- this->spudec_stream_state[i].overlay_handle);
- this->spudec_stream_state[i].overlay_handle = -1;
- this->spudec_stream_state[i].ra_seq.complete = 1;
- this->spudec_stream_state[i].ra_seq.broken = 0;
- }
-
- pthread_mutex_lock(&this->nav_pci_lock);
- spudec_clear_nav_list(this);
- pthread_mutex_unlock(&this->nav_pci_lock);
-}
-
-static void spudec_discontinuity (spu_decoder_t *this_gen) {
- spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
-
- pthread_mutex_lock(&this->nav_pci_lock);
- spudec_clear_nav_list(this);
- pthread_mutex_unlock(&this->nav_pci_lock);
-}
-
-
-static void spudec_dispose (spu_decoder_t *this_gen) {
-
- spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
-
- if( this->menu_handle >= 0 )
- ovl_manager->free_handle(ovl_manager,
- this->menu_handle);
- this->menu_handle = -1;
-
- int i;
- for (i=0; i < MAX_STREAMS; i++) {
- if( this->spudec_stream_state[i].overlay_handle >= 0 )
- ovl_manager->free_handle(ovl_manager,
- this->spudec_stream_state[i].overlay_handle);
- this->spudec_stream_state[i].overlay_handle = -1;
- free (this->spudec_stream_state[i].ra_seq.buf);
- }
-
- spudec_clear_nav_list(this);
- pthread_mutex_destroy(&this->nav_pci_lock);
-
- free (this->event.object.overlay);
- free (this);
-}
-
-/* gets the current already correctly processed nav_pci info */
-/* This is not perfectly in sync with the display, but all the same, */
-/* much closer than doing it at the input stage. */
-/* returns a bool for error/success.*/
-static int spudec_get_interact_info (spu_decoder_t *this_gen, void *data) {
- spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
- /*printf("get_interact_info() called\n");*/
- if (!this || !data)
- return 0;
-
- /*printf("get_interact_info() coping nav_pci\n");*/
- pthread_mutex_lock(&this->nav_pci_lock);
- spudec_update_nav(this);
- memcpy(data, &this->pci_cur.pci, sizeof(pci_t) );
- pthread_mutex_unlock(&this->nav_pci_lock);
- return 1;
-
-}
-
-static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t show) {
- spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
- /* This function will move to video_overlay
- * when video_overlay does menus */
-
- video_overlay_manager_t *ovl_manager;
- video_overlay_event_t *overlay_event = calloc(1, sizeof(video_overlay_event_t));
- vo_overlay_t *overlay = calloc(1, sizeof(vo_overlay_t));
-
- /* FIXME: Watch out for threads. We should really put a lock on this
- * because events is a different thread than decode_data */
-
- if( this->menu_handle < 0 ) {
- if (this->stream->video_out) {
- ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
- this->menu_handle = ovl_manager->get_handle(ovl_manager,1);
- }
- }
-#ifdef LOG_BUTTON
- printf ("libspudec:xine_decoder.c:spudec_event_listener:this=%p\n",this);
- printf ("libspudec:xine_decoder.c:spudec_event_listener:this->menu_handle=%d\n",this->menu_handle);
-#endif
- if(this->menu_handle < 0) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "Menu handle alloc failed. No more overlays objects available. Only %d at once please.",
- MAX_OBJECTS);
- free(overlay_event);
- free(overlay);
- return;
- }
-
- if (show > 0) {
-#ifdef LOG_NAV
- fprintf (stderr,"libspudec:xine_decoder.c:spudec_event_listener:buttonN = %u show=%d\n",
- button,
- show);
-#endif
- this->buttonN = button;
- if (this->button_filter != 1) {
-#ifdef LOG_BUTTON
- fprintf (stdout,"libspudec:xine_decoder.c:spudec_event_listener:buttonN updates not allowed\n");
-#endif
- /* Only update highlight is the menu will let us */
- free(overlay_event);
- free(overlay);
- return;
- }
- if (show == 2) {
- this->button_filter = 2;
- }
- pthread_mutex_lock(&this->nav_pci_lock);
- spudec_update_nav(this);
- overlay_event->object.handle = this->menu_handle;
- overlay_event->object.pts = this->pci_cur.pci.hli.hl_gi.hli_s_ptm;
- overlay_event->object.overlay=overlay;
- overlay_event->event_type = OVERLAY_EVENT_MENU_BUTTON;
-#ifdef LOG_BUTTON
- fprintf(stderr, "libspudec:Button Overlay\n");
-#endif
- spudec_copy_nav_to_overlay(this->stream->xine, &this->pci_cur.pci, this->state.clut,
- this->buttonN, show-1, overlay, &this->overlay );
- pthread_mutex_unlock(&this->nav_pci_lock);
- } else {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libspudec:xine_decoder.c:spudec_event_listener:HIDE ????\n");
- printf("We dropped out here for some reason");
- _x_abort();
- overlay_event->object.handle = this->menu_handle;
- overlay_event->event_type = OVERLAY_EVENT_HIDE;
- }
- overlay_event->vpts = 0;
- if (this->stream->video_out) {
- ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
-#ifdef LOG_BUTTON
- fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n",
- overlay_event->event_type,
- this->stream->xine->clock->get_current_time(this->stream->xine->clock),
- overlay_event->vpts);
-#endif
- ovl_manager->add_event (ovl_manager, (void *)overlay_event);
- free(overlay_event);
- free(overlay);
- } else {
- free(overlay_event);
- free(overlay);
- }
- return;
-}
-
-static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- spudec_decoder_t *this ;
-
- this = (spudec_decoder_t *) calloc(1, sizeof (spudec_decoder_t));
-
- this->spu_decoder.decode_data = spudec_decode_data;
- this->spu_decoder.reset = spudec_reset;
- this->spu_decoder.discontinuity = spudec_discontinuity;
- this->spu_decoder.dispose = spudec_dispose;
- this->spu_decoder.get_interact_info = spudec_get_interact_info;
- this->spu_decoder.set_button = spudec_set_button;
- this->stream = stream;
- this->class = (spudec_class_t *) class_gen;
-
- this->menu_handle = -1;
- this->buttonN = 1;
- this->event.object.overlay = calloc(1, sizeof(vo_overlay_t));
-
- pthread_mutex_init(&this->nav_pci_lock, NULL);
- this->pci_cur.pci.hli.hl_gi.hli_ss = 0;
- this->pci_cur.next = NULL;
-
- this->ovl_caps = stream->video_out->get_capabilities(stream->video_out);
- this->output_open = 0;
- this->last_event_vpts = 0;
-
- int i;
- for (i=0; i < MAX_STREAMS; i++) {
- this->spudec_stream_state[i].ra_seq.complete = 1;
- this->spudec_stream_state[i].overlay_handle = -1;
- }
-
-/* FIXME:Do we really need a default clut? */
- xine_fast_memcpy(this->state.clut, default_clut, sizeof(this->state.clut));
- this->state.need_clut = 1;
- this->state.vobsub = 0;
-
- return &this->spu_decoder;
-}
-
-static char *get_identifier (spu_decoder_class_t *this) {
-#ifdef LOG_DEBUG
- printf ("libspudec:get_identifier called\n");
-#endif
- return "spudec";
-}
-
-static char *get_description (spu_decoder_class_t *this) {
-#ifdef LOG_DEBUG
- printf ("libspudec:get_description called\n");
-#endif
- return "DVD/VOB SPU decoder plugin";
-}
-
-static void dispose_class (spu_decoder_class_t *this) {
-#ifdef LOG_DEBUG
- printf ("libspudec:dispose_class called\n");
-#endif
- free (this);
-}
-
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- spudec_class_t *this;
-
- this = calloc(1, sizeof (spudec_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- lprintf ("libspudec:init_plugin called\n");
- return this;
-}
-
-/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_DVD, 0 };
-
-static const decoder_info_t dec_info_data = {
- supported_types, /* supported types */
- 5 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 16, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libspudvb/Makefile.am b/src/libspudvb/Makefile.am
deleted file mode 100644
index 8187346aa..000000000
--- a/src/libspudvb/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-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
deleted file mode 100644
index 1ab52b7e7..000000000
--- a/src/libspudvb/xine_spudvb_decoder.c
+++ /dev/null
@@ -1,992 +0,0 @@
-/*
- * Copyright (C) 2008 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, USA
- *
- * DVB Subtitle decoder (ETS 300 743)
- * (c) 2004 Mike Lampard <mlampard@users.sourceforge.net>
- * based on the application dvbsub by Dave Chapman
- *
- * TODO:
- * - Implement support for teletext based subtitles
- */
-
-#include <pthread.h>
-#include <errno.h>
-
-#include "xine_internal.h"
-#include "bswap.h"
-#include "osd.h"
-#define MAX_REGIONS 7
-
-/*#define LOG 1*/
-
-typedef struct {
- int x, y;
- unsigned char is_visible;
-} visible_region_t;
-
-typedef struct {
- int page_time_out;
- int page_version_number;
- int page_state;
- int page_id;
- visible_region_t regions[MAX_REGIONS];
-} page_t;
-
-typedef struct {
- int version_number;
- int width, height;
- int empty;
- int depth;
- int CLUT_id;
- int objects_start;
- int objects_end;
- unsigned int object_pos[65536];
- unsigned char *img;
- osd_object_t *osd;
-} region_t;
-
-typedef struct {
-/* dvbsub stuff */
- int x;
- int y;
- unsigned int curr_obj;
- unsigned int curr_reg[64];
- uint8_t *buf;
- int i;
- int nibble_flag;
- int in_scanline;
- page_t page;
- region_t regions[MAX_REGIONS];
- clut_t colours[MAX_REGIONS*256];
- unsigned char trans[MAX_REGIONS*256];
-} dvbsub_func_t;
-
-typedef struct dvb_spu_class_s {
- spu_decoder_class_t class;
- xine_t *xine;
-
- int ignore_pts;
-} dvb_spu_class_t;
-
-typedef struct dvb_spu_decoder_s {
- spu_decoder_t spu_decoder;
-
- dvb_spu_class_t *class;
- xine_stream_t *stream;
-
- spu_dvb_descriptor_t *spu_descriptor;
-
- /* dvbsub_osd_mutex should be locked around all calls to this->osd_renderer->show()
- and this->osd_renderer->hide() */
- pthread_mutex_t dvbsub_osd_mutex;
-
- char *pes_pkt;
- char *pes_pkt_wrptr;
- unsigned int pes_pkt_size;
-
- int64_t vpts;
- int64_t end_vpts;
-
- pthread_t dvbsub_timer_thread;
- struct timespec dvbsub_hide_timeout;
- pthread_cond_t dvbsub_restart_timeout;
- dvbsub_func_t *dvbsub;
- int show;
-} dvb_spu_decoder_t;
-
-
-static void update_osd(dvb_spu_decoder_t *this, int region_id)
-{
- dvbsub_func_t *dvbsub = this->dvbsub;
- region_t *reg = &dvbsub->regions[region_id];
-
- if ( !reg->img ) {
- if ( reg->osd ) {
- pthread_mutex_lock( &this->dvbsub_osd_mutex );
- this->stream->osd_renderer->free_object( reg->osd );
- reg->osd = NULL;
- pthread_mutex_unlock( &this->dvbsub_osd_mutex );
- }
- return;
- }
-
- if ( reg->osd ) {
- if ( reg->width!=reg->osd->width || reg->height!=reg->osd->height ) {
- pthread_mutex_lock( &this->dvbsub_osd_mutex );
- this->stream->osd_renderer->free_object( reg->osd );
- reg->osd = NULL;
- pthread_mutex_unlock( &this->dvbsub_osd_mutex );
- }
- }
-
- if ( !reg->osd )
- reg->osd = this->stream->osd_renderer->new_object( this->stream->osd_renderer, reg->width, reg->height );
-}
-
-static void update_region (dvb_spu_decoder_t * this, int region_id, int region_width, int region_height, int fill, int fill_color)
-{
-
- dvbsub_func_t *dvbsub = this->dvbsub;
- region_t *reg = &dvbsub->regions[region_id];
-
- /* reject invalid sizes and set some limits ! */
- if ( region_width<=0 || region_height<=0 || region_width>1920 || region_height>1080 ) {
- free( reg->img );
- reg->img = NULL;
-#ifdef LOG
- printf("SPUDVB: rejected region %d = %dx%d\n", region_id, region_width, region_height );
-#endif
- return;
- }
-
- if ( (reg->width*reg->height) < (region_width*region_height) ) {
-#ifdef LOG
- printf("SPUDVB: update size of region %d = %dx%d\n", region_id, region_width, region_height);
-#endif
- free( reg->img );
- reg->img = NULL;
- }
-
- if ( !reg->img ) {
- if ( !(reg->img=malloc(region_width*region_height)) ) {
- lprintf( "can't allocate mem for region %d\n", region_id );
- return;
- }
- fill = 1;
- }
-
- if ( fill ) {
- memset( reg->img, fill_color, region_width*region_height );
- reg->empty = 1;
-#ifdef LOG
- printf("SPUDVB : FILL REGION %d\n", region_id);
-#endif
- }
- reg->width = region_width;
- reg->height = region_height;
-}
-
-
-static void do_plot (dvb_spu_decoder_t * this, int r, int x, int y, unsigned char pixel)
-{
- dvbsub_func_t *const dvbsub = this->dvbsub;
-
- const int i = (y * dvbsub->regions[r].width) + x;
- /* do some clipping */
- if ( i<(dvbsub->regions[r].width*dvbsub->regions[r].height) ) {
- dvbsub->regions[r].img[i] = pixel;
- dvbsub->regions[r].empty = 0;
- }
-}
-
-static void plot (dvb_spu_decoder_t * this, int r, int run_length, unsigned char pixel)
-{
-
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- const int x2 = dvbsub->x + run_length;
-
- while (dvbsub->x < x2) {
- do_plot (this, r, dvbsub->x, dvbsub->y, pixel);
- dvbsub->x++;
- }
-}
-
-static uint8_t next_nibble (dvb_spu_decoder_t * this)
-{
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- dvbsub->nibble_flag = !dvbsub->nibble_flag;
-
- if (dvbsub->nibble_flag) /* Inverted! */
- return (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
- else
- return (dvbsub->buf[dvbsub->i++] & 0x0f);
-}
-
-static void decode_4bit_pixel_code_string (dvb_spu_decoder_t * this, int r, int object_id, int ofs, int n)
-{
- dvbsub_func_t *const dvbsub = this->dvbsub;
-
- if (dvbsub->in_scanline == 0) {
- dvbsub->in_scanline = 1;
- }
- dvbsub->nibble_flag = 0;
- const int j = dvbsub->i + n;
- while (dvbsub->i < j) {
-
- int bits = 0;
- const uint8_t next_bits = next_nibble (this);
-
- if (next_bits != 0) {
- const uint8_t pixel_code = next_bits;
- plot (this, r, 1, pixel_code);
- bits += 4;
- }
- else {
- bits += 4;
- const uint8_t data = next_nibble (this);
- const uint8_t switch_1 = (data & 0x08) >> 3;
- bits++;
- if (switch_1 == 0) {
- const uint8_t run_length = (data & 0x07);
- bits += 3;
- if (run_length != 0) {
- plot (this, r, run_length + 2, 0);
- }
- else {
- break;
- }
- }
- else {
- const uint8_t switch_2 = (data & 0x04) >> 2;
- bits++;
- if (switch_2 == 0) {
- const uint8_t run_length = (data & 0x03);
- bits += 2;
- const uint8_t pixel_code = next_nibble (this);
- bits += 4;
- plot (this, r, run_length + 4, pixel_code);
- }
- else {
- const uint8_t switch_3 = (data & 0x03);
- bits += 2;
- switch (switch_3) {
- case 0:
- plot (this, r, 1, 0);
- break;
- case 1:
- plot (this, r, 2, 0);
- break;
- case 2:
- {
- const uint8_t run_length = next_nibble (this);
- bits += 4;
- const uint8_t pixel_code = next_nibble (this);
- bits += 4;
- plot (this, r, run_length + 9, pixel_code);
- }
- break;
- case 3:
- {
- uint8_t run_length = next_nibble (this);
- run_length = (run_length << 4) | next_nibble (this);
- bits += 8;
- const uint8_t pixel_code = next_nibble (this);
- bits += 4;
- plot (this, r, run_length + 25, pixel_code);
- }
- }
- }
- }
- }
-
- }
- if (dvbsub->nibble_flag == 1) {
- dvbsub->i++;
- dvbsub->nibble_flag = 0;
- }
-}
-
-
-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) {
-
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- if ((CLUT_id>=MAX_REGIONS) || (CLUT_entry_id>15)) {
- return;
- }
-
- 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;
- }
-
-}
-
-static void process_CLUT_definition_segment(dvb_spu_decoder_t *this) {
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- /*
- const uint16_t page_id= _X_BE_16(&dvbsub->buf[dvbsub->i]);
- */
- dvbsub->i+=2;
- const uint16_t segment_length= _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i+=2;
- const int j=dvbsub->i+segment_length;
-
- const uint8_t CLUT_id=dvbsub->buf[dvbsub->i++];
- /*
- const uint8_t CLUT_version_number=(dvbsub->buf[dvbsub->i]&0xf0)>>4;
- */
- dvbsub->i++;
-
- while (dvbsub->i < j) {
- const uint8_t CLUT_entry_id=dvbsub->buf[dvbsub->i++];
- /*
- const uint8_t CLUT_flag_2_bit=(dvbsub->buf[dvbsub->i]&0x80)>>7;
- const uint8_t CLUT_flag_4_bit=(dvbsub->buf[dvbsub->i]&0x40)>>6;
- const uint8_t CLUT_flag_8_bit=(dvbsub->buf[dvbsub->i]&0x20)>>5;
- */
- const uint8_t full_range_flag=dvbsub->buf[dvbsub->i]&1;
- dvbsub->i++;
-
- int Y_value,
- Cr_value,
- Cb_value,
- T_value;
- if (full_range_flag==1) {
- Y_value=dvbsub->buf[dvbsub->i++];
- Cr_value=dvbsub->buf[dvbsub->i++];
- Cb_value=dvbsub->buf[dvbsub->i++];
- T_value=dvbsub->buf[dvbsub->i++];
- } else {
- Y_value = dvbsub->buf[dvbsub->i] & 0xfc;
- Cr_value = (dvbsub->buf[dvbsub->i] << 6 | dvbsub->buf[dvbsub->i + 1] >> 2) & 0xf0;
- Cb_value = (dvbsub->buf[dvbsub->i + 1] << 2) & 0xf0;
- T_value = (dvbsub->buf[dvbsub->i + 1] & 3) * 0x55; /* expand only this one to full range! */
- dvbsub->i+=2;
- }
- set_clut(this, CLUT_id,CLUT_entry_id,Y_value,Cr_value,Cb_value,T_value);
- }
-}
-
-static void process_pixel_data_sub_block (dvb_spu_decoder_t * this, int r, int o, int ofs, int n)
-{
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- const int j = dvbsub->i + n;
-
- dvbsub->x = (dvbsub->regions[r].object_pos[o]) >> 16;
- dvbsub->y = ((dvbsub->regions[r].object_pos[o]) & 0xffff) + ofs;
- while (dvbsub->i < j) {
- const uint8_t data_type = dvbsub->buf[dvbsub->i++];
-
- switch (data_type) {
- case 0:
- dvbsub->i++;
- case 0x11:
- decode_4bit_pixel_code_string (this, r, o, ofs, n - 1);
- break;
- case 0xf0:
- dvbsub->in_scanline = 0;
- dvbsub->x = (dvbsub->regions[r].object_pos[o]) >> 16;
- dvbsub->y += 2;
- break;
- default:
- lprintf ("unimplemented data_type %02x in pixel_data_sub_block\n", data_type);
- }
- }
-
- dvbsub->i = j;
-}
-
-static void process_page_composition_segment (dvb_spu_decoder_t * this)
-{
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- dvbsub->page.page_id = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const uint16_t segment_length = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
-
- const int j = dvbsub->i + segment_length;
-
- dvbsub->page.page_time_out = dvbsub->buf[dvbsub->i++];
- if ( dvbsub->page.page_time_out>6 ) /* some timeout are insane, e.g. 65s ! */
- dvbsub->page.page_time_out = 6;
-
- int version = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
- if ( version == dvbsub->page.page_version_number )
- return;
- dvbsub->page.page_version_number = version;
- dvbsub->page.page_state = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2;
- dvbsub->i++;
- int r;
- for (r=0; r<MAX_REGIONS; r++) { /* reset */
- dvbsub->page.regions[r].is_visible = 0;
- }
-
- while (dvbsub->i < j) {
- const uint8_t region_id = dvbsub->buf[dvbsub->i++];
- dvbsub->i++; /* reserved */
- const uint16_t region_x = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const uint16_t region_y = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
-
- dvbsub->page.regions[region_id].x = region_x;
- dvbsub->page.regions[region_id].y = region_y;
- dvbsub->page.regions[region_id].is_visible = 1;
- }
-}
-
-
-static void process_region_composition_segment (dvb_spu_decoder_t * this)
-{
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- dvbsub->page.page_id = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const uint16_t segment_length = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const int j = dvbsub->i + segment_length;
-
- const uint8_t region_id = dvbsub->buf[dvbsub->i++];
- const uint8_t region_version_number = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
- const uint8_t region_fill_flag = (dvbsub->buf[dvbsub->i] & 0x08) >> 3;
- dvbsub->i++;
- const uint16_t region_width = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const uint16_t region_height = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- /*
- const uint8_t region_level_of_compatibility = (dvbsub->buf[dvbsub->i] & 0xe0) >> 5;
- const uint8_t region_depth = (dvbsub->buf[dvbsub->i] & 0x1c) >> 2;
- */
- dvbsub->i++;
- const uint8_t CLUT_id = dvbsub->buf[dvbsub->i++];
- /*
- const uint8_t region_8_bit_pixel_code = dvbsub->buf[dvbsub->i];
- */
- dvbsub->i++;
- const uint8_t region_4_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
- /*
- const uint8_t region_2_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2;
- */
- dvbsub->i++;
-
- if(region_id>=MAX_REGIONS)
- return;
-
- if ( dvbsub->regions[region_id].version_number == region_version_number )
- return;
-
- dvbsub->regions[region_id].version_number = region_version_number;
-
- /* Check if region size has changed and fill background. */
- update_region (this, region_id, region_width, region_height, region_fill_flag, region_4_bit_pixel_code);
- if ( CLUT_id<MAX_REGIONS )
- dvbsub->regions[region_id].CLUT_id = CLUT_id;
-
- dvbsub->regions[region_id].objects_start = dvbsub->i;
- dvbsub->regions[region_id].objects_end = j;
-
- {
- int o;
- for (o = 0; o < 65536; o++) {
- dvbsub->regions[region_id].object_pos[o] = 0xffffffff;
- }
- }
-
- while (dvbsub->i < j) {
- const uint16_t object_id = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const uint8_t object_type = (dvbsub->buf[dvbsub->i] & 0xc0) >> 6;
- /*
- const uint8_t object_provider_flag = (dvbsub->buf[dvbsub->i] & 0x30) >> 4;
- */
- const uint16_t object_x = ((dvbsub->buf[dvbsub->i] & 0x0f) << 8) | dvbsub->buf[dvbsub->i + 1];
- dvbsub->i += 2;
- const uint16_t object_y = ((dvbsub->buf[dvbsub->i] & 0x0f) << 8) | dvbsub->buf[dvbsub->i + 1];
- dvbsub->i += 2;
-
- dvbsub->regions[region_id].object_pos[object_id] = (object_x << 16) | object_y;
-
- if ((object_type == 0x01) || (object_type == 0x02)) {
- /*
- const uint8_t foreground_pixel_code = dvbsub->buf[dvbsub->i];
- const uint8_t background_pixel_code = dvbsub->buf[dvbsub->i+1];
- */
- dvbsub->i += 2;
- }
- }
-
-}
-
-static void process_object_data_segment (dvb_spu_decoder_t * this)
-{
- dvbsub_func_t *dvbsub = this->dvbsub;
-
- dvbsub->page.page_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
- dvbsub->i += 2;
- /*
- const uint16_t segment_length = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- */
- dvbsub->i += 2;
-
- const uint16_t object_id = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- dvbsub->curr_obj = object_id;
- const uint8_t object_coding_method = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2;
- /*
- const uint8_t object_version_number = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
- const uint8_t non_modifying_colour_flag = (dvbsub->buf[dvbsub->i] & 0x02) >> 1;
- */
- dvbsub->i++;
-
- if ( object_coding_method != 0 )
- return;
-
- const int old_i = dvbsub->i;
- int r;
- for (r = 0; r < MAX_REGIONS; r++) {
-
- /* If this object is in this region... */
- if (!dvbsub->regions[r].img)
- continue;
-
- if (dvbsub->regions[r].object_pos[object_id] == 0xffffffff)
- continue;
-
- dvbsub->i = old_i;
-
- const uint16_t top_field_data_block_length = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
- const uint16_t bottom_field_data_block_length = _X_BE_16(&dvbsub->buf[dvbsub->i]);
- dvbsub->i += 2;
-
- process_pixel_data_sub_block (this, r, object_id, 0, top_field_data_block_length);
- process_pixel_data_sub_block (this, r, object_id, 1, bottom_field_data_block_length);
- }
-}
-
-static void unlock_mutex_cancellation_func(void *mutex_gen)
-{
- pthread_mutex_t *mutex = (pthread_mutex_t*) mutex_gen;
- pthread_mutex_unlock(mutex);
-}
-
-/* Thread routine that checks for subtitle timeout periodically.
- To avoid unexpected subtitle hiding, calls to this->stream->osd_renderer->show()
- should be in blocks like:
-
- pthread_mutex_lock(&this->dvbsub_osd_mutex);
- this->stream->osd_renderer->show(...);
- this->dvbsub_hide_timeout.tv_sec = time(NULL) + timeout value;
- pthread_cond_signal(&this->dvbsub_restart_timeout);
- pthread_mutex_unlock(&this->dvbsub_osd_mutex);
-
- This ensures that the timeout is changed with the lock held, and
- that the thread is signalled to pick up the new timeout.
-*/
-static void* dvbsub_timer_func(void *this_gen)
-{
- dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
- pthread_mutex_lock(&this->dvbsub_osd_mutex);
-
- /* If we're cancelled via pthread_cancel, unlock the mutex */
- pthread_cleanup_push(unlock_mutex_cancellation_func, &this->dvbsub_osd_mutex);
-
- while(1) {
- /* Record the current timeout, and wait - note that pthread_cond_timedwait
- will unlock the mutex on entry, and lock it on exit */
- struct timespec timeout = this->dvbsub_hide_timeout;
- const int result = pthread_cond_timedwait(&this->dvbsub_restart_timeout,
- &this->dvbsub_osd_mutex,
- &this->dvbsub_hide_timeout);
- if(result != ETIMEDOUT ||
- timeout.tv_sec != this->dvbsub_hide_timeout.tv_sec ||
- timeout.tv_nsec != this->dvbsub_hide_timeout.tv_nsec)
- continue;
-
- /* We timed out, and no-one changed the timeout underneath us.
- Hide the OSD, then wait until we're signalled. */
- if(this && this->stream && this->stream->osd_renderer) {
- int i;
- for ( i=0; i<MAX_REGIONS; i++ ) {
- if ( !this->dvbsub->regions[i].osd )
- continue;
-
- this->stream->osd_renderer->hide( this->dvbsub->regions[i].osd, 0 );
-#ifdef LOG
- printf("SPUDVB: thread hiding = %d\n",i);
-#endif
- }
- }
- pthread_cond_wait(&this->dvbsub_restart_timeout, &this->dvbsub_osd_mutex);
- }
-
- pthread_cleanup_pop(1);
- return NULL;
-}
-
-static void downscale_region_image( region_t *reg, unsigned char *dest, int dest_width )
-{
- float i, k, inc=reg->width/(float)dest_width;
- int j;
- for ( j=0; j<reg->height; j++ ) {
- for ( i=0,k=0; i<reg->width && k<dest_width; i+=inc,k++ ) {
- dest[(j*dest_width)+(int)k] = reg->img[(j*reg->width)+(int)i];
- }
- }
-}
-
-static void draw_subtitles (dvb_spu_decoder_t * this)
-{
- int64_t dum;
- int dest_width=0, dest_height;
- this->stream->video_out->status(this->stream->video_out, NULL, &dest_width, &dest_height, &dum);
-
- if ( !dest_width )
- return;
-
- /* render all regions onto the page */
-
- {
- int r;
- int display = 0;
- for ( r=0; r<MAX_REGIONS; r++ ) {
- if ( this->dvbsub->page.regions[r].is_visible ) {
- display = 1;
- break;
- }
- }
- if ( !display )
- return;
- }
-
- int r;
- for (r = 0; r < MAX_REGIONS; r++) {
- if (this->dvbsub->regions[r].img) {
- if (this->dvbsub->page.regions[r].is_visible && !this->dvbsub->regions[r].empty) {
- update_osd( this, r );
- if ( !this->dvbsub->regions[r].osd )
- continue;
- /* clear osd */
- this->stream->osd_renderer->clear( this->dvbsub->regions[r].osd );
-
- uint8_t *reg;
- int reg_width;
- uint8_t tmp[dest_width*576];
- if (this->dvbsub->regions[r].width>dest_width) {
- downscale_region_image(&this->dvbsub->regions[r], tmp, dest_width);
- reg = tmp;
- reg_width = dest_width;
- }
- else {
- reg = this->dvbsub->regions[r].img;
- reg_width = this->dvbsub->regions[r].width;
- }
- this->stream->osd_renderer->set_palette( this->dvbsub->regions[r].osd, (uint32_t*)(&this->dvbsub->colours[this->dvbsub->regions[r].CLUT_id*256]), &this->dvbsub->trans[this->dvbsub->regions[r].CLUT_id*256]);
- this->stream->osd_renderer->draw_bitmap( this->dvbsub->regions[r].osd, reg, 0, 0, reg_width, this->dvbsub->regions[r].height, NULL );
- }
- }
- }
-
- pthread_mutex_lock(&this->dvbsub_osd_mutex);
-#ifdef LOG
- printf("SPUDVB: this->vpts=%"PRId64"\n", this->vpts);
-#endif
- for ( r=0; r<MAX_REGIONS; r++ ) {
-#ifdef LOG
- printf("SPUDVB : region=%d, visible=%d, osd=%d, empty=%d\n", r, this->dvbsub->page.regions[r].is_visible, this->dvbsub->regions[r].osd?1:0, this->dvbsub->regions[r].empty );
-#endif
- if ( this->dvbsub->page.regions[r].is_visible && this->dvbsub->regions[r].osd && !this->dvbsub->regions[r].empty ) {
- this->stream->osd_renderer->set_position( this->dvbsub->regions[r].osd, this->dvbsub->page.regions[r].x, this->dvbsub->page.regions[r].y );
- this->stream->osd_renderer->show( this->dvbsub->regions[r].osd, this->vpts );
-#ifdef LOG
- printf("SPUDVB: show region = %d\n",r);
-#endif
- }
- else {
- if ( this->dvbsub->regions[r].osd ) {
- this->stream->osd_renderer->hide( this->dvbsub->regions[r].osd, this->vpts );
-#ifdef LOG
- printf("SPUDVB: hide region = %d\n",r);
-#endif
- }
- }
- }
- this->dvbsub_hide_timeout.tv_nsec = 0;
- this->dvbsub_hide_timeout.tv_sec = time(NULL) + this->dvbsub->page.page_time_out;
-#ifdef LOG
- printf("SPUDVB: page_time_out %d\n",this->dvbsub->page.page_time_out);
-#endif
- pthread_cond_signal(&this->dvbsub_restart_timeout);
- pthread_mutex_unlock(&this->dvbsub_osd_mutex);
-}
-
-
-static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf)
-{
- dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
-
- if((buf->type & 0xffff0000)!=BUF_SPU_DVB)
- return;
-
- if (buf->decoder_flags & BUF_FLAG_SPECIAL) {
- if (buf->decoder_info[1] == BUF_SPECIAL_SPU_DVB_DESCRIPTOR) {
- if (buf->decoder_info[2] == 0) {
- /* Hide the osd - note that if the timeout thread times out, it'll rehide, which is harmless */
- pthread_mutex_lock(&this->dvbsub_osd_mutex);
- int i;
- for ( i=0; i<MAX_REGIONS; i++ ) {
- if ( this->dvbsub->regions[i].osd )
- this->stream->osd_renderer->hide( this->dvbsub->regions[i].osd, 0 );
- }
- pthread_mutex_unlock(&this->dvbsub_osd_mutex);
- }
- else {
- xine_fast_memcpy (this->spu_descriptor, buf->decoder_info_ptr[2], buf->decoder_info[2]);
- }
- }
- return;
- }
-
- /* accumulate data */
- if (buf->decoder_info[2]) {
- memset (this->pes_pkt, 0xff, 64*1024);
- this->pes_pkt_wrptr = this->pes_pkt;
- this->pes_pkt_size = buf->decoder_info[2];
-
- xine_fast_memcpy (this->pes_pkt, buf->content, buf->size);
- this->pes_pkt_wrptr += buf->size;
-
- this->vpts = 0;
- }
- else {
- if (this->pes_pkt && (this->pes_pkt_wrptr != this->pes_pkt)) {
- xine_fast_memcpy (this->pes_pkt_wrptr, buf->content, buf->size);
- this->pes_pkt_wrptr += buf->size;
- }
- }
-
- /* don't ask metronom for a vpts but rather do the calculation
- * because buf->pts could be too far in future and metronom won't accept
- * further backwards pts (see metronom_got_spu_packet) */
- if (!this->class->ignore_pts && buf->pts > 0) {
- metronom_t *const metronom = this->stream->metronom;
- const int64_t vpts_offset = metronom->get_option( metronom, METRONOM_VPTS_OFFSET );
- const int64_t spu_offset = metronom->get_option( metronom, METRONOM_SPU_OFFSET );
- const int64_t vpts = (int64_t)(buf->pts)+vpts_offset+spu_offset;
- metronom_clock_t *const clock = this->stream->xine->clock;
- const int64_t curvpts = clock->get_current_time( clock );
- /* if buf->pts is unreliable, show page asap (better than nothing) */
-#ifdef LOG
- printf("SPUDVB: spu_vpts=%"PRId64" - current_vpts=%"PRId64"\n", vpts, curvpts);
-#endif
- if ( vpts<=curvpts || (vpts-curvpts)>(5*90000) )
- this->vpts = 0;
- else
- this->vpts = vpts;
- }
-
- /* completely ignore pts since it makes a lot of problems with various providers */
- /* this->vpts = 0; */
-
- /* process the pes section */
-
- const int PES_packet_length = this->pes_pkt_size;
-
- this->dvbsub->buf = this->pes_pkt;
-
- this->dvbsub->i = 0;
-
- /*
- const uint8_t data_identifier = this->dvbsub->buf[this->dvbsub->i];
- const uint8_t subtitle_stream_id = this->dvbsub->buf[this->dvbsub->i+1];
- */
- this->dvbsub->i += 2;
-
- while (this->dvbsub->i <= (PES_packet_length)) {
- /* SUBTITLING SEGMENT */
- this->dvbsub->i++;
- const uint8_t segment_type = this->dvbsub->buf[this->dvbsub->i++];
-
- this->dvbsub->page.page_id = (this->dvbsub->buf[this->dvbsub->i] << 8) | this->dvbsub->buf[this->dvbsub->i + 1];
- const uint16_t segment_length = _X_BE_16(&this->dvbsub->buf[this->dvbsub->i + 2]);
- const int new_i = this->dvbsub->i + segment_length + 4;
-
- /* only process complete segments */
- if(new_i > (this->pes_pkt_wrptr - this->pes_pkt))
- break;
-
- /* verify we've the right segment */
- if(this->dvbsub->page.page_id==this->spu_descriptor->comp_page_id){
- /* SEGMENT_DATA_FIELD */
- switch (segment_type) {
- case 0x10:
- process_page_composition_segment(this);
- break;
- case 0x11:
- process_region_composition_segment(this);
- break;
- case 0x12:
- process_CLUT_definition_segment(this);
- break;
- case 0x13:
- process_object_data_segment (this);
- break;
- case 0x14:
- /* skip display descriptor */
- break;
- case 0x80:
- draw_subtitles( this ); /* Page is now completely rendered */
- break;
- default:
- return;
- break;
- }
- }
- this->dvbsub->i = new_i;
- }
-}
-
-static void spudec_reset (spu_decoder_t * this_gen)
-{
- dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
- int i;
-
- /* Hide the osd - if the timeout thread times out, it'll rehide harmlessly */
- pthread_mutex_lock(&this->dvbsub_osd_mutex);
- for ( i=0; i<MAX_REGIONS; i++ ) {
- if ( this->dvbsub->regions[i].osd )
- this->stream->osd_renderer->hide(this->dvbsub->regions[i].osd, 0);
- this->dvbsub->regions[i].version_number = -1;
- }
- this->dvbsub->page.page_version_number = -1;
- pthread_mutex_unlock(&this->dvbsub_osd_mutex);
-
-}
-
-static void spudec_discontinuity (spu_decoder_t * this_gen)
-{
- /* do nothing */
-}
-
-static void spudec_dispose (spu_decoder_t * this_gen)
-{
- dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
-
- pthread_cancel(this->dvbsub_timer_thread);
- pthread_join(this->dvbsub_timer_thread, NULL);
- pthread_mutex_destroy(&this->dvbsub_osd_mutex);
- pthread_cond_destroy(&this->dvbsub_restart_timeout);
-
- free(this->spu_descriptor);
- this->spu_descriptor=NULL;
-
- int i;
- for ( i=0; i<MAX_REGIONS; i++ ) {
- free( this->dvbsub->regions[i].img );
- if ( this->dvbsub->regions[i].osd )
- this->stream->osd_renderer->free_object( this->dvbsub->regions[i].osd );
- }
-
- free (this->pes_pkt);
- free (this->dvbsub);
- free (this);
-}
-
-static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen, xine_stream_t * stream)
-{
- dvb_spu_decoder_t *this = calloc(1, sizeof (dvb_spu_decoder_t));
- dvb_spu_class_t *class = (dvb_spu_class_t *)class_gen;
-
- this->spu_decoder.decode_data = spudec_decode_data;
- this->spu_decoder.reset = spudec_reset;
- this->spu_decoder.discontinuity = spudec_discontinuity;
- this->spu_decoder.dispose = spudec_dispose;
- this->spu_decoder.get_interact_info = NULL;
- this->spu_decoder.set_button = NULL;
-
- this->class = class;
- this->stream = stream;
-
- this->pes_pkt = calloc(65, 1024);
- this->spu_descriptor = calloc(1, sizeof(spu_dvb_descriptor_t));
-
- this->dvbsub = calloc(1, sizeof (dvbsub_func_t));
-
- pthread_mutex_init(&this->dvbsub_osd_mutex, NULL);
- pthread_cond_init(&this->dvbsub_restart_timeout, NULL);
- this->dvbsub_hide_timeout.tv_nsec = 0;
- this->dvbsub_hide_timeout.tv_sec = time(NULL);
- pthread_create(&this->dvbsub_timer_thread, NULL, dvbsub_timer_func, this);
-
- return (spu_decoder_t *) this;
-}
-
-static void dvb_spu_class_dispose (spu_decoder_class_t * this_gen)
-{
- dvb_spu_class_t *this = (dvb_spu_class_t *) this_gen;
-
- this->xine->config->unregister_callback(this->xine->config, "subtitles.dvb.ignore_pts");
-
- free (this);
-}
-
-static char *dvb_spu_class_get_identifier (spu_decoder_class_t * this)
-{
- return "spudvb";
-}
-
-static char *dvb_spu_class_get_description (spu_decoder_class_t * this)
-{
- return "DVB subtitle decoder plugin";
-}
-
-static void spu_dvb_ignore_pts_change(void *this_gen, xine_cfg_entry_t *value)
-{
- dvb_spu_class_t *this = (dvb_spu_class_t *) this_gen;
-
- this->ignore_pts = value->num_value;
-}
-
-static void *init_spu_decoder_plugin (xine_t * xine, void *data)
-{
- dvb_spu_class_t *this = calloc(1, sizeof (dvb_spu_class_t));
-
- this->class.open_plugin = dvb_spu_class_open_plugin;
- this->class.get_identifier = dvb_spu_class_get_identifier;
- this->class.get_description = dvb_spu_class_get_description;
- this->class.dispose = dvb_spu_class_dispose;
-
- this->xine = xine;
-
- this->ignore_pts = xine->config->register_bool(xine->config,
- "subtitles.dvb.ignore_pts", 0,
- _("Ignore DVB subtitle timing"),
- _("Do not use PTS timestamps for DVB subtitle timing"),
- 1, spu_dvb_ignore_pts_change, this);
-
- return &this->class;
-}
-
-
-/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_DVB, 0 };
-
-static const decoder_info_t spudec_info = {
- supported_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
-/* type, API, "name", version, special_info, init_function */
- {PLUGIN_SPU_DECODER, 16, "spudvb", XINE_VERSION_CODE, &spudec_info,
- &init_spu_decoder_plugin},
- {PLUGIN_NONE, 0, "", 0, NULL, NULL}
-};
diff --git a/src/libspuhdmv/Makefile.am b/src/libspuhdmv/Makefile.am
deleted file mode 100644
index 15a029f8a..000000000
--- a/src/libspuhdmv/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-xineplug_LTLIBRARIES = xineplug_decode_spuhdmv.la
-
-xineplug_decode_spuhdmv_la_SOURCES = xine_hdmv_decoder.c
-xineplug_decode_spuhdmv_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_decode_spuhdmv_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_decode_spuhdmv_la_LDFLAGS = $(xineplug_ldflags)
diff --git a/src/libspuhdmv/xine_hdmv_decoder.c b/src/libspuhdmv/xine_hdmv_decoder.c
deleted file mode 100644
index 849346ecd..000000000
--- a/src/libspuhdmv/xine_hdmv_decoder.c
+++ /dev/null
@@ -1,1095 +0,0 @@
-/*
- * Copyright (C) 2000-2009 the xine project
- *
- * Copyright (C) 2009 Petri Hintukainen <phintuka@users.sourceforge.net>
- *
- * This file is part of xine, a unix 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, USA
- *
- * Decoder for HDMV/BluRay bitmap subtitles
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <inttypes.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-#ifdef HAVE_CONFIG_H
-# include "xine_internal.h"
-# include "buffer.h"
-# include "xineutils.h"
-# include "video_out.h"
-# include "video_overlay.h"
-#else
-# include <xine/xine_internal.h>
-# include <xine/buffer.h>
-# include <xine/xineutils.h>
-# include <xine/video_out.h>
-# include <xine/video_overlay.h>
-#endif
-
-#define XINE_HDMV_TRACE(x...) printf(x)
-/*#define XINE_HDMV_TRACE(x...) */
-#define XINE_HDMV_ERROR(x...) fprintf(stderr, "spuhdmv: " x)
-/*#define XINE_HDMV_ERROR(x...) lprintf(x) */
-
-#ifndef MAX
-# define MAX(a,b) (a>b)?(a):(b)
-#endif
-
-enum {
- SEGTYPE_PALETTE = 0x14,
- SEGTYPE_OBJECT = 0x15,
- SEGTYPE_PRESENTATION_SEGMENT = 0x16,
- SEGTYPE_WINDOW_DEFINITION = 0x17,
- SEGTYPE_INTERACTIVE = 0x18,
- SEGTYPE_END_OF_DISPLAY = 0x80,
-} eSegmentType;
-
-/*
- * cached palette (xine-lib format)
- */
-typedef struct subtitle_clut_s subtitle_clut_t;
-struct subtitle_clut_s {
- uint8_t id;
- uint32_t color[256];
- uint8_t trans[256];
- subtitle_clut_t *next;
-
- int shown;
-};
-
-/*
- * cached RLE image (xine-lib format)
- */
-typedef struct subtitle_object_s subtitle_object_t;
-struct subtitle_object_s {
- uint16_t id;
- uint16_t xpos, ypos;
- uint16_t width, height;
-
- /* xine format */
- rle_elem_t *rle;
- unsigned int num_rle;
- size_t data_size;
-
- /* HDMV format (used when object does not fit to single segment) */
- uint32_t data_len; /* size of complete object */
- uint8_t *raw_data; /* partial RLE data in HDMV format */
- size_t raw_data_len; /* bytes buffered */
- size_t raw_data_size; /* allocated size */
-
- subtitle_object_t *next;
-
- int shown;
-};
-
-/*
- * Window definition
- */
-typedef struct window_def_s window_def_t;
-struct window_def_s {
- uint8_t id;
- uint16_t xpos, ypos;
- uint16_t width, height;
-
- window_def_t *next;
-
- int shown;
-};
-
-
-/*
- * decoded SPU
- */
-typedef struct composition_object_s composition_object_t;
-struct composition_object_s {
- uint8_t window_id_ref;
- uint16_t object_id_ref;
-
- uint16_t xpos, ypos;
-
- uint8_t forced_flag;
- uint8_t cropped_flag;
- uint16_t crop_horiz_pos, crop_vert_pos;
- uint16_t crop_width, crop_height;
-
- composition_object_t *next;
-
- int shown;
-};
-
-typedef struct composition_descriptor_s composition_descriptor_t;
-struct composition_descriptor_s {
- uint16_t number;
- uint8_t state;
-};
-
-typedef struct presentation_segment_s presentation_segment_t;
-struct presentation_segment_s {
- composition_descriptor_t comp_descr;
-
- uint8_t palette_update_flag;
- uint8_t palette_id_ref;
- uint8_t object_number;
-
- composition_object_t *comp_objs;
-
- presentation_segment_t *next;
-
- int64_t pts;
- int shown;
-};
-
-/*
- * list handling
- */
-
-#define LIST_REPLACE(list, obj, FREE_FUNC) \
- do { \
- unsigned int id = obj->id; \
- \
- /* insert to list */ \
- obj->next = list; \
- list = obj; \
- \
- /* remove old */ \
- while (obj->next && obj->next->id != id) \
- obj = obj->next; \
- if (obj->next) { \
- void *tmp = (void*)obj->next; \
- obj->next = obj->next->next; \
- FREE_FUNC(tmp); \
- } \
- } while (0);
-
-#define LIST_DESTROY(list, FREE_FUNC) \
- while (list) { \
- void *tmp = (void*)list; \
- list = list->next; \
- FREE_FUNC(tmp); \
- }
-
-static void free_subtitle_object(void *ptr)
-{
- if (ptr) {
- free(((subtitle_object_t*)ptr)->rle);
- free(((subtitle_object_t*)ptr)->raw_data);
- free(ptr);
- }
-}
-static void free_presentation_segment(void *ptr)
-{
- if (ptr) {
- presentation_segment_t *seg = (presentation_segment_t*)ptr;
- LIST_DESTROY(seg->comp_objs, free);
- free(ptr);
- }
-}
-
-
-/*
- * segment_buffer_t
- *
- * assemble and decode segments
- */
-
-typedef struct {
- /* current segment */
- int segment_len; /* length of current segment (without 3-byte header) */
- uint8_t segment_type; /* current segment type */
- uint8_t *segment_data; /* pointer to current segment payload */
- uint8_t *segment_end; /* pointer to last byte + 1 of current segment */
- uint8_t error; /* boolean: buffer overflow etc. */
-
- /* accumulated data */
- uint8_t *buf; /* */
- size_t len; /* count of unprocessed bytes */
- size_t data_size; /* allocated buffer size */
-} segment_buffer_t;
-
-/*
- * mgmt
- */
-
-static segment_buffer_t *segbuf_init(void)
-{
- segment_buffer_t *buf = calloc(1, sizeof(segment_buffer_t));
- return buf;
-}
-
-static void segbuf_dispose(segment_buffer_t *buf)
-{
- if (buf->buf)
- free (buf->buf);
- free (buf);
-}
-
-static void segbuf_reset(segment_buffer_t *buf)
-{
- buf->segment_end = buf->segment_data = buf->buf;
- buf->len = 0;
- buf->segment_len = -1;
- buf->segment_type = 0;
- buf->error = 0;
-}
-
-/*
- * assemble, parse
- */
-
-static void segbuf_parse_segment_header(segment_buffer_t *buf)
-{
- if (buf->len > 2) {
- buf->segment_type = buf->buf[0];
- buf->segment_len = (buf->buf[1] << 8) | buf->buf[2];
- buf->segment_data = buf->buf + 3;
- buf->segment_end = buf->segment_data + buf->segment_len;
- buf->error = 0;
-
- if ( buf->segment_type < 0x14 ||
- ( buf->segment_type > 0x18 &&
- buf->segment_type != 0x80)) {
- XINE_HDMV_ERROR("unknown segment type 0x%02x, resetting\n", buf->segment_type);
- segbuf_reset(buf);
- }
- } else {
- buf->segment_len = -1;
- buf->error = 1;
- }
-}
-
-static void segbuf_fill(segment_buffer_t *buf, uint8_t *data, size_t len)
-{
- if (buf->len + len > buf->data_size) {
- buf->data_size = buf->len + len;
- if (buf->buf)
- buf->buf = realloc(buf->buf, buf->data_size);
- else
- buf->buf = malloc(buf->data_size);
- }
-
- memcpy(buf->buf + buf->len, data, len);
- buf->len += len;
-
- segbuf_parse_segment_header(buf);
-}
-
-static int segbuf_segment_complete(segment_buffer_t *buf)
-{
- return (buf->segment_len >= 0) && (buf->len >= (unsigned)buf->segment_len + 3);
-}
-
-static void segbuf_skip_segment(segment_buffer_t *buf)
-{
- if (segbuf_segment_complete (buf)) {
- buf->len -= buf->segment_len + 3;
- if (buf->len > 0)
- memmove(buf->buf, buf->buf + buf->segment_len + 3, buf->len);
-
- segbuf_parse_segment_header(buf);
-
- XINE_HDMV_TRACE(" skip_segment: %zd bytes left\n", buf->len);
- } else {
- XINE_HDMV_ERROR(" skip_segment: ERROR - %zd bytes queued, %d required\n",
- buf->len, buf->segment_len);
- segbuf_reset (buf);
- }
-}
-
-/*
- * access segment data
- */
-
-static uint8_t segbuf_segment_type(segment_buffer_t *buf)
-{
- return buf->segment_type;
-}
-
-static size_t segbuf_data_length(segment_buffer_t *buf)
-{
- ssize_t val = buf->segment_end - buf->segment_data;
- if (val < 0) val = 0;
- return (size_t)val;
-}
-
-static uint8_t segbuf_get_u8(segment_buffer_t *buf)
-{
- if (!(buf->error = ++buf->segment_data > buf->segment_end))
- return buf->segment_data[-1];
- XINE_HDMV_ERROR("segbuf_get_u8: read failed (end of segment reached) !\n");
- return 0;
-}
-
-static uint16_t segbuf_get_u16(segment_buffer_t *buf)
-{
- return (segbuf_get_u8(buf) << 8) | segbuf_get_u8(buf);
-}
-
-static uint32_t segbuf_get_u24(segment_buffer_t *buf)
-{
- return (segbuf_get_u8(buf) << 16) | (segbuf_get_u8(buf) << 8) | segbuf_get_u8(buf);
-}
-
-/*
- * decode segments
- */
-
-static subtitle_clut_t *segbuf_decode_palette(segment_buffer_t *buf)
-{
- uint8_t palette_id = segbuf_get_u8 (buf);
- uint8_t palette_version_number = segbuf_get_u8 (buf);
-
- size_t len = segbuf_data_length(buf);
- size_t entries = len / 5;
- size_t i;
-
- if (buf->error)
- return NULL;
-
- if (len % 5) {
- XINE_HDMV_ERROR(" decode_palette: segment size error (%zd ; expected %zd for %zd entries)\n",
- len, (5 * entries), entries);
- return NULL;
- }
- XINE_HDMV_TRACE("decode_palette: %zd items (id %d, version %d)\n",
- entries, palette_id, palette_version_number);
-
- /* convert to xine-lib clut */
- subtitle_clut_t *clut = calloc(1, sizeof(subtitle_clut_t));
- clut->id = palette_id;
-
- for (i = 0; i < entries; i++) {
- uint8_t index = segbuf_get_u8 (buf);
- uint8_t Y = segbuf_get_u8 (buf);
- uint8_t Cr = segbuf_get_u8 (buf);
- uint8_t Cb = segbuf_get_u8 (buf);
- uint8_t alpha = segbuf_get_u8 (buf);
- clut->color[index] = (Y << 16) | (Cr << 8) | Cb;
- clut->trans[index] = alpha >> 4;
- }
-
- return clut;
-}
-
-static int segbuf_decode_rle(segment_buffer_t *buf, subtitle_object_t *obj)
-{
- int x = 0, y = 0;
- int rle_size = sizeof(rle_elem_t) * obj->width / 16 * obj->height + 1;
- rle_elem_t *rlep = malloc(rle_size);
-
- free (obj->rle);
- obj->rle = rlep;
- obj->data_size = rle_size;
- obj->num_rle = 0;
-
- /* convert to xine-lib rle format */
- while (y < obj->height && !buf->error) {
-
- /* decode RLE element */
- uint8_t byte = segbuf_get_u8 (buf);
- if (byte != 0) {
- rlep->color = byte;
- rlep->len = 1;
- } else {
- byte = segbuf_get_u8 (buf);
- if (!(byte & 0x80)) {
- rlep->color = 0;
- if (!(byte & 0x40))
- rlep->len = byte & 0x3f;
- else
- rlep->len = ((byte & 0x3f) << 8) | segbuf_get_u8 (buf);
- } else {
- if (!(byte & 0x40))
- rlep->len = byte & 0x3f;
- else
- rlep->len = ((byte & 0x3f) << 8) | segbuf_get_u8 (buf);
- rlep->color = segbuf_get_u8 (buf);
- }
- }
-
- /* move to next element */
- if (rlep->len > 0) {
- x += rlep->len;
- rlep++;
- obj->num_rle ++;
- } else {
- /* end of line marker (00 00) */
- if (x < obj->width) {
- rlep->len = obj->width - x;
- rlep->color = 0xff;
- rlep++;
- obj->num_rle ++;
- }
- x = 0;
- y++;
- }
-
- /* grow allocated RLE data size ? */
- if (obj->data_size <= (obj->num_rle + 1) * sizeof(rle_elem_t)) {
- obj->data_size *= 2;
- obj->rle = realloc(obj->rle, obj->data_size);
- rlep = obj->rle + obj->num_rle;
- }
- }
-
- return buf->error;
-}
-
-static subtitle_object_t *segbuf_decode_object(segment_buffer_t *buf, subtitle_object_t *objects)
-{
- uint16_t object_id = segbuf_get_u16(buf);
- uint8_t version = segbuf_get_u8 (buf);
- uint8_t seq_desc = segbuf_get_u8 (buf);
-
- XINE_HDMV_TRACE(" decode_object: object_id %d, version %d, seq 0x%x\n",
- object_id, version, seq_desc);
-
- if (seq_desc & 0x80) {
- /* new object (first-in-sequence flag set) */
-
- subtitle_object_t *obj = calloc(1, sizeof(subtitle_object_t));
-
- obj->id = object_id;
- obj->data_len = segbuf_get_u24(buf);
- obj->width = segbuf_get_u16(buf);
- obj->height = segbuf_get_u16(buf);
-
- if (buf->error) {
- XINE_HDMV_TRACE(" decode error at object header\n");
- free_subtitle_object(obj);
- return NULL;
- }
-
- obj->data_len -= 4; /* width, height parsed */
-
- XINE_HDMV_TRACE(" object length %d bytes, size %dx%d\n", obj->data_len, obj->width, obj->height);
-
- if (obj->data_len > segbuf_data_length(buf)) {
- XINE_HDMV_TRACE(" object length %d bytes, have only %zd bytes -> missing %d bytes\n",
- obj->data_len, segbuf_data_length(buf), obj->data_len - (int)segbuf_data_length(buf));
-
- if (obj->raw_data)
- free(obj->raw_data);
-
- /* store partial RLE data in HDMV format */
- obj->raw_data_len = segbuf_data_length(buf);
- obj->raw_data_size = MAX(obj->data_len, obj->raw_data_len);
- obj->raw_data = malloc(obj->raw_data_size);
- memcpy(obj->raw_data, buf->segment_data, obj->raw_data_len);
-
- return obj;
- }
-
- segbuf_decode_rle (buf, obj);
-
- if (buf->error) {
- XINE_HDMV_TRACE(" decode error at RLE data\n");
- free_subtitle_object(obj);
- return NULL;
- }
-
- return obj;
- }
-
- /* not first-of-sequence --> append data to already existing objct */
-
- /* search for object */
- while (objects && objects->id != object_id)
- objects = objects->next;
-
- if (!objects) {
- XINE_HDMV_TRACE(" object not found from list, discarding segment\n");
- return NULL;
- }
-
- /* store partial RLE data in HDMV format */
- if (objects->raw_data_size < objects->raw_data_len + segbuf_data_length(buf)) {
- XINE_HDMV_ERROR("object larger than object size !\n");
- return NULL;
- }
- memcpy(objects->raw_data + objects->raw_data_len, buf->segment_data, segbuf_data_length(buf));
- objects->raw_data_len += segbuf_data_length(buf);
-
- /* if complete, decode RLE data */
- if (objects->raw_data_len >= objects->data_len) {
- /* create dummy buffer for segbuf_decode_rle */
- segment_buffer_t tmpbuf = {
- .segment_data = objects->raw_data,
- .segment_end = objects->raw_data + objects->raw_data_len,
- };
-
- /* decode RLE data */
- segbuf_decode_rle (&tmpbuf, objects);
-
- if (tmpbuf.error) {
- XINE_HDMV_TRACE(" error decoding multi-segment object\n");
- }
-
- /* free decode buffer */
- free(objects->raw_data);
- objects->raw_data = NULL;
- objects->raw_data_len = 0;
- objects->raw_data_size = 0;
- }
-
- return NULL;
-}
-
-static window_def_t *segbuf_decode_window_definition(segment_buffer_t *buf)
-{
- window_def_t *wnd = calloc(1, sizeof(window_def_t));
-
- uint8_t a = segbuf_get_u8 (buf);
- wnd->id = segbuf_get_u8 (buf);
- wnd->xpos = segbuf_get_u16 (buf);
- wnd->ypos = segbuf_get_u16 (buf);
- wnd->width = segbuf_get_u16 (buf);
- wnd->height = segbuf_get_u16 (buf);
-
- XINE_HDMV_TRACE(" window: [%02x %d] %d,%d %dx%d\n", a,
- wnd->id, wnd->xpos, wnd->ypos, wnd->width, wnd->height);
-
- if (buf->error) {
- free(wnd);
- return NULL;
- }
-
- return wnd;
-}
-
-static int segbuf_decode_video_descriptor(segment_buffer_t *buf)
-{
- uint16_t width = segbuf_get_u16(buf);
- uint16_t height = segbuf_get_u16(buf);
- uint8_t frame_rate = segbuf_get_u8 (buf);
-
- XINE_HDMV_TRACE(" video_descriptor: %dx%d fps %d\n", width, height, frame_rate);
-
- return buf->error;
-}
-
-static int segbuf_decode_composition_descriptor(segment_buffer_t *buf, composition_descriptor_t *descr)
-{
- descr->number = segbuf_get_u16(buf);
- descr->state = segbuf_get_u8 (buf) & 0xc0;
-
- XINE_HDMV_TRACE(" composition_descriptor: number %d, state %d\n", descr->number, descr->state);
- return buf->error;
-}
-
-static composition_object_t *segbuf_decode_composition_object(segment_buffer_t *buf)
-{
- composition_object_t *cobj = calloc(1, sizeof(composition_object_t));
-
- cobj->object_id_ref = segbuf_get_u16 (buf);
- cobj->window_id_ref = segbuf_get_u8 (buf);
- uint8_t tmp = segbuf_get_u8 (buf);
- cobj->cropped_flag = !!(tmp & 0x80);
- cobj->forced_flag = !!(tmp & 0x40);
- cobj->xpos = segbuf_get_u16 (buf);
- cobj->ypos = segbuf_get_u16 (buf);
- if (cobj->cropped_flag) {
- /* x,y where to take the image from */
- cobj->crop_horiz_pos = segbuf_get_u8 (buf);
- cobj->crop_vert_pos = segbuf_get_u8 (buf);
- /* size of the cropped image */
- cobj->crop_width = segbuf_get_u8 (buf);
- cobj->crop_height = segbuf_get_u8 (buf);
- }
-
- if (buf->error) {
- free(cobj);
- return NULL;
- }
-
- XINE_HDMV_TRACE(" composition_object: id: %d, win: %d, position %d,%d crop %d forced %d\n",
- cobj->object_id_ref, cobj->window_id_ref, cobj->xpos, cobj->ypos,
- cobj->cropped_flag, cobj->forced_flag);
-
- return cobj;
-}
-
-static presentation_segment_t *segbuf_decode_presentation_segment(segment_buffer_t *buf)
-{
- presentation_segment_t *seg = calloc(1, sizeof(presentation_segment_t));
- int index;
-
- segbuf_decode_video_descriptor (buf);
- segbuf_decode_composition_descriptor (buf, &seg->comp_descr);
-
- seg->palette_update_flag = !!((segbuf_get_u8(buf)) & 0x80);
- seg->palette_id_ref = segbuf_get_u8 (buf);
- seg->object_number = segbuf_get_u8 (buf);
-
- XINE_HDMV_TRACE(" presentation_segment: object_number %d, palette %d\n",
- seg->object_number, seg->palette_id_ref);
-
- for (index = 0; index < seg->object_number; index++) {
- composition_object_t *cobj = segbuf_decode_composition_object (buf);
- cobj->next = seg->comp_objs;
- seg->comp_objs = cobj;
- }
-
- if (buf->error) {
- free_presentation_segment(seg);
- return NULL;
- }
-
- return seg;
-}
-
-static rle_elem_t *copy_crop_rle(subtitle_object_t *obj, composition_object_t *cobj)
-{
- /* TODO: cropping (w,h sized image from pos x,y) */
-
- rle_elem_t *rle = calloc (obj->num_rle, sizeof(rle_elem_t));
- memcpy (rle, obj->rle, obj->num_rle * sizeof(rle_elem_t));
- return rle;
-}
-
-
-/*
- * xine plugin
- */
-
-typedef struct {
- spu_decoder_class_t decoder_class;
-} spuhdmv_class_t;
-
-typedef struct spuhdmv_decoder_s {
- spu_decoder_t spu_decoder;
-
- spuhdmv_class_t *class;
- xine_stream_t *stream;
-
- segment_buffer_t *buf;
-
- subtitle_clut_t *cluts;
- subtitle_object_t *objects;
- window_def_t *windows;
- presentation_segment_t *segments;
-
- int overlay_handles[MAX_OBJECTS];
-
- int64_t pts;
-
-} spuhdmv_decoder_t;
-
-static void free_objs(spuhdmv_decoder_t *this)
-{
- LIST_DESTROY (this->cluts, free);
- LIST_DESTROY (this->objects, free_subtitle_object);
- LIST_DESTROY (this->windows, free);
- LIST_DESTROY (this->segments, free_presentation_segment);
-}
-
-static int decode_palette(spuhdmv_decoder_t *this)
-{
- /* decode */
- subtitle_clut_t *clut = segbuf_decode_palette(this->buf);
- if (!clut)
- return 1;
-
- LIST_REPLACE (this->cluts, clut, free);
-
- return 0;
-}
-
-static int decode_object(spuhdmv_decoder_t *this)
-{
- /* decode */
- subtitle_object_t *obj = segbuf_decode_object(this->buf, this->objects);
- if (!obj)
- return 1;
-
- LIST_REPLACE (this->objects, obj, free_subtitle_object);
-
- return 0;
-}
-
-static int decode_window_definition(spuhdmv_decoder_t *this)
-{
- /* decode */
- window_def_t *wnd = segbuf_decode_window_definition (this->buf);
- if (!wnd)
- return 1;
-
- LIST_REPLACE (this->windows, wnd, free);
-
- return 0;
-}
-
-static int decode_presentation_segment(spuhdmv_decoder_t *this)
-{
- /* decode */
- presentation_segment_t *seg = segbuf_decode_presentation_segment(this->buf);
- if (!seg)
- return 1;
-
- seg->pts = this->pts;
-
- /* epoch start or acquistion point -> drop cached objects */
- if (seg->comp_descr.state) {
- free_objs(this);
- }
-
- /* replace */
- if (this->segments)
- LIST_DESTROY(this->segments, free_presentation_segment);
- this->segments = seg;
-
- return 0;
-}
-
-static int show_overlay(spuhdmv_decoder_t *this, composition_object_t *cobj, unsigned int palette_id_ref,
- int overlay_index, int64_t pts, int force_update)
-{
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager(this->stream->video_out);
- metronom_t *metronom = this->stream->metronom;
- video_overlay_event_t event = {0};
- vo_overlay_t overlay = {0};
-
- /* find palette */
- subtitle_clut_t *clut = this->cluts;
- while (clut && clut->id != palette_id_ref)
- clut = clut->next;
- if (!clut) {
- XINE_HDMV_TRACE(" show_overlay: clut %d not found !\n", palette_id_ref);
- return -1;
- }
-
- /* find RLE image */
- subtitle_object_t *obj = this->objects;
- while (obj && obj->id != cobj->object_id_ref)
- obj = obj->next;
- if (!obj) {
- XINE_HDMV_TRACE(" show_overlay: object %d not found !\n", cobj->object_id_ref);
- return -1;
- }
- if (!obj->rle) {
- XINE_HDMV_TRACE(" show_overlay: object %d RLE data not decoded !\n", cobj->object_id_ref);
- return -1;
- }
-
- /* find window */
- window_def_t *wnd = this->windows;
- while (wnd && wnd->id != cobj->window_id_ref)
- wnd = wnd->next;
- if (!wnd) {
- XINE_HDMV_TRACE(" show_overlay: window %d not found !\n", cobj->window_id_ref);
- return -1;
- }
-
- /* do not show again if all elements are unchanged */
- if (!force_update && clut->shown && obj->shown && wnd->shown && cobj->shown)
- return 0;
- clut->shown = obj->shown = wnd->shown = cobj->shown = 1;
-
- /* copy palette to xine overlay */
- overlay.rgb_clut = 0;
- memcpy(overlay.color, clut->color, sizeof(uint32_t) * 256);
- memcpy(overlay.trans, clut->trans, sizeof(uint8_t) * 256);
-
- /* copy and crop RLE image to xine overlay */
- overlay.width = obj->width;
- overlay.height = obj->height;
-
- overlay.rle = copy_crop_rle (obj, cobj);
- overlay.num_rle = obj->num_rle;
- overlay.data_size = obj->num_rle * sizeof(rle_elem_t);
-
- /* */
-
- overlay.x = /*wnd->xpos +*/ cobj->xpos;
- overlay.y = /*wnd->ypos +*/ cobj->ypos;
-
- overlay.unscaled = 0;
- overlay.hili_top = -1;
- overlay.hili_bottom = -1;
- overlay.hili_left = -1;
- overlay.hili_right = -1;
-
- XINE_HDMV_TRACE(" -> overlay: %d,%d %dx%d\n",
- overlay.x, overlay.y, overlay.width, overlay.height);
-
-
- /* set timings */
-
- if (pts > 0)
- event.vpts = metronom->got_spu_packet (metronom, pts);
- else
- event.vpts = 0;
-
-
- /* generate SHOW event */
-
- this->stream->video_out->enable_ovl(this->stream->video_out, 1);
-
- if (this->overlay_handles[overlay_index] < 0)
- this->overlay_handles[overlay_index] = ovl_manager->get_handle(ovl_manager, 0);
-
- event.event_type = OVERLAY_EVENT_SHOW;
- event.object.handle = this->overlay_handles[overlay_index];
- event.object.overlay = &overlay;
- event.object.object_type = 0; /* subtitle */
-
- ovl_manager->add_event (ovl_manager, (void *)&event);
-
- return 0;
-}
-
-static void hide_overlays(spuhdmv_decoder_t *this, int64_t pts)
-{
- video_overlay_event_t event = {0};
- int i = 0;
-
- while (this->overlay_handles[i] >= 0) {
- XINE_HDMV_TRACE(" -> HIDE %d\n", i);
-
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager(this->stream->video_out);
- metronom_t *metronom = this->stream->metronom;
-
- event.object.handle = this->overlay_handles[i];
- if (this)
- event.vpts = metronom->got_spu_packet (metronom, pts);
- else
- event.vpts = 0;
- event.event_type = OVERLAY_EVENT_HIDE;
- event.object.overlay = NULL;
- ovl_manager->add_event (ovl_manager, (void *)&event);
-
- //this->overlay_handles[i] = -1;
- i++;
- }
-}
-
-static void update_overlays(spuhdmv_decoder_t *this)
-{
- presentation_segment_t *pseg = this->segments;
-
- while (pseg) {
-
- if (!pseg->object_number) {
-
- /* HIDE */
- if (!pseg->shown)
- hide_overlays (this, pseg->pts);
-
- } else {
-
- /* SHOW */
- composition_object_t *cobj = pseg->comp_objs;
- int i;
-
- for (i = 0; i < pseg->object_number; i++) {
- if (!cobj) {
- XINE_HDMV_ERROR("show_overlays: composition object %d missing !\n", i);
- } else {
- show_overlay(this, cobj, pseg->palette_id_ref, i, pseg->pts, !pseg->shown);
- cobj = cobj->next;
- }
- }
- }
-
- pseg->shown = 1;
-
- pseg = pseg->next;
- }
-}
-
-static void decode_segment(spuhdmv_decoder_t *this)
-{
- XINE_HDMV_TRACE("*** new segment, pts %010"PRId64": 0x%02x (%8d bytes)\n",
- this->pts, this->buf->segment_type, this->buf->segment_len);
-
- switch (segbuf_segment_type(this->buf)) {
- case SEGTYPE_PALETTE:
- XINE_HDMV_TRACE(" segment: PALETTE\n");
- decode_palette(this);
- break;
- case SEGTYPE_OBJECT:
- XINE_HDMV_TRACE(" segment: OBJECT\n");
- decode_object(this);
- break;
- case SEGTYPE_PRESENTATION_SEGMENT:
- XINE_HDMV_TRACE(" segment: PRESENTATION SEGMENT\n");
- decode_presentation_segment(this);
- break;
- case SEGTYPE_WINDOW_DEFINITION:
- XINE_HDMV_TRACE(" segment: WINDOW DEFINITION\n");
- decode_window_definition(this);
- break;
- case SEGTYPE_INTERACTIVE:
- XINE_HDMV_TRACE(" segment: INTERACTIVE\n");
- break;
- case SEGTYPE_END_OF_DISPLAY:
- XINE_HDMV_TRACE(" segment: END OF DISPLAY\n");
-#if 0
- /* drop all cached objects */
- free_objs(this);
-#endif
- break;
- default:
- XINE_HDMV_ERROR(" segment type 0x%x unknown, skipping\n", segbuf_segment_type(this->buf));
- break;
- }
- if (this->buf->error) {
- XINE_HDMV_ERROR("*** DECODE ERROR ***\n");
- }
-
- update_overlays (this);
-}
-
-static void close_osd(spuhdmv_decoder_t *this)
-{
- video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
-
- int i = 0;
- while (this->overlay_handles[i] >= 0) {
- ovl_manager->free_handle(ovl_manager, this->overlay_handles[i]);
- this->overlay_handles[i] = -1;
- i++;
- }
-}
-
-static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf)
-{
- spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
-
- if ((buf->type & 0xffff0000) != BUF_SPU_HDMV)
- return;
-
- if (buf->size < 1)
- return;
-
- if (buf->pts)
- this->pts = buf->pts;
-
-#ifdef DUMP_SPU_DATA
- int i;
- for(i = 0; i < buf->size; i++)
- printf(" %02x", buf->content[i]);
- printf("\n");
-#endif
-
- segbuf_fill(this->buf, buf->content, buf->size);
-
- while (segbuf_segment_complete(this->buf)) {
- decode_segment(this);
- segbuf_skip_segment(this->buf);
- }
-}
-
-static void spudec_reset (spu_decoder_t * this_gen)
-{
- spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
-
- if (this->buf)
- segbuf_reset(this->buf);
-
- free_objs(this);
-
- close_osd(this);
-}
-
-static void spudec_discontinuity (spu_decoder_t *this_gen)
-{
- spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
-
- close_osd(this);
-}
-
-static void spudec_dispose (spu_decoder_t *this_gen)
-{
- spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
-
- close_osd (this);
- segbuf_dispose (this->buf);
-
- free_objs(this);
-
- free (this);
-}
-
-static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream)
-{
- spuhdmv_decoder_t *this;
-
- this = (spuhdmv_decoder_t *) calloc(1, sizeof (spuhdmv_decoder_t));
-
- this->spu_decoder.decode_data = spudec_decode_data;
- this->spu_decoder.reset = spudec_reset;
- this->spu_decoder.discontinuity = spudec_discontinuity;
- this->spu_decoder.dispose = spudec_dispose;
- this->spu_decoder.get_interact_info = NULL;
- this->spu_decoder.set_button = NULL;
- this->stream = stream;
- this->class = (spuhdmv_class_t *) class_gen;
-
- this->buf = segbuf_init();
-
- memset(this->overlay_handles, 0xff, sizeof(this->overlay_handles)); /* --> -1 */
-
- return &this->spu_decoder;
-}
-
-static char *get_identifier (spu_decoder_class_t *this)
-{
- return "spuhdmv";
-}
-
-static char *get_description (spu_decoder_class_t *this)
-{
- return "HDMV/BluRay bitmap SPU decoder plugin";
-}
-
-static void dispose_class (spu_decoder_class_t *this)
-{
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data)
-{
- spuhdmv_class_t *this;
-
- this = calloc(1, sizeof (spuhdmv_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_HDMV, 0 };
-
-static const decoder_info_t dec_info_data = {
- supported_types, /* supported types */
- 5 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER, 16, "spuhdmv", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libsputext/Makefile.am b/src/libsputext/Makefile.am
deleted file mode 100644
index ad6c1b776..000000000
--- a/src/libsputext/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-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/demux_sputext.c b/src/libsputext/demux_sputext.c
deleted file mode 100644
index dd5958044..000000000
--- a/src/libsputext/demux_sputext.c
+++ /dev/null
@@ -1,1493 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * code based on old libsputext/xine_decoder.c
- *
- * code based on mplayer module:
- *
- * Subtitle reader with format autodetection
- *
- * Written by laaz
- * Some code cleanup & realloc() by A'rpi/ESP-team
- * dunnowhat sub format by szabi
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#define LOG_MODULE "demux_sputext"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "../demuxers/demux.h"
-
-#define ERR (void *)-1
-#define SUB_MAX_TEXT 5
-#define SUB_BUFSIZE 1024
-#define LINE_LEN 1000
-#define LINE_LEN_QUOT "1000"
-
-/*
- * Demuxer typedefs
- */
-
-typedef struct {
-
- int lines;
-
- long start; /* csecs */
- long end; /* csecs */
-
- char *text[SUB_MAX_TEXT];
-
-} subtitle_t;
-
-
-typedef struct {
-
- demux_plugin_t demux_plugin;
- xine_stream_t *stream;
- input_plugin_t *input;
-
- int status;
-
- char buf[SUB_BUFSIZE];
- off_t buflen;
-
- float mpsub_position;
-
- int uses_time;
- int errs;
- subtitle_t *subtitles;
- int num; /* number of subtitle structs */
- int cur; /* current subtitle */
- int format; /* constants see below */
- char next_line[SUB_BUFSIZE]; /* a buffer for next line read from file */
-
-} demux_sputext_t;
-
-typedef struct demux_sputext_class_s {
-
- demux_class_t demux_class;
-
- int max_timeout; /* default timeout of hidding subtitles */
-
-} demux_sputext_class_t;
-
-/*
- * Demuxer code start
- */
-
-#define FORMAT_UNKNOWN -1
-#define FORMAT_MICRODVD 0
-#define FORMAT_SUBRIP 1
-#define FORMAT_SUBVIEWER 2
-#define FORMAT_SAMI 3
-#define FORMAT_VPLAYER 4
-#define FORMAT_RT 5
-#define FORMAT_SSA 6 /* Sub Station Alpha */
-#define FORMAT_PJS 7
-#define FORMAT_MPSUB 8
-#define FORMAT_AQTITLE 9
-#define FORMAT_JACOBSUB 10
-#define FORMAT_SUBVIEWER2 11
-#define FORMAT_SUBRIP09 12
-#define FORMAT_MPL2 13 /*Mplayer sub 2 ?*/
-
-static int eol(char p) {
- return (p=='\r' || p=='\n' || p=='\0');
-}
-
-static inline void trail_space(char *s) {
- while (isspace(*s)) {
- char *copy = s;
- do {
- copy[0] = copy[1];
- copy++;
- } while(*copy);
- }
- size_t i = strlen(s) - 1;
- while (i > 0 && isspace(s[i]))
- s[i--] = '\0';
-}
-
-/*
- * Reimplementation of fgets() using the input->read() method.
- */
-static char *read_line_from_input(demux_sputext_t *this, char *line, off_t len) {
- off_t nread = 0;
-
- if ((len - this->buflen) > 512 && len < SUB_BUFSIZE) {
- if((nread = this->input->read(this->input,
- &this->buf[this->buflen], len - this->buflen)) < 0) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "read failed.\n");
- return NULL;
- }
- }
-
- this->buflen += nread;
- this->buf[this->buflen] = '\0';
-
- char *s = strchr(this->buf, '\n');
-
- if (line && (s || this->buflen)) {
-
- size_t linelen = s ? (s - this->buf) + 1 : this->buflen;
-
- memcpy(line, this->buf, linelen);
- line[linelen] = '\0';
-
- memmove(this->buf, &this->buf[linelen], SUB_BUFSIZE - linelen);
- this->buflen -= linelen;
-
- return line;
- }
-
- return NULL;
-}
-
-
-static subtitle_t *sub_read_line_sami(demux_sputext_t *this, subtitle_t *current) {
-
- static char line[LINE_LEN + 1];
- static char *s = NULL;
- char text[LINE_LEN + 1];
-
- char *p = NULL;
- current->lines = current->start = 0;
- current->end = -1;
- int state = 0;
-
- /* read the first line */
- if (!s)
- if (!(s = read_line_from_input(this, line, LINE_LEN))) return 0;
-
- do {
- switch (state) {
-
- case 0: /* find "START=" */
- s = strstr (s, "Start=");
- if (s) {
- current->start = strtol (s + 6, &s, 0) / 10;
- state = 1; continue;
- }
- break;
-
- case 1: /* find "<P" */
- if ((s = strstr (s, "<P"))) { s += 2; state = 2; continue; }
- break;
-
- case 2: /* find ">" */
- if ((s = strchr (s, '>'))) { s++; state = 3; p = text; continue; }
- break;
-
- case 3: /* get all text until '<' appears */
- if (*s == '\0') { break; }
- else if (*s == '<') { state = 4; }
- else if (!strncasecmp (s, "&nbsp;", 6)) { *p++ = ' '; s += 6; }
- else if (*s == '\r') { s++; }
- else if (!strncasecmp (s, "<br>", 4) || *s == '\n') {
- *p = '\0'; p = text; trail_space (text);
- if (text[0] != '\0')
- current->text[current->lines++] = strdup (text);
- if (*s == '\n') s++; else s += 4;
- }
- else *p++ = *s++;
- continue;
-
- case 4: /* get current->end or skip <TAG> */
- {
- char *q = strstr (s, "Start=");
- if (q) {
- current->end = strtol (q + 6, &q, 0) / 10 - 1;
- *p = '\0'; trail_space (text);
- if (text[0] != '\0')
- current->text[current->lines++] = strdup (text);
- if (current->lines > 0) { state = 99; break; }
- state = 0; continue;
- }
- }
- s = strchr (s, '>');
- if (s) { s++; state = 3; continue; }
- break;
- }
-
- /* read next line */
- if (state != 99 && !(s = read_line_from_input (this, line, LINE_LEN)))
- return 0;
-
- } while (state != 99);
-
- return current;
-}
-
-
-static char *sub_readtext(char *source, char **dest) {
- size_t len=0;
- char *p=source;
-
- while ( !eol(*p) && *p!= '|' ) {
- p++,len++;
- }
-
- *dest = strndup(source, len);
-
- while (*p=='\r' || *p=='\n' || *p=='|')
- p++;
-
- if (*p) return p; /* not-last text field */
- else return NULL; /* last text field */
-}
-
-static subtitle_t *sub_read_line_microdvd(demux_sputext_t *this, subtitle_t *current) {
-
- char line[LINE_LEN + 1];
- char line2[LINE_LEN + 1];
-
- memset (current, 0, sizeof(subtitle_t));
-
- current->end=-1;
- do {
- if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
- } while ((sscanf (line, "{%ld}{}%" LINE_LEN_QUOT "[^\r\n]", &(current->start), line2) !=2) &&
- (sscanf (line, "{%ld}{%ld}%" LINE_LEN_QUOT "[^\r\n]", &(current->start), &(current->end),line2) !=3)
- );
-
- char *p=line2;
-
- char *next=p;
- size_t i=0;
- while ((next =sub_readtext (next, &(current->text[i])))) {
- if (current->text[i]==ERR) return ERR;
- i++;
- if (i>=SUB_MAX_TEXT) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- current->lines=i;
- return current;
- }
- }
- current->lines= ++i;
-
- return current;
-}
-
-static subtitle_t *sub_read_line_subviewer(demux_sputext_t *this, subtitle_t *current) {
- char line[LINE_LEN + 1];
-
- memset (current, 0, sizeof(subtitle_t));
-
- while (1) {
- if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
-
- {
- int a1,a2,a3,a4,b1,b2,b3,b4;
- if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8) {
- if (sscanf (line, "%d:%d:%d,%d,%d:%d:%d,%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8)
- continue;
- }
-
- current->start = a1*360000+a2*6000+a3*100+a4;
- current->end = b1*360000+b2*6000+b3*100+b4;
- }
-
- if (!read_line_from_input(this, line, LINE_LEN))
- return NULL;
-
- char *p = line, *q = line;
- for (current->lines=1; current->lines <= SUB_MAX_TEXT; current->lines++) {
- size_t len;
- for (q=p,len=0; *p && *p!='\r' && *p!='\n' && *p!='|' && strncasecmp(p,"[br]",4); p++,len++);
- current->text[current->lines-1] = strndup(q, len);
- if (!current->text[current->lines-1]) return ERR;
- if (!*p || *p=='\r' || *p=='\n') break;
- if (*p=='[') while (*p++!=']');
- if (*p=='|') p++;
- }
- if (current->lines > SUB_MAX_TEXT) current->lines = SUB_MAX_TEXT;
- break;
- }
- return current;
-}
-
-static subtitle_t *sub_read_line_subrip(demux_sputext_t *this,subtitle_t *current) {
- memset(current,0,sizeof(subtitle_t));
-
- {
- int a1,a2,a3,a4,b1,b2,b3,b4,i;
- do {
- char line[LINE_LEN + 1];
- if(!read_line_from_input(this,line,LINE_LEN))
- return NULL;
- i = sscanf(line,"%d:%d:%d%*[,.]%d --> %d:%d:%d%*[,.]%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
- } while(i < 8);
- current->start = a1*360000+a2*6000+a3*100+a4/10;
- current->end = b1*360000+b2*6000+b3*100+b4/10;
- }
-
- int i=0;
- int end_sub=0;
- do {
- char *p; /* pointer to the curently read char */
- char line[LINE_LEN + 1];
- char temp_line[SUB_BUFSIZE] = { 0, }; /* subtitle line that will be transfered to current->text[i] */
- size_t temp_index; /* ... and its index wich 'points' to the first EMPTY place -> last read char is at temp_index-1 if temp_index>0 */
- if(!read_line_from_input(this,line,LINE_LEN)) {
- if(i)
- break; /* if something was read, transmit it */
- else
- return NULL; /* if not, repport EOF */
- }
- for(temp_index=0,p=line;*p!='\0' && !end_sub && temp_index<SUB_BUFSIZE && i<SUB_MAX_TEXT;p++) {
- switch(*p) {
- case '\\':
- if(*(p+1)=='N' || *(p+1)=='n') {
- temp_line[temp_index++]='\0'; /* end of curent line */
- p++;
- } else
- temp_line[temp_index++]=*p;
- break;
- case '\r': /* just ignore '\r's */
- break;
- case '\n':
- temp_line[temp_index++]='\0';
- break;
- default:
- temp_line[temp_index++]=*p;
- break;
- }
- if(temp_index>0) {
- if(temp_index==SUB_BUFSIZE)
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many characters in a subtitle line\n");
- if(temp_line[temp_index-1]=='\0' || temp_index==SUB_BUFSIZE) {
- if(temp_index>1) { /* more than 1 char (including '\0') -> that is a valid one */
- /* temp_index<=SUB_BUFSIZE is always true here */
- current->text[i] = strndup(temp_line, temp_index);
- if(!current->text[i])
- return ERR;
- i++;
- temp_index=0;
- } else
- end_sub=1;
- }
- }
- }
- } while(i<SUB_MAX_TEXT && !end_sub);
- if(i>=SUB_MAX_TEXT)
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- current->lines=i;
- return current;
-}
-
-static subtitle_t *sub_read_line_vplayer(demux_sputext_t *this,subtitle_t *current) {
- char line[LINE_LEN + 1];
-
- memset (current, 0, sizeof(subtitle_t));
-
- while (!current->text[0]) {
- if( this->next_line[0] == '\0' ) { /* if the buffer is empty.... */
- if( !read_line_from_input(this, line, LINE_LEN) ) return NULL;
- } else {
- /* ... get the current line from buffer. */
- strncpy( line, this->next_line, LINE_LEN);
- line[LINE_LEN] = '\0'; /* I'm scared. This makes me feel better. */
- this->next_line[0] = '\0'; /* mark the buffer as empty. */
- }
- /* Initialize buffer with next line */
- if( ! read_line_from_input( this, this->next_line, LINE_LEN) ) {
- this->next_line[0] = '\0';
- return NULL;
- }
-
- {
- int a1,a2,a3,b1,b2,b3;
- if( (sscanf( line, "%d:%d:%d:", &a1, &a2, &a3) < 3) ||
- (sscanf( this->next_line, "%d:%d:%d:", &b1, &b2, &b3) < 3) )
- continue;
- current->start = a1*360000+a2*6000+a3*100;
- current->end = b1*360000+b2*6000+b3*100;
- }
-
- if ((current->end - current->start) > LINE_LEN)
- current->end = current->start + LINE_LEN; /* not too long though. */
- /* teraz czas na wkopiowanie stringu */
- char *p=line;
- /* finds the body of the subtitle_t */
- {
- int i;
- for (i=0; i<3; i++){
- char *p2=strchr( p, ':');
- if( p2 == NULL ) break;
- p=p2+1;
- }
- }
-
- char *next=p;
- int i=0;
- while( (next = sub_readtext( next, &(current->text[i]))) ) {
- if (current->text[i]==ERR)
- return ERR;
- i++;
- if (i>=SUB_MAX_TEXT) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- current->lines=i;
- return current;
- }
- }
- current->lines=++i;
- }
- return current;
-}
-
-static subtitle_t *sub_read_line_rt(demux_sputext_t *this,subtitle_t *current) {
- /*
- * TODO: This format uses quite rich (sub/super)set of xhtml
- * I couldn't check it since DTD is not included.
- * WARNING: full XML parses can be required for proper parsing
- */
- memset (current, 0, sizeof(subtitle_t));
-
- while (!current->text[0]) {
- char line[LINE_LEN + 1];
- if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
-
- char *p = line;
- /*
- * TODO: it seems that format of time is not easily determined, it may be 1:12, 1:12.0 or 0:1:12.0
- * to describe the same moment in time. Maybe there are even more formats in use.
- */
- {
- int a1,a2,a3,a4,b1,b2,b3,b4,len,plen;
- if ((len=sscanf (line, "<Time Begin=\"%d:%d:%d.%d\" End=\"%d:%d:%d.%d\"",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8)
-
- a1=a2=a3=a4=b1=b2=b3=b4=0;
- if (
- ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d\" %*[Ee]nd=\"%d:%d\"%*[^<]<clear/>%n",&a2,&a3,&b2,&b3,&plen)) < 4) &&
- ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d\" %*[Ee]nd=\"%d:%d.%d\"%*[^<]<clear/>%n",&a2,&a3,&b2,&b3,&b4,&plen)) < 5) &&
- /* ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d.%d\" %*[Ee]nd=\"%d:%d\"%*[^<]<clear/>%n",&a2,&a3,&a4,&b2,&b3,&plen)) < 5) && */
- ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d.%d\" %*[Ee]nd=\"%d:%d.%d\"%*[^<]<clear/>%n",&a2,&a3,&a4,&b2,&b3,&b4,&plen)) < 6) &&
- ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d:%d.%d\" %*[Ee]nd=\"%d:%d:%d.%d\"%*[^<]<clear/>%n",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4,&plen)) < 8)
- )
- continue;
-
- current->start = a1*360000+a2*6000+a3*100+a4/10;
- current->end = b1*360000+b2*6000+b3*100+b4/10;
-
- p += plen;
- }
-
- int i=0;
- /* TODO: I don't know what kind of convention is here for marking multiline subs, maybe <br/> like in xml? */
- char *next = strstr(line,"<clear/>")+8;i=0;
- while ((next =sub_readtext (next, &(current->text[i])))) {
- if (current->text[i]==ERR)
- return ERR;
- i++;
- if (i>=SUB_MAX_TEXT) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- current->lines=i;
- return current;
- }
- }
- current->lines=i+1;
- }
- return current;
-}
-
-static subtitle_t *sub_read_line_ssa(demux_sputext_t *this,subtitle_t *current) {
- static int max_comma = 32; /* let's use 32 for the case that the */
- /* amount of commas increase with newer SSA versions */
-
- int hour1, min1, sec1, hunsec1, hour2, min2, sec2, hunsec2, nothing;
- char line3[LINE_LEN + 1];
-
- {
- char line[LINE_LEN + 1];
- do {
- if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
- } while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d,"
- "%[^\n\r]", &nothing,
- &hour1, &min1, &sec1, &hunsec1,
- &hour2, &min2, &sec2, &hunsec2,
- line3) < 9
- &&
- sscanf (line, "Dialogue: %d,%d:%d:%d.%d,%d:%d:%d.%d,"
- "%[^\n\r]", &nothing,
- &hour1, &min1, &sec1, &hunsec1,
- &hour2, &min2, &sec2, &hunsec2,
- line3) < 9 );
- }
-
- char *line2=strchr(line3, ',');
- if (!line2)
- return NULL;
-
- int comma;
- for (comma = 4; comma < max_comma; comma ++) {
- char *tmp = line2;
- if(!(tmp=strchr(++tmp, ','))) break;
- if(*(++tmp) == ' ') break;
- /* a space after a comma means we're already in a sentence */
- line2 = tmp;
- }
-
- if(comma < max_comma)max_comma = comma;
- /* eliminate the trailing comma */
- if(*line2 == ',') line2++;
-
- current->lines=0;
- current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1;
- current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2;
-
- int num=0;
- char *tmp;
- while (((tmp=strstr(line2, "\\n")) != NULL) || ((tmp=strstr(line2, "\\N")) != NULL) ){
- current->text[num] = strndup(line2, tmp-line2);
- line2=tmp+2;
- num++;
- current->lines++;
- if (current->lines >= SUB_MAX_TEXT) return current;
- }
-
- current->text[num]=strdup(line2);
- current->lines++;
-
- return current;
-}
-
-/* Sylvain "Skarsnik" Colinet <scolinet@gmail.com>
- * From MPlayer subreader.c :
- *
- * PJS subtitles reader.
- * That's the "Phoenix Japanimation Society" format.
- * I found some of them in http://www.scriptsclub.org/ (used for anime).
- * The time is in tenths of second.
- *
- * by set, based on code by szabi (dunnowhat sub format ;-)
- */
-
-static subtitle_t *sub_read_line_pjs (demux_sputext_t *this, subtitle_t *current) {
- char line[LINE_LEN + 1];
- char *s;
-
- memset (current, 0, sizeof(subtitle_t));
-
- if (!read_line_from_input(this, line, LINE_LEN))
- return NULL;
- for (s = line; *s && isspace(*s); s++);
- if (*s == 0)
- return NULL;
- if (sscanf (line, "%ld,%ld,", &(current->start),
- &(current->end)) <2)
- return ERR;
- /* the files I have are in tenths of second */
- current->start *= 10;
- current->end *= 10;
-
- /* walk to the beggining of the string */
- for (; *s; s++) if (*s==',') break;
- if (*s) {
- for (s++; *s; s++) if (*s==',') break;
- if (*s) s++;
- }
- if (*s!='"') {
- return ERR;
- }
- /* copy the string to the text buffer */
- char text[LINE_LEN + 1];
- char *d = NULL;
- for (s++, d=text; *s && *s!='"'; s++, d++)
- *d=*s;
- *d=0;
- current->text[0] = strdup(text);
- current->lines = 1;
-
- return current;
-}
-
-static subtitle_t *sub_read_line_mpsub (demux_sputext_t *this, subtitle_t *current) {
- char line[LINE_LEN + 1];
-
- {
- float a,b;
- do {
- if (!read_line_from_input(this, line, LINE_LEN))
- return NULL;
- } while (sscanf (line, "%f %f", &a, &b) !=2);
-
- this->mpsub_position += (a*100.0);
- current->start = (int) this->mpsub_position;
- this->mpsub_position += (b*100.0);
- current->end = (int) this->mpsub_position;
- }
-
- int num = 0;
- while (num < SUB_MAX_TEXT) {
- if (!read_line_from_input(this, line, LINE_LEN))
- return NULL;
-
- char *p=line;
- while (isspace(*p))
- p++;
-
- if (eol(*p) && num > 0)
- return current;
-
- if (eol(*p))
- return NULL;
-
- char *q;
- for (q=p; !eol(*q); q++);
- *q='\0';
- if (*p) {
- current->text[num]=strdup(p);
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, ">%s<\n",p);
- current->lines = ++num;
- } else {
- return num ? current : NULL;
- }
- }
-
- return NULL;
-}
-
-static subtitle_t *sub_read_line_aqt (demux_sputext_t *this, subtitle_t *current) {
- memset (current, 0, sizeof(subtitle_t));
-
- while (1) {
- char line[LINE_LEN + 1];
- /* try to locate next subtitle_t */
- if (!read_line_from_input(this, line, LINE_LEN))
- return NULL;
- if (!(sscanf (line, "-->> %ld", &(current->start)) <1))
- break;
- }
-
- char line[LINE_LEN + 1];
- if (!read_line_from_input(this, line, LINE_LEN))
- return NULL;
-
- sub_readtext((char *) &line,&current->text[0]);
- current->lines = 1;
- current->end = -1;
-
- if (!read_line_from_input(this, line, LINE_LEN))
- return current;;
-
- sub_readtext((char *) &line,&current->text[1]);
- current->lines = 2;
-
- if ((current->text[0][0]==0) && (current->text[1][0]==0)) {
- return NULL;
- }
-
- return current;
-}
-
-static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *current) {
- char line1[LINE_LEN] = { 0, }, line2[LINE_LEN] = { 0, }, directive[LINE_LEN] = { 0, }, *p, *q;
- unsigned a1, a2, a3, a4, b1, b2, b3, b4, comment = 0;
- static unsigned jacoTimeres = 30;
- static int jacoShift = 0;
-
- memset(current, 0, sizeof(subtitle_t));
- while (!current->text[0]) {
- if (!read_line_from_input(this, line1, LINE_LEN)) {
- return NULL;
- }
- if (sscanf
- (line1, "%u:%u:%u.%u %u:%u:%u.%u %" LINE_LEN_QUOT "[^\n\r]", &a1, &a2, &a3, &a4,
- &b1, &b2, &b3, &b4, line2) < 9) {
- if (sscanf(line1, "@%u @%u %" LINE_LEN_QUOT "[^\n\r]", &a4, &b4, line2) < 3) {
- if (line1[0] == '#') {
- int hours = 0, minutes = 0, seconds, delta, inverter =
- 1;
- unsigned units = jacoShift;
- switch (toupper(line1[1])) {
- case 'S':
- if (isalpha(line1[2])) {
- delta = 6;
- } else {
- delta = 2;
- }
- if (sscanf(&line1[delta], "%d", &hours)) {
- if (hours < 0) {
- hours *= -1;
- inverter = -1;
- }
- if (sscanf(&line1[delta], "%*d:%d", &minutes)) {
- if (sscanf
- (&line1[delta], "%*d:%*d:%d",
- &seconds)) {
- sscanf(&line1[delta], "%*d:%*d:%*d.%d",
- &units);
- } else {
- hours = 0;
- sscanf(&line1[delta], "%d:%d.%d",
- &minutes, &seconds, &units);
- minutes *= inverter;
- }
- } else {
- hours = minutes = 0;
- sscanf(&line1[delta], "%d.%d", &seconds,
- &units);
- seconds *= inverter;
- }
- jacoShift =
- ((hours * 3600 + minutes * 60 +
- seconds) * jacoTimeres +
- units) * inverter;
- }
- break;
- case 'T':
- if (isalpha(line1[2])) {
- delta = 8;
- } else {
- delta = 2;
- }
- sscanf(&line1[delta], "%u", &jacoTimeres);
- break;
- }
- }
- continue;
- } else {
- current->start =
- (unsigned long) ((a4 + jacoShift) * 100.0 /
- jacoTimeres);
- current->end =
- (unsigned long) ((b4 + jacoShift) * 100.0 /
- jacoTimeres);
- }
- } else {
- current->start =
- (unsigned
- long) (((a1 * 3600 + a2 * 60 + a3) * jacoTimeres + a4 +
- jacoShift) * 100.0 / jacoTimeres);
- current->end =
- (unsigned
- long) (((b1 * 3600 + b2 * 60 + b3) * jacoTimeres + b4 +
- jacoShift) * 100.0 / jacoTimeres);
- }
- current->lines = 0;
- p = line2;
- while ((*p == ' ') || (*p == '\t')) {
- ++p;
- }
- if (isalpha(*p)||*p == '[') {
- if (sscanf(p, "%s %" LINE_LEN_QUOT "[^\n\r]", directive, line1) < 2)
- return ERR;
- if ((strcasestr(directive, "RDB") != NULL)
- || (strcasestr(directive, "RDC") != NULL)
- || (strcasestr(directive, "RLB") != NULL)
- || (strcasestr(directive, "RLG") != NULL)) {
- continue;
- }
- /* no alignment */
-#if 0
- if (strcasestr(directive, "JL") != NULL) {
- current->alignment = SUB_ALIGNMENT_HLEFT;
- } else if (strcasestr(directive, "JR") != NULL) {
- current->alignment = SUB_ALIGNMENT_HRIGHT;
- } else {
- current->alignment = SUB_ALIGNMENT_HCENTER;
- }
-#endif
- strcpy(line2, line1);
- p = line2;
- }
- for (q = line1; (!eol(*p)) && (current->lines < SUB_MAX_TEXT); ++p) {
- switch (*p) {
- case '{':
- comment++;
- break;
- case '}':
- if (comment) {
- --comment;
- /* the next line to get rid of a blank after the comment */
- if ((*(p + 1)) == ' ')
- p++;
- }
- break;
- case '~':
- if (!comment) {
- *q = ' ';
- ++q;
- }
- break;
- case ' ':
- case '\t':
- if ((*(p + 1) == ' ') || (*(p + 1) == '\t'))
- break;
- if (!comment) {
- *q = ' ';
- ++q;
- }
- break;
- case '\\':
- if (*(p + 1) == 'n') {
- *q = '\0';
- q = line1;
- current->text[current->lines++] = strdup(line1);
- ++p;
- break;
- }
- if ((toupper(*(p + 1)) == 'C')
- || (toupper(*(p + 1)) == 'F')) {
- ++p,++p;
- break;
- }
- if ((*(p + 1) == 'B') || (*(p + 1) == 'b') ||
- /* actually this means "insert current date here" */
- (*(p + 1) == 'D') ||
- (*(p + 1) == 'I') || (*(p + 1) == 'i') ||
- (*(p + 1) == 'N') ||
- /* actually this means "insert current time here" */
- (*(p + 1) == 'T') ||
- (*(p + 1) == 'U') || (*(p + 1) == 'u')) {
- ++p;
- break;
- }
- if ((*(p + 1) == '\\') ||
- (*(p + 1) == '~') || (*(p + 1) == '{')) {
- ++p;
- } else if (eol(*(p + 1))) {
- if (!read_line_from_input(this, directive, LINE_LEN))
- return NULL;
- trail_space(directive);
- strncat(line2, directive,
- ((LINE_LEN > 511) ? LINE_LEN-1 : 511)
- - strlen(line2));
- break;
- }
- default:
- if (!comment) {
- *q = *p;
- ++q;
- }
- }
- }
- *q = '\0';
- if (current->lines < SUB_MAX_TEXT)
- current->text[current->lines] = strdup(line1);
- else
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- }
- current->lines++;
- return current;
-}
-
-static subtitle_t *sub_read_line_subviewer2(demux_sputext_t *this, subtitle_t *current) {
- char *p=NULL;
-
- while (!current->text[0]) {
- char line[LINE_LEN+1];
- if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
- if (line[0]!='{')
- continue;
-
- {
- int a1,a2,a3,a4;
- const int len = sscanf (line, "{T %d:%d:%d:%d",&a1,&a2,&a3,&a4);
- if (len < 4)
- continue;
- current->start = a1*360000+a2*6000+a3*100+a4/10;
- }
-
- int i;
- for (i=0; i<SUB_MAX_TEXT;) {
- if (!read_line_from_input(this, line, LINE_LEN)) break;
- if (line[0]=='}') break;
- size_t len=0;
- for (p=line; *p!='\n' && *p!='\r' && *p; ++p,++len);
- if (len) {
- current->text[i] = strndup(line, len);
- if (!current->text[i]) return ERR;
- ++i;
- } else {
- break;
- }
- }
- current->lines=i;
- }
- return current;
-}
-
-static subtitle_t *sub_read_line_subrip09 (demux_sputext_t *this, subtitle_t *current) {
- memset (current, 0, sizeof(subtitle_t));
-
- int h, m, s;
- {
- char line[LINE_LEN + 1];
- do {
- if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
- } while (sscanf (line, "[%d:%d:%d]", &h, &m, &s) != 3);
- }
-
- char line[LINE_LEN + 1];
- if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
-
- current->start = 360000 * h + 6000 * m + 100 * s;
- current->end = -1;
-
- char *next = line;
- int i=0;
- while ((next = sub_readtext (next, &(current->text[i])))) {
- if (current->text[i]==ERR) return ERR;
- i++;
- if (i>=SUB_MAX_TEXT) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- current->lines=i;
- return current;
- }
- }
- current->lines= ++i;
-
- return current;
-}
-
-/* Code from subreader.c of MPlayer
-** Sylvain "Skarsnik" Colinet <scolinet@gmail.com>
-*/
-
-static subtitle_t *sub_read_line_mpl2(demux_sputext_t *this, subtitle_t *current) {
- char line2[LINE_LEN+1];
-
- memset (current, 0, sizeof(subtitle_t));
-
- {
- char line[LINE_LEN+1];
- long start, end;
-
- do {
- if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
- } while ((sscanf (line,
- "[%ld][%ld]%[^\r\n]",
- &start, &end, line2) < 3));
-
- current->start = start * 10;
- current->end = end * 10;
- }
-
- char *p = line2, *next = p;
- int i = 0;
-
- while ((next = sub_readtext (next, &(current->text[i])))) {
- if (current->text[i] == ERR) {return ERR;}
- i++;
- if (i >= SUB_MAX_TEXT) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
- current->lines = i;
- return current;
- }
- }
- current->lines= ++i;
-
- return current;
-}
-
-
-
-static int sub_autodetect (demux_sputext_t *this) {
- int j;
- for(j = 1; j < 100; j++) {
- char line[LINE_LEN + 1];
- if (!read_line_from_input(this, line, LINE_LEN))
- return FORMAT_UNKNOWN;
-
- int i;
- if ((sscanf (line, "{%d}{}", &i)==1) ||
- (sscanf (line, "{%d}{%d}", &i, &i)==2)) {
- this->uses_time=0;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "microdvd subtitle format detected\n");
- return FORMAT_MICRODVD;
- }
-
- if (sscanf (line, "%d:%d:%d%*[,.]%d --> %d:%d:%d%*[,.]%d", &i, &i, &i, &i, &i, &i, &i, &i)==8) {
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subrip subtitle format detected\n");
- return FORMAT_SUBRIP;
- }
-
- if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d", &i, &i, &i, &i, &i, &i, &i, &i)==8){
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer subtitle format detected\n");
- return FORMAT_SUBVIEWER;
- }
-
- if (sscanf (line, "%d:%d:%d,%d,%d:%d:%d,%d", &i, &i, &i, &i, &i, &i, &i, &i)==8){
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer subtitle format detected\n");
- return FORMAT_SUBVIEWER;
- }
-
- if (strstr (line, "<SAMI>")) {
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "sami subtitle format detected\n");
- return FORMAT_SAMI;
- }
- if (sscanf (line, "%d:%d:%d:", &i, &i, &i )==3) {
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "vplayer subtitle format detected\n");
- return FORMAT_VPLAYER;
- }
- /*
- * A RealText format is a markup language, starts with <window> tag,
- * options (behaviour modifiers) are possible.
- */
- if ( !strcasecmp(line, "<window") ) {
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "rt subtitle format detected\n");
- return FORMAT_RT;
- }
- if ((!memcmp(line, "Dialogue: Marked", 16)) || (!memcmp(line, "Dialogue: ", 10))) {
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "ssa subtitle format detected\n");
- return FORMAT_SSA;
- }
- if (sscanf (line, "%d,%d,\"%c", &i, &i, (char *) &i) == 3) {
- this->uses_time=0;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "pjs subtitle format detected\n");
- return FORMAT_PJS;
- }
- if (sscanf (line, "FORMAT=%d", &i) == 1) {
- this->uses_time=0;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "mpsub subtitle format detected\n");
- return FORMAT_MPSUB;
- }
-
- char p;
- if (sscanf (line, "FORMAT=TIM%c", &p)==1 && p=='E') {
- this->uses_time=1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "mpsub subtitle format detected\n");
- return FORMAT_MPSUB;
- }
-
- if (strstr (line, "-->>")) {
- this->uses_time=0;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "aqtitle subtitle format detected\n");
- return FORMAT_AQTITLE;
- }
- if (sscanf(line, "@%d @%d", &i, &i) == 2 ||
- sscanf(line, "%d:%d:%d.%d %d:%d:%d.%d", &i, &i, &i, &i, &i, &i, &i, &i) == 8) {
- this->uses_time = 1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "jacobsub subtitle format detected\n");
- return FORMAT_JACOBSUB;
- }
- if (sscanf(line, "{T %d:%d:%d:%d",&i, &i, &i, &i) == 4) {
- this->uses_time = 1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer 2.0 subtitle format detected\n");
- return FORMAT_SUBVIEWER2;
- }
- if (sscanf(line, "[%d:%d:%d]", &i, &i, &i) == 3) {
- this->uses_time = 1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subrip 0.9 subtitle format detected\n");
- return FORMAT_SUBRIP09;
- }
-
- if (sscanf (line, "[%d][%d]", &i, &i) == 2) {
- this->uses_time = 1;
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "mpl2 subtitle format detected\n");
- return FORMAT_MPL2;
- }
- }
- return FORMAT_UNKNOWN; /* too many bad lines */
-}
-
-static subtitle_t *sub_read_file (demux_sputext_t *this) {
-
- subtitle_t * (*func[])(demux_sputext_t *this,subtitle_t *dest)=
- {
- sub_read_line_microdvd,
- sub_read_line_subrip,
- sub_read_line_subviewer,
- sub_read_line_sami,
- sub_read_line_vplayer,
- sub_read_line_rt,
- sub_read_line_ssa,
- sub_read_line_pjs,
- sub_read_line_mpsub,
- sub_read_line_aqt,
- sub_read_line_jacobsub,
- sub_read_line_subviewer2,
- sub_read_line_subrip09,
- sub_read_line_mpl2,
- };
-
- /* Rewind (sub_autodetect() needs to read input from the beginning) */
- if(this->input->seek(this->input, 0, SEEK_SET) == -1) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "seek failed.\n");
- return NULL;
- }
- this->buflen = 0;
-
- this->format=sub_autodetect (this);
- if (this->format==FORMAT_UNKNOWN) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Could not determine file format\n");
- return NULL;
- }
-
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Detected subtitle file format: %d\n",this->format);
-
- /* Rewind */
- if(this->input->seek(this->input, 0, SEEK_SET) == -1) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "seek failed.\n");
- return NULL;
- }
- this->buflen = 0;
-
- this->num=0;
- int n_max=32;
- subtitle_t *first = calloc(n_max, sizeof(subtitle_t));
- if(!first) return NULL;
-
- const int timeout =
- (((demux_sputext_class_t *)
- (this->demux_plugin.demux_class))->max_timeout) *
- (this->uses_time ? 100 : 10);
-
- while(1) {
- if(this->num>=n_max){
- n_max+=16;
- first=realloc(first,n_max*sizeof(subtitle_t));
- }
-
- subtitle_t *sub = func[this->format] (this, &first[this->num]);
-
- if (!sub)
- break; /* EOF */
-
- if (sub==ERR)
- ++this->errs;
- else {
- if (this->num > 0 && first[this->num-1].end == -1) {
- /* end time not defined in the subtitle */
- if (timeout > 0) {
- /* timeout */
- if (timeout > sub->start - first[this->num-1].start) {
- first[this->num-1].end = sub->start;
- } else
- first[this->num-1].end = first[this->num-1].start + timeout;
- } else {
- /* no timeout */
- first[this->num-1].end = sub->start;
- }
- }
- ++this->num; /* Error vs. Valid */
- }
- }
- /* timeout of last subtitle */
- if (this->num > 0 && first[this->num-1].end == -1)
- if (timeout > 0) {
- first[this->num-1].end = first[this->num-1].start + timeout;
- }
-
- if(this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) {
- char buffer[1024];
-
- sprintf(buffer, "Read %i subtitles", this->num);
-
- if(this->errs)
- sprintf(buffer + strlen(buffer), ", %i bad line(s).\n", this->errs);
- else
- strcat(buffer, "\n");
-
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "%s", buffer);
- }
-
- return first;
-}
-
-static int demux_sputext_next (demux_sputext_t *this_gen) {
- demux_sputext_t *this = (demux_sputext_t *) this_gen;
-
- if (this->cur >= this->num)
- return 0;
-
- subtitle_t *sub = &this->subtitles[this->cur];
-
- buf_element_t *buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo);
- buf->type = BUF_SPU_TEXT;
- buf->pts = 0;
-
- uint32_t *val = (uint32_t * )buf->content;
- *val++ = sub->lines;
- *val++ = this->uses_time;
- *val++ = (this->uses_time) ? sub->start * 10 : sub->start;
- *val++ = (this->uses_time) ? sub->end * 10 : sub->end;
- char *str = (char *)val;
-
- /** @FIXME The way this works seems wrong, SUB_BUFSIZE-1 is not the
- right maximum, I think. */
- int line;
- for (line = 0; line < sub->lines; line++, str+=strlen(str)+1) {
- strncpy(str, sub->text[line], SUB_BUFSIZE-1);
- str[SUB_BUFSIZE-1] = '\0';
- }
-
- this->stream->video_fifo->put(this->stream->video_fifo, buf);
- this->cur++;
-
- return 1;
-}
-
-static void demux_sputext_dispose (demux_plugin_t *this_gen) {
- demux_sputext_t *this = (demux_sputext_t *) this_gen;
-
- int i;
- for (i = 0; i < this->num; i++) {
- int l;
- for (l = 0; l < this->subtitles[i].lines; l++)
- free(this->subtitles[i].text[l]);
- }
- free(this->subtitles);
- free(this);
-}
-
-static int demux_sputext_get_status (demux_plugin_t *this_gen) {
- demux_sputext_t *this = (demux_sputext_t *) this_gen;
- return this->status;
-}
-
-static int demux_sputext_get_stream_length (demux_plugin_t *this_gen) {
- demux_sputext_t *this = (demux_sputext_t *) this_gen;
-
- return ( this->uses_time && this->num ) ?
- this->subtitles[this->num-1].end * 10 :
- 0;
-}
-
-static int demux_sputext_send_chunk (demux_plugin_t *this_gen) {
- demux_sputext_t *this = (demux_sputext_t *) this_gen;
-
- if (!demux_sputext_next (this)) {
- this->status = DEMUX_FINISHED;
- }
-
- return this->status;
-}
-
-static int demux_sputext_seek (demux_plugin_t *this_gen,
- off_t start_pos, int start_time, int playing) {
- demux_sputext_t *this = (demux_sputext_t*)this_gen;
-
- lprintf("seek() called\n");
-
- /* simple seeking approach: just go back to start.
- * decoder will discard subtitles until the desired position.
- */
- this->cur = 0;
- this->status = DEMUX_OK;
-
- _x_demux_flush_engine (this->stream);
- _x_demux_control_newpts(this->stream, 0, 0);
-
- return this->status;
-}
-
-static void demux_sputext_send_headers(demux_plugin_t *this_gen) {
- demux_sputext_t *this = (demux_sputext_t*)this_gen;
-
- lprintf("send_headers() called\n");
-
- _x_demux_control_start(this->stream);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 0);
-
- /* enable the SPU channel */
- buf_element_t *buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo);
- buf->type = BUF_CONTROL_SPU_CHANNEL;
- buf->decoder_info[0] = buf->decoder_info[1] = buf->decoder_info[2] = 0;
- this->stream->video_fifo->put(this->stream->video_fifo, buf);
-
- this->status = DEMUX_OK;
-}
-
-static uint32_t demux_sputext_get_capabilities(demux_plugin_t *this_gen) {
- return DEMUX_CAP_NOCAP;
-}
-
-static int demux_sputext_get_optional_data(demux_plugin_t *this_gen,
- void *data, int data_type) {
- int channel = *((int *)data);
-
- switch (data_type) {
- case DEMUX_OPTIONAL_DATA_SPULANG:
- if (channel == -1 || channel == 0) {
- strcpy(data, "sub");
- return DEMUX_OPTIONAL_SUCCESS;
- }
- default:
- return DEMUX_OPTIONAL_UNSUPPORTED;
- }
-}
-
-static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_t *stream,
- input_plugin_t *input_gen) {
-
- input_plugin_t *input = (input_plugin_t *) input_gen;
- demux_sputext_t *this;
-
- lprintf("open_plugin() called\n");
-
- this = calloc(1, sizeof (demux_sputext_t));
- this->stream = stream;
- this->input = input;
-
- this->demux_plugin.send_headers = demux_sputext_send_headers;
- this->demux_plugin.send_chunk = demux_sputext_send_chunk;
- this->demux_plugin.seek = demux_sputext_seek;
- this->demux_plugin.dispose = demux_sputext_dispose;
- this->demux_plugin.get_status = demux_sputext_get_status;
- this->demux_plugin.get_stream_length = demux_sputext_get_stream_length;
- this->demux_plugin.get_capabilities = demux_sputext_get_capabilities;
- this->demux_plugin.get_optional_data = demux_sputext_get_optional_data;
- this->demux_plugin.demux_class = class_gen;
-
- this->buflen = 0;
-
- switch (stream->content_detection_method) {
- case METHOD_BY_EXTENSION:
- {
- const char *const mrl = input->get_mrl(input);
- const char *const ending = strrchr(mrl, '.');
-
- if (!ending || (
- (strncasecmp(ending, ".asc", 4) != 0) &&
- (strncasecmp(ending, ".txt", 4) != 0) &&
- (strncasecmp(ending, ".sub", 4) != 0) &&
- (strncasecmp(ending, ".srt", 4) != 0) &&
- (strncasecmp(ending, ".smi", 4) != 0) &&
- (strncasecmp(ending, ".ssa", 4) != 0) &&
- (strncasecmp(ending, ".ass", 4) != 0))) {
- free (this);
- return NULL;
- }
- }
- /* falling through is intended */
-
- case METHOD_EXPLICIT:
- /* case METHOD_BY_CONTENT: */
-
- /* FIXME: for now this demuxer only works when requested explicitly
- * to make sure it does not interfere with others;
- * If this is found too inconvenient, this may be changed after making
- * sure the content detection does not produce any false positives.
- */
-
- if ((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) {
-
- this->subtitles = sub_read_file (this);
-
- this->cur = 0;
-
- if (this->subtitles) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subtitle format %s time.\n",
- this->uses_time ? "uses" : "doesn't use");
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "read %i subtitles, %i errors.\n", this->num, this->errs);
- return &this->demux_plugin;
- }
- }
- /* falling through is intended */
- }
-
- free (this);
- return NULL;
-}
-
-static const char *get_demux_description (demux_class_t *this_gen) {
- return "sputext demuxer plugin";
-}
-
-static const char *get_demux_identifier (demux_class_t *this_gen) {
- return "sputext";
-}
-
-static const char *get_demux_extensions (demux_class_t *this_gen) {
- return "asc txt sub srt smi ssa ass";
-}
-
-static const char *get_demux_mimetypes (demux_class_t *this_gen) {
- return NULL;
-
- /* do not report this mimetype, it might confuse browsers. */
- /* "text/plain: asc txt sub srt: VIDEO subtitles;" */
-}
-
-static void demux_class_dispose (demux_class_t *this_gen) {
- demux_sputext_class_t *this = (demux_sputext_class_t *) this_gen;
-
- free (this);
-}
-
-static void config_timeout_cb(void *this_gen, xine_cfg_entry_t *entry) {
- demux_sputext_class_t *this = (demux_sputext_class_t *)this_gen;
-
- this->max_timeout = entry->num_value;
-}
-
-static void *init_sputext_demux_class (xine_t *xine, void *data) {
-
- demux_sputext_class_t *this ;
-
- lprintf("initializing\n");
-
- this = calloc(1, sizeof (demux_sputext_class_t));
-
- this->demux_class.open_plugin = open_demux_plugin;
- this->demux_class.get_description = get_demux_description;
- this->demux_class.get_identifier = get_demux_identifier;
- this->demux_class.get_mimetypes = get_demux_mimetypes;
- this->demux_class.get_extensions = get_demux_extensions;
- this->demux_class.dispose = demux_class_dispose;
-
- /*
- * Some subtitling formats, namely AQT and Subrip09, define the end of a
- * subtitle as the beginning of the following. From end-user view it's
- * better define timeout of hidding. Setting to zero means "no timeout".
- */
- this->max_timeout = xine->config->register_num(xine->config,
- "subtitles.separate.timeout", 4,
- _("default duration of subtitle display in seconds"),
- _("Some subtitle formats do not explicitly give a duration for each subtitle. "
- "For these, you can set a default duration here. Setting to zero will result "
- "in the subtitle being shown until the next one takes over."),
- 20, config_timeout_cb, this);
-
- return this;
-}
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 26, "sputext", XINE_VERSION_CODE, NULL, &init_sputext_demux_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c
deleted file mode 100644
index e2e37bc37..000000000
--- a/src/libsputext/xine_sputext_decoder.c
+++ /dev/null
@@ -1,1215 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <ctype.h>
-
-#define LOG_MODULE "libsputext"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "buffer.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "osd.h"
-
-#define SUB_MAX_TEXT 5 /* lines */
-#define SUB_BUFSIZE 256 /* chars per line */
-
-/* alignment in SSA codes */
-#define ALIGN_LEFT 1
-#define ALIGN_CENTER 2
-#define ALIGN_RIGHT 3
-#define ALIGN_BOTTOM 0
-#define ALIGN_TOP 4
-#define ALIGN_MIDDLE 8
-#define GET_X_ALIGNMENT(a) ((a) & 3)
-#define GET_Y_ALIGNMENT(a) ((a) - ((a) & 3))
-
-/* subtitles projection */
-/* for subrip file with SSA tags, those values are always correct.*/
-/* But for SSA files, those values are the default ones. we have */
-/* to use PlayResX and PlayResY defined in [Script Info] section. */
-/* not implemented yet... */
-#define SPU_PROJECTION_X 384
-#define SPU_PROJECTION_Y 288
-
-
-
-#define rgb2yuv(R,G,B) ((((((66*R+129*G+25*B+128)>>8)+16)<<8)|(((112*R-94*G-18*B+128)>>8)+128))<<8|(((-38*R-74*G+112*B+128)>>8)+128))
-
-static const uint32_t sub_palette[22]={
-/* RED */
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(50,10,10),
- rgb2yuv(120,20,20),
- rgb2yuv(185,50,50),
- rgb2yuv(255,70,70),
-/* BLUE */
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,0,0),
- rgb2yuv(0,30,50),
- rgb2yuv(0,90,120),
- rgb2yuv(0,140,185),
- rgb2yuv(0,170,255)
-};
-
-static const uint8_t sub_trans[22]={
- 0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15,
- 0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15
-};
-
-typedef enum {
- SUBTITLE_SIZE_TINY = 0,
- SUBTITLE_SIZE_SMALL,
- SUBTITLE_SIZE_NORMAL,
- SUBTITLE_SIZE_LARGE,
- SUBTITLE_SIZE_VERY_LARGE,
- SUBTITLE_SIZE_HUGE,
-
- SUBTITLE_SIZE_NUM /* number of values in enum */
-} subtitle_size;
-
-#define FONTNAME_SIZE 100
-
-typedef struct sputext_class_s {
- spu_decoder_class_t class;
-
- subtitle_size subtitle_size; /* size of subtitles */
- int vertical_offset;
- char font[FONTNAME_SIZE]; /* subtitle font */
-#ifdef HAVE_FT2
- char font_ft[FILENAME_MAX]; /* subtitle font */
- int use_font_ft; /* use Freetype */
-#endif
- const char *src_encoding; /* encoding of subtitle file */
- int use_unscaled; /* use unscaled OSD if possible */
-
- xine_t *xine;
-
-} sputext_class_t;
-
-
-/* Convert subtiles coordinates in window coordinates. */
-/* (a, b) --> (x + a * dx, y + b * dy) */
-typedef struct video2wnd_s {
- int x;
- int y;
- double dx;
- double dy;
-} video2wnd_t;
-
-typedef struct sputext_decoder_s {
- spu_decoder_t spu_decoder;
-
- sputext_class_t *class;
- xine_stream_t *stream;
-
- int ogm;
- int lines;
- char text[SUB_MAX_TEXT][SUB_BUFSIZE];
-
- /* below 3 variables are the same from class. use to detect
- * when something changes.
- */
- subtitle_size subtitle_size; /* size of subtitles */
- int vertical_offset;
- char font[FILENAME_MAX]; /* subtitle font */
- char *buf_encoding; /* encoding of subtitle buffer */
-
- int width; /* frame width */
- int height; /* frame height */
- int font_size;
- int line_height;
- int started;
- int finished;
-
- osd_renderer_t *renderer;
- osd_object_t *osd;
- int current_osd_text;
- uint32_t spu_palette[OVL_PALETTE_SIZE];
- uint8_t spu_trans[OVL_PALETTE_SIZE];
-
- int64_t img_duration;
- int64_t last_subtitle_end; /* no new subtitle before this vpts */
- int unscaled; /* use unscaled OSD */
-
- int last_y; /* location of the previous subtitle */
- int last_lines; /* number of lines of the previous subtitle */
- video2wnd_t video2wnd;
-} sputext_decoder_t;
-
-static inline char *get_font (sputext_class_t *class)
-{
-#ifdef HAVE_FT2
- return class->use_font_ft ? class->font_ft : class->font;
-#else
- return class->font;
-#endif
-}
-
-static void update_font_size (sputext_decoder_t *this, int force_update) {
- static const int sizes[SUBTITLE_SIZE_NUM] = { 16, 20, 24, 32, 48, 64 };
-
- if ((this->subtitle_size != this->class->subtitle_size) ||
- (this->vertical_offset != this->class->vertical_offset) ||
- force_update) {
-
- this->subtitle_size = this->class->subtitle_size;
- this->vertical_offset = this->class->vertical_offset;
- this->last_lines = 0;
-
- this->font_size = sizes[this->class->subtitle_size];
-
- this->line_height = this->font_size + 10;
-
- /* Create a full-window OSD */
- if( this->osd )
- this->renderer->free_object (this->osd);
-
- this->osd = this->renderer->new_object (this->renderer,
- this->width,
- this->height);
-
- this->renderer->set_font (this->osd, get_font (this->class), this->font_size);
-
- this->renderer->set_position (this->osd, 0, 0);
- }
-}
-
-static void update_output_size (sputext_decoder_t *this) {
- const int unscaled = this->class->use_unscaled &&
- (this->stream->video_out->get_capabilities(this->stream->video_out) &
- VO_CAP_UNSCALED_OVERLAY);
-
- if( unscaled != this->unscaled ) {
- this->unscaled = unscaled;
- this->width = 0; /* force update */
- }
-
- /* initialize decoder if needed */
- if( this->unscaled ) {
- if( this->width != this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_WINDOW_WIDTH) ||
- this->height != this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_WINDOW_HEIGHT) ||
- !this->img_duration || !this->osd ) {
-
- int width = 0, height = 0;
-
- this->stream->video_out->status(this->stream->video_out, NULL,
- &width, &height, &this->img_duration );
- if( width && height ) {
-
- this->width = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_WINDOW_WIDTH);
- this->height = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_WINDOW_HEIGHT);
-
- if(!this->osd || (this->width && this->height)) {
-
- /* in unscaled mode, we have to convert subtitle position in window coordinates. */
- /* we have a scale factor because video may be zommed */
- /* and a displacement factor because video may have blacks lines. */
- int output_width, output_height, output_xoffset, output_yoffset;
-
- output_width = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_OUTPUT_WIDTH);
- output_height = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_OUTPUT_HEIGHT);
- output_xoffset = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_OUTPUT_XOFFSET);
- output_yoffset = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_OUTPUT_YOFFSET);
-
- /* driver don't seen to be capable to give us those values */
- /* fallback to a default full-window values */
- if (output_width <= 0 || output_height <= 0) {
- output_width = this->width;
- output_height = this->height;
- output_xoffset = 0;
- output_yoffset = 0;
- }
-
- this->video2wnd.x = output_xoffset;
- this->video2wnd.y = output_yoffset;
- this->video2wnd.dx = (double)output_width / SPU_PROJECTION_X;
- this->video2wnd.dy = (double)output_height / SPU_PROJECTION_Y;
-
- this->renderer = this->stream->osd_renderer;
- update_font_size (this, 1);
- }
- }
- }
- } else {
- if( !this->width || !this->height || !this->img_duration || !this->osd ) {
-
- this->width = 0;
- this->height = 0;
-
- this->stream->video_out->status(this->stream->video_out, NULL,
- &this->width, &this->height, &this->img_duration );
-
- if(!this->osd || ( this->width && this->height)) {
- this->renderer = this->stream->osd_renderer;
-
- /* in scaled mode, we have to convert subtitle position in film coordinates. */
- this->video2wnd.x = 0;
- this->video2wnd.y = 0;
- this->video2wnd.dx = (double)this->width / SPU_PROJECTION_X;
- this->video2wnd.dy = (double)this->height / SPU_PROJECTION_Y;
-
- update_font_size (this, 1);
- }
- }
- }
-}
-
-static int parse_utf8_size(const uint8_t *c)
-{
- if ( c[0]<0x80 )
- return 1;
-
- if( c[1]==0 )
- return 1;
- if ( (c[0]>=0xC2 && c[0]<=0xDF) && (c[1]>=0x80 && c[1]<=0xBF) )
- return 2;
-
- if( c[2]==0 )
- return 2;
- else if ( c[0]==0xE0 && (c[1]>=0xA0 && c[1]<=0xBF) && (c[2]>=0x80 && c[1]<=0xBF) )
- return 3;
- else if ( (c[0]>=0xE1 && c[0]<=0xEC) && (c[1]>=0x80 && c[1]<=0xBF) && (c[2]>=0x80 && c[1]<=0xBF) )
- return 3;
- else if ( c[0]==0xED && (c[1]>=0x80 && c[1]<=0x9F) && (c[2]>=0x80 && c[1]<=0xBF) )
- return 3;
- else if ( c[0]==0xEF && (c[1]>=0xA4 && c[1]<=0xBF) && (c[2]>=0x80 && c[1]<=0xBF) )
- return 3;
- else
- return 1;
-}
-
-static int ogm_render_line_internal(sputext_decoder_t *this, int x, int y, const char *text, int render)
-{
- const size_t length = strlen (text);
- size_t i = 0;
-
- while (i <= length) {
-
- if (text[i] == '<') {
- if (!strncmp("<b>", text+i, 3)) {
- /* enable Bold color */
- if (render)
- this->current_osd_text = OSD_TEXT2;
- i=i+3;
- continue;
- } else if (!strncmp("</b>", text+i, 4)) {
- /* disable BOLD */
- if (render)
- this->current_osd_text = OSD_TEXT1;
- i=i+4;
- continue;
- } else if (!strncmp("<i>", text+i, 3)) {
- /* enable italics color */
- if (render)
- this->current_osd_text = OSD_TEXT3;
- i=i+3;
- continue;
- } else if (!strncmp("</i>", text+i, 4)) {
- /* disable italics */
- if (render)
- this->current_osd_text = OSD_TEXT1;
- i=i+4;
- continue;
- } else if (!strncmp("<font>", text+i, 6)) {
- /*Do somethink to disable typing
- fixme - no teststreams*/
- i=i+6;
- continue;
- } else if (!strncmp("</font>", text+i, 7)) {
- /*Do somethink to enable typing
- fixme - no teststreams*/
- i=i+7;
- continue;
- }
- }
- if (text[i] == '{') {
-
- if (!strncmp("{\\", text+i, 2)) {
- int value;
-
- if (sscanf(text+i, "{\\b%d}", &value) == 1) {
- if (render) {
- if (value)
- this->current_osd_text = OSD_TEXT2;
- else
- this->current_osd_text = OSD_TEXT1;
- }
- } else if (sscanf(text+i, "{\\i%d}", &value) == 1) {
- if (render) {
- if (value)
- this->current_osd_text = OSD_TEXT3;
- else
- this->current_osd_text = OSD_TEXT1;
- }
- }
- char *const end = strstr(text+i+2, "}");
- if (end) {
- i=end-text+1;
- continue;
- }
- }
- }
-
- char letter[5];
- const char *const encoding = this->buf_encoding ? : this->class->src_encoding;
- const int isutf8 = !strcmp(encoding, "utf-8");
- const size_t shift = isutf8 ? parse_utf8_size (&text[i]) : 1;
- memcpy(letter,&text[i],shift);
- letter[shift]=0;
-
- if (render)
- this->renderer->render_text(this->osd, x, y, letter, this->current_osd_text);
-
- int w, dummy;
- this->renderer->get_text_size(this->osd, letter, &w, &dummy);
- x += w;
- i += shift;
- }
-
- return x;
-}
-
-static inline int ogm_get_width(sputext_decoder_t *this, char* text) {
- return ogm_render_line_internal (this, 0, 0, text, 0);
-}
-
-static inline void ogm_render_line(sputext_decoder_t *this, int x, int y, char* text) {
- ogm_render_line_internal (this, x, y, text, 1);
-}
-
-/* read SSA tags at begening of text. Suported tags are : */
-/* \a : alignment in SSA code (see #defines) */
-/* \an : alignment in 'numpad code' */
-/* \pos : absolute position of subtitles. Alignment define origin. */
-static void read_ssa_tag(sputext_decoder_t *this, const char* text,
- int* alignment, int* sub_x, int* sub_y, int* max_width) {
-
- int in_tag = 0;
-
- (*alignment) = 2;
- (*sub_x) = -1;
- (*sub_y) = -1;
-
- while (*text) {
-
- /* wait for tag begin, allow space and tab */
- if (in_tag == 0) {
- if (*text == '{') in_tag = 1;
- else if ((*text != ' ') && (*text != '\t')) break;
-
- /* parse SSA command */
- } else {
- if (*text == '\\') {
- if (sscanf(text, "\\pos(%d,%d)", sub_x, sub_y) == 2) {
- text += 8; /* just for speed up, 8 is the minimal with */
- }
-
- if (sscanf(text, "\\a%d", alignment) == 1) {
- text += 2;
- }
-
- if (sscanf(text, "\\an%d", alignment) == 1) {
- text += 3;
- if ((*alignment) > 6) (*alignment) = (*alignment) - 2;
- else if ((*alignment) > 3) (*alignment) = (*alignment) + 5;
- }
- }
-
- if (*text == '}') in_tag = 0;
- }
-
- text++;
- }
-
-
- /* check alignment validity */
- if ((*alignment) < 1 || (*alignment) > 11) {
- (*alignment) = 2;
- }
-
- /* convert to window coordinates */
- if ((*sub_x) >= 0 && (*sub_y) >= 0) {
- (*sub_x) = this->video2wnd.x + this->video2wnd.dx * (*sub_x);
- (*sub_y) = this->video2wnd.y + this->video2wnd.dy * (*sub_y);
- }
-
- /* check validity, compute max width */
- if ( (*sub_x) < 0 || (*sub_x) >= this->width ||
- (*sub_y) < 0 || (*sub_y) >= this->height ) {
- (*sub_x) = -1;
- (*sub_y) = -1;
- (*max_width) = this->width;
- } else {
- switch (GET_X_ALIGNMENT(*alignment)) {
- case ALIGN_LEFT:
- (*max_width) = this->width - (*sub_x);
- break;
- case ALIGN_CENTER:
- (*max_width) = this->width;
- break;
- case ALIGN_RIGHT:
- (*max_width) = (*sub_x);
- break;
- }
- }
-
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: position : (%d, %d), max width : %d, alignment : %d\n",
- (*sub_x), (*sub_y), (*max_width), (*alignment));
-}
-
-static int is_cjk_encoding(const char *enc) {
- /* CJK charset strings defined in iconvdata/gconv-modules of glibc */
- static const char cjk_encoding_strings[][16] = {
- "SJIS",
- "CP932",
- "EUC-KR",
- "UHC",
- "JOHAB",
- "BIG5",
- "BIG5HKSCS",
- "EUC-JP-MS",
- "EUC-JP",
- "EUC-CN",
- "GBBIG5",
- "GBK",
- "GBGBK",
- "EUC-TW",
- "ISO-2022-JP",
- "ISO-2022-JP-2",
- "ISO-2022-JP-3",
- "ISO-2022-KR",
- "ISO-2022-CN",
- "ISO-2022-CN-EXT",
- "GB18030",
- "EUC-JISX0213",
- "SHIFT_JISX0213",
- };
-
- int pstr;
-
- /* return 1 if encoding string is one of the CJK(Chinese,Jananese,Korean)
- * character set strings. */
- for (pstr = 0; pstr < sizeof (cjk_encoding_strings) / sizeof (cjk_encoding_strings[0]); pstr++)
- if (strcasecmp (enc, cjk_encoding_strings[pstr]) == 0)
- return 1;
-
- return 0;
-}
-
-static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t sub_end ) {
-
- int y;
- int sub_x, sub_y, max_width = this->width;
- int alignment;
-
- _x_assert(this->renderer != NULL);
- if ( ! this->renderer )
- return;
-
- read_ssa_tag(this, this->text[0], &alignment, &sub_x, &sub_y, &max_width);
-
- update_font_size(this, 0);
-
- const char *const font = get_font (this->class);
- if( strcmp(this->font, font) ) {
- strncpy(this->font, font, FILENAME_MAX);
- this->font[FILENAME_MAX - 1] = '\0';
- this->renderer->set_font (this->osd, font, this->font_size);
- }
-
- int font_size = this->font_size;
-
- const char *const encoding = this->buf_encoding ? : this->class->src_encoding;
- this->renderer->set_encoding(this->osd, encoding);
-
- int rebuild_all = 0;
- int line;
- for (line = 0; line < this->lines; line++) {
- int line_width = ogm_get_width(this, this->text[line]);
-
- /* line too long */
- if (line_width > max_width) {
- char *current_cut, *best_cut;
- int a;
-
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: Line too long: %d > %d, split at max size.\n",
- line_width, max_width);
-
- /* can't fit with keeping existing lines */
- if (this->lines + 1 > SUB_MAX_TEXT) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: Can't fit with keeping existing line, we have to rebuild all the subtitle\n");
- rebuild_all = 1;
- break;
- }
-
- /* find the longest sequence witch fit */
- line_width = 0;
- current_cut = this->text[line];
- best_cut = NULL;
- while (line_width < max_width) {
- while (*current_cut && *current_cut != ' ') current_cut++;
- if (*current_cut == ' ') {
- *current_cut = 0;
- line_width = ogm_get_width(this, this->text[line]);
- *current_cut = ' ';
- if (line_width < max_width) best_cut = current_cut;
- current_cut++;
- } else {
- break; /* end of line */
- }
- }
-
- if (best_cut == NULL) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: Can't wrap line: a word is too long, abort.\n");
- break;
- }
-
- /* move other lines */
- for (a = this->lines - 1; a > line; a--)
- memcpy(this->text[a + 1], this->text[a], SUB_BUFSIZE);
-
- /* split current one */
- strncpy(this->text[line + 1], best_cut + 1, SUB_BUFSIZE);
- *best_cut = 0;
-
- this->lines = this->lines + 1;
- }
- }
-
- /* regenerate all the lines to find something that better fits */
- if (rebuild_all) {
- char buf[SUB_BUFSIZE * SUB_MAX_TEXT] = { 0, };
-
- int line;
- for(line = 0; line < this->lines; line++) {
- const size_t len = strlen(buf);
- if (len)
- buf[len] = ' ';
-
- strncat(buf, this->text[line], SUB_BUFSIZE-len-1);
- }
-
- char *stream = buf;
- this->lines = 0;
-
- char *current_cut, *best_cut;
- do {
-
- if (this->lines + 1 < SUB_MAX_TEXT) {
-
- /* find the longest sequence witch fit */
- int line_width = 0;
- current_cut = stream;
- best_cut = NULL;
- while (line_width < max_width) {
- while (*current_cut && *current_cut != ' ') current_cut++;
- if (*current_cut == ' ') {
- *current_cut = 0;
- line_width = ogm_get_width(this, stream);
- *current_cut = ' ';
- if (line_width < max_width) best_cut = current_cut;
- current_cut++;
- } else {
- line_width = ogm_get_width(this, stream);
- if (line_width < max_width) best_cut = current_cut;
- break; /* end of line */
- }
- }
- }
-
- /* line maybe too long, but we have reached last subtitle line */
- else {
- best_cut = current_cut = stream + strlen(stream);
- }
-
- /* copy current line */
- if (best_cut != NULL) *best_cut = 0;
- strncpy(this->text[this->lines], stream, SUB_BUFSIZE);
- this->lines = this->lines + 1;
-
- stream = best_cut + 1;
-
- } while (best_cut != current_cut);
-
- }
-
-
- /* Erase subtitle : use last_y and last_lines saved last turn. */
- if (this->last_lines) {
- this->renderer->filled_rect (this->osd, 0, this->last_y,
- this->width - 1, this->last_y + this->last_lines * this->line_height,
- 0);
- }
-
- switch (GET_Y_ALIGNMENT(alignment)) {
- case ALIGN_TOP:
- if (sub_y >= 0) y = sub_y;
- else y = 5;
- break;
-
- case ALIGN_MIDDLE:
- if (sub_y >= 0) y = sub_y - (this->lines * this->line_height) / 2;
- else y = (this->height - this->lines * this->line_height) / 2;
- break;
-
- case ALIGN_BOTTOM:
- default:
- if (sub_y >= 0) y = sub_y - this->lines * this->line_height;
- else y = this->height - this->lines * this->line_height - this->class->vertical_offset;
- break;
- }
- if (y < 0 || y >= this->height)
- y = this->height - this->line_height * this->lines;
-
- this->last_lines = this->lines;
- this->last_y = y;
-
-
- for (line = 0; line < this->lines; line++) {
- int w, x;
-
- while(1) {
- w = ogm_get_width( this, this->text[line]);
-
- switch (GET_X_ALIGNMENT(alignment)) {
- case ALIGN_LEFT:
- if (sub_x >= 0) x = sub_x;
- else x = 5;
- break;
-
- case ALIGN_RIGHT:
- if (sub_x >= 0) x = sub_x - w;
- else x = max_width - w - 5;
- break;
-
- case ALIGN_CENTER:
- default:
- if (sub_x >= 0) x = sub_x - w / 2;
- else x = (max_width - w) / 2;
- break;
- }
-
-
- if( w > max_width && font_size > 16 ) {
- font_size -= 4;
- this->renderer->set_font (this->osd, get_font (this->class), font_size);
- } else {
- break;
- }
- }
-
- if( is_cjk_encoding(encoding) ) {
- this->renderer->render_text (this->osd, x, y + line * this->line_height,
- this->text[line], OSD_TEXT1);
- } else {
- ogm_render_line(this, x, y + line*this->line_height, this->text[line]);
- }
- }
-
- if( font_size != this->font_size )
- this->renderer->set_font (this->osd, get_font (this->class), this->font_size);
-
- if( this->last_subtitle_end && sub_start < this->last_subtitle_end ) {
- sub_start = this->last_subtitle_end;
- }
- this->last_subtitle_end = sub_end;
-
- this->renderer->set_text_palette (this->osd, -1, OSD_TEXT1);
- this->renderer->get_palette(this->osd, this->spu_palette, this->spu_trans);
- /* append some colors for colored typeface tag */
- memcpy(this->spu_palette+OSD_TEXT2, sub_palette, sizeof(sub_palette));
- memcpy(this->spu_trans+OSD_TEXT2, sub_trans, sizeof(sub_trans));
- this->renderer->set_palette(this->osd, this->spu_palette, this->spu_trans);
-
- if (this->unscaled)
- this->renderer->show_unscaled (this->osd, sub_start);
- else
- this->renderer->show (this->osd, sub_start);
-
- this->renderer->hide (this->osd, sub_end);
-
- lprintf ("scheduling subtitle >%s< at %"PRId64" until %"PRId64", current time is %"PRId64"\n",
- this->text[0], sub_start, sub_end,
- this->stream->xine->clock->get_current_time (this->stream->xine->clock));
-}
-
-
-static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
-
- sputext_decoder_t *this = (sputext_decoder_t *) this_gen;
- int uses_time;
- int32_t start, end, diff;
- int64_t start_vpts, end_vpts;
- int64_t spu_offset;
- int i;
- uint32_t *val;
- char *str;
- extra_info_t extra_info;
- int master_status, slave_status;
- int vo_discard;
-
- /* filter unwanted streams */
- if (buf->decoder_flags & BUF_FLAG_HEADER) {
- return;
- }
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- if ((this->stream->spu_channel & 0x1f) != (buf->type & 0x1f))
- return;
-
- if ( (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
- (buf->decoder_info[1] == BUF_SPECIAL_CHARSET_ENCODING) )
- this->buf_encoding = buf->decoder_info_ptr[2];
- else
- this->buf_encoding = NULL;
-
- this->current_osd_text = OSD_TEXT1;
-
- if( (buf->type & 0xFFFF0000) == BUF_SPU_OGM ) {
-
- this->ogm = 1;
- uses_time = 1;
- val = (uint32_t * )buf->content;
- start = *val++;
- end = *val++;
- str = (char *)val;
-
- if (!*str) return;
- /* Empty ogm packets (as created by ogmmux) clears out old messages. We already respect the end time. */
-
- this->lines = 0;
-
- i = 0;
- while (*str && (this->lines < SUB_MAX_TEXT) && (i < SUB_BUFSIZE)) {
- if (*str == '\r' || *str == '\n') {
- if (i) {
- this->text[ this->lines ][i] = 0;
- this->lines++;
- i = 0;
- }
- } else {
- this->text[ this->lines ][i] = *str;
- if (i < SUB_BUFSIZE-1)
- i++;
- }
- str++;
- }
- if (i == SUB_BUFSIZE)
- i--;
-
- if (i) {
- this->text[ this->lines ][i] = 0;
- this->lines++;
- }
-
- } else {
-
- this->ogm = 0;
- val = (uint32_t * )buf->content;
-
- this->lines = *val++;
- uses_time = *val++;
- start = *val++;
- end = *val++;
- str = (char *)val;
- for (i = 0; i < this->lines; i++, str += strlen(str) + 1) {
- strncpy( this->text[i], str, SUB_BUFSIZE - 1);
- this->text[i][SUB_BUFSIZE - 1] = '\0';
- }
-
- }
-
- xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: decoder data [%s]\n", this->text[0]);
- xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: mode %d timing %d->%d\n", uses_time, start, end);
-
- if( end <= start ) {
- xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: discarding subtitle with invalid timing\n");
- return;
- }
-
- spu_offset = this->stream->master->metronom->get_option (this->stream->master->metronom,
- METRONOM_SPU_OFFSET);
- if( uses_time ) {
- start += (spu_offset / 90);
- end += (spu_offset / 90);
- } else {
- if( this->osd && this->img_duration ) {
- start += spu_offset / this->img_duration;
- end += spu_offset / this->img_duration;
- }
- }
-
- while( !this->finished ) {
-
- master_status = xine_get_status (this->stream->master);
- slave_status = xine_get_status (this->stream);
- vo_discard = this->stream->video_out->get_property(this->stream->video_out,
- VO_PROP_DISCARD_FRAMES);
-
- _x_get_current_info (this->stream->master, &extra_info, sizeof(extra_info) );
-
- lprintf("master: %d slave: %d input_normpos: %d vo_discard: %d\n",
- master_status, slave_status, extra_info.input_normpos, vo_discard);
-
- if( !this->started && (master_status == XINE_STATUS_PLAY &&
- slave_status == XINE_STATUS_PLAY &&
- extra_info.input_normpos) ) {
- lprintf("started\n");
-
- this->width = this->height = 0;
-
- update_output_size( this );
- if( this->width && this->height ) {
- this->started = 1;
- }
- }
-
- if( this->started ) {
-
- if( master_status != XINE_STATUS_PLAY ||
- slave_status != XINE_STATUS_PLAY ||
- vo_discard ) {
- lprintf("finished\n");
-
- this->width = this->height = 0;
- this->finished = 1;
- return;
- }
-
- if( this->osd ) {
-
- /* try to use frame number mode */
- if( !uses_time && extra_info.frame_number ) {
-
- diff = end - extra_info.frame_number;
-
- /* discard old subtitles */
- if( diff < 0 ) {
- xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: discarding old subtitle\n");
- return;
- }
-
- diff = start - extra_info.frame_number;
-
- start_vpts = extra_info.vpts + diff * this->img_duration;
- end_vpts = start_vpts + (end-start) * this->img_duration;
-
- } else {
-
- if( !uses_time ) {
- start = start * this->img_duration / 90;
- end = end * this->img_duration / 90;
- uses_time = 1;
- }
-
- diff = end - extra_info.input_time;
-
- /* discard old subtitles */
- if( diff < 0 ) {
- xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
- "libsputext: discarding old subtitle\n");
- return;
- }
-
- diff = start - extra_info.input_time;
-
- start_vpts = extra_info.vpts + diff * 90;
- end_vpts = start_vpts + (end-start) * 90;
- }
-
- _x_spu_decoder_sleep(this->stream, start_vpts);
- update_output_size( this );
- draw_subtitle(this, start_vpts, end_vpts);
-
- return;
- }
- }
-
- if (_x_spu_decoder_sleep(this->stream, 0))
- xine_usec_sleep (50000);
- else
- return;
- }
-}
-
-
-static void spudec_reset (spu_decoder_t *this_gen) {
- sputext_decoder_t *this = (sputext_decoder_t *) this_gen;
-
- lprintf("i guess we just seeked\n");
- this->width = this->height = 0;
- this->started = this->finished = 0;
- this->last_subtitle_end = 0;
-}
-
-static void spudec_discontinuity (spu_decoder_t *this_gen) {
- /* sputext_decoder_t *this = (sputext_decoder_t *) this_gen; */
-
-}
-
-static void spudec_dispose (spu_decoder_t *this_gen) {
- sputext_decoder_t *this = (sputext_decoder_t *) this_gen;
-
- if (this->osd) {
- this->renderer->free_object (this->osd);
- this->osd = NULL;
- }
- free(this);
-}
-
-static void update_vertical_offset(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- class->vertical_offset = entry->num_value;
-}
-
-static void update_osd_font(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- strncpy(class->font, entry->str_value, FONTNAME_SIZE);
- class->font[FONTNAME_SIZE - 1] = '\0';
-
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_font = %s\n", class->font );
-}
-
-#ifdef HAVE_FT2
-static void update_osd_font_ft(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- strncpy(class->font_ft, entry->str_value, FILENAME_MAX);
- class->font_ft[FILENAME_MAX - 1] = '\0';
-
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_font_ft = %s\n", class->font_ft);
-}
-
-static void update_osd_use_font_ft(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- class->use_font_ft = entry->num_value;
-
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_use_font_ft = %d\n", class->use_font_ft);
-}
-#endif
-
-static void update_subtitle_size(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- class->subtitle_size = entry->num_value;
-}
-
-static void update_use_unscaled(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- class->use_unscaled = entry->num_value;
-}
-
-static spu_decoder_t *sputext_class_open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- sputext_class_t *class = (sputext_class_t *)class_gen;
- sputext_decoder_t *this ;
-
- this = (sputext_decoder_t *) calloc(1, sizeof(sputext_decoder_t));
-
- this->spu_decoder.decode_data = spudec_decode_data;
- this->spu_decoder.reset = spudec_reset;
- this->spu_decoder.discontinuity = spudec_discontinuity;
- this->spu_decoder.get_interact_info = NULL;
- this->spu_decoder.set_button = NULL;
- this->spu_decoder.dispose = spudec_dispose;
-
- this->class = class;
- this->stream = stream;
-
- return (spu_decoder_t *) this;
-}
-
-static void sputext_class_dispose (spu_decoder_class_t *class_gen) {
- sputext_class_t *this = (sputext_class_t *)class_gen;
-
- this->xine->config->unregister_callback(this->xine->config,
- "subtitles.separate.src_encoding");
- this->xine->config->unregister_callback(this->xine->config,
- "subtitles.separate.subtitle_size");
- this->xine->config->unregister_callback(this->xine->config,
- "subtitles.separate.vertical_offset");
- this->xine->config->unregister_callback(this->xine->config,
- "subtitles.separate.use_unscaled_osd");
- free (this);
-}
-
-static char *sputext_class_get_identifier (spu_decoder_class_t *this) {
- return "sputext";
-}
-
-static char *sputext_class_get_description (spu_decoder_class_t *this) {
- return "external subtitle decoder plugin";
-}
-
-static void update_src_encoding(void *class_gen, xine_cfg_entry_t *entry)
-{
- sputext_class_t *class = (sputext_class_t *)class_gen;
-
- class->src_encoding = entry->str_value;
- xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_src_encoding = %s\n", class->src_encoding );
-}
-
-static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
-
- static const char *subtitle_size_strings[] = {
- "tiny", "small", "normal", "large", "very large", "huge", NULL
- };
- sputext_class_t *this ;
-
- lprintf("init class\n");
-
- this = (sputext_class_t *) calloc(1, sizeof(sputext_class_t));
-
- this->class.open_plugin = sputext_class_open_plugin;
- this->class.get_identifier = sputext_class_get_identifier;
- this->class.get_description = sputext_class_get_description;
- this->class.dispose = sputext_class_dispose;
-
- this->xine = xine;
-
- this->subtitle_size = xine->config->register_enum(xine->config,
- "subtitles.separate.subtitle_size",
- 1,
- subtitle_size_strings,
- _("subtitle size"),
- _("You can adjust the subtitle size here. The setting will "
- "be evaluated relative to the window size."),
- 0, update_subtitle_size, this);
- this->vertical_offset = xine->config->register_num(xine->config,
- "subtitles.separate.vertical_offset",
- 0,
- _("subtitle vertical offset"),
- _("You can adjust the vertical position of the subtitle. "
- "The setting will be evaluated relative to the window size."),
- 0, update_vertical_offset, this);
- strncpy(this->font, xine->config->register_string(xine->config,
- "subtitles.separate.font",
- "sans",
- _("font for subtitles"),
- _("A font from the xine font directory to be used for the "
- "subtitle text."),
- 10, update_osd_font, this), FONTNAME_SIZE);
- this->font[FONTNAME_SIZE - 1] = '\0';
-#ifdef HAVE_FT2
- strncpy(this->font_ft, xine->config->register_filename(xine->config,
- "subtitles.separate.font_freetype",
- "", XINE_CONFIG_STRING_IS_FILENAME,
- _("font for subtitles"),
- _("An outline font file (e.g. a .ttf) to be used for the subtitle text."),
- 10, update_osd_font_ft, this), FILENAME_MAX);
- this->font_ft[FILENAME_MAX - 1] = '\0';
- this->use_font_ft = xine->config->register_bool(xine->config,
- "subtitles.separate.font_use_freetype",
- 0,
- _("whether to use a freetype font"),
- NULL,
- 10, update_osd_use_font_ft, this);
-#endif
- this->src_encoding = xine->config->register_string(xine->config,
- "subtitles.separate.src_encoding",
- xine_guess_spu_encoding(),
- _("encoding of the subtitles"),
- _("The encoding of the subtitle text in the stream. This setting "
- "is used to render non-ASCII characters correctly. If non-ASCII "
- "characters are not displayed as you expect, ask the "
- "creator of the subtitles what encoding was used."),
- 10, update_src_encoding, this);
- this->use_unscaled = xine->config->register_bool(xine->config,
- "subtitles.separate.use_unscaled_osd",
- 1,
- _("use unscaled OSD if possible"),
- _("The unscaled OSD will be rendered independently of the video "
- "frame and will always be sharp, even if the video is magnified. "
- "This will look better, but does not work with all graphics "
- "hardware. The alternative is the scaled OSD, which will become "
- "blurry, if you enlarge a low resolution video to fullscreen, but "
- "it works with all graphics cards."),
- 10, update_use_unscaled, this);
-
- return &this->class;
-}
-
-
-/* plugin catalog information */
-static uint32_t supported_types[] = { BUF_SPU_TEXT, BUF_SPU_OGM, 0 };
-
-static const decoder_info_t spudec_info = {
- supported_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_SPU_DECODER | PLUGIN_MUST_PRELOAD, 16, "sputext", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libw32dll/DirectShow/Makefile.am b/src/libw32dll/DirectShow/Makefile.am
index a74c65815..968a61ac0 100644
--- a/src/libw32dll/DirectShow/Makefile.am
+++ b/src/libw32dll/DirectShow/Makefile.am
@@ -1,26 +1,10 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 +16,16 @@ 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
+libds_filter_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
diff --git a/src/libw32dll/Makefile.am b/src/libw32dll/Makefile.am
index 5036851a3..d6ead9f41 100644
--- a/src/libw32dll/Makefile.am
+++ b/src/libw32dll/Makefile.am
@@ -1,39 +1,35 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+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) $(XDG_BASEDIR_LIBS)
diff --git a/src/libw32dll/dmo/Makefile.am b/src/libw32dll/dmo/Makefile.am
index ad77447c2..718fc1eed 100644
--- a/src/libw32dll/dmo/Makefile.am
+++ b/src/libw32dll/dmo/Makefile.am
@@ -1,15 +1,18 @@
+include $(top_srcdir)/misc/Makefile.quiet
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
+AM_CFLAGS = $(X_CFLAGS) -fno-omit-frame-pointer
+AM_CPPFLAGS = -DWIN32_PATH=\"$(w32_path)\" -DNOAVIFILE_HEADERS -I$(srcdir)/.. -I$(srcdir)/../wine
-if HAVE_W32DLL
-dmo_filter_lib = libdmo_filter.la
-endif
+noinst_HEADERS = \
+ DMO_AudioDecoder.h \
+ dmo_guids.h \
+ dmo_interfaces.h \
+ DMO_Filter.h \
+ dmo.h \
+ DMO_VideoDecoder.h
-noinst_LTLIBRARIES = $(dmo_filter_lib)
+noinst_LTLIBRARIES = libdmo_filter.la
libdmo_filter_la_SOURCES = \
buffer.c \
@@ -17,11 +20,4 @@ libdmo_filter_la_SOURCES = \
dmo.c \
dmo_guids.c \
DMO_VideoDecoder.c
-
-noinst_HEADERS = \
- DMO_AudioDecoder.h \
- dmo_guids.h \
- dmo_interfaces.h \
- DMO_Filter.h \
- dmo.h \
- DMO_VideoDecoder.h
+libdmo_filter_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c
index f032b3827..9b20672ab 100644
--- a/src/libw32dll/qt_decoder.c
+++ b/src/libw32dll/qt_decoder.c
@@ -38,9 +38,9 @@
*/
#include "bswap.h"
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
#include "qtx/qtxsdk/components.h"
#include "wine/win32.h"
@@ -569,19 +569,6 @@ static audio_decoder_t *qta_open_plugin (audio_decoder_class_t *class_gen,
/*
* qta plugin class
*/
-
-static char *qta_get_identifier (audio_decoder_class_t *this) {
- return "qta";
-}
-
-static char *qta_get_description (audio_decoder_class_t *this) {
- return "quicktime audio decoder plugin";
-}
-
-static void qta_dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
static void *qta_init_class (xine_t *xine, void *data) {
qta_class_t *this;
@@ -595,14 +582,14 @@ static void *qta_init_class (xine_t *xine, void *data) {
this = (qta_class_t *) calloc(1, sizeof(qta_class_t));
this->decoder_class.open_plugin = qta_open_plugin;
- this->decoder_class.get_identifier = qta_get_identifier;
- this->decoder_class.get_description = qta_get_description;
- this->decoder_class.dispose = qta_dispose_class;
+ this->decoder_class.identifier = "qta";
+ this->decoder_class.description = N_("quicktime audio decoder plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
return this;
}
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_QDESIGN1,
BUF_AUDIO_QDESIGN2,
BUF_AUDIO_QCLP,
@@ -1081,18 +1068,6 @@ static video_decoder_t *qtv_open_plugin (video_decoder_class_t *class_gen,
* qtv plugin class
*/
-static char *qtv_get_identifier (video_decoder_class_t *this) {
- return "qtvdec";
-}
-
-static char *qtv_get_description (video_decoder_class_t *this) {
- return "quicktime binary-only codec based video decoder plugin";
-}
-
-static void qtv_dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
/*
* some fake functions to make qt codecs happy
*/
@@ -1119,9 +1094,9 @@ static void *qtv_init_class (xine_t *xine, void *data) {
this = (qtv_class_t *) calloc(1, sizeof(qtv_class_t));
this->decoder_class.open_plugin = qtv_open_plugin;
- this->decoder_class.get_identifier = qtv_get_identifier;
- this->decoder_class.get_description = qtv_get_description;
- this->decoder_class.dispose = qtv_dispose_class;
+ this->decoder_class.identifier = "qtvdec";
+ this->decoder_class.description = N_("quicktime binary-only codec based video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
return this;
}
@@ -1130,7 +1105,7 @@ static void *qtv_init_class (xine_t *xine, void *data) {
* exported plugin catalog entry
*/
-static uint32_t qtv_supported_types[] = { BUF_VIDEO_SORENSON_V3, 0 };
+static const uint32_t qtv_supported_types[] = { BUF_VIDEO_SORENSON_V3, 0 };
static const decoder_info_t qtv_dec_info = {
qtv_supported_types, /* supported types */
@@ -1139,7 +1114,7 @@ static const decoder_info_t qtv_dec_info = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class },
- { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "qta", XINE_VERSION_CODE, &qta_dec_info, qta_init_class },
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class },
+ { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 16, "qta", XINE_VERSION_CODE, &qta_dec_info, qta_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/libw32dll/qtx/Makefile.am b/src/libw32dll/qtx/Makefile.am
index 060aa6acd..e550e5b15 100644
--- a/src/libw32dll/qtx/Makefile.am
+++ b/src/libw32dll/qtx/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
SUBDIRS = qtxsdk
diff --git a/src/libw32dll/qtx/qtxsdk/Makefile.am b/src/libw32dll/qtx/qtxsdk/Makefile.am
index 30aeab5e9..ba12bdd20 100644
--- a/src/libw32dll/qtx/qtxsdk/Makefile.am
+++ b/src/libw32dll/qtx/qtxsdk/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
noinst_HEADERS = components.h select.h
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 715b10ff4..231a0625c 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.c
@@ -54,11 +54,11 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "video_out.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/audio_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "common.c"
@@ -1572,18 +1572,6 @@ static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_
* video decoder class
*/
-static char *get_video_identifier (video_decoder_class_t *this) {
- return "w32v";
-}
-
-static char *get_video_description (video_decoder_class_t *this) {
- return "win32 binary video codec plugin";
-}
-
-static void dispose_video_class (video_decoder_class_t *this) {
- free (this);
-}
-
static void init_routine(void) {
pthread_mutex_init (&win32_codec_mutex, NULL);
w32v_init_rgb_ycc();
@@ -1600,9 +1588,9 @@ static void *init_video_decoder_class (xine_t *xine, void *data) {
this = (w32v_class_t *) calloc(1, sizeof(w32v_class_t));
this->decoder_class.open_plugin = open_video_decoder_plugin;
- this->decoder_class.get_identifier = get_video_identifier;
- this->decoder_class.get_description = get_video_description;
- this->decoder_class.dispose = dispose_video_class;
+ this->decoder_class.identifier = "w32v";
+ this->decoder_class.description = N_("win32 binary video codec plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
pthread_once (&once_control, init_routine);
@@ -1638,19 +1626,6 @@ static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_
/*
* audio decoder plugin class
*/
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "win32 audio";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "win32 binary audio codec plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
static void *init_audio_decoder_class (xine_t *xine, void *data) {
w32a_class_t *this;
@@ -1662,9 +1637,9 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) {
this = (w32a_class_t *) calloc(1, sizeof(w32a_class_t));
this->decoder_class.open_plugin = open_audio_decoder_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
+ this->decoder_class.identifier = "win32 audio";
+ this->decoder_class.description = N_("win32 binary audio codec plugin");
+ this->decoder_class.dispose = default_audio_decoder_class_dispose;
pthread_once (&once_control, init_routine);
@@ -1676,7 +1651,7 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) {
* exported plugin catalog entry
*/
-static uint32_t video_types[] = {
+static const uint32_t video_types[] = {
BUF_VIDEO_MSMPEG4_V1, BUF_VIDEO_MSMPEG4_V2, BUF_VIDEO_MSMPEG4_V3,
BUF_VIDEO_IV50, BUF_VIDEO_IV41, BUF_VIDEO_IV32, BUF_VIDEO_IV31,
BUF_VIDEO_CINEPAK, /* BUF_VIDEO_ATIVCR1, */
@@ -1692,7 +1667,7 @@ static const decoder_info_t dec_info_video = {
1 /* priority */
};
-static uint32_t audio_types[] = {
+static const uint32_t audio_types[] = {
BUF_AUDIO_WMAV1, BUF_AUDIO_WMAV2, BUF_AUDIO_WMAPRO, BUF_AUDIO_MSADPCM,
BUF_AUDIO_MSIMAADPCM, BUF_AUDIO_MSGSM, BUF_AUDIO_IMC, BUF_AUDIO_LH,
BUF_AUDIO_VOXWARE, BUF_AUDIO_ACELPNET, BUF_AUDIO_VIVOG723, BUF_AUDIO_WMAV,
@@ -1707,7 +1682,7 @@ static const decoder_info_t dec_info_audio = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 18, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class },
- { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 15, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class },
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class },
+ { PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 16, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/libw32dll/wine/Makefile.am b/src/libw32dll/wine/Makefile.am
index f04560130..a3aeb5684 100644
--- a/src/libw32dll/wine/Makefile.am
+++ b/src/libw32dll/wine/Makefile.am
@@ -1,41 +1,15 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 \
- -I$(top_srcdir)/src/xine-utils
-
-# 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'`
+ -I$(top_srcdir)/src/xine-utils
-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 \
@@ -75,3 +49,22 @@ 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_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+libwine_la_CPPFLAGS = $(AM_CPPFLAGS) $(XDG_BASEDIR_CPPFLAGS)
diff --git a/src/libw32dll/wine/debugtools.h b/src/libw32dll/wine/debugtools.h
index 3b342e10c..c6fac518d 100644
--- a/src/libw32dll/wine/debugtools.h
+++ b/src/libw32dll/wine/debugtools.h
@@ -8,7 +8,7 @@
#include "config.h"
#include "windef.h"
-#include "compat.h"
+#include <xine/compat.h>
struct _GUID;
diff --git a/src/libw32dll/wine/ext.h b/src/libw32dll/wine/ext.h
index f0f505c4d..ad22edc5e 100644
--- a/src/libw32dll/wine/ext.h
+++ b/src/libw32dll/wine/ext.h
@@ -2,7 +2,7 @@
#define loader_ext_h
#include "windef.h"
-#include "attributes.h"
+#include <xine/attributes.h>
extern LPVOID FILE_dommap( int unix_handle, LPVOID start,
DWORD size_high, DWORD size_low,
diff --git a/src/libw32dll/wine/registry.c b/src/libw32dll/wine/registry.c
index 7c4c0f5d8..5f9a3fdc4 100644
--- a/src/libw32dll/wine/registry.c
+++ b/src/libw32dll/wine/registry.c
@@ -18,7 +18,8 @@
#include "debugtools.h"
#ifdef XINE_MAJOR
-#include "xineutils.h"
+#include <xine/xineutils.h>
+#include <basedir.h>
#endif
//#undef TRACE
@@ -302,43 +303,23 @@ static struct reg_value* insert_reg_value(int handle, const char* name, int type
static void init_registry(void)
{
+ xdgHandle tmph;
+ xdgInitHandle(&tmph);
+ 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
- asprintf(&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");
+
+ xdgWipeHandle(&tmph);
}
#if 0
diff --git a/src/libw32dll/wine/win32.c b/src/libw32dll/wine/win32.c
index 38193a649..aba172711 100644
--- a/src/libw32dll/wine/win32.c
+++ b/src/libw32dll/wine/win32.c
@@ -12,7 +12,7 @@ for DLL to know too much about its environment.
************************************************************/
#include "config.h"
-#include "attributes.h"
+#include <xine/attributes.h>
#define QTX
@@ -3036,9 +3036,9 @@ static int WINAPI expGetSystemPaletteEntries(int hdc, int iStartIndex, int nEntr
static int WINAPI expGetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
{
- const short name[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'S', 't', 'a',
+ static const short name[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'S', 't', 'a',
'n', 'd', 'a', 'r', 'd', ' ', 'T', 'i', 'm', 'e', 0};
- const short pname[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'D', 'a', 'y',
+ static const short pname[]={'C', 'e', 'n', 't', 'r', 'a', 'l', ' ', 'D', 'a', 'y',
'l', 'i', 'g', 'h', 't', ' ', 'T', 'i', 'm', 'e', 0};
dbgprintf("GetTimeZoneInformation(%p) => TIME_ZONE_ID_STANDARD\n", lpTimeZoneInformation);
memset(lpTimeZoneInformation, 0, sizeof(TIME_ZONE_INFORMATION));
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
deleted file mode 100644
index ae261e60c..000000000
--- a/src/libxineadec/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = fooaudio.c
-
-if BUILD_NOSEFART
-nosefart_subdir = nosefart
-nosefart_module = xineplug_decode_nsf.la
-endif
-
-SUBDIRS = gsm610 $(nosefart_subdir)
-
-AM_LDFLAGS = $(xineplug_ldflags)
-
-if HAVE_VORBIS
-vorbis_module = xineplug_decode_vorbis.la
-endif
-
-if HAVE_SPEEX
-speex_module = xineplug_decode_speex.la
-endif
-
-xineplug_LTLIBRARIES = \
- xineplug_decode_gsm610.la \
- $(nosefart_module) \
- xineplug_decode_lpcm.la \
- $(vorbis_module) \
- $(speex_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_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) $(LTLIBINTL)
-xineplug_decode_vorbis_la_CFLAGS = $(VISIBILITY_FLAG) $(VORBIS_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)
diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c
deleted file mode 100644
index 776136fc2..000000000
--- a/src/libxineadec/fooaudio.c
+++ /dev/null
@@ -1,352 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * fooaudio.c: This is a reference audio decoder for the xine multimedia
- * player. It really works too! It will output a continuous sine wave in
- * place of the data it should actually send.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-/* math.h required for fooaudio sine wave generation */
-#include <math.h>
-
-#define AUDIOBUFSIZE 128*1024
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} fooaudio_class_t;
-
-typedef struct fooaudio_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- int sample_rate; /* audio sample rate */
- int bits_per_sample; /* bits/sample, usually 8 or 16 */
- int channels; /* 1 or 2, usually */
-
- int output_open; /* flag to indicate audio is ready */
-
- unsigned char *buf; /* data accumulation buffer */
- int bufsize; /* maximum size of buf */
- int size; /* size of accumulated data in buf */
-
- /* fooaudio-specific variables */
- int64_t last_pts;
- unsigned int iteration;
-
-} fooaudio_decoder_t;
-
-/**************************************************************************
- * fooaudio specific decode functions
- *************************************************************************/
-
-/**************************************************************************
- * xine audio plugin functions
- *************************************************************************/
-
-static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen;
- audio_buffer_t *audio_buffer;
- int i;
- int64_t samples_to_generate;
- int samples_to_send;
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
-
- /* When the engine sends a BUF_FLAG_HEADER flag, it is time to initialize
- * the decoder. The buffer element type has 4 decoder_info fields,
- * 0..3. Field 1 is the sample rate. Field 2 is the bits/sample. Field
- * 3 is the number of channels. */
- this->sample_rate = buf->decoder_info[1];
- this->bits_per_sample = buf->decoder_info[2];
- this->channels = buf->decoder_info[3];
-
- /* initialize the data accumulation buffer */
- this->buf = calloc(1, AUDIOBUFSIZE);
- this->bufsize = AUDIOBUFSIZE;
- this->size = 0;
-
- /* take this opportunity to initialize stream/meta information */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "fooaudio");
-
- /* perform any other required initialization */
- this->last_pts = -1;
- this->iteration = 0;
-
- return;
- }
-
- /* if the audio output is not open yet, open the audio output */
-#warning: Audio output is hardcoded to mono 16-bit PCM
- if (!this->output_open) {
- this->output_open = (this->stream->audio_out->open) (
- this->stream->audio_out,
- this->stream,
-/* this->bits_per_sample, */
- 16,
- this->sample_rate,
-/* _x_ao_channels2mode(this->channels));*/
- AO_CAP_MODE_MONO);
- }
-
- /* if the audio still isn't open, do not go any further with the decode */
- if (!this->output_open)
- return;
-
- /* accumulate the data passed through the buffer element type; increase
- * the accumulator buffer size as necessary */
- if( this->size + buf->size > this->bufsize ) {
- this->bufsize = this->size + 2 * buf->size;
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "fooaudio: increasing source buffer to %d to avoid overflow.\n", this->bufsize);
- this->buf = realloc( this->buf, this->bufsize );
- }
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
- this->size += buf->size;
-
- /* When a buffer element type has the BUF_FLAG_FRAME_END flag set, it is
- * time to decode the data in the buffer. */
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
-
- /* This is where the real meat of the audio decoder is implemented.
- * The general strategy is to decode the data in the accumulation buffer
- * into raw PCM data and then dispatch the PCM to the engine in smaller
- * buffers. What follows in the inside of this scope is the meat of
- * this particular audio decoder. */
-
- /* Operation of the fooaudio decoder:
- * This decoder generates a continuous sine pattern based on the pts
- * values sent by the xine engine. Two pts values are needed to know
- * how long to make the audio. Thus, If this is the first frame or
- * a seek has occurred (indicated by this->last_pts = -1),
- * log the pts but do not create any audio.
- *
- * When a valid pts delta is generated, create n audio samples, where
- * n is given as:
- *
- * n pts delta
- * ----------- = --------- => n = (pts delta * sample rate) / 90000
- * sample rate 90000
- *
- */
-
- if (this->last_pts != -1) {
-
- /* no real reason to set this variable to 0 first; I just wanted the
- * novelty of using all 4 basic arithmetic ops in a row (+ - * /) */
- samples_to_generate = 0;
- samples_to_generate += buf->pts;
- samples_to_generate -= this->last_pts;
- samples_to_generate *= this->sample_rate;
- samples_to_generate /= 90000;
-
- /* save the pts now since it will likely be trashed later */
- this->last_pts = buf->pts;
-
- while (samples_to_generate) {
-
- /* get an audio buffer */
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- if (audio_buffer->mem_size == 0) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "fooaudio: Help! Allocated audio buffer with nothing in it!\n");
- return;
- }
-
- /* samples_to_generate is a sample count; mem_size is a byte count */
- if (samples_to_generate > audio_buffer->mem_size / 2)
- samples_to_send = audio_buffer->mem_size / 2;
- else
- samples_to_send = samples_to_generate;
- samples_to_generate -= samples_to_send;
-
-#define WAVE_HZ 300
- /* fill up the samples in the buffer */
- for (i = 0; i < samples_to_send; i++)
- audio_buffer->mem[i] =
- (short)(sin(2 * M_PI * this->iteration++ / WAVE_HZ) * 32767);
-
- /* final prep for audio buffer dispatch */
- audio_buffer->num_frames = samples_to_send;
- audio_buffer->vpts = buf->pts;
- buf->pts = 0; /* only first buffer gets the real pts */
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
- }
- } else {
- /* log the pts for the next time */
- this->last_pts = buf->pts;
- }
-
- /* reset data accumulation buffer */
- this->size = 0;
- }
-}
-
-/* This function resets the state of the audio decoder. This usually
- * entails resetting the data accumulation buffer. */
-static void fooaudio_reset (audio_decoder_t *this_gen) {
-
- fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen;
-
- this->size = 0;
-
- /* this is specific to fooaudio */
- this->last_pts = -1;
-}
-
-/* This function resets the last pts value of the audio decoder. */
-static void fooaudio_discontinuity (audio_decoder_t *this_gen) {
-
- fooaudio_decoder_t *this = (fooaudio_decoder_t *) this_gen;
-
- /* this is specific to fooaudio */
- this->last_pts = -1;
-}
-
-/* This function closes the audio output and frees the private audio decoder
- * structure. */
-static void fooaudio_dispose (audio_decoder_t *this_gen) {
-
- fooaudio_decoder_t *this = (fooaudio_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 */
- free(this->buf);
- free(this);
-}
-
-/* This function allocates, initializes, and returns a private audio
- * decoder structure. */
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- fooaudio_decoder_t *this ;
-
- this = (fooaudio_decoder_t *) calloc(1, sizeof(fooaudio_decoder_t));
-
- /* connect the member functions */
- this->audio_decoder.decode_data = fooaudio_decode_data;
- this->audio_decoder.reset = fooaudio_reset;
- this->audio_decoder.discontinuity = fooaudio_discontinuity;
- this->audio_decoder.dispose = fooaudio_dispose;
-
- /* connect the stream */
- this->stream = stream;
-
- /* audio output is not open at the start */
- this->output_open = 0;
-
- /* initialize the basic audio parameters */
- this->channels = 0;
- this->sample_rate = 0;
- this->bits_per_sample = 0;
-
- /* initialize the data accumulation buffer */
- this->buf = NULL;
- this->bufsize = 0;
- this->size = 0;
-
- /* return the newly-initialized audio decoder */
- return &this->audio_decoder;
-}
-
-/* This function returns a brief string that describes (usually with the
- * decoder's most basic name) the audio decoder plugin. */
-static char *get_identifier (audio_decoder_class_t *this) {
- return "fooaudio";
-}
-
-/* This function returns a slightly longer string describing the audio
- * decoder plugin. */
-static char *get_description (audio_decoder_class_t *this) {
- return "fooaudio: reference xine audio decoder plugin";
-}
-
-/* This function frees the audio decoder class and any other memory that was
- * allocated. */
-static void dispose_class (audio_decoder_class_t *this_gen) {
-
- fooaudio_class_t *this = (fooaudio_class_t *)this_gen;
-
- free (this);
-}
-
-/* This function allocates a private audio decoder class and initializes
- * the class's member functions. */
-static void *init_plugin (xine_t *xine, void *data) {
-
- fooaudio_class_t *this ;
-
- this = (fooaudio_class_t *) xine_malloc (sizeof (fooaudio_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- 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_FOO, */
- 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, "fooaudio", XINE_VERSION_CODE, &dec_info_audio, &init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c
deleted file mode 100644
index c67382bc5..000000000
--- a/src/libxineadec/gsm610.c
+++ /dev/null
@@ -1,293 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * GSM 6.10 Audio Decoder
- * This decoder is based on the GSM 6.10 codec library found at:
- * http://kbs.cs.tu-berlin.de/~jutta/toast.html
- * Additionally, here is an article regarding the software that appeared
- * in Dr. Dobbs Journal:
- * http://www.ddj.com/documents/s=1012/ddj9412b/9412b.htm
- *
- * This is the notice that comes with the software:
- * --------------------------------------------------------------------
- * Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
- * Technische Universitaet Berlin
- *
- * Any use of this software is permitted provided that this notice is not
- * removed and that neither the authors nor the Technische Universitaet Berlin
- * are deemed to have made any representations as to the suitability of this
- * software for any purpose nor are held responsible for any defects of
- * this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
- *
- * As a matter of courtesy, the authors request to be informed about uses
- * this software has found, about bugs in this software, and about any
- * improvements that may be of general interest.
- *
- * Berlin, 28.11.1994
- * Jutta Degener
- * Carsten Bormann
- * --------------------------------------------------------------------
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-#include "gsm610/private.h"
-#include "gsm610/gsm.h"
-
-#define AUDIOBUFSIZE 128*1024
-
-#define GSM610_SAMPLE_SIZE 16
-#define GSM610_BLOCK_SIZE 160
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} gsm610_class_t;
-
-typedef struct gsm610_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- unsigned int buf_type;
- int output_open;
- int sample_rate;
-
- unsigned char *buf;
- int bufsize;
- int size;
-
- unsigned short decode_buffer[GSM610_BLOCK_SIZE];
- gsm gsm_state;
-
-} gsm610_decoder_t;
-
-/**************************************************************************
- * xine audio plugin functions
- *************************************************************************/
-
-static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- gsm610_decoder_t *this = (gsm610_decoder_t *) this_gen;
- audio_buffer_t *audio_buffer;
- int in_ptr;
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
- this->sample_rate = buf->decoder_info[1];
-
- this->buf = calloc(1, AUDIOBUFSIZE);
- this->bufsize = AUDIOBUFSIZE;
- this->size = 0;
-
- /* stream/meta info */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "GSM 6.10");
-
- return;
- }
-
- if (!this->output_open) {
-
- this->gsm_state = gsm_create();
- this->buf_type = buf->type;
-
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream, GSM610_SAMPLE_SIZE, this->sample_rate, AO_CAP_MODE_MONO);
- }
-
- /* if the audio still isn't open, bail */
- if (!this->output_open)
- return;
-
- if( this->size + buf->size > this->bufsize ) {
- this->bufsize = this->size + 2 * buf->size;
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "gsm610: increasing source buffer to %d to avoid overflow.\n", this->bufsize);
- this->buf = realloc( this->buf, this->bufsize );
- }
-
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
- this->size += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) { /* time to decode a frame */
-
- /* handle the Microsoft variant of GSM data */
- if (this->buf_type == BUF_AUDIO_MSGSM) {
-
- this->gsm_state->wav_fmt = 1;
-
- /* the data should line up on a 65-byte boundary */
- if ((buf->size % 65) != 0) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
- "gsm610: received MS GSM block that does not line up\n");
- this->size = 0;
- return;
- }
-
- in_ptr = 0;
- while (this->size) {
- gsm_decode(this->gsm_state, &this->buf[in_ptr], this->decode_buffer);
- if ((in_ptr % 65) == 0) {
- in_ptr += 33;
- this->size -= 33;
- } else {
- in_ptr += 32;
- this->size -= 32;
- }
-
- /* dispatch the decoded audio; assume that the audio buffer will
- * 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,
- GSM610_BLOCK_SIZE * 2);
- audio_buffer->num_frames = GSM610_BLOCK_SIZE;
-
- audio_buffer->vpts = buf->pts;
- buf->pts = 0; /* only first buffer gets the real pts */
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
- }
- } else {
-
- /* handle the other variant, which consists of 33-byte blocks */
- this->gsm_state->wav_fmt = 0;
-
- /* the data should line up on a 33-byte boundary */
- if ((buf->size % 33) != 0) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "gsm610: received GSM block that does not line up\n");
- this->size = 0;
- return;
- }
-
- in_ptr = 0;
- while (this->size) {
- gsm_decode(this->gsm_state, &this->buf[in_ptr], this->decode_buffer);
- in_ptr += 33;
- this->size -= 33;
-
- /* dispatch the decoded audio; assume that the audio buffer will
- * 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,
- GSM610_BLOCK_SIZE * 2);
- audio_buffer->num_frames = GSM610_BLOCK_SIZE;
-
- audio_buffer->vpts = buf->pts;
- buf->pts = 0; /* only first buffer gets the real pts */
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
- }
- }
- }
-}
-
-static void gsm610_reset (audio_decoder_t *this_gen) {
-}
-
-static void gsm610_discontinuity (audio_decoder_t *this_gen) {
-}
-
-static void gsm610_dispose (audio_decoder_t *this_gen) {
-
- gsm610_decoder_t *this = (gsm610_decoder_t *) this_gen;
-
- if (this->gsm_state)
- gsm_destroy(this->gsm_state);
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
- this->output_open = 0;
-
- if (this->buf)
- free(this->buf);
-
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- gsm610_decoder_t *this ;
-
- this = (gsm610_decoder_t *) calloc(1, sizeof(gsm610_decoder_t));
-
- this->audio_decoder.decode_data = gsm610_decode_data;
- this->audio_decoder.reset = gsm610_reset;
- this->audio_decoder.discontinuity = gsm610_discontinuity;
- this->audio_decoder.dispose = gsm610_dispose;
-
- this->output_open = 0;
- this->sample_rate = 0;
- this->stream = stream;
- this->buf = NULL;
- this->size = 0;
-
- return &this->audio_decoder;
-}
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "GSM 6.10";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "GSM 6.10 audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- gsm610_class_t *this ;
-
- this = (gsm610_class_t *) calloc(1, sizeof(gsm610_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_MSGSM,
- BUF_AUDIO_GSM610,
- 0
-};
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 9 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "gsm610", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxineadec/gsm610/Makefile.am b/src/libxineadec/gsm610/Makefile.am
deleted file mode 100644
index 6ec2e0a5e..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 = $(xineplug_ldflags)
-
-noinst_HEADERS = \
- gsm_config.h \
- gsm.h \
- private.h \
- proto.h \
- unproto.h
diff --git a/src/libxineadec/gsm610/long_term.c b/src/libxineadec/gsm610/long_term.c
deleted file mode 100644
index d3ef1b63d..000000000
--- a/src/libxineadec/gsm610/long_term.c
+++ /dev/null
@@ -1,964 +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 $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#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 7a8a8e2bc..000000000
--- a/src/libxineadec/gsm610/lpc.c
+++ /dev/null
@@ -1,354 +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 $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#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/rpe.c b/src/libxineadec/gsm610/rpe.c
deleted file mode 100644
index be1b1529b..000000000
--- a/src/libxineadec/gsm610/rpe.c
+++ /dev/null
@@ -1,493 +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 $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#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 c2d64853b..000000000
--- a/src/libxineadec/gsm610/short_term.c
+++ /dev/null
@@ -1,432 +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 $ */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#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/nosefart/Makefile.am b/src/libxineadec/nosefart/Makefile.am
deleted file mode 100644
index 4ca4f75b6..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 e46633478..000000000
--- a/src/libxineadec/nosefart/diff_to_nosefart_cvs.patch
+++ /dev/null
@@ -1,325 +0,0 @@
---- a/src/libxineadec/nosefart/log.h 2010-11-28 19:57:41.000000000 +0100
-+++ b/src/libxineadec/nosefart/log.h 2010-10-10 21:03:43.000000000 +0200
-@@ -27,11 +27,12 @@
- #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, ...);
-+extern void log_printf(const char *format, ...) XINE_FORMAT_PRINTF(1, 2);
-
- #endif /* _LOG_H_ */
-
-diff -r fe4287194cac src/libxineadec/nosefart/nes_apu.h
---- /src/libxineadec/nosefart/nes_apu.h 2007-12-14 05:46:22.000000000 +0100
-+++ /src/libxineadec/nosefart/nes_apu.h 2010-11-28 20:13:05.000000000 +0100
-@@ -289,6 +289,7 @@ extern void apu_write(uint32 address, ui
- /* for visualization */
- extern void apu_getpcmdata(void **data, int *num_samples, int *sample_bits);
-
-+extern void apu_setcontext(apu_t *src_apu);
-
- #ifdef __cplusplus
- }
-diff -r fe4287194cac src/libxineadec/nosefart/fmopl.c
---- a/src/libxineadec/nosefart/fmopl.c Sun Nov 28 20:32:56 2010 +0100
-+++ b/src/libxineadec/nosefart/fmopl.c Sun Nov 28 20:22:51 2010 +0100
-@@ -18,9 +18,9 @@
- #include <stdlib.h>
- #include <string.h>
- #include <stdarg.h>
-+#include <math.h>
- //#include "driver.h" /* use M.A.M.E. */
- #include "fmopl.h"
--#include <math.h>
-
- /* MPC - hacks */
- #include "types.h"
-@@ -218,19 +218,6 @@ static INT32 feedback2; /* connect for
-
- /* --------------------- subroutines --------------------- */
-
--/* There's no good reason why I should have to do this, but using "pow"
--(the POSIX fuction) causes it to not compile on my machine
----Matthew Strait */
--double mypow(float base, int power)
--{
-- int ans = 1, k;
--
-- for( k = 0; k < power; k++)
-- ans *= (int)base;
--
-- return ans;
--}
--
- INLINE int Limit( int val, int max, int min ) {
- if ( val > max )
- val = max;
-@@ -628,7 +615,7 @@ static int OPLOpenTable( void )
- }
- /* make total level table */
- for (t = 0;t < EG_ENT-1 ;t++){
-- rate = ((1<<TL_BITS)-1)/mypow(10,EG_STEP*t/20); /* dB -> voltage */
-+ 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]));*/
-@@ -663,7 +650,7 @@ static int OPLOpenTable( void )
- for (i=0; i<EG_ENT; i++)
- {
- /* ATTACK curve */
-- pom = (float)mypow( ((double)(EG_ENT-1-i)/EG_ENT) , 8 ) * EG_ENT;
-+ 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 */
-@@ -1334,5 +1321,3 @@ int OPLTimerOver(FM_OPL *OPL,int c)
- if (OPL->TimerHandler) (OPL->TimerHandler)(OPL->TimerParam+c,(double)OPL->T[c]*OPL->TimerBase);
- return OPL->status>>7;
- }
--
--
-diff -r d92191344055 src/libxineadec/nosefart/memguard.c
---- a/src/libxineadec/nosefart/memguard.c Sun Nov 28 20:42:19 2010 +0100
-+++ b/src/libxineadec/nosefart/memguard.c Sun Nov 28 20:47:08 2010 +0100
-@@ -33,6 +33,15 @@
-
- #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"
-
-@@ -271,7 +280,7 @@
- char fail[256];
-
- if (NULL == data || NULL == *data
-- || 0xFFFFFFFF == (uint32) *data || 0xFFFFFFFF == (uint32) 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",
-diff -r 075029931740 src/libxineadec/nosefart/osd.h
---- a/src/libxineadec/nosefart/osd.h Sun Nov 28 21:04:01 2010 +0100
-+++ b/src/libxineadec/nosefart/osd.h Sun Nov 28 15:12:02 2010 +0100
-@@ -27,7 +27,7 @@
- #define _OSD_H_
-
-
--#ifdef __GNUC__
-+#if defined(__GNUC__) || defined(__ICC)
- #define __PACKED__ __attribute__ ((packed))
- #define PATH_SEP '/'
- #ifdef __DJGPP__
-diff -r 075029931740 src/libxineadec/nosefart/types.h
---- a/src/libxineadec/nosefart/types.h 2010-11-28 21:11:10.000000000 +0100
-+++ b/src/libxineadec/nosefart/types.h 2010-11-28 21:07:45.000000000 +0100
-@@ -23,8 +23,12 @@
- ** $Id: types.h,v 1.4 2004/08/27 19:33:37 valtri Exp $
- */
-
--#ifndef _TYPES_H_
--#define _TYPES_H_
-+#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 */
-
-@@ -95,7 +99,7 @@
- #define ASSERT_MSG(msg)
- #endif
-
--#endif /* _TYPES_H_ */
-+#endif /* _NOSEFART_TYPES_H_ */
-
- /*
- ** $Log: types.h,v $
-diff -r 075029931740 src/libxineadec/nosefart/nes6502.h
---- a/src/libxineadec/nosefart/nes6502.h Sun Nov 28 15:12:02 2010 +0100
-+++ b/src/libxineadec/nosefart/nes6502.h Sun Nov 28 21:18:28 2010 +0100
-@@ -23,6 +23,9 @@
- ** $Id: nes6502.h,v 1.2 2003/12/05 15:55:01 f1rmb Exp $
- */
-
-+/* straitm */
-+#include "types.h"
-+
- /* NOTE: 16-bit addresses avoided like the plague: use 32-bit values
- ** wherever humanly possible
- */
-diff -r 075029931740 src/libxineadec/nosefart/nsf.c
---- a/src/libxineadec/nosefart/nsf.c 2007-12-14 05:46:22.000000000 +0100
-+++ b/src/libxineadec/nosefart/nsf.c 2010-11-28 21:31:22.000000000 +0100
-@@ -693,7 +693,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
- #if 0
- if (length <= NSF_HEADER_SIZE) {
- log_printf("nsf : [%s] not an NSF format file\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
- #endif
-@@ -701,14 +701,14 @@ nsf_t * nsf_load_extended(struct nsf_loa
- /* Read magic */
- if (loader->read(loader, id, 5)) {
- log_printf("nsf : [%s] error reading magic number\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
-
- /* Check magic */
- if (memcmp(id, NSF_MAGIC, 5)) {
- log_printf("nsf : [%s] is not an NSF format file\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
-
-@@ -719,7 +719,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
-
- if (NULL == temp_nsf) {
- log_printf("nsf : [%s] error allocating nsf header\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
- /* $$$ ben : safety net */
-@@ -730,7 +730,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
- /* Read header (without MAGIC) */
- if (loader->read(loader, (int8 *)temp_nsf+5, NSF_HEADER_SIZE - 5)) {
- log_printf("nsf : [%s] error reading nsf header\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
-
-@@ -763,7 +763,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
-
- if (temp_nsf->length <= 0) {
- log_printf("nsf : [%s] not an NSF format file (missing data)\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
-
-@@ -778,14 +778,14 @@ nsf_t * nsf_load_extended(struct nsf_loa
- }
- if (NULL == temp_nsf->data) {
- log_printf("nsf : [%s] error allocating nsf data\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
-
- /* Read data */
- if (loader->read(loader, temp_nsf->data, temp_nsf->length)) {
- log_printf("nsf : [%s] error reading NSF data\n",
-- loader->fname(loader));
-+ loader->fname);
- goto error;
- }
-
-@@ -805,7 +805,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
-
- if (size < sizeof(nsf_file_ext)) {
- log_printf("nsf : [%s] corrupt extension size (%d)\n",
-- loader->fname(loader), size);
-+ loader->fname, size);
- /* Not a fatal error here. Just skip extension loading. */
- break;
- }
-@@ -827,7 +827,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
-
- if (loader->read(loader, tmp_time, size)) {
- log_printf("nsf : [%s] missing extension data\n",
-- loader->fname(loader));
-+ loader->fname);
- /* Not a fatal error here. Just skip extension loading. */
- break;
- }
-@@ -835,7 +835,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
- temp_nsf->song_frames = malloc(sizeof(*temp_nsf->song_frames) * songs);
- if (!temp_nsf->song_frames) {
- log_printf("nsf : [%s] extension alloc failed\n",
-- loader->fname(loader));
-+ loader->fname);
- /* Not a fatal error here. Just skip extension loading. */
- break;
- }
-@@ -858,7 +858,7 @@ nsf_t * nsf_load_extended(struct nsf_loa
- }
- } else if (loader->skip(loader, size)) {
- log_printf("nsf : [%s] extension skip failed\n",
-- loader->fname(loader));
-+ loader->fname);
- /* Not a fatal error here. Just skip extension loading. */
- break;
- }
-diff -r 8bf4ad557dac src/libxineadec/nosefart/nsf.h
---- a/src/libxineadec/nosefart/nsf.h Tue Nov 30 23:30:19 2010 +0100
-+++ b/src/libxineadec/nosefart/nsf.h Tue Nov 30 23:38:15 2010 +0100
-@@ -67,22 +67,22 @@
- typedef struct nsf_s
- {
- /* NESM header */
-- uint8 id[5] __PACKED__; /* NESM\x1A */
-- uint8 version __PACKED__; /* spec version */
-- uint8 num_songs __PACKED__; /* total num songs */
-- uint8 start_song __PACKED__; /* first song */
-- uint16 load_addr __PACKED__; /* loc to load code */
-- uint16 init_addr __PACKED__; /* init call address */
-- uint16 play_addr __PACKED__; /* play call address */
-- uint8 song_name[32] __PACKED__; /* name of song */
-- uint8 artist_name[32] __PACKED__; /* artist name */
-- uint8 copyright[32] __PACKED__; /* copyright info */
-- uint16 ntsc_speed __PACKED__; /* playback speed (if NTSC) */
-- uint8 bankswitch_info[8] __PACKED__; /* initial code banking */
-- uint16 pal_speed __PACKED__; /* playback speed (if PAL) */
-- uint8 pal_ntsc_bits __PACKED__; /* NTSC/PAL determination bits */
-- uint8 ext_sound_type __PACKED__; /* type of external sound gen. */
-- uint8 reserved[4] __PACKED__; /* reserved */
-+ 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 */
-@@ -105,7 +105,7 @@
-
- /* our main processing routine, calls all external mixing routines */
- void (*process)(void *buffer, int num_samples);
--} nsf_t;
-+} __PACKED__ nsf_t;
-
- /* $$$ ben : Generic loader struct */
- struct nsf_loader_t {
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/nsf.h b/src/libxineadec/nosefart/nsf.h
deleted file mode 100644
index 356c187a3..000000000
--- a/src/libxineadec/nosefart/nsf.h
+++ /dev/null
@@ -1,184 +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,
- NSF_FILTER_MAX, /* $$$ ben : add this one for range chacking */
-};
-
-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? */
-
- /* $$$ ben : Playing time ... */
- uint32 cur_frame;
- uint32 cur_frame_end;
- uint32 * song_frames;
-
- /* $$$ ben : Last error string */
- const char * errstr;
-
- /* 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;
-
-/* $$$ ben : Generic loader struct */
-struct nsf_loader_t {
- /* Init and open. */
- int (*open)(struct nsf_loader_t * loader);
-
- /* Close and shutdown. */
- void (*close) (struct nsf_loader_t * loader);
-
- /* This function should return <0 on error, else the number of byte NOT read.
- * that way a simple 0 test tell us if read was complete.
- */
- int (*read) (struct nsf_loader_t * loader, void *data, int n);
-
- /* Get file length. */
- int (*length) (struct nsf_loader_t * loader);
-
- /* Skip n bytes. */
- int (*skip) (struct nsf_loader_t * loader,int n);
-
- /* Get filename (for debug). */
- const char * (*fname) (struct nsf_loader_t * loader);
-
-};
-
-/* Function prototypes */
-extern int nsf_init(void);
-
-extern nsf_t * nsf_load_extended(struct nsf_loader_t * loader);
-extern nsf_t *nsf_load(const char *filename, void *source, int length);
-extern void nsf_free(nsf_t **nsf_info);
-
-extern int nsf_playtrack(nsf_t *nsf, int track, int sample_rate,
- int sample_bits, boolean stereo);
-extern void nsf_frame(nsf_t *nsf);
-extern int nsf_setchan(nsf_t *nsf, int chan, boolean enabled);
-extern int nsf_setfilter(nsf_t *nsf, int filter_type);
-
-#endif /* _NSF_H_ */
-
-/*
-** $Log: nsf.h,v $
-** Revision 1.3 2003/05/01 22:34:20 benjihan
-** New NSF plugin
-**
-** Revision 1.2 2003/04/09 14:50:32 ben
-** Clean NSF api.
-**
-** Revision 1.1 2003/04/08 20:53:00 ben
-** Adding more files...
-**
-** 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/nsf.c b/src/libxineadec/nsf.c
deleted file mode 100644
index 643d431a2..000000000
--- a/src/libxineadec/nsf.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * NSF Audio "Decoder" using the Nosefart NSF engine by Matt Conte
- * http://www.baisoku.org/
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-/* Nosefart includes */
-#include "nosefart/types.h"
-#include "nosefart/nsf.h"
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} nsf_class_t;
-
-typedef struct nsf_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- int sample_rate; /* audio sample rate */
- int bits_per_sample; /* bits/sample, usually 8 or 16 */
- int channels; /* 1 or 2, usually */
-
- int output_open; /* flag to indicate audio is ready */
-
- int nsf_size;
- unsigned char *nsf_file;
- int nsf_index;
- int song_number;
-
- /* nsf-specific variables */
- int64_t last_pts;
- unsigned int iteration;
-
- nsf_t *nsf;
-} nsf_decoder_t;
-
-/**************************************************************************
- * xine audio plugin functions
- *************************************************************************/
-
-static void nsf_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- nsf_decoder_t *this = (nsf_decoder_t *) this_gen;
- audio_buffer_t *audio_buffer;
-
- if (buf->decoder_flags & BUF_FLAG_HEADER) {
-
- /* When the engine sends a BUF_FLAG_HEADER flag, it is time to initialize
- * the decoder. The buffer element type has 4 decoder_info fields,
- * 0..3. Field 1 is the sample rate. Field 2 is the bits/sample. Field
- * 3 is the number of channels. */
- this->sample_rate = buf->decoder_info[1];
- this->bits_per_sample = buf->decoder_info[2];
- this->channels = buf->decoder_info[3];
-
- /* take this opportunity to initialize stream/meta information */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC,
- "NES Music (Nosefart)");
-
- this->song_number = buf->content[4];
- /* allocate a buffer for the file */
- this->nsf_size = _X_BE_32(&buf->content[0]);
- this->nsf_file = calloc(1, this->nsf_size);
- this->nsf_index = 0;
-
- /* peform any other required initialization */
- this->last_pts = -1;
- this->iteration = 0;
-
- return;
- }
-
- /* accumulate chunks from the NSF file until whole file is received */
- if (this->nsf_index < this->nsf_size) {
- xine_fast_memcpy(&this->nsf_file[this->nsf_index], buf->content,
- buf->size);
- this->nsf_index += buf->size;
-
- if (this->nsf_index == this->nsf_size) {
- /* file has been received, proceed to initialize engine */
- nsf_init();
- this->nsf = nsf_load(NULL, this->nsf_file, this->nsf_size);
- if (!this->nsf) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "nsf: could not initialize NSF\n");
- /* make the decoder return on every subsequent buffer */
- this->nsf_index = 0;
- return;
- }
- this->nsf->current_song = this->song_number;
- nsf_playtrack(this->nsf, this->nsf->current_song, this->sample_rate,
- this->bits_per_sample, this->channels);
- }
- return;
- }
-
- /* if the audio output is not open yet, open the audio output */
- 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,
- _x_ao_channels2mode(this->channels));
- }
-
- /* if the audio still isn't open, do not go any further with the decode */
- if (!this->output_open)
- return;
-
- /* check if a song change was requested */
- if (buf->decoder_info[1]) {
- this->nsf->current_song = buf->decoder_info[1];
- nsf_playtrack(this->nsf, this->nsf->current_song, this->sample_rate,
- this->bits_per_sample, this->channels);
- }
-
- /* time to decode a frame */
- if (this->last_pts != -1) {
-
- /* process a frame */
- nsf_frame(this->nsf);
-
- /* get an audio buffer */
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
- if (audio_buffer->mem_size == 0) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "nsf: Help! Allocated audio buffer with nothing in it!\n");
- return;
- }
-
- apu_process(audio_buffer->mem, this->sample_rate / this->nsf->playback_rate);
- audio_buffer->vpts = buf->pts;
- audio_buffer->num_frames = this->sample_rate / this->nsf->playback_rate;
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
- }
- this->last_pts = buf->pts;
-}
-
-/* This function resets the state of the audio decoder. This usually
- * entails resetting the data accumulation buffer. */
-static void nsf_reset (audio_decoder_t *this_gen) {
-
- nsf_decoder_t *this = (nsf_decoder_t *) this_gen;
-
- this->last_pts = -1;
-}
-
-/* This function resets the last pts value of the audio decoder. */
-static void nsf_discontinuity (audio_decoder_t *this_gen) {
-
- nsf_decoder_t *this = (nsf_decoder_t *) this_gen;
-
- this->last_pts = -1;
-}
-
-/* This function closes the audio output and frees the private audio decoder
- * structure. */
-static void nsf_dispose (audio_decoder_t *this_gen) {
-
- nsf_decoder_t *this = (nsf_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 */
- nsf_free(&this->nsf);
- free(this->nsf_file);
- free(this);
-}
-
-/* This function allocates, initializes, and returns a private audio
- * decoder structure. */
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- nsf_decoder_t *this ;
-
- this = (nsf_decoder_t *) calloc(1, sizeof(nsf_decoder_t));
-
- /* connect the member functions */
- this->audio_decoder.decode_data = nsf_decode_data;
- this->audio_decoder.reset = nsf_reset;
- this->audio_decoder.discontinuity = nsf_discontinuity;
- this->audio_decoder.dispose = nsf_dispose;
-
- /* connect the stream */
- this->stream = stream;
-
- /* audio output is not open at the start */
- this->output_open = 0;
-
- /* initialize the basic audio parameters */
- this->channels = 0;
- this->sample_rate = 0;
- this->bits_per_sample = 0;
-
- /* return the newly-initialized audio decoder */
- return &this->audio_decoder;
-}
-
-/* This function returns a brief string that describes (usually with the
- * decoder's most basic name) the audio decoder plugin. */
-static char *get_identifier (audio_decoder_class_t *this) {
- return "NSF";
-}
-
-/* This function returns a slightly longer string describing the audio
- * decoder plugin. */
-static char *get_description (audio_decoder_class_t *this) {
- return "NES Music audio decoder plugin";
-}
-
-/* This function frees the audio decoder class and any other memory that was
- * allocated. */
-static void dispose_class (audio_decoder_class_t *this_gen) {
-
- nsf_class_t *this = (nsf_class_t *)this_gen;
-
- free (this);
-}
-
-/* This function allocates a private audio decoder class and initializes
- * the class's member functions. */
-static void *init_plugin (xine_t *xine, void *data) {
-
- nsf_class_t *this ;
-
- this = (nsf_class_t *) calloc(1, sizeof(nsf_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- 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/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c
deleted file mode 100644
index 100fcee9a..000000000
--- a/src/libxineadec/xine_lpcm_decoder.c
+++ /dev/null
@@ -1,417 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * 31-8-2001 Added LPCM rate sensing.
- * (c) 2001 James Courtier-Dutton James@superbug.demon.co.uk
- */
-
-#ifndef __sun
-#define _XOPEN_SOURCE 500
-#endif
-/* avoid compiler warnings */
-#define _BSD_SOURCE 1
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <netinet/in.h> /* ntohs */
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-
-#ifdef WIN32
-#include <winsock.h>
-/*#include <Winsock2.h>*/ /* htons */
-#endif
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} lpcm_class_t;
-
-typedef struct lpcm_decoder_s {
- audio_decoder_t audio_decoder;
-
- xine_stream_t *stream;
-
- uint32_t rate;
- uint32_t bits_per_sample;
- uint32_t number_of_channels;
- uint32_t ao_cap_mode;
-
- int output_open;
- int cpu_be; /* TRUE, if we're a Big endian CPU */
-
- int64_t pts;
-
- uint8_t *buf;
- size_t buffered_bytes;
- size_t buf_size;
-
-} lpcm_decoder_t;
-
-static void lpcm_reset (audio_decoder_t *this_gen) {
-
- lpcm_decoder_t *this = (lpcm_decoder_t *) this_gen;
-
- free (this->buf);
- this->buf = NULL;
-}
-
-static void lpcm_discontinuity (audio_decoder_t *this_gen) {
-
- lpcm_reset(this_gen);
-}
-
-static void lpcm_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- lpcm_decoder_t *this = (lpcm_decoder_t *) this_gen;
- int16_t *sample_buffer=(int16_t *)buf->content;
- int buf_size = buf->size;
- int stream_be;
- audio_buffer_t *audio_buffer;
- int format_changed = 0;
- int special_dvd_audio = 0;
-
- /* Drop preview data */
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- /* get config byte from mpeg2 stream */
- if ( (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
- buf->decoder_info[1] == BUF_SPECIAL_LPCM_CONFIG ) {
- unsigned int bits_per_sample = 16;
- unsigned int sample_rate = 0;
- unsigned int num_channels;
-
- lprintf("lpcm_decoder: config data 0x%x\n", buf->decoder_info[2]);
-
- /* BluRay PCM header is 4 bytes */
- if (buf->decoder_info[2] & 0xffffff00) {
- static const uint8_t channels[16] = {0, 1, 0, 2, 3, 3, 4, 4, 5, 6, 7, 8, 0, 0, 0, 0};
-
- num_channels = channels[(buf->decoder_info[2] >> (16+4)) & 0x0f];
- switch ((buf->decoder_info[2] >> (24+6)) & 0x03) {
- case 1: bits_per_sample = 16; break;
- case 2: /*bits_per_sample = 20; break;*/
- /* fall thru. Samples are 0-padded to 24 bits, and
- * converted later to 16 bits by dropping 8 lowest bits.
- * this needs to be changed if audio out some day accepts 24bit samples.
- */
- case 3: bits_per_sample = 24; break;
- default: bits_per_sample = 0; break;
- }
- switch ((buf->decoder_info[2] >> 16) & 0x0f) {
- case 1: sample_rate = 48000; break;
- case 4: sample_rate = 96000; break;
- case 5: sample_rate = 192000; break;
- default: sample_rate = 0; break;
- }
-
- if (!num_channels || !sample_rate || !bits_per_sample)
- xine_log (this->stream->xine, XINE_LOG_MSG,
- "lpcm_decoder: unsupported BluRay PCM format: 0x%08x\n", buf->decoder_info[2]);
-
- if (this->buffered_bytes)
- xine_log (this->stream->xine, XINE_LOG_MSG, "lpcm_decoder: %zd bytes lost !\n", this->buffered_bytes);
-
- if (!this->buf) {
- this->buffered_bytes = 0;
- this->buf_size = 8128;
- this->buf = malloc(this->buf_size);
- }
-
- } else {
-
- /* MPEG2/DVD PCM header is one byte */
- num_channels = (buf->decoder_info[2] & 0x7) + 1;
- switch ((buf->decoder_info[2]>>4) & 3) {
- case 0: sample_rate = 48000; break;
- case 1: sample_rate = 96000; break;
- case 2: sample_rate = 44100; break;
- case 3: sample_rate = 32000; break;
- }
- switch ((buf->decoder_info[2]>>6) & 3) {
- case 0: bits_per_sample = 16; break;
- case 1: bits_per_sample = 20; break;
- case 2: bits_per_sample = 24; special_dvd_audio = 1; break;
- }
- }
-
- if( this->bits_per_sample != bits_per_sample ||
- this->number_of_channels != num_channels ||
- this->rate != sample_rate ||
- !this->output_open ) {
- this->bits_per_sample = bits_per_sample;
- this->number_of_channels = num_channels;
- this->rate = sample_rate;
- format_changed++;
-
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
- "lpcm_decoder: format changed to %d channels, %d bits per sample, %d Hz, %d kbit/s\n",
- num_channels, bits_per_sample, sample_rate, (num_channels * sample_rate * bits_per_sample)/1024);
- }
- }
-
- if( buf->decoder_flags & BUF_FLAG_STDHEADER ) {
- this->rate=buf->decoder_info[1];
- this->bits_per_sample=buf->decoder_info[2];
- this->number_of_channels=buf->decoder_info[3];
- format_changed++;
- }
-
- /*
- * (re-)open output device
- */
- if ( format_changed ) {
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
- this->ao_cap_mode=_x_ao_channels2mode(this->number_of_channels);
-
- /* force 24-bit samples into 16 bits for now */
- if (this->bits_per_sample == 24)
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream,
- 16,
- this->rate,
- this->ao_cap_mode) ;
- else
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out, this->stream,
- this->bits_per_sample,
- this->rate,
- this->ao_cap_mode) ;
-
- /* stream/meta info */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "Linear PCM");
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
- this->bits_per_sample * this->rate * this->number_of_channels);
- }
-
- if (!this->output_open || (buf->decoder_flags & BUF_FLAG_HEADER) )
- return;
-
- if (buf->pts && !this->pts)
- this->pts = buf->pts;
-
- /* data accumulation */
- if (this->buf) {
- int frame_end = buf->decoder_flags & BUF_FLAG_FRAME_END;
- if (this->buffered_bytes || !frame_end) {
- if (this->buf_size < this->buffered_bytes + buf->size) {
- this->buf_size *= 2;
- this->buf = realloc(this->buf, this->buf_size);
- }
-
- memcpy(this->buf + this->buffered_bytes, buf->content, buf->size);
- this->buffered_bytes += buf->size;
-
- if (!frame_end)
- return;
-
- sample_buffer = (int16_t*)this->buf;
- buf_size = this->buffered_bytes;
- this->buffered_bytes = 0;
- }
- }
-
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
-
- /* Swap LPCM samples into native byte order, if necessary */
- buf->type &= 0xffff0000;
- stream_be = ( buf->type == BUF_AUDIO_LPCM_BE );
-
- if( this->bits_per_sample == 16 ){
- if (stream_be != this->cpu_be)
- swab (sample_buffer, audio_buffer->mem, buf_size);
- else
- memcpy (audio_buffer->mem, sample_buffer, buf_size);
- }
- else if( this->bits_per_sample == 20 ) {
- uint8_t *s = (uint8_t *)sample_buffer;
- uint8_t *d = (uint8_t *)audio_buffer->mem;
- int n = buf_size;
-
- if (stream_be != this->cpu_be) {
- while( n >= 0 ) {
- swab( s, d, 8 );
- s += 10;
- d += 8;
- n -= 10;
- }
- } else {
- while( n >= 0 ) {
- memcpy( d, s, 8 );
- s += 10;
- d += 8;
- n -= 10;
- }
- }
- } else if( this->bits_per_sample == 24 ) {
- uint8_t *s = (uint8_t *)sample_buffer;
- uint8_t *d = (uint8_t *)audio_buffer->mem;
- int n = buf_size;
-
- if ( stream_be ) {
- if (special_dvd_audio)
- while (n >= 12) {
- if ( stream_be == this->cpu_be ) {
- *d++ = s[0];
- *d++ = s[1];
- *d++ = s[2];
- *d++ = s[3];
- *d++ = s[4];
- *d++ = s[5];
- *d++ = s[6];
- *d++ = s[7];
- } else {
- *d++ = s[1];
- *d++ = s[0];
- *d++ = s[3];
- *d++ = s[2];
- *d++ = s[5];
- *d++ = s[4];
- *d++ = s[7];
- *d++ = s[6];
- }
- s += 12;
- n -= 12;
- }
- else
- while (n >= 3) {
- if ( stream_be == this->cpu_be ) {
- *d++ = s[0];
- *d++ = s[1];
- } else {
- *d++ = s[1];
- *d++ = s[0];
- }
- s += 3;
- n -= 3;
- }
- } else {
- while (n >= 3) {
- if ( stream_be == this->cpu_be ) {
- *d++ = s[1];
- *d++ = s[2];
- } else {
- *d++ = s[2];
- *d++ = s[1];
- }
- s += 3;
- n -= 3;
- }
- }
-
- if ( (d - (uint8_t*)audio_buffer->mem)/2*3 < buf_size )
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "lpcm_decoder: lost %i bytes of %i in the buffer\n", (int)(buf_size - (d - (uint8_t*)audio_buffer->mem)/2*3), buf_size);
-
- } else {
- memcpy (audio_buffer->mem, sample_buffer, buf_size);
- }
-
- audio_buffer->vpts = this->pts;
- audio_buffer->num_frames = (((buf_size*8)/this->number_of_channels)/this->bits_per_sample);
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
- this->pts = 0;
-}
-
-static void lpcm_dispose (audio_decoder_t *this_gen) {
- lpcm_decoder_t *this = (lpcm_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->buf);
-
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- lpcm_decoder_t *this ;
-
- this = (lpcm_decoder_t *) calloc(1, sizeof(lpcm_decoder_t));
-
- this->audio_decoder.decode_data = lpcm_decode_data;
- this->audio_decoder.reset = lpcm_reset;
- this->audio_decoder.discontinuity = lpcm_discontinuity;
- this->audio_decoder.dispose = lpcm_dispose;
-
- this->output_open = 0;
- this->rate = 0;
- this->bits_per_sample=0;
- this->number_of_channels=0;
- this->ao_cap_mode=0;
- this->stream = stream;
-
- this->cpu_be = ( htons(1) == 1 );
-
- return &this->audio_decoder;
-}
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "Linear PCM";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "Linear PCM audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- lpcm_class_t *this ;
-
- this = (lpcm_class_t *) calloc(1, sizeof(lpcm_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_LPCM_BE, BUF_AUDIO_LPCM_LE, 0
-};
-
-static const decoder_info_t dec_info_audio = {
- audio_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_DECODER, 15, "pcm", XINE_VERSION_CODE, &dec_info_audio, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxineadec/xine_speex_decoder.c b/src/libxineadec/xine_speex_decoder.c
deleted file mode 100644
index 9ae2e9718..000000000
--- a/src/libxineadec/xine_speex_decoder.c
+++ /dev/null
@@ -1,422 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * (ogg/)speex audio decoder plugin (libspeex wrapper) for xine
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#define LOG_MODULE "speex_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-#define LOG_BUFFERS 0
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-
-#include <ogg/ogg.h>
-
-#include <speex/speex.h>
-#include <speex/speex_header.h>
-#include <speex/speex_callbacks.h>
-#include <speex/speex_stereo.h>
-
-#define MAX_FRAME_SIZE 2000
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} speex_class_t;
-
-typedef struct speex_decoder_s {
- audio_decoder_t audio_decoder;
-
- int64_t pts;
-
- int output_sampling_rate;
- int output_open;
- int output_mode;
-
- /* speex stuff */
- void *st;
- int frame_size;
- int rate;
- int nframes;
- int channels;
- SpeexBits bits;
- SpeexStereoState stereo;
- int expect_metadata;
-
- int header_count;
-
- xine_stream_t *stream;
-
-} speex_decoder_t;
-
-
-static void speex_reset (audio_decoder_t *this_gen) {
-
- speex_decoder_t *this = (speex_decoder_t *) this_gen;
-
- speex_bits_init (&this->bits);
-}
-
-static void speex_discontinuity (audio_decoder_t *this_gen) {
-
- speex_decoder_t *this = (speex_decoder_t *) this_gen;
-
- this->pts=0;
-}
-
-/* Known speex comment keys from ogg123 sources*/
-static struct {
- char *key; /* includes the '=' for programming convenience */
- int xine_metainfo_index;
-} speex_comment_keys[] = {
- {"ARTIST=", XINE_META_INFO_ARTIST},
- {"ALBUM=", XINE_META_INFO_ALBUM},
- {"TITLE=", XINE_META_INFO_TITLE},
- {"GENRE=", XINE_META_INFO_GENRE},
- {"DESCRIPTION=", XINE_META_INFO_COMMENT},
- {"DATE=", XINE_META_INFO_YEAR},
- {NULL, 0}
-};
-
-#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \
- ((buf[base+2]<<16)&0xff0000)| \
- ((buf[base+1]<<8)&0xff00)| \
- (buf[base]&0xff))
-
-static
-void read_metadata (speex_decoder_t *this, char * comments, int length)
-{
- char * c = comments;
- int len, i, nb_fields;
- char * end;
-
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "speex");
-
- if (length < 8) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
- return;
- }
-
- end = c+length;
- len = readint (c, 0);
- c += 4;
-
- if (c+len > end) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
- return;
- }
-
-#ifdef LOG
- /* Encoder */
- printf ("libspeex: ");
- fwrite (c, 1, len, stdout);
- printf ("\n");
-#endif
-
- c += len;
-
- if (c+4 > end) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
- return;
- }
-
- nb_fields = readint (c, 0);
- c += 4;
-
- for (i = 0; i < nb_fields; i++) {
- if (c+4 > end) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
- return;
- }
-
- len = readint (c, 0);
- c += 4;
- if (c+len > end) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: invalid/corrupted comments\n");
- return;
- }
-
-#ifdef LOG
- printf ("libspeex: ");
- fwrite (c, 1, len, stdout);
- printf ("\n");
-#endif
-
- for (i = 0; speex_comment_keys[i].key != NULL; i++) {
- size_t keylen = strlen(speex_comment_keys[i].key);
-
- if ( !strncasecmp (speex_comment_keys[i].key, c,
- keylen) ) {
- char meta_info[(len - keylen) + 1];
-
- lprintf ("known metadata %d %d\n",
- i, speex_comment_keys[i].xine_metainfo_index);
-
- strncpy(meta_info, &c[keylen], len-keylen);
- _x_meta_info_set_utf8(this->stream, speex_comment_keys[i].xine_metainfo_index, meta_info);
- }
- }
-
- c += len;
- }
-}
-
-static void speex_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- speex_decoder_t *this = (speex_decoder_t *) this_gen;
-
- llprintf (LOG_BUFFERS, "decode buf=%8p content=%8p flags=%08x\n",
- buf, buf->content, buf->decoder_flags);
-
- if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
- !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) {
- lprintf ("preview buffer, %d headers to go\n", this->header_count);
-
- if (this->header_count) {
-
- if (!this->st) {
- SpeexMode * spx_mode;
- SpeexHeader * spx_header;
- unsigned int modeID;
- int bitrate;
-
- speex_bits_init (&this->bits);
-
- 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");
- return;
- }
-
- modeID = (unsigned int)spx_header->mode;
- if (modeID >= SPEEX_NB_MODES) {
- xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, LOG_MODULE ": invalid mode ID %u\n", modeID);
- return;
- }
-
- spx_mode = (SpeexMode *) speex_mode_list[modeID];
-
- if (spx_mode->bitstream_version != spx_header->mode_bitstream_version) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: incompatible Speex mode bitstream version\n");
- return;
- }
-
- this->st = speex_decoder_init (spx_mode);
- if (!this->st) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: decoder initialization failed\n");
- return;
- }
-
- this->rate = spx_header->rate;
- speex_decoder_ctl (this->st, SPEEX_SET_SAMPLING_RATE, &this->rate);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_SAMPLERATE,
- this->rate);
-
- this->channels = spx_header->nb_channels;
- if (this->channels == 2) {
- SpeexCallback callback;
-
- callback.callback_id = SPEEX_INBAND_STEREO;
- callback.func = speex_std_stereo_request_handler;
- callback.data = &this->stereo;
- speex_decoder_ctl (this->st, SPEEX_SET_HANDLER, &callback);
- }
-
- this->nframes = spx_header->frames_per_packet;
- if (!this->nframes) this->nframes = 1;
-
- speex_decoder_ctl (this->st, SPEEX_GET_FRAME_SIZE, &this->frame_size);
-
- speex_decoder_ctl (this->st, SPEEX_GET_BITRATE, &bitrate);
- if (bitrate <= 1) bitrate = 16000; /* assume 16 kbit */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, bitrate);
-
- this->header_count += spx_header->extra_headers;
- this->expect_metadata = 1;
-
- free (spx_header);
- } else if (this->expect_metadata) {
- read_metadata (this, buf->content, buf->size);
- }
-
- this->header_count--;
-
- if (!this->header_count) {
- int mode = _x_ao_channels2mode(this->channels);
-
- if (!this->output_open) {
- this->output_open =
- (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream,
- 16,
- this->rate,
- mode);
- lprintf ("this->output_open after attempt is %d\n", this->output_open);
- }
- }
- }
-
- } else if (this->output_open) {
- 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);
-
- for (j = 0; j < this->nframes; j++) {
- int ret;
- int bitrate;
-
- ret = speex_decode_int (this->st, &this->bits, audio_buffer->mem);
-
- if (ret==-1)
- break;
- if (ret==-2) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: Decoding error, corrupted stream?\n");
- break;
- }
- if (speex_bits_remaining(&this->bits)<0) {
- xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "libspeex: Decoding overflow, corrupted stream?\n");
- break;
- }
-
- if (this->channels == 2) {
- speex_decode_stereo_int (audio_buffer->mem, this->frame_size, &this->stereo);
- }
-
- speex_decoder_ctl (this->st, SPEEX_GET_BITRATE, &bitrate);
- if (bitrate <= 1) bitrate = 16000; /* assume 16 kbit */
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE, bitrate);
-
- audio_buffer->vpts = this->pts;
- this->pts=0;
- audio_buffer->num_frames = this->frame_size;
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
- buf->pts=0;
-
- }
- }
- else {
- llprintf (LOG_BUFFERS, "output not open\n");
- }
-}
-
-static void speex_dispose (audio_decoder_t *this_gen) {
-
- speex_decoder_t *this = (speex_decoder_t *) this_gen;
-
- if (this->st) {
- speex_decoder_destroy (this->st);
- }
- speex_bits_destroy (&this->bits);
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
- xine_stream_t *stream) {
-
- speex_decoder_t *this ;
- static SpeexStereoState init_stereo = SPEEX_STEREO_STATE_INIT;
-
- this = (speex_decoder_t *) calloc(1, sizeof(speex_decoder_t));
-
- this->audio_decoder.decode_data = speex_decode_data;
- this->audio_decoder.reset = speex_reset;
- this->audio_decoder.discontinuity = speex_discontinuity;
- this->audio_decoder.dispose = speex_dispose;
- this->stream = stream;
-
- this->output_open = 0;
- this->header_count = 1;
- this->expect_metadata = 0;
-
- this->st = NULL;
-
- this->channels = 1;
-
- memcpy (&this->stereo, &init_stereo, sizeof (SpeexStereoState));
-
- return (audio_decoder_t *) this;
-}
-
-/*
- * speex plugin class
- */
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "speex";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "Speex audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- speex_class_t *this;
-
- this = (speex_class_t *) calloc(1, sizeof(speex_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_SPEEX, 0
- };
-
-static const decoder_info_t dec_info_audio = {
- 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/libxineadec/xine_vorbis_decoder.c b/src/libxineadec/xine_vorbis_decoder.c
deleted file mode 100644
index 99012c40d..000000000
--- a/src/libxineadec/xine_vorbis_decoder.c
+++ /dev/null
@@ -1,385 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * (ogg/)vorbis audio decoder plugin (libvorbis wrapper) for xine
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-
-#define LOG_MODULE "vorbis_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "buffer.h"
-
-#include <ogg/ogg.h>
-#include <vorbis/codec.h>
-
-#define MAX_NUM_SAMPLES 4096
-#define INIT_BUFSIZE 8192
-
-typedef struct {
- audio_decoder_class_t decoder_class;
-} vorbis_class_t;
-
-typedef struct vorbis_decoder_s {
- audio_decoder_t audio_decoder;
-
- int64_t pts;
-
- int output_sampling_rate;
- int output_open;
- int output_mode;
-
- ogg_packet op; /* we must use this struct to sent data to libvorbis */
-
- /* vorbis stuff */
- vorbis_info vi; /* stores static vorbis bitstream settings */
- vorbis_comment vc;
- vorbis_dsp_state vd; /* central working state for packet->PCM decoder */
- vorbis_block vb; /* local working state for packet->PCM decoder */
-
- int16_t convbuffer[MAX_NUM_SAMPLES];
- int convsize;
-
- int header_count;
-
- xine_stream_t *stream;
-
- /* data accumulation stuff */
- unsigned char *buf;
- int bufsize;
- int size;
-
-} vorbis_decoder_t;
-
-
-static void vorbis_reset (audio_decoder_t *this_gen) {
-
- vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
-
- if( this->header_count ) return;
- this->size = 0;
-
- /* clear block first, as it might contain allocated data */
- vorbis_block_clear(&this->vb);
- vorbis_block_init(&this->vd,&this->vb);
-}
-
-static void vorbis_discontinuity (audio_decoder_t *this_gen) {
-
- vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
-
- this->pts=0;
-}
-
-/* Known vorbis comment keys from ogg123 sources*/
-static struct {
- char *key; /* includes the '=' for programming convenience */
- int xine_metainfo_index;
-} vorbis_comment_keys[] = {
- {"ARTIST=", XINE_META_INFO_ARTIST},
- {"ALBUM=", XINE_META_INFO_ALBUM},
- {"TITLE=", XINE_META_INFO_TITLE},
- {"GENRE=", XINE_META_INFO_GENRE},
- {"DESCRIPTION=", XINE_META_INFO_COMMENT},
- {"COMMENT=", XINE_META_INFO_COMMENT},
- {"DATE=", XINE_META_INFO_YEAR},
- {"TRACKNUMBER=", XINE_META_INFO_TRACK_NUMBER},
- {NULL, 0}
-};
-
-static void get_metadata (vorbis_decoder_t *this) {
-
- char **ptr=this->vc.user_comments;
- while(*ptr){
-
- char *comment = *ptr;
- int i;
-
- lprintf("%s\n", comment);
-
- for (i = 0; vorbis_comment_keys[i].key != NULL; i++) {
-
- if ( !strncasecmp (vorbis_comment_keys[i].key, comment,
- strlen(vorbis_comment_keys[i].key)) ) {
-
- lprintf ("known metadata %d %d\n",
- i, vorbis_comment_keys[i].xine_metainfo_index);
-
- _x_meta_info_set_utf8(this->stream, vorbis_comment_keys[i].xine_metainfo_index,
- comment + strlen(vorbis_comment_keys[i].key));
-
- }
- }
- ++ptr;
- }
-
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_AUDIOCODEC, "vorbis");
-}
-
-static void vorbis_check_bufsize (vorbis_decoder_t *this, int size) {
- if (size > this->bufsize) {
- this->bufsize = size + size / 2;
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
- _("vorbis: increasing buffer to %d to avoid overflow.\n"),
- this->bufsize);
- this->buf = realloc(this->buf, this->bufsize);
- }
-}
-
-static void vorbis_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
-
- vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
-
- memset( &this->op, 0, sizeof(this->op) );
-
- /* data accumulation */
- vorbis_check_bufsize(this, this->size + buf->size);
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
- this->size += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
- this->op.packet = this->buf;
- this->op.bytes = this->size;
-
- /* reset accumultaion buffer */
- this->size = 0;
-
- if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
- !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) {
-
- lprintf ("%d headers to go\n", this->header_count);
-
- if (this->header_count) {
- int res = 0;
-
- if (this->header_count == 3)
- this->op.b_o_s = 1;
-
- if ( (res = vorbis_synthesis_headerin(&this->vi,&this->vc,&this->op)) < 0 ) {
- /* error case; not a vorbis header */
- xine_log(this->stream->xine, XINE_LOG_MSG, "libvorbis: this bitstream does not contain vorbis audio data. Following first 64 bytes (return: %d).\n", res);
- xine_hexdump((char *)this->op.packet, this->op.bytes < 64 ? this->op.bytes : 64);
- return;
- }
-
- this->header_count--;
-
- if (!this->header_count) {
-
- int mode = AO_CAP_MODE_MONO;
-
- get_metadata (this);
-
- mode = _x_ao_channels2mode(this->vi.channels);
-
- this->convsize=MAX_NUM_SAMPLES/this->vi.channels;
-
- if (!this->output_open) {
- this->output_open = (this->stream->audio_out->open) (this->stream->audio_out,
- this->stream,
- 16,
- this->vi.rate,
- mode) ;
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_AUDIO_BITRATE,
- this->vi.bitrate_nominal);
-
- }
-
- /* OK, got and parsed all three headers. Initialize the Vorbis
- * packet->PCM decoder. */
- lprintf("all three headers parsed. initializing decoder.\n");
- /* initialize central decode state */
- vorbis_synthesis_init(&this->vd,&this->vi);
- /* initialize local state for most of the decode so multiple
- * block decodes can proceed in parallel. We could init
- * multiple vorbis_block structures for vd here */
- vorbis_block_init(&this->vd,&this->vb);
- }
- }
-
- } else if (this->output_open) {
-
- float **pcm;
- int samples;
-
- if(vorbis_synthesis(&this->vb,&this->op)==0)
- vorbis_synthesis_blockin(&this->vd,&this->vb);
-
- if (buf->pts!=0)
- this->pts=buf->pts;
-
- while ((samples=vorbis_synthesis_pcmout(&this->vd,&pcm))>0){
-
- /* **pcm is a multichannel float vector. In stereo, for
- * example, pcm[0][...] is left, and pcm[1][...] is right.
- * samples is the size of each channel. Convert the float
- * values (-1.<=range<=1.) to whatever PCM format and write
- * it out
- */
-
- int i,j;
- int bout=(samples<this->convsize?samples:this->convsize);
- audio_buffer_t *audio_buffer;
-
- audio_buffer = this->stream->audio_out->get_buffer (this->stream->audio_out);
-
- /* convert floats to 16 bit signed ints (host order) and
- interleave */
- for(i=0;i<this->vi.channels;i++){
- ogg_int16_t *ptr=audio_buffer->mem+i;
- float *mono=pcm[i];
- for(j=0;j<bout;j++){
- int val=(mono[j] + 1.0f) * 32768.f;
- val -= 32768;
- /* might as well guard against clipping */
- if(val>32767){
- val=32767;
- } else if(val<-32768){
- val=-32768;
- }
- *ptr=val;
- ptr+=this->vi.channels;
- }
- }
-
- audio_buffer->vpts = this->pts;
- this->pts=0;
- audio_buffer->num_frames = bout;
-
- this->stream->audio_out->put_buffer (this->stream->audio_out, audio_buffer, this->stream);
-
- buf->pts=0;
-
- /* tell libvorbis how many samples we actually consumed */
- vorbis_synthesis_read(&this->vd,bout);
- }
- } else {
- lprintf("output not open\n");
- }
- }
-}
-
-static void vorbis_dispose (audio_decoder_t *this_gen) {
-
- vorbis_decoder_t *this = (vorbis_decoder_t *) this_gen;
-
- if( !this->header_count ) {
- lprintf("deinitializing decoder\n");
-
- vorbis_block_clear(&this->vb);
- vorbis_dsp_clear(&this->vd);
- }
-
- vorbis_comment_clear(&this->vc);
-
- vorbis_info_clear(&this->vi); /* must be called last */
-
- if (this->output_open)
- this->stream->audio_out->close (this->stream->audio_out, this->stream);
-
- lprintf("libvorbis instance destroyed\n");
-
- free (this_gen);
-}
-
-static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
- xine_stream_t *stream) {
-
- vorbis_decoder_t *this ;
-
- this = (vorbis_decoder_t *) calloc(1, sizeof(vorbis_decoder_t));
-
- this->audio_decoder.decode_data = vorbis_decode_data;
- this->audio_decoder.reset = vorbis_reset;
- this->audio_decoder.discontinuity = vorbis_discontinuity;
- this->audio_decoder.dispose = vorbis_dispose;
- this->stream = stream;
-
- this->output_open = 0;
- this->header_count = 3;
- this->convsize = 0;
-
- this->bufsize = INIT_BUFSIZE;
- this->buf = calloc(1, INIT_BUFSIZE);
- this->size = 0;
-
- vorbis_info_init(&this->vi);
- vorbis_comment_init(&this->vc);
-
- lprintf("libvorbis decoder instance created\n");
-
- return (audio_decoder_t *) this;
-}
-
-/*
- * vorbis plugin class
- */
-
-static char *get_identifier (audio_decoder_class_t *this) {
- return "vorbis";
-}
-
-static char *get_description (audio_decoder_class_t *this) {
- return "vorbis audio decoder plugin";
-}
-
-static void dispose_class (audio_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- vorbis_class_t *this;
-
- this = (vorbis_class_t *) calloc(1, sizeof(vorbis_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-static uint32_t audio_types[] = {
- BUF_AUDIO_VORBIS, 0
- };
-
-static const decoder_info_t dec_info_audio = {
- 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/libxinevdec/Makefile.am b/src/libxinevdec/Makefile.am
deleted file mode 100644
index b7dbe1db1..000000000
--- a/src/libxinevdec/Makefile.am
+++ /dev/null
@@ -1,47 +0,0 @@
-include $(top_builddir)/misc/Makefile.plugins
-include $(top_srcdir)/misc/Makefile.common
-
-AM_CFLAGS = $(VISIBILITY_FLAG)
-AM_LDFLAGS = $(xineplug_ldflags)
-
-EXTRA_DIST = foovideo.c
-
-if HAVE_WAND
-image_module = xineplug_decode_image.la
-endif
-
-if HAVE_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) \
- xineplug_decode_bitplane.la \
- xineplug_decode_rgb.la \
- xineplug_decode_yuv.la
-
-xineplug_decode_bitplane_la_SOURCES = bitplane.c
-xineplug_decode_bitplane_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
-
-xineplug_decode_rgb_la_SOURCES = rgb.c
-xineplug_decode_rgb_la_LIBADD = $(XINE_LIB)
-
-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_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) $(LTLIBINTL)
diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c
deleted file mode 100644
index 76b7c8a89..000000000
--- a/src/libxinevdec/bitplane.c
+++ /dev/null
@@ -1,1586 +0,0 @@
-/*
- * Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * Bitplane "Decoder" by Manfred Tremmel (Manfred.Tremmel@iiv.de)
- * Converts Amiga typical bitplane pictures to a YUV2 map
- * suitable for display under xine. It's based on the rgb-decoder
- * and the development documentation from the Amiga Developer CD
- *
- * Supported formats:
- * - uncompressed and byterun1 compressed ILBM data
- * - IFF ANIM compression methods OPT 5, 7 (long and short) and
- * 8 (long and short)
- * - untested (found no testfiles) IFF-ANIM OPT 3, 4 and 6
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-#include "demuxers/iff.h"
-
-#define IFF_REPLACE_BYTE_SIMPLE(ptr, old_data, new_data, colorindexx ) { \
- register uint8_t *index_ptr = ptr; \
- register uint8_t colorindex = colorindexx; \
- *index_ptr -= ((old_data & 0x80) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x80) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x40) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x40) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x20) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x20) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x10) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x10) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x08) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x08) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x04) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x04) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x02) ? colorindex : 0); \
- *index_ptr++ += ((new_data & 0x02) ? colorindex : 0); \
- *index_ptr -= ((old_data & 0x01) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x01) ? colorindex : 0); \
- old_data = new_data; \
-}
-
-#define IFF_REPLACE_BYTE(ptr, yuvy, yuvu, yuvv, yuv_palette, old_data, new_data, colorindexx ) { \
- register uint8_t *index_ptr = ptr; \
- register uint8_t colorindex = colorindexx; \
- register uint8_t *yuv_y = yuvy; \
- register uint8_t *yuv_u = yuvu; \
- register uint8_t *yuv_v = yuvv; \
- *index_ptr -= ((old_data & 0x80) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x80) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x40) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x40) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x20) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x20) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x10) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x10) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x08) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x08) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x04) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x04) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x02) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x02) ? colorindex : 0); \
- yuv_index = *index_ptr++ * 4; \
- *yuv_y++ = yuv_palette[yuv_index++]; \
- *yuv_u++ = yuv_palette[yuv_index++]; \
- *yuv_v++ = yuv_palette[yuv_index]; \
- *index_ptr -= ((old_data & 0x01) ? colorindex : 0); \
- *index_ptr += ((new_data & 0x01) ? colorindex : 0); \
- yuv_index = *index_ptr * 4; \
- *yuv_y = yuv_palette[yuv_index++]; \
- *yuv_u = yuv_palette[yuv_index++]; \
- *yuv_v = yuv_palette[yuv_index]; \
- old_data = new_data; \
-}
-
-#define IFF_REPLACE_SHORT_SIMPLE(ptr_s, old_data_s, new_data_s, colorindexx_s ) { \
- uint8_t *xindex_ptr = (uint8_t *)ptr_s; \
- uint8_t *xold_data = (uint8_t *)old_data_s; \
- uint8_t *xnew_data = (uint8_t *)new_data_s; \
- IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_s ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_s ); \
-}
-
-#define IFF_REPLACE_SHORT(ptr_s, yuvy_s, yuvu_s, yuvv_s, yuv_palette_s, old_data_s, new_data_s, colorindexx_s ) { \
- uint8_t *xindex_ptr = (uint8_t *)ptr_s; \
- uint8_t *xold_data = (uint8_t *)old_data_s; \
- uint8_t *xnew_data = (uint8_t *)new_data_s; \
- uint8_t *xyuv_y = yuvy_s; \
- uint8_t *xyuv_u = yuvu_s; \
- uint8_t *xyuv_v = yuvv_s; \
- IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_s, *xold_data, *xnew_data, colorindexx_s ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- xyuv_y += 8; \
- xyuv_u += 8; \
- xyuv_v += 8; \
- IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_s, *xold_data, *xnew_data, colorindexx_s ); \
-}
-
-#define IFF_REPLACE_LONG_SIMPLE(ptr_l, old_data_l, new_data_l, colorindexx_l ) { \
- uint8_t *xindex_ptr = (uint8_t *)ptr_l; \
- uint8_t *xold_data = (uint8_t *)old_data_l; \
- uint8_t *xnew_data = (uint8_t *)new_data_l; \
- IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
-}
-
-#define IFF_REPLACE_LONG(ptr_l, yuvy_l, yuvu_l, yuvv_l, yuv_palette_l, old_data_l, new_data_l, colorindexx_l ) { \
- uint8_t *xindex_ptr = (uint8_t *)ptr_l; \
- uint8_t *xold_data = (uint8_t *)old_data_l; \
- uint8_t *xnew_data = (uint8_t *)new_data_l; \
- uint8_t *xyuv_y = yuvy_l; \
- uint8_t *xyuv_u = yuvu_l; \
- uint8_t *xyuv_v = yuvv_l; \
- IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- xyuv_y += 8; \
- xyuv_u += 8; \
- xyuv_v += 8; \
- IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- xyuv_y += 8; \
- xyuv_u += 8; \
- xyuv_v += 8; \
- IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
- xindex_ptr += 8; \
- xold_data++; \
- xnew_data++; \
- xyuv_y += 8; \
- xyuv_u += 8; \
- xyuv_v += 8; \
- IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
-}
-
-typedef struct {
- video_decoder_class_t decoder_class;
-} bitplane_class_t;
-
-typedef struct bitplane_decoder_s {
- video_decoder_t video_decoder; /* parent video decoder structure */
-
- bitplane_class_t *class;
- xine_stream_t *stream;
-
- /* these are traditional variables in a video decoder object */
- uint64_t video_step; /* frame duration in pts units */
- int decoder_ok; /* current decoder status */
- int skipframes; /* 0 = draw picture, 1 = skip it */
- int framenumber;
-
- unsigned char *buf; /* the accumulated buffer data */
- int bufsize; /* the maximum size of buf */
- int size; /* the current size of buf */
- int size_uk; /* size of unkompressed bitplane */
-
- int width; /* the width of a video frame */
- int height; /* the height of a video frame */
- int num_pixel; /* number pixel */
- double ratio; /* the width to height ratio */
- int bytes_per_pixel;
- int num_bitplanes;
- int camg_mode;
- int is_ham;
-
- unsigned char yuv_palette[256 * 4];
- unsigned char rgb_palette[256 * 4];
- yuv_planes_t yuv_planes;
- yuv_planes_t yuv_planes_hist;
-
- uint8_t *buf_uk; /* uncompressed buffer */
- uint8_t *buf_uk_hist; /* uncompressed buffer historic */
- uint8_t *index_buf; /* index buffer (for indexed pics) */
- uint8_t *index_buf_hist;/* index buffer historic */
-
-} bitplane_decoder_t;
-
-/* create a new buffer and decde a byterun1 decoded buffer into it */
-static uint8_t *bitplane_decode_byterun1 (uint8_t *compressed,
- int size_compressed,
- int size_uncompressed) {
-
- /* BytRun1 decompression */
- int pixel_ptr = 0;
- int i = 0;
- int j = 0;
-
- uint8_t *uncompressed = calloc(1, size_uncompressed );
-
- while ( i < size_compressed &&
- pixel_ptr < size_uncompressed ) {
- if( compressed[i] <= 127 ) {
- j = compressed[i++];
- if( (i+j) > size_compressed ) {
- free(uncompressed);
- return NULL;
- }
- for( ; (j >= 0) && (pixel_ptr < size_uncompressed); j-- ) {
- uncompressed[pixel_ptr++] = compressed[i++];
- }
- } else if ( compressed[i] > 128 ) {
- j = 256 - compressed[i++];
- if( i >= size_compressed ) {
- free(uncompressed);
- return NULL;
- }
- for( ; (j >= 0) && (pixel_ptr < size_uncompressed); j-- ) {
- uncompressed[pixel_ptr++] = compressed[i];
- }
- i++;
- }
- }
- return uncompressed;
-}
-
-/* create a new buffer with "normal" index or rgb numbers out of a bitplane */
-static void bitplane_decode_bitplane (uint8_t *bitplane_buffer,
- uint8_t *index_buf,
- int width,
- int height,
- int num_bitplanes,
- int bytes_per_pixel ) {
-
- int rowsize = width / 8;
- int pixel_ptr = 0;
- int row_ptr = 0;
- int palette_index = 0;
- int i = 0;
- int j = 0;
- int row_i = 0;
- int row_j = 0;
- int palette_offset = 0;
- int palette_index_rowsize = 0;
- uint8_t color = 0;
- uint8_t data = 0;
- int bytes_per_pixel_8 = bytes_per_pixel * 8;
- int rowsize_num_bitplanes = rowsize * num_bitplanes;
- int width_bytes_per_pixel = width * bytes_per_pixel;
-
- for (i = 0; i < (height * width_bytes_per_pixel); index_buf[i++] = 0);
-
- /* decode Bitplanes to RGB/Index Numbers */
- for (row_ptr = 0; row_ptr < height; row_ptr++) {
-
- row_i = row_ptr * width_bytes_per_pixel;
- row_j = row_ptr * rowsize_num_bitplanes;
-
- for (palette_index = 0; palette_index < num_bitplanes; palette_index++) {
-
- palette_offset = ((palette_index > 15) ? 2 : (palette_index > 7) ? 1 : 0);
- color = bitplainoffeset[palette_index];
- palette_index_rowsize = palette_index * rowsize;
-
- for (pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
- i = row_i +
- (pixel_ptr * bytes_per_pixel_8) +
- palette_offset;
- j = row_j + palette_index_rowsize + pixel_ptr;
-
- data = bitplane_buffer[j];
-
- index_buf[i] += ((data & 0x80) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x40) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x20) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x10) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x08) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x04) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x02) ? color : 0);
- i += bytes_per_pixel;
- index_buf[i] += ((data & 0x01) ? color : 0);
- }
- }
- }
-}
-
-/* create Buffer decode HAM6 and HAM8 to YUV color */
-static void bitplane_decode_ham (uint8_t *ham_buffer,
- yuv_planes_t *yuv_planes,
- int width,
- int height,
- int num_bitplanes,
- int bytes_per_pixel,
- unsigned char *rgb_palette ) {
-
- uint8_t *ham_buffer_work = ham_buffer;
- uint8_t *ham_buffer_end = &ham_buffer[(width * height)];
- uint8_t *yuv_ptr_y = yuv_planes->y;
- uint8_t *yuv_ptr_u = yuv_planes->u;
- uint8_t *yuv_ptr_v = yuv_planes->v;
- int i = 0;
- int j = 0;
- uint8_t r = 0;
- uint8_t g = 0;
- uint8_t b = 0;
- /* position of special HAM-Bits differs in HAM6 and HAM8, detect them */
- int hambits = num_bitplanes > 6 ? 6 : 4;
- /* the other bits contain the real data, dreate a mask out of it */
- int maskbits = 8 - hambits;
- int mask = ( 1 << hambits ) - 1;
-
- for(; ham_buffer_work < ham_buffer_end; j = *ham_buffer_work++) {
- i = (j & mask);
- switch ( j >> hambits ) {
- case HAMBITS_CMAP:
- /* Take colors from palette */
- r = rgb_palette[i * 4 + 0];
- g = rgb_palette[i * 4 + 1];
- b = rgb_palette[i * 4 + 2];
- break;
- case HAMBITS_BLUE:
- /* keep red and green and modify blue */
- b = i << maskbits;
- b |= b >> hambits;
- break;
- case HAMBITS_RED:
- /* keep green and blue and modify red */
- r = i << maskbits;
- r |= r >> hambits;
- break;
- case HAMBITS_GREEN:
- /* keep red and blue and modify green */
- g = i << maskbits;
- g |= g >> hambits;
- break;
- default:
- break;
- }
- *yuv_ptr_y++ = COMPUTE_Y(r, g, b);
- *yuv_ptr_u++ = COMPUTE_U(r, g, b);
- *yuv_ptr_v++ = COMPUTE_V(r, g, b);
- }
-}
-
-/* decoding method 3 */
-static void bitplane_sdelta_opt_3 (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 16;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t palette_index = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint16_t *ptr = NULL;
- uint16_t *planeptr = NULL;
- uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
- uint16_t *data = NULL;
- uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
- uint16_t *rowworkptr = NULL;
- int16_t s = 0;
- int16_t size = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t row_ptr = 0;
- uint32_t yuv_index = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
-
- planeptr = (uint16_t *)(&this->buf_uk[(palette_index * rowsize * 2)]);
- /* data starts at beginn of delta-Buffer + offset of the first */
- /* 32 Bit long word in the buffer. The buffer starts with 8 */
- /* of this Offset, for every bitplane (max 8) one */
- data = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[palette_index])]);
- if( data != (uint16_t *)this->buf ) {
- /* This 8 Pointers are followd by another 8 */
- ptr = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[(palette_index+8)])]);
-
- /* in this case, I think big/little endian is not important ;-) */
- while( *data != 0xFFFF) {
- row_ptr = 0;
- size = _X_BE_16(data);
- data++;
- if( size >= 0 ) {
- rowworkptr = planeptr + size;
- pixel_ptr_bit = size * 16;
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[pixel_ptr_bit],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[pixel_ptr_bit],
- &this->yuv_planes.y[pixel_ptr_bit], &this->yuv_planes.u[pixel_ptr_bit],
- &this->yuv_planes.v[pixel_ptr_bit], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- data++;
- } else {
- size = 0 - size + 2;
- rowworkptr = planeptr + size;
- pixel_ptr_bit = size * 16;
- s = _X_BE_16(data);
- data++;
- while( s--) {
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[pixel_ptr_bit],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[pixel_ptr_bit],
- &this->yuv_planes.y[pixel_ptr_bit], &this->yuv_planes.u[pixel_ptr_bit],
- &this->yuv_planes.v[pixel_ptr_bit], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- rowworkptr++;
- data++;
- }
- }
-
-
-
-
- size = _X_BE_16(ptr);
- ptr++;
- if (size < 0) {
- for (s = size; s < 0; s++) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- }
- else {
- for (s = 0; s < size; s++) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- }
- }
- }
- }
-}
-
-/* decoding method 4 */
-static void bitplane_set_dlta_short (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 16;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t palette_index = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint16_t *ptr = NULL;
- uint16_t *planeptr = NULL;
- uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
- uint16_t *data = NULL;
- uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
- uint16_t *rowworkptr = NULL;
- int16_t s = 0;
- int16_t size = 0;
- uint16_t pixel_ptr = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t row_ptr = 0;
- uint32_t yuv_index = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
-
- planeptr = (uint16_t *)(&this->buf_uk[(palette_index * rowsize * 2)]);
- /* data starts at beginn of delta-Buffer + offset of the first */
- /* 32 Bit long word in the buffer. The buffer starts with 8 */
- /* of this Offset, for every bitplane (max 8) one */
- data = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[palette_index])]);
- if( data != (uint16_t *)this->buf ) {
- /* This 8 Pointers are followd by another 8 */
- ptr = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[(palette_index+8)])]);
-
- /* in this case, I think big/little endian is not important ;-) */
- while( *ptr != 0xFFFF) {
- pixel_ptr = _X_BE_16(ptr);
- pixel_ptr_bit = pixel_ptr * 16;
- row_ptr = 0;
- rowworkptr = planeptr + pixel_ptr;
- ptr++;
- size = _X_BE_16(ptr);
- ptr++;
- if (size < 0) {
- for (s = size; s < 0; s++) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- } else {
- for (s = 0; s < size; s++) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- }
- }
- }
- }
-}
-
-/* decoding method 5 */
-static void bitplane_dlta_5 (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 8;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t yuv_index = 0;
- uint32_t delta_offset = 0;
- uint32_t palette_index = 0;
- uint32_t pixel_ptr = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t row_ptr = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint8_t *planeptr = NULL;
- uint8_t *rowworkptr = NULL;
- uint8_t *picture_end = this->buf_uk + (rowsize_all_planes * this->height);
- uint8_t *data = NULL;
- uint8_t *data_end = this->buf + this->size;
- uint8_t op_count = 0;
- uint8_t op = 0;
- uint8_t count = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
-
- planeptr = &this->buf_uk[(palette_index * rowsize)];
- /* data starts at beginn of delta-Buffer + offset of the first */
- /* 32 Bit long word in the buffer. The buffer starts with 8 */
- /* of this Offset, for every bitplane (max 8) one */
- delta_offset = _X_BE_32(&deltadata[palette_index]);
-
- if (delta_offset > 0) {
- data = this->buf + delta_offset;
- for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
- rowworkptr = planeptr + pixel_ptr;
- pixel_ptr_bit = pixel_ptr * 8;
- row_ptr = 0;
- /* execute ops */
- for( op_count = *data++; op_count; op_count--) {
- op = *data++;
- if (op & 0x80) {
- /* Uniq ops */
- count = op & 0x7f; /* get count */
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_BYTE_SIMPLE(&this->index_buf[yuv_index],
- *rowworkptr, *data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_BYTE( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- *rowworkptr, *data, bitplainoffeset[palette_index] );
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- } else {
- if (op == 0) {
- /* Same ops */
- count = *data++;
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_BYTE_SIMPLE(&this->index_buf[yuv_index],
- *rowworkptr, *data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_BYTE( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- *rowworkptr, *data, bitplainoffeset[palette_index] );
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- } else {
- /* Skip ops */
- rowworkptr += (rowsize_all_planes * op);
- row_ptr += op;
- }
- }
- }
- }
- }
- }
-}
-
-/* decoding method 7 (short version) */
-static void bitplane_dlta_7_short (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 16;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t yuv_index = 0;
- uint32_t opcode_offset = 0;
- uint32_t data_offset = 0;
- uint32_t palette_index = 0;
- uint32_t pixel_ptr = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t row_ptr = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint8_t *planeptr = NULL;
- uint16_t *rowworkptr = NULL;
- uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
- uint16_t *data = NULL;
- uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
- uint8_t *op_ptr = NULL;
- uint8_t op_count = 0;
- uint8_t op = 0;
- uint8_t count = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
-
- planeptr = &this->buf_uk[(palette_index * rowsize * 2)];
- /* find opcode and data offset (up to 8 pointers, one for every bitplane */
- opcode_offset = _X_BE_32(&deltadata[palette_index]);
- data_offset = _X_BE_32(&deltadata[palette_index + 8]);
-
- if (opcode_offset > 0 && data_offset > 0) {
- data = (uint16_t *)(&this->buf[data_offset]);
- op_ptr = this->buf + opcode_offset;
- for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
- rowworkptr = (uint16_t *)(&planeptr[pixel_ptr * 2]);
- pixel_ptr_bit = pixel_ptr * 16;
- row_ptr = 0;
- /* execute ops */
- for( op_count = *op_ptr++; op_count; op_count--) {
- op = *op_ptr++;
- if (op & 0x80) {
- /* Uniq ops */
- count = op & 0x7f; /* get count */
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- } else {
- if (op == 0) {
- /* Same ops */
- count = *op_ptr++;
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- } else {
- /* Skip ops */
- rowworkptr += (rowsize_all_planes * op);
- row_ptr += op;
- }
- }
- }
- }
- }
- }
-}
-
-/* decoding method 7 (long version) */
-static void bitplane_dlta_7_long (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 32;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t yuv_index = 0;
- uint32_t opcode_offset = 0;
- uint32_t data_offset = 0;
- uint32_t palette_index = 0;
- uint32_t pixel_ptr = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t row_ptr = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint8_t *planeptr = NULL;
- uint32_t *rowworkptr = NULL;
- uint32_t *picture_end = (uint32_t *)(&this->buf_uk[(rowsize_all_planes * 4 * this->height)]);
- uint32_t *data = NULL;
- uint32_t *data_end = (uint32_t *)(&this->buf[this->size]);
- uint8_t *op_ptr = NULL;
- uint8_t op_count = 0;
- uint8_t op = 0;
- uint8_t count = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
- planeptr = &this->buf_uk[(palette_index * rowsize * 4)];
- /* find opcode and data offset (up to 8 pointers, one for every bitplane */
- opcode_offset = _X_BE_32(&deltadata[palette_index]);
- data_offset = _X_BE_32(&deltadata[palette_index + 8]);
-
- if (opcode_offset > 0 && data_offset > 0) {
- data = (uint32_t *)(&this->buf[data_offset]);
- op_ptr = this->buf + opcode_offset;
- for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
- rowworkptr = (uint32_t *)(&planeptr[pixel_ptr * 4]);
- pixel_ptr_bit = pixel_ptr * 32;
- row_ptr = 0;
- /* execute ops */
- for( op_count = *op_ptr++; op_count; op_count--) {
- op = *op_ptr++;
- if (op & 0x80) {
- /* Uniq ops */
- count = op & 0x7f; /* get count */
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_LONG( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- } else {
- if (op == 0) {
- /* Same ops */
- count = *op_ptr++;
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_LONG( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- } else {
- /* Skip ops */
- rowworkptr += (rowsize_all_planes * op);
- row_ptr += op;
- }
- }
- }
- }
- }
- }
-}
-
-/* decoding method 8 short */
-static void bitplane_dlta_8_short (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 16;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t yuv_index = 0;
- uint32_t delta_offset = 0;
- uint32_t palette_index = 0;
- uint32_t pixel_ptr = 0;
- uint32_t row_ptr = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint16_t *planeptr = NULL;
- uint16_t *rowworkptr = NULL;
- uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
- uint16_t *data = NULL;
- uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
- uint16_t op_count = 0;
- uint16_t op = 0;
- uint16_t count = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
-
- planeptr = (uint16_t *)(&this->buf_uk[(palette_index * rowsize * 2)]);
- /* data starts at beginn of delta-Buffer + offset of the first */
- /* 32 Bit long word in the buffer. The buffer starts with 8 */
- /* of this Offset, for every bitplane (max 8) one */
- delta_offset = _X_BE_32(&deltadata[palette_index]);
-
- if (delta_offset > 0) {
- data = (uint16_t *)(&this->buf[delta_offset]);
- for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
- rowworkptr = planeptr + pixel_ptr;
- pixel_ptr_bit = pixel_ptr * 16;
- row_ptr = 0;
- /* execute ops */
- op_count = _X_BE_16(data);
- data++;
- for( ; op_count; op_count--) {
- op = _X_BE_16(data);
- data++;
- if (op & 0x8000) {
- /* Uniq ops */
- count = op & 0x7fff; /* get count */
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- } else {
- if (op == 0) {
- /* Same ops */
- count = _X_BE_16(data);
- data++;
- while(count--) {
- if (data > data_end || rowworkptr > picture_end)
- return;
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- } else {
- /* Skip ops */
- rowworkptr += (rowsize_all_planes * op);
- row_ptr += op;
- }
- }
- }
- }
- }
- }
-}
-
-/* decoding method 8 long */
-static void bitplane_dlta_8_long (bitplane_decoder_t *this) {
-
- uint32_t rowsize = this->width / 32;
- uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
-
- uint32_t yuv_index = 0;
- uint32_t delta_offset = 0;
- uint32_t palette_index = 0;
- uint32_t pixel_ptr = 0;
- uint32_t pixel_ptr_bit = 0;
- uint32_t row_ptr = 0;
- uint32_t *deltadata = (uint32_t *)this->buf;
- uint32_t *planeptr = NULL;
- uint32_t *rowworkptr = NULL;
- uint32_t *picture_end = (uint32_t *)(&this->buf_uk[(rowsize_all_planes * 4 * this->height)]);
- uint32_t *data = NULL;
- uint32_t *data_end = (uint32_t *)(&this->buf[this->size]);
- uint32_t op_count = 0;
- uint32_t op = 0;
- uint32_t count = 0;
-
- /* Repeat for each plane */
- for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
-
- planeptr = (uint32_t *)(&this->buf_uk[(palette_index * rowsize * 4)]);
- /* data starts at beginn of delta-Buffer + offset of the first */
- /* 32 Bit long word in the buffer. The buffer starts with 8 */
- /* of this Offset, for every bitplane (max 8) one */
- delta_offset = _X_BE_32(&deltadata[palette_index]);
-
- if (delta_offset > 0) {
- data = (uint32_t *)(&this->buf[delta_offset]);
- for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
- rowworkptr = planeptr + pixel_ptr;
- pixel_ptr_bit = pixel_ptr * 32;
- row_ptr = 0;
- /* execute ops */
- op_count = _X_BE_32(data);
- data++;
- for( ; op_count; op_count--) {
- op = _X_BE_32(data);
- data++;
- if (op & 0x80000000) {
- /* Uniq ops */
- count = op & 0x7fffffff; /* get count */
- while(count--) {
- if (data <= data_end || rowworkptr <= picture_end) {
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_LONG( &this->index_buf[((row_ptr * this->width) + pixel_ptr_bit)],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- }
- data++;
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- } else {
- if (op == 0) {
- /* Same ops */
- count = _X_BE_32(data);
- data++;
- while(count--) {
- if (data <= data_end && rowworkptr <= picture_end) {
- yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
- if( this->is_ham ) {
- IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
- rowworkptr, data, bitplainoffeset[palette_index] );
- } else {
- IFF_REPLACE_LONG( &this->index_buf[yuv_index],
- &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
- &this->yuv_planes.v[yuv_index], this->yuv_palette,
- rowworkptr, data, bitplainoffeset[palette_index] );
- }
- }
- rowworkptr += rowsize_all_planes;
- row_ptr++;
- }
- data++;
- } else {
- /* Skip ops */
- rowworkptr += (rowsize_all_planes * op);
- row_ptr += op;
- }
- }
- }
- }
- }
- }
-/* bitplane_decode_bitplane(this->buf_uk, this->index_buf, this->width, this->height, this->num_bitplanes, 1);*/
-}
-
-static void bitplane_decode_data (video_decoder_t *this_gen,
- buf_element_t *buf) {
-
- bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen;
- xine_bmiheader *bih = 0;
- palette_entry_t *palette = 0;
- AnimHeader *anhd = NULL;
- int i = 0;
- int j = 0;
- int buf_ptr = 0;
- unsigned char r = 0;
- unsigned char g = 0;
- unsigned char b = 0;
- uint8_t *buf_exchange = NULL;
-
- vo_frame_t *img = 0; /* video out frame */
-
- /* a video decoder does not care about this flag (?) */
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- if ((buf->decoder_flags & BUF_FLAG_SPECIAL) &&
- (buf->decoder_info[1] == BUF_SPECIAL_PALETTE)) {
- palette = (palette_entry_t *)buf->decoder_info_ptr[2];
-
- for (i = 0; i < buf->decoder_info[2]; i++) {
- this->yuv_palette[i * 4 + 0] =
- COMPUTE_Y(palette[i].r, palette[i].g, palette[i].b);
- this->yuv_palette[i * 4 + 1] =
- COMPUTE_U(palette[i].r, palette[i].g, palette[i].b);
- this->yuv_palette[i * 4 + 2] =
- COMPUTE_V(palette[i].r, palette[i].g, palette[i].b);
- this->rgb_palette[i * 4 + 0] = palette[i].r;
- this->rgb_palette[i * 4 + 1] = palette[i].g;
- this->rgb_palette[i * 4 + 2] = palette[i].b;
- }
-
- /* EHB Pictures not allways contain all 64 colors, sometimes only */
- /* the first 32 are included and sometimes all 64 colors are provide,*/
- /* but second 32 are only stupid dirt, so recalculate them */
- if (((this->num_bitplanes == 6) &&
- (buf->decoder_info[2] == 32)) ||
- (this->camg_mode & CAMG_EHB)) {
- for (i = 32; i < 64; i++) {
- this->rgb_palette[i * 4 + 0] = palette[(i-32)].r / 2;
- this->rgb_palette[i * 4 + 1] = palette[(i-32)].g / 2;
- this->rgb_palette[i * 4 + 2] = palette[(i-32)].b / 2;
- this->yuv_palette[i * 4 + 0] =
- COMPUTE_Y(this->rgb_palette[i*4+0], this->rgb_palette[i*4+1], this->rgb_palette[i*4+2]);
- this->yuv_palette[i * 4 + 1] =
- COMPUTE_U(this->rgb_palette[i*4+0], this->rgb_palette[i*4+1], this->rgb_palette[i*4+2]);
- this->yuv_palette[i * 4 + 2] =
- COMPUTE_V(this->rgb_palette[i*4+0], this->rgb_palette[i*4+1], this->rgb_palette[i*4+2]);
- }
- }
-
- return;
- }
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
-
- bih = (xine_bmiheader *) buf->content;
- this->width = (bih->biWidth + 15) & ~0x0f;
- this->height = bih->biHeight;
- this->num_pixel = this->width * this->height;
- this->ratio = (double)this->width/(double)this->height;
- this->video_step = buf->decoder_info[1];
- /* Palette based Formates use up to 8 Bit per pixel, always use 8 Bit if less */
- this->bytes_per_pixel = (bih->biBitCount + 1) / 8;
- if( this->bytes_per_pixel < 1 )
- this->bytes_per_pixel = 1;
-
- /* New Buffer for indexes (palette based formats) */
- this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
- this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
-
- this->num_bitplanes = bih->biPlanes;
- this->camg_mode = bih->biCompression;
- if( this->camg_mode & CAMG_HAM )
- this->is_ham = 1;
- else
- this->is_ham = 0;
-
- if( buf->decoder_info[2] != buf->decoder_info[3] &&
- buf->decoder_info[3] > 0 ) {
- this->ratio *= buf->decoder_info[2];
- this->ratio /= buf->decoder_info[3];
- }
-
- if( (bih->biCompression & CAMG_HIRES) &&
- !(bih->biCompression & CAMG_LACE) ) {
- if( (buf->decoder_info[2] * 16) > (buf->decoder_info[3] * 10) )
- this->ratio /= 2.0;
- }
-
- if( !(bih->biCompression & CAMG_HIRES) &&
- (bih->biCompression & CAMG_LACE) ) {
- if( (buf->decoder_info[2] * 10) < (buf->decoder_info[3] * 16) )
- this->ratio *= 2.0;
- }
-
- if (this->buf)
- free (this->buf);
- this->bufsize = VIDEOBUFSIZE;
- this->buf = calloc(1, this->bufsize);
- this->size = 0;
- this->framenumber = 0;
-
- init_yuv_planes(&this->yuv_planes, this->width, this->height);
- init_yuv_planes(&this->yuv_planes_hist, this->width, this->height);
-
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
- this->decoder_ok = 1;
-
- /* load the stream/meta info */
- switch( buf->type ) {
- case BUF_VIDEO_BITPLANE:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Uncompressed bitplane");
- break;
- case BUF_VIDEO_BITPLANE_BR1:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "ByteRun1 bitplane");
- break;
- default:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Unknown bitplane");
- break;
- }
-
- return;
- } else if (this->decoder_ok) {
-
- this->skipframes = 0;
- this->framenumber++;
- if (this->size + buf->size > this->bufsize) {
- this->bufsize = this->size + 2 * buf->size;
- this->buf = realloc (this->buf, this->bufsize);
- }
-
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
-
- this->size += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAMERATE)
- this->video_step = buf->decoder_info[0];
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YUY2,
- VO_BOTH_FIELDS);
-
- img->duration = this->video_step;
- img->pts = buf->pts;
- img->bad_frame = 0;
- anhd = (AnimHeader *)(buf->decoder_info_ptr[0]);
-
- if( (this->buf_uk == NULL) ||
- (anhd == NULL) ||
- (anhd->operation == IFF_ANHD_ILBM) ) {
-
- /* iterate through each row */
- buf_ptr = 0;
- this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes);
-
- if( this->buf_uk_hist != NULL )
- xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk);
- switch( buf->type ) {
- case BUF_VIDEO_BITPLANE:
- /* uncompressed Buffer, set decoded_buf pointer direct to input stream */
- if( this->buf_uk == NULL )
- this->buf_uk = malloc(this->size);
- xine_fast_memcpy (this->buf_uk, this->buf, this->size);
- break;
- case BUF_VIDEO_BITPLANE_BR1:
- /* create Buffer for decompressed bitmap */
- this->buf_uk = bitplane_decode_byterun1(
- this->buf, /* compressed buffer */
- this->size, /* size of compressed data */
- this->size_uk ); /* size of uncompressed data */
-
- if( this->buf_uk == NULL ) {
- xine_log(this->stream->xine, XINE_LOG_MSG,
- _("bitplane: error doing ByteRun1 decompression\n"));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
- return;
- }
- /* set pointer to decompressed Buffer */
- break;
- default:
- break;
- }
- bitplane_decode_bitplane( this->buf_uk, /* bitplane buffer */
- this->index_buf, /* index buffer */
- this->width, /* width */
- this->height, /* hight */
- this->num_bitplanes, /* number bitplanes */
- this->bytes_per_pixel); /* used Bytes per pixel */
-
- if ((this->bytes_per_pixel == 1) &&
- (this->is_ham == 0) ) {
- buf_exchange = this->index_buf;
- for (i = 0; i < (this->height * this->width); i++) {
- j = *buf_exchange++ * 4;
- this->yuv_planes.y[i] = this->yuv_palette[j++];
- this->yuv_planes.u[i] = this->yuv_palette[j++];
- this->yuv_planes.v[i] = this->yuv_palette[j];
- }
- }
- if( this->buf_uk_hist == NULL ) {
- this->buf_uk_hist = malloc(this->size_uk);
- xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk);
- xine_fast_memcpy (this->index_buf_hist, this->index_buf,
- (this->num_pixel * this->bytes_per_pixel));
- xine_fast_memcpy (this->yuv_planes_hist.y, this->yuv_planes.y, (this->num_pixel));
- xine_fast_memcpy (this->yuv_planes_hist.u, this->yuv_planes.u, (this->num_pixel));
- xine_fast_memcpy (this->yuv_planes_hist.v, this->yuv_planes.v, (this->num_pixel));
- }
- } else {
- /* when no start-picture is given, create a empty one */
- if( this->buf_uk_hist == NULL ) {
- this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes);
- this->buf_uk = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
- this->buf_uk_hist = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
- }
- if( this->index_buf == NULL ) {
- this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
- this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
- }
-
- switch( anhd->operation ) {
- /* also known as IFF-ANIM OPT1 (never seen in real world) */
- case IFF_ANHD_XOR:
- xine_log(this->stream->xine, XINE_LOG_MSG,
- _("bitplane: Anim Opt 1 is not supported at the moment\n"));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
- return;
- break;
- /* also known as IFF-ANIM OPT2 (never seen in real world) */
- case IFF_ANHD_LDELTA:
- xine_log(this->stream->xine, XINE_LOG_MSG,
- _("bitplane: Anim Opt 2 is not supported at the moment\n"));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
- return;
- break;
- /* also known as IFF-ANIM OPT3 */
- case IFF_ANHD_SDELTA:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT3");
- bitplane_sdelta_opt_3 ( this );
- return;
- break;
- /* also known as IFF-ANIM OPT4 (never seen in real world) */
- case IFF_ANHD_SLDELTA:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT4 (SLDELTA)");
- bitplane_set_dlta_short ( this );
- break;
- /* also known as IFF-ANIM OPT5 */
- case IFF_ANHD_BVDELTA:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT5 (BVDELTA)");
- bitplane_dlta_5(this);
- break;
- /* IFF-ANIM OPT6 is exactly the same as OPT5, but for stereo-displays */
- /* first picture is on the left display, second on the right, third on */
- /* the left, forth on right, ... Only display left picture on mono display*/
- case IFF_ANHD_STEREOO5:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT6 (BVDELTA STEREO)");
- bitplane_dlta_5(this);
- if( this->framenumber % 2 == 0 )
- this->skipframes = 1;
- return;
- break;
- case IFF_ANHD_OPT7:
- if(anhd->bits == 0) {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT7 (SHORT)");
- bitplane_dlta_7_short(this);
- } else {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT7 (LONG)");
- bitplane_dlta_7_long(this);
- }
- break;
- case IFF_ANHD_OPT8:
- if(anhd->bits == 0) {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT8 (SHORT)");
- bitplane_dlta_8_short(this);
- } else {
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT8 (LONG)");
- bitplane_dlta_8_long(this);
- }
- break;
- case IFF_ANHD_ASCIIJ:
- xine_log(this->stream->xine, XINE_LOG_MSG,
- _("bitplane: Anim ASCIIJ is not supported at the moment\n"));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
- return;
- break;
- default:
- xine_log(this->stream->xine, XINE_LOG_MSG,
- _("bitplane: This anim-type is not supported at the moment\n"));
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
- return;
- break;
- }
- /* change old bitmap buffer (which now is the new one) with new buffer */
- buf_exchange = this->buf_uk;
- this->buf_uk = this->buf_uk_hist;
- this->buf_uk_hist = buf_exchange;
- /* do the same with the index buffer */
- buf_exchange = this->index_buf;
- this->index_buf = this->index_buf_hist;
- this->index_buf_hist = buf_exchange;
- /* and also with yuv buffer */
- buf_exchange = this->yuv_planes.y;
- this->yuv_planes.y = this->yuv_planes_hist.y;
- this->yuv_planes_hist.y = buf_exchange;
- buf_exchange = this->yuv_planes.u;
- this->yuv_planes.u = this->yuv_planes_hist.u;
- this->yuv_planes_hist.u = buf_exchange;
- buf_exchange = this->yuv_planes.v;
- this->yuv_planes.v = this->yuv_planes_hist.v;
- this->yuv_planes_hist.v = buf_exchange;
- }
-
- if( this->skipframes == 0 ) {
- switch (this->bytes_per_pixel) {
- case 1:
- /* HAM-pictrues need special handling */
- if( this->is_ham ) {
- /* Decode HAM-Pictures to YUV */
- bitplane_decode_ham( this->index_buf, /* HAM-bitplane buffer */
- &(this->yuv_planes), /* YUV buffer */
- this->width, /* width */
- this->height, /* hight */
- this->num_bitplanes, /* number bitplanes */
- this->bytes_per_pixel, /* used Bytes per pixel */
- this->rgb_palette); /* Palette (RGB) */
- }
- break;
- case 3:
- buf_exchange = this->index_buf;
- for (i = 0; i < (this->height * this->width); i++) {
- r = *buf_exchange++;
- g = *buf_exchange++;
- b = *buf_exchange++;
-
- this->yuv_planes.y[i] = COMPUTE_Y(r, g, b);
- this->yuv_planes.u[i] = COMPUTE_U(r, g, b);
- this->yuv_planes.v[i] = COMPUTE_V(r, g, b);
- }
- break;
- default:
- break;
- }
-
- yuv444_to_yuy2(&this->yuv_planes, img->base[0], img->pitches[0]);
-
- img->draw(img, this->stream);
- }
- img->free(img);
-
- this->size = 0;
- if ( buf->decoder_info[1] > 90000 )
- xine_usec_sleep(buf->decoder_info[1]);
- }
- }
-}
-
-/*
- * This function is called when xine needs to flush the system. Not
- * sure when or if this is used or even if it needs to do anything.
- */
-static void bitplane_flush (video_decoder_t *this_gen) {
-}
-
-/*
- * This function resets the video decoder.
- */
-static void bitplane_reset (video_decoder_t *this_gen) {
- bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen;
-
- this->size = 0;
-}
-
-static void bitplane_discontinuity (video_decoder_t *this_gen) {
-}
-
-/*
- * This function frees the video decoder instance allocated to the decoder.
- */
-static void bitplane_dispose (video_decoder_t *this_gen) {
- bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen;
-
- if (this->buf) {
- free (this->buf);
- this->buf = NULL;
- }
-
- if (this->buf_uk) {
- free (this->buf_uk);
- this->buf_uk = NULL;
- }
-
- if (this->buf_uk_hist) {
- free (this->buf_uk_hist);
- this->buf_uk_hist = NULL;
- }
-
- if (this->index_buf) {
- free (this->index_buf);
- this->index_buf = NULL;
- }
-
- if (this->index_buf_hist) {
- free (this->index_buf_hist);
- this->index_buf_hist = NULL;
- }
-
- if (this->index_buf) {
- free (this->index_buf);
- this->index_buf = NULL;
- }
-
- if (this->decoder_ok) {
- this->decoder_ok = 0;
- this->stream->video_out->close(this->stream->video_out, this->stream);
- }
-
- free (this_gen);
-}
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- bitplane_decoder_t *this = (bitplane_decoder_t *) calloc(1, sizeof(bitplane_decoder_t));
-
- this->video_decoder.decode_data = bitplane_decode_data;
- this->video_decoder.flush = bitplane_flush;
- this->video_decoder.reset = bitplane_reset;
- this->video_decoder.discontinuity = bitplane_discontinuity;
- this->video_decoder.dispose = bitplane_dispose;
- this->size = 0;
-
- this->stream = stream;
- this->class = (bitplane_class_t *) class_gen;
-
- this->decoder_ok = 0;
- this->buf = NULL;
- this->buf_uk = NULL;
- this->index_buf = NULL;
- this->index_buf = NULL;
-
- return &this->video_decoder;
-}
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "bitplane";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "Raw bitplane video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- bitplane_class_t *this = (bitplane_class_t *) calloc(1, sizeof(bitplane_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-
-static const uint32_t video_types[] = {
- BUF_VIDEO_BITPLANE,
- BUF_VIDEO_BITPLANE_BR1,
- 0
-};
-
-static const decoder_info_t dec_info_video = {
- video_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "bitplane", XINE_VERSION_CODE, &dec_info_video, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c
deleted file mode 100644
index 6e1fd0ac3..000000000
--- a/src/libxinevdec/foovideo.c
+++ /dev/null
@@ -1,305 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * foovideo.c: This is a reference video decoder for the xine multimedia
- * player. It really works too! It will output frames of packed YUY2 data
- * where each byte in the map is the same value, which is 3 larger than the
- * value from the last frame. This creates a slowly rotating solid color
- * frame when the frames are played in succession.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-#define VIDEOBUFSIZE 128*1024
-
-typedef struct {
- video_decoder_class_t decoder_class;
-} foovideo_class_t;
-
-typedef struct foovideo_decoder_s {
- video_decoder_t video_decoder; /* parent video decoder structure */
-
- foovideo_class_t *class;
- xine_stream_t *stream;
-
- /* these are traditional variables in a video decoder object */
- uint64_t video_step; /* frame duration in pts units */
- int decoder_ok; /* current decoder status */
- int skipframes;
-
- unsigned char *buf; /* the accumulated buffer data */
- int bufsize; /* the maximum size of buf */
- int size; /* the current size of buf */
-
- int width; /* the width of a video frame */
- int height; /* the height of a video frame */
- double ratio; /* the width to height ratio */
-
- /* these are variables exclusive to the foo video decoder */
- unsigned char current_yuv_byte;
-
-} foovideo_decoder_t;
-
-/**************************************************************************
- * foovideo specific decode functions
- *************************************************************************/
-
-/**************************************************************************
- * xine video plugin functions
- *************************************************************************/
-
-/*
- * This function receives a buffer of data from the demuxer layer and
- * figures out how to handle it based on its header flags.
- */
-static void foovideo_decode_data (video_decoder_t *this_gen,
- buf_element_t *buf) {
-
- foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
- xine_bmiheader *bih;
-
- vo_frame_t *img; /* video out frame */
-
- /* a video decoder does not care about this flag (?) */
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
- this->video_step = buf->decoder_info[0];
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
- }
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
-
- if(this->buf)
- free(this->buf);
-
- bih = (xine_bmiheader *) buf->content;
- this->width = bih->biWidth;
- this->height = bih->biHeight;
- this->ratio = (double)this->width/(double)this->height;
-
- if (this->buf)
- free (this->buf);
- this->bufsize = VIDEOBUFSIZE;
- this->buf = malloc(this->bufsize);
- this->size = 0;
-
- /* take this opportunity to load the stream/meta info */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "foovideo");
-
- /* do anything else relating to initializing this decoder */
- this->current_yuv_byte = 0;
-
- this->decoder_ok = 1;
-
- return;
- } else if (this->decoder_ok) {
-
- if (this->size + buf->size > this->bufsize) {
- this->bufsize = this->size + 2 * buf->size;
- this->buf = realloc (this->buf, this->bufsize);
- }
-
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
-
- this->size += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio,
- XINE_IMGFMT_YUY2, VO_BOTH_FIELDS);
-
- img->duration = this->video_step;
- img->pts = buf->pts;
- img->bad_frame = 0;
-
- memset(img->base[0], this->current_yuv_byte,
- this->width * this->height * 2);
- this->current_yuv_byte += 3;
-
- img->draw(img, this->stream);
- img->free(img);
-
- this->size = 0;
- }
- }
-}
-
-/*
- * This function is called when xine needs to flush the system.
- */
-static void foovideo_flush (video_decoder_t *this_gen) {
-}
-
-/*
- * This function resets the video decoder.
- */
-static void foovideo_reset (video_decoder_t *this_gen) {
- foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
-
- this->size = 0;
-}
-
-/*
- * The decoder should forget any stored pts values here.
- */
-static void foovideo_discontinuity (video_decoder_t *this_gen) {
- foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
-
-}
-
-/*
- * This function frees the video decoder instance allocated to the decoder.
- */
-static void foovideo_dispose (video_decoder_t *this_gen) {
-
- foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
-
- if (this->buf) {
- free (this->buf);
- this->buf = NULL;
- }
-
- if (this->decoder_ok) {
- this->decoder_ok = 0;
- this->stream->video_out->close(this->stream->video_out, this->stream);
- }
-
- free (this_gen);
-}
-
-/*
- * This function allocates, initializes, and returns a private video
- * decoder structure.
- */
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- foovideo_decoder_t *this ;
-
- this = (foovideo_decoder_t *) calloc(1, sizeof(foovideo_decoder_t));
-
- this->video_decoder.decode_data = foovideo_decode_data;
- this->video_decoder.flush = foovideo_flush;
- this->video_decoder.reset = foovideo_reset;
- this->video_decoder.discontinuity = foovideo_discontinuity;
- this->video_decoder.dispose = foovideo_dispose;
- this->size = 0;
-
- this->stream = stream;
- this->class = (foovideo_class_t *) class_gen;
-
- this->decoder_ok = 0;
- this->buf = NULL;
-
- return &this->video_decoder;
-}
-
-/*
- * This function returns a brief string that describes (usually with the
- * decoder's most basic name) the video decoder plugin.
- */
-static char *get_identifier (video_decoder_class_t *this) {
- return "foovideo";
-}
-
-/*
- * This function returns a slightly longer string describing the video
- * decoder plugin.
- */
-static char *get_description (video_decoder_class_t *this) {
- return "foovideo: reference xine video decoder plugin";
-}
-
-/*
- * This function frees the video decoder class and any other memory that was
- * allocated.
- */
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
-/*
- * This function allocates a private video decoder class and initializes
- * the class's member functions.
- */
-static void *init_plugin (xine_t *xine, void *data) {
-
- foovideo_class_t *this;
-
- this = (foovideo_class_t *) calloc(1, sizeof(foovideo_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-/*
- * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
- /* BUF_VIDEO_FOOVIDEO, */
- BUF_VIDEO_VQA,
- BUF_VIDEO_SORENSON_V3,
- 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_video = {
- video_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, "name", version, special_info, init_function } */
- { PLUGIN_VIDEO_DECODER, 18, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c
deleted file mode 100644
index 8815edabe..000000000
--- a/src/libxinevdec/gdkpixbuf.c
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Copyright (C) 2006 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, USA
- *
- * a gdk-pixbuf-based image video decoder
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#define LOG_MODULE "gdkpixbuf_video_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-#include <gdk-pixbuf/gdk-pixbuf.h>
-
-typedef struct {
- video_decoder_class_t decoder_class;
-
- /*
- * private variables
- */
-
-} image_class_t;
-
-
-typedef struct image_decoder_s {
- video_decoder_t video_decoder;
-
- image_class_t *cls;
-
- xine_stream_t *stream;
- int video_open;
-
- GdkPixbufLoader *loader;
-
-} image_decoder_t;
-
-
-static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
- image_decoder_t *this = (image_decoder_t *) this_gen;
- GError *error = NULL;
-
- if (!this->video_open) {
- lprintf("opening video\n");
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
- this->video_open = 1;
- }
-
- if (this->loader == NULL) {
- this->loader = gdk_pixbuf_loader_new ();
- }
-
- if (gdk_pixbuf_loader_write (this->loader, buf->mem, buf->size, &error) == FALSE) {
- lprintf("error loading image: %s\n", error->message);
- g_error_free (error);
- gdk_pixbuf_loader_close (this->loader, NULL);
- g_object_unref (G_OBJECT (this->loader));
- this->loader = NULL;
- return;
- }
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
- GdkPixbuf *pixbuf;
- int width, height, x, y, rowstride, n_channels, i;
- guchar *img_buf;
- yuv_planes_t yuv_planes;
- vo_frame_t *img;
-
- /*
- * this->image -> rgb data
- */
- if (gdk_pixbuf_loader_close (this->loader, &error) == FALSE) {
- lprintf("error loading image: %s\n", error->message);
- g_error_free (error);
- g_object_unref (G_OBJECT (this->loader));
- this->loader = NULL;
- return;
- }
-
- pixbuf = gdk_pixbuf_loader_get_pixbuf (this->loader);
- if (pixbuf != NULL)
- g_object_ref (G_OBJECT (pixbuf));
- g_object_unref (this->loader);
- this->loader = NULL;
-
- if (pixbuf == NULL) {
- lprintf("error loading image\n");
- return;
- }
-
- width = gdk_pixbuf_get_width (pixbuf) & ~1; /* must be even for init_yuv_planes */
- height = gdk_pixbuf_get_height (pixbuf);
- img_buf = gdk_pixbuf_get_pixels (pixbuf);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, height);
-
- lprintf("image loaded successfully\n");
-
- /*
- * rgb data -> yuv_planes
- */
- init_yuv_planes(&yuv_planes, width, height);
-
- n_channels = gdk_pixbuf_get_n_channels (pixbuf);
- rowstride = gdk_pixbuf_get_rowstride (pixbuf);
- i = 0;
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++) {
- guchar *p;
- p = img_buf + y * rowstride + x * n_channels;
-
- yuv_planes.y[i] = COMPUTE_Y (p[0], p[1], p[2]);
- yuv_planes.u[i] = COMPUTE_U (p[0], p[1], p[2]);
- yuv_planes.v[i] = COMPUTE_V (p[0], p[1], p[2]);
-
- i++;
- }
- }
- gdk_pixbuf_unref (pixbuf);
-
- /*
- * alloc and draw video frame
- */
- img = this->stream->video_out->get_frame (this->stream->video_out, width,
- height, (double)width/(double)height,
- XINE_IMGFMT_YUY2,
- VO_BOTH_FIELDS);
- img->pts = buf->pts;
- img->duration = 3600;
- img->bad_frame = 0;
-
- yuv444_to_yuy2(&yuv_planes, img->base[0], img->pitches[0]);
- free_yuv_planes(&yuv_planes);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, img->duration);
-
- img->draw(img, this->stream);
- img->free(img);
- }
-}
-
-
-static void image_flush (video_decoder_t *this_gen) {
- /* image_decoder_t *this = (image_decoder_t *) this_gen; */
-
- /*
- * flush out any frames that are still stored in the decoder
- */
-}
-
-
-static void image_reset (video_decoder_t *this_gen) {
- image_decoder_t *this = (image_decoder_t *) this_gen;
-
- /*
- * reset decoder after engine flush (prepare for new
- * video data not related to recently decoded data)
- */
-
- if (this->loader != NULL) {
- gdk_pixbuf_loader_close (this->loader, NULL);
- g_object_unref (G_OBJECT (this->loader));
- this->loader = NULL;
- }
-}
-
-
-static void image_discontinuity (video_decoder_t *this_gen) {
- /* image_decoder_t *this = (image_decoder_t *) this_gen; */
-
- /*
- * a time reference discontinuity has happened.
- * that is, it must forget any currently held pts value
- */
-}
-
-static void image_dispose (video_decoder_t *this_gen) {
- image_decoder_t *this = (image_decoder_t *) this_gen;
-
- if (this->video_open) {
- lprintf("closing video\n");
-
- this->stream->video_out->close(this->stream->video_out, this->stream);
- this->video_open = 0;
- }
-
- if (this->loader != NULL) {
- gdk_pixbuf_loader_close (this->loader, NULL);
- g_object_unref (G_OBJECT (this->loader));
- this->loader = NULL;
- }
-
- lprintf("closed\n");
- free (this);
-}
-
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
- xine_stream_t *stream) {
-
- image_class_t *cls = (image_class_t *) class_gen;
- image_decoder_t *this;
-
- lprintf("opened\n");
-
- g_type_init ();
-
- this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
-
- this->video_decoder.decode_data = image_decode_data;
- this->video_decoder.flush = image_flush;
- this->video_decoder.reset = image_reset;
- this->video_decoder.discontinuity = image_discontinuity;
- this->video_decoder.dispose = image_dispose;
- this->cls = cls;
- this->stream = stream;
-
- /*
- * initialisation of privates
- */
-
- return &this->video_decoder;
-}
-
-/*
- * image plugin class
- */
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "gdkpixbuf";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "gdk-pixbuf image video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this_gen) {
- image_class_t *this = (image_class_t *) this_gen;
-
- lprintf("class closed\n");
-
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data) {
-
- image_class_t *this;
-
- this = (image_class_t *) calloc(1, sizeof(image_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- /*
- * initialisation of privates
- */
-
- lprintf("class opened\n");
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-
-static uint32_t supported_types[] = { BUF_VIDEO_IMAGE, BUF_VIDEO_JPEG, 0 };
-
-static const decoder_info_t dec_info_image = {
- supported_types, /* supported types */
- 7 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "gdkpixbuf", XINE_VERSION_CODE, &dec_info_image, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c
deleted file mode 100644
index 5e166382b..000000000
--- a/src/libxinevdec/image.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Copyright (C) 2003-2005 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, USA
- *
- * a image video decoder
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <stdio.h>
-
-#define LOG_MODULE "image_video_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include <wand/magick_wand.h>
-#ifdef PACKAGE_NAME
-#undef PACKAGE_BUGREPORT
-#undef PACKAGE_NAME
-#undef PACKAGE_STRING
-#undef PACKAGE_TARNAME
-#undef PACKAGE_VERSION
-#endif
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-#ifdef HAVE_GRAPHICSMAGICK
-# define MAGICK_VERSION 0x670
-#else
-# if !defined(MagickLibVersion) || MagickLibVersion < 0x671
-# define MAGICK_VERSION 0x670
-#else
-# define MAGICK_VERSION MagickLibVersion
-# endif
-#endif
-
-
-typedef struct {
- video_decoder_class_t decoder_class;
-
- /*
- * private variables
- */
-
-} image_class_t;
-
-
-typedef struct image_decoder_s {
- video_decoder_t video_decoder;
-
- image_class_t *cls;
-
- xine_stream_t *stream;
- int video_open;
-
- unsigned char *image;
- int index;
-
-} image_decoder_t;
-
-
-static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
- image_decoder_t *this = (image_decoder_t *) this_gen;
-
- if (!this->video_open) {
- lprintf("opening video\n");
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
- this->video_open = 1;
- }
-
- xine_buffer_copyin(this->image, this->index, buf->mem, buf->size);
- this->index += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
- int width, height, i;
- int status;
- MagickWand *wand;
- uint8_t *img_buf, *img_buf_ptr;
- yuv_planes_t yuv_planes;
- vo_frame_t *img;
-
- /*
- * this->image -> rgb data
- */
-#if MAGICK_VERSION < 0x671
- InitializeMagick(NULL);
-#else
- MagickWandGenesis();
-#endif
- wand = NewMagickWand();
- status = MagickReadImageBlob(wand, this->image, this->index);
-
- this->index = 0;
-
- if (!status) {
- DestroyMagickWand(wand);
-#if MAGICK_VERSION < 0x671
- DestroyMagick();
-#else
- MagickWandTerminus();
-#endif
- lprintf("error loading image\n");
- return;
- }
-
- width = MagickGetImageWidth(wand) & ~1; /* must be even for init_yuv_planes */
- height = MagickGetImageHeight(wand);
- img_buf = malloc(width * height * 3);
-#if MAGICK_VERSION < 0x671
- MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf);
- DestroyMagickWand(wand);
- DestroyMagick();
-#else
- MagickExportImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf);
- DestroyMagickWand(wand);
- MagickWandTerminus();
-#endif
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, height);
-
- lprintf("image loaded successfully\n");
-
- /*
- * rgb data -> yuv_planes
- */
- init_yuv_planes(&yuv_planes, width, height);
-
- img_buf_ptr = img_buf;
- for (i=0; i < width*height; i++) {
- uint8_t r = *(img_buf_ptr++);
- uint8_t g = *(img_buf_ptr++);
- uint8_t b = *(img_buf_ptr++);
-
- yuv_planes.y[i] = COMPUTE_Y(r, g, b);
- yuv_planes.u[i] = COMPUTE_U(r, g, b);
- yuv_planes.v[i] = COMPUTE_V(r, g, b);
- }
- free(img_buf);
-
- /*
- * alloc and draw video frame
- */
- img = this->stream->video_out->get_frame (this->stream->video_out, width,
- height, (double)width/(double)height,
- XINE_IMGFMT_YUY2,
- VO_BOTH_FIELDS);
- img->pts = buf->pts;
- img->duration = 3600;
- img->bad_frame = 0;
-
- yuv444_to_yuy2(&yuv_planes, img->base[0], img->pitches[0]);
- free_yuv_planes(&yuv_planes);
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, img->duration);
-
- img->draw(img, this->stream);
- img->free(img);
- }
-}
-
-
-static void image_flush (video_decoder_t *this_gen) {
- /* image_decoder_t *this = (image_decoder_t *) this_gen; */
-
- /*
- * flush out any frames that are still stored in the decoder
- */
-}
-
-
-static void image_reset (video_decoder_t *this_gen) {
- image_decoder_t *this = (image_decoder_t *) this_gen;
-
- /*
- * reset decoder after engine flush (prepare for new
- * video data not related to recently decoded data)
- */
-
- this->index = 0;
-}
-
-
-static void image_discontinuity (video_decoder_t *this_gen) {
- /* image_decoder_t *this = (image_decoder_t *) this_gen; */
-
- /*
- * a time reference discontinuity has happened.
- * that is, it must forget any currently held pts value
- */
-}
-
-static void image_dispose (video_decoder_t *this_gen) {
- image_decoder_t *this = (image_decoder_t *) this_gen;
-
- if (this->video_open) {
- lprintf("closing video\n");
-
- this->stream->video_out->close(this->stream->video_out, this->stream);
- this->video_open = 0;
- }
-
- xine_buffer_free(this->image);
-
- lprintf("closed\n");
- free (this);
-}
-
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
- xine_stream_t *stream) {
-
- image_class_t *cls = (image_class_t *) class_gen;
- image_decoder_t *this;
-
- lprintf("opened\n");
-
- this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
-
- this->video_decoder.decode_data = image_decode_data;
- this->video_decoder.flush = image_flush;
- this->video_decoder.reset = image_reset;
- this->video_decoder.discontinuity = image_discontinuity;
- this->video_decoder.dispose = image_dispose;
- this->cls = cls;
- this->stream = stream;
-
- /*
- * initialisation of privates
- */
-
- this->image = xine_buffer_init(10240);
-
- return &this->video_decoder;
-}
-
-/*
- * image plugin class
- */
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "imagevdec";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "image video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this_gen) {
- image_class_t *this = (image_class_t *) this_gen;
-
- lprintf("class closed\n");
-
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *data) {
-
- image_class_t *this;
-
- this = (image_class_t *) calloc(1, sizeof(image_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- /*
- * initialisation of privates
- */
-
- lprintf("class opened\n");
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-
-static uint32_t supported_types[] = { BUF_VIDEO_IMAGE,
- 0 };
-
-static const decoder_info_t dec_info_image = {
- supported_types, /* supported types */
- 6 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "image", XINE_VERSION_CODE, &dec_info_image, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c
deleted file mode 100644
index 9e28afd90..000000000
--- a/src/libxinevdec/rgb.c
+++ /dev/null
@@ -1,467 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * Raw RGB "Decoder" by Mike Melanson (melanson@pcisys.net)
- * Actually, this decoder just converts a raw RGB image to a YUY2 map
- * suitable for display under xine.
- *
- * This decoder deals with raw RGB data from Microsoft and Quicktime files.
- * Data from a MS file can be 32-, 24-, 16-, or 8-bit. The latter can also
- * be grayscale, depending on whether a palette is present. Data from a QT
- * file can be 32-, 24-, 16-, 8-, 4-, 2-, or 1-bit. Any resolutions <= 8
- * can also be greyscale depending on what the QT file specifies.
- *
- * One more catch: Raw RGB from a Microsoft file is upside down. This is
- * indicated by a negative height parameter.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#define LOG_MODULE "rgb"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-typedef struct {
- video_decoder_class_t decoder_class;
-} rgb_class_t;
-
-typedef struct rgb_decoder_s {
- video_decoder_t video_decoder; /* parent video decoder structure */
-
- rgb_class_t *class;
- xine_stream_t *stream;
-
- /* these are traditional variables in a video decoder object */
- uint64_t video_step; /* frame duration in pts units */
- int decoder_ok; /* current decoder status */
- int skipframes;
-
- unsigned char *buf; /* the accumulated buffer data */
- int bufsize; /* the maximum size of buf */
- int size; /* the current size of buf */
-
- int width; /* the width of a video frame */
- int height; /* the height of a video frame */
- double ratio; /* the width to height ratio */
- int bytes_per_pixel;
- int bit_depth;
- int upside_down;
-
- unsigned char yuv_palette[256 * 4];
- yuv_planes_t yuv_planes;
-
-} rgb_decoder_t;
-
-static void rgb_decode_data (video_decoder_t *this_gen,
- buf_element_t *buf) {
-
- rgb_decoder_t *this = (rgb_decoder_t *) this_gen;
- xine_bmiheader *bih;
- palette_entry_t *palette;
- int i;
- int pixel_ptr, row_ptr;
- int palette_index;
- int buf_ptr;
- unsigned int packed_pixel;
- unsigned char r, g, b;
- int pixels_left;
- unsigned char pixel_byte = 0;
-
- vo_frame_t *img; /* video out frame */
-
- /* a video decoder does not care about this flag (?) */
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- if ((buf->decoder_flags & BUF_FLAG_SPECIAL) &&
- (buf->decoder_info[1] == BUF_SPECIAL_PALETTE)) {
- palette = (palette_entry_t *)buf->decoder_info_ptr[2];
- for (i = 0; i < buf->decoder_info[2]; i++) {
- this->yuv_palette[i * 4 + 0] =
- COMPUTE_Y(palette[i].r, palette[i].g, palette[i].b);
- this->yuv_palette[i * 4 + 1] =
- COMPUTE_U(palette[i].r, palette[i].g, palette[i].b);
- this->yuv_palette[i * 4 + 2] =
- COMPUTE_V(palette[i].r, palette[i].g, palette[i].b);
- }
- }
-
- if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
- this->video_step = buf->decoder_info[0];
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
- }
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
-
- bih = (xine_bmiheader *) buf->content;
- this->width = (bih->biWidth + 3) & ~0x03;
- this->height = (bih->biHeight + 3) & ~0x03;
- if (this->height < 0) {
- this->upside_down = 1;
- this->height = -this->height;
- } else {
- this->upside_down = 0;
- }
- this->ratio = (double)this->width/(double)this->height;
-
- this->bit_depth = bih->biBitCount;
- if (this->bit_depth > 32)
- this->bit_depth &= 0x1F;
- /* round this number up in case of 15 */
- lprintf("width = %d, height = %d, bit_depth = %d\n", this->width, this->height, this->bit_depth);
-
- this->bytes_per_pixel = (this->bit_depth + 1) / 8;
-
- if (this->buf)
- free (this->buf);
-
- /* minimal buffer size */
- this->bufsize = this->width * this->height * this->bytes_per_pixel;
- this->buf = calloc(1, this->bufsize);
- this->size = 0;
-
- init_yuv_planes(&this->yuv_planes, this->width, this->height);
-
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
- this->decoder_ok = 1;
-
- /* load the stream/meta info */
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw RGB");
-
- return;
- } else if (this->decoder_ok) {
-
- if (this->size + buf->size > this->bufsize) {
- this->bufsize = this->size + 2 * buf->size;
- this->buf = realloc (this->buf, this->bufsize);
- }
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
-
- this->size += buf->size;
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YUY2,
- VO_BOTH_FIELDS);
-
- img->duration = this->video_step;
- img->pts = buf->pts;
- img->bad_frame = 0;
-
-
- /* iterate through each row */
- buf_ptr = 0;
-
- if (this->upside_down) {
- for (row_ptr = this->yuv_planes.row_width * (this->yuv_planes.row_count - 1);
- row_ptr >= 0; row_ptr -= this->yuv_planes.row_width) {
- for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) {
-
- if (this->bytes_per_pixel == 1) {
-
- palette_index = this->buf[buf_ptr++];
-
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 0];
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 1];
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 2];
-
- } else if (this->bytes_per_pixel == 2) {
-
- /* ABGR1555 format, little-endian order */
- packed_pixel = _X_LE_16(&this->buf[buf_ptr]);
- buf_ptr += 2;
- UNPACK_BGR15(packed_pixel, r, g, b);
-
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- COMPUTE_Y(r, g, b);
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- COMPUTE_U(r, g, b);
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- COMPUTE_V(r, g, b);
-
- } else {
-
- /* BGR24 or BGRA32 */
- b = this->buf[buf_ptr++];
- g = this->buf[buf_ptr++];
- r = this->buf[buf_ptr++];
-
- /* the next line takes care of 'A' in the 32-bit case */
- buf_ptr += this->bytes_per_pixel - 3;
-
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- COMPUTE_Y(r, g, b);
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- COMPUTE_U(r, g, b);
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- COMPUTE_V(r, g, b);
-
- }
- }
- }
- } else {
-
- for (row_ptr = 0; row_ptr < this->yuv_planes.row_width * this->yuv_planes.row_count; row_ptr += this->yuv_planes.row_width) {
- pixels_left = 0;
- for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) {
-
- if (this->bit_depth == 1) {
-
- if (pixels_left == 0) {
- pixels_left = 8;
- pixel_byte = *this->buf++;
- }
-
- if (pixel_byte & 0x80) {
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- this->yuv_palette[1 * 4 + 0];
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- this->yuv_palette[1 * 4 + 1];
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- this->yuv_palette[1 * 4 + 2];
- } else {
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- this->yuv_palette[0 * 4 + 0];
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- this->yuv_palette[0 * 4 + 1];
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- this->yuv_palette[0 * 4 + 2];
- }
- pixels_left--;
- pixel_byte <<= 1;
-
- } else if (this->bit_depth == 2) {
-
- if (pixels_left == 0) {
- pixels_left = 4;
- pixel_byte = *this->buf++;
- }
-
- palette_index = (pixel_byte & 0xC0) >> 6;
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 0];
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 1];
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 2];
-
- pixels_left--;
- pixel_byte <<= 2;
-
- } else if (this->bit_depth == 4) {
-
- if (pixels_left == 0) {
- pixels_left = 2;
- pixel_byte = *this->buf++;
- }
-
- palette_index = (pixel_byte & 0xF0) >> 4;
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 0];
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 1];
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 2];
-
- pixels_left--;
- pixel_byte <<= 4;
-
- } else if (this->bytes_per_pixel == 1) {
-
- palette_index = this->buf[buf_ptr++];
-
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 0];
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 1];
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- this->yuv_palette[palette_index * 4 + 2];
-
- } else if (this->bytes_per_pixel == 2) {
-
- /* ARGB1555 format, big-endian order */
- packed_pixel = _X_BE_16(&this->buf[buf_ptr]);
- buf_ptr += 2;
- UNPACK_RGB15(packed_pixel, r, g, b);
-
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- COMPUTE_Y(r, g, b);
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- COMPUTE_U(r, g, b);
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- COMPUTE_V(r, g, b);
-
- } else {
-
- /* RGB24 or ARGB32; the next line takes care of 'A' in the
- * 32-bit case */
- buf_ptr += this->bytes_per_pixel - 3;
-
- r = this->buf[buf_ptr++];
- g = this->buf[buf_ptr++];
- b = this->buf[buf_ptr++];
-
- this->yuv_planes.y[row_ptr + pixel_ptr] =
- COMPUTE_Y(r, g, b);
- this->yuv_planes.u[row_ptr + pixel_ptr] =
- COMPUTE_U(r, g, b);
- this->yuv_planes.v[row_ptr + pixel_ptr] =
- COMPUTE_V(r, g, b);
-
- }
- }
- }
- }
-
- yuv444_to_yuy2(&this->yuv_planes, img->base[0], img->pitches[0]);
-
- img->draw(img, this->stream);
- img->free(img);
-
- this->size = 0;
- }
- }
-}
-
-/*
- * This function is called when xine needs to flush the system. Not
- * sure when or if this is used or even if it needs to do anything.
- */
-static void rgb_flush (video_decoder_t *this_gen) {
-}
-
-/*
- * This function resets the video decoder.
- */
-static void rgb_reset (video_decoder_t *this_gen) {
- rgb_decoder_t *this = (rgb_decoder_t *) this_gen;
-
- this->size = 0;
-}
-
-static void rgb_discontinuity (video_decoder_t *this_gen) {
-}
-
-/*
- * This function frees the video decoder instance allocated to the decoder.
- */
-static void rgb_dispose (video_decoder_t *this_gen) {
- rgb_decoder_t *this = (rgb_decoder_t *) this_gen;
-
- if (this->buf) {
- free (this->buf);
- this->buf = NULL;
- }
-
- if (this->decoder_ok) {
- this->decoder_ok = 0;
- this->stream->video_out->close(this->stream->video_out, this->stream);
- }
-
- free (this_gen);
-}
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- rgb_decoder_t *this ;
-
- this = (rgb_decoder_t *) calloc(1, sizeof(rgb_decoder_t));
-
- this->video_decoder.decode_data = rgb_decode_data;
- this->video_decoder.flush = rgb_flush;
- this->video_decoder.reset = rgb_reset;
- this->video_decoder.discontinuity = rgb_discontinuity;
- this->video_decoder.dispose = rgb_dispose;
- this->size = 0;
-
- this->stream = stream;
- this->class = (rgb_class_t *) class_gen;
-
- this->decoder_ok = 0;
- this->buf = NULL;
-
- return &this->video_decoder;
-}
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "RGB";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "Raw RGB video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- rgb_class_t *this;
-
- this = (rgb_class_t *) calloc(1, sizeof(rgb_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-
-static const uint32_t video_types[] = {
- BUF_VIDEO_RGB,
- 0
- };
-
-static const decoder_info_t dec_info_video = {
- video_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/libxinevdec/xine_theora_decoder.c b/src/libxinevdec/xine_theora_decoder.c
deleted file mode 100644
index bf51a8779..000000000
--- a/src/libxinevdec/xine_theora_decoder.c
+++ /dev/null
@@ -1,398 +0,0 @@
-/*
- * Copyright (C) 2001-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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * xine decoder plugin using libtheora
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <inttypes.h>
-#include <string.h>
-#include <pthread.h>
-#include <math.h>
-#include <assert.h>
-#include <theora/theora.h>
-
-#define LOG_MODULE "theora_decoder"
-#define LOG_VERBOSE
-/*
-#define LOG
-*/
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "metronom.h"
-#include "xineutils.h"
-
-typedef struct theora_class_s {
- video_decoder_class_t decoder_class;
-} theora_class_t;
-
-typedef struct theora_decoder_s {
- video_decoder_t theora_decoder;
- theora_class_t *class;
- theora_info t_info;
- theora_comment t_comment;
- theora_state t_state;
- ogg_packet op;
- yuv_buffer yuv;
- xine_stream_t* stream;
- int reject;
- int op_max_size;
- char* packet;
- int done;
- int width, height;
- double ratio;
- int offset_x, offset_y;
- int frame_duration;
- int skipframes;
- int hp_read;
- int initialized;
-} theora_decoder_t;
-
-static void readin_op (theora_decoder_t *this, 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;
- this->packet=realloc(this->packet, this->op_max_size);
- this->op.packet=this->packet;
- }
- xine_fast_memcpy ( this->packet+this->done, src, size);
- this->done=this->done+size;
-}
-
-static void yuv2frame(yuv_buffer *yuv, vo_frame_t *frame, int offset_x, int offset_y) {
- int i;
- int crop_offset;
-
- /* fixme - direct rendering (exchaning pointers) may be possible.
- * frame->base[0] = yuv->y could work if one could change the
- * pitches[0,1,2] values, and rely on the drawing routine using
- * the new pitches. With cropping and offsets, it's a bit trickier,
- * but it would still be possible.
- * Attempts at doing this have yielded nothing but SIGSEVs so far.
- */
-
- /* Copy yuv data onto the frame. Cropping and offset as specified
- * by the frame_width, frame_height, offset_x and offset_y fields
- * in the theora header is carried out.
- */
-
- crop_offset=offset_x+yuv->y_stride*offset_y;
- for(i=0;i<frame->height;i++)
- xine_fast_memcpy(frame->base[0]+frame->pitches[0]*i,
- yuv->y+crop_offset+yuv->y_stride*i,
- frame->width);
-
- crop_offset=(offset_x/2)+(yuv->uv_stride)*(offset_y/2);
- for(i=0;i<frame->height/2;i++){
- xine_fast_memcpy(frame->base[1]+frame->pitches[1]*i,
- yuv->u+crop_offset+yuv->uv_stride*i,
- frame->width/2);
- xine_fast_memcpy(frame->base[2]+frame->pitches[2]*i,
- yuv->v+crop_offset+yuv->uv_stride*i,
- frame->width/2);
-
- }
-}
-
-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*/
-
- 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));
- this->op.packet=this->packet;
-
- readin_op (this, buf->content + sizeof(ogg_packet), buf->size - sizeof(ogg_packet) );
- /*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*/
- printf ("libtheora: rejecting packet\n");
- this->reject=1;
- return 0;
- }
- readin_op (this, buf->content, buf->size );
- }
-
- if ((buf->decoder_flags & BUF_FLAG_FRAME_END) && !this->reject) {
- if ( this->done != this->op.bytes ) {
- printf ("libtheora: A packet changed its size during transfer - rejected\n");
- printf (" size %d should be %ld\n", this->done , this->op.bytes);
- this->op.bytes=this->done;
- }
- return 1;
- }
- return 0;
-}
-
-static void theora_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
- /*
- * decode data from buf and feed decoded frames to
- * video output
- */
- theora_decoder_t *this = (theora_decoder_t *) this_gen;
- vo_frame_t *frame;
- yuv_buffer yuv;
- int ret;
-
- if (!collect_data(this, buf)) return;
- /*return, until a entire packets is collected*/
-
- if ( (buf->decoder_flags & BUF_FLAG_HEADER) &&
- !(buf->decoder_flags & BUF_FLAG_STDHEADER) ) {
- /*get the first 3 packets and decode the header during preview*/
-
- if (this->hp_read==0) {
- /*decode first hp*/
- if (theora_decode_header(&this->t_info, &this->t_comment, &this->op)>=0) {
- this->hp_read++;
- return;
- }
- }
-
- if (this->hp_read==1) {
- /*decode three header packets*/
- if (theora_decode_header(&this->t_info, &this->t_comment,&this->op)) {
- printf ("libtheora: Was unable to decode header #%d, corrupt stream?\n",this->hp_read);
- } else {
- this->hp_read++;
- return;
- }
- }
-
- if (this->hp_read==2) {
- if (theora_decode_header(&this->t_info, &this->t_comment,&this->op)) {
- printf ("libtheora: Was unable to decode header #%d, corrupt stream?\n",this->hp_read);
- }
- /*headers are now decoded. initialize the decoder*/
- theora_decode_init (&this->t_state, &this->t_info);
-
- lprintf("theora stream is Theora %dx%d %.02f fps video.\n"
- " frame content is %dx%d with offset (%d,%d).\n"
- " pixel aspect is %d:%d.\n",
- this->t_info.width,this->t_info.height,
- (double)this->t_info.fps_numerator/this->t_info.fps_denominator,
- this->t_info.frame_width, this->t_info.frame_height,
- this->t_info.offset_x, this->t_info.offset_y,
- this->t_info.aspect_numerator, this->t_info.aspect_denominator);
-
- this->frame_duration=((int64_t)90000*this->t_info.fps_denominator)/this->t_info.fps_numerator;
- this->width=this->t_info.frame_width;
- this->height=this->t_info.frame_height;
- if (this->t_info.aspect_numerator==0 || this->t_info.aspect_denominator==0)
- /* 0-values are undefined, so don't do any scaling. */
- this->ratio=(double)this->width/(double)this->height;
- else
- /* Yes, this video needs to be scaled. */
- this->ratio=(double)(this->width*this->t_info.aspect_numerator) /
- (double)(this->height*this->t_info.aspect_denominator);
- this->offset_x=this->t_info.offset_x;
- this->offset_y=this->t_info.offset_y;
- this->initialized=1;
- this->hp_read++;
- }
-
- } else if (buf->decoder_flags & BUF_FLAG_HEADER) {
- /*ignore headerpackets*/
-
- return;
-
- } else {
- /*decode videodata*/
-
- if (!this->initialized) {
- printf ("libtheora: cannot decode stream without header\n");
- return;
- }
-
- ret=theora_decode_packetin( &this->t_state, &this->op);
-
- if ( ret!=0) {
- xprintf(this->stream->xine, XINE_VERBOSITY_LOG, "libtheora:Received an bad packet\n");
- } else if (!this->skipframes) {
-
- theora_decode_YUVout(&this->t_state,&yuv);
-
- /*fixme - aspectratio from theora is not considered*/
- frame = this->stream->video_out->get_frame( this->stream->video_out,
- this->width, this->height,
- this->ratio,
- XINE_IMGFMT_YV12,
- VO_BOTH_FIELDS);
- yuv2frame(&yuv, frame, this->offset_x, this->offset_y);
-
- frame->pts = buf->pts;
- frame->duration=this->frame_duration;
- this->skipframes=frame->draw(frame, this->stream);
- frame->free(frame);
- } else {
- this->skipframes=this->skipframes-1;
- }
- }
-}
-
-
-static void theora_flush (video_decoder_t *this_gen) {
- /*
- * flush out any frames that are still stored in the decoder
- */
- theora_decoder_t *this = (theora_decoder_t *) this_gen;
- this->skipframes=0;
-}
-
-static void theora_reset (video_decoder_t *this_gen) {
- /*
- * reset decoder after engine flush (prepare for new
- * video data not related to recently decoded data)
- */
- theora_decoder_t *this = (theora_decoder_t *) this_gen;
- this->skipframes=0;
-}
-
-static void theora_discontinuity (video_decoder_t *this_gen) {
- /*
- * inform decoder that a time reference discontinuity has happened.
- * that is, it must forget any currently held pts value
- */
- theora_decoder_t *this = (theora_decoder_t *) this_gen;
- this->skipframes=0;
-}
-
-static void theora_dispose (video_decoder_t *this_gen) {
- /*
- * close down, free all resources
- */
-
- theora_decoder_t *this = (theora_decoder_t *) this_gen;
-
- lprintf ("dispose \n");
-
- theora_clear (&this->t_state);
- theora_comment_clear (&this->t_comment);
- theora_info_clear (&this->t_info);
- this->stream->video_out->close(this->stream->video_out, this->stream);
- free (this->packet);
- free (this);
-}
-
-static video_decoder_t *theora_open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- /*
- * open a new instance of this plugin class
- */
-
- theora_decoder_t *this ;
-
- this = (theora_decoder_t *) calloc(1, sizeof(theora_decoder_t));
-
- this->theora_decoder.decode_data = theora_decode_data;
- this->theora_decoder.flush = theora_flush;
- this->theora_decoder.reset = theora_reset;
- this->theora_decoder.discontinuity = theora_discontinuity;
- this->theora_decoder.dispose = theora_dispose;
-
- this->stream = stream;
- this->class = (theora_class_t *) class_gen;
-
- this->op_max_size = 4096;
- this->packet = malloc(this->op_max_size);
-
- this->done = 0;
-
- this->stream = stream;
-
- this->initialized = 0;
-
- theora_comment_init (&this->t_comment);
- theora_info_init (&this->t_info);
- (stream->video_out->open) (stream->video_out, stream);
-
- return &this->theora_decoder;
-
-}
-
-/*
- * theora plugin class
- */
-
-static char *theora_get_identifier (video_decoder_class_t *this) {
- /*
- * return short, human readable identifier for this plugin class
- */
- return "theora video";
-}
-
-static char *theora_get_description (video_decoder_class_t *this) {
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- return "theora video decoder plugin";
-}
-
-static void theora_dispose_class (video_decoder_class_t *this) {
- /*
- * free all class-related resources
- */
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
- /*initialize our plugin*/
- theora_class_t *this;
-
- this = (theora_class_t *) calloc(1, sizeof(theora_class_t));
-
- this->decoder_class.open_plugin = theora_open_plugin;
- this->decoder_class.get_identifier = theora_get_identifier;
- this->decoder_class.get_description = theora_get_description;
- this->decoder_class.dispose = theora_dispose_class;
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-
-static uint32_t supported_types[] = { BUF_VIDEO_THEORA, 0 };
-
-static const decoder_info_t dec_info_video = {
- 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/libxinevdec/yuv.c b/src/libxinevdec/yuv.c
deleted file mode 100644
index 6cb1b240c..000000000
--- a/src/libxinevdec/yuv.c
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * YUV "Decoder" by Mike Melanson (melanson@pcisys.net)
- * Actually, this decoder just reorganizes chunks of raw YUV data in such
- * a way that xine can display them.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "xine_internal.h"
-#include "video_out.h"
-#include "buffer.h"
-#include "xineutils.h"
-#include "bswap.h"
-
-#define VIDEOBUFSIZE 128*1024
-
-typedef struct {
- video_decoder_class_t decoder_class;
-} yuv_class_t;
-
-typedef struct yuv_decoder_s {
- video_decoder_t video_decoder; /* parent video decoder structure */
-
- yuv_class_t *class;
- xine_stream_t *stream;
-
- /* these are traditional variables in a video decoder object */
- uint64_t video_step; /* frame duration in pts units */
- int decoder_ok; /* current decoder status */
- int skipframes;
-
- unsigned char *buf; /* the accumulated buffer data */
- int bufsize; /* the maximum size of buf */
- int size; /* the current size of buf */
-
- int width; /* the width of a video frame */
- int height; /* the height of a video frame */
- double ratio; /* the width to height ratio */
-
- int progressive;
- int top_field_first;
-
-} yuv_decoder_t;
-
-/**************************************************************************
- * xine video plugin functions
- *************************************************************************/
-
-/*
- * This function receives a buffer of data from the demuxer layer and
- * figures out how to handle it based on its header flags.
- */
-static void yuv_decode_data (video_decoder_t *this_gen,
- buf_element_t *buf) {
-
- yuv_decoder_t *this = (yuv_decoder_t *) this_gen;
- xine_bmiheader *bih;
-
- vo_frame_t *img; /* video out frame */
-
- /* a video decoder does not care about this flag (?) */
- if (buf->decoder_flags & BUF_FLAG_PREVIEW)
- return;
-
- if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
- this->video_step = buf->decoder_info[0];
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
- }
-
- if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
- (this->stream->video_out->open) (this->stream->video_out, this->stream);
-
- bih = (xine_bmiheader *) buf->content;
- this->width = (bih->biWidth + 3) & ~0x03;
- this->height = (bih->biHeight + 3) & ~0x03;
-
- if (buf->decoder_flags & BUF_FLAG_ASPECT)
- this->ratio = (double)buf->decoder_info[1] / (double)buf->decoder_info[2];
- else
- this->ratio = (double)this->width / (double)this->height;
-
- this->progressive = buf->decoder_info[3];
- this->top_field_first = buf->decoder_info[4];
-
- if (this->buf) {
- free (this->buf);
- this->buf = NULL;
- }
-
- this->bufsize = VIDEOBUFSIZE;
- this->buf = malloc(this->bufsize);
- this->size = 0;
-
- this->decoder_ok = 1;
-
- /* load the stream/meta info */
- switch (buf->type) {
-
- case BUF_VIDEO_YUY2:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw YUY2");
- break;
-
- case BUF_VIDEO_YV12:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw YV12");
- break;
-
- case BUF_VIDEO_YVU9:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw YVU9");
- break;
-
- case BUF_VIDEO_GREY:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Greyscale YUV");
- break;
-
- case BUF_VIDEO_I420:
- _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw I420");
- break;
-
- }
-
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->width);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->height);
- _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, this->ratio*10000);
-
- return;
- } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) {
- uint8_t *src;
-
- /* if buffer contains an entire frame then there's no need to copy it
- * into our internal buffer */
- if ((buf->decoder_flags & BUF_FLAG_FRAME_START) &&
- (buf->decoder_flags & BUF_FLAG_FRAME_END))
- src = buf->content;
- else {
- if (this->size + buf->size > this->bufsize) {
- this->bufsize = this->size + 2 * buf->size;
- this->buf = realloc (this->buf, this->bufsize);
- }
-
- xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
-
- this->size += buf->size;
-
- src = this->buf;
- }
-
- if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
-
- if (buf->type == BUF_VIDEO_YUY2) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YUY2, VO_BOTH_FIELDS);
-
- yuy2_to_yuy2(
- /* src */
- src, this->width*2,
- /* dst */
- img->base[0], img->pitches[0],
- /* width x height */
- this->width, this->height);
-
- } else if (buf->type == BUF_VIDEO_YV12) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
-
- yv12_to_yv12(
- /* Y */
- src, this->width,
- img->base[0], img->pitches[0],
- /* U */
- src + (this->width * this->height * 5/4), this->width/2,
- img->base[1], img->pitches[1],
- /* V */
- src + (this->width * this->height), this->width/2,
- img->base[2], img->pitches[2],
- /* width x height */
- this->width, this->height);
-
- } else if (buf->type == BUF_VIDEO_I420) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
-
- yv12_to_yv12(
- /* Y */
- src, this->width,
- img->base[0], img->pitches[0],
- /* U */
- src + (this->width * this->height), this->width/2,
- img->base[1], img->pitches[1],
- /* V */
- src + (this->width * this->height * 5/4), this->width/2,
- img->base[2], img->pitches[2],
- /* width x height */
- this->width, this->height);
-
- } else if (buf->type == BUF_VIDEO_YVU9) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
-
-
- yuv9_to_yv12(
- /* Y */
- src,
- this->width,
- img->base[0],
- img->pitches[0],
- /* U */
- src + (this->width * this->height),
- this->width / 4,
- img->base[1],
- img->pitches[1],
- /* V */
- src + (this->width * this->height) +
- (this->width * this->height / 16),
- this->width / 4,
- img->base[2],
- img->pitches[2],
- /* width x height */
- this->width,
- this->height);
-
- } else if (buf->type == BUF_VIDEO_GREY) {
-
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
-
- xine_fast_memcpy(img->base[0], src, this->width * this->height);
- memset( img->base[1], 0x80, this->width * this->height / 4 );
- memset( img->base[2], 0x80, this->width * this->height / 4 );
-
- } else {
-
- /* just allocate something to avoid compiler warnings */
- img = this->stream->video_out->get_frame (this->stream->video_out,
- this->width, this->height,
- this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
-
- }
-
- img->duration = this->video_step;
- img->pts = buf->pts;
- img->bad_frame = 0;
-
- img->draw(img, this->stream);
- img->free(img);
-
- this->size = 0;
- }
- }
-}
-
-/*
- * This function is called when xine needs to flush the system. Not
- * sure when or if this is used or even if it needs to do anything.
- */
-static void yuv_flush (video_decoder_t *this_gen) {
-}
-
-/*
- * This function resets the video decoder.
- */
-static void yuv_reset (video_decoder_t *this_gen) {
- yuv_decoder_t *this = (yuv_decoder_t *) this_gen;
-
- this->size = 0;
-}
-
-static void yuv_discontinuity (video_decoder_t *this_gen) {
-}
-
-/*
- * This function frees the video decoder instance allocated to the decoder.
- */
-static void yuv_dispose (video_decoder_t *this_gen) {
- yuv_decoder_t *this = (yuv_decoder_t *) this_gen;
-
- if (this->buf) {
- free (this->buf);
- this->buf = NULL;
- }
-
- if (this->decoder_ok) {
- this->decoder_ok = 0;
- this->stream->video_out->close(this->stream->video_out, this->stream);
- }
-
- free (this_gen);
-}
-
-static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
-
- yuv_decoder_t *this ;
-
- this = (yuv_decoder_t *) calloc(1, sizeof(yuv_decoder_t));
-
- this->video_decoder.decode_data = yuv_decode_data;
- this->video_decoder.flush = yuv_flush;
- this->video_decoder.reset = yuv_reset;
- this->video_decoder.discontinuity = yuv_discontinuity;
- this->video_decoder.dispose = yuv_dispose;
- this->size = 0;
-
- this->stream = stream;
- this->class = (yuv_class_t *) class_gen;
-
- this->decoder_ok = 0;
- this->buf = NULL;
-
- return &this->video_decoder;
-}
-
-static char *get_identifier (video_decoder_class_t *this) {
- return "YUV";
-}
-
-static char *get_description (video_decoder_class_t *this) {
- return "Raw YUV video decoder plugin";
-}
-
-static void dispose_class (video_decoder_class_t *this) {
- free (this);
-}
-
-static void *init_plugin (xine_t *xine, void *data) {
-
- yuv_class_t *this;
-
- this = (yuv_class_t *) calloc(1, sizeof(yuv_class_t));
-
- this->decoder_class.open_plugin = open_plugin;
- this->decoder_class.get_identifier = get_identifier;
- this->decoder_class.get_description = get_description;
- this->decoder_class.dispose = dispose_class;
-
- return this;
-}
-
-/*
- * exported plugin catalog entry
- */
-
-static const uint32_t video_types[] = {
- BUF_VIDEO_YUY2,
- BUF_VIDEO_YV12,
- BUF_VIDEO_YVU9,
- BUF_VIDEO_GREY,
- BUF_VIDEO_I420,
- 0
- };
-
-static const decoder_info_t dec_info_video = {
- video_types, /* supported types */
- 1 /* priority */
-};
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 18, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
diff --git a/src/post/Makefile.am b/src/post/Makefile.am
index 8408c3f3a..f6706f221 100644
--- a/src/post/Makefile.am
+++ b/src/post/Makefile.am
@@ -1,4 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 78b94cd43..a359310e6 100644
--- a/src/post/audio/Makefile.am
+++ b/src/post/audio/Makefile.am
@@ -1,13 +1,15 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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 = $(xineplug_ldflags)
-
+xineplug_post_audio_filters_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_post_audio_filters_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) -lm
diff --git a/src/post/audio/audio_filters.c b/src/post/audio/audio_filters.c
index eb90d38cb..78f495ca6 100644
--- a/src/post/audio/audio_filters.c
+++ b/src/post/audio/audio_filters.c
@@ -24,9 +24,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "audio_filters.h"
@@ -39,9 +39,9 @@ static const post_info_t volnorm_special_info = { XINE_POST_TYPE_AUDIO_FILTER
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST, 9, "upmix", XINE_VERSION_CODE, &upmix_special_info, &upmix_init_plugin },
- { PLUGIN_POST, 9, "upmix_mono", XINE_VERSION_CODE, &upmix_mono_special_info, &upmix_mono_init_plugin },
- { PLUGIN_POST, 9, "stretch", XINE_VERSION_CODE, &stretch_special_info, &stretch_init_plugin },
- { PLUGIN_POST, 9, "volnorm", XINE_VERSION_CODE, &volnorm_special_info, &volnorm_init_plugin },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+ { PLUGIN_POST, 10, "upmix", XINE_VERSION_CODE, &upmix_special_info, &upmix_init_plugin },
+ { PLUGIN_POST, 10, "upmix_mono", XINE_VERSION_CODE, &upmix_mono_special_info, &upmix_mono_init_plugin },
+ { PLUGIN_POST, 10, "stretch", XINE_VERSION_CODE, &stretch_special_info, &stretch_init_plugin },
+ { PLUGIN_POST, 10, "volnorm", XINE_VERSION_CODE, &volnorm_special_info, &volnorm_init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/post/audio/audio_filters.h b/src/post/audio/audio_filters.h
index c2bf88cf8..144e85836 100644
--- a/src/post/audio/audio_filters.h
+++ b/src/post/audio/audio_filters.h
@@ -20,7 +20,7 @@
* catalog for audio filter plugins
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
void *upmix_init_plugin(xine_t *xine, void *data);
diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c
index e315b11a8..1f130eff8 100644
--- a/src/post/audio/stretch.c
+++ b/src/post/audio/stretch.c
@@ -26,11 +26,11 @@
#include <stdio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "dsp.h"
-#include "resample.h"
+#include <xine/resample.h>
#include "audio_filters.h"
@@ -663,33 +663,18 @@ static post_plugin_t *stretch_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *stretch_get_identifier(post_class_t *class_gen)
-{
- return "stretch";
-}
-
-static char *stretch_get_description(post_class_t *class_gen)
-{
- return "Time stretch by a given factor, optionally preserving pitch";
-}
-
-static void stretch_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *stretch_init_plugin(xine_t *xine, void *data)
{
- post_class_stretch_t *class = (post_class_stretch_t *)malloc(sizeof(post_class_stretch_t));
+ post_class_stretch_t *class = (post_class_stretch_t *)xine_xmalloc(sizeof(post_class_stretch_t));
if (!class)
return NULL;
class->post_class.open_plugin = stretch_open_plugin;
- class->post_class.get_identifier = stretch_get_identifier;
- class->post_class.get_description = stretch_get_description;
- class->post_class.dispose = stretch_class_dispose;
+ class->post_class.identifier = "stretch";
+ class->post_class.description = N_("Time stretch by a given factor, optionally preserving pitch");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c
index f4ea9544a..97edd47dd 100644
--- a/src/post/audio/upmix.c
+++ b/src/post/audio/upmix.c
@@ -30,9 +30,9 @@
#include <stdio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "dsp.h"
#include "audio_filters.h"
@@ -420,33 +420,18 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *upmix_get_identifier(post_class_t *class_gen)
-{
- return "upmix";
-}
-
-static char *upmix_get_description(post_class_t *class_gen)
-{
- return "upmix";
-}
-
-static void upmix_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *upmix_init_plugin(xine_t *xine, void *data)
{
- post_class_upmix_t *class = (post_class_upmix_t *)malloc(sizeof(post_class_upmix_t));
+ post_class_upmix_t *class = (post_class_upmix_t *)xine_xmalloc(sizeof(post_class_upmix_t));
if (!class)
return NULL;
class->post_class.open_plugin = upmix_open_plugin;
- class->post_class.get_identifier = upmix_get_identifier;
- class->post_class.get_description = upmix_get_description;
- class->post_class.dispose = upmix_class_dispose;
+ class->post_class.identifier = "upmix";
+ class->post_class.description = N_("upmix");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c
index 1e5e05549..7fb6c7bd9 100644
--- a/src/post/audio/upmix_mono.c
+++ b/src/post/audio/upmix_mono.c
@@ -35,8 +35,8 @@
#define LOG
*/
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "audio_filters.h"
@@ -333,33 +333,18 @@ static post_plugin_t *upmix_mono_open_plugin(post_class_t *class_gen, int inputs
return &this->post;
}
-static char *upmix_mono_get_identifier(post_class_t *class_gen)
-{
- return "upmix_mono";
-}
-
-static char *upmix_mono_get_description(post_class_t *class_gen)
-{
- return "converts Mono into Stereo";
-}
-
-static void upmix_mono_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *upmix_mono_init_plugin(xine_t *xine, void *data)
{
- post_class_upmix_mono_t *class = (post_class_upmix_mono_t *)malloc(sizeof(post_class_upmix_mono_t));
+ post_class_upmix_mono_t *class = (post_class_upmix_mono_t *)xine_xmalloc(sizeof(post_class_upmix_mono_t));
if (!class)
return NULL;
class->post_class.open_plugin = upmix_mono_open_plugin;
- class->post_class.get_identifier = upmix_mono_get_identifier;
- class->post_class.get_description = upmix_mono_get_description;
- class->post_class.dispose = upmix_mono_class_dispose;
+ class->post_class.identifier = "upmix_mono";
+ class->post_class.description = N_("converts Mono into Stereo");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c
index 945fd2505..dda38fa5f 100644
--- a/src/post/audio/volnorm.c
+++ b/src/post/audio/volnorm.c
@@ -29,9 +29,9 @@
#include <stdio.h>
#include <math.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "dsp.h"
#include "audio_filters.h"
@@ -449,33 +449,18 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *volnorm_get_identifier(post_class_t *class_gen)
-{
- return "volnorm";
-}
-
-static char *volnorm_get_description(post_class_t *class_gen)
-{
- return "Normalize volume";
-}
-
-static void volnorm_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *volnorm_init_plugin(xine_t *xine, void *data)
{
- post_class_volnorm_t *class = (post_class_volnorm_t *)malloc(sizeof(post_class_volnorm_t));
+ post_class_volnorm_t *class = (post_class_volnorm_t *)xine_xmalloc(sizeof(post_class_volnorm_t));
if (!class)
return NULL;
class->post_class.open_plugin = volnorm_open_plugin;
- class->post_class.get_identifier = volnorm_get_identifier;
- class->post_class.get_description = volnorm_get_description;
- class->post_class.dispose = volnorm_class_dispose;
+ class->post_class.identifier = "volnorm";
+ class->post_class.description = N_("Normalize volume");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/deinterlace/Makefile.am b/src/post/deinterlace/Makefile.am
index 079ed5baf..cde794988 100644
--- a/src/post/deinterlace/Makefile.am
+++ b/src/post/deinterlace/Makefile.am
@@ -1,19 +1,18 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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
xineplug_post_tvtime_la_SOURCES = xine_plugin.c \
deinterlace.c pulldown.c speedy.c tvtime.c
+xineplug_post_tvtime_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
xineplug_post_tvtime_la_LIBADD = $(XINE_LIB) $(LTLIBINTL) $(PTHREAD_LIBS) \
$(top_builddir)/src/post/deinterlace/plugins/libdeinterlaceplugins.la
-xineplug_post_tvtime_la_CFLAGS = $(VISIBILITY_FLAG)
-xineplug_post_tvtime_la_LDFLAGS = $(xineplug_ldflags) \
- @IMPURE_TEXT_LDFLAGS@
-
noinst_HEADERS = deinterlace.h pulldown.h speedtools.h speedy.h tvtime.h
diff --git a/src/post/deinterlace/deinterlace.c b/src/post/deinterlace/deinterlace.c
index 8e4a3bb00..5c0356c55 100644
--- a/src/post/deinterlace/deinterlace.c
+++ b/src/post/deinterlace/deinterlace.c
@@ -31,7 +31,7 @@
*/
#include "deinterlace.h"
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
typedef struct methodlist_item_s methodlist_item_t;
diff --git a/src/post/deinterlace/plugins/Makefile.am b/src/post/deinterlace/plugins/Makefile.am
index 5e50c25f4..800e6b0fa 100644
--- a/src/post/deinterlace/plugins/Makefile.am
+++ b/src/post/deinterlace/plugins/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
# plugins/Makefile.am distributes the plugins that come with tvtime.
@@ -17,6 +18,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)/src/xine-utils
+
EXTRA_DIST = greedy2frame_template.c greedyh.asm \
tomsmocomp/SearchLoop0A.inc tomsmocomp/SearchLoopBottom.inc \
tomsmocomp/SearchLoopEdgeA.inc tomsmocomp/SearchLoopEdgeA8.inc \
@@ -28,27 +34,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/xine-utils
-
-# Avoid "can't find register" failures with -O0, -O2, -O3 (gcc 4.0)
-libdeinterlaceplugins_la-kdetv_greedyh.o libdeinterlaceplugins_la-kdetv_greedyh.lo: CFLAGS=$(shell echo @CFLAGS@ | sed -e 's/$$/ -O1/')
-
-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_CFLAGS = $(VISIBILITY_FLAG) $(AM_CFLAGS)
-libdeinterlaceplugins_la_LDFLAGS = $(xineplug_ldflags)
-
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) $(AVUTIL_CFLAGS)
+libdeinterlaceplugins_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags)
diff --git a/src/post/deinterlace/plugins/greedy.c b/src/post/deinterlace/plugins/greedy.c
index 925779224..ee401dba6 100644
--- a/src/post/deinterlace/plugins/greedy.c
+++ b/src/post/deinterlace/plugins/greedy.c
@@ -32,8 +32,9 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
#include "deinterlace.h"
#include "speedtools.h"
#include "speedy.h"
diff --git a/src/post/deinterlace/plugins/greedy2frame.c b/src/post/deinterlace/plugins/greedy2frame.c
index 57e3228ac..af27d76ee 100644
--- a/src/post/deinterlace/plugins/greedy2frame.c
+++ b/src/post/deinterlace/plugins/greedy2frame.c
@@ -31,8 +31,8 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
#include "deinterlace.h"
#include "speedtools.h"
#include "speedy.h"
diff --git a/src/post/deinterlace/plugins/greedy2frame_template.c b/src/post/deinterlace/plugins/greedy2frame_template.c
index 7fe52519f..1f4df9161 100644
--- a/src/post/deinterlace/plugins/greedy2frame_template.c
+++ b/src/post/deinterlace/plugins/greedy2frame_template.c
@@ -100,8 +100,6 @@
static int64_t qwGreedyTwoFrameThreshold;
#endif
-#include <mangle.h>
-
#if defined(IS_SSE)
static void DeinterlaceGreedy2Frame_SSE(uint8_t *output, int outstride,
deinterlace_frame_data_t *data,
diff --git a/src/post/deinterlace/plugins/greedyh.asm b/src/post/deinterlace/plugins/greedyh.asm
index 11b28ca76..c96bfbf2c 100644
--- a/src/post/deinterlace/plugins/greedyh.asm
+++ b/src/post/deinterlace/plugins/greedyh.asm
@@ -17,7 +17,6 @@
/////////////////////////////////////////////////////////////////////////////
#include "x86-64_macros.inc"
-#include <mangle.h>
#if !defined(MASKS_DEFINED)
#define MASKS_DEFINED
diff --git a/src/post/deinterlace/plugins/kdetv_greedyh.c b/src/post/deinterlace/plugins/kdetv_greedyh.c
index 5ec48e4a2..2207772ca 100644
--- a/src/post/deinterlace/plugins/kdetv_greedyh.c
+++ b/src/post/deinterlace/plugins/kdetv_greedyh.c
@@ -31,8 +31,8 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
#include "deinterlace.h"
#include "speedtools.h"
#include "speedy.h"
diff --git a/src/post/deinterlace/plugins/kdetv_tomsmocomp.c b/src/post/deinterlace/plugins/kdetv_tomsmocomp.c
index ae0fa0363..0f87b913f 100644
--- a/src/post/deinterlace/plugins/kdetv_tomsmocomp.c
+++ b/src/post/deinterlace/plugins/kdetv_tomsmocomp.c
@@ -31,8 +31,8 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
#include "deinterlace.h"
#include "speedtools.h"
#include "speedy.h"
diff --git a/src/post/deinterlace/plugins/linearblend.c b/src/post/deinterlace/plugins/linearblend.c
index c594f41dd..fe230685b 100644
--- a/src/post/deinterlace/plugins/linearblend.c
+++ b/src/post/deinterlace/plugins/linearblend.c
@@ -31,8 +31,9 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
#include "speedtools.h"
#include "speedy.h"
#include "deinterlace.h"
diff --git a/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc b/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc
index a3b139691..d3ee46a20 100644
--- a/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc
+++ b/src/post/deinterlace/plugins/tomsmocomp/TomsMoCompAll.inc
@@ -21,8 +21,6 @@
// See www.eff.org for details
/////////////////////////////////////////////////////////////////////////////
-#include <mangle.h>
-
#if !defined(MASKS_DEFINED)
#define MASKS_DEFINED
static const int64_t __attribute__((__used__)) Max_Mov = 0x0404040404040404ull;
diff --git a/src/post/deinterlace/plugins/vfir.c b/src/post/deinterlace/plugins/vfir.c
index e66d7c789..89ea1d0e5 100644
--- a/src/post/deinterlace/plugins/vfir.c
+++ b/src/post/deinterlace/plugins/vfir.c
@@ -34,8 +34,9 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
#include "speedy.h"
#include "deinterlace.h"
#include "plugins.h"
diff --git a/src/post/deinterlace/speedy.c b/src/post/deinterlace/speedy.c
index 32c8b03e3..6af2c3b88 100644
--- a/src/post/deinterlace/speedy.c
+++ b/src/post/deinterlace/speedy.c
@@ -62,8 +62,9 @@
#include <stdint.h>
#endif
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
#include "speedtools.h"
#include "speedy.h"
diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c
index c9d451b4f..3cce42400 100644
--- a/src/post/deinterlace/xine_plugin.c
+++ b/src/post/deinterlace/xine_plugin.c
@@ -31,10 +31,10 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
-#include "xine_buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
+#include <xine/xine_buffer.h>
#include <pthread.h>
#include "tvtime.h"
@@ -51,7 +51,7 @@ static const post_info_t deinterlace_special_info = { XINE_POST_TYPE_VIDEO_FILTE
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 9, "tvtime", XINE_VERSION_CODE, &deinterlace_special_info, &deinterlace_init_plugin },
+ { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 10, "tvtime", XINE_VERSION_CODE, &deinterlace_special_info, &deinterlace_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -60,8 +60,8 @@ typedef struct post_plugin_deinterlace_s post_plugin_deinterlace_t;
#define MAX_NUM_METHODS 30
static const char *enum_methods[MAX_NUM_METHODS];
-static char *enum_pulldown[] = { "none", "vektor", NULL };
-static char *enum_framerate[] = { "full", "half_top", "half_bottom", NULL };
+static const char *const enum_pulldown[] = { "none", "vektor", NULL };
+static const char *const enum_framerate[] = { "full", "half_top", "half_bottom", NULL };
static void *help_string;
@@ -280,8 +280,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *deinterlace_get_identifier(post_class_t *class_gen);
-static char *deinterlace_get_description(post_class_t *class_gen);
static void deinterlace_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
@@ -311,8 +309,8 @@ static void *deinterlace_init_plugin(xine_t *xine, void *data)
return NULL;
class->class.open_plugin = deinterlace_open_plugin;
- class->class.get_identifier = deinterlace_get_identifier;
- class->class.get_description = deinterlace_get_description;
+ class->class.identifier = "tvtime";
+ class->class.description = N_("advanced deinterlacer plugin with pulldown detection");
class->class.dispose = deinterlace_class_dispose;
@@ -425,16 +423,6 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input
return &this->post;
}
-static char *deinterlace_get_identifier(post_class_t *class_gen)
-{
- return "tvtime";
-}
-
-static char *deinterlace_get_description(post_class_t *class_gen)
-{
- return "advanced deinterlacer plugin with pulldown detection";
-}
-
static void deinterlace_class_dispose(post_class_t *class_gen)
{
xine_buffer_free(help_string);
diff --git a/src/post/goom/Makefile.am b/src/post/goom/Makefile.am
index 386c0b351..8453213e3 100644
--- a/src/post/goom/Makefile.am
+++ b/src/post/goom/Makefile.am
@@ -1,37 +1,17 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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 = $(xineplug_ldflags)
+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 \
@@ -39,3 +19,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 f538aad34..f538aad34 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/goom_core.c b/src/post/goom/goom_core.c
index 62d9a27b6..7d40c0f86 100644
--- a/src/post/goom/goom_core.c
+++ b/src/post/goom/goom_core.c
@@ -26,7 +26,7 @@
#include "goom_fx.h"
#include "goomsl.h"
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
/* #define VERBOSE */
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..6861b7cfe 100644
--- a/src/post/goom/mmx.h
+++ b/src/post/goom/mmx.h
@@ -31,6 +31,8 @@
# include "config.h"
#endif
+#include <xine/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/goom/xine_goom.c b/src/post/goom/xine_goom.c
index 72692ffe1..7cf1a9325 100644
--- a/src/post/goom/xine_goom.c
+++ b/src/post/goom/xine_goom.c
@@ -35,9 +35,9 @@
*/
#include "config.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "goom.h"
@@ -116,7 +116,7 @@ static const post_info_t goom_special_info = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 9, "goom", XINE_VERSION_CODE, &goom_special_info, &goom_init_plugin },
+ { PLUGIN_POST | PLUGIN_MUST_PRELOAD, 10, "goom", XINE_VERSION_CODE, &goom_special_info, &goom_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -125,8 +125,6 @@ const plugin_info_t xine_plugin_info[] EXPORTED = {
static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *goom_get_identifier(post_class_t *class_gen);
-static char *goom_get_description(post_class_t *class_gen);
static void goom_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
@@ -194,8 +192,8 @@ static void *goom_init_plugin(xine_t *xine, void *data)
return NULL;
this->class.open_plugin = goom_open_plugin;
- this->class.get_identifier = goom_get_identifier;
- this->class.get_description = goom_get_description;
+ this->class.identifier = "goom";
+ this->class.description = N_("What a GOOM");
this->class.dispose = goom_class_dispose;
this->ip = NULL;
this->xine = xine;
@@ -307,16 +305,6 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *goom_get_identifier(post_class_t *class_gen)
-{
- return "goom";
-}
-
-static char *goom_get_description(post_class_t *class_gen)
-{
- return "What a GOOM";
-}
-
static void goom_class_dispose(post_class_t *class_gen)
{
post_class_goom_t *this = (post_class_goom_t*) class_gen;
diff --git a/src/post/mosaico/Makefile.am b/src/post/mosaico/Makefile.am
index 83f2b8f2a..cbe5faa9c 100644
--- a/src/post/mosaico/Makefile.am
+++ b/src/post/mosaico/Makefile.am
@@ -1,14 +1,14 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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 = $(xineplug_ldflags)
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 = $(xineplug_ldflags)
diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c
index 9a9a9911c..79272e8db 100644
--- a/src/post/mosaico/mosaico.c
+++ b/src/post/mosaico/mosaico.c
@@ -32,8 +32,8 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
/* FIXME: This plugin needs to handle overlays as well. */
@@ -45,7 +45,7 @@ static const post_info_t mosaico_special_info = { XINE_POST_TYPE_VIDEO_COMPOSE }
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST, 9, "mosaico", XINE_VERSION_CODE, &mosaico_special_info, &mosaico_init_plugin },
+ { PLUGIN_POST, 10, "mosaico", XINE_VERSION_CODE, &mosaico_special_info, &mosaico_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -100,9 +100,6 @@ struct post_mosaico_s {
static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *mosaico_get_identifier(post_class_t *class_gen);
-static char *mosaico_get_description(post_class_t *class_gen);
-static void mosaico_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void mosaico_dispose(post_plugin_t *this_gen);
@@ -132,9 +129,9 @@ static void *mosaico_init_plugin(xine_t *xine, void *data)
return NULL;
this->class.open_plugin = mosaico_open_plugin;
- this->class.get_identifier = mosaico_get_identifier;
- this->class.get_description = mosaico_get_description;
- this->class.dispose = mosaico_class_dispose;
+ this->class.identifier = "mosaico";
+ this->class.description = N_("Mosaico is a picture in picture (pip) post plugin");
+ this->class.dispose = default_post_class_dispose;
this->xine = xine;
return &this->class;
@@ -205,22 +202,6 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *mosaico_get_identifier(post_class_t *class_gen)
-{
- return "mosaico";
-}
-
-static char *mosaico_get_description(post_class_t *class_gen)
-{
- return "Mosaico is a picture in picture (pip) post plugin";
-}
-
-static void mosaico_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void mosaico_dispose(post_plugin_t *this_gen)
{
post_mosaico_t *this = (post_mosaico_t *)this_gen;
diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c
index 7cba7c998..1bc9058ae 100644
--- a/src/post/mosaico/switch.c
+++ b/src/post/mosaico/switch.c
@@ -28,8 +28,8 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
/* FIXME: This plugin needs to handle overlays as well. */
@@ -41,7 +41,7 @@ static const post_info_t switch_special_info = { XINE_POST_TYPE_VIDEO_COMPOSE };
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST, 9, "switch", XINE_VERSION_CODE, &switch_special_info, &switch_init_plugin },
+ { PLUGIN_POST, 10, "switch", XINE_VERSION_CODE, &switch_special_info, &switch_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
@@ -82,9 +82,6 @@ struct post_switch_s {
static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *switch_get_identifier(post_class_t *class_gen);
-static char *switch_get_description(post_class_t *class_gen);
-static void switch_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void switch_dispose(post_plugin_t *this_gen);
@@ -107,9 +104,9 @@ static void *switch_init_plugin(xine_t *xine, void *data)
return NULL;
this->class.open_plugin = switch_open_plugin;
- this->class.get_identifier = switch_get_identifier;
- this->class.get_description = switch_get_description;
- this->class.dispose = switch_class_dispose;
+ this->class.identifier = "switch";
+ this->class.description = N_("Switch is a post plugin able to switch at any time between different streams");
+ this->class.dispose = default_post_class_dispose;
this->xine = xine;
return &this->class;
@@ -168,22 +165,6 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *switch_get_identifier(post_class_t *class_gen)
-{
- return "switch";
-}
-
-static char *switch_get_description(post_class_t *class_gen)
-{
- return "Switch is a post plugin able to switch at any time between different streams";
-}
-
-static void switch_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void switch_dispose(post_plugin_t *this_gen)
{
post_switch_t *this = (post_switch_t *)this_gen;
diff --git a/src/post/planar/Makefile.am b/src/post/planar/Makefile.am
index 319152cba..d5d122ce3 100644
--- a/src/post/planar/Makefile.am
+++ b/src/post/planar/Makefile.am
@@ -1,35 +1,20 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
-POSTPROC_INT_LIB = $(top_builddir)/src/libffmpeg/libavcodec/libpostproc/libpostprocess.la
+AM_CFLAGS = $(VISIBILITY_FLAG)
+AM_CPPFLAGS =
+AM_LDFLAGS =
-if HAVE_FFMPEG
-postproc_lib = $(FFMPEG_POSTPROC_LIBS)
-ff_cflags = $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
-else
-ff_cflags = -I$(top_srcdir)/src/libffmpeg/libavcodec
-postproc_lib = $(POSTPROC_INT_LIB)
-postproc_dep = $(postproc_lib)
-endif
-
-# -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
-
-# 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) $(AVUTIL_CFLAGS)
+libpost_planar_asm_la_LIBADD = $(AVUTIL_LIBS)
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 = $(xineplug_ldflags) \
- @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) $(FFMPEG_POSTPROC_LIBS) -lm $(PTHREAD_LIBS) $(LTLIBINTL) $(noinst_LTLIBRARIES)
+xineplug_post_planar_la_DEPS = $(FFMPEG_POSTPROC_DEPS)
+xineplug_post_planar_la_CFLAGS = $(DEFAULT_OCFLAGS) $(AM_CFLAGS) $(FFMPEG_CFLAGS) $(FFMPEG_POSTPROC_CFLAGS)
+xineplug_post_planar_la_LDFLAGS = $(AM_LDFLAGS) $(xineplug_ldflags) $(IMPURE_TEXT_LDFLAGS)
diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c
index ceeba3b40..ea3085ffd 100644
--- a/src/post/planar/boxblur.c
+++ b/src/post/planar/boxblur.c
@@ -25,9 +25,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#include <pthread.h>
/* plugin class initialization function */
@@ -124,9 +124,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *boxblur_get_identifier(post_class_t *class_gen);
-static char *boxblur_get_description(post_class_t *class_gen);
-static void boxblur_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void boxblur_dispose(post_plugin_t *this_gen);
@@ -140,15 +137,15 @@ static int boxblur_draw(vo_frame_t *frame, xine_stream_t *stream);
void *boxblur_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = boxblur_open_plugin;
- class->get_identifier = boxblur_get_identifier;
- class->get_description = boxblur_get_description;
- class->dispose = boxblur_class_dispose;
+ class->identifier = "boxblur";
+ class->description = N_("box blur filter from mplayer");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -198,22 +195,6 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *boxblur_get_identifier(post_class_t *class_gen)
-{
- return "boxblur";
-}
-
-static char *boxblur_get_description(post_class_t *class_gen)
-{
- return "box blur filter from mplayer";
-}
-
-static void boxblur_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void boxblur_dispose(post_plugin_t *this_gen)
{
post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)this_gen;
diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c
index 2073151b4..793a377c7 100644
--- a/src/post/planar/denoise3d.c
+++ b/src/post/planar/denoise3d.c
@@ -25,9 +25,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#include <math.h>
#include <pthread.h>
@@ -161,9 +161,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *denoise3d_get_identifier(post_class_t *class_gen);
-static char *denoise3d_get_description(post_class_t *class_gen);
-static void denoise3d_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void denoise3d_dispose(post_plugin_t *this_gen);
@@ -180,15 +177,15 @@ static int denoise3d_draw(vo_frame_t *frame, xine_stream_t *stream);
void *denoise3d_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = denoise3d_open_plugin;
- class->get_identifier = denoise3d_get_identifier;
- class->get_description = denoise3d_get_description;
- class->dispose = denoise3d_class_dispose;
+ class->identifier = "denoise3d";
+ class->description = N_("3D Denoiser (variable lowpass filter)");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -241,22 +238,6 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *denoise3d_get_identifier(post_class_t *class_gen)
-{
- return "denoise3d";
-}
-
-static char *denoise3d_get_description(post_class_t *class_gen)
-{
- return "3D Denoiser (variable lowpass filter)";
-}
-
-static void denoise3d_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void denoise3d_dispose(post_plugin_t *this_gen)
{
post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)this_gen;
diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c
index 73607b8a1..dcf9b47fb 100644
--- a/src/post/planar/eq.c
+++ b/src/post/planar/eq.c
@@ -25,9 +25,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#include <pthread.h>
@@ -212,9 +212,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *eq_get_identifier(post_class_t *class_gen);
-static char *eq_get_description(post_class_t *class_gen);
-static void eq_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void eq_dispose(post_plugin_t *this_gen);
@@ -232,15 +229,15 @@ static int eq_draw(vo_frame_t *frame, xine_stream_t *stream);
void *eq_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = eq_open_plugin;
- class->get_identifier = eq_get_identifier;
- class->get_description = eq_get_description;
- class->dispose = eq_class_dispose;
+ class->identifier = "eq";
+ class->description = N_("soft video equalizer");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -296,22 +293,6 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *eq_get_identifier(post_class_t *class_gen)
-{
- return "eq";
-}
-
-static char *eq_get_description(post_class_t *class_gen)
-{
- return "soft video equalizer";
-}
-
-static void eq_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void eq_dispose(post_plugin_t *this_gen)
{
post_plugin_eq_t *this = (post_plugin_eq_t *)this_gen;
diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c
index 542ea7bad..a3e1acac1 100644
--- a/src/post/planar/eq2.c
+++ b/src/post/planar/eq2.c
@@ -29,9 +29,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#include <math.h>
#include <pthread.h>
@@ -393,9 +393,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *eq2_get_identifier(post_class_t *class_gen);
-static char *eq2_get_description(post_class_t *class_gen);
-static void eq2_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void eq2_dispose(post_plugin_t *this_gen);
@@ -413,15 +410,15 @@ static int eq2_draw(vo_frame_t *frame, xine_stream_t *stream);
void *eq2_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = eq2_open_plugin;
- class->get_identifier = eq2_get_identifier;
- class->get_description = eq2_get_description;
- class->dispose = eq2_class_dispose;
+ class->identifier = "eq2";
+ class->description = N_("Software video equalizer");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -480,22 +477,6 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *eq2_get_identifier(post_class_t *class_gen)
-{
- return "eq2";
-}
-
-static char *eq2_get_description(post_class_t *class_gen)
-{
- return "Software video equalizer";
-}
-
-static void eq2_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void eq2_dispose(post_plugin_t *this_gen)
{
post_plugin_eq2_t *this = (post_plugin_eq2_t *)this_gen;
diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c
index cc189118f..513def84f 100644
--- a/src/post/planar/expand.c
+++ b/src/post/planar/expand.c
@@ -27,8 +27,8 @@
*
*/
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
/* The expand trick explained:
*
@@ -100,9 +100,6 @@ typedef struct post_expand_s {
static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *expand_get_identifier(post_class_t *class_gen);
-static char *expand_get_description(post_class_t *class_gen);
-static void expand_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void expand_dispose(post_plugin_t *this_gen);
@@ -130,15 +127,15 @@ static int32_t expand_overlay_add_event(video_overlay_manager_t *this_gen
void *expand_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = expand_open_plugin;
- class->get_identifier = expand_get_identifier;
- class->get_description = expand_get_description;
- class->dispose = expand_class_dispose;
+ class->identifier = "expand";
+ class->description = N_("add black borders to top and bottom of video to expand it to 4:3 aspect ratio");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -191,22 +188,6 @@ static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *expand_get_identifier(post_class_t *class_gen)
-{
- return "expand";
-}
-
-static char *expand_get_description(post_class_t *class_gen)
-{
- return "add black borders to top and bottom of video to expand it to 4:3 aspect ratio";
-}
-
-static void expand_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void expand_dispose(post_plugin_t *this_gen)
{
post_expand_t *this = (post_expand_t *)this_gen;
diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c
index dd8b83c82..c79033a72 100644
--- a/src/post/planar/fill.c
+++ b/src/post/planar/fill.c
@@ -22,8 +22,8 @@
* based on invert.c
*/
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
/* plugin class initialization function */
void *fill_init_plugin(xine_t *xine, void *);
@@ -32,9 +32,6 @@ void *fill_init_plugin(xine_t *xine, void *);
static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *fill_get_identifier(post_class_t *class_gen);
-static char *fill_get_description(post_class_t *class_gen);
-static void fill_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void fill_dispose(post_plugin_t *this_gen);
@@ -48,15 +45,15 @@ static int fill_draw(vo_frame_t *frame, xine_stream_t *stream);
void *fill_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = fill_open_plugin;
- class->get_identifier = fill_get_identifier;
- class->get_description = fill_get_description;
- class->dispose = fill_class_dispose;
+ class->identifier = "fill";
+ class->description = N_("crops left and right of video to fill 4:3 aspect ratio");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -92,21 +89,6 @@ static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs,
return this;
}
-static char *fill_get_identifier(post_class_t *class_gen)
-{
- return "fill";
-}
-
-static char *fill_get_description(post_class_t *class_gen)
-{
- return "crops left and right of video to fill 4:3 aspect ratio";
-}
-
-static void fill_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
static void fill_dispose(post_plugin_t *this)
{
if (_x_post_dispose(this))
diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c
index 820221cf5..462b8fa7b 100644
--- a/src/post/planar/invert.c
+++ b/src/post/planar/invert.c
@@ -22,8 +22,8 @@
* simple video inverter plugin
*/
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
/* plugin class initialization function */
@@ -33,9 +33,6 @@ void *invert_init_plugin(xine_t *xine, void *);
static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *invert_get_identifier(post_class_t *class_gen);
-static char *invert_get_description(post_class_t *class_gen);
-static void invert_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void invert_dispose(post_plugin_t *this_gen);
@@ -49,15 +46,15 @@ static int invert_draw(vo_frame_t *frame, xine_stream_t *stream);
void *invert_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = invert_open_plugin;
- class->get_identifier = invert_get_identifier;
- class->get_description = invert_get_description;
- class->dispose = invert_class_dispose;
+ class->identifier = "invert";
+ class->description = N_("inverts the colours of every video frame");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -91,22 +88,6 @@ static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs,
return this;
}
-static char *invert_get_identifier(post_class_t *class_gen)
-{
- return "invert";
-}
-
-static char *invert_get_description(post_class_t *class_gen)
-{
- return "inverts the colours of every video frame";
-}
-
-static void invert_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void invert_dispose(post_plugin_t *this)
{
if (_x_post_dispose(this))
diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c
index 41a3a9aeb..471670fb9 100644
--- a/src/post/planar/noise.c
+++ b/src/post/planar/noise.c
@@ -25,12 +25,17 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#include <math.h>
#include <pthread.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
#ifdef ARCH_X86_64
# define REG_a "rax"
@@ -61,7 +66,6 @@ typedef struct noise_param_t {
shiftptr;
int8_t *noise,
*prev_shift[MAX_RES][3];
- void *base;
} noise_param_t;
static int nonTempRandShift[MAX_RES]= {-1};
@@ -78,9 +82,8 @@ static int8_t *initNoise(noise_param_t *fp){
int pattern= fp->pattern;
int8_t *noise;
int i, j;
- void *base;
- noise = xine_xmalloc_aligned(16, MAX_NOISE*sizeof(int8_t), &base);
+ noise = av_mallocz(MAX_NOISE*sizeof(int8_t));
srand(123457);
for(i=0,j=0; i<MAX_NOISE; i++,j++)
@@ -136,7 +139,6 @@ static int8_t *initNoise(noise_param_t *fp){
}
fp->noise= noise;
- fp->base = base;
fp->shiftptr= 0;
return noise;
}
@@ -324,8 +326,8 @@ typedef struct noise_parameters_s {
type, quality, pattern;
} noise_parameters_t;
-static char *enum_types[] = {"uniform", "gaussian", NULL};
-static char *enum_quality[] = {"fixed", "temporal", "averaged temporal", NULL};
+static const char *const enum_types[] = {"uniform", "gaussian", NULL};
+static const char *const enum_quality[] = {"fixed", "temporal", "averaged temporal", NULL};
/*
* description of params struct
@@ -435,9 +437,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *noise_get_identifier(post_class_t *class_gen);
-static char *noise_get_description(post_class_t *class_gen);
-static void noise_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void noise_dispose(post_plugin_t *this_gen);
@@ -451,15 +450,15 @@ static int noise_draw(vo_frame_t *frame, xine_stream_t *stream);
void *noise_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = noise_open_plugin;
- class->get_identifier = noise_get_identifier;
- class->get_description = noise_get_description;
- class->dispose = noise_class_dispose;
+ class->identifier = "noise";
+ class->description = N_("Adds noise");
+ class->dispose = default_post_class_dispose;
#ifdef ARCH_X86
if (xine_mm_accel() & MM_ACCEL_X86_MMX) {
@@ -521,28 +520,14 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *noise_get_identifier(post_class_t *class_gen)
-{
- return "noise";
-}
-
-static char *noise_get_description(post_class_t *class_gen)
-{
- return "Adds noise";
-}
-
-static void noise_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void noise_dispose(post_plugin_t *this_gen)
{
post_plugin_noise_t *this = (post_plugin_noise_t *)this_gen;
if (_x_post_dispose(this_gen)) {
pthread_mutex_destroy(&this->lock);
+ av_free(this->params[0].noise);
+ av_free(this->params[1].noise);
free(this);
}
}
diff --git a/src/post/planar/planar.c b/src/post/planar/planar.c
index 112ebdf0d..e2bd65846 100644
--- a/src/post/planar/planar.c
+++ b/src/post/planar/planar.c
@@ -24,9 +24,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
extern void *invert_init_plugin(xine_t *xine, void *);
static const post_info_t invert_special_info = { XINE_POST_TYPE_VIDEO_FILTER };
@@ -60,15 +60,15 @@ static const post_info_t noise_special_info = { XINE_POST_TYPE_VIDEO_FILTER };
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST, 9, "expand", XINE_VERSION_CODE, &expand_special_info, &expand_init_plugin },
- { PLUGIN_POST, 9, "fill", XINE_VERSION_CODE, &fill_special_info, &fill_init_plugin },
- { PLUGIN_POST, 9, "invert", XINE_VERSION_CODE, &invert_special_info, &invert_init_plugin },
- { PLUGIN_POST, 9, "eq", XINE_VERSION_CODE, &eq_special_info, &eq_init_plugin },
- { PLUGIN_POST, 9, "denoise3d", XINE_VERSION_CODE, &denoise3d_special_info, &denoise3d_init_plugin },
- { PLUGIN_POST, 9, "boxblur", XINE_VERSION_CODE, &boxblur_special_info, &boxblur_init_plugin },
- { PLUGIN_POST, 9, "eq2", XINE_VERSION_CODE, &eq2_special_info, &eq2_init_plugin },
- { PLUGIN_POST, 9, "unsharp", XINE_VERSION_CODE, &unsharp_special_info, &unsharp_init_plugin },
- { PLUGIN_POST, 9, "pp", XINE_VERSION_CODE, &pp_special_info, &pp_init_plugin },
- { PLUGIN_POST, 9, "noise", XINE_VERSION_CODE, &noise_special_info, &noise_init_plugin },
+ { PLUGIN_POST, 10, "expand", XINE_VERSION_CODE, &expand_special_info, &expand_init_plugin },
+ { PLUGIN_POST, 10, "fill", XINE_VERSION_CODE, &fill_special_info, &fill_init_plugin },
+ { PLUGIN_POST, 10, "invert", XINE_VERSION_CODE, &invert_special_info, &invert_init_plugin },
+ { PLUGIN_POST, 10, "eq", XINE_VERSION_CODE, &eq_special_info, &eq_init_plugin },
+ { PLUGIN_POST, 10, "denoise3d", XINE_VERSION_CODE, &denoise3d_special_info, &denoise3d_init_plugin },
+ { PLUGIN_POST, 10, "boxblur", XINE_VERSION_CODE, &boxblur_special_info, &boxblur_init_plugin },
+ { PLUGIN_POST, 10, "eq2", XINE_VERSION_CODE, &eq2_special_info, &eq2_init_plugin },
+ { PLUGIN_POST, 10, "unsharp", XINE_VERSION_CODE, &unsharp_special_info, &unsharp_init_plugin },
+ { PLUGIN_POST, 10, "pp", XINE_VERSION_CODE, &pp_special_info, &pp_init_plugin },
+ { PLUGIN_POST, 10, "noise", XINE_VERSION_CODE, &noise_special_info, &noise_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c
index 3753c2ce2..ab1fc3a9f 100644
--- a/src/post/planar/pp.c
+++ b/src/post/planar/pp.c
@@ -24,16 +24,17 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
-#include <pthread.h>
+#include <config.h>
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#ifdef HAVE_FFMPEG_AVUTIL_H
# include <postprocess.h>
#else
# include <libpostproc/postprocess.h>
#endif
+#include <pthread.h>
#if LIBPOSTPROC_VERSION_MAJOR < 52
# define pp_context pp_context_t
@@ -119,20 +120,19 @@ static xine_post_api_descr_t * get_param_descr (void) {
}
static char * get_help (void) {
- char *help1 =
- _("FFmpeg libpostprocess plugin.\n"
- "\n"
- "Parameters\n"
- "\n");
-
- char *help2 =
- _("\n"
- "* libpostprocess (C) Michael Niedermayer\n"
- );
static char *help = NULL;
- if( !help )
- help = _x_asprintf("%s%s%s", help1, help2, pp_help);
+ if( !help ) {
+ help = _x_asprintf("%s%s%s",
+ _("FFmpeg libpostprocess plugin.\n"
+ "\n"
+ "Parameters\n"
+ "\n"),
+ pp_help,
+ _("\n"
+ "* libpostprocess (C) Michael Niedermayer\n")
+ );
+ }
return help;
}
@@ -149,9 +149,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *pp_get_identifier(post_class_t *class_gen);
-static char *pp_get_description(post_class_t *class_gen);
-static void pp_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void pp_dispose(post_plugin_t *this_gen);
@@ -165,15 +162,15 @@ static int pp_draw(vo_frame_t *frame, xine_stream_t *stream);
void *pp_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = pp_open_plugin;
- class->get_identifier = pp_get_identifier;
- class->get_description = pp_get_description;
- class->dispose = pp_class_dispose;
+ class->identifier = "pp";
+ class->description = N_("plugin for ffmpeg libpostprocess");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -235,22 +232,6 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *pp_get_identifier(post_class_t *class_gen)
-{
- return "pp";
-}
-
-static char *pp_get_description(post_class_t *class_gen)
-{
- return "plugin for ffmpeg libpostprocess";
-}
-
-static void pp_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
-
static void pp_dispose(post_plugin_t *this_gen)
{
post_plugin_pp_t *this = (post_plugin_pp_t *)this_gen;
diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c
index dbf723577..ffa6a39df 100644
--- a/src/post/planar/unsharp.c
+++ b/src/post/planar/unsharp.c
@@ -25,9 +25,9 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include <xine/xineutils.h>
#include <pthread.h>
/*===========================================================================*/
@@ -250,9 +250,6 @@ static xine_post_api_t post_api = {
static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
xine_audio_port_t **audio_target,
xine_video_port_t **video_target);
-static char *unsharp_get_identifier(post_class_t *class_gen);
-static char *unsharp_get_description(post_class_t *class_gen);
-static void unsharp_class_dispose(post_class_t *class_gen);
/* plugin instance functions */
static void unsharp_dispose(post_plugin_t *this_gen);
@@ -266,15 +263,15 @@ static int unsharp_draw(vo_frame_t *frame, xine_stream_t *stream);
void *unsharp_init_plugin(xine_t *xine, void *data)
{
- post_class_t *class = (post_class_t *)malloc(sizeof(post_class_t));
+ post_class_t *class = (post_class_t *)xine_xmalloc(sizeof(post_class_t));
if (!class)
return NULL;
class->open_plugin = unsharp_open_plugin;
- class->get_identifier = unsharp_get_identifier;
- class->get_description = unsharp_get_description;
- class->dispose = unsharp_class_dispose;
+ class->identifier = "unsharp";
+ class->description = N_("unsharp mask & gaussian blur");
+ class->dispose = default_post_class_dispose;
return class;
}
@@ -329,21 +326,6 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *unsharp_get_identifier(post_class_t *class_gen)
-{
- return "unsharp";
-}
-
-static char *unsharp_get_description(post_class_t *class_gen)
-{
- return "unsharp mask & gaussian blur";
-}
-
-static void unsharp_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
static void unsharp_free_SC(post_plugin_unsharp_t *this)
{
int i;
diff --git a/src/post/visualizations/Makefile.am b/src/post/visualizations/Makefile.am
index f3a759fae..0bf5c21d0 100644
--- a/src/post/visualizations/Makefile.am
+++ b/src/post/visualizations/Makefile.am
@@ -1,14 +1,16 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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 = $(xineplug_ldflags)
-
-noinst_HEADERS = fft.h visualizations.h
diff --git a/src/post/visualizations/fft.c b/src/post/visualizations/fft.c
index 7e32dbbf6..8e9364400 100644
--- a/src/post/visualizations/fft.c
+++ b/src/post/visualizations/fft.c
@@ -184,18 +184,6 @@ double fft_amp (int n, complex_t wave[], int bits)
}
/*
- * Calculate phase of component n in the decimated wave[] array.
- */
-double fft_phase (int n, complex_t wave[], int bits)
-{
- n = PERMUTE (n, bits);
- if (REAL(n) != 0.0)
- return (atan (IMAG(n) / REAL(n)));
- else
- return (0.0);
-}
-
-/*
* Scale sampled values.
* Do this *before* the fft.
*/
diff --git a/src/post/visualizations/fft.h b/src/post/visualizations/fft.h
index 651c7f15d..358cec33c 100644
--- a/src/post/visualizations/fft.h
+++ b/src/post/visualizations/fft.h
@@ -44,7 +44,6 @@ void fft_compute (fft_t *fft, complex_t wave[]);
void fft_window (fft_t *fft, complex_t wave[]);
double fft_amp (int n, complex_t wave[], int bits);
-double fft_phase (int n, complex_t wave[], int bits);
void fft_scale (complex_t wave[], int bits);
#endif /* FFT_H */
diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c
index c3f8ff9f9..2d13c4084 100644
--- a/src/post/visualizations/fftgraph.c
+++ b/src/post/visualizations/fftgraph.c
@@ -30,9 +30,9 @@
#include <assert.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "bswap.h"
#include "visualizations.h"
#include "fft.h"
@@ -456,33 +456,18 @@ static post_plugin_t *fftgraph_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *fftgraph_get_identifier(post_class_t *class_gen)
-{
- return "fftgraph";
-}
-
-static char *fftgraph_get_description(post_class_t *class_gen)
-{
- return "fftgraph Visualization Post Plugin";
-}
-
-static void fftgraph_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *fftgraph_init_plugin(xine_t *xine, void *data)
{
- post_class_fftgraph_t *class = (post_class_fftgraph_t *)malloc(sizeof(post_class_fftgraph_t));
+ post_class_fftgraph_t *class = (post_class_fftgraph_t *)xine_xmalloc(sizeof(post_class_fftgraph_t));
if (!class)
return NULL;
class->post_class.open_plugin = fftgraph_open_plugin;
- class->post_class.get_identifier = fftgraph_get_identifier;
- class->post_class.get_description = fftgraph_get_description;
- class->post_class.dispose = fftgraph_class_dispose;
+ class->post_class.identifier = "fftgraph";
+ class->post_class.description = N_("fftgraph Visualization Post Plugin");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c
index 286c4ac38..3ec72fba8 100644
--- a/src/post/visualizations/fftscope.c
+++ b/src/post/visualizations/fftscope.c
@@ -30,9 +30,9 @@
#include <stdio.h>
#include <math.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "bswap.h"
#include "visualizations.h"
#include "fft.h"
@@ -477,33 +477,18 @@ static post_plugin_t *fftscope_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *fftscope_get_identifier(post_class_t *class_gen)
-{
- return "FFT Scope";
-}
-
-static char *fftscope_get_description(post_class_t *class_gen)
-{
- return "FFT Scope";
-}
-
-static void fftscope_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *fftscope_init_plugin(xine_t *xine, void *data)
{
- post_class_fftscope_t *class = (post_class_fftscope_t *)malloc(sizeof(post_class_fftscope_t));
+ post_class_fftscope_t *class = (post_class_fftscope_t *)xine_xmalloc(sizeof(post_class_fftscope_t));
if (!class)
return NULL;
class->post_class.open_plugin = fftscope_open_plugin;
- class->post_class.get_identifier = fftscope_get_identifier;
- class->post_class.get_description = fftscope_get_description;
- class->post_class.dispose = fftscope_class_dispose;
+ class->post_class.identifier = "FFT Scope";
+ class->post_class.description = N_("FFT Scope");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c
index ac85da304..9c8a9c1fa 100644
--- a/src/post/visualizations/fooviz.c
+++ b/src/post/visualizations/fooviz.c
@@ -30,9 +30,9 @@
#include <stdio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#define FPS 20
@@ -288,33 +288,18 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *fooviz_get_identifier(post_class_t *class_gen)
-{
- return "fooviz";
-}
-
-static char *fooviz_get_description(post_class_t *class_gen)
-{
- return "fooviz";
-}
-
-static void fooviz_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
static void *fooviz_init_plugin(xine_t *xine, void *data)
{
- post_class_fooviz_t *class = (post_class_fooviz_t *)malloc(sizeof(post_class_fooviz_t));
+ post_class_fooviz_t *class = (post_class_fooviz_t *)xine_xmalloc(sizeof(post_class_fooviz_t));
if (!class)
return NULL;
class->post_class.open_plugin = fooviz_open_plugin;
- class->post_class.get_identifier = fooviz_get_identifier;
- class->post_class.get_description = fooviz_get_description;
- class->post_class.dispose = fooviz_class_dispose;
+ class->post_class.identifier = "fooviz";
+ class->post_class.description = N_("fooviz");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
@@ -326,6 +311,6 @@ static const post_info_t fooviz_special_info = { XINE_POST_TYPE_AUDIO_VISUALIZAT
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST, 9, "fooviz", XINE_VERSION_CODE, &fooviz_special_info, &fooviz_init_plugin },
+ { PLUGIN_POST, 10, "fooviz", XINE_VERSION_CODE, &fooviz_special_info, &fooviz_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c
index 28d1b4cbc..ffd6f0842 100644
--- a/src/post/visualizations/oscope.c
+++ b/src/post/visualizations/oscope.c
@@ -27,9 +27,9 @@
#include <stdio.h>
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/post.h>
#include "visualizations.h"
#define FPS 20
@@ -359,33 +359,18 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs,
return &this->post;
}
-static char *oscope_get_identifier(post_class_t *class_gen)
-{
- return "Oscilloscope";
-}
-
-static char *oscope_get_description(post_class_t *class_gen)
-{
- return "Oscilloscope";
-}
-
-static void oscope_class_dispose(post_class_t *class_gen)
-{
- free(class_gen);
-}
-
/* plugin class initialization function */
void *oscope_init_plugin(xine_t *xine, void *data)
{
- post_class_oscope_t *class = (post_class_oscope_t *)malloc(sizeof(post_class_oscope_t));
+ post_class_oscope_t *class = (post_class_oscope_t *)xine_xmalloc(sizeof(post_class_oscope_t));
if (!class)
return NULL;
class->post_class.open_plugin = oscope_open_plugin;
- class->post_class.get_identifier = oscope_get_identifier;
- class->post_class.get_description = oscope_get_description;
- class->post_class.dispose = oscope_class_dispose;
+ class->post_class.identifier = "Oscilloscope";
+ class->post_class.description = N_("Oscilloscope");
+ class->post_class.dispose = default_post_class_dispose;
class->xine = xine;
diff --git a/src/post/visualizations/visualizations.c b/src/post/visualizations/visualizations.c
index a26f0bd5b..17c8491d5 100644
--- a/src/post/visualizations/visualizations.c
+++ b/src/post/visualizations/visualizations.c
@@ -24,8 +24,8 @@
#include "config.h"
#endif
-#include "xine_internal.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/post.h>
#include "visualizations.h"
@@ -46,8 +46,8 @@ static const post_info_t fftgraph_special_info = { XINE_POST_TYPE_AUDIO_VISUALIZ
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_POST, 9, "oscope", XINE_VERSION_CODE, &oscope_special_info, &oscope_init_plugin },
- { PLUGIN_POST, 9, "fftscope", XINE_VERSION_CODE, &fftscope_special_info, &fftscope_init_plugin },
- { PLUGIN_POST, 9, "fftgraph", XINE_VERSION_CODE, &fftgraph_special_info, &fftgraph_init_plugin },
+ { PLUGIN_POST, 10, "oscope", XINE_VERSION_CODE, &oscope_special_info, &oscope_init_plugin },
+ { PLUGIN_POST, 10, "fftscope", XINE_VERSION_CODE, &fftscope_special_info, &fftscope_init_plugin },
+ { PLUGIN_POST, 10, "fftgraph", XINE_VERSION_CODE, &fftgraph_special_info, &fftgraph_init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/post/visualizations/visualizations.h b/src/post/visualizations/visualizations.h
index 39d02e1cb..c72a1ad77 100644
--- a/src/post/visualizations/visualizations.h
+++ b/src/post/visualizations/visualizations.h
@@ -20,7 +20,7 @@
* This file contains plugin entries for several visualization post plugins.
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
void *oscope_init_plugin(xine_t *xine, void *data);
void *fftscope_init_plugin(xine_t *xine, void *data);
diff --git a/src/spu_dec/Makefile.am b/src/spu_dec/Makefile.am
new file mode 100644
index 000000000..85aedf9e9
--- /dev/null
+++ b/src/spu_dec/Makefile.am
@@ -0,0 +1,42 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+xineplug_LTLIBRARIES = \
+ xineplug_decode_spucc.la \
+ xineplug_decode_spucmml.la \
+ xineplug_decode_spu.la \
+ xineplug_decode_spudvb.la \
+ xineplug_decode_spuhdmv.la \
+ xineplug_sputext.la
+
+xineplug_decode_spucc_la_SOURCES = cc_decoder.c cc_decoder.h xine_cc_decoder.c
+xineplug_decode_spucc_la_LIBADD = $(XINE_LIB)
+xineplug_decode_spucc_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+
+xineplug_decode_spucmml_la_SOURCES = cmml_decoder.c
+xineplug_decode_spucmml_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+
+if WITH_EXTERNAL_DVDNAV
+external_dvdnav_libs = $(DVDNAV_LIBS)
+internal_dvdnav_sources =
+else
+external_dvdnav_libs =
+internal_dvdnav_sources = nav_read.c
+endif
+
+xineplug_decode_spu_la_SOURCES = $(internal_dvdnav_sources) spudec.c spudec.h spu_decoder.c
+xineplug_decode_spu_la_LIBADD = $(XINE_LIB) $(external_dvdnav_libs) $(PTHREAD_LIBS) $(LTLIBINTL)
+xineplug_decode_spu_la_CFLAGS = $(AM_CFLAGS) $(DVDNAV_CFLAGS) -I$(top_srcdir)/src/input/libdvdnav
+
+xineplug_decode_spudvb_la_SOURCES = spudvb_decoder.c
+xineplug_decode_spudvb_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
+
+xineplug_decode_spuhdmv_la_SOURCES = spuhdmv_decoder.c
+xineplug_decode_spuhdmv_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS) $(LTLIBINTL)
+
+xineplug_sputext_la_SOURCES = sputext_demuxer.c sputext_decoder.c
+xineplug_sputext_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
diff --git a/src/spu_dec/cc_decoder.c b/src/spu_dec/cc_decoder.c
new file mode 100644
index 000000000..d60d2cf03
--- /dev/null
+++ b/src/spu_dec/cc_decoder.c
@@ -0,0 +1,1517 @@
+/*
+ * Copyright (C) 2000-2003 the xine project
+ *
+ * Copyright (C) Christian Vogler
+ * cvogler@gradient.cis.upenn.edu - December 2001
+ *
+ * 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, USA
+ *
+ * stuff needed to provide closed captioning decoding and display
+ *
+ * Some small bits and pieces of the EIA-608 captioning decoder were
+ * adapted from CCDecoder 0.9.1 by Mike Baker. The latest version is
+ * available at http://sourceforge.net/projects/ccdecoder/.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <sys/time.h>
+
+#include <inttypes.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/xineutils.h>
+#include <xine/osd.h>
+#include "cc_decoder.h"
+#include <xine/osd.h>
+
+/*
+#define LOG_DEBUG 3
+*/
+
+/* at 29.97 fps, each NTSC frame takes 3003 metronom ticks on the average. */
+#define NTSC_FRAME_DURATION 3003
+
+#define CC_ROWS 15
+#define CC_COLUMNS 32
+#define CC_CHANNELS 2
+
+/* 1 is the caption background color index in the OSD palettes. */
+#define CAP_BG_COL 1
+
+/* number of text colors specified by EIA-608 standard */
+#define NUM_FG_COL 7
+
+#ifndef WIN32
+/* colors specified by the EIA 608 standard */
+enum { WHITE, GREEN, BLUE, CYAN, RED, YELLOW, MAGENTA, BLACK, TRANSPARENT };
+#else
+/* colors specified by the EIA 608 standard */
+enum { WHITE, GREEN, BLUE, CYAN, RED, YELLOW, MAGENTA, BLACK };
+#endif
+
+
+
+/* color mapping to OSD text color indices */
+static const int text_colormap[NUM_FG_COL] = {
+ OSD_TEXT1, OSD_TEXT2, OSD_TEXT3, OSD_TEXT4, OSD_TEXT5, OSD_TEXT6, OSD_TEXT7
+};
+
+
+/* -------------------- caption text colors -----------------------------*/
+/* FIXME: The colors look fine on an XShm display, but they look *terrible*
+ with the Xv display on the NVidia driver on a GeForce 3. The colors bleed
+ into each other more than I'd expect from the downsampling into YUV
+ colorspace.
+ At this moment, it looks like a problem in the Xv YUV blending functions.
+*/
+typedef struct colorinfo_s {
+ clut_t bgcol; /* text background color */
+ clut_t bordercol; /* text border color */
+ clut_t textcol; /* text color */
+} colorinfo_t;
+
+
+static const colorinfo_t cc_text_trans[NUM_FG_COL] = {
+ /* white, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80)
+ },
+
+ /* green, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x90, 0x22, 0x35)
+ },
+
+ /* blue, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x29, 0x6e, 0xff)
+ },
+
+ /* cyan, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xaa, 0x10, 0xa6)
+ },
+
+ /* red, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x52, 0xf0, 0x5a)
+ },
+
+ /* yellow, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xd4, 0x92, 0x10)
+ },
+
+ /* magenta, black border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x6b, 0xde, 0xca)
+ }
+};
+
+static const colorinfo_t cc_text_solid[NUM_FG_COL] = {
+ /* white, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80)
+ },
+
+ /* green, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x90, 0x22, 0x35)
+ },
+
+ /* blue, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x29, 0x6e, 0xff)
+ },
+
+ /* cyan, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xaa, 0x10, 0xa6)
+ },
+
+ /* red, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x52, 0xf0, 0x5a)
+ },
+
+ /* yellow, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xd4, 0x92, 0x10)
+ },
+
+ /* magenta, black border, solid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x6b, 0xde, 0xca)
+ }
+};
+
+
+static const uint8_t cc_text_trans_alpha[TEXT_PALETTE_SIZE] = {
+ 0, 8, 9, 10, 11, 12, 15, 15, 15, 15, 15
+};
+
+static const uint8_t cc_text_solid_alpha[TEXT_PALETTE_SIZE] = {
+ 0, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
+};
+
+
+static const colorinfo_t *const cc_text_palettes[NUM_CC_PALETTES] = {
+ cc_text_trans,
+ cc_text_solid
+};
+
+static const uint8_t *const cc_alpha_palettes[NUM_CC_PALETTES] = {
+ cc_text_trans_alpha,
+ cc_text_solid_alpha
+};
+
+/* --------------------- misc. EIA 608 definitions -------------------*/
+
+#define TRANSP_SPACE 0x19 /* code for transparent space, essentially
+ arbitrary */
+
+/* mapping from PAC row code to actual CC row */
+static const int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6,
+ 7, 8, 9};
+/* FIXME: do real â„¢ (U+2122) */
+/* Code 182 must be mapped as a musical note ('♪', U+266A) in the caption font */
+static const char specialchar[] = {
+ 174 /* ® */, 176 /* ° */, 189 /* ½ */, 191 /* ¿ */,
+ 'T' /* ™ */, 162 /* ¢ */, 163 /* £ */, 182 /* ¶ => ♪ */,
+ 224 /* à */, TRANSP_SPACE,232 /* è */, 226 /* â */,
+ 234 /* ê */, 238 /* î */, 244 /* ô */, 251 /* û */
+};
+
+/**
+ * @brief Character translation table
+ *
+ * EIA 608 codes are not all the same as ASCII
+ *
+ * The code to produce the characters table would be the following:
+ *
+ * static void build_char_table(void)
+ * {
+ * int i;
+ * // first the normal ASCII codes
+ * for (i = 0; i < 128; i++)
+ * chartbl[i] = (char) i;
+ * // now the special codes
+ * chartbl[0x2a] = 225; // á
+ * chartbl[0x5c] = 233; // é
+ * chartbl[0x5e] = 237; // í
+ * chartbl[0x5f] = 243; // ó
+ * chartbl[0x60] = 250; // ú
+ * chartbl[0x7b] = 231; // ç
+ * chartbl[0x7c] = 247; // ÷
+ * chartbl[0x7d] = 209; // Ñ
+ * chartbl[0x7e] = 241; // ñ
+ * chartbl[0x7f] = 164; // ¤ FIXME: should be a solid block ('█'; U+2588)
+ * }
+ *
+ */
+static const int chartbl[128] = {
+ '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
+ '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
+ '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
+ '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
+ '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27',
+ '\x28', '\x29', '\xe1', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f',
+ '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37',
+ '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f',
+ '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47',
+ '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f',
+ '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57',
+ '\x58', '\x59', '\x5a', '\x5b', '\xe9', '\x5d', '\xed', '\xf3',
+ '\xfa', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67',
+ '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f',
+ '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77',
+ '\x78', '\x79', '\x7a', '\xe7', '\xf7', '\xd1', '\xf1', '\xa4'
+};
+
+/**
+ * @brief Parity table for packets
+ *
+ * CC codes use odd parity for error detection, since they originally were
+ * transmitted via noisy video signals.
+ *
+ * The code to produce the parity table would be the following:
+ *
+ * static int parity(uint8_t byte)
+ * {
+ * int i;
+ * int ones = 0;
+ *
+ * for (i = 0; i < 7; i++) {
+ * if (byte & (1 << i))
+ * ones++;
+ * }
+ *
+ * return ones & 1;
+ * }
+ *
+ * static void build_parity_table(void)
+ * {
+ * uint8_t byte;
+ * int parity_v;
+ * for (byte = 0; byte <= 127; byte++) {
+ * parity_v = parity(byte);
+ * // CC uses odd parity (i.e., # of 1's in byte is odd.)
+ * parity_table[byte] = parity_v;
+ * parity_table[byte | 0x80] = !parity_v;
+ * }
+ * }
+ */
+static const int parity_table[256] = {
+ 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
+};
+
+/*---------------- decoder data structures -----------------------*/
+
+/* CC renderer */
+struct cc_renderer_s {
+ int video_width; /* video dimensions */
+ int video_height;
+
+ int x; /* coordinates of the captioning area */
+ int y;
+ int width;
+ int height;
+ int max_char_height; /* captioning font properties */
+ int max_char_width;
+
+ osd_renderer_t *osd_renderer; /* active OSD renderer */
+ osd_object_t *cap_display; /* caption display object */
+ int displayed; /* true when caption currently is displayed */
+
+ /* the next variable is a hack: hiding a caption with vpts 0 doesn't seem
+ to work if the caption has been registered in the SPU event queue, but
+ not yet displayed. So we remember the vpts of the show event, and use
+ that as the vpts of the hide event upon an osd free.
+ */
+/*FIXME: bug in OSD or SPU?*/
+ int64_t display_vpts; /* vpts of currently displayed caption */
+
+ /* this variable is an even worse hack: in some rare cases, the pts
+ information on the DVD gets out of sync with the caption information.
+ If this happens, the vpts of a hide caption event can actually be
+ slightly higher than the vpts of the following show caption event.
+ For this reason, we remember the vpts of the hide event and force
+ the next show event's vpts to be at least equal to the hide event's
+ vpts.
+ */
+ int64_t last_hide_vpts;
+
+ /* caption palette and alpha channel */
+ uint32_t cc_palette[OVL_PALETTE_SIZE];
+ uint8_t cc_trans[OVL_PALETTE_SIZE];
+
+ metronom_t *metronom; /* the active xine metronom */
+
+ cc_state_t *cc_state; /* captioning configuration */
+};
+
+
+/* CC attribute */
+typedef struct cc_attribute_s {
+ uint8_t italic;
+ uint8_t underline;
+ uint8_t foreground;
+ uint8_t background;
+} cc_attribute_t;
+
+/* CC character cell */
+typedef struct cc_char_cell_s {
+ uint8_t c; /* character code, not the same as ASCII */
+ cc_attribute_t attributes; /* attributes of this character, if changed */
+ /* here */
+ int midrow_attr; /* true if this cell changes an attribute */
+} cc_char_cell_t;
+
+/* a single row in the closed captioning memory */
+typedef struct cc_row_s {
+ cc_char_cell_t cells[CC_COLUMNS];
+ int pos; /* position of the cursor */
+ int num_chars; /* how many characters in the row are data */
+ int attr_chg; /* true if midrow attr. change at cursor pos */
+ int pac_attr_chg; /* true if attribute has changed via PAC */
+ cc_attribute_t pac_attr; /* PAC attr. that hasn't been applied yet */
+} cc_row_t;
+
+/* closed captioning memory for a single channel */
+typedef struct cc_buffer_s {
+ cc_row_t rows[CC_ROWS];
+ int rowpos; /* row cursor position */
+} cc_buffer_t;
+
+/* captioning memory for all channels */
+typedef struct cc_memory_s {
+ cc_buffer_t channel[CC_CHANNELS];
+ int channel_no; /* currently active channel */
+} cc_memory_t;
+
+/* The closed captioning decoder data structure */
+struct cc_decoder_s {
+ /* CC decoder buffer - one onscreen, one offscreen */
+ cc_memory_t buffer[2];
+ /* onscreen, offscreen buffer ptrs */
+ cc_memory_t *on_buf;
+ cc_memory_t *off_buf;
+ /* which buffer is active for receiving data */
+ cc_memory_t **active;
+
+ /* for logging and debugging purposes, captions are assigned increasing */
+ /* unique ids. */
+ uint32_t capid;
+
+ /* the last captioning code seen (control codes are often sent twice
+ in a row, but should be processed only once) */
+ uint32_t lastcode;
+
+ /* The PTS and SCR at which the captioning chunk started */
+ int64_t pts;
+ /* holds the NTSC frame offset to last known pts/scr */
+ uint32_t f_offset;
+
+ /* active OSD renderer */
+ osd_renderer_t *renderer;
+ /* true when caption currently is displayed */
+ int displayed;
+
+ /* configuration and intrinsics of CC decoder */
+ cc_state_t *cc_state;
+
+ metronom_t *metronom;
+};
+
+
+/*---------------- general utility functions ---------------------*/
+
+static void get_font_metrics(osd_renderer_t *renderer,
+ const char *fontname, int font_size,
+ int *maxw, int *maxh)
+{
+ int c;
+ osd_object_t *testc = renderer->new_object(renderer, 640, 480);
+
+ *maxw = 0;
+ *maxh = 0;
+
+ renderer->set_font(testc, (char *) fontname, font_size);
+ renderer->set_encoding(testc, "iso-8859-1");
+ for (c = 32; c < 256; c++) {
+ int tw, th;
+ const char buf[2] = { c, '\0' };
+
+ renderer->get_text_size(testc, buf, &tw, &th);
+ *maxw = MAX(*maxw, tw);
+ *maxh = MAX(*maxh, th);
+ }
+ renderer->free_object(testc);
+}
+
+
+static int good_parity(uint16_t data)
+{
+ int ret = parity_table[data & 0xff] && parity_table[(data & 0xff00) >> 8];
+ if (! ret)
+ printf("Bad parity in EIA-608 data (%x)\n", data);
+ return ret;
+}
+
+
+
+
+static clut_t interpolate_color(clut_t src, clut_t dest, int steps,
+ int current_step)
+{
+ int diff_y = ((int) dest.y) - ((int) src.y);
+ int diff_cr = ((int) dest.cr) - ((int) src.cr);
+ int diff_cb = ((int) dest.cb) - ((int) src.cb);
+ int res_y = ((int) src.y) + (diff_y * current_step / (steps + 1));
+ int res_cr = ((int) src.cr) + (diff_cr * current_step / (steps + 1));
+ int res_cb = ((int) src.cb) + (diff_cb * current_step / (steps + 1));
+#if __SUNPRO_C
+ /*
+ * Sun's Forte compiler refuses to initialize automatic structure
+ * variable with bitfields, so we use explicit assignments for now.
+ */
+ clut_t res;
+ res.y = res_y;
+ res.cr = res_cr;
+ res.cb = res_cb;
+ res.foo = 0;
+#else
+ clut_t res = CLUT_Y_CR_CB_INIT((uint8_t) res_y, (uint8_t) res_cr,
+ (uint8_t) res_cb);
+#endif
+ return res;
+}
+
+/*----------------- cc_row_t methods --------------------------------*/
+
+static void ccrow_fill_transp(cc_row_t *rowbuf){
+ int i;
+
+#ifdef LOG_DEBUG
+ printf("cc_decoder: ccrow_fill_transp: Filling in %d transparent spaces.\n",
+ rowbuf->pos - rowbuf->num_chars);
+#endif
+ for (i = rowbuf->num_chars; i < rowbuf->pos; i++) {
+ rowbuf->cells[i].c = TRANSP_SPACE;
+ rowbuf->cells[i].midrow_attr = 0;
+ }
+}
+
+
+static int ccrow_find_next_text_part(cc_row_t *this, int pos)
+{
+ while (pos < this->num_chars && this->cells[pos].c == TRANSP_SPACE)
+ pos++;
+ return pos;
+}
+
+
+static int ccrow_find_end_of_text_part(cc_row_t *this, int pos)
+{
+ while (pos < this->num_chars && this->cells[pos].c != TRANSP_SPACE)
+ pos++;
+ return pos;
+}
+
+
+static int ccrow_find_current_attr(cc_row_t *this, int pos)
+{
+ while (pos > 0 && !this->cells[pos].midrow_attr)
+ pos--;
+ return pos;
+}
+
+
+static int ccrow_find_next_attr_change(cc_row_t *this, int pos, int lastpos)
+{
+ pos++;
+ while (pos < lastpos && !this->cells[pos].midrow_attr)
+ pos++;
+ return pos;
+}
+
+
+static void ccrow_set_attributes(cc_renderer_t *renderer, cc_row_t *this,
+ int pos)
+{
+ const cc_attribute_t *attr = &this->cells[pos].attributes;
+ const char *fontname;
+ cc_config_t *cap_info = renderer->cc_state->cc_cfg;
+
+ if (attr->italic)
+ fontname = cap_info->italic_font;
+ else
+ fontname = cap_info->font;
+ renderer->osd_renderer->set_font(renderer->cap_display, (char *) fontname,
+ cap_info->font_size);
+}
+
+
+static void ccrow_render(cc_renderer_t *renderer, cc_row_t *this, int rownum)
+{
+ char buf[CC_COLUMNS + 1];
+ int base_y;
+ int pos = ccrow_find_next_text_part(this, 0);
+ cc_config_t *cap_info = renderer->cc_state->cc_cfg;
+ osd_renderer_t *osd_renderer = renderer->osd_renderer;
+
+ /* find y coordinate of caption */
+ if (cap_info->center) {
+ /* find y-center of the desired row; the next line computes */
+ /* cap_info->height * (rownum + 0.5) / CC_ROWS */
+ /* in integer arithmetic for this purpose. */
+ base_y = (renderer->height * rownum * 100 + renderer->height * 50) /
+ (CC_ROWS * 100);
+ }
+ else
+ base_y = renderer->height * rownum / CC_ROWS;
+
+ /* break down captions into parts separated by transparent space, and */
+ /* center each part individually along the x axis */
+ while (pos < this->num_chars) {
+ int endpos = ccrow_find_end_of_text_part(this, pos);
+ int seg_begin = pos;
+ int seg_end;
+ int i;
+ int text_w = 0, text_h = 0;
+ int x, y;
+ int seg_w, seg_h;
+ int seg_pos[CC_COLUMNS + 1];
+ int seg_attr[CC_COLUMNS];
+ int cumulative_seg_width[CC_COLUMNS + 1];
+ int num_seg = 0;
+ int seg;
+
+ /* break down each part into segments bounded by attribute changes and */
+ /* find text metrics of the parts */
+ seg_pos[0] = seg_begin;
+ cumulative_seg_width[0] = 0;
+ while (seg_begin < endpos) {
+ int attr_pos = ccrow_find_current_attr(this, seg_begin);
+ seg_end = ccrow_find_next_attr_change(this, seg_begin, endpos);
+
+ /* compute text size of segment */
+ for (i = seg_begin; i < seg_end; i++)
+ buf[i - seg_begin] = this->cells[i].c;
+ buf[seg_end - seg_begin] = '\0';
+ ccrow_set_attributes(renderer, this, attr_pos);
+ osd_renderer->get_text_size(renderer->cap_display, buf,
+ &seg_w, &seg_h);
+
+ /* update cumulative segment statistics */
+ text_w += seg_w;
+ text_h += seg_h;
+ seg_pos[num_seg + 1] = seg_end;
+ seg_attr[num_seg] = attr_pos;
+ cumulative_seg_width[num_seg + 1] = text_w;
+ num_seg++;
+
+ seg_begin = seg_end;
+ }
+
+ /* compute x coordinate of part */
+ if (cap_info->center) {
+ int cell_width = renderer->width / CC_COLUMNS;
+ x = (renderer->width * (pos + endpos) / 2) / CC_COLUMNS;
+ x -= text_w / 2;
+ /* clamp x coordinate to nearest character cell */
+ x = ((x + cell_width / 2) / CC_COLUMNS) * CC_COLUMNS + cell_width;
+ y = base_y - (renderer->max_char_height + 1) / 2;
+ }
+ else {
+ x = renderer->width * pos / CC_COLUMNS;
+ y = base_y;
+ }
+
+#ifdef LOG_DEBUG
+ printf("text_w, text_h = %d, %d\n", text_w, text_h);
+ printf("cc from %d to %d; text plotting from %d, %d (basey = %d)\n", pos, endpos, x, y, base_y);
+#endif
+
+ /* render text part by rendering each attributed text segment */
+ for (seg = 0; seg < num_seg; seg++) {
+ int textcol = text_colormap[this->cells[seg_attr[seg]].attributes.foreground];
+ int box_x1 = x + cumulative_seg_width[seg];
+ int box_x2 = x + cumulative_seg_width[seg + 1];
+
+#ifdef LOG_DEBUG
+ printf("ccrow_render: rendering segment %d from %d to %d / %d to %d\n",
+ seg, seg_pos[seg], seg_pos[seg + 1],
+ x + cumulative_seg_width[seg], x + cumulative_seg_width[seg + 1]);
+#endif
+ /* make caption background a uniform box. Without this line, the */
+ /* background is uneven for superscript characters. */
+ /* Also pad left & right ends of caption to make it more readable */
+/*FIXME: There may be off-by one errors in the rendering - check with Miguel*/
+ if (seg == 0)
+ box_x1 -= renderer->max_char_width;
+ if (seg == num_seg - 1)
+ box_x2 += renderer->max_char_width;
+ osd_renderer->filled_rect(renderer->cap_display, box_x1, y, box_x2,
+ y + renderer->max_char_height,
+ textcol + CAP_BG_COL);
+
+ for (i = seg_pos[seg]; i < seg_pos[seg + 1]; i++)
+ buf[i - seg_pos[seg]] = this->cells[i].c;
+ buf[seg_pos[seg + 1] - seg_pos[seg]] = '\0';
+ ccrow_set_attributes(renderer, this, seg_attr[seg]);
+
+ /* text is already mapped from EIA-608 into iso-8859-1 */
+ osd_renderer->render_text(renderer->cap_display,
+ x + cumulative_seg_width[seg], y, buf,
+ textcol);
+ }
+
+ pos = ccrow_find_next_text_part(this, endpos);
+ }
+}
+
+
+/*----------------- cc_buffer_t methods --------------------------------*/
+
+static int ccbuf_has_displayable(cc_buffer_t *this)
+{
+ int i;
+ for (i = 0; i < CC_ROWS; i++)
+ if (this->rows[i].num_chars > 0)
+ return 1;
+
+ return 0;
+}
+
+
+static void ccbuf_add_char(cc_buffer_t *this, uint8_t c)
+{
+ cc_row_t *rowbuf = &this->rows[this->rowpos];
+ int pos = rowbuf->pos;
+ int left_displayable = (pos > 0) && (pos <= rowbuf->num_chars);
+
+#if LOG_DEBUG > 2
+ printf("cc_decoder: ccbuf_add_char: %c @ %d/%d\n", c, this->rowpos, pos);
+#endif
+
+ if (pos >= CC_COLUMNS) {
+ printf("cc_decoder: ccbuf_add_char: row buffer overflow\n");
+ return;
+ }
+
+ if (pos > rowbuf->num_chars) {
+ /* fill up to indented position with transparent spaces, if necessary */
+ ccrow_fill_transp(rowbuf);
+ }
+
+ /* midrow PAC attributes are applied only if there is no displayable */
+ /* character to the immediate left. This makes the implementation rather */
+ /* complicated, but this is what the EIA-608 standard specifies. :-( */
+ if (rowbuf->pac_attr_chg && !rowbuf->attr_chg && !left_displayable) {
+ rowbuf->attr_chg = 1;
+ rowbuf->cells[pos].attributes = rowbuf->pac_attr;
+#ifdef LOG_DEBUG
+ printf("cc_decoder: ccbuf_add_char: Applying midrow PAC.\n");
+#endif
+ }
+
+ rowbuf->cells[pos].c = c;
+ rowbuf->cells[pos].midrow_attr = rowbuf->attr_chg;
+ rowbuf->pos++;
+
+ if (rowbuf->num_chars < rowbuf->pos)
+ rowbuf->num_chars = rowbuf->pos;
+
+ rowbuf->attr_chg = 0;
+ rowbuf->pac_attr_chg = 0;
+}
+
+
+static void ccbuf_set_cursor(cc_buffer_t *this, int row, int column,
+ int underline, int italics, int color)
+{
+ cc_row_t *rowbuf = &this->rows[row];
+ cc_attribute_t attr;
+
+ attr.italic = italics;
+ attr.underline = underline;
+ attr.foreground = color;
+ attr.background = BLACK;
+
+ rowbuf->pac_attr = attr;
+ rowbuf->pac_attr_chg = 1;
+
+ this->rowpos = row;
+ rowbuf->pos = column;
+ rowbuf->attr_chg = 0;
+}
+
+
+static void ccbuf_apply_attribute(cc_buffer_t *this, cc_attribute_t *attr)
+{
+ cc_row_t *rowbuf = &this->rows[this->rowpos];
+ int pos = rowbuf->pos;
+
+ rowbuf->attr_chg = 1;
+ rowbuf->cells[pos].attributes = *attr;
+ /* A midrow attribute always counts as a space */
+ ccbuf_add_char(this, chartbl[(unsigned int) ' ']);
+}
+
+
+static void ccbuf_tab(cc_buffer_t *this, int tabsize)
+{
+ cc_row_t *rowbuf = &this->rows[this->rowpos];
+ rowbuf->pos += tabsize;
+ if (rowbuf->pos > CC_COLUMNS) {
+#ifdef LOG_DEBUG
+ printf("cc_decoder: ccbuf_tab: row buffer overflow\n");
+#endif
+ rowbuf->pos = CC_COLUMNS;
+ return;
+ }
+ /* tabs have no effect on pending PAC attribute changes */
+}
+
+
+static void ccbuf_render(cc_renderer_t *renderer, cc_buffer_t *this)
+{
+ int row;
+
+#ifdef LOG_DEBUG
+ printf("cc_decoder: ccbuf_render\n");
+#endif
+
+ for (row = 0; row < CC_ROWS; ++row) {
+ if (this->rows[row].num_chars > 0)
+ ccrow_render(renderer, &this->rows[row], row);
+ }
+}
+
+
+/*----------------- cc_memory_t methods --------------------------------*/
+
+static void ccmem_clear(cc_memory_t *this)
+{
+#ifdef LOG_DEBUG
+ printf("cc_decoder.c: ccmem_clear: Clearing CC memory\n");
+#endif
+ memset(this, 0, sizeof (cc_memory_t));
+}
+
+
+static void ccmem_init(cc_memory_t *this)
+{
+ ccmem_clear(this);
+}
+
+
+static void ccmem_exit(cc_memory_t *this)
+{
+/*FIXME: anything to deallocate?*/
+}
+
+
+/*----------------- cc_renderer_t methods -------------------------------*/
+
+static void cc_renderer_build_palette(cc_renderer_t *this)
+{
+ int i, j;
+ const colorinfo_t *cc_text = cc_text_palettes[this->cc_state->cc_cfg->cc_scheme];
+ const uint8_t *cc_alpha = cc_alpha_palettes[this->cc_state->cc_cfg->cc_scheme];
+
+ memset(this->cc_palette, 0, sizeof (this->cc_palette));
+ memset(this->cc_trans, 0, sizeof (this->cc_trans));
+ for (i = 0; i < NUM_FG_COL; i++) {
+ /* background color */
+ this->cc_palette[i * TEXT_PALETTE_SIZE + 1 + OSD_TEXT1] =
+ *(uint32_t *) &cc_text[i].bgcol;
+ /* background -> border */
+ for (j = 2; j <= 5; j++) {
+ clut_t col = interpolate_color(cc_text[i].bgcol,
+ cc_text[i].bordercol, 4, j - 1);
+ this->cc_palette[i * TEXT_PALETTE_SIZE + j + OSD_TEXT1] =
+ *(uint32_t *) &col;
+ }
+ /* border color */
+ this->cc_palette[i * TEXT_PALETTE_SIZE + 6 + OSD_TEXT1] =
+ *(uint32_t *) &cc_text[i].bordercol;
+ /* border -> foreground */
+ for (j = 7; j <= 9; j++) {
+ clut_t col = interpolate_color(cc_text[i].bordercol,
+ cc_text[i].textcol, 3, j - 6);
+ this->cc_palette[i * TEXT_PALETTE_SIZE + j + OSD_TEXT1] =
+ *(uint32_t *) &col;
+ }
+ /* foreground color */
+ this->cc_palette[i * TEXT_PALETTE_SIZE + 10 + OSD_TEXT1] =
+ *(uint32_t *) &cc_text[i].textcol;
+
+ /* alpha values */
+ for (j = 0; j <= 10; j++)
+ this->cc_trans[i * TEXT_PALETTE_SIZE + j + OSD_TEXT1] = cc_alpha[j];
+ }
+}
+
+
+static int64_t cc_renderer_calc_vpts(cc_renderer_t *this, int64_t pts,
+ uint32_t ntsc_frame_offset)
+{
+ metronom_t *metronom = this->metronom;
+ int64_t vpts = metronom->got_spu_packet(metronom, pts);
+ return vpts + ntsc_frame_offset * NTSC_FRAME_DURATION;
+}
+
+
+/* returns true if a caption is on display */
+static int cc_renderer_on_display(cc_renderer_t *this)
+{
+ return this->displayed;
+}
+
+
+static void cc_renderer_hide_caption(cc_renderer_t *this, int64_t vpts)
+{
+ if ( ! this->displayed ) return;
+
+ this->osd_renderer->hide(this->cap_display, vpts);
+ this->displayed = 0;
+ this->last_hide_vpts = vpts;
+}
+
+
+static void cc_renderer_show_caption(cc_renderer_t *this, cc_buffer_t *buf,
+ int64_t vpts)
+{
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: show\n");
+#endif
+
+ if (this->displayed) {
+ cc_renderer_hide_caption(this, vpts);
+ printf("spucc: cc_renderer: show: OOPS - caption was already displayed!\n");
+ }
+
+ this->osd_renderer->clear(this->cap_display);
+ ccbuf_render(this, buf);
+ this->osd_renderer->set_position(this->cap_display,
+ this->x,
+ this->y);
+ vpts = MAX(vpts, this->last_hide_vpts);
+ this->osd_renderer->show(this->cap_display, vpts);
+
+ this->displayed = 1;
+ this->display_vpts = vpts;
+}
+
+
+static void cc_renderer_free_osd_object(cc_renderer_t *this)
+{
+ /* hide and free old displayed caption object if necessary */
+ if ( ! this->cap_display ) return;
+
+ cc_renderer_hide_caption(this, this->display_vpts);
+ this->osd_renderer->free_object(this->cap_display);
+ this->cap_display = NULL;
+}
+
+
+static void cc_renderer_adjust_osd_object(cc_renderer_t *this)
+{
+ cc_renderer_free_osd_object(this);
+
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: adjust_osd_object: creating %dx%d OSD object\n",
+ this->width, this->height);
+#endif
+
+ /* create display object */
+ this->cap_display = this->osd_renderer->new_object(this->osd_renderer,
+ this->width,
+ this->height);
+ this->osd_renderer->set_palette(this->cap_display, this->cc_palette,
+ this->cc_trans);
+ this->osd_renderer->set_encoding(this->cap_display, "iso-8859-1");
+}
+
+
+cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer,
+ metronom_t *metronom, cc_state_t *cc_state,
+ int video_width, int video_height)
+{
+ cc_renderer_t *this = calloc(1, sizeof (cc_renderer_t));
+
+ this->osd_renderer = osd_renderer;
+ this->metronom = metronom;
+ this->cc_state = cc_state;
+ cc_renderer_update_cfg(this, video_width, video_height);
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: open\n");
+#endif
+ return this;
+}
+
+
+void cc_renderer_close(cc_renderer_t *this_obj)
+{
+ cc_renderer_free_osd_object(this_obj);
+ free(this_obj);
+
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: close\n");
+#endif
+}
+
+
+void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width,
+ int video_height)
+{
+ int fontw, fonth;
+ int required_w, required_h;
+
+ this_obj->video_width = video_width;
+ this_obj->video_height = video_height;
+
+ /* fill in text palette */
+ cc_renderer_build_palette(this_obj);
+
+ /* calculate preferred captioning area, as per the EIA-608 standard */
+ this_obj->x = this_obj->video_width * 10 / 100;
+ this_obj->y = this_obj->video_height * 10 / 100;
+ this_obj->width = this_obj->video_width * 80 / 100;
+ this_obj->height = this_obj->video_height * 80 / 100;
+
+ /* find maximum text width and height for normal & italic captioning */
+ /* font */
+ get_font_metrics(this_obj->osd_renderer, this_obj->cc_state->cc_cfg->font,
+ this_obj->cc_state->cc_cfg->font_size, &fontw, &fonth);
+ this_obj->max_char_width = fontw;
+ this_obj->max_char_height = fonth;
+ get_font_metrics(this_obj->osd_renderer, this_obj->cc_state->cc_cfg->italic_font,
+ this_obj->cc_state->cc_cfg->font_size, &fontw, &fonth);
+ this_obj->max_char_width = MAX(fontw, this_obj->max_char_width);
+ this_obj->max_char_height = MAX(fonth, this_obj->max_char_height);
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: update config: max text extents: %d, %d\n",
+ this_obj->max_char_width, this_obj->max_char_height);
+#endif
+
+ /* need to adjust captioning area to accommodate font? */
+ required_w = CC_COLUMNS * (this_obj->max_char_width + 1);
+ required_h = CC_ROWS * (this_obj->max_char_height + 1);
+ if (required_w > this_obj->width) {
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: update config: adjusting cap area width: %d\n",
+ required_w);
+#endif
+ this_obj->width = required_w;
+ this_obj->x = (this_obj->video_width - required_w) / 2;
+ }
+ if (required_h > this_obj->height) {
+#ifdef LOG_DEBUG
+ printf("spucc: cc_renderer: update config: adjusting cap area height: %d\n",
+ required_h);
+#endif
+ this_obj->height = required_h;
+ this_obj->y = (this_obj->video_height - required_h) / 2;
+ }
+
+ if (required_w <= this_obj->video_width &&
+ required_h <= this_obj->video_height) {
+ this_obj->cc_state->can_cc = 1;
+ cc_renderer_adjust_osd_object(this_obj);
+ }
+ else {
+ this_obj->cc_state->can_cc = 0;
+ cc_renderer_free_osd_object(this_obj);
+ printf("spucc: required captioning area %dx%d exceeds screen %dx%d!\n"
+ " Captions disabled. Perhaps you should choose a smaller"
+ " font?\n",
+ required_w, required_h, this_obj->video_width,
+ this_obj->video_height);
+ }
+}
+
+
+/*----------------- cc_decoder_t methods --------------------------------*/
+
+static void cc_set_channel(cc_decoder_t *this, int channel)
+{
+ (*this->active)->channel_no = channel;
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_set_channel: selecting channel %d\n", channel);
+#endif
+}
+
+
+static cc_buffer_t *active_ccbuffer(cc_decoder_t *this)
+{
+ cc_memory_t *mem = *this->active;
+ return &mem->channel[mem->channel_no];
+}
+
+
+static int cc_onscreen_displayable(cc_decoder_t *this)
+{
+ return ccbuf_has_displayable(&this->on_buf->channel[this->on_buf->channel_no]);
+}
+
+
+static void cc_hide_displayed(cc_decoder_t *this)
+{
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_hide_displayed\n");
+#endif
+
+ if (cc_renderer_on_display(this->cc_state->renderer)) {
+ int64_t vpts = cc_renderer_calc_vpts(this->cc_state->renderer, this->pts,
+ this->f_offset);
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_hide_displayed: hiding caption %u at vpts %u\n", this->capid, vpts);
+#endif
+ cc_renderer_hide_caption(this->cc_state->renderer, vpts);
+ }
+}
+
+
+static void cc_show_displayed(cc_decoder_t *this)
+{
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_show_displayed\n");
+#endif
+
+ if (cc_onscreen_displayable(this)) {
+ int64_t vpts = cc_renderer_calc_vpts(this->cc_state->renderer, this->pts,
+ this->f_offset);
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_show_displayed: showing caption %u at vpts %u\n", this->capid, vpts);
+#endif
+ this->capid++;
+ cc_renderer_show_caption(this->cc_state->renderer,
+ &this->on_buf->channel[this->on_buf->channel_no],
+ vpts);
+ }
+}
+
+
+static void cc_swap_buffers(cc_decoder_t *this)
+{
+ cc_memory_t *temp;
+
+ /* hide caption in displayed memory */
+ cc_hide_displayed(this);
+
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_swap_buffers: swapping caption memory\n");
+#endif
+ temp = this->on_buf;
+ this->on_buf = this->off_buf;
+ this->off_buf = temp;
+
+ /* show new displayed memory */
+ cc_show_displayed(this);
+}
+
+static void cc_decode_standard_char(cc_decoder_t *this, uint8_t c1, uint8_t c2)
+{
+ cc_buffer_t *buf = active_ccbuffer(this);
+ /* c1 always is a valid character */
+ ccbuf_add_char(buf, chartbl[c1]);
+ /* c2 might not be a printable character, even if c1 was */
+ if (c2 & 0x60)
+ ccbuf_add_char(buf, chartbl[c2]);
+}
+
+
+static void cc_decode_PAC(cc_decoder_t *this, int channel,
+ uint8_t c1, uint8_t c2)
+{
+ cc_buffer_t *buf;
+ int row, column = 0;
+ int underline, italics = 0, color;
+
+ /* There is one invalid PAC code combination. Ignore it. */
+ if (c1 == 0x10 && c2 > 0x5f)
+ return;
+
+ cc_set_channel(this, channel);
+ buf = active_ccbuffer(this);
+
+ row = rowdata[((c1 & 0x07) << 1) | ((c2 & 0x20) >> 5)];
+ if (c2 & 0x10) {
+ column = ((c2 & 0x0e) >> 1) * 4; /* preamble indentation */
+ color = WHITE; /* indented lines have white color */
+ }
+ else if ((c2 & 0x0e) == 0x0e) {
+ italics = 1; /* italics, they are always white */
+ color = WHITE;
+ }
+ else
+ color = (c2 & 0x0e) >> 1;
+ underline = c2 & 0x01;
+
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_decode_PAC: row %d, col %d, ul %d, it %d, clr %d\n",
+ row, column, underline, italics, color);
+#endif
+
+ ccbuf_set_cursor(buf, row, column, underline, italics, color);
+}
+
+
+static void cc_decode_ext_attribute(cc_decoder_t *this, int channel,
+ uint8_t c1, uint8_t c2)
+{
+ cc_set_channel(this, channel);
+}
+
+
+static void cc_decode_special_char(cc_decoder_t *this, int channel,
+ uint8_t c1, uint8_t c2)
+{
+ cc_buffer_t *buf;
+
+ cc_set_channel(this, channel);
+ buf = active_ccbuffer(this);
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_decode_special_char: Mapping %x to %x\n", c2, specialchar[c2 & 0xf]);
+#endif
+ ccbuf_add_char(buf, specialchar[c2 & 0xf]);
+}
+
+
+static void cc_decode_midrow_attr(cc_decoder_t *this, int channel,
+ uint8_t c1, uint8_t c2)
+{
+ cc_buffer_t *buf;
+ cc_attribute_t attr;
+
+ cc_set_channel(this, channel);
+ buf = active_ccbuffer(this);
+ if (c2 < 0x2e) {
+ attr.italic = 0;
+ attr.foreground = (c2 & 0xe) >> 1;
+ }
+ else {
+ attr.italic = 1;
+ attr.foreground = WHITE;
+ }
+ attr.underline = c2 & 0x1;
+ attr.background = BLACK;
+#ifdef LOG_DEBUG
+ printf("cc_decoder: cc_decode_midrow_attr: attribute %x\n", c2);
+ printf("cc_decoder: cc_decode_midrow_attr: ul %d, it %d, clr %d\n",
+ attr.underline, attr.italic, attr.foreground);
+#endif
+
+ ccbuf_apply_attribute(buf, &attr);
+}
+
+
+static void cc_decode_misc_control_code(cc_decoder_t *this, int channel,
+ uint8_t c1, uint8_t c2)
+{
+#ifdef LOG_DEBUG
+ printf("cc_decoder: decode_misc: decoding %x %x\n", c1, c2);
+#endif
+
+ cc_set_channel(this, channel);
+
+ switch (c2) { /* 0x20 <= c2 <= 0x2f */
+
+ case 0x20: /* RCL */
+ break;
+
+ case 0x21: /* backspace */
+#ifdef LOG_DEBUG
+ printf("cc_decoder: backspace\n");
+#endif
+ break;
+
+ case 0x24: /* DER */
+ break;
+
+ case 0x25: /* RU2 */
+ break;
+
+ case 0x26: /* RU3 */
+ break;
+
+ case 0x27: /* RU4 */
+ break;
+
+ case 0x28: /* FON */
+ break;
+
+ case 0x29: /* RDC */
+ break;
+
+ case 0x2a: /* TR */
+ break;
+
+ case 0x2b: /* RTD */
+ break;
+
+ case 0x2c: /* EDM - erase displayed memory */
+ cc_hide_displayed(this);
+ ccmem_clear(this->on_buf);
+ break;
+
+ case 0x2d: /* carriage return */
+ break;
+
+ case 0x2e: /* ENM - erase non-displayed memory */
+ ccmem_clear(this->off_buf);
+ break;
+
+ case 0x2f: /* EOC - swap displayed and non displayed memory */
+ cc_swap_buffers(this);
+ break;
+ }
+}
+
+
+static void cc_decode_tab(cc_decoder_t *this, int channel,
+ uint8_t c1, uint8_t c2)
+{
+ cc_buffer_t *buf;
+
+ cc_set_channel(this, channel);
+ buf = active_ccbuffer(this);
+ ccbuf_tab(buf, c2 & 0x3);
+}
+
+
+static void cc_decode_EIA608(cc_decoder_t *this, uint16_t data)
+{
+ uint8_t c1 = data & 0x7f;
+ uint8_t c2 = (data >> 8) & 0x7f;
+
+#if LOG_DEBUG >= 3
+ printf("decoding %x %x\n", c1, c2);
+#endif
+
+ if (c1 & 0x60) { /* normal character, 0x20 <= c1 <= 0x7f */
+ cc_decode_standard_char(this, c1, c2);
+ }
+ else if (c1 & 0x10) { /* control code or special character */
+ /* 0x10 <= c1 <= 0x1f */
+ int channel = (c1 & 0x08) >> 3;
+ c1 &= ~0x08;
+
+ /* control sequences are often repeated. In this case, we should */
+ /* evaluate it only once. */
+ if (data != this->lastcode) {
+
+ if (c2 & 0x40) { /* preamble address code: 0x40 <= c2 <= 0x7f */
+ cc_decode_PAC(this, channel, c1, c2);
+ }
+ else {
+ switch (c1) {
+
+ case 0x10: /* extended background attribute code */
+ cc_decode_ext_attribute(this, channel, c1, c2);
+ break;
+
+ case 0x11: /* attribute or special character */
+ if ((c2 & 0x30) == 0x30) { /* special char: 0x30 <= c2 <= 0x3f */
+ cc_decode_special_char(this, channel, c1, c2);
+ }
+ else if (c2 & 0x20) { /* midrow attribute: 0x20 <= c2 <= 0x2f */
+ cc_decode_midrow_attr(this, channel, c1, c2);
+ }
+ break;
+
+ case 0x14: /* possibly miscellaneous control code */
+ cc_decode_misc_control_code(this, channel, c1, c2);
+ break;
+
+ case 0x17: /* possibly misc. control code TAB offset */
+ /* 0x21 <= c2 <= 0x23 */
+ if (c2 >= 0x21 && c2 <= 0x23) {
+ cc_decode_tab(this, channel, c1, c2);
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ this->lastcode = data;
+}
+
+
+void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len,
+ int64_t pts)
+{
+ /* The first number may denote a channel number. I don't have the
+ * EIA-708 standard, so it is hard to say.
+ * From what I could figure out so far, the general format seems to be:
+ *
+ * repeat
+ *
+ * 0xfe starts 2 byte sequence of unknown purpose. It might denote
+ * field #2 in line 21 of the VBI. We'll ignore it for the
+ * time being.
+ *
+ * 0xff starts 2 byte EIA-608 sequence, field #1 in line 21 of the VBI.
+ * Followed by a 3-code triplet that starts either with 0xff or
+ * 0xfe. In either case, the following triplet needs to be ignored
+ * for line 21, field 1.
+ *
+ * 0x00 is padding, followed by 2 more 0x00.
+ *
+ * 0x01 always seems to appear at the beginning, always seems to
+ * be followed by 0xf8, 8-bit number.
+ * The lower 7 bits of this 8-bit number seem to denote the
+ * number of code triplets that follow.
+ * The most significant bit denotes whether the Line 21 field 1
+ * captioning information is at odd or even triplet offsets from this
+ * beginning triplet. 1 denotes odd offsets, 0 denotes even offsets.
+ *
+ * Most captions are encoded with odd offsets, so this is what we
+ * will assume.
+ *
+ * until end of packet
+ */
+ uint8_t *current = buffer;
+ uint32_t curbytes = 0;
+ uint8_t data1, data2;
+ uint8_t cc_code;
+ int odd_offset = 1;
+
+ this->f_offset = 0;
+ this->pts = pts;
+
+#if LOG_DEBUG >= 2
+ printf("libspucc: decode_cc: got pts %u\n", pts);
+ {
+ uint8_t *cur_d = buffer;
+ printf("libspucc: decode_cc: codes: ");
+ while (cur_d < buffer + buf_len) {
+ printf("0x%0x ", *cur_d++);
+ }
+ printf("\n");
+ }
+#endif
+
+ while (curbytes < buf_len) {
+ int skip = 2;
+
+ cc_code = *current++;
+ curbytes++;
+
+ if (buf_len - curbytes < 2) {
+#ifdef LOG_DEBUG
+ fprintf(stderr, "Not enough data for 2-byte CC encoding\n");
+#endif
+ break;
+ }
+
+ data1 = *current;
+ data2 = *(current + 1);
+
+ switch (cc_code) {
+ case 0xfe:
+ /* expect 2 byte encoding (perhaps CC3, CC4?) */
+ /* ignore for time being */
+ skip = 2;
+ break;
+
+ case 0xff:
+ /* expect EIA-608 CC1/CC2 encoding */
+ if (good_parity(data1 | (data2 << 8))) {
+ cc_decode_EIA608(this, data1 | (data2 << 8));
+ this->f_offset++;
+ }
+ skip = 5;
+ break;
+
+ case 0x00:
+ /* This seems to be just padding */
+ skip = 2;
+ break;
+
+ case 0x01:
+ odd_offset = data2 & 0x80;
+ if (odd_offset)
+ skip = 2;
+ else
+ skip = 5;
+ break;
+
+ default:
+#ifdef LOG_DEBUG
+ fprintf(stderr, "Unknown CC encoding: %x\n", cc_code);
+#endif
+ skip = 2;
+ break;
+ }
+ current += skip;
+ curbytes += skip;
+ }
+}
+
+
+
+cc_decoder_t *cc_decoder_open(cc_state_t *cc_state)
+{
+ cc_decoder_t *this = calloc(1, sizeof (cc_decoder_t));
+ /* configfile stuff */
+ this->cc_state = cc_state;
+
+ ccmem_init(&this->buffer[0]);
+ ccmem_init(&this->buffer[1]);
+ this->on_buf = &this->buffer[0];
+ this->off_buf = &this->buffer[1];
+ this->active = &this->off_buf;
+
+ this->lastcode = 0;
+ this->capid = 0;
+
+ this->pts = this->f_offset = 0;
+
+#ifdef LOG_DEBUG
+ printf("spucc: cc_decoder_open\n");
+#endif
+ return this;
+}
+
+
+void cc_decoder_close(cc_decoder_t *this)
+{
+ ccmem_exit(&this->buffer[0]);
+ ccmem_exit(&this->buffer[1]);
+
+ free(this);
+
+#ifdef LOG_DEBUG
+ printf("spucc: cc_decoder_close\n");
+#endif
+}
diff --git a/src/spu_dec/cc_decoder.h b/src/spu_dec/cc_decoder.h
new file mode 100644
index 000000000..58bd5aa9a
--- /dev/null
+++ b/src/spu_dec/cc_decoder.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2000-2008 the xine project
+ *
+ * Copyright (C) Christian Vogler
+ * cvogler@gradient.cis.upenn.edu - December 2001
+ *
+ * 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, USA
+ *
+ * stuff needed to provide closed captioning decoding and display
+ *
+ * Some small bits and pieces of the EIA-608 captioning decoder were
+ * adapted from CCDecoder 0.9.1 by Mike Baker. The latest version is
+ * available at http://sourceforge.net/projects/ccdecoder/.
+ */
+
+typedef struct cc_decoder_s cc_decoder_t;
+typedef struct cc_renderer_s cc_renderer_t;
+
+#define NUM_CC_PALETTES 2
+#define CC_FONT_MAX 256
+
+typedef struct cc_config_s {
+ int cc_enabled; /* true if closed captions are enabled */
+ char font[CC_FONT_MAX]; /* standard captioning font & size */
+ int font_size;
+ char italic_font[CC_FONT_MAX]; /* italic captioning font & size */
+ int center; /* true if captions should be centered */
+ /* according to text width */
+ int cc_scheme; /* which captioning scheme to use */
+
+ int config_version; /* the decoder should be updated when this is increased */
+} cc_config_t;
+
+typedef struct spucc_class_s {
+ spu_decoder_class_t spu_class;
+ cc_config_t cc_cfg;
+} spucc_class_t;
+
+typedef struct cc_state_s {
+ cc_config_t *cc_cfg;
+ /* the following variables are not controlled by configuration files; they */
+ /* are intrinsic to the properties of the configuration options and the */
+ /* currently played video */
+ int can_cc; /* true if captions can be displayed */
+ /* (e.g., font fits on screen) */
+ cc_renderer_t *renderer; /* closed captioning renderer */
+} cc_state_t;
+
+cc_decoder_t *cc_decoder_open(cc_state_t *cc_state);
+void cc_decoder_close(cc_decoder_t *this_obj);
+
+void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len,
+ int64_t pts);
+
+/* Instantiates a new closed captioning renderer. */
+cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer,
+ metronom_t *metronom, cc_state_t *cc_state,
+ int video_width, int video_height);
+
+/* Destroys a closed captioning renderer. */
+void cc_renderer_close(cc_renderer_t *this_obj);
+
+/* Updates the renderer configuration variables */
+void cc_renderer_update_cfg(cc_renderer_t *this_obj, int video_width,
+ int video_height);
+
diff --git a/src/spu_dec/cmml_decoder.c b/src/spu_dec/cmml_decoder.c
new file mode 100644
index 000000000..53d5fa9ea
--- /dev/null
+++ b/src/spu_dec/cmml_decoder.c
@@ -0,0 +1,525 @@
+/*
+ * Copyright (C) 2000-2008 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, USA
+ */
+
+#define LOG_MODULE "libspucmml"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+#define LOG_OSD 0
+#define LOG_SCHEDULING 0
+#define LOG_WIDTH 0
+
+#define SUB_BUFSIZE 1024
+#define SUB_MAX_TEXT 5
+
+#include <xine/xine_internal.h>
+
+typedef enum {
+ SUBTITLE_SIZE_SMALL = 0,
+ SUBTITLE_SIZE_NORMAL,
+ SUBTITLE_SIZE_LARGE,
+
+ SUBTITLE_SIZE_NUM /* number of values in enum */
+} subtitle_size;
+
+
+typedef struct spucmml_class_s {
+ spu_decoder_class_t class;
+ char *src_encoding; /* encoding of subtitle file */
+ xine_t *xine;
+
+} spucmml_class_t;
+
+
+typedef struct cmml_anchor_s {
+ char *text;
+ char *href;
+} cmml_anchor_t;
+
+
+typedef struct spucmml_decoder_s {
+ spu_decoder_t spu_decoder;
+
+ spucmml_class_t *class;
+ xine_stream_t *stream;
+
+ xine_event_queue_t *event_queue;
+
+ int lines;
+ char text[SUB_MAX_TEXT][SUB_BUFSIZE];
+
+ int cached_width; /* frame width */
+ int cached_height; /* frame height */
+ int64_t cached_img_duration;
+ int font_size;
+ int line_height;
+ int master_started;
+ int slave_started;
+
+ char *font; /* subtitle font */
+ subtitle_size subtitle_size; /* size of subtitles */
+ int vertical_offset;
+
+ osd_object_t *osd;
+
+ cmml_anchor_t current_anchor;
+} spucmml_decoder_t;
+
+
+static void video_frame_format_change_callback (void *user_data, const xine_event_t *event);
+
+
+static void update_font_size (spucmml_decoder_t *this) {
+ static const int sizes[SUBTITLE_SIZE_NUM][4] = {
+ { 16, 16, 16, 20 }, /* SUBTITLE_SIZE_SMALL */
+ { 16, 16, 20, 24 }, /* SUBTITLE_SIZE_NORMAL */
+ { 16, 20, 24, 32 }, /* SUBTITLE_SIZE_LARGE */
+ };
+
+ const int *const vec = sizes[this->subtitle_size];
+
+ if( this->cached_width >= 512 )
+ this->font_size = vec[3];
+ else if( this->cached_width >= 384 )
+ this->font_size = vec[2];
+ else if( this->cached_width >= 320 )
+ this->font_size = vec[1];
+ else
+ this->font_size = vec[0];
+
+ this->line_height = this->font_size + 10;
+
+ int y = this->cached_height - (SUB_MAX_TEXT * this->line_height) - 5;
+
+ if(((y - this->vertical_offset) >= 0) && ((y - this->vertical_offset) <= this->cached_height))
+ y -= this->vertical_offset;
+
+ /* TODO: we should move this stuff below into another function */
+
+ if (this->osd)
+ this->stream->osd_renderer->free_object (this->osd);
+
+ llprintf (LOG_OSD,
+ "pre new_object: osd=%p, osd_renderer=%p, width=%d, height=%d\n",
+ this->osd,
+ this->stream->osd_renderer,
+ this->cached_width,
+ SUB_MAX_TEXT * this->line_height);
+
+ this->osd = this->stream->osd_renderer->new_object (this->stream->osd_renderer,
+ this->cached_width, SUB_MAX_TEXT * this->line_height);
+
+ llprintf (LOG_OSD, "post new_object: osd is %p\n", this->osd);
+
+ if(this->stream->osd_renderer) {
+ this->stream->osd_renderer->set_font (this->osd, this->font, this->font_size);
+ this->stream->osd_renderer->set_position (this->osd, 0, y);
+ }
+}
+
+static int get_width(spucmml_decoder_t *this, char* text) {
+ int width=0;
+
+ while (1)
+ switch (*text) {
+ case '\0':
+ llprintf(LOG_WIDTH, "get_width returning width of %d\n", width);
+ return width;
+
+ case '<':
+ if (!strncmp("<b>", text, 3)) {
+ /*Do somethink to enable BOLD typeface*/
+ text += 3;
+ break;
+ } else if (!strncmp("</b>", text, 3)) {
+ /*Do somethink to disable BOLD typeface*/
+ text += 4;
+ break;
+ } else if (!strncmp("<i>", text, 3)) {
+ /*Do somethink to enable italics typeface*/
+ text += 3;
+ break;
+ } else if (!strncmp("</i>", text, 3)) {
+ /*Do somethink to disable italics typeface*/
+ text += 4;
+ break;
+ } else if (!strncmp("<font>", text, 3)) {
+ /*Do somethink to disable typing
+ fixme - no teststreams*/
+ text += 6;
+ break;
+ } else if (!strncmp("</font>", text, 3)) {
+ /*Do somethink to enable typing
+ fixme - no teststreams*/
+ text += 7;
+ break;
+ }
+ default:
+ {
+ int w, dummy;
+ const char letter[2] = { *text, '\0' };
+ this->stream->osd_renderer->get_text_size(this->osd, letter, &w, &dummy);
+ width += w;
+ text++;
+ }
+ }
+}
+
+static void render_line(spucmml_decoder_t *this, int x, int y, char* text) {
+ while (*text != '\0') {
+ int w, dummy;
+ const char letter[2] = { *text, '\0' };
+
+ this->stream->osd_renderer->render_text(this->osd, x, y, letter, OSD_TEXT1);
+ this->stream->osd_renderer->get_text_size(this->osd, letter, &w, &dummy);
+ x += w;
+ text++;
+ }
+}
+
+static void draw_subtitle(spucmml_decoder_t *this, int64_t sub_start) {
+
+ this->stream->osd_renderer->filled_rect (this->osd, 0, 0,
+ this->cached_width-1, this->line_height * SUB_MAX_TEXT - 1, 0);
+
+ const int y = (SUB_MAX_TEXT - this->lines) * this->line_height;
+ int font_size = this->font_size;
+ this->stream->osd_renderer->set_encoding(this->osd, this->class->src_encoding);
+
+ int line;
+
+ for (line=0; line<this->lines; line++) {
+ int x;
+ while(1) {
+ const int w = get_width( this, this->text[line]);
+ x = (this->cached_width - w) / 2;
+
+ if( w > this->cached_width && font_size > 16 ) {
+ font_size -= 4;
+ this->stream->osd_renderer->set_font (this->osd, this->font, font_size);
+ } else {
+ break;
+ }
+ }
+ render_line(this, x, y + line*this->line_height, this->text[line]);
+ }
+
+ if( font_size != this->font_size )
+ this->stream->osd_renderer->set_font (this->osd, this->font, this->font_size);
+
+
+ this->stream->osd_renderer->set_text_palette (this->osd, -1, OSD_TEXT1);
+ this->stream->osd_renderer->show (this->osd, sub_start);
+
+ llprintf (LOG_SCHEDULING,
+ "spucmml: scheduling subtitle >%s< at %"PRId64", current time is %"PRId64"\n",
+ this->text[0], sub_start,
+ this->stream->xine->clock->get_current_time (this->stream->xine->clock));
+}
+
+static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
+
+ spucmml_decoder_t *this = (spucmml_decoder_t *) this_gen;
+
+ xml_parser_t *xml_parser;
+ xml_node_t *packet_xml_root;
+ char * anchor_text = NULL;
+
+ lprintf("CMML packet seen\n");
+
+ char *str = (char *) buf->content;
+
+ /* parse the CMML */
+
+ xml_parser = xml_parser_init_r (str, strlen (str), XML_PARSER_CASE_INSENSITIVE);
+ if (xml_parser_build_tree_r(xml_parser, &packet_xml_root) != XML_PARSER_OK) {
+ lprintf ("warning: invalid XML packet detected in CMML track\n");
+ xml_parser_finalize_r(xml_parser);
+ return;
+ }
+
+ xml_parser_finalize_r(xml_parser);
+
+ if (strcasecmp(packet_xml_root->name, "head") == 0) {
+ /* found a <head>...</head> packet: need to parse the title */
+
+ xml_node_t *title_node;
+
+ /* iterate through children trying to find the title node */
+
+ for (title_node = packet_xml_root->child; title_node != NULL; title_node = title_node->next) {
+
+ if (title_node->data &&
+ strcasecmp (title_node->name, "title") == 0) {
+ /* found a title node */
+
+ xine_ui_data_t data = {
+ .str_len = strlen(title_node->data) + 1
+ };
+ xine_event_t uevent = {
+ .type = XINE_EVENT_UI_SET_TITLE,
+ .stream = this->stream,
+ .data = &data,
+ .data_length = sizeof(data),
+ };
+ strncpy(data.str, title_node->data, sizeof(data.str)-1);
+
+ /* found a non-empty title */
+ lprintf ("found title: \"%s\"\n", data.str);
+
+ /* set xine meta-info */
+ _x_meta_info_set(this->stream, XINE_META_INFO_TITLE, strdup(data.str));
+
+ /* and push out a new event signifying the title update on the event
+ * queue */
+ xine_event_send(this->stream, &uevent);
+ }
+ }
+ } else if (strcasecmp(packet_xml_root->name, "clip") == 0) {
+ /* found a <clip>...</clip> packet: search for the <a href="..."> in it */
+ xml_node_t *clip_node;
+
+ /* iterate through each tag contained in the <clip> tag to look for <a> */
+
+ for (clip_node = packet_xml_root->child; clip_node != NULL; clip_node = clip_node->next) {
+
+ if (strcasecmp (clip_node->name, "a") == 0) {
+ xml_property_t *href_property;
+
+ /* found the <a> tag: grab its value and its href property */
+
+ if (clip_node->data)
+ anchor_text = strdup (clip_node->data);
+
+ for (href_property = clip_node->props; href_property != NULL; href_property = href_property->next) {
+ if (strcasecmp (href_property->name, "href") == 0) {
+ /* found the href property */
+ char *href = href_property->value;
+
+ if (href) {
+ lprintf ("found href: \"%s\"\n", href);
+ this->current_anchor.href = strdup(href);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /* finish here if we don't have to process any anchor text */
+ if (!anchor_text)
+ return;
+
+ /* how many lines does the anchor text take up? */
+ this->lines=0;
+ {
+ int i = 0, index = 0;
+ while (anchor_text[index]) {
+ if (anchor_text[index] == '\r' || anchor_text[index] == '\n') {
+ if (i) {
+ /* match a newline and there are chars on the current line ... */
+ this->text[ this->lines ][i] = '\0';
+ this->lines++;
+ i = 0;
+ }
+ } else {
+ /* found a normal (non-line-ending) character */
+ this->text[ this->lines ][i] = anchor_text[index];
+ if (i<SUB_BUFSIZE-1)
+ i++;
+ }
+ index++;
+ }
+
+ /* always NULL-terminate the string */
+ if (i) {
+ this->text[ this->lines ][i] = '\0';
+ this->lines++;
+ }
+ }
+ free (anchor_text);
+
+ /* initialize decoder if needed */
+ if( !this->cached_width || !this->cached_height || !this->cached_img_duration || !this->osd ) {
+ if( this->stream->video_out->status(this->stream->video_out, NULL,
+ &this->cached_width, &this->cached_height, &this->cached_img_duration )) {
+ if( this->cached_width && this->cached_height && this->cached_img_duration ) {
+ lprintf("this->stream->osd_renderer is %p\n", this->stream->osd_renderer);
+ }
+ }
+ }
+
+ update_font_size (this);
+
+ if( this->osd ) {
+ draw_subtitle(this, buf->pts);
+ return;
+ } else {
+ lprintf ("libspucmml: no osd\n");
+ }
+
+ return;
+}
+
+static void video_frame_format_change_callback (void *user_data, const xine_event_t *event)
+{
+ /* this doesn't do anything for now: it's a start at attempting to display
+ * CMML clips which occur at 0 seconds into the track. see
+ *
+ * http://marc.theaimsgroup.com/?l=xine-devel&m=109202443013890&w=2
+ *
+ * for a description of the problem. */
+
+ switch (event->type) {
+ case XINE_EVENT_FRAME_FORMAT_CHANGE:
+ lprintf("video_frame_format_change_callback called!\n");
+ break;
+ default:
+ lprintf("video_frame_format_change_callback called with unknown event %d\n", event->type);
+ break;
+ }
+}
+
+static void spudec_reset (spu_decoder_t *this_gen) {
+ spucmml_decoder_t *this = (spucmml_decoder_t *) this_gen;
+
+ this->cached_width = this->cached_height = 0;
+}
+
+static void spudec_discontinuity (spu_decoder_t *this_gen) {
+ /* do nothing */
+}
+
+static void spudec_dispose (spu_decoder_t *this_gen) {
+ spucmml_decoder_t *this = (spucmml_decoder_t *) this_gen;
+
+ if (this->event_queue)
+ xine_event_dispose_queue (this->event_queue);
+
+ if (this->osd) {
+ this->stream->osd_renderer->free_object (this->osd);
+ this->osd = NULL;
+ }
+ free(this);
+}
+
+static void update_vertical_offset(void *this_gen, xine_cfg_entry_t *entry)
+{
+ spucmml_decoder_t *this = (spucmml_decoder_t *)this_gen;
+
+ this->vertical_offset = entry->num_value;
+ update_font_size(this);
+}
+
+static void update_osd_font(void *this_gen, xine_cfg_entry_t *entry)
+{
+ spucmml_decoder_t *this = (spucmml_decoder_t *)this_gen;
+
+ this->font = entry->str_value;
+
+ if( this->stream->osd_renderer )
+ this->stream->osd_renderer->set_font (this->osd, this->font, this->font_size);
+}
+
+static spu_decoder_t *spucmml_class_open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream) {
+ spucmml_class_t *class = (spucmml_class_t *)class_gen;
+ spucmml_decoder_t *this = (spucmml_decoder_t *) calloc(1, sizeof(spucmml_decoder_t));
+
+ this->spu_decoder.decode_data = spudec_decode_data;
+ this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
+ this->spu_decoder.dispose = spudec_dispose;
+ this->spu_decoder.get_interact_info = NULL;
+ this->spu_decoder.set_button = NULL;
+ this->spu_decoder.dispose = spudec_dispose;
+
+ this->class = class;
+ this->stream = stream;
+
+ this->event_queue = xine_event_new_queue (this->stream);
+ xine_event_create_listener_thread (this->event_queue,
+ video_frame_format_change_callback,
+ this);
+
+ this->font_size = 24;
+ this->subtitle_size = 1;
+
+ this->font = class->xine->config->register_string(class->xine->config,
+ "subtitles.separate.font",
+ "sans",
+ _("font for external subtitles"),
+ NULL, 0, update_osd_font, this);
+
+ this->vertical_offset = class->xine->config->register_num(class->xine->config,
+ "subtitles.separate.vertical_offset",
+ 0,
+ _("subtitle vertical offset (relative window size)"),
+ NULL, 0, update_vertical_offset, this);
+
+ this->current_anchor.href = NULL;
+
+ lprintf ("video_out is at %p\n", this->stream->video_out);
+
+ return (spu_decoder_t *) this;
+}
+
+static void update_src_encoding(void *this_gen, xine_cfg_entry_t *entry)
+{
+ spucmml_class_t *this = (spucmml_class_t *)this_gen;
+
+ this->src_encoding = entry->str_value;
+ printf("libspucmml: spu_src_encoding = %s\n", this->src_encoding );
+}
+
+static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
+ spucmml_class_t *this = (spucmml_class_t *) calloc(1, sizeof(spucmml_class_t));
+
+ this->class.open_plugin = spucmml_class_open_plugin;
+ this->class.identifier = "spucmml";
+ this->class.description = N_("CMML subtitle decoder plugin");
+ this->class.dispose = default_spu_decoder_class_dispose;
+
+ this->xine = xine;
+
+ this->src_encoding = xine->config->register_string(xine->config,
+ "subtitles.separate.src_encoding",
+ "iso-8859-1",
+ _("encoding of subtitles"),
+ NULL, 10, update_src_encoding, this);
+
+ return &this->class;
+}
+
+
+/* plugin catalog information */
+static const uint32_t supported_types[] = { BUF_SPU_CMML, 0 };
+
+static const decoder_info_t spudec_info = {
+ supported_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_SPU_DECODER, 17, "spucmml", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
+
diff --git a/src/libspudec/nav_read.c b/src/spu_dec/nav_read.c
index 5244bfdd6..5244bfdd6 100644
--- a/src/libspudec/nav_read.c
+++ b/src/spu_dec/nav_read.c
diff --git a/src/spu_dec/spu_decoder.c b/src/spu_dec/spu_decoder.c
new file mode 100644
index 000000000..9244564ff
--- /dev/null
+++ b/src/spu_dec/spu_decoder.c
@@ -0,0 +1,386 @@
+/*
+ * Copyright (C) 2000-2008 the xine project
+ *
+ * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
+ *
+ * This file is part of xine, a unix 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, USA
+ *
+ * stuff needed to turn libspu into a xine decoder plugin
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
+#include "xine-engine/bswap.h"
+#include <xine/xineutils.h>
+#ifdef HAVE_DVDNAV
+# ifdef HAVE_DVDNAV_NAVTYPES_H
+# include <dvdnav/nav_types.h>
+# include <dvdnav/nav_read.h>
+# else
+# include <dvdread/nav_types.h>
+# include <dvdread/nav_read.h>
+# endif
+#else
+# include "nav_read.h"
+# include "nav_types.h"
+#endif
+
+#include "spudec.h"
+
+/*
+#define LOG_DEBUG 1
+#define LOG_BUTTON 1
+*/
+
+static const clut_t default_clut[] = {
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef),
+ CLUT_Y_CR_CB_INIT(0x51, 0xef, 0x5a),
+ CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x36, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef),
+ CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x51, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x10, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef),
+ CLUT_Y_CR_CB_INIT(0x5c, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0xbf, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x1c, 0x80, 0x80),
+ CLUT_Y_CR_CB_INIT(0x28, 0x6d, 0xef)
+};
+
+static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+ const uint8_t stream_id = buf->type & 0x1f ;
+
+#ifdef LOG_DEBUG
+ printf("libspudec:got buffer type = %x\n", buf->type);
+#endif
+
+ /* check, if we need to process the next PCI from the list */
+ pthread_mutex_lock(&this->nav_pci_lock);
+ spudec_update_nav(this);
+ pthread_mutex_unlock(&this->nav_pci_lock);
+
+ if ( (buf->type & 0xffff0000) != BUF_SPU_DVD ||
+ !(buf->decoder_flags & BUF_FLAG_SPECIAL) ||
+ buf->decoder_info[1] != BUF_SPECIAL_SPU_DVD_SUBTYPE )
+ return;
+
+ if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_CLUT ) {
+#ifdef LOG_DEBUG
+ printf("libspudec: SPU CLUT\n");
+#endif
+ if (buf->content[0]) { /* cheap endianess detection */
+ xine_fast_memcpy(this->state.clut, buf->content, sizeof(uint32_t)*16);
+ } else {
+ int i;
+ uint32_t *clut = (uint32_t*) buf->content;
+ for (i = 0; i < 16; i++)
+ this->state.clut[i] = bswap_32(clut[i]);
+ }
+ this->state.need_clut = 0;
+ return;
+ }
+
+ if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_NAV ) {
+#ifdef LOG_DEBUG
+ printf("libspudec:got nav packet 1\n");
+#endif
+ spudec_decode_nav(this,buf);
+ return;
+ }
+
+ if ( buf->decoder_info[2] == SPU_DVD_SUBTYPE_VOBSUB_PACKAGE ) {
+ this->state.vobsub = 1;
+ }
+
+#ifdef LOG_DEBUG
+ printf("libspudec:got buffer type = %x\n", buf->type);
+#endif
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW) /* skip preview data */
+ return;
+
+ if (buf->pts) {
+ metronom_t *metronom = this->stream->metronom;
+ int64_t vpts = metronom->got_spu_packet(metronom, buf->pts);
+
+ this->spudec_stream_state[stream_id].vpts = vpts; /* Show timer */
+ this->spudec_stream_state[stream_id].pts = buf->pts; /* Required to match up with NAV packets */
+ }
+
+ spudec_reassembly(this->stream->xine,
+ &this->spudec_stream_state[stream_id].ra_seq, buf->content, buf->size);
+ if(this->spudec_stream_state[stream_id].ra_seq.complete == 1) {
+ if(this->spudec_stream_state[stream_id].ra_seq.broken) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: dropping broken SPU\n");
+ this->spudec_stream_state[stream_id].ra_seq.broken = 0;
+ } else
+ spudec_process(this,stream_id);
+ }
+}
+
+static void spudec_reset (spu_decoder_t *this_gen) {
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+ int i;
+
+ if( this->menu_handle >= 0 )
+ ovl_manager->free_handle(ovl_manager,
+ this->menu_handle);
+ this->menu_handle = -1;
+
+ for (i=0; i < MAX_STREAMS; i++) {
+ if( this->spudec_stream_state[i].overlay_handle >= 0 )
+ ovl_manager->free_handle(ovl_manager,
+ this->spudec_stream_state[i].overlay_handle);
+ this->spudec_stream_state[i].overlay_handle = -1;
+ this->spudec_stream_state[i].ra_seq.complete = 1;
+ this->spudec_stream_state[i].ra_seq.broken = 0;
+ }
+
+ pthread_mutex_lock(&this->nav_pci_lock);
+ spudec_clear_nav_list(this);
+ pthread_mutex_unlock(&this->nav_pci_lock);
+}
+
+static void spudec_discontinuity (spu_decoder_t *this_gen) {
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+
+ pthread_mutex_lock(&this->nav_pci_lock);
+ spudec_clear_nav_list(this);
+ pthread_mutex_unlock(&this->nav_pci_lock);
+}
+
+
+static void spudec_dispose (spu_decoder_t *this_gen) {
+
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+
+ if( this->menu_handle >= 0 )
+ ovl_manager->free_handle(ovl_manager,
+ this->menu_handle);
+ this->menu_handle = -1;
+
+ int i;
+ for (i=0; i < MAX_STREAMS; i++) {
+ if( this->spudec_stream_state[i].overlay_handle >= 0 )
+ ovl_manager->free_handle(ovl_manager,
+ this->spudec_stream_state[i].overlay_handle);
+ this->spudec_stream_state[i].overlay_handle = -1;
+ free (this->spudec_stream_state[i].ra_seq.buf);
+ }
+
+ spudec_clear_nav_list(this);
+ pthread_mutex_destroy(&this->nav_pci_lock);
+
+ free (this->event.object.overlay);
+ free (this);
+}
+
+/* gets the current already correctly processed nav_pci info */
+/* This is not perfectly in sync with the display, but all the same, */
+/* much closer than doing it at the input stage. */
+/* returns a bool for error/success.*/
+static int spudec_get_interact_info (spu_decoder_t *this_gen, void *data) {
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+ /*printf("get_interact_info() called\n");*/
+ if (!this || !data)
+ return 0;
+
+ /*printf("get_interact_info() coping nav_pci\n");*/
+ pthread_mutex_lock(&this->nav_pci_lock);
+ spudec_update_nav(this);
+ memcpy(data, &this->pci_cur.pci, sizeof(pci_t) );
+ pthread_mutex_unlock(&this->nav_pci_lock);
+ return 1;
+
+}
+
+static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t show) {
+ spudec_decoder_t *this = (spudec_decoder_t *) this_gen;
+ /* This function will move to video_overlay
+ * when video_overlay does menus */
+
+ video_overlay_manager_t *ovl_manager;
+ video_overlay_event_t *overlay_event = calloc(1, sizeof(video_overlay_event_t));
+ vo_overlay_t *overlay = calloc(1, sizeof(vo_overlay_t));
+
+ /* FIXME: Watch out for threads. We should really put a lock on this
+ * because events is a different thread than decode_data */
+
+ if( this->menu_handle < 0 ) {
+ if (this->stream->video_out) {
+ ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+ this->menu_handle = ovl_manager->get_handle(ovl_manager,1);
+ }
+ }
+#ifdef LOG_BUTTON
+ printf ("libspudec:xine_decoder.c:spudec_event_listener:this=%p\n",this);
+ printf ("libspudec:xine_decoder.c:spudec_event_listener:this->menu_handle=%d\n",this->menu_handle);
+#endif
+ if(this->menu_handle < 0) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "Menu handle alloc failed. No more overlays objects available. Only %d at once please.",
+ MAX_OBJECTS);
+ free(overlay_event);
+ free(overlay);
+ return;
+ }
+
+ if (show > 0) {
+#ifdef LOG_NAV
+ fprintf (stderr,"libspudec:xine_decoder.c:spudec_event_listener:buttonN = %u show=%d\n",
+ button,
+ show);
+#endif
+ this->buttonN = button;
+ if (this->button_filter != 1) {
+#ifdef LOG_BUTTON
+ fprintf (stdout,"libspudec:xine_decoder.c:spudec_event_listener:buttonN updates not allowed\n");
+#endif
+ /* Only update highlight is the menu will let us */
+ free(overlay_event);
+ free(overlay);
+ return;
+ }
+ if (show == 2) {
+ this->button_filter = 2;
+ }
+ pthread_mutex_lock(&this->nav_pci_lock);
+ spudec_update_nav(this);
+ overlay_event->object.handle = this->menu_handle;
+ overlay_event->object.pts = this->pci_cur.pci.hli.hl_gi.hli_s_ptm;
+ overlay_event->object.overlay=overlay;
+ overlay_event->event_type = OVERLAY_EVENT_MENU_BUTTON;
+#ifdef LOG_BUTTON
+ fprintf(stderr, "libspudec:Button Overlay\n");
+#endif
+ spudec_copy_nav_to_overlay(this->stream->xine, &this->pci_cur.pci, this->state.clut,
+ this->buttonN, show-1, overlay, &this->overlay );
+ pthread_mutex_unlock(&this->nav_pci_lock);
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libspudec:xine_decoder.c:spudec_event_listener:HIDE ????\n");
+ printf("We dropped out here for some reason");
+ _x_abort();
+ overlay_event->object.handle = this->menu_handle;
+ overlay_event->event_type = OVERLAY_EVENT_HIDE;
+ }
+ overlay_event->vpts = 0;
+ if (this->stream->video_out) {
+ ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+#ifdef LOG_BUTTON
+ fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n",
+ overlay_event->event_type,
+ this->stream->xine->clock->get_current_time(this->stream->xine->clock),
+ overlay_event->vpts);
+#endif
+ ovl_manager->add_event (ovl_manager, (void *)overlay_event);
+ free(overlay_event);
+ free(overlay);
+ } else {
+ free(overlay_event);
+ free(overlay);
+ }
+ return;
+}
+
+static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ spudec_decoder_t *this ;
+
+ this = (spudec_decoder_t *) calloc(1, sizeof (spudec_decoder_t));
+
+ this->spu_decoder.decode_data = spudec_decode_data;
+ this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
+ this->spu_decoder.dispose = spudec_dispose;
+ this->spu_decoder.get_interact_info = spudec_get_interact_info;
+ this->spu_decoder.set_button = spudec_set_button;
+ this->stream = stream;
+ this->class = (spudec_class_t *) class_gen;
+
+ this->menu_handle = -1;
+ this->buttonN = 1;
+ this->event.object.overlay = calloc(1, sizeof(vo_overlay_t));
+
+ pthread_mutex_init(&this->nav_pci_lock, NULL);
+ this->pci_cur.pci.hli.hl_gi.hli_ss = 0;
+ this->pci_cur.next = NULL;
+
+ this->ovl_caps = stream->video_out->get_capabilities(stream->video_out);
+ this->output_open = 0;
+ this->last_event_vpts = 0;
+
+ int i;
+ for (i=0; i < MAX_STREAMS; i++) {
+ this->spudec_stream_state[i].ra_seq.complete = 1;
+ this->spudec_stream_state[i].overlay_handle = -1;
+ }
+
+/* FIXME:Do we really need a default clut? */
+ xine_fast_memcpy(this->state.clut, default_clut, sizeof(this->state.clut));
+ this->state.need_clut = 1;
+ this->state.vobsub = 0;
+
+ return &this->spu_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ spudec_class_t *this;
+
+ this = calloc(1, sizeof (spudec_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "spudec";
+ this->decoder_class.description = N_("DVD/VOB SPU decoder plugin");
+ this->decoder_class.dispose = default_spu_decoder_class_dispose;
+
+ lprintf ("libspudec:init_plugin called\n");
+ return this;
+}
+
+/* plugin catalog information */
+static const uint32_t supported_types[] = { BUF_SPU_DVD, 0 };
+
+static const decoder_info_t dec_info_data = {
+ supported_types, /* supported types */
+ 5 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_SPU_DECODER, 17, "spudec", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/spu_dec/spudec.c b/src/spu_dec/spudec.c
new file mode 100644
index 000000000..fc305b864
--- /dev/null
+++ b/src/spu_dec/spudec.c
@@ -0,0 +1,1034 @@
+/*
+ * Copyright (C) 2002-2004 the xine project
+ *
+ * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
+ *
+ * spu.c - converts DVD subtitles to an XPM image
+ *
+ * Mostly based on hard work by:
+ *
+ * Copyright (C) 2000 Samuel Hocevar <sam@via.ecp.fr>
+ * and Michel Lespinasse <walken@via.ecp.fr>
+ *
+ * Lots of rearranging by:
+ * Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
+ * Thomas Mirlacher <dent@cosy.sbg.ac.at>
+ * implemented reassembling
+ * cleaner implementation of SPU are saving
+ * overlaying (proof of concept for now)
+ * ... and yes, it works now with oms
+ * added tranparency (provided by the SPU hdr)
+ * changed structures for easy porting to MGAs DVD mode
+ * This file is part of xine
+ * This file was originally part of the OMS program.
+ *
+ * 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, 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; see the file COPYING. If not, write to
+ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+#include <inttypes.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/buffer.h>
+#include "xine-engine/bswap.h"
+#ifdef HAVE_DVDNAV
+# ifdef HAVE_DVDNAV_NAVTYPES_H
+# include <dvdnav/nav_read.h>
+# include <dvdnav/nav_print.h>
+# else
+# include <dvdread/nav_read.h>
+# include <dvdread/nav_print.h>
+# endif
+#else
+# include "nav_read.h"
+# include "nav_print.h"
+#endif
+
+#include "spudec.h"
+
+/*
+#define LOG_DEBUG 1
+#define LOG_BUTTON 1
+#define LOG_NAV 1
+*/
+
+static void spudec_do_commands (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl);
+static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl);
+static void spudec_discover_clut (xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl);
+#ifdef LOG_DEBUG
+static void spudec_print_overlay( vo_overlay_t *overlay );
+#endif
+
+void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) {
+ uint8_t *p;
+ uint32_t packet_len;
+ uint32_t stream_id;
+ uint32_t header_len;
+ pci_t pci;
+ dsi_t dsi;
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+
+ p = buf->content;
+ if (p[0] || p[1] || (p[2] != 1)) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libspudec:spudec_decode_nav:nav demux error! %02x %02x %02x (should be 0x000001) \n",p[0],p[1],p[2]);
+ return;
+ }
+
+ packet_len = p[4] << 8 | p[5];
+ stream_id = p[3];
+
+ header_len = 6;
+ p += header_len;
+
+ if (stream_id == 0xbf) { /* Private stream 2 */
+/* int i;
+ * for(i=0;i<80;i++) {
+ * printf("%02x ",p[i]);
+ * }
+ * printf("\n p[0]=0x%02x\n",p[0]);
+ */
+ if(p[0] == 0x00) {
+#ifdef LOG_NAV
+ printf("libspudec:nav_PCI\n");
+#endif
+ navRead_PCI(&pci, p+1);
+#ifdef LOG_NAV
+ printf("libspudec:nav:hli_ss=%u, hli_s_ptm=%u, hli_e_ptm=%u, btn_sl_e_ptm=%u pts=%lli\n",
+ pci.hli.hl_gi.hli_ss,
+ pci.hli.hl_gi.hli_s_ptm,
+ pci.hli.hl_gi.hli_e_ptm,
+ pci.hli.hl_gi.btn_se_e_ptm,
+ buf->pts);
+ printf("libspudec:nav:btn_sn/ofn=%u, btn_ns=%u, fosl_btnn=%u, foac_btnn=%u\n",
+ pci.hli.hl_gi.btn_ofn, pci.hli.hl_gi.btn_ns,
+ pci.hli.hl_gi.fosl_btnn, pci.hli.hl_gi.foac_btnn);
+ printf("btngr_ns %d\n", pci.hli.hl_gi.btngr_ns);
+ printf("btngr%d_dsp_ty 0x%02x\n", 1, pci.hli.hl_gi.btngr1_dsp_ty);
+ printf("btngr%d_dsp_ty 0x%02x\n", 2, pci.hli.hl_gi.btngr2_dsp_ty);
+ printf("btngr%d_dsp_ty 0x%02x\n", 3, pci.hli.hl_gi.btngr3_dsp_ty);
+ //navPrint_PCI(&pci);
+ //navPrint_PCI_GI(&pci.pci_gi);
+ //navPrint_NSML_AGLI(&pci.nsml_agli);
+ //navPrint_HLI(&pci.hli);
+ //navPrint_HL_GI(&pci.hli.hl_gi, & btngr_ns, & btn_ns);
+#endif
+ }
+
+ p += packet_len;
+
+ /* We should now have a DSI packet. */
+ /* We don't need anything from the DSI packet here. */
+ if(p[6] == 0x01) {
+ packet_len = p[4] << 8 | p[5];
+ p += 6;
+#ifdef LOG_NAV
+ printf("NAV DSI packet\n");
+#endif
+ navRead_DSI(&dsi, p+1);
+
+// self->vobu_start = self->dsi.dsi_gi.nv_pck_lbn;
+// self->vobu_length = self->dsi.dsi_gi.vobu_ea;
+ }
+ }
+
+ /* NAV packets contain start and end presentation timestamps, which tell the
+ * application, when the highlight information in the NAV is supposed to be valid.
+ * We handle these timestamps only in a very stripped-down way: We keep a list
+ * of NAV packets (or better: the PCI part of them), tagged with a VPTS timestamp
+ * telling, when the NAV should be processed. However, we only enqueue a new node
+ * into this list, when we receive new highlight information during an already
+ * showing menu. This happens very rarerly on common DVDs, so it is of low impact.
+ * And we only check for processing of queued entries at some prominent
+ * locations in this SPU decoder. Since presentation timestamps rarely solve a real
+ * purpose on most DVDs, this is ok compared to the full-blown solution, which would
+ * require a separate thread managing the queue all the time. */
+ pthread_mutex_lock(&this->nav_pci_lock);
+ switch (pci.hli.hl_gi.hli_ss) {
+ case 0:
+ /* No Highlight information for this VOBU */
+ if ( this->pci_cur.pci.hli.hl_gi.hli_ss == 1) {
+ /* Hide menu spu between menus */
+#ifdef LOG_BUTTON
+ printf("libspudec:nav:SHOULD HIDE SPU here\n");
+#endif
+ if( this->menu_handle < 0 ) {
+ this->menu_handle = ovl_manager->get_handle(ovl_manager,1);
+ }
+ if( this->menu_handle >= 0 ) {
+ this->event.object.handle = this->menu_handle;
+ this->event.event_type = OVERLAY_EVENT_HIDE;
+ /* hide menu right now */
+ this->event.vpts = 0;
+ ovl_manager->add_event(ovl_manager, (void *)&this->event);
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: No video_overlay handles left for menu\n");
+ }
+ }
+ spudec_clear_nav_list(this);
+ xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t));
+ /* incoming SPUs will be plain subtitles */
+ this->event.object.object_type = 0;
+ if (this->button_filter) {
+ /* we possibly had buttons before, so we update the UI info */
+ xine_event_t event;
+ xine_ui_data_t data;
+
+ event.type = XINE_EVENT_UI_NUM_BUTTONS;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.num_buttons = 0;
+
+ xine_event_send(this->stream, &event);
+ }
+ this->button_filter=0;
+
+ break;
+ case 1:
+ /* All New Highlight information for this VOBU */
+ if (this->pci_cur.pci.hli.hl_gi.hli_ss != 0 &&
+ pci.hli.hl_gi.hli_s_ptm > this->pci_cur.pci.hli.hl_gi.hli_s_ptm) {
+ pci_node_t *node = &this->pci_cur;
+#ifdef LOG_DEBUG
+ printf("libspudec: allocating new PCI node for hli_s_ptm %d\n", pci.hli.hl_gi.hli_s_ptm);
+#endif
+ /* append PCI at the end of the list */
+ while (node->next) node = node->next;
+ node->next = malloc(sizeof(pci_node_t));
+ node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm);
+ node->next->next = NULL;
+ xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t));
+ } else {
+ spudec_clear_nav_list(this);
+ /* menu ahead, remember PCI for later use */
+ xine_fast_memcpy(&this->pci_cur.pci, &pci, sizeof(pci_t));
+ spudec_process_nav(this);
+ }
+ break;
+ case 2:
+ /* Use Highlight information from previous VOBU */
+ if (this->pci_cur.next) {
+ /* apply changes to last enqueued NAV */
+ pci_node_t *node = this->pci_cur.next;
+ while (node->next) node = node->next;
+ node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
+ node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
+ node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
+ spudec_update_nav(this);
+ } else {
+ this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
+ this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
+ this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
+ }
+ break;
+ case 3:
+ /* Use Highlight information from previous VOBU except commands, which come from this VOBU */
+ if (this->pci_cur.next) {
+ /* apply changes to last enqueued NAV */
+ pci_node_t *node = this->pci_cur.next;
+ while (node->next) node = node->next;
+ node->pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
+ node->pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
+ node->pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
+ /* FIXME: Add command copying here */
+ spudec_update_nav(this);
+ } else {
+ this->pci_cur.pci.pci_gi.vobu_s_ptm = pci.pci_gi.vobu_s_ptm;
+ this->pci_cur.pci.pci_gi.vobu_e_ptm = pci.pci_gi.vobu_e_ptm;
+ this->pci_cur.pci.pci_gi.vobu_se_e_ptm = pci.pci_gi.vobu_se_e_ptm;
+ /* FIXME: Add command copying here */
+ }
+ break;
+ default:
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libspudec: unknown pci.hli.hl_gi.hli_ss = %d\n", pci.hli.hl_gi.hli_ss );
+ break;
+ }
+ pthread_mutex_unlock(&this->nav_pci_lock);
+ return;
+}
+
+void spudec_clear_nav_list(spudec_decoder_t *this)
+{
+ while (this->pci_cur.next) {
+ pci_node_t *node = this->pci_cur.next->next;
+ free(this->pci_cur.next);
+ this->pci_cur.next = node;
+ }
+ /* invalidate current timestamp */
+ this->pci_cur.pci.hli.hl_gi.hli_s_ptm = (uint32_t)-1;
+}
+
+void spudec_update_nav(spudec_decoder_t *this)
+{
+ metronom_clock_t *clock = this->stream->xine->clock;
+
+ if (this->pci_cur.next && this->pci_cur.next->vpts <= clock->get_current_time(clock)) {
+ pci_node_t *node = this->pci_cur.next;
+ xine_fast_memcpy(&this->pci_cur, this->pci_cur.next, sizeof(pci_node_t));
+ spudec_process_nav(this);
+ free(node);
+ }
+}
+
+void spudec_process_nav(spudec_decoder_t *this)
+{
+ /* incoming SPUs will be menus */
+ this->event.object.object_type = 1;
+ if (!this->button_filter) {
+ /* we possibly entered a menu, so we update the UI button info */
+ xine_event_t event;
+ xine_ui_data_t data;
+
+ event.type = XINE_EVENT_UI_NUM_BUTTONS;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.num_buttons = this->pci_cur.pci.hli.hl_gi.btn_ns;
+
+ xine_event_send(this->stream, &event);
+ }
+ this->button_filter=1;
+}
+
+void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len)
+{
+#ifdef LOG_DEBUG
+ printf ("libspudec: seq->complete = %d\n", seq->complete);
+ printf("libspudec:1: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n",
+ seq->ra_offs,
+ seq->seq_len,
+ seq->buf_len,
+ seq->buf);
+#endif
+ if (seq->complete) {
+ seq->seq_len = (((uint32_t)pkt_data[0])<<8) | pkt_data[1];
+ seq->cmd_offs = (((uint32_t)pkt_data[2])<<8) | pkt_data[3];
+ if (seq->cmd_offs >= seq->seq_len) {
+ xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n");
+ seq->broken = 1;
+ }
+ if (seq->buf_len < seq->seq_len) {
+ seq->buf_len = seq->seq_len;
+#ifdef LOG_DEBUG
+ printf ("spu: MALLOC1: seq->buf %p, len=%d\n", seq->buf,seq->buf_len);
+#endif
+ if (seq->buf) {
+ free(seq->buf);
+ seq->buf = NULL;
+ }
+ seq->buf = malloc(seq->buf_len);
+#ifdef LOG_DEBUG
+ printf ("spu: MALLOC2: seq->buf %p, len=%d\n", seq->buf,seq->buf_len);
+#endif
+
+ }
+ seq->ra_offs = 0;
+
+#ifdef LOG_DEBUG
+ printf ("spu: buf_len: %d\n", seq->buf_len);
+ printf ("spu: cmd_off: %d\n", seq->cmd_offs);
+#endif
+ }
+
+#ifdef LOG_DEBUG
+ printf("libspudec:2: seq->ra_offs = %d, seq->seq_len = %d, seq->buf_len = %d, seq->buf=%p\n",
+ seq->ra_offs,
+ seq->seq_len,
+ seq->buf_len,
+ seq->buf);
+#endif
+ if (seq->ra_offs < seq->seq_len) {
+ if (seq->ra_offs + pkt_len > seq->seq_len)
+ pkt_len = seq->seq_len - seq->ra_offs;
+ memcpy (seq->buf + seq->ra_offs, pkt_data, pkt_len);
+ seq->ra_offs += pkt_len;
+ } else {
+ xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n");
+ seq->broken = 1;
+ }
+
+ if (seq->ra_offs == seq->seq_len) {
+ seq->finished = 0;
+ seq->complete = 1;
+ return; /* sequence ready */
+ }
+ seq->complete = 0;
+ return;
+}
+
+void spudec_process (spudec_decoder_t *this, int stream_id) {
+ spudec_seq_t *cur_seq;
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+ int pending = 1;
+ cur_seq = &this->spudec_stream_state[stream_id].ra_seq;
+
+#ifdef LOG_DEBUG
+ printf ("spu: Found SPU from stream %d pts=%lli vpts=%lli\n",stream_id,
+ this->spudec_stream_state[stream_id].pts,
+ this->spudec_stream_state[stream_id].vpts);
+#endif
+ this->state.cmd_ptr = cur_seq->buf + cur_seq->cmd_offs;
+ this->state.modified = 1; /* Only draw picture if = 1 on first event of SPU */
+ this->state.visible = OVERLAY_EVENT_SHOW;
+ this->state.forced_display = 0; /* 0 - No value, 1 - Forced Display. */
+ this->state.delay = 0;
+ cur_seq->finished=0;
+
+ do {
+ if (!(cur_seq->finished) ) {
+ pci_node_t *node;
+
+ /* spu_channel is now set based on whether we are in the menu or not. */
+ /* Bit 7 is set if only forced display SPUs should be shown */
+ if ( (this->stream->spu_channel & 0x1f) != stream_id ) {
+#ifdef LOG_DEBUG
+ printf ("spu: Dropping SPU channel %d. Not selected stream_id\n", stream_id);
+#endif
+ return;
+ }
+ /* parse SPU command sequence, this will update forced_display, so it must come
+ * before the check for it */
+ spudec_do_commands(this->stream->xine, &this->state, cur_seq, &this->overlay);
+ /* FIXME: Check for Forced-display or subtitle stream
+ * For subtitles, open event.
+ * For menus, store it for later.
+ */
+ if (cur_seq->broken) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "libspudec: dropping broken SPU\n");
+ cur_seq->broken = 0;
+ return;
+ }
+ if ( (this->state.forced_display == 0) && (this->stream->spu_channel & 0x80) ) {
+#ifdef LOG_DEBUG
+ printf ("spu: Dropping SPU channel %d. Only allow forced display SPUs\n", stream_id);
+#endif
+ return;
+ }
+
+#ifdef LOG_DEBUG
+ spudec_print_overlay( &this->overlay );
+ printf ("spu: forced display:%s\n", this->state.forced_display ? "Yes" : "No" );
+#endif
+ pthread_mutex_lock(&this->nav_pci_lock);
+ /* search for a PCI that matches this SPU's PTS */
+ for (node = &this->pci_cur; node; node = node->next)
+ if (node->pci.hli.hl_gi.hli_s_ptm == this->spudec_stream_state[stream_id].pts)
+ break;
+ if (node) {
+ if (this->state.visible == OVERLAY_EVENT_HIDE) {
+ /* menus are hidden via nav packet decoding, not here */
+ /* FIXME: James is not sure about this solution and may want to look this over.
+ * I'm commiting it, because I haven't found a disc it breaks, but it fixes
+ * some instead. Michael Roitzsch */
+ pthread_mutex_unlock(&this->nav_pci_lock);
+ continue;
+ }
+ if (node->pci.hli.hl_gi.fosl_btnn > 0) {
+ xine_event_t event;
+
+ this->buttonN = node->pci.hli.hl_gi.fosl_btnn;
+ event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
+ event.stream = this->stream;
+ event.data = &this->buttonN;
+ event.data_length = sizeof(this->buttonN);
+ xine_event_send(this->stream, &event);
+ }
+#ifdef LOG_BUTTON
+ fprintf(stderr, "libspudec:Full Overlay\n");
+#endif
+ if (!spudec_copy_nav_to_overlay(this->stream->xine,
+ &node->pci, this->state.clut,
+ this->buttonN, 0, &this->overlay, &this->overlay)) {
+ /* current button does not exist -> use another one */
+ xine_event_t event;
+
+ if (this->buttonN > node->pci.hli.hl_gi.btn_ns)
+ this->buttonN = node->pci.hli.hl_gi.btn_ns;
+ else
+ this->buttonN = 1;
+ event.type = XINE_EVENT_INPUT_BUTTON_FORCE;
+ event.stream = this->stream;
+ event.data = &this->buttonN;
+ event.data_length = sizeof(this->buttonN);
+ xine_event_send(this->stream, &event);
+ spudec_copy_nav_to_overlay(this->stream->xine,
+ &node->pci, this->state.clut,
+ this->buttonN, 0, &this->overlay, &this->overlay);
+ }
+ } else {
+ /* Subtitle and not a menu button */
+ int i;
+ for (i = 0;i < 4; i++) {
+ this->overlay.hili_color[i] = this->overlay.color[i];
+ this->overlay.hili_trans[i] = this->overlay.trans[i];
+ }
+ }
+ pthread_mutex_unlock(&this->nav_pci_lock);
+
+ if ((this->state.modified) ) {
+ spudec_draw_picture(this->stream->xine, &this->state, cur_seq, &this->overlay);
+ }
+
+ if (this->state.need_clut) {
+ spudec_discover_clut(this->stream->xine, &this->state, &this->overlay);
+ }
+
+ if (this->state.vobsub) {
+ int width, height;
+ int64_t duration;
+
+ /*
+ * vobsubs are usually played with a scaled-down stream (not full DVD
+ * resolution), therefore we should try to realign it.
+ */
+
+ this->stream->video_out->status(this->stream->video_out, NULL,
+ &width, &height, &duration );
+
+ this->overlay.x = (width - this->overlay.width) / 2;
+ this->overlay.y = height - this->overlay.height;
+ }
+
+ /* Subtitle */
+ if( this->menu_handle < 0 ) {
+ this->menu_handle = ovl_manager->get_handle(ovl_manager,1);
+ }
+
+ if( this->menu_handle < 0 ) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libspudec: No video_overlay handles left for menu\n");
+ return;
+ }
+ this->event.object.handle = this->menu_handle;
+ this->event.object.pts = this->spudec_stream_state[stream_id].pts;
+
+ xine_fast_memcpy(this->event.object.overlay,
+ &this->overlay,
+ sizeof(vo_overlay_t));
+ this->overlay.rle=NULL;
+ /* For force display menus */
+ //if ( !(this->state.visible) ) {
+ // this->state.visible = OVERLAY_EVENT_SHOW;
+ //}
+
+ this->event.event_type = this->state.visible;
+ /*
+ printf("spu event %d handle: %d vpts: %lli\n", this->event.event_type,
+ this->event.object.handle, this->event.vpts );
+ */
+
+ this->event.vpts = this->spudec_stream_state[stream_id].vpts+(this->state.delay*1000);
+
+ /* Keep all the events in the correct order. */
+ /* This corrects for errors during estimation around discontinuity */
+ if( this->event.vpts < this->last_event_vpts ) {
+ this->event.vpts = this->last_event_vpts + 1;
+ }
+ this->last_event_vpts = this->event.vpts;
+
+#ifdef LOG_BUTTON
+ fprintf(stderr, "libspudec: add_event type=%d : current time=%lld, spu vpts=%lli\n",
+ this->event.event_type,
+ this->stream->xine->clock->get_current_time(this->stream->xine->clock),
+ this->event.vpts);
+#endif
+ ovl_manager->add_event(ovl_manager, (void *)&this->event);
+ } else {
+ pending = 0;
+ }
+ } while (pending);
+
+}
+
+#define CMD_SPU_FORCE_DISPLAY 0x00
+#define CMD_SPU_SHOW 0x01
+#define CMD_SPU_HIDE 0x02
+#define CMD_SPU_SET_PALETTE 0x03
+#define CMD_SPU_SET_ALPHA 0x04
+#define CMD_SPU_SET_SIZE 0x05
+#define CMD_SPU_SET_PXD_OFFSET 0x06
+#define CMD_SPU_WIPE 0x07 /* Not currently implemented */
+#define CMD_SPU_EOF 0xff
+
+static void spudec_do_commands(xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl)
+{
+ uint8_t *buf = state->cmd_ptr;
+ uint8_t *next_seq;
+ int32_t param_length;
+
+#ifdef LOG_DEBUG
+ printf ("spu: SPU DO COMMANDS\n");
+#endif
+
+ state->delay = (buf[0] << 8) + buf[1];
+#ifdef LOG_DEBUG
+ printf ("spu: \tdelay=%d\n",state->delay);
+#endif
+ next_seq = seq->buf + (buf[2] << 8) + buf[3];
+ buf += 4;
+#ifdef LOG_DEBUG
+ printf ("spu: \tnext_seq=%d\n",next_seq - seq->buf);
+#endif
+
+/* if next equals current, this is the last one
+ */
+ if (state->cmd_ptr >= next_seq)
+ next_seq = seq->buf + seq->seq_len; /* allow to run until end */
+
+ state->cmd_ptr = next_seq;
+
+ while (buf < next_seq && *buf != CMD_SPU_EOF) {
+ switch (*buf) {
+ case CMD_SPU_SHOW: /* show subpicture */
+#ifdef LOG_DEBUG
+ printf ("spu: \tshow subpicture\n");
+#endif
+ state->visible = OVERLAY_EVENT_SHOW;
+ buf++;
+ break;
+
+ case CMD_SPU_HIDE: /* hide subpicture */
+#ifdef LOG_DEBUG
+ printf ("spu: \thide subpicture\n");
+#endif
+ state->visible = OVERLAY_EVENT_HIDE;
+ buf++;
+ break;
+
+ case CMD_SPU_SET_PALETTE: { /* CLUT */
+ spudec_clut_t *clut = (spudec_clut_t *) (buf+1);
+
+ state->cur_colors[3] = clut->entry0;
+ state->cur_colors[2] = clut->entry1;
+ state->cur_colors[1] = clut->entry2;
+ state->cur_colors[0] = clut->entry3;
+
+/* This is a bit out of context for now */
+ ovl->color[3] = state->clut[clut->entry0];
+ ovl->color[2] = state->clut[clut->entry1];
+ ovl->color[1] = state->clut[clut->entry2];
+ ovl->color[0] = state->clut[clut->entry3];
+
+#ifdef LOG_DEBUG
+ printf ("spu: \tclut [%x %x %x %x]\n",
+ ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]);
+ printf ("spu: \tclut base [%x %x %x %x]\n",
+ clut->entry0, clut->entry1, clut->entry2, clut->entry3);
+#endif
+ state->modified = 1;
+ buf += 3;
+ break;
+ }
+ case CMD_SPU_SET_ALPHA: { /* transparency palette */
+ spudec_clut_t *trans = (spudec_clut_t *) (buf+1);
+/* This should go into state for now */
+
+ ovl->trans[3] = trans->entry0;
+ ovl->trans[2] = trans->entry1;
+ ovl->trans[1] = trans->entry2;
+ ovl->trans[0] = trans->entry3;
+
+#ifdef LOG_DEBUG
+ printf ("spu: \ttrans [%d %d %d %d]\n",
+ ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]);
+#endif
+ state->modified = 1;
+ buf += 3;
+ break;
+ }
+
+ case CMD_SPU_SET_SIZE: /* image coordinates */
+/* state->o_left = (buf[1] << 4) | (buf[2] >> 4);
+ state->o_right = (((buf[2] & 0x0f) << 8) | buf[3]);
+
+ state->o_top = (buf[4] << 4) | (buf[5] >> 4);
+ state->o_bottom = (((buf[5] & 0x0f) << 8) | buf[6]);
+ */
+ ovl->x = (buf[1] << 4) | (buf[2] >> 4);
+ ovl->y = (buf[4] << 4) | (buf[5] >> 4);
+ ovl->width = (((buf[2] & 0x0f) << 8) | buf[3]) - ovl->x + 1;
+ ovl->height = (((buf[5] & 0x0f) << 8) | buf[6]) - ovl->y + 1;
+ ovl->hili_top = -1;
+ ovl->hili_bottom = -1;
+ ovl->hili_left = -1;
+ ovl->hili_right = -1;
+
+#ifdef LOG_DEBUG
+ printf ("spu: \tx = %d y = %d width = %d height = %d\n",
+ ovl->x, ovl->y, ovl->width, ovl->height );
+#endif
+ state->modified = 1;
+ buf += 7;
+ break;
+
+ case CMD_SPU_SET_PXD_OFFSET: /* image top[0] field / image bottom[1] field*/
+ state->field_offs[0] = (((u_int)buf[1]) << 8) | buf[2];
+ state->field_offs[1] = (((u_int)buf[3]) << 8) | buf[4];
+
+#ifdef LOG_DEBUG
+ printf ("spu: \toffset[0] = %d offset[1] = %d\n",
+ state->field_offs[0], state->field_offs[1]);
+#endif
+
+ if ((state->field_offs[0] >= seq->seq_len) ||
+ (state->field_offs[1] >= seq->seq_len)) {
+ xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec:faulty stream\n");
+ seq->broken = 1;
+ }
+ state->modified = 1;
+ buf += 5;
+ break;
+
+ case CMD_SPU_WIPE:
+#ifdef LOG_DEBUG
+ printf ("libspudec: \tSPU_WIPE not implemented yet\n");
+#endif
+ param_length = (buf[1] << 8) | (buf[2]);
+ buf += 1 + param_length;
+ break;
+
+ case CMD_SPU_FORCE_DISPLAY:
+#ifdef LOG_DEBUG
+ printf ("libspudec: \tForce Display/Menu\n");
+#endif
+ state->forced_display = 1;
+ buf++;
+ break;
+
+ default:
+ xprintf(xine, XINE_VERBOSITY_DEBUG, "libspudec: unknown seqence command (%02x)\n", buf[0]);
+ /* FIXME: SPU should be dropped, and buffers resynced */
+ buf = next_seq;
+ seq->broken = 1;
+ break;
+ }
+ }
+
+ if (next_seq >= seq->buf + seq->seq_len)
+ seq->finished = 1; /* last sub-sequence */
+}
+
+/* FIXME: Get rid of all these static values */
+static uint8_t *bit_ptr[2];
+static int field; // which field we are currently decoding
+static int put_x, put_y;
+
+static u_int get_bits (u_int bits)
+{
+ static u_int data;
+ static u_int bits_left;
+ u_int ret = 0;
+
+ if (!bits) { /* for realignment to next byte */
+ bits_left = 0;
+ }
+
+ while (bits) {
+ if (bits > bits_left) {
+ ret |= data << (bits - bits_left);
+ bits -= bits_left;
+
+ data = *bit_ptr[field]++;
+ bits_left = 8;
+ } else {
+ bits_left -= bits;
+ ret |= data >> (bits_left);
+ data &= (1 << bits_left) - 1;
+ bits = 0;
+ }
+ }
+
+ return ret;
+}
+
+static int spudec_next_line (vo_overlay_t *spu)
+{
+ get_bits (0); // byte align rle data
+
+ put_x = 0;
+ put_y++;
+ field ^= 1; // Toggle fields
+
+ if (put_y >= spu->height) {
+#ifdef LOG_DEBUG
+ printf ("spu: put_y >= spu->height\n");
+#endif
+ return -1;
+ }
+ return 0;
+}
+
+static void spudec_draw_picture (xine_t *xine, spudec_state_t *state, spudec_seq_t* seq, vo_overlay_t *ovl)
+{
+ rle_elem_t *rle;
+ field = 0;
+ bit_ptr[0] = seq->buf + state->field_offs[0];
+ bit_ptr[1] = seq->buf + state->field_offs[1];
+ put_x = put_y = 0;
+ get_bits (0); /* Reset/init bit code */
+
+/* ovl->x = state->o_left;
+ * ovl->y = state->o_top;
+ * ovl->width = state->o_right - state->o_left + 1;
+ * ovl->height = state->o_bottom - state->o_top + 1;
+
+ * ovl->hili_top = 0;
+ * ovl->hili_bottom = ovl->height - 1;
+ * ovl->hili_left = 0;
+ * ovl->hili_right = ovl->width - 1;
+ */
+
+ /* allocate for the worst case:
+ * - both fields running to the very end
+ * - 2 RLE elements per byte meaning single pixel RLE
+ */
+ ovl->data_size = ((seq->cmd_offs - state->field_offs[0]) +
+ (seq->cmd_offs - state->field_offs[1])) * 2 * sizeof(rle_elem_t);
+
+ if (ovl->rle) {
+ xprintf (xine, XINE_VERBOSITY_DEBUG,
+ "libspudec: spudec_draw_picture: ovl->rle is not empty!!!! It should be!!! "
+ "You should never see this message.\n");
+ free(ovl->rle);
+ ovl->rle=NULL;
+ }
+ ovl->rle = malloc(ovl->data_size);
+
+ state->modified = 0; /* mark as already processed */
+ rle = ovl->rle;
+#ifdef LOG_DEBUG
+ printf ("libspudec: Draw RLE=%p\n",rle);
+#endif
+
+ while (bit_ptr[1] < seq->buf + seq->cmd_offs) {
+ u_int len;
+ u_int vlc;
+
+ vlc = get_bits (4);
+ if (vlc < 0x0004) {
+ vlc = (vlc << 4) | get_bits (4);
+ if (vlc < 0x0010) {
+ vlc = (vlc << 4) | get_bits (4);
+ if (vlc < 0x0040) {
+ vlc = (vlc << 4) | get_bits (4);
+ }
+ }
+ }
+
+ len = vlc >> 2;
+
+ /* if len == 0 -> end sequence - fill to end of line */
+ if (len == 0)
+ len = ovl->width - put_x;
+
+ rle->len = len;
+ rle->color = vlc & 0x03;
+ rle++;
+ put_x += len;
+
+ if (put_x >= ovl->width) {
+ if (spudec_next_line (ovl) < 0)
+ break;
+ }
+ }
+
+ ovl->num_rle = rle - ovl->rle;
+ ovl->rgb_clut = 0;
+ ovl->unscaled = 0;
+#ifdef LOG_DEBUG
+ printf ("spu: Num RLE=%d\n",ovl->num_rle);
+ printf ("spu: Date size=%d\n",ovl->data_size);
+ printf ("spu: sizeof RLE=%d\n",sizeof(rle_elem_t));
+#endif
+}
+
+/* Heuristic to discover the colors used by the subtitles
+ and assign a "readable" pallete to them.
+ Currently looks for sequence of border-fg-border or
+ border1-border2-fg-border2-border1.
+ MINFOUND is the number of ocurrences threshold.
+*/
+#define MINFOUND 20
+static void spudec_discover_clut(xine_t *xine, spudec_state_t *state, vo_overlay_t *ovl)
+{
+ int bg,c;
+ int seqcolor[10];
+ int n,i;
+ rle_elem_t *rle;
+
+ int found[2][16] = { { 0, }, };
+
+ static const clut_t text_clut[] = {
+ CLUT_Y_CR_CB_INIT(0x80, 0x90, 0x80),
+ CLUT_Y_CR_CB_INIT(0x00, 0x90, 0x00),
+ CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00)
+ };
+
+ rle = ovl->rle;
+
+ /* this seems to be a problem somewhere else,
+ why rle is null? */
+ if( !rle )
+ return;
+
+ /* suppose the first and last pixels are bg */
+ if( rle[0].color != rle[ovl->num_rle-1].color )
+ return;
+
+ bg = rle[0].color;
+
+ i = 0;
+ for( n = 0; n < ovl->num_rle; n++ )
+ {
+ c = rle[n].color;
+
+ if( c == bg )
+ {
+ if( i == 3 && seqcolor[1] == seqcolor[3] )
+ {
+ found[0][seqcolor[2]]++;
+ if( found[0][seqcolor[2]] > MINFOUND )
+ {
+ memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[1],
+ sizeof(clut_t));
+ memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[2],
+ sizeof(clut_t));
+ ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]];
+ ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]];
+ state->need_clut = 0;
+ break;
+ }
+ }
+ if( i == 5 && seqcolor[1] == seqcolor[5]
+ && seqcolor[2] == seqcolor[4] )
+ {
+ found[1][seqcolor[3]]++;
+ if( found[1][seqcolor[3]] > MINFOUND )
+ {
+ memcpy(&state->clut[state->cur_colors[seqcolor[1]]], &text_clut[0],
+ sizeof(clut_t));
+ memcpy(&state->clut[state->cur_colors[seqcolor[2]]], &text_clut[1],
+ sizeof(clut_t));
+ memcpy(&state->clut[state->cur_colors[seqcolor[3]]], &text_clut[2],
+ sizeof(clut_t));
+ ovl->color[seqcolor[1]] = state->clut[state->cur_colors[seqcolor[1]]];
+ ovl->color[seqcolor[2]] = state->clut[state->cur_colors[seqcolor[2]]];
+ ovl->color[seqcolor[3]] = state->clut[state->cur_colors[seqcolor[3]]];
+ state->need_clut = 0;
+ break;
+ }
+ }
+ i = 0;
+ seqcolor[i] = c;
+ }
+ else if ( i < 6 )
+ {
+ i++;
+ seqcolor[i] = c;
+ }
+ }
+}
+
+#ifdef LOG_DEBUG
+static void spudec_print_overlay( vo_overlay_t *ovl ) {
+ printf ("spu: OVERLAY to show\n");
+ printf ("spu: \tx = %d y = %d width = %d height = %d\n",
+ ovl->x, ovl->y, ovl->width, ovl->height );
+ printf ("spu: \tclut [%x %x %x %x]\n",
+ ovl->color[0], ovl->color[1], ovl->color[2], ovl->color[3]);
+ printf ("spu: \ttrans [%d %d %d %d]\n",
+ ovl->trans[0], ovl->trans[1], ovl->trans[2], ovl->trans[3]);
+ printf ("spu: \tclip top=%d bottom=%d left=%d right=%d\n",
+ ovl->hili_top, ovl->hili_bottom, ovl->hili_left, ovl->hili_right);
+ printf ("spu: \tclip_clut [%x %x %x %x]\n",
+ ovl->hili_color[0], ovl->hili_color[1], ovl->hili_color[2], ovl->hili_color[3]);
+ printf ("spu: \thili_trans [%d %d %d %d]\n",
+ ovl->hili_trans[0], ovl->hili_trans[1], ovl->hili_trans[2], ovl->hili_trans[3]);
+ return;
+}
+#endif
+
+int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut,
+ int32_t button, int32_t mode, vo_overlay_t * overlay, vo_overlay_t * base ) {
+ btni_t *button_ptr = NULL;
+ unsigned int btns_per_group;
+ int i;
+
+ if((button <= 0) || (button > nav_pci->hli.hl_gi.btn_ns))
+ return 0;
+
+ btns_per_group = 36 / nav_pci->hli.hl_gi.btngr_ns;
+
+ /* choose button group: we can always use a normal 4:3 or widescreen button group
+ * as long as xine blends the overlay before scaling the image to its aspect */
+ if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 1 && !(nav_pci->hli.hl_gi.btngr1_dsp_ty & 6))
+ button_ptr = &nav_pci->hli.btnit[0 * btns_per_group + button - 1];
+ if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 2 && !(nav_pci->hli.hl_gi.btngr2_dsp_ty & 6))
+ button_ptr = &nav_pci->hli.btnit[1 * btns_per_group + button - 1];
+ if (!button_ptr && nav_pci->hli.hl_gi.btngr_ns >= 3 && !(nav_pci->hli.hl_gi.btngr3_dsp_ty & 6))
+ button_ptr = &nav_pci->hli.btnit[2 * btns_per_group + button - 1];
+ if (!button_ptr) {
+ xprintf(xine, XINE_VERBOSITY_DEBUG,
+ "libspudec: No suitable menu button group found, using group 1.\n");
+ button_ptr = &nav_pci->hli.btnit[button - 1];
+ }
+
+ /* button areas in the nav packet are in screen coordinates,
+ * overlay clipping areas are in overlay coordinates;
+ * therefore we must subtract the display coordinates of the underlying overlay */
+ overlay->hili_left = (button_ptr->x_start > base->x) ? (button_ptr->x_start - base->x) : 0;
+ overlay->hili_top = (button_ptr->y_start > base->y) ? (button_ptr->y_start - base->y) : 0;
+ overlay->hili_right = (button_ptr->x_end > base->x) ? (button_ptr->x_end - base->x) : 0;
+ overlay->hili_bottom = (button_ptr->y_end > base->y) ? (button_ptr->y_end - base->y) : 0;
+ if(button_ptr->btn_coln != 0) {
+#ifdef LOG_BUTTON
+ fprintf(stderr, "libspudec: normal button clut\n");
+#endif
+ for (i = 0;i < 4; i++) {
+ overlay->hili_color[i] = clut[0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (16 + 4*i))];
+ overlay->hili_trans[i] = 0xf & (nav_pci->hli.btn_colit.btn_coli[button_ptr->btn_coln-1][mode] >> (4*i));
+ }
+ } else {
+#ifdef LOG_BUTTON
+ fprintf(stderr, "libspudec: abnormal button clut\n");
+#endif
+ for (i = 0;i < 4; i++) {
+#ifdef LOG_BUTTON
+ printf("libspudec:btn_coln = 0, hili_color = colour\n");
+#endif
+ overlay->hili_color[i] = overlay->color[i];
+ overlay->hili_trans[i] = overlay->trans[i];
+ }
+ }
+
+ /* spudec_print_overlay( overlay ); */
+#ifdef LOG_BUTTON
+ printf("libspudec:xine_decoder.c:NAV to SPU pts match!\n");
+#endif
+
+ return 1;
+}
diff --git a/src/spu_dec/spudec.h b/src/spu_dec/spudec.h
new file mode 100644
index 000000000..225a87f13
--- /dev/null
+++ b/src/spu_dec/spudec.h
@@ -0,0 +1,146 @@
+/*
+ * Copyright (C) 2000-2004 the xine project
+ *
+ * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
+ *
+ * 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, USA
+ *
+ * This file was originally part of the OMS program.
+ */
+
+#ifndef __SPU_H__
+#define __SPU_H__
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <inttypes.h>
+#include <xine/video_out.h>
+#include <xine/video_overlay.h>
+#ifdef HAVE_DVDNAV
+# ifdef HAVE_DVDNAV_NAVTYPES_H
+# include <dvdnav/nav_types.h>
+# else
+# include <dvdread/nav_types.h>
+# endif
+#else
+# include "nav_types.h"
+#endif
+
+#define NUM_SEQ_BUFFERS 50
+#define MAX_STREAMS 32
+
+typedef struct spudec_clut_struct {
+#ifdef WORDS_BIGENDIAN
+ uint8_t entry0 : 4;
+ uint8_t entry1 : 4;
+ uint8_t entry2 : 4;
+ uint8_t entry3 : 4;
+#else
+ uint8_t entry1 : 4;
+ uint8_t entry0 : 4;
+ uint8_t entry3 : 4;
+ uint8_t entry2 : 4;
+#endif
+} spudec_clut_t;
+
+typedef struct {
+ uint8_t *buf;
+ uint32_t ra_offs; /* reassembly offset */
+ uint32_t seq_len;
+ uint32_t buf_len;
+ uint32_t cmd_offs;
+ int64_t pts; /* Base PTS of this sequence */
+ int32_t finished; /* Has this control sequence been finished? */
+ uint32_t complete; /* Has this reassembly been finished? */
+ uint32_t broken; /* this SPU is broken and should be dropped */
+} spudec_seq_t;
+
+typedef struct {
+ uint8_t *cmd_ptr;
+
+ uint32_t field_offs[2];
+ int32_t b_top, o_top;
+ int32_t b_bottom, o_bottom;
+ int32_t b_left, o_left;
+ int32_t b_right, o_right;
+
+ int32_t modified; /* Was the sub-picture modified? */
+ int32_t visible; /* Must the sub-picture be shown? */
+ int32_t forced_display; /* This overlay is a menu */
+ int32_t delay; /* Delay in 90Khz / 1000 */
+ int32_t need_clut; /* doesn't have the right clut yet */
+ int32_t cur_colors[4];/* current 4 colors been used */
+ int32_t vobsub; /* vobsub must be aligned to bottom */
+
+ uint32_t clut[16];
+} spudec_state_t;
+
+typedef struct spudec_stream_state_s {
+ spudec_seq_t ra_seq;
+ spudec_state_t state;
+ int64_t vpts;
+ int64_t pts;
+ int32_t overlay_handle;
+} spudec_stream_state_t;
+
+typedef struct {
+ spu_decoder_class_t decoder_class;
+} spudec_class_t;
+
+typedef struct pci_node_s pci_node_t;
+struct pci_node_s {
+ pci_t pci;
+ uint64_t vpts;
+ pci_node_t *next;
+};
+
+typedef struct spudec_decoder_s {
+ spu_decoder_t spu_decoder;
+
+ spudec_class_t *class;
+ xine_stream_t *stream;
+ spudec_stream_state_t spudec_stream_state[MAX_STREAMS];
+
+ video_overlay_event_t event;
+ video_overlay_object_t object;
+ int32_t menu_handle;
+
+ spudec_state_t state;
+
+ vo_overlay_t overlay;
+ int ovl_caps;
+ int output_open;
+ pthread_mutex_t nav_pci_lock;
+ pci_node_t pci_cur;
+ uint32_t buttonN; /* Current button number for highlights */
+ int32_t button_filter; /* Allow highlight changes or not */
+ int64_t last_event_vpts;
+} spudec_decoder_t;
+
+void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, u_int pkt_len);
+void spudec_process( spudec_decoder_t *this, int stream_id);
+/* the nav functions must be called with the nav_pci_lock held */
+void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf);
+void spudec_clear_nav_list(spudec_decoder_t *this);
+void spudec_update_nav(spudec_decoder_t *this);
+void spudec_process_nav(spudec_decoder_t *this);
+int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode,
+ vo_overlay_t * overlay, vo_overlay_t * base );
+
+#endif
diff --git a/src/spu_dec/spudvb_decoder.c b/src/spu_dec/spudvb_decoder.c
new file mode 100644
index 000000000..518903e01
--- /dev/null
+++ b/src/spu_dec/spudvb_decoder.c
@@ -0,0 +1,1218 @@
+/*
+ * Copyright (C) 2010 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, USA
+ *
+ * DVB Subtitle decoder (ETS 300 743)
+ * (c) 2004 Mike Lampard <mlampard@users.sourceforge.net>
+ * based on the application dvbsub by Dave Chapman
+ *
+ * TODO:
+ * - Implement support for teletext based subtitles
+ */
+
+#include <pthread.h>
+#include <errno.h>
+
+/*#define LOG*/
+#define LOG_MODULE "spudvb"
+
+#include <xine/xine_internal.h>
+#include <xine/spu.h>
+#include <xine/osd.h>
+
+#define MAX_REGIONS 7
+
+#define SPU_MAX_WIDTH 1920
+#define SPU_MAX_HEIGHT 1080
+
+typedef struct {
+ int x, y;
+ unsigned char is_visible;
+} visible_region_t;
+
+typedef struct {
+ int page_time_out;
+ int page_version_number;
+ int page_state;
+ int page_id;
+ visible_region_t regions[MAX_REGIONS];
+} page_t;
+
+typedef struct {
+ int version_number;
+ int width, height;
+ int empty;
+ int depth;
+ int CLUT_id;
+ int objects_start;
+ int objects_end;
+ unsigned int object_pos[65536];
+ unsigned char *img;
+ osd_object_t *osd;
+} region_t;
+
+typedef struct {
+/* dvbsub stuff */
+ int x;
+ int y;
+ unsigned int curr_obj;
+ unsigned int curr_reg[64];
+ uint8_t *buf;
+ int i;
+ int i_bits;
+ int in_scanline;
+ int compat_depth;
+ page_t page;
+ region_t regions[MAX_REGIONS];
+ clut_t colours[MAX_REGIONS*256];
+ unsigned char trans[MAX_REGIONS*256];
+ struct {
+ unsigned char lut24[4], lut28[4], lut48[16];
+ } lut[MAX_REGIONS];
+} dvbsub_func_t;
+
+typedef struct dvb_spu_class_s {
+ spu_decoder_class_t class;
+ xine_t *xine;
+
+ int ignore_pts;
+} dvb_spu_class_t;
+
+typedef struct dvb_spu_decoder_s {
+ spu_decoder_t spu_decoder;
+
+ dvb_spu_class_t *class;
+ xine_stream_t *stream;
+
+ spu_dvb_descriptor_t *spu_descriptor;
+
+ /* dvbsub_osd_mutex should be locked around all calls to this->osd_renderer->show()
+ and this->osd_renderer->hide() */
+ pthread_mutex_t dvbsub_osd_mutex;
+
+ char *pes_pkt;
+ char *pes_pkt_wrptr;
+ unsigned int pes_pkt_size;
+
+ int64_t vpts;
+ int64_t end_vpts;
+
+ pthread_t dvbsub_timer_thread;
+ struct timespec dvbsub_hide_timeout;
+ pthread_cond_t dvbsub_restart_timeout;
+ dvbsub_func_t *dvbsub;
+ int show;
+} dvb_spu_decoder_t;
+
+static clut_t default_clut[256];
+static unsigned char default_trans[256];
+static int default_colours_init = 0;
+
+static void reset_clut (dvbsub_func_t *dvbsub)
+{
+ int i, r;
+
+ /* Reset the colour LUTs */
+ for (r = 0; r < MAX_REGIONS; ++r)
+ {
+ memcpy (dvbsub->colours + r * 256, default_clut, sizeof (default_clut));
+ memcpy (dvbsub->trans + r * 256, default_trans, sizeof (default_trans));
+ }
+
+ /* Reset the colour index LUTs */
+ for (r = 0; r < MAX_REGIONS; ++r)
+ {
+ dvbsub->lut[r].lut24[0] = 0x0;
+ dvbsub->lut[r].lut24[1] = 0x7;
+ dvbsub->lut[r].lut24[2] = 0x8;
+ dvbsub->lut[r].lut24[3] = 0xF;
+ dvbsub->lut[r].lut28[0] = 0x00;
+ dvbsub->lut[r].lut28[1] = 0x77;
+ dvbsub->lut[r].lut28[2] = 0x88;
+ dvbsub->lut[r].lut28[3] = 0xFF;
+ for (i = 0; i < 16; ++i)
+ dvbsub->lut[r].lut48[i] = i | i << 4;
+ }
+}
+
+static void update_osd(dvb_spu_decoder_t *this, int region_id)
+{
+ dvbsub_func_t *dvbsub = this->dvbsub;
+ region_t *reg = &dvbsub->regions[region_id];
+
+ if ( !reg->img ) {
+ if ( reg->osd ) {
+ pthread_mutex_lock( &this->dvbsub_osd_mutex );
+ this->stream->osd_renderer->free_object( reg->osd );
+ reg->osd = NULL;
+ pthread_mutex_unlock( &this->dvbsub_osd_mutex );
+ }
+ return;
+ }
+
+ if ( reg->osd ) {
+ if ( reg->width!=reg->osd->width || reg->height!=reg->osd->height ) {
+ pthread_mutex_lock( &this->dvbsub_osd_mutex );
+ this->stream->osd_renderer->free_object( reg->osd );
+ reg->osd = NULL;
+ pthread_mutex_unlock( &this->dvbsub_osd_mutex );
+ }
+ }
+
+ if ( !reg->osd )
+ reg->osd = this->stream->osd_renderer->new_object( this->stream->osd_renderer, reg->width, reg->height );
+}
+
+static void update_region (dvb_spu_decoder_t * this, int region_id, int region_width, int region_height, int fill, int fill_color)
+{
+
+ dvbsub_func_t *dvbsub = this->dvbsub;
+ region_t *reg = &dvbsub->regions[region_id];
+
+ /* reject invalid sizes and set some limits ! */
+ if ( region_width<=0 || region_height<=0 || region_width>SPU_MAX_WIDTH || region_height>SPU_MAX_HEIGHT ) {
+ if ( reg->img ) {
+ free( reg->img );
+ reg->img = NULL;
+ }
+ lprintf("rejected region %d = %dx%d\n", region_id, region_width, region_height );
+ return;
+ }
+
+ if ( reg->width*reg->height<region_width*region_height ) {
+ lprintf("update size of region %d = %dx%d\n", region_id, region_width, region_height);
+ if ( reg->img ) {
+ free( reg->img );
+ reg->img = NULL;
+ }
+ }
+
+ if ( !reg->img ) {
+ if ( !(reg->img=xine_xmalloc(region_width*region_height)) ) {
+ lprintf( "can't allocate mem for region %d\n", region_id );
+ return;
+ }
+ fill = 1;
+ }
+
+ if ( fill ) {
+ memset( reg->img, fill_color, region_width*region_height );
+ reg->empty = 1;
+ lprintf("FILL REGION %d\n", region_id);
+ }
+ reg->width = region_width;
+ reg->height = region_height;
+}
+
+
+static void do_plot (dvb_spu_decoder_t * this, int r, int x, int y, unsigned char pixel)
+{
+ int i;
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ i = (y * dvbsub->regions[r].width) + x;
+ /* do some clipping */
+ if ( i<(dvbsub->regions[r].width*dvbsub->regions[r].height) ) {
+ dvbsub->regions[r].img[i] = pixel;
+ dvbsub->regions[r].empty = 0;
+ }
+}
+
+static void plot (dvb_spu_decoder_t * this, int r, int run_length, unsigned char pixel)
+{
+
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ int x2 = dvbsub->x + run_length;
+
+ while (dvbsub->x < x2) {
+ do_plot (this, r, dvbsub->x, dvbsub->y, pixel);
+ dvbsub->x++;
+ }
+}
+
+static const uint8_t *lookup_lut (const dvbsub_func_t *dvbsub, int r)
+{
+ static const uint8_t identity_lut[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
+
+ switch (dvbsub->compat_depth)
+ {
+ case 012: return dvbsub->lut[r].lut24;
+ case 013: return dvbsub->lut[r].lut28;
+ case 023: return dvbsub->lut[r].lut48;
+ default: return identity_lut;
+ }
+}
+
+static unsigned char next_datum (dvb_spu_decoder_t * this, int width)
+{
+ dvbsub_func_t *dvbsub = this->dvbsub;
+ unsigned char x = 0;
+
+ if (!dvbsub->i_bits)
+ dvbsub->i_bits = 8;
+
+ if (dvbsub->i_bits < width)
+ {
+ /* need to read from more than one byte; split it up */
+ width -= dvbsub->i_bits;
+ x = dvbsub->buf[dvbsub->i++] & ((1 << dvbsub->i_bits) - 1);
+ dvbsub->i_bits = 8;
+ return x << width | next_datum (this, width);
+ }
+
+ dvbsub->i_bits = (dvbsub->i_bits - width) & 7;
+ x = (dvbsub->buf[dvbsub->i] >> dvbsub->i_bits) & ((1 << width) - 1);
+
+ if (!dvbsub->i_bits)
+ ++dvbsub->i;
+
+ return x;
+}
+
+static void decode_2bit_pixel_code_string (dvb_spu_decoder_t * this, int r, int object_id, int ofs, int n)
+{
+ dvbsub_func_t *dvbsub = this->dvbsub;
+ int j;
+ const uint8_t *lut = lookup_lut (dvbsub, r);
+
+ if (dvbsub->in_scanline == 0)
+ dvbsub->in_scanline = 1;
+
+ dvbsub->i_bits = 0;
+ j = dvbsub->i + n;
+
+ while (dvbsub->i < j)
+ {
+ int next_bits = next_datum (this, 2);
+ int run_length;
+
+ if (next_bits)
+ {
+ /* single pixel */
+ plot (this, r, 1, lut[next_bits]);
+ continue;
+ }
+
+ /* switch 1 */
+ if (next_datum (this, 1) == 0)
+ {
+ /* run length, 3 to 10 pixels, colour given */
+ run_length = next_datum (this, 3);
+ plot (this, r, run_length + 3, lut[next_datum (this, 2)]);
+ continue;
+ }
+
+ /* switch 2 */
+ if (next_datum (this, 1) == 1)
+ {
+ /* single pixel, colour 0 */
+ plot (this, r, 1, lut[0]);
+ continue;
+ }
+
+ /* switch 3 */
+ switch (next_datum (this, 2))
+ {
+ case 0: /* end-of-string */
+ j = dvbsub->i; /* set the while cause FALSE */
+ break;
+ case 1: /* two pixels, colour 0 */
+ plot (this, r, 2, lut[0]);
+ break;
+ case 2: /* run length, 12 to 27 pixels (4-bit), colour given */
+ run_length = next_datum (this, 4);
+ plot (this, r, run_length + 12, lut[next_datum (this, 2)]);
+ break;
+ case 3: /* run length, 29 to 284 pixels (8-bit), colour given */
+ run_length = next_datum (this, 8);
+ plot (this, r, run_length + 29, lut[next_datum (this, 2)]);
+ }
+ }
+
+ if (dvbsub->i_bits) {
+ dvbsub->i++;
+ dvbsub->i_bits = 0;
+ }
+}
+
+static void decode_4bit_pixel_code_string (dvb_spu_decoder_t * this, int r, int object_id, int ofs, int n)
+{
+ dvbsub_func_t *dvbsub = this->dvbsub;
+ int j;
+ const uint8_t *lut = lookup_lut (dvbsub, r);
+
+ if (dvbsub->in_scanline == 0)
+ dvbsub->in_scanline = 1;
+
+ dvbsub->i_bits = 0;
+ j = dvbsub->i + n;
+
+ while (dvbsub->i < j)
+ {
+ int next_bits = next_datum (this, 4);
+ int run_length;
+
+ if (next_bits)
+ {
+ /* single pixel */
+ plot (this, r, 1, lut[next_bits]);
+ continue;
+ }
+
+ /* switch 1 */
+ if (next_datum (this, 1) == 0)
+ {
+ run_length = next_datum (this, 3);
+ if (!run_length)
+ /* end-of-string */
+ break;
+
+ /* run length, 3 to 9 pixels, colour 0 */
+ plot (this, r, run_length + 2, lut[0]);
+ continue;
+ }
+
+ /* switch 2 */
+ if (next_datum (this, 1) == 0)
+ {
+ /* run length, 4 to 7 pixels, colour given */
+ run_length = next_datum (this, 2);
+ plot (this, r, run_length + 4, lut[next_datum (this, 4)]);
+ continue;
+ }
+
+ /* switch 3 */
+ switch (next_datum (this, 2))
+ {
+ case 0: /* single pixel, colour 0 */
+ plot (this, r, 1, lut[0]);
+ break;
+ case 1: /* two pixels, colour 0 */
+ plot (this, r, 2, lut[0]);
+ break;
+ case 2: /* run length, 9 to 24 pixels (4-bit), colour given */
+ run_length = next_datum (this, 4);
+ plot (this, r, run_length + 9, lut[next_datum (this, 4)]);
+ break;
+ case 3: /* run length, 25 to 280 pixels (8-bit), colour given */
+ run_length = next_datum (this, 8);
+ plot (this, r, run_length + 25, lut[next_datum (this, 4)]);
+ }
+ }
+
+ if (dvbsub->i_bits) {
+ dvbsub->i++;
+ dvbsub->i_bits = 0;
+ }
+}
+
+static void decode_8bit_pixel_code_string (dvb_spu_decoder_t * this, int r, int object_id, int ofs, int n)
+{
+ dvbsub_func_t *dvbsub = this->dvbsub;
+ int j;
+
+ if (dvbsub->in_scanline == 0)
+ dvbsub->in_scanline = 1;
+
+ j = dvbsub->i + n;
+
+ while (dvbsub->i < j)
+ {
+ int next_bits = dvbsub->buf[dvbsub->i++];
+ int run_length;
+
+ if (next_bits)
+ {
+ /* single pixel */
+ plot (this, r, 1, next_bits);
+ continue;
+ }
+
+ /* switch 1 */
+ run_length = dvbsub->buf[dvbsub->i] & 127;
+
+ if (dvbsub->buf[dvbsub->i++] & 128)
+ {
+ /* run length, 3 to 127 pixels, colour given */
+ if (run_length > 2)
+ plot (this, r, run_length + 4, dvbsub->buf[dvbsub->i++]);
+ continue;
+ }
+
+ if (!run_length)
+ /* end-of-string */
+ break;
+
+ /* run length, 1 to 127 pixels, colour 0 */
+ plot (this, r, run_length + 2, 0);
+ }
+}
+
+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) {
+
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ if ((CLUT_id>=MAX_REGIONS) || (CLUT_entry_id>255)) {
+ return;
+ }
+
+ 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;
+ dvbsub->colours[(CLUT_id*256)+CLUT_entry_id].foo = T_value;
+}
+
+static void process_CLUT_definition_segment(dvb_spu_decoder_t *this) {
+ int page_id,
+ segment_length,
+ CLUT_id,
+ CLUT_version_number;
+
+ int CLUT_entry_id,
+ CLUT_flag_8_bit,
+ CLUT_flag_4_bit,
+ CLUT_flag_2_bit,
+ full_range_flag,
+ Y_value,
+ Cr_value,
+ Cb_value,
+ T_value;
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ int j;
+
+ page_id=(dvbsub->buf[dvbsub->i]<<8)|dvbsub->buf[dvbsub->i+1]; dvbsub->i+=2;
+ segment_length=(dvbsub->buf[dvbsub->i]<<8)|dvbsub->buf[dvbsub->i+1]; dvbsub->i+=2;
+ j=dvbsub->i+segment_length;
+
+ CLUT_id=dvbsub->buf[dvbsub->i++];
+ CLUT_version_number=(dvbsub->buf[dvbsub->i]&0xf0)>>4;
+ dvbsub->i++;
+
+ while (dvbsub->i < j) {
+ CLUT_entry_id=dvbsub->buf[dvbsub->i++];
+
+ CLUT_flag_2_bit=(dvbsub->buf[dvbsub->i]&0x80)>>7;
+ CLUT_flag_4_bit=(dvbsub->buf[dvbsub->i]&0x40)>>6;
+ CLUT_flag_8_bit=(dvbsub->buf[dvbsub->i]&0x20)>>5;
+ full_range_flag=dvbsub->buf[dvbsub->i]&1;
+ dvbsub->i++;
+
+ if (full_range_flag==1) {
+ Y_value=dvbsub->buf[dvbsub->i++];
+ Cr_value=dvbsub->buf[dvbsub->i++];
+ Cb_value=dvbsub->buf[dvbsub->i++];
+ T_value=dvbsub->buf[dvbsub->i++];
+ } else {
+ Y_value = dvbsub->buf[dvbsub->i] & 0xfc;
+ Cr_value = (dvbsub->buf[dvbsub->i] << 6 | dvbsub->buf[dvbsub->i + 1] >> 2) & 0xf0;
+ Cb_value = (dvbsub->buf[dvbsub->i + 1] << 2) & 0xf0;
+ T_value = (dvbsub->buf[dvbsub->i + 1] & 3) * 0x55; /* expand only this one to full range! */
+ dvbsub->i+=2;
+ }
+ set_clut(this, CLUT_id,CLUT_entry_id,Y_value,Cr_value,Cb_value,T_value);
+ }
+}
+
+static void process_pixel_data_sub_block (dvb_spu_decoder_t * this, int r, int o, int ofs, int n)
+{
+ int data_type;
+ int j;
+
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ j = dvbsub->i + n;
+
+ dvbsub->x = (dvbsub->regions[r].object_pos[o]) >> 16;
+ dvbsub->y = ((dvbsub->regions[r].object_pos[o]) & 0xffff) + ofs;
+ while (dvbsub->i < j) {
+ data_type = dvbsub->buf[dvbsub->i++];
+
+ switch (data_type) {
+ case 0:
+ dvbsub->i++;
+ case 0x10:
+ decode_2bit_pixel_code_string (this, r, o, ofs, n - 1);
+ break;
+ case 0x11:
+ decode_4bit_pixel_code_string (this, r, o, ofs, n - 1);
+ break;
+ case 0x12:
+ decode_8bit_pixel_code_string (this, r, o, ofs, n - 1);
+ break;
+ case 0x20: /* 2-to-4bit colour index map */
+ /* should this be implemented since we have an 8-bit overlay? */
+ dvbsub->lut[r].lut24[0] = dvbsub->buf[dvbsub->i ] >> 4;
+ dvbsub->lut[r].lut24[1] = dvbsub->buf[dvbsub->i ] & 0x0f;
+ dvbsub->lut[r].lut24[2] = dvbsub->buf[dvbsub->i + 1] >> 4;
+ dvbsub->lut[r].lut24[3] = dvbsub->buf[dvbsub->i + 1] & 0x0f;
+ dvbsub->i += 2;
+ break;
+ case 0x21: /* 2-to-8bit colour index map */
+ memcpy (dvbsub->lut[r].lut28, dvbsub->buf + dvbsub->i, 4);
+ dvbsub->i += 4;
+ break;
+ case 0x22:
+ memcpy (dvbsub->lut[r].lut48, dvbsub->buf + dvbsub->i, 16);
+ dvbsub->i += 16;
+ break;
+ case 0xf0:
+ dvbsub->in_scanline = 0;
+ dvbsub->x = (dvbsub->regions[r].object_pos[o]) >> 16;
+ dvbsub->y += 2;
+ break;
+ default:
+ lprintf ("unimplemented data_type %02x in pixel_data_sub_block\n", data_type);
+ }
+ }
+
+ dvbsub->i = j;
+}
+
+static void process_page_composition_segment (dvb_spu_decoder_t * this)
+{
+ int segment_length;
+ int region_id, region_x, region_y;
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ dvbsub->page.page_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ segment_length = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+
+ int j = dvbsub->i + segment_length;
+
+ dvbsub->page.page_time_out = dvbsub->buf[dvbsub->i++];
+ if ( dvbsub->page.page_time_out>6 ) /* some timeout are insane, e.g. 65s ! */
+ dvbsub->page.page_time_out = 6;
+
+ int version = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
+ if ( version == dvbsub->page.page_version_number )
+ return;
+ dvbsub->page.page_version_number = version;
+ dvbsub->page.page_state = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2;
+ dvbsub->i++;
+
+ int r;
+ for (r=0; r<MAX_REGIONS; r++) { /* reset */
+ dvbsub->page.regions[r].is_visible = 0;
+ }
+
+ while (dvbsub->i < j) {
+ region_id = dvbsub->buf[dvbsub->i++];
+ dvbsub->i++; /* reserved */
+ region_x = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ region_y = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+
+ dvbsub->page.regions[region_id].x = region_x;
+ dvbsub->page.regions[region_id].y = region_y;
+ dvbsub->page.regions[region_id].is_visible = 1;
+ }
+}
+
+
+static void process_region_composition_segment (dvb_spu_decoder_t * this)
+{
+ int segment_length,
+ region_id,
+ region_version_number,
+ region_fill_flag, region_width, region_height, region_level_of_compatibility, region_depth, CLUT_id, region_8_bit_pixel_code, region_4_bit_pixel_code, region_2_bit_pixel_code;
+ int object_id, object_type, object_provider_flag, object_x, object_y, foreground_pixel_code, background_pixel_code;
+ int j;
+ int o;
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ dvbsub->page.page_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ segment_length = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ j = dvbsub->i + segment_length;
+
+ region_id = dvbsub->buf[dvbsub->i++];
+ region_version_number = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
+ region_fill_flag = (dvbsub->buf[dvbsub->i] & 0x08) >> 3;
+ dvbsub->i++;
+ region_width = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ region_height = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ region_level_of_compatibility = (dvbsub->buf[dvbsub->i] & 0xe0) >> 5;
+ region_depth = (dvbsub->buf[dvbsub->i] & 0x1c) >> 2;
+ dvbsub->compat_depth = region_level_of_compatibility << 3 | region_depth;
+ dvbsub->i++;
+ CLUT_id = dvbsub->buf[dvbsub->i++];
+ region_8_bit_pixel_code = dvbsub->buf[dvbsub->i++];
+ region_4_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
+ region_2_bit_pixel_code = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2;
+ dvbsub->i++;
+
+ if(region_id>=MAX_REGIONS)
+ return;
+
+ if ( dvbsub->regions[region_id].version_number == region_version_number )
+ return;
+
+ dvbsub->regions[region_id].version_number = region_version_number;
+
+ /* Check if region size has changed and fill background. */
+ update_region (this, region_id, region_width, region_height, region_fill_flag, region_4_bit_pixel_code);
+ if ( CLUT_id<MAX_REGIONS )
+ dvbsub->regions[region_id].CLUT_id = CLUT_id;
+
+ dvbsub->regions[region_id].objects_start = dvbsub->i;
+ dvbsub->regions[region_id].objects_end = j;
+
+ for (o = 0; o < 65536; o++) {
+ dvbsub->regions[region_id].object_pos[o] = 0xffffffff;
+ }
+
+ while (dvbsub->i < j) {
+ object_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ object_type = (dvbsub->buf[dvbsub->i] & 0xc0) >> 6;
+ object_provider_flag = (dvbsub->buf[dvbsub->i] & 0x30) >> 4;
+ object_x = ((dvbsub->buf[dvbsub->i] & 0x0f) << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ object_y = ((dvbsub->buf[dvbsub->i] & 0x0f) << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+
+ dvbsub->regions[region_id].object_pos[object_id] = (object_x << 16) | object_y;
+
+ if ((object_type == 0x01) || (object_type == 0x02)) {
+ foreground_pixel_code = dvbsub->buf[dvbsub->i++];
+ background_pixel_code = dvbsub->buf[dvbsub->i++];
+ }
+ }
+
+}
+
+static void process_object_data_segment (dvb_spu_decoder_t * this)
+{
+ int segment_length, object_id, object_version_number, object_coding_method, non_modifying_colour_flag;
+
+ int top_field_data_block_length, bottom_field_data_block_length;
+
+ dvbsub_func_t *dvbsub = this->dvbsub;
+
+ int old_i;
+ int r;
+
+ dvbsub->page.page_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ segment_length = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+
+ object_id = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ dvbsub->curr_obj = object_id;
+ object_version_number = (dvbsub->buf[dvbsub->i] & 0xf0) >> 4;
+ object_coding_method = (dvbsub->buf[dvbsub->i] & 0x0c) >> 2;
+ non_modifying_colour_flag = (dvbsub->buf[dvbsub->i] & 0x02) >> 1;
+ dvbsub->i++;
+
+ old_i = dvbsub->i;
+ for (r = 0; r < MAX_REGIONS; r++) {
+
+ /* If this object is in this region... */
+ if (dvbsub->regions[r].img) {
+ if (dvbsub->regions[r].object_pos[object_id] != 0xffffffff) {
+ dvbsub->i = old_i;
+ if (object_coding_method == 0) {
+ top_field_data_block_length = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+ bottom_field_data_block_length = (dvbsub->buf[dvbsub->i] << 8) | dvbsub->buf[dvbsub->i + 1];
+ dvbsub->i += 2;
+
+ process_pixel_data_sub_block (this, r, object_id, 0, top_field_data_block_length);
+
+ if (bottom_field_data_block_length == 0)
+ {
+ /* handle bottom field == top field */
+ bottom_field_data_block_length = top_field_data_block_length;
+ dvbsub->i = old_i + 4;
+ }
+
+ process_pixel_data_sub_block (this, r, object_id, 1, bottom_field_data_block_length);
+ }
+ }
+ }
+ }
+}
+
+static void process_display_definition_segment(dvb_spu_decoder_t *this)
+{
+ /* FIXME: not implemented. */
+}
+
+static void unlock_mutex_cancellation_func(void *mutex_gen)
+{
+ pthread_mutex_t *mutex = (pthread_mutex_t*) mutex_gen;
+ pthread_mutex_unlock(mutex);
+}
+
+/* Thread routine that checks for subtitle timeout periodically.
+ To avoid unexpected subtitle hiding, calls to this->stream->osd_renderer->show()
+ should be in blocks like:
+
+ pthread_mutex_lock(&this->dvbsub_osd_mutex);
+ this->stream->osd_renderer->show(...);
+ this->dvbsub_hide_timeout.tv_sec = time(NULL) + timeout value;
+ pthread_cond_signal(&this->dvbsub_restart_timeout);
+ pthread_mutex_unlock(&this->dvbsub_osd_mutex);
+
+ This ensures that the timeout is changed with the lock held, and
+ that the thread is signalled to pick up the new timeout.
+*/
+static void* dvbsub_timer_func(void *this_gen)
+{
+ dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
+ pthread_mutex_lock(&this->dvbsub_osd_mutex);
+ int i;
+
+ /* If we're cancelled via pthread_cancel, unlock the mutex */
+ pthread_cleanup_push(unlock_mutex_cancellation_func, &this->dvbsub_osd_mutex);
+
+ while(1)
+ {
+ /* Record the current timeout, and wait - note that pthread_cond_timedwait
+ will unlock the mutex on entry, and lock it on exit */
+ struct timespec timeout = this->dvbsub_hide_timeout;
+ int result = pthread_cond_timedwait(&this->dvbsub_restart_timeout,
+ &this->dvbsub_osd_mutex,
+ &this->dvbsub_hide_timeout);
+ if(result == ETIMEDOUT &&
+ timeout.tv_sec == this->dvbsub_hide_timeout.tv_sec &&
+ timeout.tv_nsec == this->dvbsub_hide_timeout.tv_nsec)
+ {
+ /* We timed out, and no-one changed the timeout underneath us.
+ Hide the OSD, then wait until we're signalled. */
+ if(this && this->stream && this->stream->osd_renderer)
+ {
+ for ( i=0; i<MAX_REGIONS; i++ ) {
+ if ( this->dvbsub->regions[i].osd ) {
+ this->stream->osd_renderer->hide( this->dvbsub->regions[i].osd, 0 );
+ lprintf("thread hiding = %d\n",i);
+ }
+ }
+ }
+ pthread_cond_wait(&this->dvbsub_restart_timeout, &this->dvbsub_osd_mutex);
+ }
+ }
+
+ pthread_cleanup_pop(1);
+ return NULL;
+}
+
+static void downscale_region_image( region_t *reg, unsigned char *dest, int dest_width )
+{
+ float i, k, inc=reg->width/(float)dest_width;
+ int j;
+ for ( j=0; j<reg->height; j++ ) {
+ for ( i=0,k=0; i<reg->width && k<dest_width; i+=inc,k++ ) {
+ dest[(j*dest_width)+(int)k] = reg->img[(j*reg->width)+(int)i];
+ }
+ }
+}
+
+static void draw_subtitles (dvb_spu_decoder_t * this)
+{
+ int r;
+ int display=0;
+ int64_t dum;
+ int dest_width=0, dest_height, reg_width;
+ this->stream->video_out->status(this->stream->video_out, NULL, &dest_width, &dest_height, &dum);
+ unsigned char tmp[dest_width*576];
+ unsigned char *reg;
+
+ if ( !dest_width || !dest_height )
+ return;
+
+ /* render all regions onto the page */
+
+ for ( r=0; r<MAX_REGIONS; r++ ) {
+ if ( this->dvbsub->page.regions[r].is_visible )
+ display++;
+ }
+ if ( !display )
+ return;
+
+ for (r = 0; r < MAX_REGIONS; r++) {
+ if (this->dvbsub->regions[r].img) {
+ if (this->dvbsub->page.regions[r].is_visible && !this->dvbsub->regions[r].empty) {
+ update_osd( this, r );
+ if ( !this->dvbsub->regions[r].osd )
+ continue;
+ /* clear osd */
+ this->stream->osd_renderer->clear( this->dvbsub->regions[r].osd );
+ if ( this->dvbsub->regions[r].width>dest_width && !(this->stream->video_driver->get_capabilities(this->stream->video_driver) & VO_CAP_CUSTOM_EXTENT_OVERLAY)) {
+ downscale_region_image(&this->dvbsub->regions[r], tmp, dest_width);
+ reg = tmp;
+ reg_width = dest_width;
+ }
+ else {
+ reg = this->dvbsub->regions[r].img;
+ reg_width = this->dvbsub->regions[r].width;
+ }
+ this->stream->osd_renderer->set_palette( this->dvbsub->regions[r].osd, (uint32_t*)(&this->dvbsub->colours[this->dvbsub->regions[r].CLUT_id*256]), &this->dvbsub->trans[this->dvbsub->regions[r].CLUT_id*256]);
+ this->stream->osd_renderer->draw_bitmap( this->dvbsub->regions[r].osd, reg, 0, 0, reg_width, this->dvbsub->regions[r].height, NULL );
+ }
+ }
+ }
+
+ pthread_mutex_lock(&this->dvbsub_osd_mutex);
+ lprintf("this->vpts=%"PRId64"\n",this->vpts);
+ for ( r=0; r<MAX_REGIONS; r++ ) {
+ lprintf("region=%d, visible=%d, osd=%d, empty=%d\n", r, this->dvbsub->page.regions[r].is_visible, this->dvbsub->regions[r].osd?1:0, this->dvbsub->regions[r].empty );
+ if ( this->dvbsub->page.regions[r].is_visible && this->dvbsub->regions[r].osd && !this->dvbsub->regions[r].empty ) {
+ this->stream->osd_renderer->set_position( this->dvbsub->regions[r].osd, this->dvbsub->page.regions[r].x, this->dvbsub->page.regions[r].y );
+ this->stream->osd_renderer->show( this->dvbsub->regions[r].osd, this->vpts );
+ lprintf("show region = %d\n",r);
+ }
+ else {
+ if ( this->dvbsub->regions[r].osd ) {
+ this->stream->osd_renderer->hide( this->dvbsub->regions[r].osd, this->vpts );
+ lprintf("hide region = %d\n",r);
+ }
+ }
+ }
+ this->dvbsub_hide_timeout.tv_nsec = 0;
+ this->dvbsub_hide_timeout.tv_sec = time(NULL) + this->dvbsub->page.page_time_out;
+ lprintf("page_time_out %d\n",this->dvbsub->page.page_time_out);
+ pthread_cond_signal(&this->dvbsub_restart_timeout);
+ pthread_mutex_unlock(&this->dvbsub_osd_mutex);
+}
+
+static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf)
+{
+ dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
+ int new_i;
+ int data_identifier, subtitle_stream_id;
+ int segment_length, segment_type;
+ int PES_packet_length;
+ int i;
+
+ if((buf->type & 0xffff0000)!=BUF_SPU_DVB)
+ return;
+
+ if (buf->decoder_flags & BUF_FLAG_SPECIAL) {
+ if (buf->decoder_info[1] == BUF_SPECIAL_SPU_DVB_DESCRIPTOR) {
+ if (buf->decoder_info[2] == 0) {
+ /* Hide the osd - note that if the timeout thread times out, it'll rehide, which is harmless */
+ pthread_mutex_lock(&this->dvbsub_osd_mutex);
+ for ( i=0; i<MAX_REGIONS; i++ ) {
+ if ( this->dvbsub->regions[i].osd )
+ this->stream->osd_renderer->hide( this->dvbsub->regions[i].osd, 0 );
+ }
+ pthread_mutex_unlock(&this->dvbsub_osd_mutex);
+ }
+ else {
+ xine_fast_memcpy (this->spu_descriptor, buf->decoder_info_ptr[2], buf->decoder_info[2]);
+ }
+ }
+ return;
+ }
+
+ /* accumulate data */
+ if (buf->decoder_info[2]) {
+ memset (this->pes_pkt, 0xff, 64*1024);
+ this->pes_pkt_wrptr = this->pes_pkt;
+ this->pes_pkt_size = buf->decoder_info[2];
+
+ xine_fast_memcpy (this->pes_pkt, buf->content, buf->size);
+ this->pes_pkt_wrptr += buf->size;
+
+ this->vpts = 0;
+ }
+ else {
+ if (this->pes_pkt && (this->pes_pkt_wrptr != this->pes_pkt)) {
+ xine_fast_memcpy (this->pes_pkt_wrptr, buf->content, buf->size);
+ this->pes_pkt_wrptr += buf->size;
+ }
+ }
+
+ /* don't ask metronom for a vpts but rather do the calculation
+ * because buf->pts could be too far in future and metronom won't accept
+ * further backwards pts (see metronom_got_spu_packet) */
+ if (!this->class->ignore_pts && buf->pts > 0) {
+ metronom_t *metronom = this->stream->metronom;
+ int64_t vpts_offset = metronom->get_option( metronom, METRONOM_VPTS_OFFSET );
+ int64_t spu_offset = metronom->get_option( metronom, METRONOM_SPU_OFFSET );
+ int64_t vpts = (int64_t)(buf->pts)+vpts_offset+spu_offset;
+ metronom_clock_t *clock = this->stream->xine->clock;
+ int64_t curvpts = clock->get_current_time( clock );
+ /* if buf->pts is unreliable, show page asap (better than nothing) */
+ lprintf("spu_vpts=%"PRId64" - current_vpts=%"PRId64"\n", vpts, curvpts);
+ if ( vpts<=curvpts || (vpts-curvpts)>(5*90000) )
+ this->vpts = 0;
+ else
+ this->vpts = vpts;
+ }
+
+ /* completely ignore pts since it makes a lot of problems with various providers */
+ /* this->vpts = 0; */
+
+ /* process the pes section */
+
+ PES_packet_length = this->pes_pkt_size;
+
+ this->dvbsub->buf = this->pes_pkt;
+
+ this->dvbsub->i = 0;
+
+ data_identifier = this->dvbsub->buf[this->dvbsub->i++];
+ subtitle_stream_id = this->dvbsub->buf[this->dvbsub->i++];
+
+ while (this->dvbsub->i <= (PES_packet_length)) {
+ /* SUBTITLING SEGMENT */
+ this->dvbsub->i++;
+ segment_type = this->dvbsub->buf[this->dvbsub->i++];
+
+ this->dvbsub->page.page_id = (this->dvbsub->buf[this->dvbsub->i] << 8) | this->dvbsub->buf[this->dvbsub->i + 1];
+ segment_length = (this->dvbsub->buf[this->dvbsub->i + 2] << 8) | this->dvbsub->buf[this->dvbsub->i + 3];
+ new_i = this->dvbsub->i + segment_length + 4;
+
+ /* only process complete segments */
+ if(new_i > (this->pes_pkt_wrptr - this->pes_pkt))
+ break;
+ /* verify we've the right segment */
+ if(this->dvbsub->page.page_id==this->spu_descriptor->comp_page_id){
+ /* SEGMENT_DATA_FIELD */
+ switch (segment_type & 0xff) {
+ case 0x10:
+ process_page_composition_segment (this);
+ break;
+ case 0x11:
+ process_region_composition_segment (this);
+ break;
+ case 0x12:
+ process_CLUT_definition_segment(this);
+ break;
+ case 0x13:
+ process_object_data_segment (this);
+ break;
+ case 0x14:
+ process_display_definition_segment(this);
+ break;
+ case 0x80: /* Page is now completely rendered */
+ recalculate_trans(this);
+ draw_subtitles( this );
+ break;
+ case 0xFF: /* stuffing */
+ break;
+ default:
+ return;
+ break;
+ }
+ }
+ this->dvbsub->i = new_i;
+ }
+}
+
+static void spudec_reset (spu_decoder_t * this_gen)
+{
+ dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
+ int i;
+
+ /* Hide the osd - if the timeout thread times out, it'll rehide harmlessly */
+ pthread_mutex_lock(&this->dvbsub_osd_mutex);
+ for ( i=0; i<MAX_REGIONS; i++ ) {
+ if ( this->dvbsub->regions[i].osd )
+ this->stream->osd_renderer->hide(this->dvbsub->regions[i].osd, 0);
+ this->dvbsub->regions[i].version_number = -1;
+ }
+ this->dvbsub->page.page_version_number = -1;
+ reset_clut (this->dvbsub);
+
+ pthread_mutex_unlock(&this->dvbsub_osd_mutex);
+}
+
+static void spudec_discontinuity (spu_decoder_t * this_gen)
+{
+ /* do nothing */
+}
+
+static void spudec_dispose (spu_decoder_t * this_gen)
+{
+ dvb_spu_decoder_t *this = (dvb_spu_decoder_t *) this_gen;
+ int i;
+
+ pthread_cancel(this->dvbsub_timer_thread);
+ pthread_join(this->dvbsub_timer_thread, NULL);
+ pthread_mutex_destroy(&this->dvbsub_osd_mutex);
+ pthread_cond_destroy(&this->dvbsub_restart_timeout);
+
+ if(this->spu_descriptor){
+ free(this->spu_descriptor);
+ this->spu_descriptor=NULL;
+ }
+
+ for ( i=0; i<MAX_REGIONS; i++ ) {
+ if ( this->dvbsub->regions[i].img )
+ free( this->dvbsub->regions[i].img );
+ if ( this->dvbsub->regions[i].osd )
+ this->stream->osd_renderer->free_object( this->dvbsub->regions[i].osd );
+ }
+
+ if (this->pes_pkt)
+ free (this->pes_pkt);
+
+ if (this->dvbsub)
+ free (this->dvbsub);
+
+ free (this);
+}
+
+static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen, xine_stream_t * stream)
+{
+ dvb_spu_decoder_t *this = calloc(1, sizeof (dvb_spu_decoder_t));
+ dvb_spu_class_t *class = (dvb_spu_class_t *)class_gen;
+
+#define YUVA(r, g, b, a) (clut_t) { COMPUTE_V(r, g, b), COMPUTE_U(r, g, b), COMPUTE_V(r, g, b), a }
+#define GETBIT(s, v1, v2, tr) \
+ r = s + ((i & 1) ? v1 : 0) + ((i & 0x10) ? v2 : 0); \
+ g = s + ((i & 2) ? v1 : 0) + ((i & 0x20) ? v2 : 0); \
+ b = s + ((i & 4) ? v1 : 0) + ((i & 0x40) ? v2 : 0); \
+ a = tr
+
+ if (!default_colours_init)
+ {
+ int i;
+ default_clut[0] = YUVA(0, 0, 0, 0);
+ for (i = 1; i < 256; i++) {
+ uint8_t r, g, b, a;
+ if (i < 8) {
+ GETBIT(0, 255, 0, 63);
+ } else switch (i & 0x88) {
+ case 0x00: GETBIT( 0, 85, 170, 255); break;
+ case 0x08: GETBIT( 0, 85, 170, 127); break;
+ case 0x80: GETBIT(127, 43, 85, 255); break;
+ default : GETBIT( 0, 43, 85, 255); break;
+ }
+ default_trans[i] = a;
+ default_clut[i] = YUVA(r, g, b, a);
+ }
+ default_colours_init = 1;
+ }
+
+
+ this->spu_decoder.decode_data = spudec_decode_data;
+ this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
+ this->spu_decoder.dispose = spudec_dispose;
+ this->spu_decoder.get_interact_info = NULL;
+ this->spu_decoder.set_button = NULL;
+
+ this->class = class;
+ this->stream = stream;
+
+ this->pes_pkt = calloc(65, 1024);
+ this->spu_descriptor = calloc(1, sizeof(spu_dvb_descriptor_t));
+
+ this->dvbsub = calloc(1, sizeof (dvbsub_func_t));
+
+ int i;
+ for (i = 0; i < MAX_REGIONS; i++) {
+ this->dvbsub->page.regions[i].is_visible = 0;
+ this->dvbsub->regions[i].img = NULL;
+ this->dvbsub->regions[i].osd = NULL;
+ 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;
+ this->dvbsub_hide_timeout.tv_sec = time(NULL);
+ pthread_create(&this->dvbsub_timer_thread, NULL, dvbsub_timer_func, this);
+
+ return (spu_decoder_t *) this;
+}
+
+static void dvb_spu_decoder_class_dispose (spu_decoder_class_t * this_gen)
+{
+ dvb_spu_class_t *this = (dvb_spu_class_t *) this_gen;
+
+ this->xine->config->unregister_callback(this->xine->config, "subtitles.dvb.ignore_pts");
+
+ free (this);
+}
+
+static void *init_spu_decoder_plugin (xine_t * xine, void *data)
+{
+
+ dvb_spu_class_t *this;
+ this = calloc(1, sizeof (dvb_spu_class_t));
+
+ this->class.open_plugin = dvb_spu_class_open_plugin;
+ this->class.identifier = "spudvb";
+ this->class.description = N_("DVB subtitle decoder plugin");
+ this->class.dispose = dvb_spu_decoder_class_dispose;
+
+ this->xine = xine;
+
+ return &this->class;
+}
+
+
+/* plugin catalog information */
+static const uint32_t supported_types[] = { BUF_SPU_DVB, 0 };
+
+static const decoder_info_t spudec_info = {
+ supported_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+/* type, API, "name", version, special_info, init_function */
+ {PLUGIN_SPU_DECODER, 17, "spudvb", XINE_VERSION_CODE, &spudec_info,
+ &init_spu_decoder_plugin},
+ {PLUGIN_NONE, 0, "", 0, NULL, NULL}
+};
diff --git a/src/spu_dec/spuhdmv_decoder.c b/src/spu_dec/spuhdmv_decoder.c
new file mode 100644
index 000000000..85d35aec5
--- /dev/null
+++ b/src/spu_dec/spuhdmv_decoder.c
@@ -0,0 +1,1072 @@
+/*
+ * Copyright (C) 2000-2009 the xine project
+ *
+ * Copyright (C) 2009 Petri Hintukainen <phintuka@users.sourceforge.net>
+ *
+ * This file is part of xine, a unix 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, USA
+ *
+ * Decoder for HDMV/BluRay bitmap subtitles
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <inttypes.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include <xine/video_out.h>
+#include <xine/video_overlay.h>
+
+#define XINE_HDMV_TRACE(x...) printf(x)
+/*#define XINE_HDMV_TRACE(x...) */
+#define XINE_HDMV_ERROR(x...) fprintf(stderr, "spuhdmv: " x)
+/*#define XINE_HDMV_ERROR(x...) lprintf(x) */
+
+#ifndef MAX
+# define MAX(a,b) (a>b)?(a):(b)
+#endif
+
+enum {
+ SEGTYPE_PALETTE = 0x14,
+ SEGTYPE_OBJECT = 0x15,
+ SEGTYPE_PRESENTATION_SEGMENT = 0x16,
+ SEGTYPE_WINDOW_DEFINITION = 0x17,
+ SEGTYPE_INTERACTIVE = 0x18,
+ SEGTYPE_END_OF_DISPLAY = 0x80,
+} eSegmentType;
+
+/*
+ * cached palette (xine-lib format)
+ */
+typedef struct subtitle_clut_s subtitle_clut_t;
+struct subtitle_clut_s {
+ uint8_t id;
+ uint32_t color[256];
+ uint8_t trans[256];
+ subtitle_clut_t *next;
+
+ int shown;
+};
+
+/*
+ * cached RLE image (xine-lib format)
+ */
+typedef struct subtitle_object_s subtitle_object_t;
+struct subtitle_object_s {
+ uint16_t id;
+ uint16_t xpos, ypos;
+ uint16_t width, height;
+
+ /* xine format */
+ rle_elem_t *rle;
+ unsigned int num_rle;
+ size_t data_size;
+
+ /* HDMV format (used when object does not fit to single segment) */
+ uint32_t data_len; /* size of complete object */
+ uint8_t *raw_data; /* partial RLE data in HDMV format */
+ size_t raw_data_len; /* bytes buffered */
+ size_t raw_data_size; /* allocated size */
+
+ subtitle_object_t *next;
+
+ int shown;
+};
+
+/*
+ * Window definition
+ */
+typedef struct window_def_s window_def_t;
+struct window_def_s {
+ uint8_t id;
+ uint16_t xpos, ypos;
+ uint16_t width, height;
+
+ window_def_t *next;
+
+ int shown;
+};
+
+
+/*
+ * decoded SPU
+ */
+typedef struct composition_object_s composition_object_t;
+struct composition_object_s {
+ uint8_t window_id_ref;
+ uint16_t object_id_ref;
+
+ uint16_t xpos, ypos;
+
+ uint8_t forced_flag;
+ uint8_t cropped_flag;
+ uint16_t crop_horiz_pos, crop_vert_pos;
+ uint16_t crop_width, crop_height;
+
+ composition_object_t *next;
+
+ int shown;
+};
+
+typedef struct composition_descriptor_s composition_descriptor_t;
+struct composition_descriptor_s {
+ uint16_t number;
+ uint8_t state;
+};
+
+typedef struct presentation_segment_s presentation_segment_t;
+struct presentation_segment_s {
+ composition_descriptor_t comp_descr;
+
+ uint8_t palette_update_flag;
+ uint8_t palette_id_ref;
+ uint8_t object_number;
+
+ composition_object_t *comp_objs;
+
+ presentation_segment_t *next;
+
+ int64_t pts;
+ int shown;
+};
+
+/*
+ * list handling
+ */
+
+#define LIST_REPLACE(list, obj, FREE_FUNC) \
+ do { \
+ unsigned int id = obj->id; \
+ \
+ /* insert to list */ \
+ obj->next = list; \
+ list = obj; \
+ \
+ /* remove old */ \
+ while (obj->next && obj->next->id != id) \
+ obj = obj->next; \
+ if (obj->next) { \
+ void *tmp = (void*)obj->next; \
+ obj->next = obj->next->next; \
+ FREE_FUNC(tmp); \
+ } \
+ } while (0);
+
+#define LIST_DESTROY(list, FREE_FUNC) \
+ while (list) { \
+ void *tmp = (void*)list; \
+ list = list->next; \
+ FREE_FUNC(tmp); \
+ }
+
+static void free_subtitle_object(void *ptr)
+{
+ if (ptr) {
+ free(((subtitle_object_t*)ptr)->rle);
+ free(((subtitle_object_t*)ptr)->raw_data);
+ free(ptr);
+ }
+}
+static void free_presentation_segment(void *ptr)
+{
+ if (ptr) {
+ presentation_segment_t *seg = (presentation_segment_t*)ptr;
+ LIST_DESTROY(seg->comp_objs, free);
+ free(ptr);
+ }
+}
+
+
+/*
+ * segment_buffer_t
+ *
+ * assemble and decode segments
+ */
+
+typedef struct {
+ /* current segment */
+ int segment_len; /* length of current segment (without 3-byte header) */
+ uint8_t segment_type; /* current segment type */
+ uint8_t *segment_data; /* pointer to current segment payload */
+ uint8_t *segment_end; /* pointer to last byte + 1 of current segment */
+ uint8_t error; /* boolean: buffer overflow etc. */
+
+ /* accumulated data */
+ uint8_t *buf; /* */
+ size_t len; /* count of unprocessed bytes */
+ size_t data_size; /* allocated buffer size */
+} segment_buffer_t;
+
+/*
+ * mgmt
+ */
+
+static segment_buffer_t *segbuf_init(void)
+{
+ segment_buffer_t *buf = calloc(1, sizeof(segment_buffer_t));
+ return buf;
+}
+
+static void segbuf_dispose(segment_buffer_t *buf)
+{
+ if (buf->buf)
+ free (buf->buf);
+ free (buf);
+}
+
+static void segbuf_reset(segment_buffer_t *buf)
+{
+ buf->segment_end = buf->segment_data = buf->buf;
+ buf->len = 0;
+ buf->segment_len = -1;
+ buf->segment_type = 0;
+ buf->error = 0;
+}
+
+/*
+ * assemble, parse
+ */
+
+static void segbuf_parse_segment_header(segment_buffer_t *buf)
+{
+ if (buf->len > 2) {
+ buf->segment_type = buf->buf[0];
+ buf->segment_len = (buf->buf[1] << 8) | buf->buf[2];
+ buf->segment_data = buf->buf + 3;
+ buf->segment_end = buf->segment_data + buf->segment_len;
+ buf->error = 0;
+
+ if ( buf->segment_type < 0x14 ||
+ ( buf->segment_type > 0x18 &&
+ buf->segment_type != 0x80)) {
+ XINE_HDMV_ERROR("unknown segment type 0x%02x, resetting\n", buf->segment_type);
+ segbuf_reset(buf);
+ }
+ } else {
+ buf->segment_len = -1;
+ buf->error = 1;
+ }
+}
+
+static void segbuf_fill(segment_buffer_t *buf, uint8_t *data, size_t len)
+{
+ if (buf->len + len > buf->data_size) {
+ buf->data_size = buf->len + len;
+ if (buf->buf)
+ buf->buf = realloc(buf->buf, buf->data_size);
+ else
+ buf->buf = malloc(buf->data_size);
+ }
+
+ memcpy(buf->buf + buf->len, data, len);
+ buf->len += len;
+
+ segbuf_parse_segment_header(buf);
+}
+
+static int segbuf_segment_complete(segment_buffer_t *buf)
+{
+ return (buf->segment_len >= 0) && (buf->len >= (unsigned)buf->segment_len + 3);
+}
+
+static void segbuf_skip_segment(segment_buffer_t *buf)
+{
+ if (segbuf_segment_complete (buf)) {
+ buf->len -= buf->segment_len + 3;
+ if (buf->len > 0)
+ memmove(buf->buf, buf->buf + buf->segment_len + 3, buf->len);
+
+ segbuf_parse_segment_header(buf);
+
+ XINE_HDMV_TRACE(" skip_segment: %zd bytes left\n", buf->len);
+ } else {
+ XINE_HDMV_ERROR(" skip_segment: ERROR - %zd bytes queued, %d required\n",
+ buf->len, buf->segment_len);
+ segbuf_reset (buf);
+ }
+}
+
+/*
+ * access segment data
+ */
+
+static uint8_t segbuf_segment_type(segment_buffer_t *buf)
+{
+ return buf->segment_type;
+}
+
+static size_t segbuf_data_length(segment_buffer_t *buf)
+{
+ ssize_t val = buf->segment_end - buf->segment_data;
+ if (val < 0) val = 0;
+ return (size_t)val;
+}
+
+static uint8_t segbuf_get_u8(segment_buffer_t *buf)
+{
+ if (!(buf->error = ++buf->segment_data > buf->segment_end))
+ return buf->segment_data[-1];
+ XINE_HDMV_ERROR("segbuf_get_u8: read failed (end of segment reached) !\n");
+ return 0;
+}
+
+static uint16_t segbuf_get_u16(segment_buffer_t *buf)
+{
+ return (segbuf_get_u8(buf) << 8) | segbuf_get_u8(buf);
+}
+
+static uint32_t segbuf_get_u24(segment_buffer_t *buf)
+{
+ return (segbuf_get_u8(buf) << 16) | (segbuf_get_u8(buf) << 8) | segbuf_get_u8(buf);
+}
+
+/*
+ * decode segments
+ */
+
+static subtitle_clut_t *segbuf_decode_palette(segment_buffer_t *buf)
+{
+ uint8_t palette_id = segbuf_get_u8 (buf);
+ uint8_t palette_version_number = segbuf_get_u8 (buf);
+
+ size_t len = segbuf_data_length(buf);
+ size_t entries = len / 5;
+ size_t i;
+
+ if (buf->error)
+ return NULL;
+
+ if (len % 5) {
+ XINE_HDMV_ERROR(" decode_palette: segment size error (%zd ; expected %zd for %zd entries)\n",
+ len, (5 * entries), entries);
+ return NULL;
+ }
+ XINE_HDMV_TRACE("decode_palette: %zd items (id %d, version %d)\n",
+ entries, palette_id, palette_version_number);
+
+ /* convert to xine-lib clut */
+ subtitle_clut_t *clut = calloc(1, sizeof(subtitle_clut_t));
+ clut->id = palette_id;
+
+ for (i = 0; i < entries; i++) {
+ uint8_t index = segbuf_get_u8 (buf);
+ uint8_t Y = segbuf_get_u8 (buf);
+ uint8_t Cr = segbuf_get_u8 (buf);
+ uint8_t Cb = segbuf_get_u8 (buf);
+ uint8_t alpha = segbuf_get_u8 (buf);
+ clut->color[index] = (Y << 16) | (Cr << 8) | Cb;
+ clut->trans[index] = alpha >> 4;
+ }
+
+ return clut;
+}
+
+static int segbuf_decode_rle(segment_buffer_t *buf, subtitle_object_t *obj)
+{
+ int x = 0, y = 0;
+ int rle_size = sizeof(rle_elem_t) * obj->width / 16 * obj->height + 1;
+ rle_elem_t *rlep = malloc(rle_size);
+
+ free (obj->rle);
+ obj->rle = rlep;
+ obj->data_size = rle_size;
+ obj->num_rle = 0;
+
+ /* convert to xine-lib rle format */
+ while (y < obj->height && !buf->error) {
+
+ /* decode RLE element */
+ uint8_t byte = segbuf_get_u8 (buf);
+ if (byte != 0) {
+ rlep->color = byte;
+ rlep->len = 1;
+ } else {
+ byte = segbuf_get_u8 (buf);
+ if (!(byte & 0x80)) {
+ rlep->color = 0;
+ if (!(byte & 0x40))
+ rlep->len = byte & 0x3f;
+ else
+ rlep->len = ((byte & 0x3f) << 8) | segbuf_get_u8 (buf);
+ } else {
+ if (!(byte & 0x40))
+ rlep->len = byte & 0x3f;
+ else
+ rlep->len = ((byte & 0x3f) << 8) | segbuf_get_u8 (buf);
+ rlep->color = segbuf_get_u8 (buf);
+ }
+ }
+
+ /* move to next element */
+ if (rlep->len > 0) {
+ x += rlep->len;
+ rlep++;
+ obj->num_rle ++;
+ } else {
+ /* end of line marker (00 00) */
+ if (x < obj->width) {
+ rlep->len = obj->width - x;
+ rlep->color = 0xff;
+ rlep++;
+ obj->num_rle ++;
+ }
+ x = 0;
+ y++;
+ }
+
+ /* grow allocated RLE data size ? */
+ if (obj->data_size <= (obj->num_rle + 1) * sizeof(rle_elem_t)) {
+ obj->data_size *= 2;
+ obj->rle = realloc(obj->rle, obj->data_size);
+ rlep = obj->rle + obj->num_rle;
+ }
+ }
+
+ return buf->error;
+}
+
+static subtitle_object_t *segbuf_decode_object(segment_buffer_t *buf, subtitle_object_t *objects)
+{
+ uint16_t object_id = segbuf_get_u16(buf);
+ uint8_t version = segbuf_get_u8 (buf);
+ uint8_t seq_desc = segbuf_get_u8 (buf);
+
+ XINE_HDMV_TRACE(" decode_object: object_id %d, version %d, seq 0x%x\n",
+ object_id, version, seq_desc);
+
+ if (seq_desc & 0x80) {
+ /* new object (first-in-sequence flag set) */
+
+ subtitle_object_t *obj = calloc(1, sizeof(subtitle_object_t));
+
+ obj->id = object_id;
+ obj->data_len = segbuf_get_u24(buf);
+ obj->width = segbuf_get_u16(buf);
+ obj->height = segbuf_get_u16(buf);
+
+ if (buf->error) {
+ XINE_HDMV_TRACE(" decode error at object header\n");
+ free_subtitle_object(obj);
+ return NULL;
+ }
+
+ obj->data_len -= 4; /* width, height parsed */
+
+ XINE_HDMV_TRACE(" object length %d bytes, size %dx%d\n", obj->data_len, obj->width, obj->height);
+
+ if (obj->data_len > segbuf_data_length(buf)) {
+ XINE_HDMV_TRACE(" object length %d bytes, have only %zd bytes -> missing %d bytes\n",
+ obj->data_len, segbuf_data_length(buf), obj->data_len - (int)segbuf_data_length(buf));
+
+ if (obj->raw_data)
+ free(obj->raw_data);
+
+ /* store partial RLE data in HDMV format */
+ obj->raw_data_len = segbuf_data_length(buf);
+ obj->raw_data_size = MAX(obj->data_len, obj->raw_data_len);
+ obj->raw_data = malloc(obj->raw_data_size);
+ memcpy(obj->raw_data, buf->segment_data, obj->raw_data_len);
+
+ return obj;
+ }
+
+ segbuf_decode_rle (buf, obj);
+
+ if (buf->error) {
+ XINE_HDMV_TRACE(" decode error at RLE data\n");
+ free_subtitle_object(obj);
+ return NULL;
+ }
+
+ return obj;
+ }
+
+ /* not first-of-sequence --> append data to already existing objct */
+
+ /* search for object */
+ while (objects && objects->id != object_id)
+ objects = objects->next;
+
+ if (!objects) {
+ XINE_HDMV_TRACE(" object not found from list, discarding segment\n");
+ return NULL;
+ }
+
+ /* store partial RLE data in HDMV format */
+ if (objects->raw_data_size < objects->raw_data_len + segbuf_data_length(buf)) {
+ XINE_HDMV_ERROR("object larger than object size !\n");
+ return NULL;
+ }
+ memcpy(objects->raw_data + objects->raw_data_len, buf->segment_data, segbuf_data_length(buf));
+ objects->raw_data_len += segbuf_data_length(buf);
+
+ /* if complete, decode RLE data */
+ if (objects->raw_data_len >= objects->data_len) {
+ /* create dummy buffer for segbuf_decode_rle */
+ segment_buffer_t tmpbuf = {
+ .segment_data = objects->raw_data,
+ .segment_end = objects->raw_data + objects->raw_data_len,
+ };
+
+ /* decode RLE data */
+ segbuf_decode_rle (&tmpbuf, objects);
+
+ if (tmpbuf.error) {
+ XINE_HDMV_TRACE(" error decoding multi-segment object\n");
+ }
+
+ /* free decode buffer */
+ free(objects->raw_data);
+ objects->raw_data = NULL;
+ objects->raw_data_len = 0;
+ objects->raw_data_size = 0;
+ }
+
+ return NULL;
+}
+
+static window_def_t *segbuf_decode_window_definition(segment_buffer_t *buf)
+{
+ window_def_t *wnd = calloc(1, sizeof(window_def_t));
+
+ uint8_t a = segbuf_get_u8 (buf);
+ wnd->id = segbuf_get_u8 (buf);
+ wnd->xpos = segbuf_get_u16 (buf);
+ wnd->ypos = segbuf_get_u16 (buf);
+ wnd->width = segbuf_get_u16 (buf);
+ wnd->height = segbuf_get_u16 (buf);
+
+ XINE_HDMV_TRACE(" window: [%02x %d] %d,%d %dx%d\n", a,
+ wnd->id, wnd->xpos, wnd->ypos, wnd->width, wnd->height);
+
+ if (buf->error) {
+ free(wnd);
+ return NULL;
+ }
+
+ return wnd;
+}
+
+static int segbuf_decode_video_descriptor(segment_buffer_t *buf)
+{
+ uint16_t width = segbuf_get_u16(buf);
+ uint16_t height = segbuf_get_u16(buf);
+ uint8_t frame_rate = segbuf_get_u8 (buf);
+
+ XINE_HDMV_TRACE(" video_descriptor: %dx%d fps %d\n", width, height, frame_rate);
+
+ return buf->error;
+}
+
+static int segbuf_decode_composition_descriptor(segment_buffer_t *buf, composition_descriptor_t *descr)
+{
+ descr->number = segbuf_get_u16(buf);
+ descr->state = segbuf_get_u8 (buf) & 0xc0;
+
+ XINE_HDMV_TRACE(" composition_descriptor: number %d, state %d\n", descr->number, descr->state);
+ return buf->error;
+}
+
+static composition_object_t *segbuf_decode_composition_object(segment_buffer_t *buf)
+{
+ composition_object_t *cobj = calloc(1, sizeof(composition_object_t));
+
+ cobj->object_id_ref = segbuf_get_u16 (buf);
+ cobj->window_id_ref = segbuf_get_u8 (buf);
+ uint8_t tmp = segbuf_get_u8 (buf);
+ cobj->cropped_flag = !!(tmp & 0x80);
+ cobj->forced_flag = !!(tmp & 0x40);
+ cobj->xpos = segbuf_get_u16 (buf);
+ cobj->ypos = segbuf_get_u16 (buf);
+ if (cobj->cropped_flag) {
+ /* x,y where to take the image from */
+ cobj->crop_horiz_pos = segbuf_get_u8 (buf);
+ cobj->crop_vert_pos = segbuf_get_u8 (buf);
+ /* size of the cropped image */
+ cobj->crop_width = segbuf_get_u8 (buf);
+ cobj->crop_height = segbuf_get_u8 (buf);
+ }
+
+ if (buf->error) {
+ free(cobj);
+ return NULL;
+ }
+
+ XINE_HDMV_TRACE(" composition_object: id: %d, win: %d, position %d,%d crop %d forced %d\n",
+ cobj->object_id_ref, cobj->window_id_ref, cobj->xpos, cobj->ypos,
+ cobj->cropped_flag, cobj->forced_flag);
+
+ return cobj;
+}
+
+static presentation_segment_t *segbuf_decode_presentation_segment(segment_buffer_t *buf)
+{
+ presentation_segment_t *seg = calloc(1, sizeof(presentation_segment_t));
+ int index;
+
+ segbuf_decode_video_descriptor (buf);
+ segbuf_decode_composition_descriptor (buf, &seg->comp_descr);
+
+ seg->palette_update_flag = !!((segbuf_get_u8(buf)) & 0x80);
+ seg->palette_id_ref = segbuf_get_u8 (buf);
+ seg->object_number = segbuf_get_u8 (buf);
+
+ XINE_HDMV_TRACE(" presentation_segment: object_number %d, palette %d\n",
+ seg->object_number, seg->palette_id_ref);
+
+ for (index = 0; index < seg->object_number; index++) {
+ composition_object_t *cobj = segbuf_decode_composition_object (buf);
+ cobj->next = seg->comp_objs;
+ seg->comp_objs = cobj;
+ }
+
+ if (buf->error) {
+ free_presentation_segment(seg);
+ return NULL;
+ }
+
+ return seg;
+}
+
+static rle_elem_t *copy_crop_rle(subtitle_object_t *obj, composition_object_t *cobj)
+{
+ /* TODO: cropping (w,h sized image from pos x,y) */
+
+ rle_elem_t *rle = calloc (obj->num_rle, sizeof(rle_elem_t));
+ memcpy (rle, obj->rle, obj->num_rle * sizeof(rle_elem_t));
+ return rle;
+}
+
+
+/*
+ * xine plugin
+ */
+
+typedef struct {
+ spu_decoder_class_t decoder_class;
+} spuhdmv_class_t;
+
+typedef struct spuhdmv_decoder_s {
+ spu_decoder_t spu_decoder;
+
+ spuhdmv_class_t *class;
+ xine_stream_t *stream;
+
+ segment_buffer_t *buf;
+
+ subtitle_clut_t *cluts;
+ subtitle_object_t *objects;
+ window_def_t *windows;
+ presentation_segment_t *segments;
+
+ int overlay_handles[MAX_OBJECTS];
+
+ int64_t pts;
+
+} spuhdmv_decoder_t;
+
+static void free_objs(spuhdmv_decoder_t *this)
+{
+ LIST_DESTROY (this->cluts, free);
+ LIST_DESTROY (this->objects, free_subtitle_object);
+ LIST_DESTROY (this->windows, free);
+ LIST_DESTROY (this->segments, free_presentation_segment);
+}
+
+static int decode_palette(spuhdmv_decoder_t *this)
+{
+ /* decode */
+ subtitle_clut_t *clut = segbuf_decode_palette(this->buf);
+ if (!clut)
+ return 1;
+
+ LIST_REPLACE (this->cluts, clut, free);
+
+ return 0;
+}
+
+static int decode_object(spuhdmv_decoder_t *this)
+{
+ /* decode */
+ subtitle_object_t *obj = segbuf_decode_object(this->buf, this->objects);
+ if (!obj)
+ return 1;
+
+ LIST_REPLACE (this->objects, obj, free_subtitle_object);
+
+ return 0;
+}
+
+static int decode_window_definition(spuhdmv_decoder_t *this)
+{
+ /* decode */
+ window_def_t *wnd = segbuf_decode_window_definition (this->buf);
+ if (!wnd)
+ return 1;
+
+ LIST_REPLACE (this->windows, wnd, free);
+
+ return 0;
+}
+
+static int decode_presentation_segment(spuhdmv_decoder_t *this)
+{
+ /* decode */
+ presentation_segment_t *seg = segbuf_decode_presentation_segment(this->buf);
+ if (!seg)
+ return 1;
+
+ seg->pts = this->pts;
+
+ /* epoch start or acquistion point -> drop cached objects */
+ if (seg->comp_descr.state) {
+ free_objs(this);
+ }
+
+ /* replace */
+ if (this->segments)
+ LIST_DESTROY(this->segments, free_presentation_segment);
+ this->segments = seg;
+
+ return 0;
+}
+
+static int show_overlay(spuhdmv_decoder_t *this, composition_object_t *cobj, unsigned int palette_id_ref,
+ int overlay_index, int64_t pts, int force_update)
+{
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager(this->stream->video_out);
+ metronom_t *metronom = this->stream->metronom;
+ video_overlay_event_t event = {0};
+ vo_overlay_t overlay = {0};
+
+ /* find palette */
+ subtitle_clut_t *clut = this->cluts;
+ while (clut && clut->id != palette_id_ref)
+ clut = clut->next;
+ if (!clut) {
+ XINE_HDMV_TRACE(" show_overlay: clut %d not found !\n", palette_id_ref);
+ return -1;
+ }
+
+ /* find RLE image */
+ subtitle_object_t *obj = this->objects;
+ while (obj && obj->id != cobj->object_id_ref)
+ obj = obj->next;
+ if (!obj) {
+ XINE_HDMV_TRACE(" show_overlay: object %d not found !\n", cobj->object_id_ref);
+ return -1;
+ }
+ if (!obj->rle) {
+ XINE_HDMV_TRACE(" show_overlay: object %d RLE data not decoded !\n", cobj->object_id_ref);
+ return -1;
+ }
+
+ /* find window */
+ window_def_t *wnd = this->windows;
+ while (wnd && wnd->id != cobj->window_id_ref)
+ wnd = wnd->next;
+ if (!wnd) {
+ XINE_HDMV_TRACE(" show_overlay: window %d not found !\n", cobj->window_id_ref);
+ return -1;
+ }
+
+ /* do not show again if all elements are unchanged */
+ if (!force_update && clut->shown && obj->shown && wnd->shown && cobj->shown)
+ return 0;
+ clut->shown = obj->shown = wnd->shown = cobj->shown = 1;
+
+ /* copy palette to xine overlay */
+ overlay.rgb_clut = 0;
+ memcpy(overlay.color, clut->color, sizeof(uint32_t) * 256);
+ memcpy(overlay.trans, clut->trans, sizeof(uint8_t) * 256);
+
+ /* copy and crop RLE image to xine overlay */
+ overlay.width = obj->width;
+ overlay.height = obj->height;
+
+ overlay.rle = copy_crop_rle (obj, cobj);
+ overlay.num_rle = obj->num_rle;
+ overlay.data_size = obj->num_rle * sizeof(rle_elem_t);
+
+ /* */
+
+ overlay.x = /*wnd->xpos +*/ cobj->xpos;
+ overlay.y = /*wnd->ypos +*/ cobj->ypos;
+
+ overlay.unscaled = 0;
+ overlay.hili_top = -1;
+ overlay.hili_bottom = -1;
+ overlay.hili_left = -1;
+ overlay.hili_right = -1;
+
+ XINE_HDMV_TRACE(" -> overlay: %d,%d %dx%d\n",
+ overlay.x, overlay.y, overlay.width, overlay.height);
+
+
+ /* set timings */
+
+ if (pts > 0)
+ event.vpts = metronom->got_spu_packet (metronom, pts);
+ else
+ event.vpts = 0;
+
+
+ /* generate SHOW event */
+
+ this->stream->video_out->enable_ovl(this->stream->video_out, 1);
+
+ if (this->overlay_handles[overlay_index] < 0)
+ this->overlay_handles[overlay_index] = ovl_manager->get_handle(ovl_manager, 0);
+
+ event.event_type = OVERLAY_EVENT_SHOW;
+ event.object.handle = this->overlay_handles[overlay_index];
+ event.object.overlay = &overlay;
+ event.object.object_type = 0; /* subtitle */
+
+ ovl_manager->add_event (ovl_manager, (void *)&event);
+
+ return 0;
+}
+
+static void hide_overlays(spuhdmv_decoder_t *this, int64_t pts)
+{
+ video_overlay_event_t event = {0};
+ int i = 0;
+
+ while (this->overlay_handles[i] >= 0) {
+ XINE_HDMV_TRACE(" -> HIDE %d\n", i);
+
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager(this->stream->video_out);
+ metronom_t *metronom = this->stream->metronom;
+
+ event.object.handle = this->overlay_handles[i];
+ if (this)
+ event.vpts = metronom->got_spu_packet (metronom, pts);
+ else
+ event.vpts = 0;
+ event.event_type = OVERLAY_EVENT_HIDE;
+ event.object.overlay = NULL;
+ ovl_manager->add_event (ovl_manager, (void *)&event);
+
+ //this->overlay_handles[i] = -1;
+ i++;
+ }
+}
+
+static void update_overlays(spuhdmv_decoder_t *this)
+{
+ presentation_segment_t *pseg = this->segments;
+
+ while (pseg) {
+
+ if (!pseg->object_number) {
+
+ /* HIDE */
+ if (!pseg->shown)
+ hide_overlays (this, pseg->pts);
+
+ } else {
+
+ /* SHOW */
+ composition_object_t *cobj = pseg->comp_objs;
+ int i;
+
+ for (i = 0; i < pseg->object_number; i++) {
+ if (!cobj) {
+ XINE_HDMV_ERROR("show_overlays: composition object %d missing !\n", i);
+ } else {
+ show_overlay(this, cobj, pseg->palette_id_ref, i, pseg->pts, !pseg->shown);
+ cobj = cobj->next;
+ }
+ }
+ }
+
+ pseg->shown = 1;
+
+ pseg = pseg->next;
+ }
+}
+
+static void decode_segment(spuhdmv_decoder_t *this)
+{
+ XINE_HDMV_TRACE("*** new segment, pts %010"PRId64": 0x%02x (%8d bytes)\n",
+ this->pts, this->buf->segment_type, this->buf->segment_len);
+
+ switch (segbuf_segment_type(this->buf)) {
+ case SEGTYPE_PALETTE:
+ XINE_HDMV_TRACE(" segment: PALETTE\n");
+ decode_palette(this);
+ break;
+ case SEGTYPE_OBJECT:
+ XINE_HDMV_TRACE(" segment: OBJECT\n");
+ decode_object(this);
+ break;
+ case SEGTYPE_PRESENTATION_SEGMENT:
+ XINE_HDMV_TRACE(" segment: PRESENTATION SEGMENT\n");
+ decode_presentation_segment(this);
+ break;
+ case SEGTYPE_WINDOW_DEFINITION:
+ XINE_HDMV_TRACE(" segment: WINDOW DEFINITION\n");
+ decode_window_definition(this);
+ break;
+ case SEGTYPE_INTERACTIVE:
+ XINE_HDMV_TRACE(" segment: INTERACTIVE\n");
+ break;
+ case SEGTYPE_END_OF_DISPLAY:
+ XINE_HDMV_TRACE(" segment: END OF DISPLAY\n");
+#if 0
+ /* drop all cached objects */
+ free_objs(this);
+#endif
+ break;
+ default:
+ XINE_HDMV_ERROR(" segment type 0x%x unknown, skipping\n", segbuf_segment_type(this->buf));
+ break;
+ }
+ if (this->buf->error) {
+ XINE_HDMV_ERROR("*** DECODE ERROR ***\n");
+ }
+
+ update_overlays (this);
+}
+
+static void close_osd(spuhdmv_decoder_t *this)
+{
+ video_overlay_manager_t *ovl_manager = this->stream->video_out->get_overlay_manager (this->stream->video_out);
+
+ int i = 0;
+ while (this->overlay_handles[i] >= 0) {
+ ovl_manager->free_handle(ovl_manager, this->overlay_handles[i]);
+ this->overlay_handles[i] = -1;
+ i++;
+ }
+}
+
+static void spudec_decode_data (spu_decoder_t * this_gen, buf_element_t * buf)
+{
+ spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
+
+ if ((buf->type & 0xffff0000) != BUF_SPU_HDMV)
+ return;
+
+ if (buf->size < 1)
+ return;
+
+ if (buf->pts)
+ this->pts = buf->pts;
+
+#ifdef DUMP_SPU_DATA
+ int i;
+ for(i = 0; i < buf->size; i++)
+ printf(" %02x", buf->content[i]);
+ printf("\n");
+#endif
+
+ segbuf_fill(this->buf, buf->content, buf->size);
+
+ while (segbuf_segment_complete(this->buf)) {
+ decode_segment(this);
+ segbuf_skip_segment(this->buf);
+ }
+}
+
+static void spudec_reset (spu_decoder_t * this_gen)
+{
+ spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
+
+ if (this->buf)
+ segbuf_reset(this->buf);
+
+ free_objs(this);
+
+ close_osd(this);
+}
+
+static void spudec_discontinuity (spu_decoder_t *this_gen)
+{
+ spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
+
+ close_osd(this);
+}
+
+static void spudec_dispose (spu_decoder_t *this_gen)
+{
+ spuhdmv_decoder_t *this = (spuhdmv_decoder_t *) this_gen;
+
+ close_osd (this);
+ segbuf_dispose (this->buf);
+
+ free_objs(this);
+
+ free (this);
+}
+
+static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream)
+{
+ spuhdmv_decoder_t *this;
+
+ this = (spuhdmv_decoder_t *) calloc(1, sizeof (spuhdmv_decoder_t));
+
+ this->spu_decoder.decode_data = spudec_decode_data;
+ this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
+ this->spu_decoder.dispose = spudec_dispose;
+ this->spu_decoder.get_interact_info = NULL;
+ this->spu_decoder.set_button = NULL;
+ this->stream = stream;
+ this->class = (spuhdmv_class_t *) class_gen;
+
+ this->buf = segbuf_init();
+
+ memset(this->overlay_handles, 0xff, sizeof(this->overlay_handles)); /* --> -1 */
+
+ return &this->spu_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data)
+{
+ spuhdmv_class_t *this;
+
+ this = calloc(1, sizeof (spuhdmv_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "spuhdmv";
+ this->decoder_class.description = "HDMV/BluRay bitmap SPU decoder plugin";
+ this->decoder_class.dispose = default_spu_decoder_class_dispose;
+
+ return this;
+}
+
+/* plugin catalog information */
+static const uint32_t supported_types[] = { BUF_SPU_HDMV, 0 };
+
+static const decoder_info_t dec_info_data = {
+ supported_types, /* supported types */
+ 5 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_SPU_DECODER, 17, "spuhdmv", XINE_VERSION_CODE, &dec_info_data, &init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/spu_dec/sputext_decoder.c b/src/spu_dec/sputext_decoder.c
new file mode 100644
index 000000000..0eb42d665
--- /dev/null
+++ b/src/spu_dec/sputext_decoder.c
@@ -0,0 +1,1211 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <ctype.h>
+
+#define LOG_MODULE "libsputext"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/buffer.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/osd.h>
+
+#define SUB_MAX_TEXT 5 /* lines */
+#define SUB_BUFSIZE 256 /* chars per line */
+
+/* alignment in SSA codes */
+#define ALIGN_LEFT 1
+#define ALIGN_CENTER 2
+#define ALIGN_RIGHT 3
+#define ALIGN_BOTTOM 0
+#define ALIGN_TOP 4
+#define ALIGN_MIDDLE 8
+#define GET_X_ALIGNMENT(a) ((a) & 3)
+#define GET_Y_ALIGNMENT(a) ((a) - ((a) & 3))
+
+/* subtitles projection */
+/* for subrip file with SSA tags, those values are always correct.*/
+/* But for SSA files, those values are the default ones. we have */
+/* to use PlayResX and PlayResY defined in [Script Info] section. */
+/* not implemented yet... */
+#define SPU_PROJECTION_X 384
+#define SPU_PROJECTION_Y 288
+
+
+
+#define rgb2yuv(R,G,B) ((((((66*R+129*G+25*B+128)>>8)+16)<<8)|(((112*R-94*G-18*B+128)>>8)+128))<<8|(((-38*R-74*G+112*B+128)>>8)+128))
+
+static const uint32_t sub_palette[22]={
+/* RED */
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(50,10,10),
+ rgb2yuv(120,20,20),
+ rgb2yuv(185,50,50),
+ rgb2yuv(255,70,70),
+/* BLUE */
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,0,0),
+ rgb2yuv(0,30,50),
+ rgb2yuv(0,90,120),
+ rgb2yuv(0,140,185),
+ rgb2yuv(0,170,255)
+};
+
+static const uint8_t sub_trans[22]={
+ 0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15,
+ 0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15
+};
+
+typedef enum {
+ SUBTITLE_SIZE_TINY = 0,
+ SUBTITLE_SIZE_SMALL,
+ SUBTITLE_SIZE_NORMAL,
+ SUBTITLE_SIZE_LARGE,
+ SUBTITLE_SIZE_VERY_LARGE,
+ SUBTITLE_SIZE_HUGE,
+
+ SUBTITLE_SIZE_NUM /* number of values in enum */
+} subtitle_size;
+
+#define FONTNAME_SIZE 100
+
+typedef struct sputext_class_s {
+ spu_decoder_class_t class;
+
+ subtitle_size subtitle_size; /* size of subtitles */
+ int vertical_offset;
+ char font[FONTNAME_SIZE]; /* subtitle font */
+#ifdef HAVE_FT2
+ char font_ft[FILENAME_MAX]; /* subtitle font */
+ int use_font_ft; /* use Freetype */
+#endif
+ const char *src_encoding; /* encoding of subtitle file */
+ int use_unscaled; /* use unscaled OSD if possible */
+
+ xine_t *xine;
+
+} sputext_class_t;
+
+
+/* Convert subtiles coordinates in window coordinates. */
+/* (a, b) --> (x + a * dx, y + b * dy) */
+typedef struct video2wnd_s {
+ int x;
+ int y;
+ double dx;
+ double dy;
+} video2wnd_t;
+
+typedef struct sputext_decoder_s {
+ spu_decoder_t spu_decoder;
+
+ sputext_class_t *class;
+ xine_stream_t *stream;
+
+ int ogm;
+ int lines;
+ char text[SUB_MAX_TEXT][SUB_BUFSIZE];
+
+ /* below 3 variables are the same from class. use to detect
+ * when something changes.
+ */
+ subtitle_size subtitle_size; /* size of subtitles */
+ int vertical_offset;
+ char font[FILENAME_MAX]; /* subtitle font */
+ char *buf_encoding; /* encoding of subtitle buffer */
+
+ int width; /* frame width */
+ int height; /* frame height */
+ int font_size;
+ int line_height;
+ int started;
+ int finished;
+
+ osd_renderer_t *renderer;
+ osd_object_t *osd;
+ int current_osd_text;
+ uint32_t spu_palette[OVL_PALETTE_SIZE];
+ uint8_t spu_trans[OVL_PALETTE_SIZE];
+
+ int64_t img_duration;
+ int64_t last_subtitle_end; /* no new subtitle before this vpts */
+ int unscaled; /* use unscaled OSD */
+
+ int last_y; /* location of the previous subtitle */
+ int last_lines; /* number of lines of the previous subtitle */
+ video2wnd_t video2wnd;
+} sputext_decoder_t;
+
+static inline char *get_font (sputext_class_t *class)
+{
+#ifdef HAVE_FT2
+ return class->use_font_ft ? class->font_ft : class->font;
+#else
+ return class->font;
+#endif
+}
+
+static void update_font_size (sputext_decoder_t *this, int force_update) {
+ static const int sizes[SUBTITLE_SIZE_NUM] = { 16, 20, 24, 32, 48, 64 };
+
+ if ((this->subtitle_size != this->class->subtitle_size) ||
+ (this->vertical_offset != this->class->vertical_offset) ||
+ force_update) {
+
+ this->subtitle_size = this->class->subtitle_size;
+ this->vertical_offset = this->class->vertical_offset;
+ this->last_lines = 0;
+
+ this->font_size = sizes[this->class->subtitle_size];
+
+ this->line_height = this->font_size + 10;
+
+ /* Create a full-window OSD */
+ if( this->osd )
+ this->renderer->free_object (this->osd);
+
+ this->osd = this->renderer->new_object (this->renderer,
+ this->width,
+ this->height);
+
+ this->renderer->set_font (this->osd, get_font (this->class), this->font_size);
+
+ this->renderer->set_position (this->osd, 0, 0);
+ }
+}
+
+static void update_output_size (sputext_decoder_t *this) {
+ const int unscaled = this->class->use_unscaled &&
+ (this->stream->video_out->get_capabilities(this->stream->video_out) &
+ VO_CAP_UNSCALED_OVERLAY);
+
+ if( unscaled != this->unscaled ) {
+ this->unscaled = unscaled;
+ this->width = 0; /* force update */
+ }
+
+ /* initialize decoder if needed */
+ if( this->unscaled ) {
+ if( this->width != this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_WINDOW_WIDTH) ||
+ this->height != this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_WINDOW_HEIGHT) ||
+ !this->img_duration || !this->osd ) {
+
+ int width = 0, height = 0;
+
+ this->stream->video_out->status(this->stream->video_out, NULL,
+ &width, &height, &this->img_duration );
+ if( width && height ) {
+
+ this->width = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_WINDOW_WIDTH);
+ this->height = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_WINDOW_HEIGHT);
+
+ if(!this->osd || (this->width && this->height)) {
+
+ /* in unscaled mode, we have to convert subtitle position in window coordinates. */
+ /* we have a scale factor because video may be zommed */
+ /* and a displacement factor because video may have blacks lines. */
+ int output_width, output_height, output_xoffset, output_yoffset;
+
+ output_width = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_OUTPUT_WIDTH);
+ output_height = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_OUTPUT_HEIGHT);
+ output_xoffset = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_OUTPUT_XOFFSET);
+ output_yoffset = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_OUTPUT_YOFFSET);
+
+ /* driver don't seen to be capable to give us those values */
+ /* fallback to a default full-window values */
+ if (output_width <= 0 || output_height <= 0) {
+ output_width = this->width;
+ output_height = this->height;
+ output_xoffset = 0;
+ output_yoffset = 0;
+ }
+
+ this->video2wnd.x = output_xoffset;
+ this->video2wnd.y = output_yoffset;
+ this->video2wnd.dx = (double)output_width / SPU_PROJECTION_X;
+ this->video2wnd.dy = (double)output_height / SPU_PROJECTION_Y;
+
+ this->renderer = this->stream->osd_renderer;
+ update_font_size (this, 1);
+ }
+ }
+ }
+ } else {
+ if( !this->width || !this->height || !this->img_duration || !this->osd ) {
+
+ this->width = 0;
+ this->height = 0;
+
+ this->stream->video_out->status(this->stream->video_out, NULL,
+ &this->width, &this->height, &this->img_duration );
+
+ if(!this->osd || ( this->width && this->height)) {
+ this->renderer = this->stream->osd_renderer;
+
+ /* in scaled mode, we have to convert subtitle position in film coordinates. */
+ this->video2wnd.x = 0;
+ this->video2wnd.y = 0;
+ this->video2wnd.dx = (double)this->width / SPU_PROJECTION_X;
+ this->video2wnd.dy = (double)this->height / SPU_PROJECTION_Y;
+
+ update_font_size (this, 1);
+ }
+ }
+ }
+}
+
+static int parse_utf8_size(const void *buf)
+{
+ const uint8_t *c = buf;
+ if ( c[0]<0x80 )
+ return 1;
+
+ if( c[1]==0 )
+ return 1;
+ if ( (c[0]>=0xC2 && c[0]<=0xDF) && (c[1]>=0x80 && c[1]<=0xBF) )
+ return 2;
+
+ if( c[2]==0 )
+ return 2;
+ else if ( c[0]==0xE0 && (c[1]>=0xA0 && c[1]<=0xBF) && (c[2]>=0x80 && c[1]<=0xBF) )
+ return 3;
+ else if ( (c[0]>=0xE1 && c[0]<=0xEC) && (c[1]>=0x80 && c[1]<=0xBF) && (c[2]>=0x80 && c[1]<=0xBF) )
+ return 3;
+ else if ( c[0]==0xED && (c[1]>=0x80 && c[1]<=0x9F) && (c[2]>=0x80 && c[1]<=0xBF) )
+ return 3;
+ else if ( c[0]==0xEF && (c[1]>=0xA4 && c[1]<=0xBF) && (c[2]>=0x80 && c[1]<=0xBF) )
+ return 3;
+ else
+ return 1;
+}
+
+static int ogm_render_line_internal(sputext_decoder_t *this, int x, int y, const char *text, int render)
+{
+ const size_t length = strlen (text);
+ size_t i = 0;
+
+ while (i <= length) {
+
+ if (text[i] == '<') {
+ if (!strncmp("<b>", text+i, 3)) {
+ /* enable Bold color */
+ if (render)
+ this->current_osd_text = OSD_TEXT2;
+ i=i+3;
+ continue;
+ } else if (!strncmp("</b>", text+i, 4)) {
+ /* disable BOLD */
+ if (render)
+ this->current_osd_text = OSD_TEXT1;
+ i=i+4;
+ continue;
+ } else if (!strncmp("<i>", text+i, 3)) {
+ /* enable italics color */
+ if (render)
+ this->current_osd_text = OSD_TEXT3;
+ i=i+3;
+ continue;
+ } else if (!strncmp("</i>", text+i, 4)) {
+ /* disable italics */
+ if (render)
+ this->current_osd_text = OSD_TEXT1;
+ i=i+4;
+ continue;
+ } else if (!strncmp("<font>", text+i, 6)) {
+ /*Do somethink to disable typing
+ fixme - no teststreams*/
+ i=i+6;
+ continue;
+ } else if (!strncmp("</font>", text+i, 7)) {
+ /*Do somethink to enable typing
+ fixme - no teststreams*/
+ i=i+7;
+ continue;
+ }
+ }
+ if (text[i] == '{') {
+
+ if (!strncmp("{\\", text+i, 2)) {
+ int value;
+
+ if (sscanf(text+i, "{\\b%d}", &value) == 1) {
+ if (render) {
+ if (value)
+ this->current_osd_text = OSD_TEXT2;
+ else
+ this->current_osd_text = OSD_TEXT1;
+ }
+ } else if (sscanf(text+i, "{\\i%d}", &value) == 1) {
+ if (render) {
+ if (value)
+ this->current_osd_text = OSD_TEXT3;
+ else
+ this->current_osd_text = OSD_TEXT1;
+ }
+ }
+ char *const end = strstr(text+i+2, "}");
+ if (end) {
+ i=end-text+1;
+ continue;
+ }
+ }
+ }
+
+ char letter[5];
+ const char *const encoding = this->buf_encoding ? : this->class->src_encoding;
+ const int isutf8 = !strcmp(encoding, "utf-8");
+ const size_t shift = isutf8 ? parse_utf8_size (&text[i]) : 1;
+ memcpy(letter,&text[i],shift);
+ letter[shift]=0;
+
+ if (render)
+ this->renderer->render_text(this->osd, x, y, letter, this->current_osd_text);
+
+ int w, dummy;
+ this->renderer->get_text_size(this->osd, letter, &w, &dummy);
+ x += w;
+ i += shift;
+ }
+
+ return x;
+}
+
+static inline int ogm_get_width(sputext_decoder_t *this, char* text) {
+ return ogm_render_line_internal (this, 0, 0, text, 0);
+}
+
+static inline void ogm_render_line(sputext_decoder_t *this, int x, int y, char* text) {
+ ogm_render_line_internal (this, x, y, text, 1);
+}
+
+/* read SSA tags at begening of text. Suported tags are : */
+/* \a : alignment in SSA code (see #defines) */
+/* \an : alignment in 'numpad code' */
+/* \pos : absolute position of subtitles. Alignment define origin. */
+static void read_ssa_tag(sputext_decoder_t *this, const char* text,
+ int* alignment, int* sub_x, int* sub_y, int* max_width) {
+
+ int in_tag = 0;
+
+ (*alignment) = 2;
+ (*sub_x) = -1;
+ (*sub_y) = -1;
+
+ while (*text) {
+
+ /* wait for tag begin, allow space and tab */
+ if (in_tag == 0) {
+ if (*text == '{') in_tag = 1;
+ else if ((*text != ' ') && (*text != '\t')) break;
+
+ /* parse SSA command */
+ } else {
+ if (*text == '\\') {
+ if (sscanf(text, "\\pos(%d,%d)", sub_x, sub_y) == 2) {
+ text += 8; /* just for speed up, 8 is the minimal with */
+ }
+
+ if (sscanf(text, "\\a%d", alignment) == 1) {
+ text += 2;
+ }
+
+ if (sscanf(text, "\\an%d", alignment) == 1) {
+ text += 3;
+ if ((*alignment) > 6) (*alignment) = (*alignment) - 2;
+ else if ((*alignment) > 3) (*alignment) = (*alignment) + 5;
+ }
+ }
+
+ if (*text == '}') in_tag = 0;
+ }
+
+ text++;
+ }
+
+
+ /* check alignment validity */
+ if ((*alignment) < 1 || (*alignment) > 11) {
+ (*alignment) = 2;
+ }
+
+ /* convert to window coordinates */
+ if ((*sub_x) >= 0 && (*sub_y) >= 0) {
+ (*sub_x) = this->video2wnd.x + this->video2wnd.dx * (*sub_x);
+ (*sub_y) = this->video2wnd.y + this->video2wnd.dy * (*sub_y);
+ }
+
+ /* check validity, compute max width */
+ if ( (*sub_x) < 0 || (*sub_x) >= this->width ||
+ (*sub_y) < 0 || (*sub_y) >= this->height ) {
+ (*sub_x) = -1;
+ (*sub_y) = -1;
+ (*max_width) = this->width;
+ } else {
+ switch (GET_X_ALIGNMENT(*alignment)) {
+ case ALIGN_LEFT:
+ (*max_width) = this->width - (*sub_x);
+ break;
+ case ALIGN_CENTER:
+ (*max_width) = this->width;
+ break;
+ case ALIGN_RIGHT:
+ (*max_width) = (*sub_x);
+ break;
+ }
+ }
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: position : (%d, %d), max width : %d, alignment : %d\n",
+ (*sub_x), (*sub_y), (*max_width), (*alignment));
+}
+
+static int is_cjk_encoding(const char *enc) {
+ /* CJK charset strings defined in iconvdata/gconv-modules of glibc */
+ static const char cjk_encoding_strings[][16] = {
+ "SJIS",
+ "CP932",
+ "EUC-KR",
+ "UHC",
+ "JOHAB",
+ "BIG5",
+ "BIG5HKSCS",
+ "EUC-JP-MS",
+ "EUC-JP",
+ "EUC-CN",
+ "GBBIG5",
+ "GBK",
+ "GBGBK",
+ "EUC-TW",
+ "ISO-2022-JP",
+ "ISO-2022-JP-2",
+ "ISO-2022-JP-3",
+ "ISO-2022-KR",
+ "ISO-2022-CN",
+ "ISO-2022-CN-EXT",
+ "GB18030",
+ "EUC-JISX0213",
+ "SHIFT_JISX0213",
+ };
+
+ int pstr;
+
+ /* return 1 if encoding string is one of the CJK(Chinese,Jananese,Korean)
+ * character set strings. */
+ for (pstr = 0; pstr < sizeof (cjk_encoding_strings) / sizeof (cjk_encoding_strings[0]); pstr++)
+ if (strcasecmp (enc, cjk_encoding_strings[pstr]) == 0)
+ return 1;
+
+ return 0;
+}
+
+static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t sub_end ) {
+
+ int y;
+ int sub_x, sub_y, max_width = this->width;
+ int alignment;
+
+ _x_assert(this->renderer != NULL);
+ if ( ! this->renderer )
+ return;
+
+ read_ssa_tag(this, this->text[0], &alignment, &sub_x, &sub_y, &max_width);
+
+ update_font_size(this, 0);
+
+ const char *const font = get_font (this->class);
+ if( strcmp(this->font, font) ) {
+ strncpy(this->font, font, FILENAME_MAX);
+ this->font[FILENAME_MAX - 1] = '\0';
+ this->renderer->set_font (this->osd, font, this->font_size);
+ }
+
+ int font_size = this->font_size;
+
+ const char *const encoding = this->buf_encoding ? : this->class->src_encoding;
+ this->renderer->set_encoding(this->osd, encoding);
+
+ int rebuild_all = 0;
+ int line;
+ for (line = 0; line < this->lines; line++) {
+ int line_width = ogm_get_width(this, this->text[line]);
+
+ /* line too long */
+ if (line_width > max_width) {
+ char *current_cut, *best_cut;
+ int a;
+
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: Line too long: %d > %d, split at max size.\n",
+ line_width, max_width);
+
+ /* can't fit with keeping existing lines */
+ if (this->lines + 1 > SUB_MAX_TEXT) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: Can't fit with keeping existing line, we have to rebuild all the subtitle\n");
+ rebuild_all = 1;
+ break;
+ }
+
+ /* find the longest sequence witch fit */
+ line_width = 0;
+ current_cut = this->text[line];
+ best_cut = NULL;
+ while (line_width < max_width) {
+ while (*current_cut && *current_cut != ' ') current_cut++;
+ if (*current_cut == ' ') {
+ *current_cut = 0;
+ line_width = ogm_get_width(this, this->text[line]);
+ *current_cut = ' ';
+ if (line_width < max_width) best_cut = current_cut;
+ current_cut++;
+ } else {
+ break; /* end of line */
+ }
+ }
+
+ if (best_cut == NULL) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: Can't wrap line: a word is too long, abort.\n");
+ break;
+ }
+
+ /* move other lines */
+ for (a = this->lines - 1; a > line; a--)
+ memcpy(this->text[a + 1], this->text[a], SUB_BUFSIZE);
+
+ /* split current one */
+ strncpy(this->text[line + 1], best_cut + 1, SUB_BUFSIZE);
+ *best_cut = 0;
+
+ this->lines = this->lines + 1;
+ }
+ }
+
+ /* regenerate all the lines to find something that better fits */
+ if (rebuild_all) {
+ char buf[SUB_BUFSIZE * SUB_MAX_TEXT] = { 0, };
+
+ int line;
+ for(line = 0; line < this->lines; line++) {
+ const size_t len = strlen(buf);
+ if (len)
+ buf[len] = ' ';
+
+ strncat(buf, this->text[line], SUB_BUFSIZE-len-1);
+ }
+
+ char *stream = buf;
+ this->lines = 0;
+
+ char *current_cut, *best_cut;
+ do {
+
+ if (this->lines + 1 < SUB_MAX_TEXT) {
+
+ /* find the longest sequence witch fit */
+ int line_width = 0;
+ current_cut = stream;
+ best_cut = NULL;
+ while (line_width < max_width) {
+ while (*current_cut && *current_cut != ' ') current_cut++;
+ if (*current_cut == ' ') {
+ *current_cut = 0;
+ line_width = ogm_get_width(this, stream);
+ *current_cut = ' ';
+ if (line_width < max_width) best_cut = current_cut;
+ current_cut++;
+ } else {
+ line_width = ogm_get_width(this, stream);
+ if (line_width < max_width) best_cut = current_cut;
+ break; /* end of line */
+ }
+ }
+ }
+
+ /* line maybe too long, but we have reached last subtitle line */
+ else {
+ best_cut = current_cut = stream + strlen(stream);
+ }
+
+ /* copy current line */
+ if (best_cut != NULL) *best_cut = 0;
+ strncpy(this->text[this->lines], stream, SUB_BUFSIZE);
+ this->lines = this->lines + 1;
+
+ stream = best_cut + 1;
+
+ } while (best_cut != current_cut);
+
+ }
+
+
+ /* Erase subtitle : use last_y and last_lines saved last turn. */
+ if (this->last_lines) {
+ this->renderer->filled_rect (this->osd, 0, this->last_y,
+ this->width - 1, this->last_y + this->last_lines * this->line_height,
+ 0);
+ }
+
+ switch (GET_Y_ALIGNMENT(alignment)) {
+ case ALIGN_TOP:
+ if (sub_y >= 0) y = sub_y;
+ else y = 5;
+ break;
+
+ case ALIGN_MIDDLE:
+ if (sub_y >= 0) y = sub_y - (this->lines * this->line_height) / 2;
+ else y = (this->height - this->lines * this->line_height) / 2;
+ break;
+
+ case ALIGN_BOTTOM:
+ default:
+ if (sub_y >= 0) y = sub_y - this->lines * this->line_height;
+ else y = this->height - this->lines * this->line_height - this->class->vertical_offset;
+ break;
+ }
+ if (y < 0 || y >= this->height)
+ y = this->height - this->line_height * this->lines;
+
+ this->last_lines = this->lines;
+ this->last_y = y;
+
+
+ for (line = 0; line < this->lines; line++) {
+ int w, x;
+
+ while(1) {
+ w = ogm_get_width( this, this->text[line]);
+
+ switch (GET_X_ALIGNMENT(alignment)) {
+ case ALIGN_LEFT:
+ if (sub_x >= 0) x = sub_x;
+ else x = 5;
+ break;
+
+ case ALIGN_RIGHT:
+ if (sub_x >= 0) x = sub_x - w;
+ else x = max_width - w - 5;
+ break;
+
+ case ALIGN_CENTER:
+ default:
+ if (sub_x >= 0) x = sub_x - w / 2;
+ else x = (max_width - w) / 2;
+ break;
+ }
+
+
+ if( w > max_width && font_size > 16 ) {
+ font_size -= 4;
+ this->renderer->set_font (this->osd, get_font (this->class), font_size);
+ } else {
+ break;
+ }
+ }
+
+ if( is_cjk_encoding(encoding) ) {
+ this->renderer->render_text (this->osd, x, y + line * this->line_height,
+ this->text[line], OSD_TEXT1);
+ } else {
+ ogm_render_line(this, x, y + line*this->line_height, this->text[line]);
+ }
+ }
+
+ if( font_size != this->font_size )
+ this->renderer->set_font (this->osd, get_font (this->class), this->font_size);
+
+ if( this->last_subtitle_end && sub_start < this->last_subtitle_end ) {
+ sub_start = this->last_subtitle_end;
+ }
+ this->last_subtitle_end = sub_end;
+
+ this->renderer->set_text_palette (this->osd, -1, OSD_TEXT1);
+ this->renderer->get_palette(this->osd, this->spu_palette, this->spu_trans);
+ /* append some colors for colored typeface tag */
+ memcpy(this->spu_palette+OSD_TEXT2, sub_palette, sizeof(sub_palette));
+ memcpy(this->spu_trans+OSD_TEXT2, sub_trans, sizeof(sub_trans));
+ this->renderer->set_palette(this->osd, this->spu_palette, this->spu_trans);
+
+ if (this->unscaled)
+ this->renderer->show_unscaled (this->osd, sub_start);
+ else
+ this->renderer->show (this->osd, sub_start);
+
+ this->renderer->hide (this->osd, sub_end);
+
+ lprintf ("scheduling subtitle >%s< at %"PRId64" until %"PRId64", current time is %"PRId64"\n",
+ this->text[0], sub_start, sub_end,
+ this->stream->xine->clock->get_current_time (this->stream->xine->clock));
+}
+
+
+static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
+
+ sputext_decoder_t *this = (sputext_decoder_t *) this_gen;
+ int uses_time;
+ int32_t start, end, diff;
+ int64_t start_vpts, end_vpts;
+ int64_t spu_offset;
+ int i;
+ uint32_t *val;
+ char *str;
+ extra_info_t extra_info;
+ int master_status, slave_status;
+ int vo_discard;
+
+ /* filter unwanted streams */
+ if (buf->decoder_flags & BUF_FLAG_HEADER) {
+ return;
+ }
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if ((this->stream->spu_channel & 0x1f) != (buf->type & 0x1f))
+ return;
+
+ if ( (buf->decoder_flags & BUF_FLAG_SPECIAL) &&
+ (buf->decoder_info[1] == BUF_SPECIAL_CHARSET_ENCODING) )
+ this->buf_encoding = buf->decoder_info_ptr[2];
+ else
+ this->buf_encoding = NULL;
+
+ this->current_osd_text = OSD_TEXT1;
+
+ if( (buf->type & 0xFFFF0000) == BUF_SPU_OGM ) {
+
+ this->ogm = 1;
+ uses_time = 1;
+ val = (uint32_t * )buf->content;
+ start = *val++;
+ end = *val++;
+ str = (char *)val;
+
+ if (!*str) return;
+ /* Empty ogm packets (as created by ogmmux) clears out old messages. We already respect the end time. */
+
+ this->lines = 0;
+
+ i = 0;
+ while (*str && (this->lines < SUB_MAX_TEXT) && (i < SUB_BUFSIZE)) {
+ if (*str == '\r' || *str == '\n') {
+ if (i) {
+ this->text[ this->lines ][i] = 0;
+ this->lines++;
+ i = 0;
+ }
+ } else {
+ this->text[ this->lines ][i] = *str;
+ if (i < SUB_BUFSIZE-1)
+ i++;
+ }
+ str++;
+ }
+ if (i == SUB_BUFSIZE)
+ i--;
+
+ if (i) {
+ this->text[ this->lines ][i] = 0;
+ this->lines++;
+ }
+
+ } else {
+
+ this->ogm = 0;
+ val = (uint32_t * )buf->content;
+
+ this->lines = *val++;
+ uses_time = *val++;
+ start = *val++;
+ end = *val++;
+ str = (char *)val;
+ for (i = 0; i < this->lines; i++, str += strlen(str) + 1) {
+ strncpy( this->text[i], str, SUB_BUFSIZE - 1);
+ this->text[i][SUB_BUFSIZE - 1] = '\0';
+ }
+
+ }
+
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: decoder data [%s]\n", this->text[0]);
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: mode %d timing %d->%d\n", uses_time, start, end);
+
+ if( end <= start ) {
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: discarding subtitle with invalid timing\n");
+ return;
+ }
+
+ spu_offset = this->stream->master->metronom->get_option (this->stream->master->metronom,
+ METRONOM_SPU_OFFSET);
+ if( uses_time ) {
+ start += (spu_offset / 90);
+ end += (spu_offset / 90);
+ } else {
+ if( this->osd && this->img_duration ) {
+ start += spu_offset / this->img_duration;
+ end += spu_offset / this->img_duration;
+ }
+ }
+
+ while( !this->finished ) {
+
+ master_status = xine_get_status (this->stream->master);
+ slave_status = xine_get_status (this->stream);
+ vo_discard = this->stream->video_out->get_property(this->stream->video_out,
+ VO_PROP_DISCARD_FRAMES);
+
+ _x_get_current_info (this->stream->master, &extra_info, sizeof(extra_info) );
+
+ lprintf("master: %d slave: %d input_normpos: %d vo_discard: %d\n",
+ master_status, slave_status, extra_info.input_normpos, vo_discard);
+
+ if( !this->started && (master_status == XINE_STATUS_PLAY &&
+ slave_status == XINE_STATUS_PLAY &&
+ extra_info.input_normpos) ) {
+ lprintf("started\n");
+
+ this->width = this->height = 0;
+
+ update_output_size( this );
+ if( this->width && this->height ) {
+ this->started = 1;
+ }
+ }
+
+ if( this->started ) {
+
+ if( master_status != XINE_STATUS_PLAY ||
+ slave_status != XINE_STATUS_PLAY ||
+ vo_discard ) {
+ lprintf("finished\n");
+
+ this->width = this->height = 0;
+ this->finished = 1;
+ return;
+ }
+
+ if( this->osd ) {
+
+ /* try to use frame number mode */
+ if( !uses_time && extra_info.frame_number ) {
+
+ diff = end - extra_info.frame_number;
+
+ /* discard old subtitles */
+ if( diff < 0 ) {
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: discarding old subtitle\n");
+ return;
+ }
+
+ diff = start - extra_info.frame_number;
+
+ start_vpts = extra_info.vpts + diff * this->img_duration;
+ end_vpts = start_vpts + (end-start) * this->img_duration;
+
+ } else {
+
+ if( !uses_time ) {
+ start = start * this->img_duration / 90;
+ end = end * this->img_duration / 90;
+ uses_time = 1;
+ }
+
+ diff = end - extra_info.input_time;
+
+ /* discard old subtitles */
+ if( diff < 0 ) {
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "libsputext: discarding old subtitle\n");
+ return;
+ }
+
+ diff = start - extra_info.input_time;
+
+ start_vpts = extra_info.vpts + diff * 90;
+ end_vpts = start_vpts + (end-start) * 90;
+ }
+
+ _x_spu_decoder_sleep(this->stream, start_vpts);
+ update_output_size( this );
+ draw_subtitle(this, start_vpts, end_vpts);
+
+ return;
+ }
+ }
+
+ if (_x_spu_decoder_sleep(this->stream, 0))
+ xine_usec_sleep (50000);
+ else
+ return;
+ }
+}
+
+
+static void spudec_reset (spu_decoder_t *this_gen) {
+ sputext_decoder_t *this = (sputext_decoder_t *) this_gen;
+
+ lprintf("i guess we just seeked\n");
+ this->width = this->height = 0;
+ this->started = this->finished = 0;
+ this->last_subtitle_end = 0;
+}
+
+static void spudec_discontinuity (spu_decoder_t *this_gen) {
+ /* sputext_decoder_t *this = (sputext_decoder_t *) this_gen; */
+
+}
+
+static void spudec_dispose (spu_decoder_t *this_gen) {
+ sputext_decoder_t *this = (sputext_decoder_t *) this_gen;
+
+ if (this->osd) {
+ this->renderer->free_object (this->osd);
+ this->osd = NULL;
+ }
+ free(this);
+}
+
+static void update_vertical_offset(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ class->vertical_offset = entry->num_value;
+}
+
+static void update_osd_font(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ strncpy(class->font, entry->str_value, FONTNAME_SIZE);
+ class->font[FONTNAME_SIZE - 1] = '\0';
+
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_font = %s\n", class->font );
+}
+
+#ifdef HAVE_FT2
+static void update_osd_font_ft(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ strncpy(class->font_ft, entry->str_value, FILENAME_MAX);
+ class->font_ft[FILENAME_MAX - 1] = '\0';
+
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_font_ft = %s\n", class->font_ft);
+}
+
+static void update_osd_use_font_ft(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ class->use_font_ft = entry->num_value;
+
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_use_font_ft = %d\n", class->use_font_ft);
+}
+#endif
+
+static void update_subtitle_size(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ class->subtitle_size = entry->num_value;
+}
+
+static void update_use_unscaled(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ class->use_unscaled = entry->num_value;
+}
+
+static spu_decoder_t *sputext_class_open_plugin (spu_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+ sputext_decoder_t *this ;
+
+ this = (sputext_decoder_t *) calloc(1, sizeof(sputext_decoder_t));
+
+ this->spu_decoder.decode_data = spudec_decode_data;
+ this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
+ this->spu_decoder.get_interact_info = NULL;
+ this->spu_decoder.set_button = NULL;
+ this->spu_decoder.dispose = spudec_dispose;
+
+ this->class = class;
+ this->stream = stream;
+
+ return (spu_decoder_t *) this;
+}
+
+static void sputext_class_dispose (spu_decoder_class_t *class_gen) {
+ sputext_class_t *this = (sputext_class_t *)class_gen;
+
+ this->xine->config->unregister_callback(this->xine->config,
+ "subtitles.separate.src_encoding");
+ this->xine->config->unregister_callback(this->xine->config,
+ "subtitles.separate.subtitle_size");
+ this->xine->config->unregister_callback(this->xine->config,
+ "subtitles.separate.vertical_offset");
+ this->xine->config->unregister_callback(this->xine->config,
+ "subtitles.separate.use_unscaled_osd");
+ free (this);
+}
+
+static void update_src_encoding(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ class->src_encoding = entry->str_value;
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_src_encoding = %s\n", class->src_encoding );
+}
+
+static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
+
+ static const char *const subtitle_size_strings[] = {
+ "tiny", "small", "normal", "large", "very large", "huge", NULL
+ };
+ sputext_class_t *this ;
+
+ lprintf("init class\n");
+
+ this = (sputext_class_t *) calloc(1, sizeof(sputext_class_t));
+
+ this->class.open_plugin = sputext_class_open_plugin;
+ this->class.identifier = "sputext";
+ this->class.description = N_("external subtitle decoder plugin");
+ this->class.dispose = sputext_class_dispose;
+
+ this->xine = xine;
+
+ this->subtitle_size = xine->config->register_enum(xine->config,
+ "subtitles.separate.subtitle_size",
+ 1,
+ subtitle_size_strings,
+ _("subtitle size"),
+ _("You can adjust the subtitle size here. The setting will "
+ "be evaluated relative to the window size."),
+ 0, update_subtitle_size, this);
+ this->vertical_offset = xine->config->register_num(xine->config,
+ "subtitles.separate.vertical_offset",
+ 0,
+ _("subtitle vertical offset"),
+ _("You can adjust the vertical position of the subtitle. "
+ "The setting will be evaluated relative to the window size."),
+ 0, update_vertical_offset, this);
+ strncpy(this->font, xine->config->register_string(xine->config,
+ "subtitles.separate.font",
+ "sans",
+ _("font for subtitles"),
+ _("A font from the xine font directory to be used for the "
+ "subtitle text."),
+ 10, update_osd_font, this), FONTNAME_SIZE);
+ this->font[FONTNAME_SIZE - 1] = '\0';
+#ifdef HAVE_FT2
+ strncpy(this->font_ft, xine->config->register_filename(xine->config,
+ "subtitles.separate.font_freetype",
+ "", XINE_CONFIG_STRING_IS_FILENAME,
+ _("font for subtitles"),
+ _("An outline font file (e.g. a .ttf) to be used for the subtitle text."),
+ 10, update_osd_font_ft, this), FILENAME_MAX);
+ this->font_ft[FILENAME_MAX - 1] = '\0';
+ this->use_font_ft = xine->config->register_bool(xine->config,
+ "subtitles.separate.font_use_freetype",
+ 0,
+ _("whether to use a freetype font"),
+ NULL,
+ 10, update_osd_use_font_ft, this);
+#endif
+ this->src_encoding = xine->config->register_string(xine->config,
+ "subtitles.separate.src_encoding",
+ xine_guess_spu_encoding(),
+ _("encoding of the subtitles"),
+ _("The encoding of the subtitle text in the stream. This setting "
+ "is used to render non-ASCII characters correctly. If non-ASCII "
+ "characters are not displayed as you expect, ask the "
+ "creator of the subtitles what encoding was used."),
+ 10, update_src_encoding, this);
+ this->use_unscaled = xine->config->register_bool(xine->config,
+ "subtitles.separate.use_unscaled_osd",
+ 1,
+ _("use unscaled OSD if possible"),
+ _("The unscaled OSD will be rendered independently of the video "
+ "frame and will always be sharp, even if the video is magnified. "
+ "This will look better, but does not work with all graphics "
+ "hardware. The alternative is the scaled OSD, which will become "
+ "blurry, if you enlarge a low resolution video to fullscreen, but "
+ "it works with all graphics cards."),
+ 10, update_use_unscaled, this);
+
+ return &this->class;
+}
+
+
+/* plugin catalog information */
+static const uint32_t supported_types[] = { BUF_SPU_TEXT, BUF_SPU_OGM, 0 };
+
+static const decoder_info_t spudec_info = {
+ supported_types, /* supported types */
+ 1 /* priority */
+};
+
+extern void *init_sputext_demux_class (xine_t *xine, void *data);
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_SPU_DECODER | PLUGIN_MUST_PRELOAD, 17, "sputext", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin },
+ { PLUGIN_DEMUX, 27, "sputext", XINE_VERSION_CODE, NULL, &init_sputext_demux_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/spu_dec/sputext_demuxer.c b/src/spu_dec/sputext_demuxer.c
new file mode 100644
index 000000000..a8e252c30
--- /dev/null
+++ b/src/spu_dec/sputext_demuxer.c
@@ -0,0 +1,1452 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * code based on old libsputext/xine_decoder.c
+ *
+ * code based on mplayer module:
+ *
+ * Subtitle reader with format autodetection
+ *
+ * Written by laaz
+ * Some code cleanup & realloc() by A'rpi/ESP-team
+ * dunnowhat sub format by szabi
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <ctype.h>
+
+#define LOG_MODULE "demux_sputext"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/demux.h>
+
+#define ERR (void *)-1
+#define SUB_MAX_TEXT 5
+#define SUB_BUFSIZE 1024
+#define LINE_LEN 1000
+#define LINE_LEN_QUOT "1000"
+
+/*
+ * Demuxer typedefs
+ */
+
+typedef struct {
+
+ int lines;
+
+ long start; /* csecs */
+ long end; /* csecs */
+
+ char *text[SUB_MAX_TEXT];
+
+} subtitle_t;
+
+
+typedef struct {
+
+ demux_plugin_t demux_plugin;
+ xine_stream_t *stream;
+ input_plugin_t *input;
+
+ int status;
+
+ char buf[SUB_BUFSIZE];
+ off_t buflen;
+
+ float mpsub_position;
+
+ int uses_time;
+ int errs;
+ subtitle_t *subtitles;
+ int num; /* number of subtitle structs */
+ int cur; /* current subtitle */
+ int format; /* constants see below */
+ char next_line[SUB_BUFSIZE]; /* a buffer for next line read from file */
+
+} demux_sputext_t;
+
+typedef struct demux_sputext_class_s {
+
+ demux_class_t demux_class;
+
+ int max_timeout; /* default timeout of hidding subtitles */
+
+} demux_sputext_class_t;
+
+/*
+ * Demuxer code start
+ */
+
+#define FORMAT_UNKNOWN -1
+#define FORMAT_MICRODVD 0
+#define FORMAT_SUBRIP 1
+#define FORMAT_SUBVIEWER 2
+#define FORMAT_SAMI 3
+#define FORMAT_VPLAYER 4
+#define FORMAT_RT 5
+#define FORMAT_SSA 6 /* Sub Station Alpha */
+#define FORMAT_PJS 7
+#define FORMAT_MPSUB 8
+#define FORMAT_AQTITLE 9
+#define FORMAT_JACOBSUB 10
+#define FORMAT_SUBVIEWER2 11
+#define FORMAT_SUBRIP09 12
+#define FORMAT_MPL2 13 /*Mplayer sub 2 ?*/
+
+static int eol(char p) {
+ return (p=='\r' || p=='\n' || p=='\0');
+}
+
+static inline void trail_space(char *s) {
+ while (isspace(*s)) {
+ char *copy = s;
+ do {
+ copy[0] = copy[1];
+ copy++;
+ } while(*copy);
+ }
+ size_t i = strlen(s) - 1;
+ while (i > 0 && isspace(s[i]))
+ s[i--] = '\0';
+}
+
+/*
+ * Reimplementation of fgets() using the input->read() method.
+ */
+static char *read_line_from_input(demux_sputext_t *this, char *line, off_t len) {
+ off_t nread = 0;
+ char *s;
+ int linelen;
+
+ if ((len - this->buflen) > 512 && len < SUB_BUFSIZE) {
+ if((nread = this->input->read(this->input,
+ &this->buf[this->buflen], len - this->buflen)) < 0) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "read failed.\n");
+ return NULL;
+ }
+ }
+
+ this->buflen += nread;
+ this->buf[this->buflen] = '\0';
+
+ s = strchr(this->buf, '\n');
+
+ if (line && (s || this->buflen)) {
+
+ linelen = s ? (s - this->buf) + 1 : this->buflen;
+
+ memcpy(line, this->buf, linelen);
+ line[linelen] = '\0';
+
+ memmove(this->buf, &this->buf[linelen], SUB_BUFSIZE - linelen);
+ this->buflen -= linelen;
+
+ return line;
+ }
+
+ return NULL;
+}
+
+
+static subtitle_t *sub_read_line_sami(demux_sputext_t *this, subtitle_t *current) {
+
+ static char line[LINE_LEN + 1];
+ static char *s = NULL;
+ char text[LINE_LEN + 1], *p, *q;
+ int state;
+
+ p = NULL;
+ current->lines = current->start = 0;
+ current->end = -1;
+ state = 0;
+
+ /* read the first line */
+ if (!s)
+ if (!(s = read_line_from_input(this, line, LINE_LEN))) return 0;
+
+ do {
+ switch (state) {
+
+ case 0: /* find "START=" */
+ s = strstr (s, "Start=");
+ if (s) {
+ current->start = strtol (s + 6, &s, 0) / 10;
+ state = 1; continue;
+ }
+ break;
+
+ case 1: /* find "<P" */
+ if ((s = strstr (s, "<P"))) { s += 2; state = 2; continue; }
+ break;
+
+ case 2: /* find ">" */
+ if ((s = strchr (s, '>'))) { s++; state = 3; p = text; continue; }
+ break;
+
+ case 3: /* get all text until '<' appears */
+ if (*s == '\0') { break; }
+ else if (*s == '<') { state = 4; }
+ else if (!strncasecmp (s, "&nbsp;", 6)) { *p++ = ' '; s += 6; }
+ else if (*s == '\r') { s++; }
+ else if (!strncasecmp (s, "<br>", 4) || *s == '\n') {
+ *p = '\0'; p = text; trail_space (text);
+ if (text[0] != '\0')
+ current->text[current->lines++] = strdup (text);
+ if (*s == '\n') s++; else s += 4;
+ }
+ else *p++ = *s++;
+ continue;
+
+ case 4: /* get current->end or skip <TAG> */
+ q = strstr (s, "Start=");
+ if (q) {
+ current->end = strtol (q + 6, &q, 0) / 10 - 1;
+ *p = '\0'; trail_space (text);
+ if (text[0] != '\0')
+ current->text[current->lines++] = strdup (text);
+ if (current->lines > 0) { state = 99; break; }
+ state = 0; continue;
+ }
+ s = strchr (s, '>');
+ if (s) { s++; state = 3; continue; }
+ break;
+ }
+
+ /* read next line */
+ if (state != 99 && !(s = read_line_from_input (this, line, LINE_LEN)))
+ return 0;
+
+ } while (state != 99);
+
+ return current;
+}
+
+
+static char *sub_readtext(char *source, char **dest) {
+ int len=0;
+ char *p=source;
+
+ while ( !eol(*p) && *p!= '|' ) {
+ p++,len++;
+ }
+
+ *dest = strndup(source, len);
+
+ while (*p=='\r' || *p=='\n' || *p=='|')
+ p++;
+
+ if (*p) return p; /* not-last text field */
+ else return NULL; /* last text field */
+}
+
+static subtitle_t *sub_read_line_microdvd(demux_sputext_t *this, subtitle_t *current) {
+
+ char line[LINE_LEN + 1];
+ char line2[LINE_LEN + 1];
+ char *p, *next;
+ int i;
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ current->end=-1;
+ do {
+ if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
+ } while ((sscanf (line, "{%ld}{}%" LINE_LEN_QUOT "[^\r\n]", &(current->start), line2) !=2) &&
+ (sscanf (line, "{%ld}{%ld}%" LINE_LEN_QUOT "[^\r\n]", &(current->start), &(current->end),line2) !=3)
+ );
+
+ p=line2;
+
+ next=p, i=0;
+ while ((next =sub_readtext (next, &(current->text[i])))) {
+ if (current->text[i]==ERR) return ERR;
+ i++;
+ if (i>=SUB_MAX_TEXT) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ current->lines=i;
+ return current;
+ }
+ }
+ current->lines= ++i;
+
+ return current;
+}
+
+static subtitle_t *sub_read_line_subviewer(demux_sputext_t *this, subtitle_t *current) {
+
+ char line[LINE_LEN + 1];
+ int a1,a2,a3,a4,b1,b2,b3,b4;
+ char *p=NULL, *q=NULL;
+ int len;
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ while (1) {
+ if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
+ if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8) {
+ if (sscanf (line, "%d:%d:%d,%d,%d:%d:%d,%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4) < 8)
+ continue;
+ }
+ current->start = a1*360000+a2*6000+a3*100+a4;
+ current->end = b1*360000+b2*6000+b3*100+b4;
+
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return NULL;
+
+ p=q=line;
+ for (current->lines=1; current->lines <= SUB_MAX_TEXT; current->lines++) {
+ for (q=p,len=0; *p && *p!='\r' && *p!='\n' && *p!='|' && strncasecmp(p,"[br]",4); p++,len++);
+ current->text[current->lines-1] = strndup(q, len);
+ if (!current->text[current->lines-1]) return ERR;
+ if (!*p || *p=='\r' || *p=='\n') break;
+ if (*p=='[') while (*p++!=']');
+ if (*p=='|') p++;
+ }
+ if (current->lines > SUB_MAX_TEXT) current->lines = SUB_MAX_TEXT;
+ break;
+ }
+ return current;
+}
+
+static subtitle_t *sub_read_line_subrip(demux_sputext_t *this,subtitle_t *current) {
+ char line[LINE_LEN + 1];
+ int a1,a2,a3,a4,b1,b2,b3,b4;
+ int i,end_sub;
+
+ memset(current,0,sizeof(subtitle_t));
+ do {
+ if(!read_line_from_input(this,line,LINE_LEN))
+ return NULL;
+ i = sscanf(line,"%d:%d:%d%*[,.]%d --> %d:%d:%d%*[,.]%d",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4);
+ } while(i < 8);
+ current->start = a1*360000+a2*6000+a3*100+a4/10;
+ current->end = b1*360000+b2*6000+b3*100+b4/10;
+ i=0;
+ end_sub=0;
+ do {
+ char *p; /* pointer to the curently read char */
+ char temp_line[SUB_BUFSIZE]; /* subtitle line that will be transfered to current->text[i] */
+ int temp_index; /* ... and its index wich 'points' to the first EMPTY place -> last read char is at temp_index-1 if temp_index>0 */
+ temp_line[SUB_BUFSIZE-1]='\0'; /* just in case... */
+ if(!read_line_from_input(this,line,LINE_LEN)) {
+ if(i)
+ break; /* if something was read, transmit it */
+ else
+ return NULL; /* if not, repport EOF */
+ }
+ for(temp_index=0,p=line;*p!='\0' && !end_sub && temp_index<SUB_BUFSIZE && i<SUB_MAX_TEXT;p++) {
+ switch(*p) {
+ case '\\':
+ if(*(p+1)=='N' || *(p+1)=='n') {
+ temp_line[temp_index++]='\0'; /* end of curent line */
+ p++;
+ } else
+ temp_line[temp_index++]=*p;
+ break;
+ case '\r': /* just ignore '\r's */
+ break;
+ case '\n':
+ temp_line[temp_index++]='\0';
+ break;
+ default:
+ temp_line[temp_index++]=*p;
+ break;
+ }
+ if(temp_index>0) {
+ if(temp_index==SUB_BUFSIZE)
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many characters in a subtitle line\n");
+ if(temp_line[temp_index-1]=='\0' || temp_index==SUB_BUFSIZE) {
+ if(temp_index>1) { /* more than 1 char (including '\0') -> that is a valid one */
+ /* temp_index<=SUB_BUFSIZE is always true here */
+ current->text[i] = strndup(temp_line, temp_index);
+ if(!current->text[i])
+ return ERR;
+ i++;
+ temp_index=0;
+ } else
+ end_sub=1;
+ }
+ }
+ }
+ } while(i<SUB_MAX_TEXT && !end_sub);
+ if(i>=SUB_MAX_TEXT)
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ current->lines=i;
+ return current;
+}
+
+static subtitle_t *sub_read_line_vplayer(demux_sputext_t *this,subtitle_t *current) {
+ char line[LINE_LEN + 1];
+ int a1,a2,a3,b1,b2,b3;
+ char *p=NULL, *next, *p2;
+ int i;
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ while (!current->text[0]) {
+ if( this->next_line[0] == '\0' ) { /* if the buffer is empty.... */
+ if( !read_line_from_input(this, line, LINE_LEN) ) return NULL;
+ } else {
+ /* ... get the current line from buffer. */
+ strncpy( line, this->next_line, LINE_LEN);
+ line[LINE_LEN] = '\0'; /* I'm scared. This makes me feel better. */
+ this->next_line[0] = '\0'; /* mark the buffer as empty. */
+ }
+ /* Initialize buffer with next line */
+ if( ! read_line_from_input( this, this->next_line, LINE_LEN) ) {
+ this->next_line[0] = '\0';
+ return NULL;
+ }
+ if( (sscanf( line, "%d:%d:%d:", &a1, &a2, &a3) < 3) ||
+ (sscanf( this->next_line, "%d:%d:%d:", &b1, &b2, &b3) < 3) )
+ continue;
+ current->start = a1*360000+a2*6000+a3*100;
+ current->end = b1*360000+b2*6000+b3*100;
+ if ((current->end - current->start) > LINE_LEN)
+ current->end = current->start + LINE_LEN; /* not too long though. */
+ /* teraz czas na wkopiowanie stringu */
+ p=line;
+ /* finds the body of the subtitle_t */
+ for (i=0; i<3; i++){
+ p2=strchr( p, ':');
+ if( p2 == NULL ) break;
+ p=p2+1;
+ }
+
+ next=p;
+ i=0;
+ while( (next = sub_readtext( next, &(current->text[i]))) ) {
+ if (current->text[i]==ERR)
+ return ERR;
+ i++;
+ if (i>=SUB_MAX_TEXT) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ current->lines=i;
+ return current;
+ }
+ }
+ current->lines=++i;
+ }
+ return current;
+}
+
+static subtitle_t *sub_read_line_rt(demux_sputext_t *this,subtitle_t *current) {
+ /*
+ * TODO: This format uses quite rich (sub/super)set of xhtml
+ * I couldn't check it since DTD is not included.
+ * WARNING: full XML parses can be required for proper parsing
+ */
+ char line[LINE_LEN + 1];
+ int a1,a2,a3,a4,b1,b2,b3,b4;
+ char *p=NULL,*next=NULL;
+ int i,len,plen;
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ while (!current->text[0]) {
+ if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
+ /*
+ * TODO: it seems that format of time is not easily determined, it may be 1:12, 1:12.0 or 0:1:12.0
+ * to describe the same moment in time. Maybe there are even more formats in use.
+ */
+ if ((len=sscanf (line, "<Time Begin=\"%d:%d:%d.%d\" End=\"%d:%d:%d.%d\"",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4)) < 8)
+
+ plen=a1=a2=a3=a4=b1=b2=b3=b4=0;
+ if (
+ ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d\" %*[Ee]nd=\"%d:%d\"%*[^<]<clear/>%n",&a2,&a3,&b2,&b3,&plen)) < 4) &&
+ ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d\" %*[Ee]nd=\"%d:%d.%d\"%*[^<]<clear/>%n",&a2,&a3,&b2,&b3,&b4,&plen)) < 5) &&
+ /* ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d.%d\" %*[Ee]nd=\"%d:%d\"%*[^<]<clear/>%n",&a2,&a3,&a4,&b2,&b3,&plen)) < 5) && */
+ ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d.%d\" %*[Ee]nd=\"%d:%d.%d\"%*[^<]<clear/>%n",&a2,&a3,&a4,&b2,&b3,&b4,&plen)) < 6) &&
+ ((len=sscanf (line, "<%*[tT]ime %*[bB]egin=\"%d:%d:%d.%d\" %*[Ee]nd=\"%d:%d:%d.%d\"%*[^<]<clear/>%n",&a1,&a2,&a3,&a4,&b1,&b2,&b3,&b4,&plen)) < 8)
+ )
+ continue;
+ current->start = a1*360000+a2*6000+a3*100+a4/10;
+ current->end = b1*360000+b2*6000+b3*100+b4/10;
+ p=line; p+=plen;i=0;
+ /* TODO: I don't know what kind of convention is here for marking multiline subs, maybe <br/> like in xml? */
+ next = strstr(line,"<clear/>")+8;i=0;
+ while ((next =sub_readtext (next, &(current->text[i])))) {
+ if (current->text[i]==ERR)
+ return ERR;
+ i++;
+ if (i>=SUB_MAX_TEXT) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ current->lines=i;
+ return current;
+ }
+ }
+ current->lines=i+1;
+ }
+ return current;
+}
+
+static subtitle_t *sub_read_line_ssa(demux_sputext_t *this,subtitle_t *current) {
+ int comma;
+ static int max_comma = 32; /* let's use 32 for the case that the */
+ /* amount of commas increase with newer SSA versions */
+
+ int hour1, min1, sec1, hunsec1, hour2, min2, sec2, hunsec2, nothing;
+ int num;
+ char line[LINE_LEN + 1], line3[LINE_LEN + 1], *line2;
+ char *tmp;
+
+ do {
+ if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
+ } while (sscanf (line, "Dialogue: Marked=%d,%d:%d:%d.%d,%d:%d:%d.%d,"
+ "%[^\n\r]", &nothing,
+ &hour1, &min1, &sec1, &hunsec1,
+ &hour2, &min2, &sec2, &hunsec2,
+ line3) < 9
+ &&
+ sscanf (line, "Dialogue: %d,%d:%d:%d.%d,%d:%d:%d.%d,"
+ "%[^\n\r]", &nothing,
+ &hour1, &min1, &sec1, &hunsec1,
+ &hour2, &min2, &sec2, &hunsec2,
+ line3) < 9 );
+
+ line2=strchr(line3, ',');
+ if (!line2)
+ return NULL;
+
+ for (comma = 4; comma < max_comma; comma ++)
+ {
+ tmp = line2;
+ if(!(tmp=strchr(++tmp, ','))) break;
+ if(*(++tmp) == ' ') break;
+ /* a space after a comma means we're already in a sentence */
+ line2 = tmp;
+ }
+
+ if(comma < max_comma)max_comma = comma;
+ /* eliminate the trailing comma */
+ if(*line2 == ',') line2++;
+
+ current->lines=0;num=0;
+ current->start = 360000*hour1 + 6000*min1 + 100*sec1 + hunsec1;
+ current->end = 360000*hour2 + 6000*min2 + 100*sec2 + hunsec2;
+
+ while (((tmp=strstr(line2, "\\n")) != NULL) || ((tmp=strstr(line2, "\\N")) != NULL) ){
+ current->text[num] = strndup(line2, tmp-line2);
+ line2=tmp+2;
+ num++;
+ current->lines++;
+ if (current->lines >= SUB_MAX_TEXT) return current;
+ }
+
+ current->text[num]=strdup(line2);
+ current->lines++;
+
+ return current;
+}
+
+/* Sylvain "Skarsnik" Colinet <scolinet@gmail.com>
+ * From MPlayer subreader.c :
+ *
+ * PJS subtitles reader.
+ * That's the "Phoenix Japanimation Society" format.
+ * I found some of them in http://www.scriptsclub.org/ (used for anime).
+ * The time is in tenths of second.
+ *
+ * by set, based on code by szabi (dunnowhat sub format ;-)
+ */
+
+static subtitle_t *sub_read_line_pjs (demux_sputext_t *this, subtitle_t *current) {
+ char line[LINE_LEN + 1];
+ char text[LINE_LEN + 1];
+ char *s, *d;
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return NULL;
+ for (s = line; *s && isspace(*s); s++);
+ if (*s == 0)
+ return NULL;
+ if (sscanf (line, "%ld,%ld,", &(current->start),
+ &(current->end)) <2)
+ return ERR;
+ /* the files I have are in tenths of second */
+ current->start *= 10;
+ current->end *= 10;
+
+ /* walk to the beggining of the string */
+ for (; *s; s++) if (*s==',') break;
+ if (*s) {
+ for (s++; *s; s++) if (*s==',') break;
+ if (*s) s++;
+ }
+ if (*s!='"') {
+ return ERR;
+ }
+ /* copy the string to the text buffer */
+ for (s++, d=text; *s && *s!='"'; s++, d++)
+ *d=*s;
+ *d=0;
+ current->text[0] = strdup(text);
+ current->lines = 1;
+
+ return current;
+}
+
+static subtitle_t *sub_read_line_mpsub (demux_sputext_t *this, subtitle_t *current) {
+ char line[LINE_LEN + 1];
+ float a,b;
+ int num=0;
+ char *p, *q;
+
+ do {
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return NULL;
+ } while (sscanf (line, "%f %f", &a, &b) !=2);
+
+ this->mpsub_position += (a*100.0);
+ current->start = (int) this->mpsub_position;
+ this->mpsub_position += (b*100.0);
+ current->end = (int) this->mpsub_position;
+
+ while (num < SUB_MAX_TEXT) {
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return NULL;
+
+ p=line;
+ while (isspace(*p))
+ p++;
+
+ if (eol(*p) && num > 0)
+ return current;
+
+ if (eol(*p))
+ return NULL;
+
+ for (q=p; !eol(*q); q++);
+ *q='\0';
+ if (strlen(p)) {
+ current->text[num]=strdup(p);
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, ">%s<\n",p);
+ current->lines = ++num;
+ } else {
+ if (num)
+ return current;
+ else
+ return NULL;
+ }
+ }
+
+ return NULL;
+}
+
+static subtitle_t *sub_read_line_aqt (demux_sputext_t *this, subtitle_t *current) {
+ char line[LINE_LEN + 1];
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ while (1) {
+ /* try to locate next subtitle_t */
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return NULL;
+ if (!(sscanf (line, "-->> %ld", &(current->start)) <1))
+ break;
+ }
+
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return NULL;
+
+ sub_readtext((char *) &line,&current->text[0]);
+ current->lines = 1;
+ current->end = -1;
+
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return current;;
+
+ sub_readtext((char *) &line,&current->text[1]);
+ current->lines = 2;
+
+ if ((current->text[0][0]==0) && (current->text[1][0]==0)) {
+ return NULL;
+ }
+
+ return current;
+}
+
+static subtitle_t *sub_read_line_jacobsub(demux_sputext_t *this, subtitle_t *current) {
+ char line1[LINE_LEN], line2[LINE_LEN], directive[LINE_LEN], *p, *q;
+ unsigned a1, a2, a3, a4, b1, b2, b3, b4, comment = 0;
+ static unsigned jacoTimeres = 30;
+ static int jacoShift = 0;
+
+ memset(current, 0, sizeof(subtitle_t));
+ memset(line1, 0, LINE_LEN);
+ memset(line2, 0, LINE_LEN);
+ memset(directive, 0, LINE_LEN);
+ while (!current->text[0]) {
+ if (!read_line_from_input(this, line1, LINE_LEN)) {
+ return NULL;
+ }
+ if (sscanf
+ (line1, "%u:%u:%u.%u %u:%u:%u.%u %" LINE_LEN_QUOT "[^\n\r]", &a1, &a2, &a3, &a4,
+ &b1, &b2, &b3, &b4, line2) < 9) {
+ if (sscanf(line1, "@%u @%u %" LINE_LEN_QUOT "[^\n\r]", &a4, &b4, line2) < 3) {
+ if (line1[0] == '#') {
+ int hours = 0, minutes = 0, seconds, delta, inverter =
+ 1;
+ unsigned units = jacoShift;
+ switch (line1[1]) {
+ case 'S':
+ case 's':
+ if (isalpha(line1[2])) {
+ delta = 6;
+ } else {
+ delta = 2;
+ }
+ if (sscanf(&line1[delta], "%d", &hours)) {
+ if (hours < 0) {
+ hours *= -1;
+ inverter = -1;
+ }
+ if (sscanf(&line1[delta], "%*d:%d", &minutes)) {
+ if (sscanf
+ (&line1[delta], "%*d:%*d:%d",
+ &seconds)) {
+ sscanf(&line1[delta], "%*d:%*d:%*d.%d",
+ &units);
+ } else {
+ hours = 0;
+ sscanf(&line1[delta], "%d:%d.%d",
+ &minutes, &seconds, &units);
+ minutes *= inverter;
+ }
+ } else {
+ hours = minutes = 0;
+ sscanf(&line1[delta], "%d.%d", &seconds,
+ &units);
+ seconds *= inverter;
+ }
+ jacoShift =
+ ((hours * 3600 + minutes * 60 +
+ seconds) * jacoTimeres +
+ units) * inverter;
+ }
+ break;
+ case 'T':
+ case 't':
+ if (isalpha(line1[2])) {
+ delta = 8;
+ } else {
+ delta = 2;
+ }
+ sscanf(&line1[delta], "%u", &jacoTimeres);
+ break;
+ }
+ }
+ continue;
+ } else {
+ current->start =
+ (unsigned long) ((a4 + jacoShift) * 100.0 /
+ jacoTimeres);
+ current->end =
+ (unsigned long) ((b4 + jacoShift) * 100.0 /
+ jacoTimeres);
+ }
+ } else {
+ current->start =
+ (unsigned
+ long) (((a1 * 3600 + a2 * 60 + a3) * jacoTimeres + a4 +
+ jacoShift) * 100.0 / jacoTimeres);
+ current->end =
+ (unsigned
+ long) (((b1 * 3600 + b2 * 60 + b3) * jacoTimeres + b4 +
+ jacoShift) * 100.0 / jacoTimeres);
+ }
+ current->lines = 0;
+ p = line2;
+ while ((*p == ' ') || (*p == '\t')) {
+ ++p;
+ }
+ if (isalpha(*p)||*p == '[') {
+ if (sscanf(p, "%s %" LINE_LEN_QUOT "[^\n\r]", directive, line1) < 2)
+ return ERR;
+ if ((strcasestr(directive, "RDB") != NULL)
+ || (strcasestr(directive, "RDC") != NULL)
+ || (strcasestr(directive, "RLB") != NULL)
+ || (strcasestr(directive, "RLG") != NULL)) {
+ continue;
+ }
+ /* no alignment */
+#if 0
+ if (strcasestr(directive, "JL") != NULL) {
+ current->alignment = SUB_ALIGNMENT_HLEFT;
+ } else if (strcasestr(directive, "JR") != NULL) {
+ current->alignment = SUB_ALIGNMENT_HRIGHT;
+ } else {
+ current->alignment = SUB_ALIGNMENT_HCENTER;
+ }
+#endif
+ strcpy(line2, line1);
+ p = line2;
+ }
+ for (q = line1; (!eol(*p)) && (current->lines < SUB_MAX_TEXT); ++p) {
+ switch (*p) {
+ case '{':
+ comment++;
+ break;
+ case '}':
+ if (comment) {
+ --comment;
+ /* the next line to get rid of a blank after the comment */
+ if ((*(p + 1)) == ' ')
+ p++;
+ }
+ break;
+ case '~':
+ if (!comment) {
+ *q = ' ';
+ ++q;
+ }
+ break;
+ case ' ':
+ case '\t':
+ if ((*(p + 1) == ' ') || (*(p + 1) == '\t'))
+ break;
+ if (!comment) {
+ *q = ' ';
+ ++q;
+ }
+ break;
+ case '\\':
+ if (*(p + 1) == 'n') {
+ *q = '\0';
+ q = line1;
+ current->text[current->lines++] = strdup(line1);
+ ++p;
+ break;
+ }
+ if ((*(p + 1) == 'C') || (*(p + 1) == 'c') ||
+ (*(p + 1) == 'F') || (*(p + 1) == 'f')) {
+ ++p,++p;
+ break;
+ }
+ if ((*(p + 1) == 'B') || (*(p + 1) == 'b') ||
+ /* actually this means "insert current date here" */
+ (*(p + 1) == 'D') ||
+ (*(p + 1) == 'I') || (*(p + 1) == 'i') ||
+ (*(p + 1) == 'N') ||
+ /* actually this means "insert current time here" */
+ (*(p + 1) == 'T') ||
+ (*(p + 1) == 'U') || (*(p + 1) == 'u')) {
+ ++p;
+ break;
+ }
+ if ((*(p + 1) == '\\') ||
+ (*(p + 1) == '~') || (*(p + 1) == '{')) {
+ ++p;
+ } else if (eol(*(p + 1))) {
+ if (!read_line_from_input(this, directive, LINE_LEN))
+ return NULL;
+ trail_space(directive);
+ strncat(line2, directive,
+ ((LINE_LEN > 511) ? LINE_LEN-1 : 511)
+ - strlen(line2));
+ break;
+ }
+ default:
+ if (!comment) {
+ *q = *p;
+ ++q;
+ }
+ }
+ }
+ *q = '\0';
+ if (current->lines < SUB_MAX_TEXT)
+ current->text[current->lines] = strdup(line1);
+ else
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ }
+ current->lines++;
+ return current;
+}
+
+static subtitle_t *sub_read_line_subviewer2(demux_sputext_t *this, subtitle_t *current) {
+ char line[LINE_LEN+1];
+ int a1,a2,a3,a4;
+ char *p=NULL;
+ int i,len;
+
+ while (!current->text[0]) {
+ if (!read_line_from_input(this, line, LINE_LEN)) return NULL;
+ if (line[0]!='{')
+ continue;
+ if ((len=sscanf (line, "{T %d:%d:%d:%d",&a1,&a2,&a3,&a4)) < 4)
+ continue;
+ current->start = a1*360000+a2*6000+a3*100+a4/10;
+ for (i=0; i<SUB_MAX_TEXT;) {
+ if (!read_line_from_input(this, line, LINE_LEN)) break;
+ if (line[0]=='}') break;
+ len=0;
+ for (p=line; *p!='\n' && *p!='\r' && *p; ++p,++len);
+ if (len) {
+ current->text[i] = strndup(line, len);
+ if (!current->text[i]) return ERR;
+ ++i;
+ } else {
+ break;
+ }
+ }
+ current->lines=i;
+ }
+ return current;
+}
+
+static subtitle_t *sub_read_line_subrip09 (demux_sputext_t *this, subtitle_t *current) {
+ char line[LINE_LEN + 1];
+ char *next;
+ int h, m, s;
+ int i;
+
+ memset (current, 0, sizeof(subtitle_t));
+
+ do {
+ if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
+ } while (sscanf (line, "[%d:%d:%d]", &h, &m, &s) != 3);
+
+ if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
+
+ current->start = 360000 * h + 6000 * m + 100 * s;
+ current->end = -1;
+
+ next=line;
+ i=0;
+ while ((next = sub_readtext (next, &(current->text[i])))) {
+ if (current->text[i]==ERR) return ERR;
+ i++;
+ if (i>=SUB_MAX_TEXT) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ current->lines=i;
+ return current;
+ }
+ }
+ current->lines= ++i;
+
+ return current;
+}
+
+/* Code from subreader.c of MPlayer
+** Sylvain "Skarsnik" Colinet <scolinet@gmail.com>
+*/
+
+static subtitle_t *sub_read_line_mpl2(demux_sputext_t *this, subtitle_t *current) {
+ char line[LINE_LEN+1];
+ char line2[LINE_LEN+1];
+ char *p, *next;
+ int i;
+
+ memset (current, 0, sizeof(subtitle_t));
+ do {
+ if (!read_line_from_input (this, line, LINE_LEN)) return NULL;
+ } while ((sscanf (line,
+ "[%ld][%ld]%[^\r\n]",
+ &(current->start), &(current->end), line2) < 3));
+ current->start *= 10;
+ current->end *= 10;
+ p=line2;
+
+ next=p, i=0;
+ while ((next = sub_readtext (next, &(current->text[i])))) {
+ if (current->text[i] == ERR) {return ERR;}
+ i++;
+ if (i >= SUB_MAX_TEXT) {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "Too many lines in a subtitle\n");
+ current->lines = i;
+ return current;
+ }
+ }
+ current->lines= ++i;
+
+ return current;
+}
+
+
+
+static int sub_autodetect (demux_sputext_t *this) {
+
+ char line[LINE_LEN + 1];
+ int i, j=0;
+ char p;
+
+ while (j < 100) {
+ j++;
+ if (!read_line_from_input(this, line, LINE_LEN))
+ return FORMAT_UNKNOWN;
+
+ if ((sscanf (line, "{%d}{}", &i)==1) ||
+ (sscanf (line, "{%d}{%d}", &i, &i)==2)) {
+ this->uses_time=0;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "microdvd subtitle format detected\n");
+ return FORMAT_MICRODVD;
+ }
+
+ if (sscanf (line, "%d:%d:%d%*[,.]%d --> %d:%d:%d%*[,.]%d", &i, &i, &i, &i, &i, &i, &i, &i)==8) {
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subrip subtitle format detected\n");
+ return FORMAT_SUBRIP;
+ }
+
+ if (sscanf (line, "%d:%d:%d.%d,%d:%d:%d.%d", &i, &i, &i, &i, &i, &i, &i, &i)==8){
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer subtitle format detected\n");
+ return FORMAT_SUBVIEWER;
+ }
+
+ if (sscanf (line, "%d:%d:%d,%d,%d:%d:%d,%d", &i, &i, &i, &i, &i, &i, &i, &i)==8){
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer subtitle format detected\n");
+ return FORMAT_SUBVIEWER;
+ }
+
+ if (strstr (line, "<SAMI>")) {
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "sami subtitle format detected\n");
+ return FORMAT_SAMI;
+ }
+ if (sscanf (line, "%d:%d:%d:", &i, &i, &i )==3) {
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "vplayer subtitle format detected\n");
+ return FORMAT_VPLAYER;
+ }
+ /*
+ * A RealText format is a markup language, starts with <window> tag,
+ * options (behaviour modifiers) are possible.
+ */
+ if ( !strcasecmp(line, "<window") ) {
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "rt subtitle format detected\n");
+ return FORMAT_RT;
+ }
+ if ((!memcmp(line, "Dialogue: Marked", 16)) || (!memcmp(line, "Dialogue: ", 10))) {
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "ssa subtitle format detected\n");
+ return FORMAT_SSA;
+ }
+ if (sscanf (line, "%d,%d,\"%c", &i, &i, (char *) &i) == 3) {
+ this->uses_time=0;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "pjs subtitle format detected\n");
+ return FORMAT_PJS;
+ }
+ if (sscanf (line, "FORMAT=%d", &i) == 1) {
+ this->uses_time=0;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "mpsub subtitle format detected\n");
+ return FORMAT_MPSUB;
+ }
+ if (sscanf (line, "FORMAT=TIM%c", &p)==1 && p=='E') {
+ this->uses_time=1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "mpsub subtitle format detected\n");
+ return FORMAT_MPSUB;
+ }
+ if (strstr (line, "-->>")) {
+ this->uses_time=0;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "aqtitle subtitle format detected\n");
+ return FORMAT_AQTITLE;
+ }
+ if (sscanf(line, "@%d @%d", &i, &i) == 2 ||
+ sscanf(line, "%d:%d:%d.%d %d:%d:%d.%d", &i, &i, &i, &i, &i, &i, &i, &i) == 8) {
+ this->uses_time = 1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "jacobsub subtitle format detected\n");
+ return FORMAT_JACOBSUB;
+ }
+ if (sscanf(line, "{T %d:%d:%d:%d",&i, &i, &i, &i) == 4) {
+ this->uses_time = 1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subviewer 2.0 subtitle format detected\n");
+ return FORMAT_SUBVIEWER2;
+ }
+ if (sscanf(line, "[%d:%d:%d]", &i, &i, &i) == 3) {
+ this->uses_time = 1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subrip 0.9 subtitle format detected\n");
+ return FORMAT_SUBRIP09;
+ }
+
+ if (sscanf (line, "[%d][%d]", &i, &i) == 2) {
+ this->uses_time = 1;
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "mpl2 subtitle format detected\n");
+ return FORMAT_MPL2;
+ }
+ }
+ return FORMAT_UNKNOWN; /* too many bad lines */
+}
+
+static subtitle_t *sub_read_file (demux_sputext_t *this) {
+
+ int n_max;
+ int timeout;
+ subtitle_t *first;
+ subtitle_t * (*func[])(demux_sputext_t *this,subtitle_t *dest)=
+ {
+ sub_read_line_microdvd,
+ sub_read_line_subrip,
+ sub_read_line_subviewer,
+ sub_read_line_sami,
+ sub_read_line_vplayer,
+ sub_read_line_rt,
+ sub_read_line_ssa,
+ sub_read_line_pjs,
+ sub_read_line_mpsub,
+ sub_read_line_aqt,
+ sub_read_line_jacobsub,
+ sub_read_line_subviewer2,
+ sub_read_line_subrip09,
+ sub_read_line_mpl2,
+ };
+
+ /* Rewind (sub_autodetect() needs to read input from the beginning) */
+ if(this->input->seek(this->input, 0, SEEK_SET) == -1) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "seek failed.\n");
+ return NULL;
+ }
+ this->buflen = 0;
+
+ this->format=sub_autodetect (this);
+ if (this->format==FORMAT_UNKNOWN) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Could not determine file format\n");
+ return NULL;
+ }
+
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "Detected subtitle file format: %d\n",this->format);
+
+ /* Rewind */
+ if(this->input->seek(this->input, 0, SEEK_SET) == -1) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "seek failed.\n");
+ return NULL;
+ }
+ this->buflen = 0;
+
+ this->num=0;n_max=32;
+ first = calloc(n_max, sizeof(subtitle_t));
+ if(!first) return NULL;
+ timeout = ((demux_sputext_class_t *)
+ (this->demux_plugin.demux_class))->max_timeout;
+ if (this->uses_time) timeout *= 100;
+ else timeout *= 10;
+
+ while(1) {
+ subtitle_t *sub;
+
+ if(this->num>=n_max){
+ n_max+=16;
+ first=realloc(first,n_max*sizeof(subtitle_t));
+ }
+
+ sub = func[this->format] (this, &first[this->num]);
+
+ if (!sub)
+ break; /* EOF */
+
+ if (sub==ERR)
+ ++this->errs;
+ else {
+ if (this->num > 0 && first[this->num-1].end == -1) {
+ /* end time not defined in the subtitle */
+ if (timeout > 0) {
+ /* timeout */
+ if (timeout > sub->start - first[this->num-1].start) {
+ first[this->num-1].end = sub->start;
+ } else
+ first[this->num-1].end = first[this->num-1].start + timeout;
+ } else {
+ /* no timeout */
+ first[this->num-1].end = sub->start;
+ }
+ }
+ ++this->num; /* Error vs. Valid */
+ }
+ }
+ /* timeout of last subtitle */
+ if (this->num > 0 && first[this->num-1].end == -1)
+ if (timeout > 0) {
+ first[this->num-1].end = first[this->num-1].start + timeout;
+ }
+
+ if(this->stream->xine->verbosity >= XINE_VERBOSITY_DEBUG) {
+ char buffer[1024];
+
+ sprintf(buffer, "Read %i subtitles", this->num);
+
+ if(this->errs)
+ sprintf(buffer + strlen(buffer), ", %i bad line(s).\n", this->errs);
+ else
+ strcat(buffer, "\n");
+
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "%s", buffer);
+ }
+
+ return first;
+}
+
+static int demux_sputext_next (demux_sputext_t *this_gen) {
+ demux_sputext_t *this = (demux_sputext_t *) this_gen;
+ buf_element_t *buf;
+ uint32_t *val;
+ char *str;
+ subtitle_t *sub;
+ int line;
+
+ if (this->cur >= this->num)
+ return 0;
+
+ sub = &this->subtitles[this->cur];
+
+ buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo);
+ buf->type = BUF_SPU_TEXT;
+ buf->pts = 0;
+
+ val = (uint32_t * )buf->content;
+ *val++ = sub->lines;
+ *val++ = this->uses_time;
+ *val++ = (this->uses_time) ? sub->start * 10 : sub->start;
+ *val++ = (this->uses_time) ? sub->end * 10 : sub->end;
+ str = (char *)val;
+ for (line = 0; line < sub->lines; line++, str+=strlen(str)+1) {
+ strncpy(str, sub->text[line], SUB_BUFSIZE-1);
+ str[SUB_BUFSIZE-1] = '\0';
+ }
+
+ this->stream->video_fifo->put(this->stream->video_fifo, buf);
+ this->cur++;
+
+ return 1;
+}
+
+static void demux_sputext_dispose (demux_plugin_t *this_gen) {
+ demux_sputext_t *this = (demux_sputext_t *) this_gen;
+ int i, l;
+
+ for (i = 0; i < this->num; i++) {
+ for (l = 0; l < this->subtitles[i].lines; l++)
+ free(this->subtitles[i].text[l]);
+ }
+ free(this->subtitles);
+ free(this);
+}
+
+static int demux_sputext_get_status (demux_plugin_t *this_gen) {
+ demux_sputext_t *this = (demux_sputext_t *) this_gen;
+ return this->status;
+}
+
+static int demux_sputext_get_stream_length (demux_plugin_t *this_gen) {
+ demux_sputext_t *this = (demux_sputext_t *) this_gen;
+
+ if( this->uses_time && this->num ) {
+ return this->subtitles[this->num-1].end * 10;
+ } else {
+ return 0;
+ }
+}
+
+static int demux_sputext_send_chunk (demux_plugin_t *this_gen) {
+ demux_sputext_t *this = (demux_sputext_t *) this_gen;
+
+ if (!demux_sputext_next (this)) {
+ this->status = DEMUX_FINISHED;
+ }
+
+ return this->status;
+}
+
+static int demux_sputext_seek (demux_plugin_t *this_gen,
+ off_t start_pos, int start_time, int playing) {
+ demux_sputext_t *this = (demux_sputext_t*)this_gen;
+
+ lprintf("seek() called\n");
+
+ /* simple seeking approach: just go back to start.
+ * decoder will discard subtitles until the desired position.
+ */
+ this->cur = 0;
+ this->status = DEMUX_OK;
+
+ _x_demux_flush_engine (this->stream);
+ _x_demux_control_newpts(this->stream, 0, 0);
+
+ return this->status;
+}
+
+static void demux_sputext_send_headers(demux_plugin_t *this_gen) {
+ demux_sputext_t *this = (demux_sputext_t*)this_gen;
+ buf_element_t *buf;
+
+
+ lprintf("send_headers() called\n");
+
+ _x_demux_control_start(this->stream);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 0);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 0);
+
+ /* enable the SPU channel */
+ buf = this->stream->video_fifo->buffer_pool_alloc(this->stream->video_fifo);
+ buf->type = BUF_CONTROL_SPU_CHANNEL;
+ buf->decoder_info[0] = buf->decoder_info[1] = buf->decoder_info[2] = 0;
+ this->stream->video_fifo->put(this->stream->video_fifo, buf);
+
+ this->status = DEMUX_OK;
+}
+
+static uint32_t demux_sputext_get_capabilities(demux_plugin_t *this_gen) {
+ return DEMUX_CAP_NOCAP;
+}
+
+static int demux_sputext_get_optional_data(demux_plugin_t *this_gen,
+ void *data, int data_type) {
+ int channel = *((int *)data);
+
+ switch (data_type) {
+ case DEMUX_OPTIONAL_DATA_SPULANG:
+ if (channel == -1 || channel == 0) {
+ strcpy(data, "sub");
+ return DEMUX_OPTIONAL_SUCCESS;
+ }
+ default:
+ return DEMUX_OPTIONAL_UNSUPPORTED;
+ }
+}
+
+static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_t *stream,
+ input_plugin_t *input_gen) {
+
+ input_plugin_t *input = (input_plugin_t *) input_gen;
+ demux_sputext_t *this;
+
+ lprintf("open_plugin() called\n");
+
+ this = calloc(1, sizeof (demux_sputext_t));
+ this->stream = stream;
+ this->input = input;
+
+ this->demux_plugin.send_headers = demux_sputext_send_headers;
+ this->demux_plugin.send_chunk = demux_sputext_send_chunk;
+ this->demux_plugin.seek = demux_sputext_seek;
+ this->demux_plugin.dispose = demux_sputext_dispose;
+ this->demux_plugin.get_status = demux_sputext_get_status;
+ this->demux_plugin.get_stream_length = demux_sputext_get_stream_length;
+ this->demux_plugin.get_capabilities = demux_sputext_get_capabilities;
+ this->demux_plugin.get_optional_data = demux_sputext_get_optional_data;
+ this->demux_plugin.demux_class = class_gen;
+
+ this->buflen = 0;
+
+ switch (stream->content_detection_method) {
+ case METHOD_BY_MRL:
+ {
+ const char *const mrl = input->get_mrl(input);
+ const char *const ending = strrchr(mrl, '.');
+
+ if (!ending || (
+ (strncasecmp(ending, ".asc", 4) != 0) &&
+ (strncasecmp(ending, ".txt", 4) != 0) &&
+ (strncasecmp(ending, ".sub", 4) != 0) &&
+ (strncasecmp(ending, ".srt", 4) != 0) &&
+ (strncasecmp(ending, ".smi", 4) != 0) &&
+ (strncasecmp(ending, ".ssa", 4) != 0) &&
+ (strncasecmp(ending, ".ass", 4) != 0))) {
+ free (this);
+ return NULL;
+ }
+ }
+ /* falling through is intended */
+
+ case METHOD_EXPLICIT:
+ /* case METHOD_BY_CONTENT: */
+
+ /* FIXME: for now this demuxer only works when requested explicitly
+ * to make sure it does not interfere with others;
+ * If this is found too inconvenient, this may be changed after making
+ * sure the content detection does not produce any false positives.
+ */
+
+ if ((input->get_capabilities(input) & INPUT_CAP_SEEKABLE) != 0) {
+
+ this->subtitles = sub_read_file (this);
+
+ this->cur = 0;
+
+ if (this->subtitles) {
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG, "subtitle format %s time.\n",
+ this->uses_time ? "uses" : "doesn't use");
+ xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "read %i subtitles, %i errors.\n", this->num, this->errs);
+ return &this->demux_plugin;
+ }
+ }
+ /* falling through is intended */
+ }
+
+ free (this);
+ return NULL;
+}
+
+static void config_timeout_cb(void *this_gen, xine_cfg_entry_t *entry) {
+ demux_sputext_class_t *this = (demux_sputext_class_t *)this_gen;
+
+ this->max_timeout = entry->num_value;
+}
+
+void *init_sputext_demux_class (xine_t *xine, void *data) {
+
+ demux_sputext_class_t *this ;
+
+ lprintf("initializing\n");
+
+ this = calloc(1, sizeof (demux_sputext_class_t));
+
+ this->demux_class.open_plugin = open_demux_plugin;
+ this->demux_class.description = N_("sputext demuxer plugin");
+ this->demux_class.identifier = "sputext";
+ /* do not report this mimetype, it might confuse browsers. */
+ /* "text/plain: asc txt sub srt: VIDEO subtitles;" */
+ this->demux_class.mimetypes = NULL;
+ this->demux_class.extensions = "asc txt sub srt smi ssa ass";
+ this->demux_class.dispose = default_demux_class_dispose;
+
+ /*
+ * Some subtitling formats, namely AQT and Subrip09, define the end of a
+ * subtitle as the beginning of the following. From end-user view it's
+ * better define timeout of hidding. Setting to zero means "no timeout".
+ */
+ this->max_timeout = xine->config->register_num(xine->config,
+ "subtitles.separate.timeout", 4,
+ _("default duration of subtitle display in seconds"),
+ _("Some subtitle formats do not explicitly give a duration for each subtitle. "
+ "For these, you can set a default duration here. Setting to zero will result "
+ "in the subtitle being shown until the next one takes over."),
+ 20, config_timeout_cb, this);
+
+ return this;
+}
diff --git a/src/spu_dec/xine_cc_decoder.c b/src/spu_dec/xine_cc_decoder.c
new file mode 100644
index 000000000..fc69304cc
--- /dev/null
+++ b/src/spu_dec/xine_cc_decoder.c
@@ -0,0 +1,361 @@
+/*
+ * Copyright (C) 2000-2008 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, USA
+ *
+ * closed caption spu decoder. receive data by events.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include <xine/buffer.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include "cc_decoder.h"
+
+/*
+#define LOG_DEBUG 1
+*/
+
+static const char *const cc_schemes[NUM_CC_PALETTES + 1] = {
+ "White/Gray/Translucent",
+ "White/Black/Solid",
+ NULL
+};
+
+typedef struct spucc_decoder_s {
+ spu_decoder_t spu_decoder;
+
+ xine_stream_t *stream;
+
+ /* closed captioning decoder state */
+ cc_decoder_t *ccdec;
+ /* true if ccdec has been initialized */
+ int cc_open;
+
+ /* closed captioning decoder configuration and intrinsics */
+ cc_state_t cc_state;
+ /* this is to detect configuration changes */
+ int config_version;
+
+ /* video dimensions captured in frame change events */
+ int video_width;
+ int video_height;
+
+ /* events will be sent here */
+ xine_event_queue_t *queue;
+
+} spucc_decoder_t;
+
+
+/*------------------- general utility functions ----------------------------*/
+
+static void copy_str(char *d, const char *s, size_t maxbytes)
+{
+ strncpy(d, s, maxbytes - 1);
+ d[maxbytes - 1] = '\0';
+}
+
+
+/*------------------- private methods --------------------------------------*/
+
+static void spucc_update_intrinsics(spucc_decoder_t *this)
+{
+#ifdef LOG_DEBUG
+ printf("spucc: update_intrinsics\n");
+#endif
+
+ if (this->cc_open)
+ cc_renderer_update_cfg(this->cc_state.renderer, this->video_width,
+ this->video_height);
+}
+
+static void spucc_do_close(spucc_decoder_t *this)
+{
+ if (this->cc_open) {
+#ifdef LOG_DEBUG
+ printf("spucc: close\n");
+#endif
+ cc_decoder_close(this->ccdec);
+ cc_renderer_close(this->cc_state.renderer);
+ this->cc_open = 0;
+ }
+}
+
+static void spucc_do_init (spucc_decoder_t *this)
+{
+ if (! this->cc_open) {
+#ifdef LOG_DEBUG
+ printf("spucc: init\n");
+#endif
+ /* initialize caption renderer */
+ this->cc_state.renderer = cc_renderer_open(this->stream->osd_renderer,
+ this->stream->metronom,
+ &this->cc_state,
+ this->video_width,
+ this->video_height);
+ spucc_update_intrinsics(this);
+ /* initialize CC decoder */
+ this->ccdec = cc_decoder_open(&this->cc_state);
+ this->cc_open = 1;
+ }
+}
+
+
+/*----------------- configuration listeners --------------------------------*/
+
+static void spucc_cfg_enable_change(void *this_gen, xine_cfg_entry_t *value)
+{
+ spucc_class_t *this = (spucc_class_t *) this_gen;
+ cc_config_t *cc_cfg = &this->cc_cfg;
+
+ cc_cfg->cc_enabled = value->num_value;
+#ifdef LOG_DEBUG
+ printf("spucc: closed captions are now %s.\n", cc_cfg->cc_enabled?
+ "enabled" : "disabled");
+#endif
+ cc_cfg->config_version++;
+}
+
+
+static void spucc_cfg_scheme_change(void *this_gen, xine_cfg_entry_t *value)
+{
+ spucc_class_t *this = (spucc_class_t *) this_gen;
+ cc_config_t *cc_cfg = &this->cc_cfg;
+
+ cc_cfg->cc_scheme = value->num_value;
+#ifdef LOG_DEBUG
+ printf("spucc: closed captioning scheme is now %s.\n",
+ cc_schemes[cc_cfg->cc_scheme]);
+#endif
+ cc_cfg->config_version++;
+}
+
+
+static void spucc_font_change(void *this_gen, xine_cfg_entry_t *value)
+{
+ spucc_class_t *this = (spucc_class_t *) this_gen;
+ cc_config_t *cc_cfg = &this->cc_cfg;
+ char *font;
+
+ if (strcmp(value->key, "subtitles.closedcaption.font") == 0)
+ font = cc_cfg->font;
+ else
+ font = cc_cfg->italic_font;
+
+ copy_str(font, value->str_value, CC_FONT_MAX);
+#ifdef LOG_DEBUG
+ printf("spucc: changing %s to font %s\n", value->key, font);
+#endif
+ cc_cfg->config_version++;
+}
+
+
+static void spucc_num_change(void *this_gen, xine_cfg_entry_t *value)
+{
+ spucc_class_t *this = (spucc_class_t *) this_gen;
+ cc_config_t *cc_cfg = &this->cc_cfg;
+ int *num;
+
+ if (strcmp(value->key, "subtitles.closedcaption.font_size") == 0)
+ num = &cc_cfg->font_size;
+ else
+ num = &cc_cfg->center;
+
+ *num = value->num_value;
+#ifdef LOG_DEBUG
+ printf("spucc: changing %s to %d\n", value->key, *num);
+#endif
+ cc_cfg->config_version++;
+}
+
+
+static void spucc_register_cfg_vars(spucc_class_t *this,
+ config_values_t *xine_cfg) {
+ cc_config_t *cc_vars = &this->cc_cfg;
+
+ cc_vars->cc_enabled = xine_cfg->register_bool(xine_cfg,
+ "subtitles.closedcaption.enabled", 0,
+ _("display closed captions in MPEG-2 streams"),
+ _("Closed Captions are subtitles mostly meant "
+ "to help the hearing impaired."),
+ 0, spucc_cfg_enable_change, this);
+
+ cc_vars->cc_scheme = xine_cfg->register_enum(xine_cfg,
+ "subtitles.closedcaption.scheme", 0,
+ (char **)cc_schemes,
+ _("closed-captioning foreground/background scheme"),
+ _("Choose your favourite rendering of the closed "
+ "captions."),
+ 10, spucc_cfg_scheme_change, this);
+
+ copy_str(cc_vars->font,
+ xine_cfg->register_string(xine_cfg, "subtitles.closedcaption.font", "cc",
+ _("standard closed captioning font"),
+ _("Choose the font for standard closed captions text."),
+ 20, spucc_font_change, this),
+ CC_FONT_MAX);
+
+ copy_str(cc_vars->italic_font,
+ xine_cfg->register_string(xine_cfg, "subtitles.closedcaption.italic_font", "cci",
+ _("italic closed captioning font"),
+ _("Choose the font for italic closed captions text."),
+ 20, spucc_font_change, this),
+ CC_FONT_MAX);
+
+ cc_vars->font_size = xine_cfg->register_num(xine_cfg, "subtitles.closedcaption.font_size",
+ 24,
+ _("closed captioning font size"),
+ _("Choose the font size for closed captions text."),
+ 10, spucc_num_change, this);
+
+ cc_vars->center = xine_cfg->register_bool(xine_cfg, "subtitles.closedcaption.center", 1,
+ _("center-adjust closed captions"),
+ _("When enabled, closed captions will be positioned "
+ "by the center of the individual lines."),
+ 20, spucc_num_change, this);
+}
+
+
+/* called when the video frame size changes */
+static void spucc_notify_frame_change(spucc_decoder_t *this,
+ int width, int height) {
+#ifdef LOG_DEBUG
+ printf("spucc: new frame size: %dx%d\n", width, height);
+#endif
+
+ this->video_width = width;
+ this->video_height = height;
+ spucc_update_intrinsics(this);
+}
+
+
+/*------------------- implementation of spudec interface -------------------*/
+
+static void spudec_decode_data (spu_decoder_t *this_gen, buf_element_t *buf) {
+ spucc_decoder_t *this = (spucc_decoder_t *) this_gen;
+ xine_event_t *event;
+
+ while ((event = xine_event_get(this->queue))) {
+ switch (event->type) {
+ case XINE_EVENT_FRAME_FORMAT_CHANGE:
+ {
+ xine_format_change_data_t *frame_change =
+ (xine_format_change_data_t *)event->data;
+
+ spucc_notify_frame_change(this, frame_change->width,
+ frame_change->height);
+ }
+ break;
+ }
+ xine_event_free(event);
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW) {
+ } else {
+
+ if (this->cc_state.cc_cfg->config_version > this->config_version) {
+ spucc_update_intrinsics(this);
+ if (!this->cc_state.cc_cfg->cc_enabled)
+ spucc_do_close(this);
+ this->config_version = this->cc_state.cc_cfg->config_version;
+ }
+
+ if (this->cc_state.cc_cfg->cc_enabled) {
+ if( !this->cc_open )
+ spucc_do_init (this);
+ if(this->cc_state.can_cc) {
+ decode_cc(this->ccdec, buf->content, buf->size,
+ buf->pts);
+ }
+ }
+ }
+}
+
+static void spudec_reset (spu_decoder_t *this_gen) {
+}
+
+static void spudec_discontinuity (spu_decoder_t *this_gen) {
+}
+
+static void spudec_dispose (spu_decoder_t *this_gen) {
+ spucc_decoder_t *this = (spucc_decoder_t *) this_gen;
+
+ spucc_do_close(this);
+ xine_event_dispose_queue(this->queue);
+ free (this);
+}
+
+
+static spu_decoder_t *spudec_open_plugin (spu_decoder_class_t *class, xine_stream_t *stream) {
+
+ spucc_decoder_t *this ;
+
+ this = (spucc_decoder_t *) calloc(1, sizeof(spucc_decoder_t));
+
+ this->spu_decoder.decode_data = spudec_decode_data;
+ this->spu_decoder.reset = spudec_reset;
+ this->spu_decoder.discontinuity = spudec_discontinuity;
+ this->spu_decoder.dispose = spudec_dispose;
+ this->spu_decoder.get_interact_info = NULL;
+ this->spu_decoder.set_button = NULL;
+
+ this->stream = stream;
+ this->queue = xine_event_new_queue(stream);
+ this->cc_state.cc_cfg = &((spucc_class_t *)class)->cc_cfg;
+ this->config_version = 0;
+ this->cc_open = 0;
+
+ return &this->spu_decoder;
+}
+
+static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
+
+ spucc_class_t *this ;
+
+ this = (spucc_class_t *) calloc(1, sizeof(spucc_class_t));
+
+ this->spu_class.open_plugin = spudec_open_plugin;
+ this->spu_class.identifier = "spucc";
+ this->spu_class.description = N_("closed caption decoder plugin");
+ this->spu_class.dispose = default_spu_decoder_class_dispose;
+
+ spucc_register_cfg_vars(this, xine->config);
+ this->cc_cfg.config_version = 0;
+
+ return &this->spu_class;
+}
+
+/* plugin catalog information */
+static const uint32_t supported_types[] = { BUF_SPU_CC, 0 };
+
+static const decoder_info_t spudec_info = {
+ supported_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_SPU_DECODER, 17, "spucc", XINE_VERSION_CODE, &spudec_info, &init_spu_decoder_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/vdr/Makefile.am b/src/vdr/Makefile.am
new file mode 100644
index 000000000..68e6cd822
--- /dev/null
+++ b/src/vdr/Makefile.am
@@ -0,0 +1,14 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+if ENABLE_VDR
+xineplug_LTLIBRARIES = xineplug_vdr.la
+endif
+
+xineplug_vdr_la_SOURCES = combined_vdr.c combined_vdr.h input_vdr.c post_vdr_video.c post_vdr_audio.c
+xineplug_vdr_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_vdr_la_LIBADD = $(XINE_LIB) $(PTHREAD_LIBS)
diff --git a/src/vdr/combined_vdr.c b/src/vdr/combined_vdr.c
new file mode 100644
index 000000000..0dd7a5f26
--- /dev/null
+++ b/src/vdr/combined_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/*
+ * plugins for VDR
+ */
+
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include "combined_vdr.h"
+
+
+
+static const post_info_t vdr_video_special_info = { XINE_POST_TYPE_VIDEO_FILTER };
+static const post_info_t vdr_audio_special_info = { XINE_POST_TYPE_AUDIO_FILTER };
+
+/* exported plugin catalog entry */
+const plugin_info_t xine_plugin_info[] EXPORTED =
+{
+ /* type , API, "name" , version , special_info , init_function */
+ { PLUGIN_INPUT, 18, "VDR" , XINE_VERSION_CODE, NULL , &vdr_input_init_plugin },
+ { PLUGIN_POST , 10, "vdr" , XINE_VERSION_CODE, &vdr_video_special_info, &vdr_video_init_plugin },
+ { PLUGIN_POST , 10, "vdr_video", XINE_VERSION_CODE, &vdr_video_special_info, &vdr_video_init_plugin },
+ { PLUGIN_POST , 10, "vdr_audio", XINE_VERSION_CODE, &vdr_audio_special_info, &vdr_audio_init_plugin },
+ { PLUGIN_NONE , 0, "" , 0 , NULL , NULL }
+};
+
diff --git a/src/vdr/combined_vdr.h b/src/vdr/combined_vdr.h
new file mode 100644
index 000000000..9757bff50
--- /dev/null
+++ b/src/vdr/combined_vdr.h
@@ -0,0 +1,82 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#ifndef __COMBINED_VDR_H
+#define __COMBINED_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;
+ }
+
+ if (stream->input_plugin->input_class->identifier &&
+ 0 == strcmp(stream->input_plugin->input_class->identifier, "VDR"))
+ return 1;
+
+ return 0;
+}
+
+
+
+/* plugin class initialization function */
+void *vdr_input_init_plugin(xine_t *xine, void *data);
+void *vdr_video_init_plugin(xine_t *xine, void *data);
+void *vdr_audio_init_plugin(xine_t *xine, void *data);
+
+
+
+#endif /* __COMBINED_VDR_H */
+
diff --git a/src/vdr/input_vdr.c b/src/vdr/input_vdr.c
new file mode 100644
index 000000000..53da46c51
--- /dev/null
+++ b/src/vdr/input_vdr.c
@@ -0,0 +1,2771 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+#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 <netinet/in.h>
+#include <resolv.h>
+#include <netdb.h>
+
+#define LOG_MODULE "input_vdr"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/input_plugin.h>
+
+#include <xine/vdr.h>
+#include "combined_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 vdr_input_plugin_s vdr_input_plugin_t;
+
+typedef struct
+{
+ metronom_t metronom;
+ metronom_t *stream_metronom;
+ vdr_input_plugin_t *input;
+}
+vdr_metronom_t;
+
+
+typedef struct vdr_osd_s
+{
+ xine_osd_t *window;
+ uint8_t *argb_buffer[ 2 ];
+ int width;
+ int height;
+}
+vdr_osd_t;
+
+
+typedef struct vdr_vpts_offset_s vdr_vpts_offset_t;
+
+struct vdr_vpts_offset_s
+{
+ vdr_vpts_offset_t *next;
+ int64_t vpts;
+ int64_t offset;
+};
+
+
+struct vdr_input_plugin_s
+{
+ 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;
+
+ vdr_osd_t osd[ VDR_MAX_NUM_WINDOWS ];
+ uint8_t *osd_buffer;
+ uint32_t osd_buffer_size;
+ uint8_t osd_unscaled_blending;
+ uint8_t osd_supports_custom_extent;
+ uint8_t osd_supports_argb_layer;
+
+ uint8_t audio_channels;
+ uint8_t mute_mode;
+ uint8_t volume_mode;
+ int last_volume;
+ vdr_frame_size_changed_data_t frame_size;
+
+ uint8_t trick_speed_mode;
+ uint8_t trick_speed_mode_blocked;
+ pthread_mutex_t trick_speed_mode_lock;
+ pthread_cond_t trick_speed_mode_cond;
+
+ pthread_t rpc_thread;
+ int rpc_thread_shutdown;
+ pthread_mutex_t rpc_thread_shutdown_lock;
+ pthread_cond_t rpc_thread_shutdown_cond;
+ int startup_phase;
+
+ pthread_t metronom_thread;
+ pthread_mutex_t metronom_thread_lock;
+ int64_t metronom_thread_request;
+ int metronom_thread_reply;
+ pthread_cond_t metronom_thread_request_cond;
+ pthread_cond_t metronom_thread_reply_cond;
+ pthread_mutex_t metronom_thread_call_lock;
+
+ 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;
+
+ uint8_t find_sync_point;
+ pthread_mutex_t find_sync_point_lock;
+
+ vdr_metronom_t metronom;
+ int last_disc_type;
+
+ vdr_vpts_offset_t *vpts_offset_queue;
+ vdr_vpts_offset_t *vpts_offset_queue_tail;
+ pthread_mutex_t vpts_offset_queue_lock;
+ pthread_cond_t vpts_offset_queue_changed_cond;
+ int vpts_offset_queue_changes;
+
+ int video_window_active;
+ vdr_set_video_window_data_t video_window_event_data;
+};
+
+
+typedef struct
+{
+ input_class_t input_class;
+ xine_t *xine;
+}
+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);
+ int matches4_3 = abs(ratio - 13333);
+ int matches16_9 = abs(ratio - 17778);
+
+ /* fprintf(stderr, "ratio: %d\n", ratio); */
+ if (matches4_3 < matches16_9)
+ {
+ 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
+ {
+ 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 void vdr_vpts_offset_queue_process(vdr_input_plugin_t *this, int64_t vpts)
+{
+ while (this->vpts_offset_queue
+ && this->vpts_offset_queue->vpts <= vpts)
+ {
+ vdr_vpts_offset_t *curr = this->vpts_offset_queue;
+ this->vpts_offset_queue = curr->next;
+
+ free(curr);
+ }
+
+ if (!this->vpts_offset_queue)
+ this->vpts_offset_queue_tail = 0;
+}
+
+
+static void vdr_vpts_offset_queue_purge(vdr_input_plugin_t *this)
+{
+ vdr_vpts_offset_queue_process(this, 1ll << 62);
+}
+
+
+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)@(%d,%d)\n", data->x, data->y, data->width, data->height, data->w_ref, data->h_ref));
+
+ fprintf(stderr, "vdr: osdnew %d\n", data->window);
+*/
+ if (data->window >= VDR_MAX_NUM_WINDOWS)
+ return -1;
+
+ if (0 != this->osd[ data->window ].window)
+ return -1;
+
+ this->osd[ data->window ].window = xine_osd_new(this->stream
+ , data->x
+ , data->y
+ , data->width
+ , data->height);
+
+ this->osd[ data->window ].width = data->width;
+ this->osd[ data->window ].height = data->height;
+
+ if (0 == this->osd[ data->window ].window)
+ return -1;
+
+ if (this->osd_supports_custom_extent && data->w_ref > 0 && data->h_ref > 0)
+ xine_osd_set_extent(this->osd[ data->window ].window, data->w_ref, data->h_ref);
+ }
+ break;
+
+ case func_osd_free:
+ {
+ int i;
+ 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[ data->window ].window)
+ xine_osd_free(this->osd[ data->window ].window);
+
+ this->osd[ data->window ].window = 0;
+
+ for (i = 0; i < 2; i++)
+ {
+ free(this->osd[ data->window ].argb_buffer[ i ]);
+ this->osd[ data->window ].argb_buffer[ i ] = 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[ data->window ].window)
+ {
+#ifdef XINE_OSD_CAP_VIDEO_WINDOW
+ xine_osd_set_video_window(this->osd[ data->window ].window
+ , this->video_window_active ? this->video_window_event_data.x : 0
+ , this->video_window_active ? this->video_window_event_data.y : 0
+ , this->video_window_active ? this->video_window_event_data.w : 0
+ , this->video_window_active ? this->video_window_event_data.h : 0);
+#endif
+ if (this->osd_unscaled_blending)
+ xine_osd_show_unscaled(this->osd[ data->window ].window, 0);
+ else
+ xine_osd_show(this->osd[ data->window ].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[ data->window ].window)
+ xine_osd_hide(this->osd[ data->window ].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)))
+ {
+break;
+ 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[ data->window ].window)
+ xine_osd_set_position(this->osd[ data->window ].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, %d, %d, %d, %d, %d\n", data->window, data->x, data->y, data->width, data->height, data->argb);
+*/
+ 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[ data->window ].window)
+ {
+ vdr_osd_t *osd = &this->osd[ data->window ];
+
+ if (data->argb)
+ {
+ int i;
+ for (i = 0; i < 2; i++)
+ {
+ if (!osd->argb_buffer[ i ])
+ osd->argb_buffer[ i ] = calloc(4 * osd->width, osd->height);
+
+ {
+ int src_stride = 4 * data->width;
+ int dst_stride = 4 * osd->width;
+
+ uint8_t *src = this->osd_buffer;
+ uint8_t *dst = osd->argb_buffer[ i ] + data->y * dst_stride + data->x * 4;
+ int y;
+
+ if (src_stride == dst_stride)
+ xine_fast_memcpy(dst, src, src_stride * data->height);
+ else
+ {
+ for (y = 0; y < data->height; y++)
+ {
+ xine_fast_memcpy(dst, src, src_stride);
+ dst += dst_stride;
+ src += src_stride;
+ }
+ }
+ }
+
+ if (i == 0)
+ xine_osd_set_argb_buffer(osd->window, (uint32_t *)osd->argb_buffer[ i ], data->x, data->y, data->width, data->height);
+ }
+ /* flip render and display buffer */
+ {
+ uint8_t *argb_buffer = osd->argb_buffer[ 0 ];
+ osd->argb_buffer[ 0 ] = osd->argb_buffer[ 1 ];
+ osd->argb_buffer[ 1 ] = argb_buffer;
+ }
+ }
+ else
+ xine_osd_draw_bitmap(osd->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[ data->window ].window)
+ {
+ uint32_t color[ 256 ];
+ uint8_t trans[ 256 ];
+
+ xine_osd_get_palette(this->osd[ data->window ].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[ data->window ].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): sync point: %02x\n", data->n, data->s ? 'b' : 'a', data->i); */
+ if (!data->s)
+ {
+ pthread_mutex_lock(&this->find_sync_point_lock);
+ this->find_sync_point = data->i;
+ pthread_mutex_unlock(&this->find_sync_point_lock);
+ }
+/*
+ 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;
+
+ this->video_window_active = (data->x != 0
+ || data->y != 0
+ || data->w != data->w_ref
+ || data->h != data->h_ref);
+
+ this->video_window_event_data.x = data->x;
+ this->video_window_event_data.y = data->y;
+ this->video_window_event_data.w = data->w;
+ this->video_window_event_data.h = data->h;
+ this->video_window_event_data.w_ref = data->w_ref;
+ this->video_window_event_data.h_ref = data->h_ref;
+
+ event.type = XINE_EVENT_VDR_SETVIDEOWINDOW;
+ event.data = &this->video_window_event_data;
+ event.data_length = sizeof (this->video_window_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)
+ {
+ pthread_mutex_lock(&this->trick_speed_mode_lock);
+
+ while (this->trick_speed_mode_blocked)
+ pthread_cond_wait(&this->trick_speed_mode_cond, &this->trick_speed_mode_lock);
+
+ this->trick_speed_mode = data->on;
+
+ pthread_mutex_unlock(&this->trick_speed_mode_lock);
+
+ _x_demux_seek(this->stream, 0, 0, 0);
+
+ {
+ xine_event_t event;
+
+ event.type = XINE_EVENT_VDR_TRICKSPEEDMODE;
+ event.data = 0;
+ event.data_length = 0; /* 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 == XINE_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:
+ {
+double t3, t2, t1, t0;
+ READ_DATA_OR_FAIL(set_volume, lprintf("got SETVOLUME\n"));
+t0 = _now();
+ {
+ int change_volume = (this->volume_mode != XINE_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 == XINE_VDR_VOLUME_CHANGE_SW) ? XINE_PARAM_AUDIO_AMP_MUTE : XINE_PARAM_AUDIO_MUTE;
+ int param_volume = (this->volume_mode == XINE_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 XINE_VDR_MUTE_EXECUTE:
+ report_change = 1;
+ xine_set_param(this->stream, param_mute, do_mute);
+
+ case XINE_VDR_MUTE_IGNORE:
+ if (do_mute)
+ change_volume = 0;
+ break;
+
+ case XINE_VDR_MUTE_SIMULATE:
+ change_volume = 1;
+ break;
+
+ default:
+ return -1;
+ };
+ }
+t1 = _now();
+
+ if (change_volume)
+ {
+ report_change = 1;
+ xine_set_param(this->stream, param_volume, this->last_volume);
+ }
+t2 = _now();
+
+ if (report_change && this->volume_mode != XINE_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);
+t3 = _now();
+
+ event.type = XINE_EVENT_AUDIO_LEVEL;
+ event.data = &data;
+ event.data_length = sizeof (data);
+
+ xine_event_send(this->stream, &event);
+ }
+ }
+/* fprintf(stderr, "volume: %6.3lf ms, %6.3lf ms, %6.3lf ms\n", t1 - t0, t2 - t1, t3 - t2); */
+ }
+ 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;
+
+ if (data->id == 1)
+ this->startup_phase = 0;
+ }
+ }
+ 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;
+
+ xine_current_frame_data_t frame_data;
+ memset(&frame_data, 0, sizeof (frame_data));
+
+ if (xine_get_current_frame_data(this->stream, &frame_data, XINE_FRAME_DATA_ALLOCATE_IMG))
+ {
+ if (frame_data.ratio_code == XINE_VO_ASPECT_SQUARE)
+ frame_data.ratio_code = 10000;
+ else if (frame_data.ratio_code == XINE_VO_ASPECT_4_3)
+ frame_data.ratio_code = 13333;
+ else if (frame_data.ratio_code == XINE_VO_ASPECT_ANAMORPHIC)
+ frame_data.ratio_code = 17778;
+ else if (frame_data.ratio_code == XINE_VO_ASPECT_DVB)
+ frame_data.ratio_code = 21100;
+ }
+
+ if (!frame_data.img)
+ memset(&frame_data, 0, sizeof (frame_data));
+
+ {
+ 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_data.img_size;
+
+ result_grab_image.width = frame_data.width;
+ result_grab_image.height = frame_data.height;
+ result_grab_image.ratio = frame_data.ratio_code;
+ result_grab_image.format = frame_data.format;
+ result_grab_image.interlaced = frame_data.interlaced;
+ result_grab_image.crop_left = frame_data.crop_left;
+ result_grab_image.crop_right = frame_data.crop_right;
+ result_grab_image.crop_top = frame_data.crop_top;
+ result_grab_image.crop_bottom = frame_data.crop_bottom;
+
+ if (sizeof (result_grab_image) == vdr_write(this->fh_result, &result_grab_image, sizeof (result_grab_image)))
+ {
+ if (!frame_data.img_size || (frame_data.img_size == vdr_write(this->fh_result, frame_data.img, frame_data.img_size)))
+ ret_val = 0;
+ }
+ }
+
+ free(frame_data.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);
+
+ pthread_mutex_lock(&this->vpts_offset_queue_lock);
+
+ while (this->vpts_offset_queue_changes)
+ pthread_cond_wait(&this->vpts_offset_queue_changed_cond, &this->vpts_offset_queue_lock);
+
+ if (this->last_disc_type == DISC_STREAMSTART
+ && data->ms_timeout > 0)
+ {
+ struct timespec abstime;
+ {
+ struct timeval now;
+ gettimeofday(&now, 0);
+
+ abstime.tv_sec = now.tv_sec + data->ms_timeout / 1000;
+ abstime.tv_nsec = now.tv_usec * 1000 + (data->ms_timeout % 1000) * 1e6;
+
+ if (abstime.tv_nsec > 1e9)
+ {
+ abstime.tv_nsec -= 1e9;
+ abstime.tv_sec++;
+ }
+ }
+
+ while (this->last_disc_type == DISC_STREAMSTART
+ || this->vpts_offset_queue_changes)
+ {
+ if (0 != pthread_cond_timedwait(&this->vpts_offset_queue_changed_cond, &this->vpts_offset_queue_lock, &abstime))
+ break;
+ }
+ }
+
+ if (this->last_disc_type == DISC_STREAMSTART
+ || this->vpts_offset_queue_changes)
+ {
+ result_get_pts.pts = -1;
+ result_get_pts.queued = 0;
+ }
+ else
+ {
+ int64_t offset, vpts = xine_get_current_vpts(this->stream);
+
+ vdr_vpts_offset_queue_process(this, vpts);
+
+/* if(this->vpts_offset_queue) */
+if(0)
+ {
+fprintf(stderr, "C ---------------------------------------------\n");
+ vdr_vpts_offset_t *p = this->vpts_offset_queue;
+ while (p)
+ {
+ fprintf(stderr, "C now: %12"PRId64", vpts: %12"PRId64", offset: %12"PRId64"\n", xine_get_current_vpts(this->stream), p->vpts, p->offset);
+ p = p->next;
+ }
+fprintf(stderr, "C =============================================\n");
+ }
+
+ if (this->vpts_offset_queue)
+ offset = this->vpts_offset_queue->offset;
+ else
+ offset = this->stream->metronom->get_option(this->stream->metronom, METRONOM_VPTS_OFFSET);
+
+ result_get_pts.pts = (vpts - offset) & ((1ll << 33) - 1);
+ result_get_pts.queued = !!this->vpts_offset_queue;
+/* fprintf(stderr, "vpts: %12ld, stc: %12ld, offset: %12ld\n", vpts, result_get_pts.pts, offset); */
+ }
+
+ pthread_mutex_unlock(&this->vpts_offset_queue_lock);
+
+ 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_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;
+
+ case func_query_capabilities:
+ {
+ READ_DATA_OR_FAIL(query_capabilities, lprintf("got QUERYCAPABILITIES\n"));
+
+ {
+ result_query_capabilities_t result_query_capabilities;
+ result_query_capabilities.header.func = data->header.func;
+ result_query_capabilities.header.len = sizeof (result_query_capabilities);
+
+ result_query_capabilities.osd_max_num_windows = MAX_SHOWING;
+ result_query_capabilities.osd_palette_max_depth = 8;
+ result_query_capabilities.osd_palette_is_shared = 0;
+ result_query_capabilities.osd_supports_argb_layer = this->osd_supports_argb_layer;
+ result_query_capabilities.osd_supports_custom_extent = this->osd_supports_custom_extent;
+
+ if (sizeof (result_query_capabilities) != vdr_write(this->fh_result, &result_query_capabilities, sizeof (result_query_capabilities)))
+ return -1;
+ }
+ }
+ 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;
+ int was_startup_phase = this->startup_phase;
+
+ while (!failed
+ && !this->rpc_thread_shutdown
+ && was_startup_phase == this->startup_phase)
+ {
+ 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);
+ }
+ }
+ }
+
+ if (!failed && was_startup_phase)
+ return (void *)1;
+
+ /* 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 int internal_write_event_discontinuity(vdr_input_plugin_t *this, int32_t type)
+{
+ event_discontinuity_t event;
+ event.header.func = func_discontinuity;
+ event.header.len = sizeof (event);
+
+ event.type = type;
+
+ 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;
+ uint8_t *buf = (uint8_t *)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, (char *)&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;
+ }
+
+ if (this->find_sync_point
+ && total == 6)
+ {
+ pthread_mutex_lock(&this->find_sync_point_lock);
+
+ while (this->find_sync_point
+ && total == 6
+ && buf[0] == 0x00
+ && buf[1] == 0x00
+ && buf[2] == 0x01)
+ {
+ int l, sp;
+
+ if (buf[3] == 0xbe
+ && buf[4] == 0xff)
+ {
+/* fprintf(stderr, "------- seen sync point: %02x, waiting for: %02x\n", buf[5], this->find_sync_point); */
+ if (buf[5] == this->find_sync_point)
+ {
+ this->find_sync_point = 0;
+ break;
+ }
+ }
+
+ if ((buf[3] & 0xf0) != 0xe0
+ && (buf[3] & 0xe0) != 0xc0
+ && buf[3] != 0xbd
+ && buf[3] != 0xbe)
+ {
+ break;
+ }
+
+ l = buf[4] * 256 + buf[5];
+ if (l <= 0)
+ break;
+
+ sp = this->find_sync_point;
+ this->find_sync_point = 0;
+ this_gen->seek(this_gen, l, SEEK_CUR);
+ total = this_gen->read(this_gen, buf, 6);
+ this->find_sync_point = sp;
+ }
+
+ pthread_mutex_unlock(&this->find_sync_point_lock);
+ }
+
+ 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_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);
+
+ if (this->metronom_thread)
+ {
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: joining metronom thread ...\n"), LOG_MODULE);
+
+ pthread_mutex_lock(&this->metronom_thread_call_lock);
+
+ pthread_mutex_lock(&this->metronom_thread_lock);
+ this->metronom_thread_request = -1;
+ this->metronom_thread_reply = 0;
+ pthread_cond_broadcast(&this->metronom_thread_request_cond);
+/*
+ pthread_mutex_unlock(&this->metronom_thread_lock);
+
+ pthread_mutex_lock(&this->metronom_thread_lock);
+ if (!this->metronom_thread_reply)
+*/
+ pthread_cond_wait(&this->metronom_thread_reply_cond, &this->metronom_thread_lock);
+ pthread_mutex_unlock(&this->metronom_thread_lock);
+
+ pthread_mutex_unlock(&this->metronom_thread_call_lock);
+
+ pthread_join(this->metronom_thread, 0);
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("%s: metronom thread joined.\n"), LOG_MODULE);
+ }
+
+ pthread_mutex_destroy(&this->metronom_thread_lock);
+ pthread_cond_destroy(&this->metronom_thread_request_cond);
+ pthread_cond_destroy(&this->metronom_thread_reply_cond);
+
+ pthread_mutex_destroy(&this->trick_speed_mode_lock);
+ pthread_cond_destroy(&this->trick_speed_mode_cond);
+
+ pthread_mutex_destroy(&this->find_sync_point_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++)
+ {
+ int k;
+
+ if (0 == this->osd[ i ].window)
+ continue;
+
+ xine_osd_hide(this->osd[ i ].window, 0);
+ xine_osd_free(this->osd[ i ].window);
+
+ for (k = 0; k < 2; k++)
+ free(this->osd[ i ].argb_buffer[ k ]);
+ }
+
+ if (this->osd_buffer)
+ free(this->osd_buffer);
+
+ if ((this->fh != STDIN_FILENO) && (this->fh != -1))
+ close(this->fh);
+
+ free(this->mrl);
+
+ this->stream->metronom = this->metronom.stream_metronom;
+ this->metronom.stream_metronom = 0;
+
+ vdr_vpts_offset_queue_purge(this);
+ pthread_cond_destroy(&this->vpts_offset_queue_changed_cond);
+ pthread_mutex_destroy(&this->vpts_offset_queue_lock);
+
+ 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;
+ (void)this;
+ switch (data_type)
+ {
+ case INPUT_OPTIONAL_DATA_PREVIEW:
+ /* just fake what mpeg_pes demuxer expects */
+ memcpy (data, "\x00\x00\x01\xe0\x00\x03\x80\x00\x00", 9);
+ return 9;
+ }
+ return INPUT_OPTIONAL_UNSUPPORTED;
+}
+
+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 = (char *)mrl_to_fifo (this->mrl);
+
+ if(!strcmp(filename, "/")) {
+ filename = (char *)VDR_ABS_FIFO_DIR "/stream";
+ }
+
+ filename = strdup(filename);
+
+ _x_mrl_unescape (filename);
+ this->fh = xine_open_cloexec(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));
+
+ /* eat initial handshake byte */
+ {
+ char b;
+ read(this->fh, &b, 1);
+ }
+
+ {
+ char *filename_control = 0;
+ filename_control = _x_asprintf("%s.control", filename);
+
+ this->fh_control = xine_open_cloexec(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;
+ filename_result = _x_asprintf("%s.result", filename);
+
+ this->fh_result = xine_open_cloexec(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;
+ filename_event = _x_asprintf("%s.event", filename);
+
+ this->fh_event = xine_open_cloexec(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 = xine_socket_cloexec(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 void vdr_metronom_handle_audio_discontinuity_impl(metronom_t *self, int type, int64_t disc_off);
+
+static void *vdr_metronom_thread_loop(void *arg)
+{
+ vdr_input_plugin_t *this = (vdr_input_plugin_t *)arg;
+ int run = 1;
+
+ pthread_mutex_lock(&this->metronom_thread_lock);
+
+ while (run)
+ {
+ if (this->metronom_thread_request == 0)
+ pthread_cond_wait(&this->metronom_thread_request_cond, &this->metronom_thread_lock);
+
+ if (this->metronom_thread_request == -1)
+ run = 0;
+ else
+ vdr_metronom_handle_audio_discontinuity_impl(&this->metronom.metronom, DISC_ABSOLUTE, this->metronom_thread_request);
+
+ this->metronom_thread_request = 0;
+ this->metronom_thread_reply = 1;
+ pthread_cond_broadcast(&this->metronom_thread_reply_cond);
+ }
+
+ pthread_mutex_unlock(&this->metronom_thread_lock);
+
+ return 0;
+}
+
+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;
+ }
+
+ if ((err = pthread_create(&this->metronom_thread, NULL,
+ vdr_metronom_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;
+ }
+
+ this->rpc_thread_shutdown = 0;
+
+ /* let this thread handle rpc commands in startup phase */
+ this->startup_phase = 1;
+ if (0 == vdr_rpc_thread_loop(this))
+ return 0;
+/* fprintf(stderr, "####################################################\n"); */
+ 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
+ */
+
+ this->preview = NULL;
+ this->preview_size = 0;
+ 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;
+ }
+
+ if (XINE_EVENT_VDR_DISCONTINUITY == event->type)
+ {
+ if (0 != internal_write_event_discontinuity(this, event->data_length))
+ xprintf(this->stream->xine, XINE_VERBOSITY_LOG,
+ _("%s: input event write: %s.\n"), LOG_MODULE, strerror(errno));
+
+ return;
+ }
+
+ 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 = 0; /* 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);
+ }
+
+ return;
+ }
+
+ 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_USER0: key = key_user0; 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 int64_t vdr_vpts_offset_queue_change_begin(vdr_input_plugin_t *this, int type)
+{
+ pthread_mutex_lock(&this->vpts_offset_queue_lock);
+ this->vpts_offset_queue_changes++;
+ pthread_mutex_unlock(&this->vpts_offset_queue_lock);
+
+ return this->metronom.metronom.get_option(&this->metronom.metronom, METRONOM_VPTS_OFFSET);
+}
+
+static void vdr_vpts_offset_queue_change_end(vdr_input_plugin_t *this, int type, int64_t disc_off, int64_t vpts_offset)
+{
+ pthread_mutex_lock(&this->vpts_offset_queue_lock);
+
+if(0)
+ {
+fprintf(stderr, "A ---------------------------------------------\n");
+ vdr_vpts_offset_t *p = this->vpts_offset_queue;
+ while (p)
+ {
+ fprintf(stderr, "A now: %12"PRId64", vpts: %12"PRId64", offset: %12"PRId64"\n", xine_get_current_vpts(this->stream), p->vpts, p->offset);
+ p = p->next;
+ }
+fprintf(stderr, "A =============================================\n");
+ }
+
+ if (type == DISC_ABSOLUTE)
+ {
+ int64_t vpts = this->stream->metronom->get_option(this->stream->metronom, METRONOM_VPTS_OFFSET) + disc_off;
+
+ if (!this->vpts_offset_queue
+ || this->vpts_offset_queue_tail->vpts < vpts)
+ {
+ vdr_vpts_offset_t *curr = (vdr_vpts_offset_t *)calloc(1, sizeof (vdr_vpts_offset_t));
+ curr->vpts = vpts;
+ curr->offset = vpts_offset;
+
+ if (!this->vpts_offset_queue)
+ this->vpts_offset_queue = this->vpts_offset_queue_tail = curr;
+ else
+ {
+ this->vpts_offset_queue_tail->next = curr;
+ this->vpts_offset_queue_tail = curr;
+ }
+ }
+ }
+ else
+ vdr_vpts_offset_queue_purge(this);
+
+if(0)
+ {
+fprintf(stderr, "B ---------------------------------------------\n");
+ vdr_vpts_offset_t *p = this->vpts_offset_queue;
+ while (p)
+ {
+ fprintf(stderr, "B now: %12"PRId64", vpts: %12"PRId64", offset: %12"PRId64"\n", xine_get_current_vpts(this->stream), p->vpts, p->offset);
+ p = p->next;
+ }
+fprintf(stderr, "B =============================================\n");
+ }
+
+ this->vpts_offset_queue_changes--;
+ pthread_cond_broadcast(&this->vpts_offset_queue_changed_cond);
+
+ this->last_disc_type = type;
+
+ pthread_mutex_unlock(&this->vpts_offset_queue_lock);
+
+ if (!this->trick_speed_mode)
+ {
+ xine_event_t event;
+
+ event.type = XINE_EVENT_VDR_DISCONTINUITY;
+ event.data = 0;
+ event.data_length = type;
+
+ xine_event_send(this->stream, &event);
+ }
+}
+
+static void vdr_metronom_handle_audio_discontinuity_impl(metronom_t *self, int type, int64_t disc_off)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ int64_t vpts_offset = vdr_vpts_offset_queue_change_begin(this->input, type);
+/* fprintf(stderr, "had A: %d, %"PRId64", %"PRId64", %"PRId64"\n", type, disc_off, xine_get_current_vpts(this->input->stream), this->stream_metronom->get_option(this->stream_metronom, METRONOM_VPTS_OFFSET)); */
+ this->stream_metronom->handle_audio_discontinuity(this->stream_metronom, type, disc_off);
+/* fprintf(stderr, "had B: %d, %"PRId64", %"PRId64", %"PRId64"\n", type, disc_off, xine_get_current_vpts(this->input->stream), this->stream_metronom->get_option(this->stream_metronom, METRONOM_VPTS_OFFSET)); */
+ vdr_vpts_offset_queue_change_end(this->input, type, disc_off, vpts_offset);
+}
+
+static void vdr_metronom_handle_audio_discontinuity(metronom_t *self, int type, int64_t disc_off)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+
+ pthread_mutex_lock(&this->input->trick_speed_mode_lock);
+
+ if (this->input->trick_speed_mode_blocked & 0x04) /* must not enter while video is leaving */
+ pthread_cond_wait(&this->input->trick_speed_mode_cond, &this->input->trick_speed_mode_lock);
+
+ this->input->trick_speed_mode_blocked |= 0x02; /* audio is in */
+
+ if (!this->input->trick_speed_mode)
+ {
+ pthread_mutex_unlock(&this->input->trick_speed_mode_lock);
+
+ vdr_metronom_handle_audio_discontinuity_impl(self, type, disc_off);
+
+ pthread_mutex_lock(&this->input->trick_speed_mode_lock);
+ }
+ else
+ {
+ if (this->input->trick_speed_mode_blocked != 0x03) /* wait for audio and video in */
+ {
+ pthread_cond_wait(&this->input->trick_speed_mode_cond, &this->input->trick_speed_mode_lock);
+ this->input->trick_speed_mode_blocked &= ~0x04; /* video left already */
+ }
+ else
+ {
+ this->input->trick_speed_mode_blocked |= 0x04; /* audio is leaving */
+ pthread_cond_broadcast(&this->input->trick_speed_mode_cond);
+ }
+ }
+
+ this->input->trick_speed_mode_blocked &= ~0x02; /* audio is out */
+
+ if (!this->input->trick_speed_mode_blocked)
+ pthread_cond_broadcast(&this->input->trick_speed_mode_cond);
+
+ pthread_mutex_unlock(&this->input->trick_speed_mode_lock);
+}
+
+static void vdr_metronom_handle_video_discontinuity_impl(metronom_t *self, int type, int64_t disc_off)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ int64_t vpts_offset = vdr_vpts_offset_queue_change_begin(this->input, type);
+/* fprintf(stderr, "hvd A: %d, %"PRId64", %"PRId64", %"PRId64"\n", type, disc_off, xine_get_current_vpts(this->input->stream), this->stream_metronom->get_option(this->stream_metronom, METRONOM_VPTS_OFFSET)); */
+ this->stream_metronom->handle_video_discontinuity(this->stream_metronom, type, disc_off);
+/* fprintf(stderr, "hvd B: %d, %"PRId64", %"PRId64", %"PRId64"\n", type, disc_off, xine_get_current_vpts(this->input->stream), this->stream_metronom->get_option(this->stream_metronom, METRONOM_VPTS_OFFSET)); */
+ vdr_vpts_offset_queue_change_end(this->input, type, disc_off, vpts_offset);
+}
+
+static void vdr_metronom_handle_video_discontinuity(metronom_t *self, int type, int64_t disc_off)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+
+ pthread_mutex_lock(&this->input->trick_speed_mode_lock);
+
+ if (this->input->trick_speed_mode_blocked & 0x04) /* must not enter while audio is leaving */
+ pthread_cond_wait(&this->input->trick_speed_mode_cond, &this->input->trick_speed_mode_lock);
+
+ this->input->trick_speed_mode_blocked |= 0x01; /* video is in */
+
+ if (!this->input->trick_speed_mode)
+ {
+ pthread_mutex_unlock(&this->input->trick_speed_mode_lock);
+
+ vdr_metronom_handle_video_discontinuity_impl(self, type, disc_off);
+
+ pthread_mutex_lock(&this->input->trick_speed_mode_lock);
+ }
+ else
+ {
+ if (this->input->trick_speed_mode_blocked != 0x03) /* wait for audio and video in */
+ {
+ pthread_cond_wait(&this->input->trick_speed_mode_cond, &this->input->trick_speed_mode_lock);
+ this->input->trick_speed_mode_blocked &= ~0x04; /* audio left already */
+ }
+ else
+ {
+ this->input->trick_speed_mode_blocked |= 0x04; /* video is leaving */
+ pthread_cond_broadcast(&this->input->trick_speed_mode_cond);
+ }
+ }
+
+ this->input->trick_speed_mode_blocked &= ~0x01; /* video is out */
+
+ if (!this->input->trick_speed_mode_blocked)
+ pthread_cond_broadcast(&this->input->trick_speed_mode_cond);
+
+ pthread_mutex_unlock(&this->input->trick_speed_mode_lock);
+}
+
+static void vdr_metronom_got_video_frame(metronom_t *self, vo_frame_t *frame)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+
+ if (frame->pts)
+ {
+ pthread_mutex_lock(&this->input->trick_speed_mode_lock);
+
+ if (this->input->trick_speed_mode)
+ {
+ frame->progressive_frame = -1; /* force progressive */
+
+ pthread_mutex_lock(&this->input->metronom_thread_call_lock);
+
+ pthread_mutex_lock(&this->input->metronom_thread_lock);
+ this->input->metronom_thread_request = frame->pts;
+ this->input->metronom_thread_reply = 0;
+ pthread_cond_broadcast(&this->input->metronom_thread_request_cond);
+ pthread_mutex_unlock(&this->input->metronom_thread_lock);
+
+ vdr_metronom_handle_video_discontinuity_impl(self, DISC_ABSOLUTE, frame->pts);
+
+ pthread_mutex_lock(&this->input->metronom_thread_lock);
+ if (!this->input->metronom_thread_reply)
+ pthread_cond_wait(&this->input->metronom_thread_reply_cond, &this->input->metronom_thread_lock);
+ pthread_mutex_unlock(&this->input->metronom_thread_lock);
+
+ pthread_mutex_unlock(&this->input->metronom_thread_call_lock);
+ }
+
+ pthread_mutex_unlock(&this->input->trick_speed_mode_lock);
+ }
+
+ this->stream_metronom->got_video_frame(this->stream_metronom, frame);
+
+ if (this->input->trick_speed_mode && frame->pts)
+ {
+/* fprintf(stderr, "vpts: %12ld, pts: %12ld, offset: %12ld\n", frame->vpts, frame->pts, this->stream_metronom->get_option(this->stream_metronom, METRONOM_VPTS_OFFSET)); */
+ }
+}
+
+static int64_t vdr_metronom_got_audio_samples(metronom_t *self, int64_t pts, int nsamples)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ return this->stream_metronom->got_audio_samples(this->stream_metronom, pts, nsamples);
+}
+
+static int64_t vdr_metronom_got_spu_packet(metronom_t *self, int64_t pts)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ return this->stream_metronom->got_spu_packet(this->stream_metronom, pts);
+}
+
+static void vdr_metronom_set_audio_rate(metronom_t *self, int64_t pts_per_smpls)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ this->stream_metronom->set_audio_rate(this->stream_metronom, pts_per_smpls);
+}
+
+static void vdr_metronom_set_option(metronom_t *self, int option, int64_t value)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ this->stream_metronom->set_option(this->stream_metronom, option, value);
+}
+
+static int64_t vdr_metronom_get_option(metronom_t *self, int option)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ return this->stream_metronom->get_option(this->stream_metronom, option);
+}
+
+static void vdr_metronom_set_master(metronom_t *self, metronom_t *master)
+{
+ vdr_metronom_t *this = (vdr_metronom_t *)self;
+ this->stream_metronom->set_master(this->stream_metronom, master);
+}
+
+static void vdr_metronom_exit(metronom_t *self)
+{
+ _x_abort();
+}
+
+
+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, 0, sizeof (this->osd));
+
+ {
+ xine_osd_t *osd = xine_osd_new(this->stream, 0, 0, 16, 16);
+ uint32_t caps = xine_osd_get_capabilities(osd);
+ xine_osd_free(osd);
+
+ this->osd_supports_argb_layer = !!(caps & XINE_OSD_CAP_ARGB_LAYER);
+ this->osd_supports_custom_extent = !!(caps & XINE_OSD_CAP_CUSTOM_EXTENT);
+ }
+
+ 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 = XINE_VDR_MUTE_SIMULATE;
+ this->volume_mode = XINE_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->trick_speed_mode_lock, 0);
+ pthread_cond_init(&this->trick_speed_mode_cond, 0);
+
+ pthread_mutex_init(&this->metronom_thread_lock, 0);
+ pthread_cond_init(&this->metronom_thread_request_cond, 0);
+ pthread_cond_init(&this->metronom_thread_reply_cond, 0);
+ pthread_mutex_init(&this->metronom_thread_call_lock, 0);
+
+ pthread_mutex_init(&this->find_sync_point_lock, 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);
+
+ this->metronom.input = this;
+ this->metronom.metronom.set_audio_rate = vdr_metronom_set_audio_rate;
+ this->metronom.metronom.got_video_frame = vdr_metronom_got_video_frame;
+ this->metronom.metronom.got_audio_samples = vdr_metronom_got_audio_samples;
+ this->metronom.metronom.got_spu_packet = vdr_metronom_got_spu_packet;
+ this->metronom.metronom.handle_audio_discontinuity = vdr_metronom_handle_audio_discontinuity;
+ this->metronom.metronom.handle_video_discontinuity = vdr_metronom_handle_video_discontinuity;
+ this->metronom.metronom.set_option = vdr_metronom_set_option;
+ this->metronom.metronom.get_option = vdr_metronom_get_option;
+ this->metronom.metronom.set_master = vdr_metronom_set_master;
+ this->metronom.metronom.exit = vdr_metronom_exit;
+
+ this->metronom.stream_metronom = stream->metronom;
+ stream->metronom = &this->metronom.metronom;
+
+ pthread_mutex_init(&this->vpts_offset_queue_lock, 0);
+ pthread_cond_init(&this->vpts_offset_queue_changed_cond, 0);
+
+ return &this->input_plugin;
+}
+
+/*
+ * vdr input plugin class stuff
+ */
+static const char * const *vdr_class_get_autoplay_list(input_class_t *this_gen,
+ int *num_files)
+{
+ static const char * const mrls[] = {"vdr:/" VDR_ABS_FIFO_DIR "/stream#demux:mpeg_pes", NULL};
+
+ *num_files = 1;
+ return mrls;
+}
+
+void *vdr_input_init_plugin(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->input_class.get_instance = vdr_class_get_instance;
+ this->input_class.identifier = "VDR";
+ this->input_class.description = N_("VDR display device plugin");
+ this->input_class.get_dir = NULL;
+ this->input_class.get_autoplay_list = vdr_class_get_autoplay_list;
+ this->input_class.dispose = default_input_class_dispose;
+ this->input_class.eject_media = NULL;
+
+ return this;
+}
diff --git a/src/vdr/post_vdr_audio.c b/src/vdr/post_vdr_audio.c
new file mode 100644
index 000000000..d85bb3629
--- /dev/null
+++ b/src/vdr/post_vdr_audio.c
@@ -0,0 +1,266 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/*
+ * select audio channel plugin for VDR
+ */
+
+#define LOG_MODULE "vdr_audio"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include "combined_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);
+
+/* 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 *)xine_xmalloc(sizeof (post_class_t));
+
+ if (!class)
+ return NULL;
+
+ class->open_plugin = vdr_audio_open_plugin;
+ class->identifier = "vdr_audio";
+ class->description = N_("modifies every audio frame as requested by VDR");
+ class->dispose = default_post_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 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..772374dd5
--- /dev/null
+++ b/src/vdr/post_vdr_video.c
@@ -0,0 +1,483 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ */
+
+/*
+ * frame scaler plugin for VDR
+ */
+
+#define LOG_MODULE "vdr_video"
+/*
+#define LOG
+#define LOG_VERBOSE
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/post.h>
+#include "combined_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);
+
+/* 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 *)xine_xmalloc(sizeof (post_class_t));
+
+ if (!class)
+ return NULL;
+
+ class->open_plugin = vdr_video_open_plugin;
+ class->identifier = "vdr";
+ class->description = N_("modifies every video frame as requested by VDR");
+ class->dispose = default_post_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 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 defined(LOG) && defined(LOG_VERBOSE)
+ {
+ int a = 0, b = 0, c = 0, d = 0;
+ if (stream)
+ _x_query_buffer_usage(stream, &a, &b, &c, &d);
+ lprintf("buffer usage: %3d, %2d, %2d, %2d, %p\n", a, b, c, d, stream);
+ }
+#endif
+
+ 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_dec/Makefile.am b/src/video_dec/Makefile.am
new file mode 100644
index 000000000..f20a88bad
--- /dev/null
+++ b/src/video_dec/Makefile.am
@@ -0,0 +1,45 @@
+include $(top_srcdir)/misc/Makefile.quiet
+SUBDIRS = \
+ libmpeg2 \
+ libmpeg2new \
+ libvdpau
+
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+EXTRA_DIST = foovideo.c
+
+if ENABLE_IMAGEMAGICK
+image_module = xineplug_decode_image.la
+endif
+
+if ENABLE_GDK_PIXBUF
+gdkpixbuf_module = xineplug_decode_gdk_pixbuf.la
+endif
+
+xineplug_LTLIBRARIES = $(image_module) \
+ $(gdkpixbuf_module) \
+ $(theora_module) \
+ xineplug_decode_bitplane.la \
+ xineplug_decode_rgb.la \
+ xineplug_decode_yuv.la
+
+xineplug_decode_bitplane_la_SOURCES = bitplane.c
+xineplug_decode_bitplane_la_LIBADD = $(XINE_LIB) $(LTLIBINTL)
+
+xineplug_decode_rgb_la_SOURCES = rgb.c
+xineplug_decode_rgb_la_LIBADD = $(XINE_LIB)
+
+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_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_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(GDK_PIXBUF_LIBS)
+xineplug_decode_gdk_pixbuf_la_CFLAGS = $(AM_CFLAGS) $(GDK_PIXBUF_CFLAGS)
diff --git a/src/video_dec/bitplane.c b/src/video_dec/bitplane.c
new file mode 100644
index 000000000..fa9f0ffba
--- /dev/null
+++ b/src/video_dec/bitplane.c
@@ -0,0 +1,1550 @@
+/*
+ * Copyright (C) 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * Bitplane "Decoder" by Manfred Tremmel (Manfred.Tremmel@iiv.de)
+ * Converts Amiga typical bitplane pictures to a YUV2 map
+ * suitable for display under xine. It's based on the rgb-decoder
+ * and the development documentation from the Amiga Developer CD
+ *
+ * Supported formats:
+ * - uncompressed and byterun1 compressed ILBM data
+ * - IFF ANIM compression methods OPT 5, 7 (long and short) and
+ * 8 (long and short)
+ * - untested (found no testfiles) IFF-ANIM OPT 3, 4 and 6
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+#include "demuxers/iff.h"
+
+#define IFF_REPLACE_BYTE_SIMPLE(ptr, old_data, new_data, colorindexx ) { \
+ register uint8_t *index_ptr = ptr; \
+ register uint8_t colorindex = colorindexx; \
+ *index_ptr -= ((old_data & 0x80) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x80) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x40) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x40) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x20) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x20) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x10) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x10) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x08) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x08) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x04) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x04) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x02) ? colorindex : 0); \
+ *index_ptr++ += ((new_data & 0x02) ? colorindex : 0); \
+ *index_ptr -= ((old_data & 0x01) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x01) ? colorindex : 0); \
+ old_data = new_data; \
+}
+
+#define IFF_REPLACE_BYTE(ptr, yuvy, yuvu, yuvv, yuv_palette, old_data, new_data, colorindexx ) { \
+ register uint8_t *index_ptr = ptr; \
+ register uint8_t colorindex = colorindexx; \
+ register uint8_t *yuv_y = yuvy; \
+ register uint8_t *yuv_u = yuvu; \
+ register uint8_t *yuv_v = yuvv; \
+ *index_ptr -= ((old_data & 0x80) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x80) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x40) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x40) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x20) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x20) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x10) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x10) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x08) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x08) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x04) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x04) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x02) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x02) ? colorindex : 0); \
+ yuv_index = *index_ptr++ * 4; \
+ *yuv_y++ = yuv_palette[yuv_index++]; \
+ *yuv_u++ = yuv_palette[yuv_index++]; \
+ *yuv_v++ = yuv_palette[yuv_index]; \
+ *index_ptr -= ((old_data & 0x01) ? colorindex : 0); \
+ *index_ptr += ((new_data & 0x01) ? colorindex : 0); \
+ yuv_index = *index_ptr * 4; \
+ *yuv_y = yuv_palette[yuv_index++]; \
+ *yuv_u = yuv_palette[yuv_index++]; \
+ *yuv_v = yuv_palette[yuv_index]; \
+ old_data = new_data; \
+}
+
+#define IFF_REPLACE_SHORT_SIMPLE(ptr_s, old_data_s, new_data_s, colorindexx_s ) { \
+ uint8_t *xindex_ptr = (uint8_t *)ptr_s; \
+ uint8_t *xold_data = (uint8_t *)old_data_s; \
+ uint8_t *xnew_data = (uint8_t *)new_data_s; \
+ IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_s ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_s ); \
+}
+
+#define IFF_REPLACE_SHORT(ptr_s, yuvy_s, yuvu_s, yuvv_s, yuv_palette_s, old_data_s, new_data_s, colorindexx_s ) { \
+ uint8_t *xindex_ptr = (uint8_t *)ptr_s; \
+ uint8_t *xold_data = (uint8_t *)old_data_s; \
+ uint8_t *xnew_data = (uint8_t *)new_data_s; \
+ uint8_t *xyuv_y = yuvy_s; \
+ uint8_t *xyuv_u = yuvu_s; \
+ uint8_t *xyuv_v = yuvv_s; \
+ IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_s, *xold_data, *xnew_data, colorindexx_s ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ xyuv_y += 8; \
+ xyuv_u += 8; \
+ xyuv_v += 8; \
+ IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_s, *xold_data, *xnew_data, colorindexx_s ); \
+}
+
+#define IFF_REPLACE_LONG_SIMPLE(ptr_l, old_data_l, new_data_l, colorindexx_l ) { \
+ uint8_t *xindex_ptr = (uint8_t *)ptr_l; \
+ uint8_t *xold_data = (uint8_t *)old_data_l; \
+ uint8_t *xnew_data = (uint8_t *)new_data_l; \
+ IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ IFF_REPLACE_BYTE_SIMPLE(xindex_ptr, *xold_data, *xnew_data, colorindexx_l ); \
+}
+
+#define IFF_REPLACE_LONG(ptr_l, yuvy_l, yuvu_l, yuvv_l, yuv_palette_l, old_data_l, new_data_l, colorindexx_l ) { \
+ uint8_t *xindex_ptr = (uint8_t *)ptr_l; \
+ uint8_t *xold_data = (uint8_t *)old_data_l; \
+ uint8_t *xnew_data = (uint8_t *)new_data_l; \
+ uint8_t *xyuv_y = yuvy_l; \
+ uint8_t *xyuv_u = yuvu_l; \
+ uint8_t *xyuv_v = yuvv_l; \
+ IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ xyuv_y += 8; \
+ xyuv_u += 8; \
+ xyuv_v += 8; \
+ IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ xyuv_y += 8; \
+ xyuv_u += 8; \
+ xyuv_v += 8; \
+ IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
+ xindex_ptr += 8; \
+ xold_data++; \
+ xnew_data++; \
+ xyuv_y += 8; \
+ xyuv_u += 8; \
+ xyuv_v += 8; \
+ IFF_REPLACE_BYTE(xindex_ptr, xyuv_y, xyuv_u, xyuv_v, yuv_palette_l, *xold_data, *xnew_data, colorindexx_l ); \
+}
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} bitplane_class_t;
+
+typedef struct bitplane_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ bitplane_class_t *class;
+ xine_stream_t *stream;
+
+ /* these are traditional variables in a video decoder object */
+ uint64_t video_step; /* frame duration in pts units */
+ int decoder_ok; /* current decoder status */
+ int skipframes; /* 0 = draw picture, 1 = skip it */
+ int framenumber;
+
+ unsigned char *buf; /* the accumulated buffer data */
+ int bufsize; /* the maximum size of buf */
+ int size; /* the current size of buf */
+ int size_uk; /* size of unkompressed bitplane */
+
+ int width; /* the width of a video frame */
+ int height; /* the height of a video frame */
+ int num_pixel; /* number pixel */
+ double ratio; /* the width to height ratio */
+ int bytes_per_pixel;
+ int num_bitplanes;
+ int camg_mode;
+ int is_ham;
+
+ unsigned char yuv_palette[256 * 4];
+ unsigned char rgb_palette[256 * 4];
+ yuv_planes_t yuv_planes;
+ yuv_planes_t yuv_planes_hist;
+
+ uint8_t *buf_uk; /* uncompressed buffer */
+ uint8_t *buf_uk_hist; /* uncompressed buffer historic */
+ uint8_t *index_buf; /* index buffer (for indexed pics) */
+ uint8_t *index_buf_hist;/* index buffer historic */
+
+} bitplane_decoder_t;
+
+/* create a new buffer and decde a byterun1 decoded buffer into it */
+static uint8_t *bitplane_decode_byterun1 (uint8_t *compressed,
+ int size_compressed,
+ int size_uncompressed) {
+
+ /* BytRun1 decompression */
+ int pixel_ptr = 0;
+ int i = 0;
+ int j = 0;
+
+ uint8_t *uncompressed = calloc(1, size_uncompressed );
+
+ while ( i < size_compressed &&
+ pixel_ptr < size_uncompressed ) {
+ if( compressed[i] <= 127 ) {
+ j = compressed[i++];
+ if( (i+j) > size_compressed ) {
+ free(uncompressed);
+ return NULL;
+ }
+ for( ; (j >= 0) && (pixel_ptr < size_uncompressed); j-- ) {
+ uncompressed[pixel_ptr++] = compressed[i++];
+ }
+ } else if ( compressed[i] > 128 ) {
+ j = 256 - compressed[i++];
+ if( i >= size_compressed ) {
+ free(uncompressed);
+ return NULL;
+ }
+ for( ; (j >= 0) && (pixel_ptr < size_uncompressed); j-- ) {
+ uncompressed[pixel_ptr++] = compressed[i];
+ }
+ i++;
+ }
+ }
+ return uncompressed;
+}
+
+/* create a new buffer with "normal" index or rgb numbers out of a bitplane */
+static void bitplane_decode_bitplane (uint8_t *bitplane_buffer,
+ uint8_t *index_buf,
+ int width,
+ int height,
+ int num_bitplanes,
+ int bytes_per_pixel ) {
+
+ int rowsize = width / 8;
+ int pixel_ptr = 0;
+ int row_ptr = 0;
+ int palette_index = 0;
+ int i = 0;
+ int j = 0;
+ int row_i = 0;
+ int row_j = 0;
+ int palette_offset = 0;
+ int palette_index_rowsize = 0;
+ uint8_t color = 0;
+ uint8_t data = 0;
+ int bytes_per_pixel_8 = bytes_per_pixel * 8;
+ int rowsize_num_bitplanes = rowsize * num_bitplanes;
+ int width_bytes_per_pixel = width * bytes_per_pixel;
+
+ for (i = 0; i < (height * width_bytes_per_pixel); index_buf[i++] = 0);
+
+ /* decode Bitplanes to RGB/Index Numbers */
+ for (row_ptr = 0; row_ptr < height; row_ptr++) {
+
+ row_i = row_ptr * width_bytes_per_pixel;
+ row_j = row_ptr * rowsize_num_bitplanes;
+
+ for (palette_index = 0; palette_index < num_bitplanes; palette_index++) {
+
+ palette_offset = ((palette_index > 15) ? 2 : (palette_index > 7) ? 1 : 0);
+ color = bitplainoffeset[palette_index];
+ palette_index_rowsize = palette_index * rowsize;
+
+ for (pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
+ i = row_i +
+ (pixel_ptr * bytes_per_pixel_8) +
+ palette_offset;
+ j = row_j + palette_index_rowsize + pixel_ptr;
+
+ data = bitplane_buffer[j];
+
+ index_buf[i] += ((data & 0x80) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x40) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x20) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x10) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x08) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x04) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x02) ? color : 0);
+ i += bytes_per_pixel;
+ index_buf[i] += ((data & 0x01) ? color : 0);
+ }
+ }
+ }
+}
+
+/* create Buffer decode HAM6 and HAM8 to YUV color */
+static void bitplane_decode_ham (uint8_t *ham_buffer,
+ yuv_planes_t *yuv_planes,
+ int width,
+ int height,
+ int num_bitplanes,
+ int bytes_per_pixel,
+ unsigned char *rgb_palette ) {
+
+ uint8_t *ham_buffer_work = ham_buffer;
+ uint8_t *ham_buffer_end = &ham_buffer[(width * height)];
+ uint8_t *yuv_ptr_y = yuv_planes->y;
+ uint8_t *yuv_ptr_u = yuv_planes->u;
+ uint8_t *yuv_ptr_v = yuv_planes->v;
+ int i = 0;
+ int j = 0;
+ uint8_t r = 0;
+ uint8_t g = 0;
+ uint8_t b = 0;
+ /* position of special HAM-Bits differs in HAM6 and HAM8, detect them */
+ int hambits = num_bitplanes > 6 ? 6 : 4;
+ /* the other bits contain the real data, dreate a mask out of it */
+ int maskbits = 8 - hambits;
+ int mask = ( 1 << hambits ) - 1;
+
+ for(; ham_buffer_work < ham_buffer_end; j = *ham_buffer_work++) {
+ i = (j & mask);
+ switch ( j >> hambits ) {
+ case HAMBITS_CMAP:
+ /* Take colors from palette */
+ r = rgb_palette[i * 4 + 0];
+ g = rgb_palette[i * 4 + 1];
+ b = rgb_palette[i * 4 + 2];
+ break;
+ case HAMBITS_BLUE:
+ /* keep red and green and modify blue */
+ b = i << maskbits;
+ b |= b >> hambits;
+ break;
+ case HAMBITS_RED:
+ /* keep green and blue and modify red */
+ r = i << maskbits;
+ r |= r >> hambits;
+ break;
+ case HAMBITS_GREEN:
+ /* keep red and blue and modify green */
+ g = i << maskbits;
+ g |= g >> hambits;
+ break;
+ default:
+ break;
+ }
+ *yuv_ptr_y++ = COMPUTE_Y(r, g, b);
+ *yuv_ptr_u++ = COMPUTE_U(r, g, b);
+ *yuv_ptr_v++ = COMPUTE_V(r, g, b);
+ }
+}
+
+/* decoding method 3 */
+static void bitplane_sdelta_opt_3 (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 16;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t palette_index = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint16_t *ptr = NULL;
+ uint16_t *planeptr = NULL;
+ uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
+ uint16_t *data = NULL;
+ uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
+ uint16_t *rowworkptr = NULL;
+ int16_t s = 0;
+ int16_t size = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t row_ptr = 0;
+ uint32_t yuv_index = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+
+ planeptr = (uint16_t *)(&this->buf_uk[(palette_index * rowsize * 2)]);
+ /* data starts at beginn of delta-Buffer + offset of the first */
+ /* 32 Bit long word in the buffer. The buffer starts with 8 */
+ /* of this Offset, for every bitplane (max 8) one */
+ data = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[palette_index])]);
+ if( data != (uint16_t *)this->buf ) {
+ /* This 8 Pointers are followd by another 8 */
+ ptr = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[(palette_index+8)])]);
+
+ /* in this case, I think big/little endian is not important ;-) */
+ while( *data != 0xFFFF) {
+ row_ptr = 0;
+ size = _X_BE_16(data);
+ data++;
+ if( size >= 0 ) {
+ rowworkptr = planeptr + size;
+ pixel_ptr_bit = size * 16;
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[pixel_ptr_bit],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[pixel_ptr_bit],
+ &this->yuv_planes.y[pixel_ptr_bit], &this->yuv_planes.u[pixel_ptr_bit],
+ &this->yuv_planes.v[pixel_ptr_bit], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ } else {
+ size = 0 - size + 2;
+ rowworkptr = planeptr + size;
+ pixel_ptr_bit = size * 16;
+ s = _X_BE_16(data);
+ data++;
+ while( s--) {
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[pixel_ptr_bit],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[pixel_ptr_bit],
+ &this->yuv_planes.y[pixel_ptr_bit], &this->yuv_planes.u[pixel_ptr_bit],
+ &this->yuv_planes.v[pixel_ptr_bit], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr++;
+ data++;
+ }
+ }
+
+
+
+
+ size = _X_BE_16(ptr);
+ ptr++;
+ if (size < 0) {
+ for (s = size; s < 0; s++) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ }
+ else {
+ for (s = 0; s < size; s++) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ }
+ }
+ }
+ }
+}
+
+/* decoding method 4 */
+static void bitplane_set_dlta_short (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 16;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t palette_index = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint16_t *ptr = NULL;
+ uint16_t *planeptr = NULL;
+ uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
+ uint16_t *data = NULL;
+ uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
+ uint16_t *rowworkptr = NULL;
+ int16_t s = 0;
+ int16_t size = 0;
+ uint16_t pixel_ptr = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t row_ptr = 0;
+ uint32_t yuv_index = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+
+ planeptr = (uint16_t *)(&this->buf_uk[(palette_index * rowsize * 2)]);
+ /* data starts at beginn of delta-Buffer + offset of the first */
+ /* 32 Bit long word in the buffer. The buffer starts with 8 */
+ /* of this Offset, for every bitplane (max 8) one */
+ data = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[palette_index])]);
+ if( data != (uint16_t *)this->buf ) {
+ /* This 8 Pointers are followd by another 8 */
+ ptr = (uint16_t *)(&this->buf[_X_BE_32(&deltadata[(palette_index+8)])]);
+
+ /* in this case, I think big/little endian is not important ;-) */
+ while( *ptr != 0xFFFF) {
+ pixel_ptr = _X_BE_16(ptr);
+ pixel_ptr_bit = pixel_ptr * 16;
+ row_ptr = 0;
+ rowworkptr = planeptr + pixel_ptr;
+ ptr++;
+ size = _X_BE_16(ptr);
+ ptr++;
+ if (size < 0) {
+ for (s = size; s < 0; s++) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ } else {
+ for (s = 0; s < size; s++) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ }
+ }
+ }
+ }
+}
+
+/* decoding method 5 */
+static void bitplane_dlta_5 (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 8;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t yuv_index = 0;
+ uint32_t delta_offset = 0;
+ uint32_t palette_index = 0;
+ uint32_t pixel_ptr = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t row_ptr = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint8_t *planeptr = NULL;
+ uint8_t *rowworkptr = NULL;
+ uint8_t *picture_end = this->buf_uk + (rowsize_all_planes * this->height);
+ uint8_t *data = NULL;
+ uint8_t *data_end = this->buf + this->size;
+ uint8_t op_count = 0;
+ uint8_t op = 0;
+ uint8_t count = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+
+ planeptr = &this->buf_uk[(palette_index * rowsize)];
+ /* data starts at beginn of delta-Buffer + offset of the first */
+ /* 32 Bit long word in the buffer. The buffer starts with 8 */
+ /* of this Offset, for every bitplane (max 8) one */
+ delta_offset = _X_BE_32(&deltadata[palette_index]);
+
+ if (delta_offset > 0) {
+ data = this->buf + delta_offset;
+ for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
+ rowworkptr = planeptr + pixel_ptr;
+ pixel_ptr_bit = pixel_ptr * 8;
+ row_ptr = 0;
+ /* execute ops */
+ for( op_count = *data++; op_count; op_count--) {
+ op = *data++;
+ if (op & 0x80) {
+ /* Uniq ops */
+ count = op & 0x7f; /* get count */
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_BYTE_SIMPLE(&this->index_buf[yuv_index],
+ *rowworkptr, *data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_BYTE( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ *rowworkptr, *data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ } else {
+ if (op == 0) {
+ /* Same ops */
+ count = *data++;
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_BYTE_SIMPLE(&this->index_buf[yuv_index],
+ *rowworkptr, *data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_BYTE( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ *rowworkptr, *data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ } else {
+ /* Skip ops */
+ rowworkptr += (rowsize_all_planes * op);
+ row_ptr += op;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/* decoding method 7 (short version) */
+static void bitplane_dlta_7_short (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 16;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t yuv_index = 0;
+ uint32_t opcode_offset = 0;
+ uint32_t data_offset = 0;
+ uint32_t palette_index = 0;
+ uint32_t pixel_ptr = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t row_ptr = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint8_t *planeptr = NULL;
+ uint16_t *rowworkptr = NULL;
+ uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
+ uint16_t *data = NULL;
+ uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
+ uint8_t *op_ptr = NULL;
+ uint8_t op_count = 0;
+ uint8_t op = 0;
+ uint8_t count = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+
+ planeptr = &this->buf_uk[(palette_index * rowsize * 2)];
+ /* find opcode and data offset (up to 8 pointers, one for every bitplane */
+ opcode_offset = _X_BE_32(&deltadata[palette_index]);
+ data_offset = _X_BE_32(&deltadata[palette_index + 8]);
+
+ if (opcode_offset > 0 && data_offset > 0) {
+ data = (uint16_t *)(&this->buf[data_offset]);
+ op_ptr = this->buf + opcode_offset;
+ for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
+ rowworkptr = (uint16_t *)(&planeptr[pixel_ptr * 2]);
+ pixel_ptr_bit = pixel_ptr * 16;
+ row_ptr = 0;
+ /* execute ops */
+ for( op_count = *op_ptr++; op_count; op_count--) {
+ op = *op_ptr++;
+ if (op & 0x80) {
+ /* Uniq ops */
+ count = op & 0x7f; /* get count */
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ } else {
+ if (op == 0) {
+ /* Same ops */
+ count = *op_ptr++;
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ } else {
+ /* Skip ops */
+ rowworkptr += (rowsize_all_planes * op);
+ row_ptr += op;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/* decoding method 7 (long version) */
+static void bitplane_dlta_7_long (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 32;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t yuv_index = 0;
+ uint32_t opcode_offset = 0;
+ uint32_t data_offset = 0;
+ uint32_t palette_index = 0;
+ uint32_t pixel_ptr = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t row_ptr = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint8_t *planeptr = NULL;
+ uint32_t *rowworkptr = NULL;
+ uint32_t *picture_end = (uint32_t *)(&this->buf_uk[(rowsize_all_planes * 4 * this->height)]);
+ uint32_t *data = NULL;
+ uint32_t *data_end = (uint32_t *)(&this->buf[this->size]);
+ uint8_t *op_ptr = NULL;
+ uint8_t op_count = 0;
+ uint8_t op = 0;
+ uint8_t count = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+ planeptr = &this->buf_uk[(palette_index * rowsize * 4)];
+ /* find opcode and data offset (up to 8 pointers, one for every bitplane */
+ opcode_offset = _X_BE_32(&deltadata[palette_index]);
+ data_offset = _X_BE_32(&deltadata[palette_index + 8]);
+
+ if (opcode_offset > 0 && data_offset > 0) {
+ data = (uint32_t *)(&this->buf[data_offset]);
+ op_ptr = this->buf + opcode_offset;
+ for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
+ rowworkptr = (uint32_t *)(&planeptr[pixel_ptr * 4]);
+ pixel_ptr_bit = pixel_ptr * 32;
+ row_ptr = 0;
+ /* execute ops */
+ for( op_count = *op_ptr++; op_count; op_count--) {
+ op = *op_ptr++;
+ if (op & 0x80) {
+ /* Uniq ops */
+ count = op & 0x7f; /* get count */
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_LONG( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ } else {
+ if (op == 0) {
+ /* Same ops */
+ count = *op_ptr++;
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_LONG( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ } else {
+ /* Skip ops */
+ rowworkptr += (rowsize_all_planes * op);
+ row_ptr += op;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/* decoding method 8 short */
+static void bitplane_dlta_8_short (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 16;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t yuv_index = 0;
+ uint32_t delta_offset = 0;
+ uint32_t palette_index = 0;
+ uint32_t pixel_ptr = 0;
+ uint32_t row_ptr = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint16_t *planeptr = NULL;
+ uint16_t *rowworkptr = NULL;
+ uint16_t *picture_end = (uint16_t *)(&this->buf_uk[(rowsize_all_planes * 2 * this->height)]);
+ uint16_t *data = NULL;
+ uint16_t *data_end = (uint16_t *)(&this->buf[this->size]);
+ uint16_t op_count = 0;
+ uint16_t op = 0;
+ uint16_t count = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+
+ planeptr = (uint16_t *)(&this->buf_uk[(palette_index * rowsize * 2)]);
+ /* data starts at beginn of delta-Buffer + offset of the first */
+ /* 32 Bit long word in the buffer. The buffer starts with 8 */
+ /* of this Offset, for every bitplane (max 8) one */
+ delta_offset = _X_BE_32(&deltadata[palette_index]);
+
+ if (delta_offset > 0) {
+ data = (uint16_t *)(&this->buf[delta_offset]);
+ for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
+ rowworkptr = planeptr + pixel_ptr;
+ pixel_ptr_bit = pixel_ptr * 16;
+ row_ptr = 0;
+ /* execute ops */
+ op_count = _X_BE_16(data);
+ data++;
+ for( ; op_count; op_count--) {
+ op = _X_BE_16(data);
+ data++;
+ if (op & 0x8000) {
+ /* Uniq ops */
+ count = op & 0x7fff; /* get count */
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ } else {
+ if (op == 0) {
+ /* Same ops */
+ count = _X_BE_16(data);
+ data++;
+ while(count--) {
+ if (data > data_end || rowworkptr > picture_end)
+ return;
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_SHORT_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_SHORT( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ } else {
+ /* Skip ops */
+ rowworkptr += (rowsize_all_planes * op);
+ row_ptr += op;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/* decoding method 8 long */
+static void bitplane_dlta_8_long (bitplane_decoder_t *this) {
+
+ uint32_t rowsize = this->width / 32;
+ uint32_t rowsize_all_planes = rowsize * this->num_bitplanes;
+
+ uint32_t yuv_index = 0;
+ uint32_t delta_offset = 0;
+ uint32_t palette_index = 0;
+ uint32_t pixel_ptr = 0;
+ uint32_t pixel_ptr_bit = 0;
+ uint32_t row_ptr = 0;
+ uint32_t *deltadata = (uint32_t *)this->buf;
+ uint32_t *planeptr = NULL;
+ uint32_t *rowworkptr = NULL;
+ uint32_t *picture_end = (uint32_t *)(&this->buf_uk[(rowsize_all_planes * 4 * this->height)]);
+ uint32_t *data = NULL;
+ uint32_t *data_end = (uint32_t *)(&this->buf[this->size]);
+ uint32_t op_count = 0;
+ uint32_t op = 0;
+ uint32_t count = 0;
+
+ /* Repeat for each plane */
+ for(palette_index = 0; palette_index < this->num_bitplanes; palette_index++) {
+
+ planeptr = (uint32_t *)(&this->buf_uk[(palette_index * rowsize * 4)]);
+ /* data starts at beginn of delta-Buffer + offset of the first */
+ /* 32 Bit long word in the buffer. The buffer starts with 8 */
+ /* of this Offset, for every bitplane (max 8) one */
+ delta_offset = _X_BE_32(&deltadata[palette_index]);
+
+ if (delta_offset > 0) {
+ data = (uint32_t *)(&this->buf[delta_offset]);
+ for( pixel_ptr = 0; pixel_ptr < rowsize; pixel_ptr++) {
+ rowworkptr = planeptr + pixel_ptr;
+ pixel_ptr_bit = pixel_ptr * 32;
+ row_ptr = 0;
+ /* execute ops */
+ op_count = _X_BE_32(data);
+ data++;
+ for( ; op_count; op_count--) {
+ op = _X_BE_32(data);
+ data++;
+ if (op & 0x80000000) {
+ /* Uniq ops */
+ count = op & 0x7fffffff; /* get count */
+ while(count--) {
+ if (data <= data_end || rowworkptr <= picture_end) {
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_LONG( &this->index_buf[((row_ptr * this->width) + pixel_ptr_bit)],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ }
+ data++;
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ } else {
+ if (op == 0) {
+ /* Same ops */
+ count = _X_BE_32(data);
+ data++;
+ while(count--) {
+ if (data <= data_end && rowworkptr <= picture_end) {
+ yuv_index = ((row_ptr * this->width) + pixel_ptr_bit);
+ if( this->is_ham ) {
+ IFF_REPLACE_LONG_SIMPLE(&this->index_buf[yuv_index],
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ } else {
+ IFF_REPLACE_LONG( &this->index_buf[yuv_index],
+ &this->yuv_planes.y[yuv_index], &this->yuv_planes.u[yuv_index],
+ &this->yuv_planes.v[yuv_index], this->yuv_palette,
+ rowworkptr, data, bitplainoffeset[palette_index] );
+ }
+ }
+ rowworkptr += rowsize_all_planes;
+ row_ptr++;
+ }
+ data++;
+ } else {
+ /* Skip ops */
+ rowworkptr += (rowsize_all_planes * op);
+ row_ptr += op;
+ }
+ }
+ }
+ }
+ }
+ }
+/* bitplane_decode_bitplane(this->buf_uk, this->index_buf, this->width, this->height, this->num_bitplanes, 1);*/
+}
+
+static void bitplane_decode_data (video_decoder_t *this_gen,
+ buf_element_t *buf) {
+
+ bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen;
+ xine_bmiheader *bih = 0;
+ palette_entry_t *palette = 0;
+ AnimHeader *anhd = NULL;
+ int i = 0;
+ int j = 0;
+ int buf_ptr = 0;
+ unsigned char r = 0;
+ unsigned char g = 0;
+ unsigned char b = 0;
+ uint8_t *buf_exchange = NULL;
+
+ vo_frame_t *img = 0; /* video out frame */
+
+ /* a video decoder does not care about this flag (?) */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if ((buf->decoder_flags & BUF_FLAG_SPECIAL) &&
+ (buf->decoder_info[1] == BUF_SPECIAL_PALETTE)) {
+ palette = (palette_entry_t *)buf->decoder_info_ptr[2];
+
+ for (i = 0; i < buf->decoder_info[2]; i++) {
+ this->yuv_palette[i * 4 + 0] =
+ COMPUTE_Y(palette[i].r, palette[i].g, palette[i].b);
+ this->yuv_palette[i * 4 + 1] =
+ COMPUTE_U(palette[i].r, palette[i].g, palette[i].b);
+ this->yuv_palette[i * 4 + 2] =
+ COMPUTE_V(palette[i].r, palette[i].g, palette[i].b);
+ this->rgb_palette[i * 4 + 0] = palette[i].r;
+ this->rgb_palette[i * 4 + 1] = palette[i].g;
+ this->rgb_palette[i * 4 + 2] = palette[i].b;
+ }
+
+ /* EHB Pictures not allways contain all 64 colors, sometimes only */
+ /* the first 32 are included and sometimes all 64 colors are provide,*/
+ /* but second 32 are only stupid dirt, so recalculate them */
+ if (((this->num_bitplanes == 6) &&
+ (buf->decoder_info[2] == 32)) ||
+ (this->camg_mode & CAMG_EHB)) {
+ for (i = 32; i < 64; i++) {
+ this->rgb_palette[i * 4 + 0] = palette[(i-32)].r / 2;
+ this->rgb_palette[i * 4 + 1] = palette[(i-32)].g / 2;
+ this->rgb_palette[i * 4 + 2] = palette[(i-32)].b / 2;
+ this->yuv_palette[i * 4 + 0] =
+ COMPUTE_Y(this->rgb_palette[i*4+0], this->rgb_palette[i*4+1], this->rgb_palette[i*4+2]);
+ this->yuv_palette[i * 4 + 1] =
+ COMPUTE_U(this->rgb_palette[i*4+0], this->rgb_palette[i*4+1], this->rgb_palette[i*4+2]);
+ this->yuv_palette[i * 4 + 2] =
+ COMPUTE_V(this->rgb_palette[i*4+0], this->rgb_palette[i*4+1], this->rgb_palette[i*4+2]);
+ }
+ }
+
+ return;
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+
+ bih = (xine_bmiheader *) buf->content;
+ this->width = (bih->biWidth + 15) & ~0x0f;
+ this->height = bih->biHeight;
+ this->num_pixel = this->width * this->height;
+ this->ratio = (double)this->width/(double)this->height;
+ this->video_step = buf->decoder_info[1];
+ /* Palette based Formates use up to 8 Bit per pixel, always use 8 Bit if less */
+ this->bytes_per_pixel = (bih->biBitCount + 1) / 8;
+ if( this->bytes_per_pixel < 1 )
+ this->bytes_per_pixel = 1;
+
+ /* New Buffer for indexes (palette based formats) */
+ this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
+ this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
+
+ this->num_bitplanes = bih->biPlanes;
+ this->camg_mode = bih->biCompression;
+ if( this->camg_mode & CAMG_HAM )
+ this->is_ham = 1;
+ else
+ this->is_ham = 0;
+
+ if( buf->decoder_info[2] != buf->decoder_info[3] &&
+ buf->decoder_info[3] > 0 ) {
+ this->ratio *= buf->decoder_info[2];
+ this->ratio /= buf->decoder_info[3];
+ }
+
+ if( (bih->biCompression & CAMG_HIRES) &&
+ !(bih->biCompression & CAMG_LACE) ) {
+ if( (buf->decoder_info[2] * 16) > (buf->decoder_info[3] * 10) )
+ this->ratio /= 2.0;
+ }
+
+ if( !(bih->biCompression & CAMG_HIRES) &&
+ (bih->biCompression & CAMG_LACE) ) {
+ if( (buf->decoder_info[2] * 10) < (buf->decoder_info[3] * 16) )
+ this->ratio *= 2.0;
+ }
+
+ free (this->buf);
+ this->bufsize = VIDEOBUFSIZE;
+ this->buf = calloc(1, this->bufsize);
+ this->size = 0;
+ this->framenumber = 0;
+
+ init_yuv_planes(&this->yuv_planes, this->width, this->height);
+ init_yuv_planes(&this->yuv_planes_hist, this->width, this->height);
+
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+ this->decoder_ok = 1;
+
+ /* load the stream/meta info */
+ switch( buf->type ) {
+ case BUF_VIDEO_BITPLANE:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Uncompressed bitplane");
+ break;
+ case BUF_VIDEO_BITPLANE_BR1:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "ByteRun1 bitplane");
+ break;
+ default:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Unknown bitplane");
+ break;
+ }
+
+ return;
+ } else if (this->decoder_ok) {
+
+ this->skipframes = 0;
+ this->framenumber++;
+ if (this->size + buf->size > this->bufsize) {
+ this->bufsize = this->size + 2 * buf->size;
+ this->buf = realloc (this->buf, this->bufsize);
+ }
+
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+
+ this->size += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE)
+ this->video_step = buf->decoder_info[0];
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YUY2,
+ VO_BOTH_FIELDS);
+
+ img->duration = this->video_step;
+ img->pts = buf->pts;
+ img->bad_frame = 0;
+ anhd = (AnimHeader *)(buf->decoder_info_ptr[0]);
+
+ if( (this->buf_uk == NULL) ||
+ (anhd == NULL) ||
+ (anhd->operation == IFF_ANHD_ILBM) ) {
+
+ /* iterate through each row */
+ buf_ptr = 0;
+ this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes);
+
+ if( this->buf_uk_hist != NULL )
+ xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk);
+ switch( buf->type ) {
+ case BUF_VIDEO_BITPLANE:
+ /* uncompressed Buffer, set decoded_buf pointer direct to input stream */
+ if( this->buf_uk == NULL )
+ this->buf_uk = malloc(this->size);
+ xine_fast_memcpy (this->buf_uk, this->buf, this->size);
+ break;
+ case BUF_VIDEO_BITPLANE_BR1:
+ /* create Buffer for decompressed bitmap */
+ this->buf_uk = bitplane_decode_byterun1(
+ this->buf, /* compressed buffer */
+ this->size, /* size of compressed data */
+ this->size_uk ); /* size of uncompressed data */
+
+ if( this->buf_uk == NULL ) {
+ xine_log(this->stream->xine, XINE_LOG_MSG,
+ _("bitplane: error doing ByteRun1 decompression\n"));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
+ return;
+ }
+ /* set pointer to decompressed Buffer */
+ break;
+ default:
+ break;
+ }
+ bitplane_decode_bitplane( this->buf_uk, /* bitplane buffer */
+ this->index_buf, /* index buffer */
+ this->width, /* width */
+ this->height, /* hight */
+ this->num_bitplanes, /* number bitplanes */
+ this->bytes_per_pixel); /* used Bytes per pixel */
+
+ if ((this->bytes_per_pixel == 1) &&
+ (this->is_ham == 0) ) {
+ buf_exchange = this->index_buf;
+ for (i = 0; i < (this->height * this->width); i++) {
+ j = *buf_exchange++ * 4;
+ this->yuv_planes.y[i] = this->yuv_palette[j++];
+ this->yuv_planes.u[i] = this->yuv_palette[j++];
+ this->yuv_planes.v[i] = this->yuv_palette[j];
+ }
+ }
+ if( this->buf_uk_hist == NULL ) {
+ this->buf_uk_hist = malloc(this->size_uk);
+ xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk);
+ xine_fast_memcpy (this->index_buf_hist, this->index_buf,
+ (this->num_pixel * this->bytes_per_pixel));
+ xine_fast_memcpy (this->yuv_planes_hist.y, this->yuv_planes.y, (this->num_pixel));
+ xine_fast_memcpy (this->yuv_planes_hist.u, this->yuv_planes.u, (this->num_pixel));
+ xine_fast_memcpy (this->yuv_planes_hist.v, this->yuv_planes.v, (this->num_pixel));
+ }
+ } else {
+ /* when no start-picture is given, create a empty one */
+ if( this->buf_uk_hist == NULL ) {
+ this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes);
+ this->buf_uk = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
+ this->buf_uk_hist = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
+ }
+ if( this->index_buf == NULL ) {
+ this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
+ this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
+ }
+
+ switch( anhd->operation ) {
+ /* also known as IFF-ANIM OPT1 (never seen in real world) */
+ case IFF_ANHD_XOR:
+ xine_log(this->stream->xine, XINE_LOG_MSG,
+ _("bitplane: Anim Opt 1 is not supported at the moment\n"));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
+ return;
+ break;
+ /* also known as IFF-ANIM OPT2 (never seen in real world) */
+ case IFF_ANHD_LDELTA:
+ xine_log(this->stream->xine, XINE_LOG_MSG,
+ _("bitplane: Anim Opt 2 is not supported at the moment\n"));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
+ return;
+ break;
+ /* also known as IFF-ANIM OPT3 */
+ case IFF_ANHD_SDELTA:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT3");
+ bitplane_sdelta_opt_3 ( this );
+ return;
+ break;
+ /* also known as IFF-ANIM OPT4 (never seen in real world) */
+ case IFF_ANHD_SLDELTA:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT4 (SLDELTA)");
+ bitplane_set_dlta_short ( this );
+ break;
+ /* also known as IFF-ANIM OPT5 */
+ case IFF_ANHD_BVDELTA:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT5 (BVDELTA)");
+ bitplane_dlta_5(this);
+ break;
+ /* IFF-ANIM OPT6 is exactly the same as OPT5, but for stereo-displays */
+ /* first picture is on the left display, second on the right, third on */
+ /* the left, forth on right, ... Only display left picture on mono display*/
+ case IFF_ANHD_STEREOO5:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT6 (BVDELTA STEREO)");
+ bitplane_dlta_5(this);
+ if( this->framenumber % 2 == 0 )
+ this->skipframes = 1;
+ return;
+ break;
+ case IFF_ANHD_OPT7:
+ if(anhd->bits == 0) {
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT7 (SHORT)");
+ bitplane_dlta_7_short(this);
+ } else {
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT7 (LONG)");
+ bitplane_dlta_7_long(this);
+ }
+ break;
+ case IFF_ANHD_OPT8:
+ if(anhd->bits == 0) {
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT8 (SHORT)");
+ bitplane_dlta_8_short(this);
+ } else {
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Anim OPT8 (LONG)");
+ bitplane_dlta_8_long(this);
+ }
+ break;
+ case IFF_ANHD_ASCIIJ:
+ xine_log(this->stream->xine, XINE_LOG_MSG,
+ _("bitplane: Anim ASCIIJ is not supported at the moment\n"));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
+ return;
+ break;
+ default:
+ xine_log(this->stream->xine, XINE_LOG_MSG,
+ _("bitplane: This anim-type is not supported at the moment\n"));
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HANDLED, 0);
+ return;
+ break;
+ }
+ /* change old bitmap buffer (which now is the new one) with new buffer */
+ buf_exchange = this->buf_uk;
+ this->buf_uk = this->buf_uk_hist;
+ this->buf_uk_hist = buf_exchange;
+ /* do the same with the index buffer */
+ buf_exchange = this->index_buf;
+ this->index_buf = this->index_buf_hist;
+ this->index_buf_hist = buf_exchange;
+ /* and also with yuv buffer */
+ buf_exchange = this->yuv_planes.y;
+ this->yuv_planes.y = this->yuv_planes_hist.y;
+ this->yuv_planes_hist.y = buf_exchange;
+ buf_exchange = this->yuv_planes.u;
+ this->yuv_planes.u = this->yuv_planes_hist.u;
+ this->yuv_planes_hist.u = buf_exchange;
+ buf_exchange = this->yuv_planes.v;
+ this->yuv_planes.v = this->yuv_planes_hist.v;
+ this->yuv_planes_hist.v = buf_exchange;
+ }
+
+ if( this->skipframes == 0 ) {
+ switch (this->bytes_per_pixel) {
+ case 1:
+ /* HAM-pictrues need special handling */
+ if( this->is_ham ) {
+ /* Decode HAM-Pictures to YUV */
+ bitplane_decode_ham( this->index_buf, /* HAM-bitplane buffer */
+ &(this->yuv_planes), /* YUV buffer */
+ this->width, /* width */
+ this->height, /* hight */
+ this->num_bitplanes, /* number bitplanes */
+ this->bytes_per_pixel, /* used Bytes per pixel */
+ this->rgb_palette); /* Palette (RGB) */
+ }
+ break;
+ case 3:
+ buf_exchange = this->index_buf;
+ for (i = 0; i < (this->height * this->width); i++) {
+ r = *buf_exchange++;
+ g = *buf_exchange++;
+ b = *buf_exchange++;
+
+ this->yuv_planes.y[i] = COMPUTE_Y(r, g, b);
+ this->yuv_planes.u[i] = COMPUTE_U(r, g, b);
+ this->yuv_planes.v[i] = COMPUTE_V(r, g, b);
+ }
+ break;
+ default:
+ break;
+ }
+
+ yuv444_to_yuy2(&this->yuv_planes, img->base[0], img->pitches[0]);
+
+ img->draw(img, this->stream);
+ }
+ img->free(img);
+
+ this->size = 0;
+ if ( buf->decoder_info[1] > 90000 )
+ xine_usec_sleep(buf->decoder_info[1]);
+ }
+ }
+}
+
+/*
+ * This function is called when xine needs to flush the system. Not
+ * sure when or if this is used or even if it needs to do anything.
+ */
+static void bitplane_flush (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void bitplane_reset (video_decoder_t *this_gen) {
+ bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen;
+
+ this->size = 0;
+}
+
+static void bitplane_discontinuity (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void bitplane_dispose (video_decoder_t *this_gen) {
+ bitplane_decoder_t *this = (bitplane_decoder_t *) this_gen;
+
+ free (this->buf);
+ free (this->buf_uk);
+ free (this->buf_uk_hist);
+ free (this->index_buf);
+ free (this->index_buf_hist);
+ free (this->index_buf);
+
+ if (this->decoder_ok) {
+ this->decoder_ok = 0;
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ }
+
+ free (this_gen);
+}
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ bitplane_decoder_t *this = (bitplane_decoder_t *) calloc(1, sizeof(bitplane_decoder_t));
+
+ this->video_decoder.decode_data = bitplane_decode_data;
+ this->video_decoder.flush = bitplane_flush;
+ this->video_decoder.reset = bitplane_reset;
+ this->video_decoder.discontinuity = bitplane_discontinuity;
+ this->video_decoder.dispose = bitplane_dispose;
+ this->size = 0;
+
+ this->stream = stream;
+ this->class = (bitplane_class_t *) class_gen;
+
+ this->decoder_ok = 0;
+ this->buf = NULL;
+ this->buf_uk = NULL;
+ this->index_buf = NULL;
+ this->index_buf = NULL;
+
+ return &this->video_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ bitplane_class_t *this = (bitplane_class_t *) calloc(1, sizeof(bitplane_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "bitplane";
+ this->decoder_class.description = N_("Raw bitplane video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t video_types[] = {
+ BUF_VIDEO_BITPLANE,
+ BUF_VIDEO_BITPLANE_BR1,
+ 0
+};
+
+static const decoder_info_t dec_info_video = {
+ video_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "bitplane", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/foovideo.c b/src/video_dec/foovideo.c
new file mode 100644
index 000000000..99ec1287b
--- /dev/null
+++ b/src/video_dec/foovideo.c
@@ -0,0 +1,285 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * foovideo.c: This is a reference video decoder for the xine multimedia
+ * player. It really works too! It will output frames of packed YUY2 data
+ * where each byte in the map is the same value, which is 3 larger than the
+ * value from the last frame. This creates a slowly rotating solid color
+ * frame when the frames are played in succession.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+#define VIDEOBUFSIZE 128*1024
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} foovideo_class_t;
+
+typedef struct foovideo_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ foovideo_class_t *class;
+ xine_stream_t *stream;
+
+ /* these are traditional variables in a video decoder object */
+ uint64_t video_step; /* frame duration in pts units */
+ int decoder_ok; /* current decoder status */
+ int skipframes;
+
+ unsigned char *buf; /* the accumulated buffer data */
+ int bufsize; /* the maximum size of buf */
+ int size; /* the current size of buf */
+
+ int width; /* the width of a video frame */
+ int height; /* the height of a video frame */
+ double ratio; /* the width to height ratio */
+
+ /* these are variables exclusive to the foo video decoder */
+ unsigned char current_yuv_byte;
+
+} foovideo_decoder_t;
+
+/**************************************************************************
+ * foovideo specific decode functions
+ *************************************************************************/
+
+/**************************************************************************
+ * xine video plugin functions
+ *************************************************************************/
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void foovideo_decode_data (video_decoder_t *this_gen,
+ buf_element_t *buf) {
+
+ foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
+ xine_bmiheader *bih;
+
+ vo_frame_t *img; /* video out frame */
+
+ /* a video decoder does not care about this flag (?) */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
+ this->video_step = buf->decoder_info[0];
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+
+ free(this->buf);
+
+ bih = (xine_bmiheader *) buf->content;
+ this->width = bih->biWidth;
+ this->height = bih->biHeight;
+ this->ratio = (double)this->width/(double)this->height;
+
+ if (this->buf)
+ free (this->buf);
+ this->bufsize = VIDEOBUFSIZE;
+ this->buf = malloc(this->bufsize);
+ this->size = 0;
+
+ /* take this opportunity to load the stream/meta info */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "foovideo");
+
+ /* do anything else relating to initializing this decoder */
+ this->current_yuv_byte = 0;
+
+ this->decoder_ok = 1;
+
+ return;
+ } else if (this->decoder_ok) {
+
+ if (this->size + buf->size > this->bufsize) {
+ this->bufsize = this->size + 2 * buf->size;
+ this->buf = realloc (this->buf, this->bufsize);
+ }
+
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+
+ this->size += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio,
+ XINE_IMGFMT_YUY2, VO_BOTH_FIELDS);
+
+ img->duration = this->video_step;
+ img->pts = buf->pts;
+ img->bad_frame = 0;
+
+ memset(img->base[0], this->current_yuv_byte,
+ this->width * this->height * 2);
+ this->current_yuv_byte += 3;
+
+ img->draw(img, this->stream);
+ img->free(img);
+
+ this->size = 0;
+ }
+ }
+}
+
+/*
+ * This function is called when xine needs to flush the system.
+ */
+static void foovideo_flush (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void foovideo_reset (video_decoder_t *this_gen) {
+ foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
+
+ this->size = 0;
+}
+
+/*
+ * The decoder should forget any stored pts values here.
+ */
+static void foovideo_discontinuity (video_decoder_t *this_gen) {
+ foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
+
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void foovideo_dispose (video_decoder_t *this_gen) {
+
+ foovideo_decoder_t *this = (foovideo_decoder_t *) this_gen;
+
+ free (this->buf);
+
+ if (this->decoder_ok) {
+ this->decoder_ok = 0;
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ }
+
+ free (this_gen);
+}
+
+/*
+ * This function allocates, initializes, and returns a private video
+ * decoder structure.
+ */
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ foovideo_decoder_t *this ;
+
+ this = (foovideo_decoder_t *) calloc(1, sizeof(foovideo_decoder_t));
+
+ this->video_decoder.decode_data = foovideo_decode_data;
+ this->video_decoder.flush = foovideo_flush;
+ this->video_decoder.reset = foovideo_reset;
+ this->video_decoder.discontinuity = foovideo_discontinuity;
+ this->video_decoder.dispose = foovideo_dispose;
+ this->size = 0;
+
+ this->stream = stream;
+ this->class = (foovideo_class_t *) class_gen;
+
+ this->decoder_ok = 0;
+ this->buf = NULL;
+
+ return &this->video_decoder;
+}
+
+/*
+ * This function frees the video decoder class and any other memory that was
+ * allocated.
+ */
+static void dispose_class (video_decoder_class_t *this) {
+ free (this);
+}
+
+/*
+ * This function allocates a private video decoder class and initializes
+ * the class's member functions.
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ foovideo_class_t *this;
+
+ this = (foovideo_class_t *) calloc(1, sizeof(foovideo_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "foovideo";
+ this->decoder_class.description = N_("foovideo: reference xine video decoder plugin");
+ this->decoder_class.dispose = dispose_class;
+
+ return this;
+}
+
+/*
+ * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
+ /* BUF_VIDEO_FOOVIDEO, */
+ BUF_VIDEO_VQA,
+ BUF_VIDEO_SORENSON_V3,
+ 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_video = {
+ video_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, "name", version, special_info, init_function } */
+ { PLUGIN_VIDEO_DECODER, 19, "foovideo", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/gdkpixbuf.c b/src/video_dec/gdkpixbuf.c
new file mode 100644
index 000000000..ed88323fb
--- /dev/null
+++ b/src/video_dec/gdkpixbuf.c
@@ -0,0 +1,299 @@
+/*
+ * Copyright (C) 2006 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, USA
+ *
+ * a gdk-pixbuf-based image video decoder
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#define LOG_MODULE "gdkpixbuf_video_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+#include <gdk-pixbuf/gdk-pixbuf.h>
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+
+ /*
+ * private variables
+ */
+
+} image_class_t;
+
+
+typedef struct image_decoder_s {
+ video_decoder_t video_decoder;
+
+ image_class_t *cls;
+
+ xine_stream_t *stream;
+ int video_open;
+
+ GdkPixbufLoader *loader;
+
+} image_decoder_t;
+
+
+static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
+ image_decoder_t *this = (image_decoder_t *) this_gen;
+ GError *error = NULL;
+
+ if (!this->video_open) {
+ lprintf("opening video\n");
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+ this->video_open = 1;
+ }
+
+ if (this->loader == NULL) {
+ this->loader = gdk_pixbuf_loader_new ();
+ }
+
+ if (gdk_pixbuf_loader_write (this->loader, buf->mem, buf->size, &error) == FALSE) {
+ lprintf("error loading image: %s\n", error->message);
+ g_error_free (error);
+ gdk_pixbuf_loader_close (this->loader, NULL);
+ g_object_unref (G_OBJECT (this->loader));
+ this->loader = NULL;
+ return;
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+ GdkPixbuf *pixbuf;
+ int width, height, x, y, rowstride, n_channels, i;
+ guchar *img_buf;
+ yuv_planes_t yuv_planes;
+ vo_frame_t *img;
+
+ /*
+ * this->image -> rgb data
+ */
+ if (gdk_pixbuf_loader_close (this->loader, &error) == FALSE) {
+ lprintf("error loading image: %s\n", error->message);
+ g_error_free (error);
+ g_object_unref (G_OBJECT (this->loader));
+ this->loader = NULL;
+ return;
+ }
+
+ pixbuf = gdk_pixbuf_loader_get_pixbuf (this->loader);
+ if (pixbuf != NULL)
+ g_object_ref (G_OBJECT (pixbuf));
+ g_object_unref (this->loader);
+ this->loader = NULL;
+
+ if (pixbuf == NULL) {
+ lprintf("error loading image\n");
+ return;
+ }
+
+ width = gdk_pixbuf_get_width (pixbuf) & ~1; /* must be even for init_yuv_planes */
+ height = gdk_pixbuf_get_height (pixbuf);
+ img_buf = gdk_pixbuf_get_pixels (pixbuf);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, height);
+
+ lprintf("image loaded successfully\n");
+
+ /*
+ * rgb data -> yuv_planes
+ */
+ init_yuv_planes(&yuv_planes, width, height);
+
+ n_channels = gdk_pixbuf_get_n_channels (pixbuf);
+ rowstride = gdk_pixbuf_get_rowstride (pixbuf);
+ i = 0;
+ for (y = 0; y < height; y++) {
+ for (x = 0; x < width; x++) {
+ guchar *p;
+ p = img_buf + y * rowstride + x * n_channels;
+
+ yuv_planes.y[i] = COMPUTE_Y (p[0], p[1], p[2]);
+ yuv_planes.u[i] = COMPUTE_U (p[0], p[1], p[2]);
+ yuv_planes.v[i] = COMPUTE_V (p[0], p[1], p[2]);
+
+ i++;
+ }
+ }
+ gdk_pixbuf_unref (pixbuf);
+
+ /*
+ * alloc and draw video frame
+ */
+ img = this->stream->video_out->get_frame (this->stream->video_out, width,
+ height, (double)width/(double)height,
+ XINE_IMGFMT_YUY2,
+ VO_BOTH_FIELDS);
+ img->pts = buf->pts;
+ img->duration = 3600;
+ img->bad_frame = 0;
+
+ yuv444_to_yuy2(&yuv_planes, img->base[0], img->pitches[0]);
+ free_yuv_planes(&yuv_planes);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, img->duration);
+
+ img->draw(img, this->stream);
+ img->free(img);
+ }
+}
+
+
+static void image_flush (video_decoder_t *this_gen) {
+ /* image_decoder_t *this = (image_decoder_t *) this_gen; */
+
+ /*
+ * flush out any frames that are still stored in the decoder
+ */
+}
+
+
+static void image_reset (video_decoder_t *this_gen) {
+ image_decoder_t *this = (image_decoder_t *) this_gen;
+
+ /*
+ * reset decoder after engine flush (prepare for new
+ * video data not related to recently decoded data)
+ */
+
+ if (this->loader != NULL) {
+ gdk_pixbuf_loader_close (this->loader, NULL);
+ g_object_unref (G_OBJECT (this->loader));
+ this->loader = NULL;
+ }
+}
+
+
+static void image_discontinuity (video_decoder_t *this_gen) {
+ /* image_decoder_t *this = (image_decoder_t *) this_gen; */
+
+ /*
+ * a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
+}
+
+static void image_dispose (video_decoder_t *this_gen) {
+ image_decoder_t *this = (image_decoder_t *) this_gen;
+
+ if (this->video_open) {
+ lprintf("closing video\n");
+
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ this->video_open = 0;
+ }
+
+ if (this->loader != NULL) {
+ gdk_pixbuf_loader_close (this->loader, NULL);
+ g_object_unref (G_OBJECT (this->loader));
+ this->loader = NULL;
+ }
+
+ lprintf("closed\n");
+ free (this);
+}
+
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
+ xine_stream_t *stream) {
+
+ image_class_t *cls = (image_class_t *) class_gen;
+ image_decoder_t *this;
+
+ lprintf("opened\n");
+
+ g_type_init ();
+
+ this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
+
+ this->video_decoder.decode_data = image_decode_data;
+ this->video_decoder.flush = image_flush;
+ this->video_decoder.reset = image_reset;
+ this->video_decoder.discontinuity = image_discontinuity;
+ this->video_decoder.dispose = image_dispose;
+ this->cls = cls;
+ this->stream = stream;
+
+ /*
+ * initialisation of privates
+ */
+
+ return &this->video_decoder;
+}
+
+/*
+ * image plugin class
+ */
+static void *init_class (xine_t *xine, void *data) {
+
+ image_class_t *this;
+
+ this = (image_class_t *) calloc(1, sizeof(image_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "gdkpixbuf";
+ this->decoder_class.description = N_("gdk-pixbuf image video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ /*
+ * initialisation of privates
+ */
+
+ lprintf("class opened\n");
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t supported_types[] = { BUF_VIDEO_IMAGE, BUF_VIDEO_JPEG, 0 };
+
+static const decoder_info_t dec_info_image = {
+ supported_types, /* supported types */
+ 7 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "gdkpixbuf", XINE_VERSION_CODE, &dec_info_image, init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/image.c b/src/video_dec/image.c
new file mode 100644
index 000000000..e91588702
--- /dev/null
+++ b/src/video_dec/image.c
@@ -0,0 +1,306 @@
+/*
+ * Copyright (C) 2003-2005 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, USA
+ *
+ * a image video decoder
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+
+#define LOG_MODULE "image_video_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <wand/magick_wand.h>
+#ifdef PACKAGE_NAME
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#endif
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+#ifdef HAVE_GRAPHICSMAGICK
+# define MAGICK_VERSION 0x670
+#else
+# if !defined(MagickLibVersion) || MagickLibVersion < 0x671
+# define MAGICK_VERSION 0x670
+#else
+# define MAGICK_VERSION MagickLibVersion
+# endif
+#endif
+
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+
+ /*
+ * private variables
+ */
+
+} image_class_t;
+
+
+typedef struct image_decoder_s {
+ video_decoder_t video_decoder;
+
+ image_class_t *cls;
+
+ xine_stream_t *stream;
+ int video_open;
+
+ unsigned char *image;
+ int index;
+
+} image_decoder_t;
+
+
+static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
+ image_decoder_t *this = (image_decoder_t *) this_gen;
+
+ if (!this->video_open) {
+ lprintf("opening video\n");
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+ this->video_open = 1;
+ }
+
+ xine_buffer_copyin(this->image, this->index, buf->mem, buf->size);
+ this->index += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+ int width, height, i;
+ int status;
+ MagickWand *wand;
+ uint8_t *img_buf, *img_buf_ptr;
+ yuv_planes_t yuv_planes;
+ vo_frame_t *img;
+
+ /*
+ * this->image -> rgb data
+ */
+#if MAGICK_VERSION < 0x671
+ InitializeMagick(NULL);
+#else
+ MagickWandGenesis();
+#endif
+ wand = NewMagickWand();
+ status = MagickReadImageBlob(wand, this->image, this->index);
+
+ this->index = 0;
+
+ if (!status) {
+ DestroyMagickWand(wand);
+#if MAGICK_VERSION < 0x671
+ DestroyMagick();
+#else
+ MagickWandTerminus();
+#endif
+ lprintf("error loading image\n");
+ return;
+ }
+
+ width = MagickGetImageWidth(wand) & ~1; /* must be even for init_yuv_planes */
+ height = MagickGetImageHeight(wand);
+ img_buf = malloc(width * height * 3);
+#if MAGICK_VERSION < 0x671
+ MagickGetImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf);
+ DestroyMagickWand(wand);
+ DestroyMagick();
+#else
+ MagickExportImagePixels(wand, 0, 0, width, height, "RGB", CharPixel, img_buf);
+ DestroyMagickWand(wand);
+ MagickWandTerminus();
+#endif
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, width);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, height);
+
+ lprintf("image loaded successfully\n");
+
+ /*
+ * rgb data -> yuv_planes
+ */
+ init_yuv_planes(&yuv_planes, width, height);
+
+ img_buf_ptr = img_buf;
+ for (i=0; i < width*height; i++) {
+ uint8_t r = *(img_buf_ptr++);
+ uint8_t g = *(img_buf_ptr++);
+ uint8_t b = *(img_buf_ptr++);
+
+ yuv_planes.y[i] = COMPUTE_Y(r, g, b);
+ yuv_planes.u[i] = COMPUTE_U(r, g, b);
+ yuv_planes.v[i] = COMPUTE_V(r, g, b);
+ }
+ free(img_buf);
+
+ /*
+ * alloc and draw video frame
+ */
+ img = this->stream->video_out->get_frame (this->stream->video_out, width,
+ height, (double)width/(double)height,
+ XINE_IMGFMT_YUY2,
+ VO_BOTH_FIELDS);
+ img->pts = buf->pts;
+ img->duration = 3600;
+ img->bad_frame = 0;
+
+ yuv444_to_yuy2(&yuv_planes, img->base[0], img->pitches[0]);
+ free_yuv_planes(&yuv_planes);
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, img->duration);
+
+ img->draw(img, this->stream);
+ img->free(img);
+ }
+}
+
+
+static void image_flush (video_decoder_t *this_gen) {
+ /* image_decoder_t *this = (image_decoder_t *) this_gen; */
+
+ /*
+ * flush out any frames that are still stored in the decoder
+ */
+}
+
+
+static void image_reset (video_decoder_t *this_gen) {
+ image_decoder_t *this = (image_decoder_t *) this_gen;
+
+ /*
+ * reset decoder after engine flush (prepare for new
+ * video data not related to recently decoded data)
+ */
+
+ this->index = 0;
+}
+
+
+static void image_discontinuity (video_decoder_t *this_gen) {
+ /* image_decoder_t *this = (image_decoder_t *) this_gen; */
+
+ /*
+ * a time reference discontinuity has happened.
+ * that is, it must forget any currently held pts value
+ */
+}
+
+static void image_dispose (video_decoder_t *this_gen) {
+ image_decoder_t *this = (image_decoder_t *) this_gen;
+
+ if (this->video_open) {
+ lprintf("closing video\n");
+
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ this->video_open = 0;
+ }
+
+ xine_buffer_free(this->image);
+
+ lprintf("closed\n");
+ free (this);
+}
+
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
+ xine_stream_t *stream) {
+
+ image_class_t *cls = (image_class_t *) class_gen;
+ image_decoder_t *this;
+
+ lprintf("opened\n");
+
+ this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
+
+ this->video_decoder.decode_data = image_decode_data;
+ this->video_decoder.flush = image_flush;
+ this->video_decoder.reset = image_reset;
+ this->video_decoder.discontinuity = image_discontinuity;
+ this->video_decoder.dispose = image_dispose;
+ this->cls = cls;
+ this->stream = stream;
+
+ /*
+ * initialisation of privates
+ */
+
+ this->image = xine_buffer_init(10240);
+
+ return &this->video_decoder;
+}
+
+/*
+ * image plugin class
+ */
+static void *init_class (xine_t *xine, void *data) {
+
+ image_class_t *this;
+
+ this = (image_class_t *) calloc(1, sizeof(image_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "imagevdec";
+ this->decoder_class.description = N_("image video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ /*
+ * initialisation of privates
+ */
+
+ lprintf("class opened\n");
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t supported_types[] = { BUF_VIDEO_IMAGE,
+ 0 };
+
+static const decoder_info_t dec_info_image = {
+ supported_types, /* supported types */
+ 6 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "image", XINE_VERSION_CODE, &dec_info_image, init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/libmpeg2/Makefile.am b/src/video_dec/libmpeg2/Makefile.am
new file mode 100644
index 000000000..a6aab2a72
--- /dev/null
+++ b/src/video_dec/libmpeg2/Makefile.am
@@ -0,0 +1,34 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+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 = \
+ cpu_state.c \
+ decode.c \
+ header.c \
+ idct.c \
+ idct_altivec.c \
+ idct_mlib.c \
+ idct_mmx.c \
+ motion_comp.c \
+ motion_comp_altivec.c \
+ motion_comp_mmx.c \
+ motion_comp_mlib.c \
+ motion_comp_vis.c \
+ slice.c \
+ slice_xvmc.c \
+ slice_xvmc_vld.c \
+ stats.c \
+ xine_mpeg2_decoder.c \
+ libmpeg2_accel.c
+
+xineplug_decode_mpeg2_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) $(LTLIBINTL) $(AVUTIL_LIBS) -lm
+xineplug_decode_mpeg2_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS) $(AVUTIL_CFLAGS)
diff --git a/src/video_dec/libmpeg2/cpu_state.c b/src/video_dec/libmpeg2/cpu_state.c
new file mode 100644
index 000000000..d1507eec1
--- /dev/null
+++ b/src/video_dec/libmpeg2/cpu_state.c
@@ -0,0 +1,184 @@
+/*
+ * cpu_state.c
+ * 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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 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 <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
+
+void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL;
+void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL;
+
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+static void state_restore_mmx (cpu_state_t * state)
+{
+ emms ();
+}
+#endif
+
+#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
+
+#ifndef HOST_OS_DARWIN
+
+static void state_save_altivec (cpu_state_t * state)
+{
+ asm (" \n"
+ " li %r9, 16 \n"
+ " stvx %v20, 0, %r3 \n"
+ " li %r11, 32 \n"
+ " stvx %v21, %r9, %r3 \n"
+ " li %r9, 48 \n"
+ " stvx %v22, %r11, %r3 \n"
+ " li %r11, 64 \n"
+ " stvx %v23, %r9, %r3 \n"
+ " li %r9, 80 \n"
+ " stvx %v24, %r11, %r3 \n"
+ " li %r11, 96 \n"
+ " stvx %v25, %r9, %r3 \n"
+ " li %r9, 112 \n"
+ " stvx %v26, %r11, %r3 \n"
+ " li %r11, 128 \n"
+ " stvx %v27, %r9, %r3 \n"
+ " li %r9, 144 \n"
+ " stvx %v28, %r11, %r3 \n"
+ " li %r11, 160 \n"
+ " stvx %v29, %r9, %r3 \n"
+ " li %r9, 176 \n"
+ " stvx %v30, %r11, %r3 \n"
+ " stvx %v31, %r9, %r3 \n"
+ );
+}
+
+static void state_restore_altivec (cpu_state_t * state)
+{
+ asm (" \n"
+ " li %r9, 16 \n"
+ " lvx %v20, 0, %r3 \n"
+ " li %r11, 32 \n"
+ " lvx %v21, %r9, %r3 \n"
+ " li %r9, 48 \n"
+ " lvx %v22, %r11, %r3 \n"
+ " li %r11, 64 \n"
+ " lvx %v23, %r9, %r3 \n"
+ " li %r9, 80 \n"
+ " lvx %v24, %r11, %r3 \n"
+ " li %r11, 96 \n"
+ " lvx %v25, %r9, %r3 \n"
+ " li %r9, 112 \n"
+ " lvx %v26, %r11, %r3 \n"
+ " li %r11, 128 \n"
+ " lvx %v27, %r9, %r3 \n"
+ " li %r9, 144 \n"
+ " lvx %v28, %r11, %r3 \n"
+ " li %r11, 160 \n"
+ " lvx %v29, %r9, %r3 \n"
+ " li %r9, 176 \n"
+ " lvx %v30, %r11, %r3 \n"
+ " lvx %v31, %r9, %r3 \n"
+ );
+}
+
+#else /* HOST_OS_DARWIN */
+
+#define LI(a,b) "li r" #a "," #b "\n\t"
+#define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t"
+#define STVX(a,b,c) "stvx v" #a ",r" #b ",r" #c "\n\t"
+#define LVX0(a,b,c) "lvx v" #a ",0,r" #c "\n\t"
+#define LVX(a,b,c) "lvx v" #a ",r" #b ",r" #c "\n\t"
+
+static void state_save_altivec (cpu_state_t * state)
+{
+ asm (LI (9, 16)
+ STVX0 (20, 0, 3)
+ LI (11, 32)
+ STVX (21, 9, 3)
+ LI (9, 48)
+ STVX (22, 11, 3)
+ LI (11, 64)
+ STVX (23, 9, 3)
+ LI (9, 80)
+ STVX (24, 11, 3)
+ LI (11, 96)
+ STVX (25, 9, 3)
+ LI (9, 112)
+ STVX (26, 11, 3)
+ LI (11, 128)
+ STVX (27, 9, 3)
+ LI (9, 144)
+ STVX (28, 11, 3)
+ LI (11, 160)
+ STVX (29, 9, 3)
+ LI (9, 176)
+ STVX (30, 11, 3)
+ STVX (31, 9, 3));
+}
+
+static void state_restore_altivec (cpu_state_t * state)
+{
+ asm (LI (9, 16)
+ LVX0 (20, 0, 3)
+ LI (11, 32)
+ LVX (21, 9, 3)
+ LI (9, 48)
+ LVX (22, 11, 3)
+ LI (11, 64)
+ LVX (23, 9, 3)
+ LI (9, 80)
+ LVX (24, 11, 3)
+ LI (11, 96)
+ LVX (25, 9, 3)
+ LI (9, 112)
+ LVX (26, 11, 3)
+ LI (11, 128)
+ LVX (27, 9, 3)
+ LI (9, 144)
+ LVX (28, 11, 3)
+ LI (11, 160)
+ LVX (29, 9, 3)
+ LI (9, 176)
+ LVX (30, 11, 3)
+ LVX (31, 9, 3));
+}
+#endif /* HOST_OS_DARWIN */
+
+#endif /* defined (ARCH_PPC) && defined (ENABLE_ALTIVEC) */
+
+void mpeg2_cpu_state_init (uint32_t mm_accel)
+{
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+ if (mm_accel & MM_ACCEL_X86_MMX) {
+ mpeg2_cpu_state_restore = state_restore_mmx;
+ }
+#endif
+#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
+ if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
+ mpeg2_cpu_state_save = state_save_altivec;
+ mpeg2_cpu_state_restore = state_restore_altivec;
+ }
+#endif
+}
+
diff --git a/src/video_dec/libmpeg2/decode.c b/src/video_dec/libmpeg2/decode.c
new file mode 100644
index 000000000..848d111fc
--- /dev/null
+++ b/src/video_dec/libmpeg2/decode.c
@@ -0,0 +1,1006 @@
+/*
+ * decode.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * xine-specific version by G. Bartsch
+ *
+ */
+
+#include "config.h"
+#include <stdio.h>
+#include <string.h> /* memcpy/memset, try to remove */
+#include <stdlib.h>
+#include <inttypes.h>
+#include <math.h>
+
+#define LOG_MODULE "decode"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+
+#include "mpeg2.h"
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+#include "libmpeg2_accel.h"
+
+/*
+#define LOG_PAN_SCAN
+*/
+
+/* #define BUFFER_SIZE (224 * 1024) */
+#define BUFFER_SIZE (1194 * 1024) /* new buffer size for mpeg2dec 0.2.1 */
+
+static void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer);
+
+void mpeg2_init (mpeg2dec_t * mpeg2dec,
+ xine_video_port_t * output)
+{
+ static int do_init = 1;
+ uint32_t mm_accel;
+
+ if (do_init) {
+ do_init = 0;
+ mm_accel = xine_mm_accel();
+ mpeg2_cpu_state_init (mm_accel);
+ mpeg2_idct_init (mm_accel);
+ mpeg2_mc_init (mm_accel);
+ libmpeg2_accel_scan(&mpeg2dec->accel, mpeg2_scan_norm, mpeg2_scan_alt);
+ }
+
+ if( !mpeg2dec->chunk_buffer )
+ mpeg2dec->chunk_buffer = av_mallocz(BUFFER_SIZE + 4);
+ if( !mpeg2dec->picture )
+ mpeg2dec->picture = av_mallocz(sizeof(picture_t));
+
+ mpeg2dec->shift = 0xffffff00;
+ mpeg2dec->new_sequence = 0;
+ mpeg2dec->is_sequence_needed = 1;
+ mpeg2dec->is_wait_for_ip_frames = 2;
+ mpeg2dec->frames_to_drop = 0;
+ mpeg2dec->drop_frame = 0;
+ mpeg2dec->in_slice = 0;
+ mpeg2dec->output = output;
+ mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
+ mpeg2dec->code = 0xb4;
+ mpeg2dec->seek_mode = 0;
+
+ /* initialize AFD storage */
+ mpeg2dec->afd_value_seen = XINE_VIDEO_AFD_NOT_PRESENT;
+ mpeg2dec->afd_value_reported = (XINE_VIDEO_AFD_NOT_PRESENT - 1);
+
+ /* initialize substructures */
+ mpeg2_header_state_init (mpeg2dec->picture);
+
+ if ( output->get_capabilities(output) & VO_CAP_XXMC) {
+ printf("libmpeg2: output port has XxMC capability\n");
+ mpeg2dec->frame_format = XINE_IMGFMT_XXMC;
+ } else if( output->get_capabilities(output) & VO_CAP_XVMC_MOCOMP) {
+ printf("libmpeg2: output port has XvMC capability\n");
+ mpeg2dec->frame_format = XINE_IMGFMT_XVMC;
+ } else {
+ mpeg2dec->frame_format = XINE_IMGFMT_YV12;
+ }
+}
+
+static inline void get_frame_duration (mpeg2dec_t * mpeg2dec, vo_frame_t *frame)
+{
+ static const double durations[] = {
+ 0, /* invalid */
+ 3753.75, /* 23.976 fps */
+ 3750, /* 24 fps */
+ 3600, /* 25 fps */
+ 3003, /* 29.97 fps */
+ 3000, /* 30 fps */
+ 1800, /* 50 fps */
+ 1501.5, /* 59.94 fps */
+ 1500, /* 60 fps */
+ };
+ double duration = ((unsigned) mpeg2dec->picture->frame_rate_code > 8u)
+ ? 0 : durations[mpeg2dec->picture->frame_rate_code];
+
+ duration = duration * (mpeg2dec->picture->frame_rate_ext_n + 1.0) /
+ (mpeg2dec->picture->frame_rate_ext_d + 1.0);
+
+ /* this should be used to detect any special rff pattern */
+ mpeg2dec->rff_pattern = mpeg2dec->rff_pattern << 1;
+ mpeg2dec->rff_pattern |= !!frame->repeat_first_field;
+
+ if( ((mpeg2dec->rff_pattern & 0xff) == 0xaa ||
+ (mpeg2dec->rff_pattern & 0xff) == 0x55) &&
+ !mpeg2dec->picture->progressive_sequence ) {
+ /* special case for ntsc 3:2 pulldown */
+ duration *= 5.0 / 4.0;
+ }
+ else
+ {
+ if( frame->repeat_first_field ) {
+ if( !mpeg2dec->picture->progressive_sequence &&
+ frame->progressive_frame ) {
+ /* decoder should output 3 fields, so adjust duration to
+ count on this extra field time */
+ duration *= 3.0 / 2.0;
+ } else if( mpeg2dec->picture->progressive_sequence ) {
+ /* for progressive sequences the output should repeat the
+ frame 1 or 2 times depending on top_field_first flag. */
+ duration *= (frame->top_field_first) ? 3 : 2;
+ }
+ }
+ }
+
+ frame->duration = (int) ceil (duration);
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, frame->duration);
+ /*printf("mpeg2dec: rff=%u\n",frame->repeat_first_field);*/
+}
+
+static double get_aspect_ratio(mpeg2dec_t *mpeg2dec)
+{
+ double ratio;
+ picture_t * picture = mpeg2dec->picture;
+ double mpeg1_pel_ratio[16] = {1.0 /* forbidden */,
+ 1.0, 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, 1.0 /*reserved*/ };
+
+ /* TODO: For slower machines the value of this function should be computed
+ * once and cached!
+ */
+
+ if( !picture->mpeg1 ) {
+ /* these hardcoded values are defined on mpeg2 standard for
+ * aspect ratio. other values are reserved or forbidden. */
+ switch(picture->aspect_ratio_information) {
+ case 2:
+ ratio = 4.0/3.0;
+ break;
+ case 3:
+ ratio = 16.0/9.0;
+ break;
+ case 4:
+ ratio = 2.11/1.0;
+ break;
+ case 1:
+ default:
+ ratio = (double)picture->coded_picture_width/(double)picture->coded_picture_height;
+ break;
+ }
+ } else {
+ /* mpeg1 constants refer to pixel aspect ratio */
+ ratio = (double)picture->coded_picture_width/(double)picture->coded_picture_height;
+ ratio /= mpeg1_pel_ratio[picture->aspect_ratio_information];
+ }
+
+ return ratio;
+}
+
+static void remember_metainfo (mpeg2dec_t *mpeg2dec) {
+
+ picture_t * picture = mpeg2dec->picture;
+
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_WIDTH, picture->display_width);
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, picture->display_height);
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_RATIO,
+ ((double)10000 * get_aspect_ratio(mpeg2dec)));
+
+ switch (mpeg2dec->picture->frame_rate_code) {
+ case 1: /* 23.976 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3913);
+ break;
+ case 2: /* 24 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3750);
+ break;
+ case 3: /* 25 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3600);
+ break;
+ case 4: /* 29.97 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3003);
+ break;
+ case 5: /* 30 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3000);
+ break;
+ case 6: /* 50 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 1800);
+ break;
+ case 7: /* 59.94 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 1525);
+ break;
+ case 8: /* 60 fps */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 1509);
+ break;
+ default:
+ /* printf ("invalid/unknown frame rate code : %d \n",
+ frame->frame_rate_code); */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_FRAME_DURATION, 3000);
+ }
+
+ _x_meta_info_set_utf8(mpeg2dec->stream, XINE_META_INFO_VIDEOCODEC, "MPEG (libmpeg2)");
+}
+
+static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
+ uint8_t * buffer, int next_code)
+{
+ picture_t * picture;
+ int is_frame_done;
+ double ratio;
+
+ /* wait for sequence_header_code */
+ if (mpeg2dec->is_sequence_needed) {
+ if (code != 0xb3) {
+ /* printf ("libmpeg2: waiting for sequence header\n"); */
+ mpeg2dec->pts = 0;
+ return 0;
+ }
+ }
+ if (mpeg2dec->is_frame_needed) {
+ /* printf ("libmpeg2: waiting for frame start\n"); */
+ mpeg2dec->pts = 0;
+ if (mpeg2dec->picture->current_frame)
+ mpeg2dec->picture->current_frame->bad_frame = 1;
+ }
+
+ mpeg2_stats (code, buffer);
+
+ picture = mpeg2dec->picture;
+ is_frame_done = mpeg2dec->in_slice && ((!code) || (code >= 0xb0));
+
+ if (is_frame_done)
+ mpeg2dec->in_slice = 0;
+
+ if (is_frame_done && picture->current_frame != NULL) {
+
+ libmpeg2_accel_frame_completion(&mpeg2dec->accel, mpeg2dec->frame_format,
+ picture, code);
+
+ if (((picture->picture_structure == FRAME_PICTURE) ||
+ (picture->second_field)) ) {
+
+ if (mpeg2dec->drop_frame)
+ picture->current_frame->bad_frame = 1;
+
+ if (picture->picture_coding_type == B_TYPE) {
+ if( picture->current_frame && !picture->current_frame->drawn ) {
+
+ /* hack against wrong mpeg1 pts */
+ if (picture->mpeg1)
+ picture->current_frame->pts = 0;
+
+ get_frame_duration(mpeg2dec, picture->current_frame);
+ mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame, mpeg2dec->stream);
+ picture->current_frame->drawn = 1;
+ }
+ } else if (picture->forward_reference_frame && !picture->forward_reference_frame->drawn) {
+ get_frame_duration(mpeg2dec, picture->forward_reference_frame);
+ mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame,
+ mpeg2dec->stream);
+ picture->forward_reference_frame->drawn = 1;
+ }
+ }
+ }
+
+ switch (code) {
+ case 0x00: /* picture_start_code */
+ if (mpeg2_header_picture (picture, buffer)) {
+ fprintf (stderr, "bad picture header\n");
+ abort();
+ }
+
+ mpeg2dec->is_frame_needed=0;
+
+ if (!picture->second_field) {
+ /* find out if we want to skip this frame */
+ mpeg2dec->drop_frame = 0;
+
+ /* picture->skip_non_intra_dct = (mpeg2dec->frames_to_drop>0) ; */
+
+ switch (picture->picture_coding_type) {
+ case B_TYPE:
+
+ lprintf ("B-Frame\n");
+
+ if (mpeg2dec->frames_to_drop>1) {
+ lprintf ("dropping b-frame because frames_to_drop==%d\n",
+ mpeg2dec->frames_to_drop);
+ mpeg2dec->drop_frame = 1;
+ } else if (!picture->forward_reference_frame || picture->forward_reference_frame->bad_frame
+ || !picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) {
+#ifdef LOG
+ printf ("libmpeg2: dropping b-frame because ref is bad (");
+ if (picture->forward_reference_frame)
+ printf ("fw ref frame %d, bad %d;", picture->forward_reference_frame->id,
+ picture->forward_reference_frame->bad_frame);
+ else
+ printf ("fw ref frame not there;");
+ if (picture->backward_reference_frame)
+ printf ("bw ref frame %d, bad %d)\n", picture->backward_reference_frame->id,
+ picture->backward_reference_frame->bad_frame);
+ else
+ printf ("fw ref frame not there)\n");
+#endif
+ mpeg2dec->drop_frame = 1;
+ } else if (mpeg2dec->is_wait_for_ip_frames > 0) {
+ lprintf("dropping b-frame because refs are invalid\n");
+ mpeg2dec->drop_frame = 1;
+ }
+ break;
+
+ case P_TYPE:
+
+ lprintf ("P-Frame\n");
+
+ if (mpeg2dec->frames_to_drop>2) {
+ mpeg2dec->drop_frame = 1;
+ lprintf ("dropping p-frame because frames_to_drop==%d\n",
+ mpeg2dec->frames_to_drop);
+ } else if (!picture->backward_reference_frame || picture->backward_reference_frame->bad_frame) {
+ mpeg2dec->drop_frame = 1;
+#ifdef LOG
+ if (!picture->backward_reference_frame)
+ printf ("libmpeg2: dropping p-frame because no ref frame\n");
+ else
+ printf ("libmpeg2: dropping p-frame because ref %d is bad\n", picture->backward_reference_frame->id);
+#endif
+ } else if (mpeg2dec->is_wait_for_ip_frames > 1) {
+ lprintf("dropping p-frame because ref is invalid\n");
+ mpeg2dec->drop_frame = 1;
+ } else if (mpeg2dec->is_wait_for_ip_frames)
+ mpeg2dec->is_wait_for_ip_frames--;
+
+ break;
+
+ case I_TYPE:
+ lprintf ("I-Frame\n");
+ /* for the sake of dvd menus, never drop i-frames
+ if (mpeg2dec->frames_to_drop>4) {
+ mpeg2dec->drop_frame = 1;
+ }
+ */
+
+ if (mpeg2dec->is_wait_for_ip_frames)
+ mpeg2dec->is_wait_for_ip_frames--;
+
+ break;
+ }
+ }
+
+ break;
+
+ case 0xb2: /* user data code */
+ process_userdata(mpeg2dec, buffer);
+ break;
+
+ case 0xb3: /* sequence_header_code */
+ if (mpeg2_header_sequence (picture, buffer)) {
+ fprintf (stderr, "bad sequence header\n");
+ /* abort(); */
+ break;
+ }
+
+ /* reset AFD value to detect absence */
+ mpeg2dec->afd_value_seen = XINE_VIDEO_AFD_NOT_PRESENT;
+
+ /* according to ISO/IEC 13818-2, an extension start code will follow.
+ * Otherwise the stream follows ISO/IEC 11172-2 which means MPEG1 */
+ picture->mpeg1 = (next_code != 0xb5);
+
+ if (mpeg2dec->force_aspect) picture->aspect_ratio_information = mpeg2dec->force_aspect;
+
+ if (mpeg2dec->is_sequence_needed ) {
+ mpeg2dec->new_sequence = 1;
+ }
+
+ if (mpeg2dec->is_sequence_needed
+ || (picture->aspect_ratio_information != picture->saved_aspect_ratio)
+ || (picture->frame_width != picture->coded_picture_width)
+ || (picture->frame_height != picture->coded_picture_height)) {
+ xine_event_t event;
+ xine_format_change_data_t data;
+
+ remember_metainfo (mpeg2dec);
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = mpeg2dec->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = picture->coded_picture_width;
+ data.height = picture->coded_picture_height;
+ data.aspect = picture->aspect_ratio_information;
+ data.pan_scan = mpeg2dec->force_pan_scan;
+ xine_event_send(mpeg2dec->stream, &event);
+
+ _x_stream_info_set(mpeg2dec->stream,XINE_STREAM_INFO_VIDEO_WIDTH,
+ picture->display_width);
+ _x_stream_info_set(mpeg2dec->stream,XINE_STREAM_INFO_VIDEO_HEIGHT,
+ picture->display_height);
+
+ if (picture->forward_reference_frame &&
+ picture->forward_reference_frame != picture->current_frame &&
+ picture->forward_reference_frame != picture->backward_reference_frame)
+ picture->forward_reference_frame->free (picture->forward_reference_frame);
+
+ if (picture->backward_reference_frame &&
+ picture->backward_reference_frame != picture->current_frame)
+ picture->backward_reference_frame->free (picture->backward_reference_frame);
+
+ mpeg2dec->is_sequence_needed = 0;
+ picture->forward_reference_frame = NULL;
+ picture->backward_reference_frame = NULL;
+
+ picture->frame_width = picture->coded_picture_width;
+ picture->frame_height = picture->coded_picture_height;
+ picture->saved_aspect_ratio = picture->aspect_ratio_information;
+ }
+ break;
+
+ case 0xb5: /* extension_start_code */
+ if (mpeg2_header_extension (picture, buffer)) {
+ fprintf (stderr, "bad extension\n");
+ abort();
+ }
+ break;
+
+ case 0xb7: /* sequence end code */
+ mpeg2_flush(mpeg2dec);
+ mpeg2dec->is_sequence_needed = 1;
+ break;
+
+ case 0xb8: /* group of pictures start code */
+ if (mpeg2_header_group_of_pictures (picture, buffer)) {
+ printf ("libmpeg2: bad group of pictures\n");
+ abort();
+ }
+ default:
+ if ((code >= 0xb9) && (code != 0xe4)) {
+ printf("Not multiplexed? 0x%x\n",code);
+ }
+ if (code >= 0xb0)
+ break;
+
+ /* check for AFD change once per picture */
+ if (mpeg2dec->afd_value_reported != mpeg2dec->afd_value_seen) {
+ /* AFD data should better be stored in current_frame to have it */
+ /* ready and synchronous with other data like width or height. */
+ /* An AFD change should then be detected when a new frame is emitted */
+ /* from the decoder to report the AFD change in display order and not */
+ /* in decoding order like it happens below for now. */
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_AFD, mpeg2dec->afd_value_seen);
+ lprintf ("AFD changed from %d to %d\n", mpeg2dec->afd_value_reported, mpeg2dec->afd_value_seen);
+ mpeg2dec->afd_value_reported = mpeg2dec->afd_value_seen;
+ }
+
+ if (!(mpeg2dec->in_slice)) {
+ mpeg2dec->in_slice = 1;
+
+ if (picture->second_field) {
+ if (picture->current_frame)
+ picture->current_frame->field(picture->current_frame,
+ picture->picture_structure);
+ else
+ mpeg2dec->drop_frame = 1;
+ } else {
+ int flags = picture->picture_structure;
+
+ if (!picture->mpeg1) flags |= VO_INTERLACED_FLAG;
+ if (mpeg2dec->force_pan_scan) flags |= VO_PAN_SCAN_FLAG;
+ if (mpeg2dec->new_sequence) flags |= VO_NEW_SEQUENCE_FLAG;
+
+ if ( picture->current_frame &&
+ picture->current_frame != picture->backward_reference_frame &&
+ picture->current_frame != picture->forward_reference_frame ) {
+ picture->current_frame->free (picture->current_frame);
+ }
+ if (picture->picture_coding_type == B_TYPE) {
+ ratio = get_aspect_ratio(mpeg2dec);
+ picture->current_frame =
+ mpeg2dec->stream->video_out->get_frame (mpeg2dec->stream->video_out,
+ picture->coded_picture_width,
+ picture->coded_picture_height,
+ ratio,
+ mpeg2dec->frame_format,
+ flags);
+ libmpeg2_accel_new_frame( &mpeg2dec->accel, mpeg2dec->frame_format,
+ picture, ratio, flags);
+ } else {
+ ratio = get_aspect_ratio(mpeg2dec);
+ picture->current_frame =
+ mpeg2dec->stream->video_out->get_frame (mpeg2dec->stream->video_out,
+ picture->coded_picture_width,
+ picture->coded_picture_height,
+ ratio,
+ mpeg2dec->frame_format,
+ flags);
+
+ libmpeg2_accel_new_frame( &mpeg2dec->accel, mpeg2dec->frame_format,
+ picture, ratio, flags);
+
+ if (picture->forward_reference_frame &&
+ picture->forward_reference_frame != picture->backward_reference_frame)
+ picture->forward_reference_frame->free (picture->forward_reference_frame);
+
+ picture->forward_reference_frame =
+ picture->backward_reference_frame;
+ picture->backward_reference_frame = picture->current_frame;
+ }
+
+ if(mpeg2dec->new_sequence)
+ mpeg2dec->new_sequence =
+ libmpeg2_accel_new_sequence(&mpeg2dec->accel, mpeg2dec->frame_format,
+ picture);
+
+ picture->current_frame->bad_frame = 1;
+ picture->current_frame->drawn = 0;
+ picture->current_frame->pts = mpeg2dec->pts;
+ picture->current_frame->top_field_first = picture->top_field_first;
+ picture->current_frame->repeat_first_field = picture->repeat_first_field;
+ picture->current_frame->progressive_frame = picture->progressive_frame;
+ picture->current_frame->crop_right = picture->coded_picture_width - picture->display_width;
+ picture->current_frame->crop_bottom = picture->coded_picture_height - picture->display_height;
+
+ switch( picture->picture_coding_type ) {
+ case I_TYPE:
+ picture->current_frame->picture_coding_type = XINE_PICT_I_TYPE;
+ break;
+ case P_TYPE:
+ picture->current_frame->picture_coding_type = XINE_PICT_P_TYPE;
+ break;
+ case B_TYPE:
+ picture->current_frame->picture_coding_type = XINE_PICT_B_TYPE;
+ break;
+ case D_TYPE:
+ picture->current_frame->picture_coding_type = XINE_PICT_D_TYPE;
+ break;
+ }
+
+ lprintf ("decoding frame %d, type %s\n",
+ picture->current_frame->id, picture->picture_coding_type == I_TYPE ? "I" :
+ picture->picture_coding_type == P_TYPE ? "P" : "B");
+ mpeg2dec->pts = 0;
+ /*printf("Starting to decode frame %d\n",picture->current_frame->id);*/
+ }
+ }
+
+ if (!mpeg2dec->drop_frame && picture->current_frame != NULL) {
+#ifdef DEBUG_LOG
+ printf("slice target %08x past %08x future %08x\n",picture->current_frame,picture->forward_reference_frame,picture->backward_reference_frame);
+ fflush(stdout);
+#endif
+ libmpeg2_accel_slice(&mpeg2dec->accel, picture, code, buffer, mpeg2dec->chunk_size,
+ mpeg2dec->chunk_buffer);
+
+ if( picture->v_offset > picture->limit_y ||
+ picture->v_offset + 16 > picture->display_height ) {
+ picture->current_frame->bad_frame = 0;
+ }
+ }
+ }
+
+ /* printf ("libmpeg2: parse_chunk %d completed\n", code); */
+ return is_frame_done;
+}
+
+static inline int find_start_code (mpeg2dec_t * mpeg2dec,
+ uint8_t ** current, uint8_t * limit)
+{
+ uint8_t * p;
+
+ if (*current >= limit)
+ return 0;
+ if (mpeg2dec->shift == 0x00000100)
+ return 1;
+
+ mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
+
+ if (*current >= limit)
+ return 0;
+ if (mpeg2dec->shift == 0x00000100)
+ return 1;
+
+ mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
+
+ if (*current >= limit)
+ return 0;
+ if (mpeg2dec->shift == 0x00000100)
+ return 1;
+
+ limit--;
+
+ if (*current >= limit) {
+ mpeg2dec->shift = (mpeg2dec->shift | *(*current)++) << 8;
+ return 0;
+ }
+
+ p = *current;
+
+ while (p < limit && (p = (uint8_t *)memchr(p, 0x01, limit - p))) {
+ if (p[-2] || p[-1])
+ p += 3;
+ else {
+ *current = ++p;
+ return 1;
+ }
+ }
+
+ *current = ++limit;
+ p = limit - 3;
+ mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
+ mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
+ mpeg2dec->shift = (mpeg2dec->shift | *p++) << 8;
+
+ return 0;
+}
+
+static inline uint8_t * copy_chunk (mpeg2dec_t * mpeg2dec,
+ uint8_t * current, uint8_t * end)
+{
+ uint8_t * limit;
+ uint8_t * data = current;
+ int found, bite;
+
+ /* sequence end code 0xb7 doesn't have any data and there might be the case
+ * that no start code will follow this code for quite some time (e. g. in case
+ * of a still image.
+ * Therefore, return immediately with a chunk_size of 0. Setting code to 0xb4
+ * will eat up any trailing garbage next time.
+ */
+ if (mpeg2dec->code == 0xb7) {
+ mpeg2dec->code = 0xb4;
+ mpeg2dec->chunk_size = 0;
+ return current;
+ }
+
+ limit = current + (mpeg2dec->chunk_buffer + BUFFER_SIZE - mpeg2dec->chunk_ptr);
+ if (limit > end)
+ limit = end;
+
+ found = find_start_code(mpeg2dec, &current, limit);
+ bite = current - data;
+ if (bite) {
+ xine_fast_memcpy(mpeg2dec->chunk_ptr, data, bite);
+ mpeg2dec->chunk_ptr += bite;
+ }
+
+ if (found) {
+ mpeg2dec->code = *current++;
+ mpeg2dec->chunk_size = mpeg2dec->chunk_ptr - mpeg2dec->chunk_buffer - 3;
+ mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
+ mpeg2dec->shift = 0xffffff00;
+ return current;
+ }
+
+ if (current == end)
+ return NULL;
+
+ /* we filled the chunk buffer without finding a start code */
+ mpeg2dec->code = 0xb4; /* sequence_error_code */
+ mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
+ return current;
+}
+
+int mpeg2_decode_data (mpeg2dec_t * mpeg2dec, uint8_t * current, uint8_t * end,
+ uint64_t pts)
+{
+ int ret;
+ uint8_t code;
+
+ ret = 0;
+ if (mpeg2dec->seek_mode) {
+ mpeg2dec->chunk_ptr = mpeg2dec->chunk_buffer;
+ mpeg2dec->code = 0xb4;
+ mpeg2dec->seek_mode = 0;
+ mpeg2dec->shift = 0xffffff00;
+ mpeg2dec->is_frame_needed = 1;
+ }
+
+ if (pts)
+ mpeg2dec->pts = pts;
+
+ while (current != end || mpeg2dec->code == 0xb7) {
+ code = mpeg2dec->code;
+ current = copy_chunk (mpeg2dec, current, end);
+ if (current == NULL)
+ break;
+ ret += parse_chunk (mpeg2dec, code, mpeg2dec->chunk_buffer, mpeg2dec->code);
+ }
+
+ libmpeg2_accel_frame_completion(&mpeg2dec->accel, mpeg2dec->frame_format,
+ mpeg2dec->picture, 0xff);
+
+ return ret;
+}
+
+void mpeg2_discontinuity (mpeg2dec_t * mpeg2dec) {
+ picture_t *picture = mpeg2dec->picture;
+
+ if( !picture )
+ return;
+
+ mpeg2dec->in_slice = 0;
+ mpeg2dec->pts = 0;
+ if ( picture->current_frame )
+ picture->current_frame->pts = 0;
+ if ( picture->forward_reference_frame )
+ picture->forward_reference_frame->pts = 0;
+ if ( picture->backward_reference_frame )
+ picture->backward_reference_frame->pts = 0;
+
+ libmpeg2_accel_discontinuity(&mpeg2dec->accel, mpeg2dec->frame_format, picture);
+}
+
+void mpeg2_reset (mpeg2dec_t * mpeg2dec) {
+
+ picture_t *picture = mpeg2dec->picture;
+
+ if( !picture )
+ return;
+
+ mpeg2_discontinuity(mpeg2dec);
+
+ if( !picture->mpeg1 ) {
+ mpeg2dec->is_wait_for_ip_frames = 2;
+
+ /* mark current frames as bad so they won't make to screen */
+ if ( picture->current_frame )
+ picture->current_frame->bad_frame=1;
+ if (picture->forward_reference_frame )
+ picture->forward_reference_frame->bad_frame=1;
+ if (picture->backward_reference_frame)
+ picture->backward_reference_frame->bad_frame=1;
+
+ } else {
+ /* to free reference frames one also needs to fix slice.c to
+ * abort when they are NULL. unfortunately it seems to break
+ * DVD menus.
+ *
+ * ...so let's do this for mpeg-1 only :)
+ */
+ if ( picture->current_frame &&
+ picture->current_frame != picture->backward_reference_frame &&
+ picture->current_frame != picture->forward_reference_frame )
+ picture->current_frame->free (picture->current_frame);
+ picture->current_frame = NULL;
+
+ if (picture->forward_reference_frame &&
+ picture->forward_reference_frame != picture->backward_reference_frame)
+ picture->forward_reference_frame->free (picture->forward_reference_frame);
+ picture->forward_reference_frame = NULL;
+
+ if (picture->backward_reference_frame)
+ picture->backward_reference_frame->free (picture->backward_reference_frame);
+ picture->backward_reference_frame = NULL;
+ }
+
+ mpeg2dec->in_slice = 0;
+ mpeg2dec->seek_mode = 1;
+
+}
+
+void mpeg2_flush (mpeg2dec_t * mpeg2dec) {
+
+ picture_t *picture = mpeg2dec->picture;
+
+ if (!picture)
+ return;
+
+ if (picture->current_frame && !picture->current_frame->drawn &&
+ !picture->current_frame->bad_frame) {
+
+ lprintf ("blasting out current frame %d on flush\n",
+ picture->current_frame->id);
+
+ picture->current_frame->drawn = 1;
+ get_frame_duration(mpeg2dec, picture->current_frame);
+
+ picture->current_frame->pts = 0;
+ picture->current_frame->draw(picture->current_frame, mpeg2dec->stream);
+ }
+
+}
+
+void mpeg2_close (mpeg2dec_t * mpeg2dec)
+{
+ picture_t *picture = mpeg2dec->picture;
+
+ /*
+ {
+ static uint8_t finalizer[] = {0,0,1,0xb4};
+ mpeg2_decode_data (mpeg2dec, finalizer, finalizer+4, 0);
+ }
+ */
+
+ /*
+ dont remove any picture->*->free() below. doing so will cause buffer
+ leak, and we only have about 15 of them.
+ */
+
+ if ( picture->current_frame ) {
+ if( !picture->current_frame->drawn ) {
+ lprintf ("blasting out current frame on close\n");
+ picture->current_frame->pts = 0;
+ get_frame_duration(mpeg2dec, picture->current_frame);
+ picture->current_frame->draw (picture->current_frame, mpeg2dec->stream);
+ picture->current_frame->drawn = 1;
+ }
+
+ if( picture->current_frame != picture->backward_reference_frame &&
+ picture->current_frame != picture->forward_reference_frame ) {
+ picture->current_frame->free (picture->current_frame);
+ }
+ picture->current_frame = NULL;
+ }
+
+ if (picture->forward_reference_frame &&
+ picture->forward_reference_frame != picture->backward_reference_frame) {
+ picture->forward_reference_frame->free (picture->forward_reference_frame);
+ picture->forward_reference_frame = NULL;
+ }
+
+ if (picture->backward_reference_frame) {
+ if( !picture->backward_reference_frame->drawn) {
+ lprintf ("blasting out backward reference frame on close\n");
+ picture->backward_reference_frame->pts = 0;
+ get_frame_duration(mpeg2dec, picture->backward_reference_frame);
+ picture->backward_reference_frame->draw (picture->backward_reference_frame, mpeg2dec->stream);
+ picture->backward_reference_frame->drawn = 1;
+ }
+ picture->backward_reference_frame->free (picture->backward_reference_frame);
+ picture->backward_reference_frame = NULL;
+ }
+
+ av_freep(&mpeg2dec->chunk_buffer);
+ av_freep(&mpeg2dec->picture_base);
+
+ if ( mpeg2dec->cc_dec) {
+ /* dispose the closed caption decoder */
+ mpeg2dec->cc_dec->dispose(mpeg2dec->cc_dec);
+ mpeg2dec->cc_dec = NULL;
+ }
+}
+
+void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
+ uint8_t * current, uint8_t * end){
+
+ uint8_t code, next_code;
+ picture_t *picture = mpeg2dec->picture;
+
+ mpeg2dec->seek_mode = 1;
+
+ while (current != end) {
+ code = mpeg2dec->code;
+ current = copy_chunk (mpeg2dec, current, end);
+ if (current == NULL)
+ return ;
+ next_code = mpeg2dec->code;
+
+ /* printf ("looking for sequence header... %02x\n", code); */
+
+ mpeg2_stats (code, mpeg2dec->chunk_buffer);
+
+ if (code == 0xb3) { /* sequence_header_code */
+ if (mpeg2_header_sequence (picture, mpeg2dec->chunk_buffer)) {
+ printf ("libmpeg2: bad sequence header\n");
+ continue;
+ }
+
+ /* according to ISO/IEC 13818-2, an extension start code will follow.
+ * Otherwise the stream follows ISO/IEC 11172-2 which means MPEG1 */
+ picture->mpeg1 = (next_code != 0xb5);
+
+ if (mpeg2dec->force_aspect) picture->aspect_ratio_information = mpeg2dec->force_aspect;
+
+ if (mpeg2dec->is_sequence_needed) {
+ xine_event_t event;
+ xine_format_change_data_t data;
+
+ mpeg2dec->new_sequence = 1;
+
+ mpeg2dec->is_sequence_needed = 0;
+ picture->frame_width = picture->coded_picture_width;
+ picture->frame_height = picture->coded_picture_height;
+
+ remember_metainfo (mpeg2dec);
+
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = mpeg2dec->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = picture->coded_picture_width;
+ data.height = picture->coded_picture_height;
+ data.aspect = picture->aspect_ratio_information;
+ data.pan_scan = mpeg2dec->force_pan_scan;
+ xine_event_send(mpeg2dec->stream, &event);
+
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_WIDTH,
+ picture->display_width);
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_HEIGHT,
+ picture->display_height);
+ }
+ } else if (code == 0xb5) { /* extension_start_code */
+ if (mpeg2_header_extension (picture, mpeg2dec->chunk_buffer)) {
+ printf ("libmpeg2: bad extension\n");
+ continue ;
+ }
+ }
+ }
+}
+
+/* Find the end of the userdata field in an MPEG-2 stream */
+static uint8_t *find_end(uint8_t *buffer)
+{
+ uint8_t *current = buffer;
+ while(1) {
+ if (current[0] == 0 && current[1] == 0 && current[2] == 1)
+ break;
+ current++;
+ }
+ return current;
+}
+
+static void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer)
+{
+ /* check if user data denotes closed captions */
+ if (buffer[0] == 'C' && buffer[1] == 'C') {
+
+ if (!mpeg2dec->cc_dec) {
+ xine_event_t event;
+ xine_format_change_data_t data;
+
+ /* open the closed caption decoder first */
+ mpeg2dec->cc_dec = _x_get_spu_decoder(mpeg2dec->stream, (BUF_SPU_CC >> 16) & 0xff);
+
+ /* send a frame format event so that the CC decoder knows the initial image size */
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = mpeg2dec->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = mpeg2dec->picture->coded_picture_width;
+ data.height = mpeg2dec->picture->coded_picture_height;
+ data.aspect = mpeg2dec->picture->aspect_ratio_information;
+ data.pan_scan = mpeg2dec->force_pan_scan;
+ xine_event_send(mpeg2dec->stream, &event);
+
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_WIDTH,
+ mpeg2dec->picture->display_width);
+ _x_stream_info_set(mpeg2dec->stream, XINE_STREAM_INFO_VIDEO_HEIGHT,
+ mpeg2dec->picture->display_height);
+ }
+
+ if (mpeg2dec->cc_dec) {
+ buf_element_t buf;
+
+ buf.type = BUF_SPU_CC;
+ buf.content = &buffer[2];
+ buf.pts = mpeg2dec->pts;
+ buf.size = find_end(buffer) - &buffer[2];
+ buf.decoder_flags = 0;
+
+ mpeg2dec->cc_dec->decode_data(mpeg2dec->cc_dec, &buf);
+ }
+ }
+ /* check Active Format Description ETSI TS 101 154 V1.5.1 */
+ else if (buffer[0] == 0x44 && buffer[1] == 0x54 && buffer[2] == 0x47 && buffer[3] == 0x31)
+ mpeg2dec->afd_value_seen = (buffer[4] & 0x40) ? (buffer[5] & 0x0f) : XINE_VIDEO_AFD_NOT_PRESENT;
+}
diff --git a/src/video_dec/libmpeg2/header.c b/src/video_dec/libmpeg2/header.c
new file mode 100644
index 000000000..0c2b76891
--- /dev/null
+++ b/src/video_dec/libmpeg2/header.c
@@ -0,0 +1,419 @@
+/*
+ * header.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/*
+#define LOG_PAN_SCAN
+*/
+
+#include "config.h"
+
+#include <stdio.h> /* For printf debugging */
+#include <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/attributes.h>
+
+/* default intra quant matrix, in zig-zag order */
+static const uint8_t default_intra_quantizer_matrix[64] ATTR_ALIGN(16) = {
+ 8,
+ 16, 16,
+ 19, 16, 19,
+ 22, 22, 22, 22,
+ 22, 22, 26, 24, 26,
+ 27, 27, 27, 26, 26, 26,
+ 26, 27, 27, 27, 29, 29, 29,
+ 34, 34, 34, 29, 29, 29, 27, 27,
+ 29, 29, 32, 32, 34, 34, 37,
+ 38, 37, 35, 35, 34, 35,
+ 38, 38, 40, 40, 40,
+ 48, 48, 46, 46,
+ 56, 56, 58,
+ 69, 69,
+ 83
+};
+
+uint8_t mpeg2_scan_norm[64] ATTR_ALIGN(16) =
+{
+ /* Zig-Zag scan pattern */
+ 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
+};
+
+uint8_t mpeg2_scan_alt[64] ATTR_ALIGN(16) =
+{
+ /* Alternate scan pattern */
+ 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
+};
+
+/* count must be between 1 and 32 */
+static uint32_t get_bits(uint8_t *buffer, uint32_t count, uint32_t *bit_position) {
+ uint32_t byte_offset;
+ uint32_t bit_offset;
+ uint32_t bit_mask;
+ uint32_t bit_bite;
+ uint32_t result=0;
+ if (count == 0) return 0;
+ do {
+ byte_offset = *bit_position >> 3; /* Div 8 */
+ bit_offset = 8 - (*bit_position & 0x7); /* Bits got 87654321 */
+ bit_mask = ((1 << (bit_offset)) - 1);
+ bit_bite = bit_offset;
+ if (count < bit_offset) {
+ bit_mask ^= ((1 << (bit_offset-count)) - 1);
+ bit_bite = count;
+ }
+ /*
+ printf("Byte=0x%02x Bitmask=0x%04x byte_offset=%u bit_offset=%u bit_byte=%u count=%u\n",buffer[byte_offset], bit_mask, byte_offset, bit_offset, bit_bite,count);
+ */
+ result = (result << bit_bite) | ((buffer[byte_offset] & bit_mask) >> (bit_offset-bit_bite));
+ *bit_position+=bit_bite;
+ count-=bit_bite;
+ } while ((count > 0) && (byte_offset<50) );
+ return result;
+}
+
+static int32_t get_bits_signed(uint8_t *buffer, uint32_t count, uint32_t *bit_position) {
+ uint32_t value = get_bits(buffer, count, bit_position);
+ uint32_t sign_mask = (uint32_t)(-1 << (count - 1));
+ if (value & sign_mask)
+ value |= sign_mask; /* sign-extend value */
+ return (int32_t)value;
+}
+
+void mpeg2_header_state_init (picture_t * picture)
+{
+ picture->scan = mpeg2_scan_norm;
+ picture->load_intra_quantizer_matrix = 1;
+ picture->load_non_intra_quantizer_matrix = 1;
+}
+
+int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer)
+{
+ int width, height;
+ int i;
+
+ if ((buffer[6] & 0x20) != 0x20)
+ return 1; /* missing marker_bit */
+
+ height = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2];
+
+ picture->display_width = width = (height >> 12);
+ picture->display_height = height = (height & 0xfff);
+
+ width = (width + 15) & ~15;
+ height = (height + 15) & ~15;
+
+ if ((width > 1920) || (height > 1152))
+ return 1; /* size restrictions for MP@HL */
+
+ picture->coded_picture_width = width;
+ picture->coded_picture_height = height;
+
+ /* this is not used by the decoder */
+ picture->aspect_ratio_information = buffer[3] >> 4;
+ picture->frame_rate_code = buffer[3] & 15;
+ picture->bitrate = (buffer[4]<<10)|(buffer[5]<<2)|(buffer[6]>>6);
+
+ if (buffer[7] & 2) {
+ for (i = 0; i < 64; i++)
+ picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
+ (buffer[i+7] << 7) | (buffer[i+8] >> 1);
+ buffer += 64;
+ } else
+ for (i = 0; i < 64; i++)
+ picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
+ default_intra_quantizer_matrix [i];
+
+ if (buffer[7] & 1)
+ for (i = 0; i < 64; i++)
+ picture->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
+ buffer[i+8];
+ else
+ for (i = 0; i < 64; i++)
+ picture->non_intra_quantizer_matrix[i] = 16;
+ picture->load_intra_quantizer_matrix = 1;
+ picture->load_non_intra_quantizer_matrix = 1;
+ /* MPEG1 - for testing only */
+ picture->mpeg1 = 1;
+ picture->intra_dc_precision = 0;
+ picture->frame_pred_frame_dct = 1;
+ picture->q_scale_type = 0;
+ picture->concealment_motion_vectors = 0;
+ /* picture->alternate_scan = 0; */
+ picture->picture_structure = FRAME_PICTURE;
+ /* picture->second_field = 0; */
+
+ return 0;
+}
+
+static int sequence_extension (picture_t * picture, uint8_t * buffer)
+{
+ /* check chroma format, size extensions, marker bit */
+ if (((buffer[1] & 0x07) != 0x02) || (buffer[2] & 0xe0) ||
+ ((buffer[3] & 0x01) != 0x01))
+ return 1;
+
+ /* this is not used by the decoder */
+ picture->progressive_sequence = (buffer[1] >> 3) & 1;
+
+ picture->low_delay = buffer[5] & 0x80;
+
+ if (!picture->progressive_sequence)
+ picture->coded_picture_height =
+ (picture->coded_picture_height + 31) & ~31;
+
+
+ /* printf ("libmpeg2: low_delay : %d\n", picture->low_delay); */
+
+/*
+ printf ("libmpeg2: sequence extension+5 : %08x (%d)\n",
+ buffer[5], buffer[5] % 0x80);
+ */
+
+ picture->frame_rate_ext_n = buffer[5] & 0x31;
+ picture->frame_rate_ext_d = (buffer[5] >> 2) & 0x03;
+
+ /* MPEG1 - for testing only */
+ picture->mpeg1 = 0;
+
+ return 0;
+}
+
+static int quant_matrix_extension (picture_t * picture, uint8_t * buffer)
+{
+ int i;
+
+ if (buffer[0] & 8) {
+ for (i = 0; i < 64; i++)
+ picture->intra_quantizer_matrix[mpeg2_scan_norm[i]] =
+ (buffer[i] << 5) | (buffer[i+1] >> 3);
+ buffer += 64;
+ }
+
+ if (buffer[0] & 4)
+ for (i = 0; i < 64; i++)
+ picture->non_intra_quantizer_matrix[mpeg2_scan_norm[i]] =
+ (buffer[i] << 6) | (buffer[i+1] >> 2);
+
+ return 0;
+}
+
+static int picture_coding_extension (picture_t * picture, uint8_t * buffer)
+{
+ /* pre subtract 1 for use later in compute_motion_vector */
+ picture->f_motion.f_code[0] = (buffer[0] & 15) - 1;
+ picture->f_motion.f_code[1] = (buffer[1] >> 4) - 1;
+ picture->b_motion.f_code[0] = (buffer[1] & 15) - 1;
+ picture->b_motion.f_code[1] = (buffer[2] >> 4) - 1;
+
+ picture->intra_dc_precision = (buffer[2] >> 2) & 3;
+ picture->picture_structure = buffer[2] & 3;
+ picture->frame_pred_frame_dct = (buffer[3] >> 6) & 1;
+ picture->concealment_motion_vectors = (buffer[3] >> 5) & 1;
+ picture->q_scale_type = (buffer[3] >> 4) & 1;
+ picture->intra_vlc_format = (buffer[3] >> 3) & 1;
+
+ if (buffer[3] & 4) /* alternate_scan */
+ picture->scan = mpeg2_scan_alt;
+ else
+ picture->scan = mpeg2_scan_norm;
+
+ /* these are not used by the decoder */
+ picture->top_field_first = buffer[3] >> 7;
+ picture->repeat_first_field = (buffer[3] >> 1) & 1;
+ picture->progressive_frame = buffer[4] >> 7;
+
+ return 0;
+}
+
+static int sequence_display_extension (picture_t * picture, uint8_t * buffer) {
+ /* FIXME: implement. */
+ uint32_t bit_position;
+ uint32_t padding;
+
+ bit_position = 0;
+ padding = get_bits(buffer, 4, &bit_position);
+ picture->video_format = get_bits(buffer, 3, &bit_position);
+ picture->colour_description = get_bits(buffer, 1, &bit_position);
+ if(picture->colour_description) {
+ picture->colour_primatives = get_bits(buffer, 8, &bit_position);
+ picture->transfer_characteristics = get_bits(buffer, 8, &bit_position);
+ picture->matrix_coefficients = get_bits(buffer, 8, &bit_position);
+ }
+ picture->display_horizontal_size = get_bits(buffer, 14, &bit_position);
+ padding = get_bits(buffer, 1, &bit_position);
+ picture->display_vertical_size = get_bits(buffer, 14, &bit_position);
+
+#ifdef LOG_PAN_SCAN
+ printf("Sequence_display_extension\n");
+ printf(" video_format: %u\n", picture->video_format);
+ printf(" colour_description: %u\n", picture->colour_description);
+ if(picture->colour_description) {
+ printf(" colour_primatives: %u\n", picture->colour_primatives);
+ printf(" transfer_characteristics %u\n", picture->transfer_characteristics);
+ printf(" matrix_coefficients %u\n", picture->matrix_coefficients);
+ }
+ printf(" display_horizontal_size %u\n", picture->display_horizontal_size);
+ printf(" display_vertical_size %u\n", picture->display_vertical_size);
+#endif
+
+ return 0;
+}
+
+static int picture_display_extension (picture_t * picture, uint8_t * buffer) {
+ uint32_t bit_position;
+ uint32_t padding;
+
+#ifdef LOG_PAN_SCAN
+ printf ("libmpeg2: picture_display_extension\n");
+#endif
+
+ bit_position = 0;
+ padding = get_bits(buffer, 4, &bit_position);
+ picture->frame_centre_horizontal_offset = get_bits_signed(buffer, 16, &bit_position);
+ padding = get_bits(buffer, 1, &bit_position);
+ picture->frame_centre_vertical_offset = get_bits_signed(buffer, 16, &bit_position);
+ padding = get_bits(buffer, 1, &bit_position);
+
+#ifdef LOG_PAN_SCAN
+ printf("Pan & Scan centre (x,y) = (%d, %d)\n",
+ picture->frame_centre_horizontal_offset,
+ picture->frame_centre_vertical_offset);
+#endif
+
+ return 0;
+}
+
+int mpeg2_header_extension (picture_t * picture, uint8_t * buffer)
+{
+ switch (buffer[0] & 0xf0) {
+ case 0x00: /* reserved */
+ return 0;
+
+ case 0x10: /* sequence extension */
+ return sequence_extension (picture, buffer);
+
+ case 0x20: /* sequence display extension for Pan & Scan */
+ return sequence_display_extension (picture, buffer);
+
+ case 0x30: /* quant matrix extension */
+ return quant_matrix_extension (picture, buffer);
+
+ case 0x40: /* copyright extension */
+ return 0;
+
+ case 0x50: /* sequence scalable extension */
+ return 0;
+
+ case 0x60: /* reserved */
+ return 0;
+
+ case 0x70: /* picture display extension for Pan & Scan */
+ return picture_display_extension (picture, buffer);
+
+ case 0x80: /* picture coding extension */
+ return picture_coding_extension (picture, buffer);
+
+ case 0x90: /* picture spacial scalable extension */
+ return 0;
+
+ case 0xA0: /* picture temporal scalable extension */
+ return 0;
+
+ case 0xB0: /* camera parameters extension */
+ return 0;
+
+ case 0xC0: /* ITU-T extension */
+ return 0;
+
+ case 0xD0: /* reserved */
+ return 0;
+
+ case 0xE0: /* reserved */
+ return 0;
+
+ case 0xF0: /* reserved */
+ return 0;
+ }
+
+ return 0;
+}
+
+int mpeg2_header_group_of_pictures (picture_t * picture, uint8_t * buffer) {
+ uint32_t bit_position;
+ uint32_t padding;
+ bit_position = 0;
+
+ picture->drop_frame_flag = get_bits(buffer, 1, &bit_position);
+ picture->time_code_hours = get_bits(buffer, 5, &bit_position);
+ picture->time_code_minutes = get_bits(buffer, 6, &bit_position);
+ padding = get_bits(buffer, 1, &bit_position);
+ picture->time_code_seconds = get_bits(buffer, 6, &bit_position);
+ picture->time_code_pictures = get_bits(buffer, 6, &bit_position);
+ picture->closed_gop = get_bits(buffer, 1, &bit_position);
+ picture->broken_link = get_bits(buffer, 1, &bit_position);
+
+#ifdef LOG_PAN_SCAN
+ printf("Group of pictures\n");
+ printf(" drop_frame_flag: %u\n", picture->drop_frame_flag);
+ printf(" time_code: HH:MM:SS:Pictures %02u:%02u:%02u:%02u\n",
+ picture->time_code_hours,
+ picture->time_code_minutes,
+ picture->time_code_seconds,
+ picture->time_code_pictures);
+ printf(" closed_gop: %u\n", picture->closed_gop);
+ printf(" bloken_link: %u\n", picture->broken_link);
+#endif
+
+ return 0;
+}
+
+int mpeg2_header_picture (picture_t * picture, uint8_t * buffer)
+{
+ picture->picture_coding_type = (buffer [1] >> 3) & 7;
+ picture->vbv_delay = ((buffer[1] << 13) | (buffer[2] << 5) |
+ (buffer[3] >> 3)) & 0xffff;
+
+ /* forward_f_code and backward_f_code - used in mpeg1 only */
+ picture->f_motion.f_code[1] = (buffer[3] >> 2) & 1;
+ picture->f_motion.f_code[0] =
+ (((buffer[3] << 1) | (buffer[4] >> 7)) & 7) - 1;
+ picture->b_motion.f_code[1] = (buffer[4] >> 6) & 1;
+ picture->b_motion.f_code[0] = ((buffer[4] >> 3) & 7) - 1;
+
+ /* move in header_process_picture_header */
+ picture->second_field =
+ (picture->picture_structure != FRAME_PICTURE) &&
+ !(picture->second_field);
+
+ return 0;
+}
diff --git a/src/video_dec/libmpeg2/idct.c b/src/video_dec/libmpeg2/idct.c
new file mode 100644
index 000000000..9f216db58
--- /dev/null
+++ b/src/video_dec/libmpeg2/idct.c
@@ -0,0 +1,348 @@
+/*
+ * idct.c
+ * Copyright (C) 2000-2002 Michel Lespinasse <walken@zoy.org>
+ * Copyright (C) 1999-2000 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
+ *
+ * Portions of this code are from the MPEG software simulation group
+ * idct implementation. This code will be replaced with a new
+ * implementation soon.
+ *
+ * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/**********************************************************/
+/* inverse two dimensional DCT, Chen-Wang algorithm */
+/* (cf. IEEE ASSP-32, pp. 803-816, Aug. 1984) */
+/* 32-bit integer arithmetic (8 bit coefficients) */
+/* 11 mults, 29 adds per DCT */
+/* sE, 18.8.91 */
+/**********************************************************/
+/* coefficients extended to 12 bit for IEEE1180-1990 */
+/* compliance sE, 2.1.94 */
+/**********************************************************/
+
+/* this code assumes >> to be a two's-complement arithmetic */
+/* right shift: (-2)>>1 == -1 , (-3)>>1 == -2 */
+
+#include "config.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+
+#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 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) */
+
+/* idct main entry points */
+void (* mpeg2_idct_copy) (int16_t * block, uint8_t * dest, int stride);
+void (* mpeg2_idct_add) (int16_t * block, uint8_t * dest, int stride);
+void (* mpeg2_idct) (int16_t * block);
+void (* mpeg2_zero_block) (int16_t * block);
+
+static uint8_t clip_lut[1024];
+#define CLIP(i) ((clip_lut+384)[ (i)])
+
+/* row (horizontal) IDCT
+ *
+ * 7 pi 1
+ * dst[k] = sum c[l] * src[l] * cos ( -- * ( k + - ) * l )
+ * l=0 8 2
+ *
+ * where: c[0] = 128
+ * c[1..7] = 128*sqrt (2)
+ */
+
+static void inline idct_row (int16_t * block)
+{
+ int x0, x1, x2, x3, x4, x5, x6, x7, x8;
+
+ x1 = block[4] << 11;
+ x2 = block[6];
+ x3 = block[2];
+ x4 = block[1];
+ x5 = block[7];
+ x6 = block[5];
+ x7 = block[3];
+
+ /* shortcut */
+ if (! (x1 | x2 | x3 | x4 | x5 | x6 | x7 )) {
+ block[0] = block[1] = block[2] = block[3] = block[4] =
+ block[5] = block[6] = block[7] = block[0]<<3;
+ return;
+ }
+
+ x0 = (block[0] << 11) + 128; /* for proper rounding in the fourth stage */
+
+ /* first stage */
+ x8 = W7 * (x4 + x5);
+ x4 = x8 + (W1 - W7) * x4;
+ x5 = x8 - (W1 + W7) * x5;
+ x8 = W3 * (x6 + x7);
+ x6 = x8 - (W3 - W5) * x6;
+ x7 = x8 - (W3 + W5) * x7;
+
+ /* second stage */
+ x8 = x0 + x1;
+ x0 -= x1;
+ x1 = W6 * (x3 + x2);
+ x2 = x1 - (W2 + W6) * x2;
+ x3 = x1 + (W2 - W6) * x3;
+ x1 = x4 + x6;
+ x4 -= x6;
+ x6 = x5 + x7;
+ x5 -= x7;
+
+ /* third stage */
+ x7 = x8 + x3;
+ x8 -= x3;
+ x3 = x0 + x2;
+ x0 -= x2;
+ x2 = (181 * (x4 + x5) + 128) >> 8;
+ x4 = (181 * (x4 - x5) + 128) >> 8;
+
+ /* fourth stage */
+ block[0] = (x7 + x1) >> 8;
+ block[1] = (x3 + x2) >> 8;
+ block[2] = (x0 + x4) >> 8;
+ block[3] = (x8 + x6) >> 8;
+ block[4] = (x8 - x6) >> 8;
+ block[5] = (x0 - x4) >> 8;
+ block[6] = (x3 - x2) >> 8;
+ block[7] = (x7 - x1) >> 8;
+}
+
+/* column (vertical) IDCT
+ *
+ * 7 pi 1
+ * dst[8*k] = sum c[l] * src[8*l] * cos ( -- * ( k + - ) * l )
+ * l=0 8 2
+ *
+ * where: c[0] = 1/1024
+ * c[1..7] = (1/1024)*sqrt (2)
+ */
+
+static void inline idct_col (int16_t *block)
+{
+ int x0, x1, x2, x3, x4, x5, x6, x7, x8;
+
+ /* shortcut */
+ x1 = block [8*4] << 8;
+ x2 = block [8*6];
+ x3 = block [8*2];
+ x4 = block [8*1];
+ x5 = block [8*7];
+ x6 = block [8*5];
+ x7 = block [8*3];
+
+#if 0
+ if (! (x1 | x2 | x3 | x4 | x5 | x6 | x7 )) {
+ block[8*0] = block[8*1] = block[8*2] = block[8*3] = block[8*4] =
+ block[8*5] = block[8*6] = block[8*7] = (block[8*0] + 32) >> 6;
+ return;
+ }
+#endif
+
+ x0 = (block[8*0] << 8) + 8192;
+
+ /* first stage */
+ x8 = W7 * (x4 + x5) + 4;
+ x4 = (x8 + (W1 - W7) * x4) >> 3;
+ x5 = (x8 - (W1 + W7) * x5) >> 3;
+ x8 = W3 * (x6 + x7) + 4;
+ x6 = (x8 - (W3 - W5) * x6) >> 3;
+ x7 = (x8 - (W3 + W5) * x7) >> 3;
+
+ /* second stage */
+ x8 = x0 + x1;
+ x0 -= x1;
+ x1 = W6 * (x3 + x2) + 4;
+ x2 = (x1 - (W2 + W6) * x2) >> 3;
+ x3 = (x1 + (W2 - W6) * x3) >> 3;
+ x1 = x4 + x6;
+ x4 -= x6;
+ x6 = x5 + x7;
+ x5 -= x7;
+
+ /* third stage */
+ x7 = x8 + x3;
+ x8 -= x3;
+ x3 = x0 + x2;
+ x0 -= x2;
+ x2 = (181 * (x4 + x5) + 128) >> 8;
+ x4 = (181 * (x4 - x5) + 128) >> 8;
+
+ /* fourth stage */
+ block[8*0] = (x7 + x1) >> 14;
+ block[8*1] = (x3 + x2) >> 14;
+ block[8*2] = (x0 + x4) >> 14;
+ block[8*3] = (x8 + x6) >> 14;
+ block[8*4] = (x8 - x6) >> 14;
+ block[8*5] = (x0 - x4) >> 14;
+ block[8*6] = (x3 - x2) >> 14;
+ block[8*7] = (x7 - x1) >> 14;
+}
+
+static void mpeg2_idct_copy_c (int16_t * block, uint8_t * dest, int stride)
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+
+ i = 8;
+ do {
+ dest[0] = CLIP (block[0]);
+ dest[1] = CLIP (block[1]);
+ dest[2] = CLIP (block[2]);
+ dest[3] = CLIP (block[3]);
+ dest[4] = CLIP (block[4]);
+ dest[5] = CLIP (block[5]);
+ dest[6] = CLIP (block[6]);
+ dest[7] = CLIP (block[7]);
+
+ block[0] = 0; block[1] = 0; block[2] = 0; block[3] = 0;
+ block[4] = 0; block[5] = 0; block[6] = 0; block[7] = 0;
+
+ dest += stride;
+ block += 8;
+ } while (--i);
+}
+
+static void mpeg2_idct_add_c (int16_t * block, uint8_t * dest, int stride)
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+
+ i = 8;
+ do {
+ dest[0] = CLIP (block[0] + dest[0]);
+ dest[1] = CLIP (block[1] + dest[1]);
+ dest[2] = CLIP (block[2] + dest[2]);
+ dest[3] = CLIP (block[3] + dest[3]);
+ dest[4] = CLIP (block[4] + dest[4]);
+ dest[5] = CLIP (block[5] + dest[5]);
+ dest[6] = CLIP (block[6] + dest[6]);
+ dest[7] = CLIP (block[7] + dest[7]);
+
+ block[0] = 0; block[1] = 0; block[2] = 0; block[3] = 0;
+ block[4] = 0; block[5] = 0; block[6] = 0; block[7] = 0;
+
+ dest += stride;
+ block += 8;
+ } while (--i);
+}
+
+static void mpeg2_idct_c (int16_t * block)
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+}
+
+static void mpeg2_zero_block_c (int16_t * wblock)
+{
+ memset( wblock, 0, sizeof(int16_t) * 64 );
+}
+
+void mpeg2_idct_init (uint32_t mm_accel)
+{
+ mpeg2_zero_block = mpeg2_zero_block_c;
+
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+ if (mm_accel & MM_ACCEL_X86_MMXEXT) {
+#ifdef LOG
+ fprintf (stderr, "Using MMXEXT for IDCT transform\n");
+#endif
+ mpeg2_idct_copy = mpeg2_idct_copy_mmxext;
+ mpeg2_idct_add = mpeg2_idct_add_mmxext;
+ mpeg2_idct = mpeg2_idct_mmxext;
+ mpeg2_zero_block = mpeg2_zero_block_mmx;
+ mpeg2_idct_mmx_init ();
+ } else if (mm_accel & MM_ACCEL_X86_MMX) {
+#ifdef LOG
+ fprintf (stderr, "Using MMX for IDCT transform\n");
+#endif
+ mpeg2_idct_copy = mpeg2_idct_copy_mmx;
+ mpeg2_idct_add = mpeg2_idct_add_mmx;
+ mpeg2_idct = mpeg2_idct_mmx;
+ mpeg2_zero_block = mpeg2_zero_block_mmx;
+ mpeg2_idct_mmx_init ();
+ } else
+#endif
+#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
+ if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
+#ifdef LOG
+ fprintf (stderr, "Using altivec for IDCT transform\n");
+#endif
+ mpeg2_idct_copy = mpeg2_idct_copy_altivec;
+ mpeg2_idct_add = mpeg2_idct_add_altivec;
+ mpeg2_idct_altivec_init ();
+ mpeg2_idct = mpeg2_idct_c;
+ } else
+#endif
+#ifdef LIBMPEG2_MLIB
+ if (mm_accel & MM_ACCEL_MLIB) {
+ char * env_var;
+
+ env_var = getenv ("MLIB_NON_IEEE");
+
+ mpeg2_idct = mpeg2_idct_mlib;
+ if (env_var == NULL) {
+#ifdef LOG
+ fprintf (stderr, "Using mlib for IDCT transform\n");
+#endif
+ mpeg2_idct_add = mpeg2_idct_add_mlib;
+ } else {
+ fprintf (stderr, "Using non-IEEE mlib for IDCT transform\n");
+ mpeg2_idct_add = mpeg2_idct_add_mlib_non_ieee;
+ }
+ mpeg2_idct_copy = mpeg2_idct_copy_mlib_non_ieee;
+ } else
+#endif
+ {
+ int i;
+
+#ifdef LOG
+ fprintf (stderr, "No accelerated IDCT transform found\n");
+#endif
+ mpeg2_idct_copy = mpeg2_idct_copy_c;
+ mpeg2_idct_add = mpeg2_idct_add_c;
+ mpeg2_idct = mpeg2_idct_c;
+ for (i = -384; i < 640; i++)
+ clip_lut[i+384] = (i < 0) ? 0 : ((i > 255) ? 255 : i);
+ }
+}
diff --git a/src/video_dec/libmpeg2/idct_altivec.c b/src/video_dec/libmpeg2/idct_altivec.c
new file mode 100644
index 000000000..de396560b
--- /dev/null
+++ b/src/video_dec/libmpeg2/idct_altivec.c
@@ -0,0 +1,233 @@
+/*
+ * idct_altivec.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
+
+#include <altivec.h>
+
+#include <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+
+#define vector_s16_t 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);
+
+#if defined( __APPLE_CC__ ) && defined( __APPLE_ALTIVEC__ ) /* apple */
+#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h)
+#else /* gnu */
+#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) {a, b, c, d, e, f, g, h}
+#endif
+
+static vector_s16_t constants[5] = {
+ VEC_S16(23170, 13573, 6518, 21895, -23170, -21895, 32, 31),
+ VEC_S16(16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725),
+ VEC_S16(22725, 31521, 29692, 26722, 22725, 26722, 29692, 31521),
+ VEC_S16(21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692),
+ VEC_S16(19266, 26722, 25172, 22654, 19266, 22654, 25172, 26722)
+};
+
+void mpeg2_idct_copy_altivec (vector_s16_t * block, unsigned char * dest,
+ int stride)
+{
+ vector_u8_t tmp;
+
+ 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)
+ memset (block, 0, 64 * sizeof (signed short));
+}
+
+void mpeg2_idct_add_altivec (vector_s16_t * block, unsigned char * dest,
+ int stride)
+{
+ vector_u8_t tmp;
+ vector_s16_t tmp2, tmp3;
+ vector_u8_t perm0;
+ vector_u8_t perm1;
+ vector_u8_t p0, p1, p;
+
+ 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)
+ memset (block, 0, 64 * sizeof (signed short));
+}
+
+void mpeg2_idct_altivec_init (void)
+{
+ int i, j;
+
+ /* the altivec idct uses a transposed input, so we patch scan tables */
+ for (i = 0; i < 64; i++) {
+ j = mpeg2_scan_norm[i];
+ mpeg2_scan_norm[i] = (j >> 3) | ((j & 7) << 3);
+ j = mpeg2_scan_alt[i];
+ mpeg2_scan_alt[i] = (j >> 3) | ((j & 7) << 3);
+ }
+}
+
+#endif /* ARCH_PPC && ENABLED_ALTIVEC */
+
diff --git a/src/libmpeg2/idct_mlib.c b/src/video_dec/libmpeg2/idct_mlib.c
index e573c9790..e573c9790 100644
--- a/src/libmpeg2/idct_mlib.c
+++ b/src/video_dec/libmpeg2/idct_mlib.c
diff --git a/src/libmpeg2/idct_mlib.h b/src/video_dec/libmpeg2/idct_mlib.h
index 1fb0787dd..1fb0787dd 100644
--- a/src/libmpeg2/idct_mlib.h
+++ b/src/video_dec/libmpeg2/idct_mlib.h
diff --git a/src/video_dec/libmpeg2/idct_mmx.c b/src/video_dec/libmpeg2/idct_mmx.c
new file mode 100644
index 000000000..92ae365b4
--- /dev/null
+++ b/src/video_dec/libmpeg2/idct_mmx.c
@@ -0,0 +1,741 @@
+/*
+ * idct_mmx.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+
+#include <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
+
+#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, 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 (int16_t * table, 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, 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, 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 (int16_t * table, 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, 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 short _T1[] ATTR_ALIGN(8) = {T1,T1,T1,T1};
+ static short _T2[] ATTR_ALIGN(8) = {T2,T2,T2,T2};
+ static short _T3[] ATTR_ALIGN(8) = {T3,T3,T3,T3};
+ static 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
+}
+
+
+static int32_t rounder0[] ATTR_ALIGN(8) =
+ rounder ((1 << (COL_SHIFT - 1)) - 0.5);
+static int32_t rounder4[] ATTR_ALIGN(8) = rounder (0);
+static int32_t rounder1[] ATTR_ALIGN(8) =
+ rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */
+static int32_t rounder7[] ATTR_ALIGN(8) =
+ rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */
+static int32_t rounder2[] ATTR_ALIGN(8) =
+ rounder (0.60355339059); /* C2 * (C6+C2)/2 */
+static int32_t rounder6[] ATTR_ALIGN(8) =
+ rounder (-0.25); /* C2 * (C6-C2)/2 */
+static int32_t rounder3[] ATTR_ALIGN(8) =
+ rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */
+static int32_t rounder5[] ATTR_ALIGN(8) =
+ rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */
+
+
+#define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \
+static inline void idct (int16_t * block) \
+{ \
+ static int16_t table04[] ATTR_ALIGN(16) = \
+ table (22725, 21407, 19266, 16384, 12873, 8867, 4520); \
+ static int16_t table17[] ATTR_ALIGN(16) = \
+ table (31521, 29692, 26722, 22725, 17855, 12299, 6270); \
+ static int16_t table26[] ATTR_ALIGN(16) = \
+ table (29692, 27969, 25172, 21407, 16819, 11585, 5906); \
+ static 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); \
+}
+
+
+#define COPY_MMX(offset,r0,r1,r2) \
+do { \
+ movq_m2r (*(block+offset), r0); \
+ dest += stride; \
+ movq_m2r (*(block+offset+4), r1); \
+ movq_r2m (r2, *dest); \
+ packuswb_r2r (r1, r0); \
+} while (0)
+
+static void block_copy (int16_t * block, uint8_t * dest, int stride)
+{
+ movq_m2r (*(block+0*8), mm0);
+ movq_m2r (*(block+0*8+4), mm1);
+ movq_m2r (*(block+1*8), mm2);
+ packuswb_r2r (mm1, mm0);
+ movq_m2r (*(block+1*8+4), mm3);
+ movq_r2m (mm0, *dest);
+ packuswb_r2r (mm3, mm2);
+ COPY_MMX (2*8, mm0, mm1, mm2);
+ COPY_MMX (3*8, mm2, mm3, mm0);
+ COPY_MMX (4*8, mm0, mm1, mm2);
+ COPY_MMX (5*8, mm2, mm3, mm0);
+ COPY_MMX (6*8, mm0, mm1, mm2);
+ COPY_MMX (7*8, mm2, mm3, mm0);
+ movq_r2m (mm2, *(dest+stride));
+}
+
+
+#define ADD_MMX(offset,r1,r2,r3,r4) \
+do { \
+ movq_m2r (*(dest+2*stride), r1); \
+ packuswb_r2r (r4, r3); \
+ movq_r2r (r1, r2); \
+ dest += stride; \
+ movq_r2m (r3, *dest); \
+ punpcklbw_r2r (mm0, r1); \
+ paddsw_m2r (*(block+offset), r1); \
+ punpckhbw_r2r (mm0, r2); \
+ paddsw_m2r (*(block+offset+4), r2); \
+} while (0)
+
+static void block_add (int16_t * block, uint8_t * dest, int stride)
+{
+ movq_m2r (*dest, mm1);
+ pxor_r2r (mm0, mm0);
+ movq_m2r (*(dest+stride), mm3);
+ movq_r2r (mm1, mm2);
+ punpcklbw_r2r (mm0, mm1);
+ movq_r2r (mm3, mm4);
+ paddsw_m2r (*(block+0*8), mm1);
+ punpckhbw_r2r (mm0, mm2);
+ paddsw_m2r (*(block+0*8+4), mm2);
+ punpcklbw_r2r (mm0, mm3);
+ paddsw_m2r (*(block+1*8), mm3);
+ packuswb_r2r (mm2, mm1);
+ punpckhbw_r2r (mm0, mm4);
+ movq_r2m (mm1, *dest);
+ paddsw_m2r (*(block+1*8+4), mm4);
+ ADD_MMX (2*8, mm1, mm2, mm3, mm4);
+ ADD_MMX (3*8, mm3, mm4, mm1, mm2);
+ ADD_MMX (4*8, mm1, mm2, mm3, mm4);
+ ADD_MMX (5*8, mm3, mm4, mm1, mm2);
+ ADD_MMX (6*8, mm1, mm2, mm3, mm4);
+ ADD_MMX (7*8, mm3, mm4, mm1, mm2);
+ packuswb_r2r (mm4, mm3);
+ movq_r2m (mm3, *(dest+stride));
+}
+
+static inline void block_zero (int16_t * block) {
+ pxor_r2r (mm0, mm0);
+ movq_r2m (mm0, *(block+0*4));
+ movq_r2m (mm0, *(block+1*4));
+ movq_r2m (mm0, *(block+2*4));
+ movq_r2m (mm0, *(block+3*4));
+ movq_r2m (mm0, *(block+4*4));
+ movq_r2m (mm0, *(block+5*4));
+ movq_r2m (mm0, *(block+6*4));
+ movq_r2m (mm0, *(block+7*4));
+ movq_r2m (mm0, *(block+8*4));
+ movq_r2m (mm0, *(block+9*4));
+ movq_r2m (mm0, *(block+10*4));
+ movq_r2m (mm0, *(block+11*4));
+ movq_r2m (mm0, *(block+12*4));
+ movq_r2m (mm0, *(block+13*4));
+ movq_r2m (mm0, *(block+14*4));
+ movq_r2m (mm0, *(block+15*4));
+}
+
+declare_idct (mmxext_idct, mmxext_table,
+ mmxext_row_head, mmxext_row, mmxext_row_tail, mmxext_row_mid)
+
+void mpeg2_idct_copy_mmxext (int16_t * block, uint8_t * dest, int stride)
+{
+ mmxext_idct (block);
+ block_copy (block, dest, stride);
+ block_zero (block);
+}
+
+void mpeg2_idct_add_mmxext (int16_t * block, uint8_t * dest, int stride)
+{
+ mmxext_idct (block);
+ block_add (block, dest, stride);
+ block_zero (block);
+}
+
+void mpeg2_idct_mmxext (int16_t * block)
+{
+ mmxext_idct (block);
+}
+
+declare_idct (mmx_idct, mmx_table,
+ mmx_row_head, mmx_row, mmx_row_tail, mmx_row_mid)
+
+void mpeg2_idct_copy_mmx (int16_t * block, uint8_t * dest, int stride)
+{
+ mmx_idct (block);
+ block_copy (block, dest, stride);
+ block_zero (block);
+}
+
+void mpeg2_idct_add_mmx (int16_t * block, uint8_t * dest, int stride)
+{
+ mmx_idct (block);
+ block_add (block, dest, stride);
+ block_zero (block);
+}
+
+void mpeg2_idct_mmx (int16_t * block)
+{
+ mmx_idct (block);
+}
+
+void mpeg2_zero_block_mmx (int16_t * block)
+{
+ block_zero (block);
+}
+
+void mpeg2_idct_mmx_init (void)
+{
+ int i, j;
+
+ /* the mmx/mmxext idct uses a reordered input, so we patch scan tables */
+
+ for (i = 0; i < 64; i++) {
+ j = mpeg2_scan_norm[i];
+ mpeg2_scan_norm[i] = (j & 0x38) | ((j & 6) >> 1) | ((j & 1) << 2);
+ j = mpeg2_scan_alt[i];
+ mpeg2_scan_alt[i] = (j & 0x38) | ((j & 6) >> 1) | ((j & 1) << 2);
+ }
+}
+
+#endif
diff --git a/src/video_dec/libmpeg2/libmpeg2_accel.c b/src/video_dec/libmpeg2/libmpeg2_accel.c
new file mode 100644
index 000000000..92c0e280b
--- /dev/null
+++ b/src/video_dec/libmpeg2/libmpeg2_accel.c
@@ -0,0 +1,223 @@
+/*
+ * libmpeg2_accel.c
+ * Copyright (C) 2004 The Unichrome Project.
+ * Copyright (C) 2005 Thomas Hellstrom.
+ *
+ * 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
+ */
+
+#include <xine/xine_internal.h>
+#include "mpeg2.h"
+#include "mpeg2_internal.h"
+#include "xvmc_vld.h"
+#include "libmpeg2_accel.h"
+
+
+void
+libmpeg2_accel_scan( mpeg2dec_accel_t *accel, uint8_t *scan_norm, uint8_t *scan_alt)
+{
+ xvmc_setup_scan_ptable();
+}
+
+
+int
+libmpeg2_accel_discontinuity(mpeg2dec_accel_t *accel, uint32_t frame_format, picture_t *picture)
+{
+ accel->xvmc_last_slice_code=-1;
+ if ( !picture->current_frame )
+ return 0;
+ if (frame_format == XINE_IMGFMT_XXMC) {
+ xine_xxmc_t *xxmc = (xine_xxmc_t *)
+ picture->current_frame->accel_data;
+ switch(xxmc->acceleration) {
+ case XINE_XVMC_ACCEL_VLD:
+ case XINE_XVMC_ACCEL_IDCT:
+ case XINE_XVMC_ACCEL_MOCOMP:
+ xxmc->proc_xxmc_flush( picture->current_frame );
+ break;
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
+int
+libmpeg2_accel_new_sequence(mpeg2dec_accel_t *accel, uint32_t frame_format, picture_t *picture)
+{
+ switch(frame_format) {
+ case XINE_IMGFMT_XXMC:
+ case XINE_IMGFMT_XVMC: {
+ xine_xvmc_t *xvmc = (xine_xvmc_t *)
+ picture->current_frame->accel_data;
+ picture->mc = xvmc->macroblocks;
+ return 0;
+ }
+ default:
+ break;
+ }
+ return 1;
+}
+
+int
+libmpeg2_accel_new_frame(mpeg2dec_accel_t *accel, uint32_t frame_format,
+ picture_t *picture, double ratio, uint32_t flags)
+{
+ if (picture->current_frame) {
+ if (XINE_IMGFMT_XXMC == frame_format) {
+ xine_xxmc_t *xxmc = (xine_xxmc_t *)
+ picture->current_frame->accel_data;
+
+ /*
+ * Make a request for acceleration type and mpeg coding from
+ * the output plugin.
+ */
+
+ xxmc->fallback_format = XINE_IMGFMT_YV12;
+ xxmc->acceleration = XINE_XVMC_ACCEL_VLD| XINE_XVMC_ACCEL_IDCT
+ | XINE_XVMC_ACCEL_MOCOMP ;
+
+ /*
+ * Standard MOCOMP / IDCT XvMC implementation for interlaced streams
+ * is buggy. The bug is inherited from the old XvMC driver. Don't use it until
+ * it has been fixed. (A volunteer ?)
+ */
+
+ if ( picture->picture_structure != 3 ) {
+ picture->top_field_first = (picture->picture_structure == 1);
+ xxmc->acceleration &= ~( XINE_XVMC_ACCEL_IDCT | XINE_XVMC_ACCEL_MOCOMP );
+ }
+
+ xxmc->mpeg = (picture->mpeg1) ? XINE_XVMC_MPEG_1:XINE_XVMC_MPEG_2;
+ xxmc->proc_xxmc_update_frame (picture->current_frame->driver,
+ picture->current_frame,
+ picture->coded_picture_width,
+ picture->coded_picture_height,
+ ratio,
+ XINE_IMGFMT_XXMC, flags);
+ }
+ }
+ return 0;
+}
+
+void
+libmpeg2_accel_frame_completion(mpeg2dec_accel_t * accel, uint32_t frame_format, picture_t *picture,
+ int code)
+{
+
+ if ( !picture->current_frame ) return;
+
+ if (frame_format == XINE_IMGFMT_XXMC) {
+ xine_xxmc_t *xxmc = (xine_xxmc_t *)
+ picture->current_frame->accel_data;
+ if (!xxmc->decoded) {
+ switch(picture->current_frame->format) {
+ case XINE_IMGFMT_XXMC:
+ switch(xxmc->acceleration) {
+ case XINE_XVMC_ACCEL_VLD:
+ mpeg2_xxmc_vld_frame_complete(accel, picture, code);
+ break;
+ case XINE_XVMC_ACCEL_IDCT:
+ case XINE_XVMC_ACCEL_MOCOMP:
+ xxmc->decoded = !picture->current_frame->bad_frame;
+ xxmc->proc_xxmc_flush( picture->current_frame );
+ break;
+ default:
+ break;
+ }
+ default:
+ break;
+ }
+ }
+ }
+}
+
+
+int
+libmpeg2_accel_slice(mpeg2dec_accel_t *accel, picture_t *picture, int code, char * buffer,
+ uint32_t chunk_size, uint8_t *chunk_buffer)
+{
+ /*
+ * Don't reference frames of other formats. They are invalid. This may happen if the
+ * xxmc plugin suddenly falls back to software decoding.
+ */
+
+ if (( picture->current_frame->picture_coding_type == XINE_PICT_P_TYPE ) ||
+ ( picture->current_frame->picture_coding_type == XINE_PICT_B_TYPE )) {
+ if (! picture->forward_reference_frame) return 1;
+ if (picture->forward_reference_frame->format != picture->current_frame->format) {
+ picture->v_offset = 0;
+ return 1;
+ }
+ }
+
+ if ( picture->current_frame->picture_coding_type == XINE_PICT_B_TYPE ) {
+ if (! picture->backward_reference_frame) return 1;
+ if (picture->backward_reference_frame->format != picture->current_frame->format) {
+ picture->v_offset = 0;
+ return 1;
+ }
+ }
+
+ switch( picture->current_frame->format ) {
+
+ case XINE_IMGFMT_XXMC:
+ {
+ xine_xxmc_t *xxmc = (xine_xxmc_t *)
+ picture->current_frame->accel_data;
+
+ if ( xxmc->proc_xxmc_lock_valid( picture->current_frame,
+ picture->forward_reference_frame,
+ picture->backward_reference_frame,
+ picture->current_frame->picture_coding_type)) {
+ picture->v_offset = 0;
+ return 1;
+ }
+
+ switch(picture->current_frame->format) {
+ case XINE_IMGFMT_XXMC:
+ switch(xxmc->acceleration) {
+ case XINE_XVMC_ACCEL_VLD:
+ mpeg2_xxmc_slice(accel, picture, code, buffer, chunk_size, chunk_buffer);
+ break;
+ case XINE_XVMC_ACCEL_IDCT:
+ case XINE_XVMC_ACCEL_MOCOMP:
+ mpeg2_xvmc_slice (accel, picture, code, buffer);
+ break;
+ default:
+ mpeg2_slice (picture, code, buffer);
+ break;
+ }
+ break;
+ default:
+ mpeg2_slice (picture, code, buffer);
+ break;
+ }
+ xxmc->proc_xxmc_unlock(picture->current_frame->driver);
+ break;
+ }
+
+ case XINE_IMGFMT_XVMC:
+ mpeg2_xvmc_slice (accel, picture, code, buffer);
+ break;
+
+ default:
+ mpeg2_slice (picture, code, buffer);
+ break;
+ }
+ return 0;
+}
diff --git a/src/libmpeg2/libmpeg2_accel.h b/src/video_dec/libmpeg2/libmpeg2_accel.h
index 5d0b37a78..5d0b37a78 100644
--- a/src/libmpeg2/libmpeg2_accel.h
+++ b/src/video_dec/libmpeg2/libmpeg2_accel.h
diff --git a/src/video_dec/libmpeg2/motion_comp.c b/src/video_dec/libmpeg2/motion_comp.c
new file mode 100644
index 000000000..4a324b8ea
--- /dev/null
+++ b/src/video_dec/libmpeg2/motion_comp.c
@@ -0,0 +1,154 @@
+/*
+ * motion_comp.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 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 <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+
+mpeg2_mc_t mpeg2_mc;
+
+void mpeg2_mc_init (uint32_t mm_accel)
+{
+#ifdef LIBMPEG2_MLIB
+ if (mm_accel & MM_ACCEL_MLIB) {
+#ifdef LOG
+ fprintf (stderr, "Using mediaLib for motion compensation\n");
+#endif
+ mpeg2_mc = mpeg2_mc_mlib;
+ }
+#endif
+
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+ if (mm_accel & MM_ACCEL_X86_MMXEXT) {
+#ifdef LOG
+ fprintf (stderr, "Using MMXEXT for motion compensation\n");
+#endif
+ mpeg2_mc = mpeg2_mc_mmxext;
+ } else if (mm_accel & MM_ACCEL_X86_3DNOW) {
+#ifdef LOG
+ fprintf (stderr, "Using 3DNOW for motion compensation\n");
+#endif
+ mpeg2_mc = mpeg2_mc_3dnow;
+ } else if (mm_accel & MM_ACCEL_X86_MMX) {
+#ifdef LOG
+ fprintf (stderr, "Using MMX for motion compensation\n");
+#endif
+ mpeg2_mc = mpeg2_mc_mmx;
+ } else
+#endif
+#if defined (ARCH_PPC) && defined (ENABLE_ALTIVEC)
+ if (mm_accel & MM_ACCEL_PPC_ALTIVEC) {
+#ifdef LOG
+ fprintf (stderr, "Using altivec for motion compensation\n");
+#endif
+ mpeg2_mc = mpeg2_mc_altivec;
+ } else
+#endif
+#if defined(ARCH_SPARC) && defined(ENABLE_VIS)
+ if (mm_accel & MM_ACCEL_SPARC_VIS) {
+#ifdef LOG
+ fprintf (stderr, "Using VIS for motion compensation\n");
+#endif
+ mpeg2_mc = mpeg2_mc_vis;
+ } else
+#endif
+ {
+#ifdef LOG
+ fprintf (stderr, "No accelerated motion compensation found\n");
+#endif
+ mpeg2_mc = mpeg2_mc_c;
+ }
+}
+
+#define avg2(a,b) ((a+b+1)>>1)
+#define avg4(a,b,c,d) ((a+b+c+d+2)>>2)
+
+#define predict_o(i) (ref[i])
+#define predict_x(i) (avg2 (ref[i], ref[i+1]))
+#define predict_y(i) (avg2 (ref[i], (ref+stride)[i]))
+#define predict_xy(i) (avg4 (ref[i], ref[i+1], \
+ (ref+stride)[i], (ref+stride)[i+1]))
+
+#define put(predictor,i) dest[i] = predictor (i)
+#define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i])
+
+/* mc function template */
+
+#define MC_FUNC(op,xy) \
+static void MC_##op##_##xy##_16_c (uint8_t * dest, uint8_t * ref, \
+ int stride, int height) \
+{ \
+ do { \
+ op (predict_##xy, 0); \
+ op (predict_##xy, 1); \
+ op (predict_##xy, 2); \
+ op (predict_##xy, 3); \
+ op (predict_##xy, 4); \
+ op (predict_##xy, 5); \
+ op (predict_##xy, 6); \
+ op (predict_##xy, 7); \
+ op (predict_##xy, 8); \
+ op (predict_##xy, 9); \
+ op (predict_##xy, 10); \
+ op (predict_##xy, 11); \
+ op (predict_##xy, 12); \
+ op (predict_##xy, 13); \
+ op (predict_##xy, 14); \
+ op (predict_##xy, 15); \
+ ref += stride; \
+ dest += stride; \
+ } while (--height); \
+} \
+static void MC_##op##_##xy##_8_c (uint8_t * dest, uint8_t * ref, \
+ int stride, int height) \
+{ \
+ do { \
+ op (predict_##xy, 0); \
+ op (predict_##xy, 1); \
+ op (predict_##xy, 2); \
+ op (predict_##xy, 3); \
+ op (predict_##xy, 4); \
+ op (predict_##xy, 5); \
+ op (predict_##xy, 6); \
+ op (predict_##xy, 7); \
+ ref += stride; \
+ dest += stride; \
+ } while (--height); \
+}
+
+/* definitions of the actual mc functions */
+
+MC_FUNC (put,o)
+MC_FUNC (avg,o)
+MC_FUNC (put,x)
+MC_FUNC (avg,x)
+MC_FUNC (put,y)
+MC_FUNC (avg,y)
+MC_FUNC (put,xy)
+MC_FUNC (avg,xy)
+
+MPEG2_MC_EXTERN (c)
diff --git a/src/libmpeg2/motion_comp_altivec.c b/src/video_dec/libmpeg2/motion_comp_altivec.c
index 99719b7fb..99719b7fb 100644
--- a/src/libmpeg2/motion_comp_altivec.c
+++ b/src/video_dec/libmpeg2/motion_comp_altivec.c
diff --git a/src/libmpeg2/motion_comp_mlib.c b/src/video_dec/libmpeg2/motion_comp_mlib.c
index 1a37070ae..1a37070ae 100644
--- a/src/libmpeg2/motion_comp_mlib.c
+++ b/src/video_dec/libmpeg2/motion_comp_mlib.c
diff --git a/src/video_dec/libmpeg2/motion_comp_mmx.c b/src/video_dec/libmpeg2/motion_comp_mmx.c
new file mode 100644
index 000000000..9c5ab455d
--- /dev/null
+++ b/src/video_dec/libmpeg2/motion_comp_mmx.c
@@ -0,0 +1,1013 @@
+/*
+ * motion_comp_mmx.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+
+#include <inttypes.h>
+
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
+
+#define CPU_MMXEXT 0
+#define CPU_3DNOW 1
+
+
+/* MMX code - needs a rewrite */
+
+/* some rounding constants */
+static mmx_t round1 = {0x0001000100010001LL};
+static mmx_t round4 = {0x0002000200020002LL};
+
+/*
+ * This code should probably be compiled with loop unrolling
+ * (ie, -funroll-loops in gcc)becuase some of the loops
+ * use a small static number of iterations. This was written
+ * with the assumption the compiler knows best about when
+ * unrolling will help
+ */
+
+static inline void mmx_zero_reg ()
+{
+ /* load 0 into mm0 */
+ pxor_r2r (mm0, mm0);
+}
+
+static inline void mmx_average_2_U8 (uint8_t * dest,
+ uint8_t * src1, uint8_t * src2)
+{
+ /* *dest = (*src1 + *src2 + 1)/ 2; */
+
+ movq_m2r (*src1, mm1); // load 8 src1 bytes
+ movq_r2r (mm1, mm2); // copy 8 src1 bytes
+
+ movq_m2r (*src2, mm3); // load 8 src2 bytes
+ movq_r2r (mm3, mm4); // copy 8 src2 bytes
+
+ punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes
+ punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes
+
+ paddw_r2r (mm3, mm1); // add lows to mm1
+ paddw_m2r (round1, mm1);
+ psraw_i2r (1, mm1); // /2
+
+ paddw_r2r (mm4, mm2); // add highs to mm2
+ paddw_m2r (round1, mm2);
+ psraw_i2r (1, mm2); // /2
+
+ packuswb_r2r (mm2, mm1); // pack (w/ saturation)
+ movq_r2m (mm1, *dest); // store result in dest
+}
+
+static inline void mmx_interp_average_2_U8 (uint8_t * dest,
+ uint8_t * src1, uint8_t * src2)
+{
+ /* *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; */
+
+ movq_m2r (*dest, mm1); // load 8 dest bytes
+ movq_r2r (mm1, mm2); // copy 8 dest bytes
+
+ movq_m2r (*src1, mm3); // load 8 src1 bytes
+ movq_r2r (mm3, mm4); // copy 8 src1 bytes
+
+ movq_m2r (*src2, mm5); // load 8 src2 bytes
+ movq_r2r (mm5, mm6); // copy 8 src2 bytes
+
+ punpcklbw_r2r (mm0, mm1); // unpack low dest bytes
+ punpckhbw_r2r (mm0, mm2); // unpack high dest bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low src1 bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high src1 bytes
+
+ punpcklbw_r2r (mm0, mm5); // unpack low src2 bytes
+ punpckhbw_r2r (mm0, mm6); // unpack high src2 bytes
+
+ paddw_r2r (mm5, mm3); // add lows
+ paddw_m2r (round1, mm3);
+ psraw_i2r (1, mm3); // /2
+
+ paddw_r2r (mm6, mm4); // add highs
+ paddw_m2r (round1, mm4);
+ psraw_i2r (1, mm4); // /2
+
+ paddw_r2r (mm3, mm1); // add lows
+ paddw_m2r (round1, mm1);
+ psraw_i2r (1, mm1); // /2
+
+ paddw_r2r (mm4, mm2); // add highs
+ paddw_m2r (round1, mm2);
+ psraw_i2r (1, mm2); // /2
+
+ packuswb_r2r (mm2, mm1); // pack (w/ saturation)
+ movq_r2m (mm1, *dest); // store result in dest
+}
+
+static inline void mmx_average_4_U8 (uint8_t * dest,
+ uint8_t * src1, uint8_t * src2,
+ uint8_t * src3, uint8_t * src4)
+{
+ /* *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; */
+
+ movq_m2r (*src1, mm1); // load 8 src1 bytes
+ movq_r2r (mm1, mm2); // copy 8 src1 bytes
+
+ punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes
+ punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes
+
+ movq_m2r (*src2, mm3); // load 8 src2 bytes
+ movq_r2r (mm3, mm4); // copy 8 src2 bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes
+
+ paddw_r2r (mm3, mm1); // add lows
+ paddw_r2r (mm4, mm2); // add highs
+
+ /* now have partials in mm1 and mm2 */
+
+ movq_m2r (*src3, mm3); // load 8 src3 bytes
+ movq_r2r (mm3, mm4); // copy 8 src3 bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low src3 bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high src3 bytes
+
+ paddw_r2r (mm3, mm1); // add lows
+ paddw_r2r (mm4, mm2); // add highs
+
+ movq_m2r (*src4, mm5); // load 8 src4 bytes
+ movq_r2r (mm5, mm6); // copy 8 src4 bytes
+
+ punpcklbw_r2r (mm0, mm5); // unpack low src4 bytes
+ punpckhbw_r2r (mm0, mm6); // unpack high src4 bytes
+
+ paddw_r2r (mm5, mm1); // add lows
+ paddw_r2r (mm6, mm2); // add highs
+
+ /* now have subtotal in mm1 and mm2 */
+
+ paddw_m2r (round4, mm1);
+ psraw_i2r (2, mm1); // /4
+ paddw_m2r (round4, mm2);
+ psraw_i2r (2, mm2); // /4
+
+ packuswb_r2r (mm2, mm1); // pack (w/ saturation)
+ movq_r2m (mm1, *dest); // store result in dest
+}
+
+static inline void mmx_interp_average_4_U8 (uint8_t * dest,
+ uint8_t * src1, uint8_t * src2,
+ uint8_t * src3, uint8_t * src4)
+{
+ /* *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; */
+
+ movq_m2r (*src1, mm1); // load 8 src1 bytes
+ movq_r2r (mm1, mm2); // copy 8 src1 bytes
+
+ punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes
+ punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes
+
+ movq_m2r (*src2, mm3); // load 8 src2 bytes
+ movq_r2r (mm3, mm4); // copy 8 src2 bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes
+
+ paddw_r2r (mm3, mm1); // add lows
+ paddw_r2r (mm4, mm2); // add highs
+
+ /* now have partials in mm1 and mm2 */
+
+ movq_m2r (*src3, mm3); // load 8 src3 bytes
+ movq_r2r (mm3, mm4); // copy 8 src3 bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low src3 bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high src3 bytes
+
+ paddw_r2r (mm3, mm1); // add lows
+ paddw_r2r (mm4, mm2); // add highs
+
+ movq_m2r (*src4, mm5); // load 8 src4 bytes
+ movq_r2r (mm5, mm6); // copy 8 src4 bytes
+
+ punpcklbw_r2r (mm0, mm5); // unpack low src4 bytes
+ punpckhbw_r2r (mm0, mm6); // unpack high src4 bytes
+
+ paddw_r2r (mm5, mm1); // add lows
+ paddw_r2r (mm6, mm2); // add highs
+
+ paddw_m2r (round4, mm1);
+ psraw_i2r (2, mm1); // /4
+ paddw_m2r (round4, mm2);
+ psraw_i2r (2, mm2); // /4
+
+ /* now have subtotal/4 in mm1 and mm2 */
+
+ movq_m2r (*dest, mm3); // load 8 dest bytes
+ movq_r2r (mm3, mm4); // copy 8 dest bytes
+
+ punpcklbw_r2r (mm0, mm3); // unpack low dest bytes
+ punpckhbw_r2r (mm0, mm4); // unpack high dest bytes
+
+ paddw_r2r (mm3, mm1); // add lows
+ paddw_r2r (mm4, mm2); // add highs
+
+ paddw_m2r (round1, mm1);
+ psraw_i2r (1, mm1); // /2
+ paddw_m2r (round1, mm2);
+ psraw_i2r (1, mm2); // /2
+
+ /* now have end value in mm1 and mm2 */
+
+ packuswb_r2r (mm2, mm1); // pack (w/ saturation)
+ movq_r2m (mm1,*dest); // store result in dest
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_avg_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ mmx_zero_reg ();
+
+ do {
+ mmx_average_2_U8 (dest, dest, ref);
+
+ if (width == 16)
+ mmx_average_2_U8 (dest+8, dest+8, ref+8);
+
+ dest += stride;
+ ref += stride;
+ } while (--height);
+}
+
+static void MC_avg_o_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_avg_o_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_put_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ mmx_zero_reg ();
+
+ do {
+ movq_m2r (* ref, mm1); // load 8 ref bytes
+ movq_r2m (mm1,* dest); // store 8 bytes at curr
+
+ if (width == 16)
+ {
+ movq_m2r (* (ref+8), mm1); // load 8 ref bytes
+ movq_r2m (mm1,* (dest+8)); // store 8 bytes at curr
+ }
+
+ dest += stride;
+ ref += stride;
+ } while (--height);
+}
+
+static void MC_put_o_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_put_o_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+/* Half pixel interpolation in the x direction */
+static inline void MC_avg_x_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ mmx_zero_reg ();
+
+ do {
+ mmx_interp_average_2_U8 (dest, ref, ref+1);
+
+ if (width == 16)
+ mmx_interp_average_2_U8 (dest+8, ref+8, ref+9);
+
+ dest += stride;
+ ref += stride;
+ } while (--height);
+}
+
+static void MC_avg_x_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_x_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_avg_x_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_x_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_put_x_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ mmx_zero_reg ();
+
+ do {
+ mmx_average_2_U8 (dest, ref, ref+1);
+
+ if (width == 16)
+ mmx_average_2_U8 (dest+8, ref+8, ref+9);
+
+ dest += stride;
+ ref += stride;
+ } while (--height);
+}
+
+static void MC_put_x_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_x_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_put_x_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_x_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_avg_xy_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ uint8_t * ref_next = ref+stride;
+
+ mmx_zero_reg ();
+
+ do {
+ mmx_interp_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
+
+ if (width == 16)
+ mmx_interp_average_4_U8 (dest+8, ref+8, ref+9,
+ ref_next+8, ref_next+9);
+
+ dest += stride;
+ ref += stride;
+ ref_next += stride;
+ } while (--height);
+}
+
+static void MC_avg_xy_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_xy_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_avg_xy_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_xy_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_put_xy_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ uint8_t * ref_next = ref+stride;
+
+ mmx_zero_reg ();
+
+ do {
+ mmx_average_4_U8 (dest, ref, ref+1, ref_next, ref_next+1);
+
+ if (width == 16)
+ mmx_average_4_U8 (dest+8, ref+8, ref+9, ref_next+8, ref_next+9);
+
+ dest += stride;
+ ref += stride;
+ ref_next += stride;
+ } while (--height);
+}
+
+static void MC_put_xy_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_xy_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_put_xy_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_xy_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_avg_y_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ uint8_t * ref_next = ref+stride;
+
+ mmx_zero_reg ();
+
+ do {
+ mmx_interp_average_2_U8 (dest, ref, ref_next);
+
+ if (width == 16)
+ mmx_interp_average_2_U8 (dest+8, ref+8, ref_next+8);
+
+ dest += stride;
+ ref += stride;
+ ref_next += stride;
+ } while (--height);
+}
+
+static void MC_avg_y_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_y_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_avg_y_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg_y_mmx (8, height, dest, ref, stride);
+}
+
+/*-----------------------------------------------------------------------*/
+
+static inline void MC_put_y_mmx (int width, int height,
+ uint8_t * dest, uint8_t * ref, int stride)
+{
+ uint8_t * ref_next = ref+stride;
+
+ mmx_zero_reg ();
+
+ do {
+ mmx_average_2_U8 (dest, ref, ref_next);
+
+ if (width == 16)
+ mmx_average_2_U8 (dest+8, ref+8, ref_next+8);
+
+ dest += stride;
+ ref += stride;
+ ref_next += stride;
+ } while (--height);
+}
+
+static void MC_put_y_16_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_y_mmx (16, height, dest, ref, stride);
+}
+
+static void MC_put_y_8_mmx (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put_y_mmx (8, height, dest, ref, stride);
+}
+
+
+MPEG2_MC_EXTERN (mmx)
+
+
+
+
+
+
+
+/* CPU_MMXEXT/CPU_3DNOW adaptation layer */
+
+#define pavg_r2r(src,dest) \
+do { \
+ if (cpu == CPU_MMXEXT) \
+ pavgb_r2r (src, dest); \
+ else \
+ pavgusb_r2r (src, dest); \
+} while (0)
+
+#define pavg_m2r(src,dest) \
+do { \
+ if (cpu == CPU_MMXEXT) \
+ pavgb_m2r (src, dest); \
+ else \
+ pavgusb_m2r (src, dest); \
+} while (0)
+
+
+/* CPU_MMXEXT code */
+
+
+static inline void MC_put1_8 (int height, uint8_t * dest, uint8_t * ref,
+ int stride)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_r2m (mm0, *dest);
+ ref += stride;
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_put1_16 (int height, uint8_t * dest, uint8_t * ref,
+ int stride)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+8), mm1);
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ movq_r2m (mm1, *(dest+8));
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_avg1_8 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ pavg_m2r (*dest, mm0);
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_avg1_16 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+8), mm1);
+ pavg_m2r (*dest, mm0);
+ pavg_m2r (*(dest+8), mm1);
+ movq_r2m (mm0, *dest);
+ ref += stride;
+ movq_r2m (mm1, *(dest+8));
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_put2_8 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int offset, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ pavg_m2r (*(ref+offset), mm0);
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_put2_16 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int offset, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+8), mm1);
+ pavg_m2r (*(ref+offset), mm0);
+ pavg_m2r (*(ref+offset+8), mm1);
+ movq_r2m (mm0, *dest);
+ ref += stride;
+ movq_r2m (mm1, *(dest+8));
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_avg2_8 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int offset, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ pavg_m2r (*(ref+offset), mm0);
+ pavg_m2r (*dest, mm0);
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_avg2_16 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int offset, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+8), mm1);
+ pavg_m2r (*(ref+offset), mm0);
+ pavg_m2r (*(ref+offset+8), mm1);
+ pavg_m2r (*dest, mm0);
+ pavg_m2r (*(dest+8), mm1);
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ movq_r2m (mm1, *(dest+8));
+ dest += stride;
+ } while (--height);
+}
+
+static mmx_t mask_one = {0x0101010101010101LL};
+
+static inline void MC_put4_8 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int cpu)
+{
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+1), mm1);
+ movq_r2r (mm0, mm7);
+ pxor_r2r (mm1, mm7);
+ pavg_r2r (mm1, mm0);
+ ref += stride;
+
+ do {
+ movq_m2r (*ref, mm2);
+ movq_r2r (mm0, mm5);
+
+ movq_m2r (*(ref+1), mm3);
+ movq_r2r (mm2, mm6);
+
+ pxor_r2r (mm3, mm6);
+ pavg_r2r (mm3, mm2);
+
+ por_r2r (mm6, mm7);
+ pxor_r2r (mm2, mm5);
+
+ pand_r2r (mm5, mm7);
+ pavg_r2r (mm2, mm0);
+
+ pand_m2r (mask_one, mm7);
+
+ psubusb_r2r (mm7, mm0);
+
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ dest += stride;
+
+ movq_r2r (mm6, mm7); // unroll !
+ movq_r2r (mm2, mm0); // unroll !
+ } while (--height);
+}
+
+static inline void MC_put4_16 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+stride+1), mm1);
+ movq_r2r (mm0, mm7);
+ movq_m2r (*(ref+1), mm2);
+ pxor_r2r (mm1, mm7);
+ movq_m2r (*(ref+stride), mm3);
+ movq_r2r (mm2, mm6);
+ pxor_r2r (mm3, mm6);
+ pavg_r2r (mm1, mm0);
+ pavg_r2r (mm3, mm2);
+ por_r2r (mm6, mm7);
+ movq_r2r (mm0, mm6);
+ pxor_r2r (mm2, mm6);
+ pand_r2r (mm6, mm7);
+ pand_m2r (mask_one, mm7);
+ pavg_r2r (mm2, mm0);
+ psubusb_r2r (mm7, mm0);
+ movq_r2m (mm0, *dest);
+
+ movq_m2r (*(ref+8), mm0);
+ movq_m2r (*(ref+stride+9), mm1);
+ movq_r2r (mm0, mm7);
+ movq_m2r (*(ref+9), mm2);
+ pxor_r2r (mm1, mm7);
+ movq_m2r (*(ref+stride+8), mm3);
+ movq_r2r (mm2, mm6);
+ pxor_r2r (mm3, mm6);
+ pavg_r2r (mm1, mm0);
+ pavg_r2r (mm3, mm2);
+ por_r2r (mm6, mm7);
+ movq_r2r (mm0, mm6);
+ pxor_r2r (mm2, mm6);
+ pand_r2r (mm6, mm7);
+ pand_m2r (mask_one, mm7);
+ pavg_r2r (mm2, mm0);
+ psubusb_r2r (mm7, mm0);
+ ref += stride;
+ movq_r2m (mm0, *(dest+8));
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_avg4_8 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+stride+1), mm1);
+ movq_r2r (mm0, mm7);
+ movq_m2r (*(ref+1), mm2);
+ pxor_r2r (mm1, mm7);
+ movq_m2r (*(ref+stride), mm3);
+ movq_r2r (mm2, mm6);
+ pxor_r2r (mm3, mm6);
+ pavg_r2r (mm1, mm0);
+ pavg_r2r (mm3, mm2);
+ por_r2r (mm6, mm7);
+ movq_r2r (mm0, mm6);
+ pxor_r2r (mm2, mm6);
+ pand_r2r (mm6, mm7);
+ pand_m2r (mask_one, mm7);
+ pavg_r2r (mm2, mm0);
+ psubusb_r2r (mm7, mm0);
+ movq_m2r (*dest, mm1);
+ pavg_r2r (mm1, mm0);
+ ref += stride;
+ movq_r2m (mm0, *dest);
+ dest += stride;
+ } while (--height);
+}
+
+static inline void MC_avg4_16 (int height, uint8_t * dest, uint8_t * ref,
+ int stride, int cpu)
+{
+ do {
+ movq_m2r (*ref, mm0);
+ movq_m2r (*(ref+stride+1), mm1);
+ movq_r2r (mm0, mm7);
+ movq_m2r (*(ref+1), mm2);
+ pxor_r2r (mm1, mm7);
+ movq_m2r (*(ref+stride), mm3);
+ movq_r2r (mm2, mm6);
+ pxor_r2r (mm3, mm6);
+ pavg_r2r (mm1, mm0);
+ pavg_r2r (mm3, mm2);
+ por_r2r (mm6, mm7);
+ movq_r2r (mm0, mm6);
+ pxor_r2r (mm2, mm6);
+ pand_r2r (mm6, mm7);
+ pand_m2r (mask_one, mm7);
+ pavg_r2r (mm2, mm0);
+ psubusb_r2r (mm7, mm0);
+ movq_m2r (*dest, mm1);
+ pavg_r2r (mm1, mm0);
+ movq_r2m (mm0, *dest);
+
+ movq_m2r (*(ref+8), mm0);
+ movq_m2r (*(ref+stride+9), mm1);
+ movq_r2r (mm0, mm7);
+ movq_m2r (*(ref+9), mm2);
+ pxor_r2r (mm1, mm7);
+ movq_m2r (*(ref+stride+8), mm3);
+ movq_r2r (mm2, mm6);
+ pxor_r2r (mm3, mm6);
+ pavg_r2r (mm1, mm0);
+ pavg_r2r (mm3, mm2);
+ por_r2r (mm6, mm7);
+ movq_r2r (mm0, mm6);
+ pxor_r2r (mm2, mm6);
+ pand_r2r (mm6, mm7);
+ pand_m2r (mask_one, mm7);
+ pavg_r2r (mm2, mm0);
+ psubusb_r2r (mm7, mm0);
+ movq_m2r (*(dest+8), mm1);
+ pavg_r2r (mm1, mm0);
+ ref += stride;
+ movq_r2m (mm0, *(dest+8));
+ dest += stride;
+ } while (--height);
+}
+
+static void MC_avg_o_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg1_16 (height, dest, ref, stride, CPU_MMXEXT);
+}
+
+static void MC_avg_o_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg1_8 (height, dest, ref, stride, CPU_MMXEXT);
+}
+
+static void MC_put_o_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put1_16 (height, dest, ref, stride);
+}
+
+static void MC_put_o_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put1_8 (height, dest, ref, stride);
+}
+
+static void MC_avg_x_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
+}
+
+static void MC_avg_x_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
+}
+
+static void MC_put_x_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_16 (height, dest, ref, stride, 1, CPU_MMXEXT);
+}
+
+static void MC_put_x_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_8 (height, dest, ref, stride, 1, CPU_MMXEXT);
+}
+
+static void MC_avg_y_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
+}
+
+static void MC_avg_y_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
+}
+
+static void MC_put_y_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_16 (height, dest, ref, stride, stride, CPU_MMXEXT);
+}
+
+static void MC_put_y_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_8 (height, dest, ref, stride, stride, CPU_MMXEXT);
+}
+
+static void MC_avg_xy_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg4_16 (height, dest, ref, stride, CPU_MMXEXT);
+}
+
+static void MC_avg_xy_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg4_8 (height, dest, ref, stride, CPU_MMXEXT);
+}
+
+static void MC_put_xy_16_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put4_16 (height, dest, ref, stride, CPU_MMXEXT);
+}
+
+static void MC_put_xy_8_mmxext (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put4_8 (height, dest, ref, stride, CPU_MMXEXT);
+}
+
+
+MPEG2_MC_EXTERN (mmxext)
+
+
+
+static void MC_avg_o_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg1_16 (height, dest, ref, stride, CPU_3DNOW);
+}
+
+static void MC_avg_o_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg1_8 (height, dest, ref, stride, CPU_3DNOW);
+}
+
+static void MC_put_o_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put1_16 (height, dest, ref, stride);
+}
+
+static void MC_put_o_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put1_8 (height, dest, ref, stride);
+}
+
+static void MC_avg_x_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
+}
+
+static void MC_avg_x_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_8 (height, dest, ref, stride, 1, CPU_3DNOW);
+}
+
+static void MC_put_x_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_16 (height, dest, ref, stride, 1, CPU_3DNOW);
+}
+
+static void MC_put_x_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_8 (height, dest, ref, stride, 1, CPU_3DNOW);
+}
+
+static void MC_avg_y_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_16 (height, dest, ref, stride, stride, CPU_3DNOW);
+}
+
+static void MC_avg_y_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg2_8 (height, dest, ref, stride, stride, CPU_3DNOW);
+}
+
+static void MC_put_y_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_16 (height, dest, ref, stride, stride, CPU_3DNOW);
+}
+
+static void MC_put_y_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put2_8 (height, dest, ref, stride, stride, CPU_3DNOW);
+}
+
+static void MC_avg_xy_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg4_16 (height, dest, ref, stride, CPU_3DNOW);
+}
+
+static void MC_avg_xy_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_avg4_8 (height, dest, ref, stride, CPU_3DNOW);
+}
+
+static void MC_put_xy_16_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put4_16 (height, dest, ref, stride, CPU_3DNOW);
+}
+
+static void MC_put_xy_8_3dnow (uint8_t * dest, uint8_t * ref,
+ int stride, int height)
+{
+ MC_put4_8 (height, dest, ref, stride, CPU_3DNOW);
+}
+
+
+MPEG2_MC_EXTERN (3dnow)
+
+#endif
diff --git a/src/libmpeg2/motion_comp_vis.c b/src/video_dec/libmpeg2/motion_comp_vis.c
index d0a6673d6..d0a6673d6 100644
--- a/src/libmpeg2/motion_comp_vis.c
+++ b/src/video_dec/libmpeg2/motion_comp_vis.c
diff --git a/src/libmpeg2/mpeg2.h b/src/video_dec/libmpeg2/mpeg2.h
index ae69688f5..ae69688f5 100644
--- a/src/libmpeg2/mpeg2.h
+++ b/src/video_dec/libmpeg2/mpeg2.h
diff --git a/src/video_dec/libmpeg2/mpeg2_internal.h b/src/video_dec/libmpeg2/mpeg2_internal.h
new file mode 100644
index 000000000..eeaa16227
--- /dev/null
+++ b/src/video_dec/libmpeg2/mpeg2_internal.h
@@ -0,0 +1,294 @@
+/*
+ * mpeg2_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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef MPEG2_INTERNAL_H
+#define MPEG2_INTERNAL_H
+
+#include <xine/video_out.h>
+#include "accel_xvmc.h"
+
+#ifdef ENABLE_ALTIVEC
+#include <altivec.h>
+#endif
+
+/* macroblock modes */
+#define MACROBLOCK_INTRA XINE_MACROBLOCK_INTRA
+#define MACROBLOCK_PATTERN XINE_MACROBLOCK_PATTERN
+#define MACROBLOCK_MOTION_BACKWARD XINE_MACROBLOCK_MOTION_BACKWARD
+#define MACROBLOCK_MOTION_FORWARD XINE_MACROBLOCK_MOTION_FORWARD
+#define MACROBLOCK_QUANT XINE_MACROBLOCK_QUANT
+#define DCT_TYPE_INTERLACED XINE_MACROBLOCK_DCT_TYPE_INTERLACED
+
+/* motion_type */
+#define MOTION_TYPE_MASK (3*64)
+#define MOTION_TYPE_BASE 64
+#define MC_FIELD (1*64)
+#define MC_FRAME (2*64)
+#define MC_16X8 (2*64)
+#define MC_DMV (3*64)
+
+/* picture structure */
+#define TOP_FIELD VO_TOP_FIELD
+#define BOTTOM_FIELD VO_BOTTOM_FIELD
+#define FRAME_PICTURE VO_BOTH_FIELDS
+
+/* picture coding type (mpeg2 header) */
+#define I_TYPE 1
+#define P_TYPE 2
+#define B_TYPE 3
+#define D_TYPE 4
+
+typedef struct motion_s {
+ uint8_t * ref[2][3];
+ uint8_t ** ref2[2];
+ int pmv[2][2];
+ int f_code[2];
+} motion_t;
+
+typedef struct picture_s {
+ /* first, state that carries information from one macroblock to the */
+ /* next inside a slice, and is never used outside of mpeg2_slice() */
+
+ /* DCT coefficients - should be kept aligned ! */
+ int16_t DCTblock[64];
+
+ /* XvMC DCT block and macroblock data for XvMC acceleration */
+ xine_macroblocks_t *mc;
+ int XvMC_mb_type;
+ int XvMC_mv_field_sel[2][2];
+ int XvMC_x;
+ int XvMC_y;
+ int XvMC_motion_type;
+ int XvMC_dmvector[2];
+ int XvMC_cbp;
+ int XvMC_dct_type;
+
+ /* bit parsing stuff */
+ uint32_t bitstream_buf; /* current 32 bit working set of buffer */
+ int bitstream_bits; /* used bits in working set */
+ uint8_t * bitstream_ptr; /* buffer with stream data */
+
+ uint8_t * dest[3];
+ int pitches[3];
+ int offset;
+ unsigned int limit_x;
+ unsigned int limit_y_16;
+ unsigned int limit_y_8;
+ unsigned int limit_y;
+
+ /* Motion vectors */
+ /* The f_ and b_ correspond to the forward and backward motion */
+ /* predictors */
+ motion_t b_motion;
+ motion_t f_motion;
+
+ /* predictor for DC coefficients in intra blocks */
+ int16_t dc_dct_pred[3];
+
+ int quantizer_scale; /* remove */
+ int current_field; /* remove */
+ int dmv_offset; /* remove */
+ unsigned int v_offset; /* remove */
+
+
+ /* now non-slice-specific information */
+
+ /* sequence header stuff */
+ uint8_t intra_quantizer_matrix [64];
+ uint8_t non_intra_quantizer_matrix [64];
+ int load_intra_quantizer_matrix;
+ int load_non_intra_quantizer_matrix;
+
+ /* The width and height of the picture snapped to macroblock units */
+ int coded_picture_width;
+ int coded_picture_height;
+
+ /* The width and height as it appears on header sequence */
+ unsigned int display_width, display_height;
+
+ /* picture header stuff */
+
+ /* what type of picture this is (I, P, B, D) */
+ int picture_coding_type;
+
+ int vbv_delay;
+ int low_delay;
+
+ /* picture coding extension stuff */
+
+ /* quantization factor for intra dc coefficients */
+ int intra_dc_precision;
+ /* top/bottom/both fields */
+ int picture_structure;
+ /* bool to indicate all predictions are frame based */
+ int frame_pred_frame_dct;
+ /* bool to indicate whether intra blocks have motion vectors */
+ /* (for concealment) */
+ int concealment_motion_vectors;
+ /* bit to indicate which quantization table to use */
+ int q_scale_type;
+ /* bool to use different vlc tables */
+ int intra_vlc_format;
+ /* used for DMV MC */
+ int top_field_first;
+
+ /* stuff derived from bitstream */
+
+ /* pointer to the zigzag scan we're supposed to be using */
+ uint8_t * scan;
+
+ struct vo_frame_s * current_frame;
+ struct vo_frame_s * forward_reference_frame;
+ struct vo_frame_s * backward_reference_frame;
+
+ int frame_width, frame_height;
+
+ int second_field;
+
+ int mpeg1;
+
+ int skip_non_intra_dct;
+
+ /* these things are not needed by the decoder */
+ /* this is a temporary interface, we will build a better one later. */
+ int aspect_ratio_information;
+ int saved_aspect_ratio;
+ int frame_rate_code;
+ int progressive_sequence;
+ int repeat_first_field;
+ int progressive_frame;
+ int32_t frame_centre_horizontal_offset;
+ int32_t frame_centre_vertical_offset;
+ uint32_t video_format;
+ uint32_t colour_description;
+ uint32_t colour_primatives;
+ uint32_t transfer_characteristics;
+ uint32_t matrix_coefficients;
+ uint32_t display_horizontal_size;
+ uint32_t display_vertical_size;
+ uint32_t drop_frame_flag;
+ uint32_t time_code_hours;
+ uint32_t time_code_minutes;
+ uint32_t time_code_seconds;
+ uint32_t time_code_pictures;
+ uint32_t closed_gop;
+ uint32_t broken_link;
+
+ int bitrate;
+ int frame_rate_ext_n;
+ int frame_rate_ext_d;
+
+} picture_t;
+
+typedef struct cpu_state_s {
+#ifdef ARCH_PPC
+ uint8_t regv[12*16];
+#endif
+ int dummy;
+} cpu_state_t;
+
+/* cpu_state.c */
+extern void (* mpeg2_cpu_state_save) (cpu_state_t * state);
+extern void (* mpeg2_cpu_state_restore) (cpu_state_t * state);
+void mpeg2_cpu_state_init (uint32_t mm_accel);
+
+/* header.c */
+extern uint8_t mpeg2_scan_norm[64];
+extern uint8_t mpeg2_scan_alt[64];
+void mpeg2_header_state_init (picture_t * picture);
+int mpeg2_header_picture (picture_t * picture, uint8_t * buffer);
+int mpeg2_header_sequence (picture_t * picture, uint8_t * buffer);
+int mpeg2_header_extension (picture_t * picture, uint8_t * buffer);
+int mpeg2_header_group_of_pictures (picture_t * picture, uint8_t * buffer);
+
+/* idct.c */
+extern void (* mpeg2_idct_copy) (int16_t * block, uint8_t * dest, int stride);
+extern void (* mpeg2_idct_add) (int16_t * block, uint8_t * dest, int stride);
+extern void (* mpeg2_idct) (int16_t * block);
+extern void (* mpeg2_zero_block) (int16_t * block);
+void mpeg2_idct_init (uint32_t mm_accel);
+
+/* idct_mlib.c */
+void mpeg2_idct_add_mlib (int16_t * block, uint8_t * dest, int stride);
+void mpeg2_idct_copy_mlib_non_ieee (int16_t * block, uint8_t * dest,
+ int stride);
+void mpeg2_idct_add_mlib_non_ieee (int16_t * block, uint8_t * dest,
+ int stride);
+void mpeg2_idct_mlib (int16_t * block);
+
+/* idct_mmx.c */
+void mpeg2_idct_copy_mmxext (int16_t * block, uint8_t * dest, int stride);
+void mpeg2_idct_add_mmxext (int16_t * block, uint8_t * dest, int stride);
+void mpeg2_idct_mmxext (int16_t * block);
+void mpeg2_idct_copy_mmx (int16_t * block, uint8_t * dest, int stride);
+void mpeg2_idct_add_mmx (int16_t * block, uint8_t * dest, int stride);
+void mpeg2_idct_mmx (int16_t * block);
+void mpeg2_zero_block_mmx (int16_t * block);
+void mpeg2_idct_mmx_init (void);
+
+/* idct_altivec.c */
+# ifdef ENABLE_ALTIVEC
+void mpeg2_idct_copy_altivec (vector signed short * block, unsigned char * dest,
+ int stride);
+void mpeg2_idct_add_altivec (vector signed short * block, unsigned char * dest,
+ int stride);
+# else /* ! ENABLE_ALTIVEC */
+void mpeg2_idct_copy_altivec (signed short * block, unsigned char * dest,
+ int stride);
+void mpeg2_idct_add_altivec (signed short * block, unsigned char * dest,
+ int stride);
+# endif /* ENABLE_ALTIVEC */
+void mpeg2_idct_altivec_init (void);
+
+/* motion_comp.c */
+void mpeg2_mc_init (uint32_t mm_accel);
+
+typedef struct mpeg2_mc_s {
+ void (* put [8]) (uint8_t * dst, uint8_t *, int32_t, int32_t);
+ void (* avg [8]) (uint8_t * dst, uint8_t *, int32_t, int32_t);
+} mpeg2_mc_t;
+
+#define MPEG2_MC_EXTERN(x) mpeg2_mc_t mpeg2_mc_##x = { \
+ {MC_put_o_16_##x, MC_put_x_16_##x, MC_put_y_16_##x, MC_put_xy_16_##x, \
+ MC_put_o_8_##x, MC_put_x_8_##x, MC_put_y_8_##x, MC_put_xy_8_##x}, \
+ {MC_avg_o_16_##x, MC_avg_x_16_##x, MC_avg_y_16_##x, MC_avg_xy_16_##x, \
+ MC_avg_o_8_##x, MC_avg_x_8_##x, MC_avg_y_8_##x, MC_avg_xy_8_##x} \
+};
+
+extern mpeg2_mc_t mpeg2_mc;
+extern mpeg2_mc_t mpeg2_mc_c;
+extern mpeg2_mc_t mpeg2_mc_mmx;
+extern mpeg2_mc_t mpeg2_mc_mmxext;
+extern mpeg2_mc_t mpeg2_mc_3dnow;
+extern mpeg2_mc_t mpeg2_mc_altivec;
+extern mpeg2_mc_t mpeg2_mc_mlib;
+extern mpeg2_mc_t mpeg2_mc_vis;
+
+/* slice.c */
+void mpeg2_slice (picture_t * picture, int code, uint8_t * buffer);
+
+/* stats.c */
+void mpeg2_stats (int code, uint8_t * buffer);
+
+
+#endif
diff --git a/src/video_dec/libmpeg2/slice.c b/src/video_dec/libmpeg2/slice.c
new file mode 100644
index 000000000..8247a9a24
--- /dev/null
+++ b/src/video_dec/libmpeg2/slice.c
@@ -0,0 +1,1833 @@
+/*
+ * slice.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 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 <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include "mpeg2_internal.h"
+#include <xine/attributes.h>
+
+#include "vlc.h"
+
+static const int non_linear_quantizer_scale [] = {
+ 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
+};
+
+static inline int get_macroblock_modes (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int macroblock_modes;
+ const MBtab * tab;
+
+ switch (picture->picture_coding_type) {
+ case I_TYPE:
+
+ tab = MB_I + UBITS (bit_buf, 1);
+ DUMPBITS (bit_buf, bits, tab->len);
+ macroblock_modes = tab->modes;
+
+ if ((! (picture->frame_pred_frame_dct)) &&
+ (picture->picture_structure == FRAME_PICTURE)) {
+ macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
+ DUMPBITS (bit_buf, bits, 1);
+ }
+
+ return macroblock_modes;
+
+ case P_TYPE:
+
+ tab = MB_P + UBITS (bit_buf, 5);
+ DUMPBITS (bit_buf, bits, tab->len);
+ macroblock_modes = tab->modes;
+
+ if (picture->picture_structure != FRAME_PICTURE) {
+ if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ }
+ return macroblock_modes;
+ } else if (picture->frame_pred_frame_dct) {
+ if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
+ macroblock_modes |= MC_FRAME;
+ return macroblock_modes;
+ } else {
+ if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ }
+ if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
+ macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
+ DUMPBITS (bit_buf, bits, 1);
+ }
+ return macroblock_modes;
+ }
+
+ case B_TYPE:
+
+ tab = MB_B + UBITS (bit_buf, 6);
+ DUMPBITS (bit_buf, bits, tab->len);
+ macroblock_modes = tab->modes;
+
+ if (picture->picture_structure != FRAME_PICTURE) {
+ if (! (macroblock_modes & MACROBLOCK_INTRA)) {
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ }
+ return macroblock_modes;
+ } else if (picture->frame_pred_frame_dct) {
+ /* if (! (macroblock_modes & MACROBLOCK_INTRA)) */
+ macroblock_modes |= MC_FRAME;
+ return macroblock_modes;
+ } else {
+ if (macroblock_modes & MACROBLOCK_INTRA)
+ goto intra;
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
+ intra:
+ macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
+ DUMPBITS (bit_buf, bits, 1);
+ }
+ return macroblock_modes;
+ }
+
+ case D_TYPE:
+
+ DUMPBITS (bit_buf, bits, 1);
+ return MACROBLOCK_INTRA;
+
+ default:
+ return 0;
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_quantizer_scale (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ int quantizer_scale_code;
+
+ quantizer_scale_code = UBITS (bit_buf, 5);
+ DUMPBITS (bit_buf, bits, 5);
+
+ if (picture->q_scale_type)
+ return non_linear_quantizer_scale [quantizer_scale_code];
+ else
+ return quantizer_scale_code << 1;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_motion_delta (picture_t * picture, int f_code)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ int delta;
+ int sign;
+ const MVtab * tab;
+
+ if (bit_buf & 0x80000000) {
+ DUMPBITS (bit_buf, bits, 1);
+ return 0;
+ } else if (bit_buf >= 0x0c000000) {
+
+ tab = MV_4 + UBITS (bit_buf, 4);
+ delta = (tab->delta << f_code) + 1;
+ bits += tab->len + f_code + 1;
+ bit_buf <<= tab->len;
+
+ sign = SBITS (bit_buf, 1);
+ bit_buf <<= 1;
+
+ if (f_code)
+ delta += UBITS (bit_buf, f_code);
+ bit_buf <<= f_code;
+
+ return (delta ^ sign) - sign;
+
+ } else {
+
+ tab = MV_10 + UBITS (bit_buf, 10);
+ delta = (tab->delta << f_code) + 1;
+ bits += tab->len + 1;
+ bit_buf <<= tab->len;
+
+ sign = SBITS (bit_buf, 1);
+ bit_buf <<= 1;
+
+ if (f_code) {
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ delta += UBITS (bit_buf, f_code);
+ DUMPBITS (bit_buf, bits, f_code);
+ }
+
+ return (delta ^ sign) - sign;
+
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int bound_motion_vector (int vec, int f_code)
+{
+#if 1
+ unsigned int limit;
+ int sign;
+
+ limit = 16 << f_code;
+
+ if ((unsigned int)(vec + limit) < 2 * limit)
+ return vec;
+ else {
+ sign = ((int32_t)vec) >> 31;
+ return vec - ((2 * limit) ^ sign) + sign;
+ }
+#else
+ return ((int32_t)vector << (27 - f_code)) >> (27 - f_code);
+#endif
+}
+
+static inline int get_dmv (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ const DMVtab * tab;
+
+ tab = DMV_2 + UBITS (bit_buf, 2);
+ DUMPBITS (bit_buf, bits, tab->len);
+ return tab->dmv;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_coded_block_pattern (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ const CBPtab * tab;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ if (bit_buf >= 0x20000000) {
+
+ tab = CBP_7 + (UBITS (bit_buf, 7) - 16);
+ DUMPBITS (bit_buf, bits, tab->len);
+ return tab->cbp;
+
+ } else {
+
+ tab = CBP_9 + UBITS (bit_buf, 9);
+ DUMPBITS (bit_buf, bits, tab->len);
+ return tab->cbp;
+ }
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_luma_dc_dct_diff (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ const DCtab * tab;
+ int size;
+ int dc_diff;
+
+ if (bit_buf < 0xf8000000) {
+ tab = DC_lum_5 + UBITS (bit_buf, 5);
+ size = tab->size;
+ if (size) {
+ bits += tab->len + size;
+ bit_buf <<= tab->len;
+ dc_diff =
+ UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ bit_buf <<= size;
+ return dc_diff;
+ } else {
+ DUMPBITS (bit_buf, bits, 3);
+ return 0;
+ }
+ } else {
+ tab = DC_long + (UBITS (bit_buf, 9) - 0x1e0);
+ size = tab->size;
+ DUMPBITS (bit_buf, bits, tab->len);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ DUMPBITS (bit_buf, bits, size);
+ return dc_diff;
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_chroma_dc_dct_diff (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ const DCtab * tab;
+ int size;
+ int dc_diff;
+
+ if (bit_buf < 0xf8000000) {
+ tab = DC_chrom_5 + UBITS (bit_buf, 5);
+ size = tab->size;
+ if (size) {
+ bits += tab->len + size;
+ bit_buf <<= tab->len;
+ dc_diff =
+ UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ bit_buf <<= size;
+ return dc_diff;
+ } else {
+ DUMPBITS (bit_buf, bits, 2);
+ return 0;
+ }
+ } else {
+ tab = DC_long + (UBITS (bit_buf, 10) - 0x3e0);
+ size = tab->size;
+ DUMPBITS (bit_buf, bits, tab->len + 1);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ DUMPBITS (bit_buf, bits, size);
+ return dc_diff;
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+#define SATURATE(val) \
+do { \
+ if ((uint32_t)(val + 2048) > 4095) \
+ val = (val > 0) ? 2047 : -2048; \
+} while (0)
+
+static void get_intra_block_B14 (picture_t * picture)
+{
+ int i;
+ int j;
+ int val;
+ uint8_t * scan = picture->scan;
+ uint8_t * quant_matrix = picture->intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ int mismatch;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ dest = picture->DCTblock;
+ i = 0;
+ mismatch = ~dest[0];
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ j = scan[i];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = (tab->level * quantizer_scale * quant_matrix[j]) >> 4;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ j = scan[i];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = (SBITS (bit_buf, 12) *
+ quantizer_scale * quant_matrix[j]) / 16;
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ dest[63] ^= mismatch & 1;
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_intra_block_B15 (picture_t * picture)
+{
+ int i;
+ int j;
+ int val;
+ uint8_t * scan = picture->scan;
+ uint8_t * quant_matrix = picture->intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ int mismatch;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ dest = picture->DCTblock;
+ i = 0;
+ mismatch = ~dest[0];
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ while (1) {
+ if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B15_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64) {
+
+ normal_code:
+ j = scan[i];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = (tab->level * quantizer_scale * quant_matrix[j]) >> 4;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else {
+
+ /* end of block. I commented out this code because if we */
+ /* dont exit here we will still exit at the later test :) */
+
+ /* if (i >= 128) break; */ /* end of block */
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check against buffer overflow */
+
+ j = scan[i];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = (SBITS (bit_buf, 12) *
+ quantizer_scale * quant_matrix[j]) / 16;
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ }
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B15_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ dest[63] ^= mismatch & 1;
+ DUMPBITS (bit_buf, bits, 4); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_non_intra_block (picture_t * picture)
+{
+ int i;
+ int j;
+ int val;
+ uint8_t * scan = picture->scan;
+ uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ int mismatch;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ i = -1;
+ mismatch = 1;
+ dest = picture->DCTblock;
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ if (bit_buf >= 0x28000000) {
+ tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
+ goto entry_1;
+ } else
+ goto entry_2;
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ entry_1:
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ j = scan[i];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = ((2*tab->level+1) * quantizer_scale * quant_matrix[j]) >> 5;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ }
+
+ entry_2:
+ if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ j = scan[i];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = 2 * (SBITS (bit_buf, 12) + SBITS (bit_buf, 1)) + 1;
+ val = (val * quantizer_scale * quant_matrix[j]) / 32;
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ dest[63] ^= mismatch & 1;
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_mpeg1_intra_block (picture_t * picture)
+{
+ int i;
+ int j;
+ int val;
+ uint8_t * scan = picture->scan;
+ uint8_t * quant_matrix = picture->intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ i = 0;
+ dest = picture->DCTblock;
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ j = scan[i];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = (tab->level * quantizer_scale * quant_matrix[j]) >> 4;
+
+ /* oddification */
+ val = (val - 1) | 1;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ j = scan[i];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = SBITS (bit_buf, 8);
+ if (! (val & 0x7f)) {
+ DUMPBITS (bit_buf, bits, 8);
+ val = UBITS (bit_buf, 8) + 2 * val;
+ }
+ val = (val * quantizer_scale * quant_matrix[j]) / 16;
+
+ /* oddification */
+ val = (val + ~SBITS (val, 1)) | 1;
+
+ SATURATE (val);
+ dest[j] = val;
+
+ DUMPBITS (bit_buf, bits, 8);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_mpeg1_non_intra_block (picture_t * picture)
+{
+ int i;
+ int j;
+ int val;
+ uint8_t * scan = picture->scan;
+ uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ i = -1;
+ dest = picture->DCTblock;
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ if (bit_buf >= 0x28000000) {
+ tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
+ goto entry_1;
+ } else
+ goto entry_2;
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ entry_1:
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ j = scan[i];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = ((2*tab->level+1) * quantizer_scale * quant_matrix[j]) >> 5;
+
+ /* oddification */
+ val = (val - 1) | 1;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ }
+
+ entry_2:
+ if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ j = scan[i];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = SBITS (bit_buf, 8);
+ if (! (val & 0x7f)) {
+ DUMPBITS (bit_buf, bits, 8);
+ val = UBITS (bit_buf, 8) + 2 * val;
+ }
+ val = 2 * (val + SBITS (val, 1)) + 1;
+ val = (val * quantizer_scale * quant_matrix[j]) / 32;
+
+ /* oddification */
+ val = (val + ~SBITS (val, 1)) | 1;
+
+ SATURATE (val);
+ dest[j] = val;
+
+ DUMPBITS (bit_buf, bits, 8);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static inline void slice_intra_DCT (picture_t * picture, int cc,
+ uint8_t * dest, int stride)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ /* Get the intra DC coefficient and inverse quantize it */
+ if (cc == 0)
+ picture->dc_dct_pred[0] += get_luma_dc_dct_diff (picture);
+ else
+ picture->dc_dct_pred[cc] += get_chroma_dc_dct_diff (picture);
+ picture->DCTblock[0] =
+ picture->dc_dct_pred[cc] << (3 - picture->intra_dc_precision);
+
+ if (picture->mpeg1) {
+ if (picture->picture_coding_type != D_TYPE)
+ get_mpeg1_intra_block (picture);
+ } else if (picture->intra_vlc_format)
+ get_intra_block_B15 (picture);
+ else
+ get_intra_block_B14 (picture);
+ mpeg2_idct_copy (picture->DCTblock, dest, stride);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline void slice_non_intra_DCT (picture_t * picture, uint8_t * dest,
+ int stride)
+{
+ if (picture->mpeg1)
+ get_mpeg1_non_intra_block (picture);
+ else
+ get_non_intra_block (picture);
+ mpeg2_idct_add (picture->DCTblock, dest, stride);
+}
+
+#define MOTION(table,ref,motion_x,motion_y,size,y) \
+ pos_x = 2 * picture->offset + motion_x; \
+ pos_y = 2 * picture->v_offset + motion_y + 2 * y; \
+ if (pos_x > picture->limit_x) { \
+ pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x; \
+ motion_x = pos_x - 2 * picture->offset; \
+ } \
+ if (pos_y > picture->limit_y_ ## size){ \
+ pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y_ ## size; \
+ motion_y = pos_y - 2 * picture->v_offset - 2 * y; \
+ } \
+ xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \
+ table[xy_half] (picture->dest[0] + y * picture->pitches[0] + \
+ picture->offset, ref[0] + (pos_x >> 1) + \
+ (pos_y >> 1) * picture->pitches[0], picture->pitches[0], \
+ size); \
+ motion_x /= 2; motion_y /= 2; \
+ xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \
+ table[4+xy_half] (picture->dest[1] + y/2 * picture->pitches[1] + \
+ (picture->offset >> 1), ref[1] + \
+ (((picture->offset + motion_x) >> 1) + \
+ ((((picture->v_offset + motion_y) >> 1) + y/2) * \
+ picture->pitches[1])), picture->pitches[1], size/2); \
+ table[4+xy_half] (picture->dest[2] + y/2 * picture->pitches[2] + \
+ (picture->offset >> 1), ref[2] + \
+ (((picture->offset + motion_x) >> 1) + \
+ ((((picture->v_offset + motion_y) >> 1) + y/2) * \
+ picture->pitches[2])), picture->pitches[2], size/2) \
+
+#define MOTION_FIELD(table,ref,motion_x,motion_y,dest_field,op,src_field) \
+ pos_x = 2 * picture->offset + motion_x; \
+ pos_y = picture->v_offset + motion_y; \
+ if (pos_x > picture->limit_x) { \
+ pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x; \
+ motion_x = pos_x - 2 * picture->offset; \
+ } \
+ if (pos_y > picture->limit_y){ \
+ pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y; \
+ motion_y = pos_y - picture->v_offset; \
+ } \
+ xy_half = ((pos_y & 1) << 1) | (pos_x & 1); \
+ table[xy_half] (picture->dest[0] + dest_field * picture->pitches[0] + \
+ picture->offset, \
+ (ref[0] + (pos_x >> 1) + \
+ ((pos_y op) + src_field) * picture->pitches[0]), \
+ 2 * picture->pitches[0], 8); \
+ motion_x /= 2; motion_y /= 2; \
+ xy_half = ((motion_y & 1) << 1) | (motion_x & 1); \
+ table[4+xy_half] (picture->dest[1] + dest_field * picture->pitches[1] + \
+ (picture->offset >> 1), ref[1] + \
+ (((picture->offset + motion_x) >> 1) + \
+ (((picture->v_offset >> 1) + \
+ (motion_y op) + src_field) * picture->pitches[1])), \
+ 2 * picture->pitches[1], 4); \
+ table[4+xy_half] (picture->dest[2] + dest_field * picture->pitches[2] + \
+ (picture->offset >> 1), ref[2] + \
+ (((picture->offset + motion_x) >> 1) + \
+ (((picture->v_offset >> 1) + \
+ (motion_y op) + src_field) * picture->pitches[2])), \
+ 2 * picture->pitches[2], 4)
+
+static void motion_mp1 (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+ unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = (motion->pmv[0][0] +
+ (get_motion_delta (picture,
+ motion->f_code[0]) << motion->f_code[1]));
+ motion_x = bound_motion_vector (motion_x,
+ motion->f_code[0] + motion->f_code[1]);
+ motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = (motion->pmv[0][1] +
+ (get_motion_delta (picture,
+ motion->f_code[0]) << motion->f_code[1]));
+ motion_y = bound_motion_vector (motion_y,
+ motion->f_code[0] + motion->f_code[1]);
+ motion->pmv[0][1] = motion_y;
+
+ MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fr_frame (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+ unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = motion->pmv[0][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[0][1] + get_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
+
+ MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fr_field (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y, field;
+ unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ field = UBITS (bit_buf, 1);
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[0][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = (motion->pmv[0][1] >> 1) + get_motion_delta (picture,
+ motion->f_code[1]);
+ /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
+ motion->pmv[0][1] = motion_y << 1;
+
+ MOTION_FIELD (table, motion->ref[0], motion_x, motion_y, 0, & ~1, field);
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ field = UBITS (bit_buf, 1);
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[1][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = (motion->pmv[1][1] >> 1) + get_motion_delta (picture,
+ motion->f_code[1]);
+ /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
+ motion->pmv[1][1] = motion_y << 1;
+
+ MOTION_FIELD (table, motion->ref[0], motion_x, motion_y, 1, & ~1, field);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fr_dmv (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y, dmv_x, dmv_y, m, other_x, other_y;
+ unsigned int pos_x, pos_y, xy_half, offset;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = motion->pmv[0][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ dmv_x = get_dmv (picture);
+
+ motion_y = (motion->pmv[0][1] >> 1) + get_motion_delta (picture,
+ motion->f_code[1]);
+ /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y << 1;
+ dmv_y = get_dmv (picture);
+
+ m = picture->top_field_first ? 1 : 3;
+ other_x = ((motion_x * m + (motion_x > 0)) >> 1) + dmv_x;
+ other_y = ((motion_y * m + (motion_y > 0)) >> 1) + dmv_y - 1;
+ MOTION_FIELD (mpeg2_mc.put, motion->ref[0], other_x, other_y, 0, | 1, 0);
+
+ m = picture->top_field_first ? 3 : 1;
+ other_x = ((motion_x * m + (motion_x > 0)) >> 1) + dmv_x;
+ other_y = ((motion_y * m + (motion_y > 0)) >> 1) + dmv_y + 1;
+ MOTION_FIELD (mpeg2_mc.put, motion->ref[0], other_x, other_y, 1, & ~1, 0);
+
+ pos_x = 2 * picture->offset + motion_x;
+ pos_y = picture->v_offset + motion_y;
+ if(pos_x > picture->limit_x){
+ pos_x = ((int)pos_x < 0) ? 0 : picture->limit_x;
+ motion_x = pos_x - 2 * picture->offset;
+ }
+ if(pos_y > picture->limit_y){
+ pos_y = ((int)pos_y < 0) ? 0 : picture->limit_y;
+ motion_y = pos_y - picture->v_offset;
+ }
+ xy_half = ((pos_y & 1) << 1) | (pos_x & 1);
+ offset = (pos_x >> 1) + (pos_y & ~1) * picture->pitches[0];
+ mpeg2_mc.avg[xy_half]
+ (picture->dest[0] + picture->offset,
+ motion->ref[0][0] + offset, 2 * picture->pitches[0], 8);
+ mpeg2_mc.avg[xy_half]
+ (picture->dest[0] + picture->pitches[0] + picture->offset,
+ motion->ref[0][0] + picture->pitches[0] + offset,
+ 2 * picture->pitches[0], 8);
+ motion_x /= 2; motion_y /= 2;
+ xy_half = ((motion_y & 1) << 1) | (motion_x & 1);
+ offset = (((picture->offset + motion_x) >> 1) +
+ (((picture->v_offset >> 1) + (motion_y & ~1)) *
+ picture->pitches[1]));
+ mpeg2_mc.avg[4+xy_half]
+ (picture->dest[1] + (picture->offset >> 1),
+ motion->ref[0][1] + offset, 2 * picture->pitches[1], 4);
+ mpeg2_mc.avg[4+xy_half]
+ (picture->dest[1] + picture->pitches[1] + (picture->offset >> 1),
+ motion->ref[0][1] + picture->pitches[1] + offset,
+ 2 * picture->pitches[1], 4);
+ offset = (((picture->offset + motion_x) >> 1) +
+ (((picture->v_offset >> 1) + (motion_y & ~1)) *
+ picture->pitches[2]));
+ mpeg2_mc.avg[4+xy_half]
+ (picture->dest[2] + (picture->offset >> 1),
+ motion->ref[0][2] + offset, 2 * picture->pitches[2], 4);
+ mpeg2_mc.avg[4+xy_half]
+ (picture->dest[2] + picture->pitches[2] + (picture->offset >> 1),
+ motion->ref[0][2] + picture->pitches[2] + offset,
+ 2 * picture->pitches[2], 4);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_reuse (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+ int motion_x, motion_y;
+ unsigned int pos_x, pos_y, xy_half;
+
+ motion_x = motion->pmv[0][0];
+ motion_y = motion->pmv[0][1];
+
+ MOTION (table, motion->ref[0], motion_x, motion_y, 16, 0);
+}
+
+static void motion_zero (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+ table[0] (picture->dest[0] + picture->offset,
+ (motion->ref[0][0] + picture->offset +
+ picture->v_offset * picture->pitches[0]),
+ picture->pitches[0], 16);
+
+ table[4] (picture->dest[1] + (picture->offset >> 1),
+ motion->ref[0][1] + (picture->offset >> 1) +
+ (picture->v_offset >> 1) * picture->pitches[1],
+ picture->pitches[1], 8);
+ table[4] (picture->dest[2] + (picture->offset >> 1),
+ motion->ref[0][2] + (picture->offset >> 1) +
+ (picture->v_offset >> 1) * picture->pitches[2],
+ picture->pitches[2], 8);
+}
+
+/* like motion_frame, but parsing without actual motion compensation */
+static void motion_fr_conceal (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ tmp = (picture->f_motion.pmv[0][0] +
+ get_motion_delta (picture, picture->f_motion.f_code[0]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ tmp = (picture->f_motion.pmv[0][1] +
+ get_motion_delta (picture, picture->f_motion.f_code[1]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
+ picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
+
+ DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_field (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+ uint8_t ** ref_field;
+ unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ ref_field = motion->ref2[UBITS (bit_buf, 1)];
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[0][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[0][1] + get_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
+
+ MOTION (table, ref_field, motion_x, motion_y, 16, 0);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_16x8 (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+ uint8_t ** ref_field;
+ unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ ref_field = motion->ref2[UBITS (bit_buf, 1)];
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[0][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[0][1] + get_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[0][1] = motion_y;
+
+ MOTION (table, ref_field, motion_x, motion_y, 8, 0);
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ ref_field = motion->ref2[UBITS (bit_buf, 1)];
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[1][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[1][1] + get_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion_y;
+
+ MOTION (table, ref_field, motion_x, motion_y, 8, 8);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_dmv (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y, other_x, other_y;
+ unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = motion->pmv[0][0] + get_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ other_x = ((motion_x + (motion_x > 0)) >> 1) + get_dmv (picture);
+
+ motion_y = motion->pmv[0][1] + get_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
+ other_y = (((motion_y + (motion_y > 0)) >> 1) + get_dmv (picture) +
+ picture->dmv_offset);
+
+ MOTION (mpeg2_mc.put, motion->ref[0], motion_x, motion_y, 16, 0);
+ MOTION (mpeg2_mc.avg, motion->ref[1], other_x, other_y, 16, 0);
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_conceal (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ DUMPBITS (bit_buf, bits, 1); /* remove field_select */
+
+ tmp = (picture->f_motion.pmv[0][0] +
+ get_motion_delta (picture, picture->f_motion.f_code[0]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ tmp = (picture->f_motion.pmv[0][1] +
+ get_motion_delta (picture, picture->f_motion.f_code[1]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
+ picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
+
+ DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+#define MOTION_CALL(routine,direction) \
+do { \
+ if ((direction) & MACROBLOCK_MOTION_FORWARD) \
+ routine (picture, &(picture->f_motion), mpeg2_mc.put); \
+ if ((direction) & MACROBLOCK_MOTION_BACKWARD) \
+ routine (picture, &(picture->b_motion), \
+ ((direction) & MACROBLOCK_MOTION_FORWARD ? \
+ mpeg2_mc.avg : mpeg2_mc.put)); \
+} while (0)
+
+#define NEXT_MACROBLOCK \
+do { \
+ picture->offset += 16; \
+ if (picture->offset == picture->coded_picture_width) { \
+ do { /* just so we can use the break statement */ \
+ if (picture->current_frame->proc_slice) { \
+ picture->current_frame->proc_slice (picture->current_frame, \
+ picture->dest); \
+ } \
+ picture->dest[0] += 16 * picture->pitches[0]; \
+ picture->dest[1] += 8 * picture->pitches[1]; \
+ picture->dest[2] += 8 * picture->pitches[2]; \
+ } while (0); \
+ picture->v_offset += 16; \
+ if (picture->v_offset > picture->limit_y) { \
+ if (mpeg2_cpu_state_restore) \
+ mpeg2_cpu_state_restore (&cpu_state); \
+ return; \
+ } \
+ picture->offset = 0; \
+ } \
+} while (0)
+
+static inline int slice_init (picture_t * picture, int code)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int offset, height;
+ struct vo_frame_s * forward_reference_frame;
+ struct vo_frame_s * backward_reference_frame;
+ const MBAtab * mba;
+
+ offset = picture->picture_structure == BOTTOM_FIELD;
+ picture->pitches[0] = picture->current_frame->pitches[0];
+ picture->pitches[1] = picture->current_frame->pitches[1];
+ picture->pitches[2] = picture->current_frame->pitches[2];
+
+ if( picture->forward_reference_frame ) {
+ forward_reference_frame = picture->forward_reference_frame;
+ }
+ else {
+ /* return 1; */
+ forward_reference_frame = picture->current_frame;
+ }
+
+ if( picture->backward_reference_frame ) {
+ backward_reference_frame = picture->backward_reference_frame;
+ }
+ else {
+ /* return 1; */
+ backward_reference_frame = picture->current_frame;
+ }
+
+ picture->f_motion.ref[0][0] =
+ forward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
+ picture->f_motion.ref[0][1] =
+ forward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
+ picture->f_motion.ref[0][2] =
+ forward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
+
+ picture->b_motion.ref[0][0] =
+ backward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
+ picture->b_motion.ref[0][1] =
+ backward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
+ picture->b_motion.ref[0][2] =
+ backward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
+
+ if (picture->picture_structure != FRAME_PICTURE) {
+ uint8_t ** forward_ref;
+ int bottom_field;
+
+ bottom_field = (picture->picture_structure == BOTTOM_FIELD);
+ picture->dmv_offset = bottom_field ? 1 : -1;
+ picture->f_motion.ref2[0] = picture->f_motion.ref[bottom_field];
+ picture->f_motion.ref2[1] = picture->f_motion.ref[!bottom_field];
+ picture->b_motion.ref2[0] = picture->b_motion.ref[bottom_field];
+ picture->b_motion.ref2[1] = picture->b_motion.ref[!bottom_field];
+
+ forward_ref = forward_reference_frame->base;
+ if (picture->second_field && (picture->picture_coding_type != B_TYPE))
+ forward_ref = picture->current_frame->base;
+
+ picture->f_motion.ref[1][0] = forward_ref[0] + (bottom_field ? 0 : picture->pitches[0]);
+ picture->f_motion.ref[1][1] = forward_ref[1] + (bottom_field ? 0 : picture->pitches[1]);
+ picture->f_motion.ref[1][2] = forward_ref[2] + (bottom_field ? 0 : picture->pitches[2]);
+
+ picture->b_motion.ref[1][0] =
+ backward_reference_frame->base[0] + (bottom_field ? 0 : picture->pitches[0]);
+ picture->b_motion.ref[1][1] =
+ backward_reference_frame->base[1] + (bottom_field ? 0 : picture->pitches[1]);
+ picture->b_motion.ref[1][2] =
+ backward_reference_frame->base[2] + (bottom_field ? 0 : picture->pitches[2]);
+ }
+
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+ picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
+ picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
+
+ picture->v_offset = (code - 1) * 16;
+ offset = (code - 1);
+ if (picture->picture_structure != FRAME_PICTURE)
+ offset = 2 * offset;
+
+ picture->dest[0] = picture->current_frame->base[0] + picture->pitches[0] * offset * 16;
+ picture->dest[1] = picture->current_frame->base[1] + picture->pitches[1] * offset * 8;
+ picture->dest[2] = picture->current_frame->base[2] + picture->pitches[2] * offset * 8;
+
+ height = picture->coded_picture_height;
+ switch (picture->picture_structure) {
+ case BOTTOM_FIELD:
+ picture->dest[0] += picture->pitches[0];
+ picture->dest[1] += picture->pitches[1];
+ picture->dest[2] += picture->pitches[2];
+ /* follow thru */
+ case TOP_FIELD:
+ picture->pitches[0] <<= 1;
+ picture->pitches[1] <<= 1;
+ picture->pitches[2] <<= 1;
+ height >>= 1;
+ }
+ picture->limit_x = 2 * picture->coded_picture_width - 32;
+ picture->limit_y_16 = 2 * height - 32;
+ picture->limit_y_8 = 2 * height - 16;
+ picture->limit_y = height - 16;
+
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 1 << (picture->intra_dc_precision + 7);
+
+ picture->quantizer_scale = get_quantizer_scale (picture);
+
+ /* ignore intra_slice and all the extra data */
+ while (bit_buf & 0x80000000) {
+ DUMPBITS (bit_buf, bits, 9);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ }
+
+ /* decode initial macroblock address increment */
+ offset = 0;
+ while (1) {
+ if (bit_buf >= 0x08000000) {
+ mba = MBA_5 + (UBITS (bit_buf, 6) - 2);
+ break;
+ } else if (bit_buf >= 0x01800000) {
+ mba = MBA_11 + (UBITS (bit_buf, 12) - 24);
+ break;
+ } else switch (UBITS (bit_buf, 12)) {
+ case 8: /* macroblock_escape */
+ offset += 33;
+ DUMPBITS (bit_buf, bits, 11);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ continue;
+ case 15: /* macroblock_stuffing (MPEG1 only) */
+ bit_buf &= 0xfffff;
+ DUMPBITS (bit_buf, bits, 11);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ continue;
+ default: /* error */
+ return 1;
+ }
+ }
+ DUMPBITS (bit_buf, bits, mba->len + 1);
+ picture->offset = (offset + mba->mba) << 4;
+
+ while (picture->offset - picture->coded_picture_width >= 0) {
+ picture->offset -= picture->coded_picture_width;
+ if ((picture->current_frame->proc_slice == NULL) ||
+ (picture->picture_coding_type != B_TYPE)) {
+ picture->dest[0] += 16 * picture->pitches[0];
+ picture->dest[1] += 8 * picture->pitches[1];
+ picture->dest[2] += 8 * picture->pitches[2];
+ }
+ picture->v_offset += 16;
+ }
+ if (picture->v_offset > picture->limit_y)
+ return 1;
+
+ return 0;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+void mpeg2_slice (picture_t * picture, int code, uint8_t * buffer)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ cpu_state_t cpu_state;
+
+ bitstream_init (picture, buffer);
+
+ if (slice_init (picture, code))
+ return;
+
+ if (mpeg2_cpu_state_save)
+ mpeg2_cpu_state_save (&cpu_state);
+
+ while (1) {
+ int macroblock_modes;
+ int mba_inc;
+ const MBAtab * mba;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ macroblock_modes = get_macroblock_modes (picture);
+
+ /* maybe integrate MACROBLOCK_QUANT test into get_macroblock_modes ? */
+ if (macroblock_modes & MACROBLOCK_QUANT)
+ picture->quantizer_scale = get_quantizer_scale (picture);
+
+ if (macroblock_modes & MACROBLOCK_INTRA) {
+
+ int DCT_offset, DCT_stride;
+ int offset;
+ uint8_t * dest_y;
+
+ if (picture->concealment_motion_vectors) {
+ if (picture->picture_structure == FRAME_PICTURE)
+ motion_fr_conceal (picture);
+ else
+ motion_fi_conceal (picture);
+ } else {
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+ picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
+ picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
+ }
+
+ if (macroblock_modes & DCT_TYPE_INTERLACED) {
+ DCT_offset = picture->pitches[0];
+ DCT_stride = picture->pitches[0] * 2;
+ } else {
+ DCT_offset = picture->pitches[0] * 8;
+ DCT_stride = picture->pitches[0];
+ }
+
+ offset = picture->offset;
+ dest_y = picture->dest[0] + offset;
+ slice_intra_DCT (picture, 0, dest_y, DCT_stride);
+ slice_intra_DCT (picture, 0, dest_y + 8, DCT_stride);
+ slice_intra_DCT (picture, 0, dest_y + DCT_offset, DCT_stride);
+ slice_intra_DCT (picture, 0, dest_y + DCT_offset + 8, DCT_stride);
+ slice_intra_DCT (picture, 1, picture->dest[1] + (offset >> 1),
+ picture->pitches[1]);
+ slice_intra_DCT (picture, 2, picture->dest[2] + (offset >> 1),
+ picture->pitches[2]);
+
+ if (picture->picture_coding_type == D_TYPE) {
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ DUMPBITS (bit_buf, bits, 1);
+ }
+ } else {
+
+ if (picture->picture_structure == FRAME_PICTURE)
+ switch (macroblock_modes & MOTION_TYPE_MASK) {
+ case MC_FRAME:
+ if (picture->mpeg1)
+ MOTION_CALL (motion_mp1, macroblock_modes);
+ else
+ MOTION_CALL (motion_fr_frame, macroblock_modes);
+ break;
+
+ case MC_FIELD:
+ MOTION_CALL (motion_fr_field, macroblock_modes);
+ break;
+
+ case MC_DMV:
+ MOTION_CALL (motion_fr_dmv, MACROBLOCK_MOTION_FORWARD);
+ break;
+
+ case 0:
+ /* non-intra mb without forward mv in a P picture */
+ picture->f_motion.pmv[0][0] = 0;
+ picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = 0;
+ picture->f_motion.pmv[1][1] = 0;
+ MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
+ break;
+ }
+ else
+ switch (macroblock_modes & MOTION_TYPE_MASK) {
+ case MC_FIELD:
+ MOTION_CALL (motion_fi_field, macroblock_modes);
+ break;
+
+ case MC_16X8:
+ MOTION_CALL (motion_fi_16x8, macroblock_modes);
+ break;
+
+ case MC_DMV:
+ MOTION_CALL (motion_fi_dmv, MACROBLOCK_MOTION_FORWARD);
+ break;
+
+ case 0:
+ /* non-intra mb without forward mv in a P picture */
+ picture->f_motion.pmv[0][0] = 0;
+ picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = 0;
+ picture->f_motion.pmv[1][1] = 0;
+ MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
+ break;
+ }
+
+ if (macroblock_modes & MACROBLOCK_PATTERN) {
+ int coded_block_pattern;
+ int DCT_offset, DCT_stride;
+ int offset;
+ uint8_t * dest_y;
+
+ if (macroblock_modes & DCT_TYPE_INTERLACED) {
+ DCT_offset = picture->pitches[0];
+ DCT_stride = picture->pitches[0] * 2;
+ } else {
+ DCT_offset = picture->pitches[0] * 8;
+ DCT_stride = picture->pitches[0];
+ }
+
+ coded_block_pattern = get_coded_block_pattern (picture);
+
+ offset = picture->offset;
+ dest_y = picture->dest[0] + offset;
+ if (coded_block_pattern & 0x20)
+ slice_non_intra_DCT (picture, dest_y, DCT_stride);
+ if (coded_block_pattern & 0x10)
+ slice_non_intra_DCT (picture, dest_y + 8, DCT_stride);
+ if (coded_block_pattern & 0x08)
+ slice_non_intra_DCT (picture, dest_y + DCT_offset,
+ DCT_stride);
+ if (coded_block_pattern & 0x04)
+ slice_non_intra_DCT (picture, dest_y + DCT_offset + 8,
+ DCT_stride);
+ if (coded_block_pattern & 0x2)
+ slice_non_intra_DCT (picture,
+ picture->dest[1] + (offset >> 1),
+ picture->pitches[1]);
+ if (coded_block_pattern & 0x1)
+ slice_non_intra_DCT (picture,
+ picture->dest[2] + (offset >> 1),
+ picture->pitches[2]);
+ }
+
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
+ }
+
+ NEXT_MACROBLOCK;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ mba_inc = 0;
+ while (1) {
+ if (bit_buf >= 0x10000000) {
+ mba = MBA_5 + (UBITS (bit_buf, 5) - 2);
+ break;
+ } else if (bit_buf >= 0x03000000) {
+ mba = MBA_11 + (UBITS (bit_buf, 11) - 24);
+ break;
+ } else switch (UBITS (bit_buf, 11)) {
+ case 8: /* macroblock_escape */
+ mba_inc += 33;
+ /* pass through */
+ case 15: /* macroblock_stuffing (MPEG1 only) */
+ DUMPBITS (bit_buf, bits, 11);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ continue;
+ default: /* end of slice, or error */
+ if (mpeg2_cpu_state_restore)
+ mpeg2_cpu_state_restore (&cpu_state);
+ return;
+ }
+ }
+ DUMPBITS (bit_buf, bits, mba->len);
+ mba_inc += mba->mba;
+
+ if (mba_inc) {
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
+
+ if (picture->picture_coding_type == P_TYPE) {
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+
+ do {
+ MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
+ NEXT_MACROBLOCK;
+ } while (--mba_inc);
+ } else {
+ do {
+ MOTION_CALL (motion_reuse, macroblock_modes);
+ NEXT_MACROBLOCK;
+ } while (--mba_inc);
+ }
+ }
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
diff --git a/src/video_dec/libmpeg2/slice_xvmc.c b/src/video_dec/libmpeg2/slice_xvmc.c
new file mode 100644
index 000000000..014ae7924
--- /dev/null
+++ b/src/video_dec/libmpeg2/slice_xvmc.c
@@ -0,0 +1,1988 @@
+/*
+ * slice_xvmc.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 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 <string.h> /* memcpy/memset, try to remove */
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include "mpeg2_internal.h"
+#include <xine/xineutils.h>
+
+#include <xine/attributes.h>
+#include "accel_xvmc.h"
+#include "xvmc.h"
+
+
+#define MOTION_ACCEL XINE_VO_MOTION_ACCEL
+#define IDCT_ACCEL XINE_VO_IDCT_ACCEL
+#define SIGNED_INTRA XINE_VO_SIGNED_INTRA
+#define ACCEL (MOTION_ACCEL | IDCT_ACCEL)
+
+#include "vlc.h"
+/* original (non-patched) scan tables */
+
+static const uint8_t mpeg2_scan_norm_orig[64] ATTR_ALIGN(16) =
+{
+ /* Zig-Zag scan pattern */
+ 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
+};
+
+static const uint8_t mpeg2_scan_alt_orig[64] ATTR_ALIGN(16) =
+{
+ /* Alternate scan pattern */
+ 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
+};
+
+static uint8_t mpeg2_scan_alt_ptable[64] ATTR_ALIGN(16);
+static uint8_t mpeg2_scan_norm_ptable[64] ATTR_ALIGN(16);
+static uint8_t mpeg2_scan_orig_ptable[64] ATTR_ALIGN(16);
+
+void xvmc_setup_scan_ptable( void )
+{
+ int i;
+ for (i=0; i<64; ++i) {
+ mpeg2_scan_norm_ptable[mpeg2_scan_norm_orig[i]] = mpeg2_scan_norm[i];
+ mpeg2_scan_alt_ptable[mpeg2_scan_alt_orig[i]] = mpeg2_scan_alt[i];
+ mpeg2_scan_orig_ptable[i] = i;
+ }
+}
+
+
+static const int non_linear_quantizer_scale [] = {
+ 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
+};
+
+static inline int get_xvmc_macroblock_modes (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int macroblock_modes;
+ const MBtab * tab;
+
+ switch (picture->picture_coding_type) {
+ case I_TYPE:
+
+ tab = MB_I + UBITS (bit_buf, 1);
+ DUMPBITS (bit_buf, bits, tab->len);
+ macroblock_modes = tab->modes;
+
+ if ((! (picture->frame_pred_frame_dct)) &&
+ (picture->picture_structure == FRAME_PICTURE)) {
+ macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
+ DUMPBITS (bit_buf, bits, 1);
+ }
+
+ return macroblock_modes;
+
+ case P_TYPE:
+
+ tab = MB_P + UBITS (bit_buf, 5);
+ DUMPBITS (bit_buf, bits, tab->len);
+ macroblock_modes = tab->modes;
+
+ if (picture->picture_structure != FRAME_PICTURE) {
+ if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ }
+ return macroblock_modes;
+ } else if (picture->frame_pred_frame_dct) {
+ if (macroblock_modes & MACROBLOCK_MOTION_FORWARD)
+ macroblock_modes |= MC_FRAME;
+ return macroblock_modes;
+ } else {
+ if (macroblock_modes & MACROBLOCK_MOTION_FORWARD) {
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ }
+ if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
+ macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
+ DUMPBITS (bit_buf, bits, 1);
+ }
+ return macroblock_modes;
+ }
+
+ case B_TYPE:
+
+ tab = MB_B + UBITS (bit_buf, 6);
+ DUMPBITS (bit_buf, bits, tab->len);
+ macroblock_modes = tab->modes;
+
+ if (picture->picture_structure != FRAME_PICTURE) {
+ if (! (macroblock_modes & MACROBLOCK_INTRA)) {
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ }
+ return macroblock_modes;
+ } else if (picture->frame_pred_frame_dct) {
+ /* if (! (macroblock_modes & MACROBLOCK_INTRA)) */
+ macroblock_modes |= MC_FRAME;
+ return macroblock_modes;
+ } else {
+ if (macroblock_modes & MACROBLOCK_INTRA)
+ goto intra;
+ macroblock_modes |= UBITS (bit_buf, 2) * MOTION_TYPE_BASE;
+ DUMPBITS (bit_buf, bits, 2);
+ if (macroblock_modes & (MACROBLOCK_INTRA | MACROBLOCK_PATTERN)) {
+ intra:
+ macroblock_modes |= UBITS (bit_buf, 1) * DCT_TYPE_INTERLACED;
+ DUMPBITS (bit_buf, bits, 1);
+ }
+ return macroblock_modes;
+ }
+
+ case D_TYPE:
+
+ DUMPBITS (bit_buf, bits, 1);
+ return MACROBLOCK_INTRA;
+
+ default:
+ return 0;
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_xvmc_quantizer_scale (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ int quantizer_scale_code;
+
+ quantizer_scale_code = UBITS (bit_buf, 5);
+ DUMPBITS (bit_buf, bits, 5);
+
+ if (picture->q_scale_type)
+ return non_linear_quantizer_scale [quantizer_scale_code];
+ else
+ return quantizer_scale_code << 1;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_xvmc_motion_delta (picture_t * picture, int f_code)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ int delta;
+ int sign;
+ const MVtab * tab;
+
+ if (bit_buf & 0x80000000) {
+ DUMPBITS (bit_buf, bits, 1);
+ return 0;
+ } else if (bit_buf >= 0x0c000000) {
+
+ tab = MV_4 + UBITS (bit_buf, 4);
+ delta = (tab->delta << f_code) + 1;
+ bits += tab->len + f_code + 1;
+ bit_buf <<= tab->len;
+
+ sign = SBITS (bit_buf, 1);
+ bit_buf <<= 1;
+
+ if (f_code)
+ delta += UBITS (bit_buf, f_code);
+ bit_buf <<= f_code;
+
+ return (delta ^ sign) - sign;
+
+ } else {
+
+ tab = MV_10 + UBITS (bit_buf, 10);
+ delta = (tab->delta << f_code) + 1;
+ bits += tab->len + 1;
+ bit_buf <<= tab->len;
+
+ sign = SBITS (bit_buf, 1);
+ bit_buf <<= 1;
+
+ if (f_code) {
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ delta += UBITS (bit_buf, f_code);
+ DUMPBITS (bit_buf, bits, f_code);
+ }
+
+ return (delta ^ sign) - sign;
+
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int bound_motion_vector (int vec, int f_code)
+{
+#if 1
+ unsigned int limit;
+ int sign;
+
+ limit = 16 << f_code;
+
+ if ((unsigned int)(vec + limit) < 2 * limit)
+ return vec;
+ else {
+ sign = ((int32_t)vec) >> 31;
+ return vec - ((2 * limit) ^ sign) + sign;
+ }
+#else
+ return ((int32_t)vec << (27 - f_code)) >> (27 - f_code);
+#endif
+}
+
+static inline int get_xvmc_dmv (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ const DMVtab * tab;
+
+ tab = DMV_2 + UBITS (bit_buf, 2);
+ DUMPBITS (bit_buf, bits, tab->len);
+ return tab->dmv;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_xvmc_coded_block_pattern (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+
+ const CBPtab * tab;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ if (bit_buf >= 0x20000000) {
+
+ tab = CBP_7 + (UBITS (bit_buf, 7) - 16);
+ DUMPBITS (bit_buf, bits, tab->len);
+ return tab->cbp;
+
+ } else {
+
+ tab = CBP_9 + UBITS (bit_buf, 9);
+ DUMPBITS (bit_buf, bits, tab->len);
+ return tab->cbp;
+ }
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_xvmc_luma_dc_dct_diff (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ const DCtab * tab;
+ int size;
+ int dc_diff;
+
+ if (bit_buf < 0xf8000000) {
+ tab = DC_lum_5 + UBITS (bit_buf, 5);
+ size = tab->size;
+ if (size) {
+ bits += tab->len + size;
+ bit_buf <<= tab->len;
+ dc_diff =
+ UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ bit_buf <<= size;
+ return dc_diff;
+ } else {
+ DUMPBITS (bit_buf, bits, 3);
+ return 0;
+ }
+ } else {
+ tab = DC_long + (UBITS (bit_buf, 9) - 0x1e0);
+ size = tab->size;
+ DUMPBITS (bit_buf, bits, tab->len);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ DUMPBITS (bit_buf, bits, size);
+ return dc_diff;
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline int get_xvmc_chroma_dc_dct_diff (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ const DCtab * tab;
+ int size;
+ int dc_diff;
+
+ if (bit_buf < 0xf8000000) {
+ tab = DC_chrom_5 + UBITS (bit_buf, 5);
+ size = tab->size;
+ if (size) {
+ bits += tab->len + size;
+ bit_buf <<= tab->len;
+ dc_diff =
+ UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ bit_buf <<= size;
+ return dc_diff;
+ } else {
+ DUMPBITS (bit_buf, bits, 2);
+ return 0;
+ }
+ } else {
+ tab = DC_long + (UBITS (bit_buf, 10) - 0x3e0);
+ size = tab->size;
+ DUMPBITS (bit_buf, bits, tab->len + 1);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ dc_diff = UBITS (bit_buf, size) - UBITS (SBITS (~bit_buf, 1), size);
+ DUMPBITS (bit_buf, bits, size);
+ return dc_diff;
+ }
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+#define SATURATE(val) \
+do { \
+ if ((uint32_t)(val + 2048) > 4095) \
+ val = (val > 0) ? 2047 : -2048; \
+} while (0)
+
+static void get_xvmc_intra_block_B14 (picture_t * picture)
+{
+ int i;
+ int j;
+ int l;
+ int val;
+ const uint8_t * scan = picture->scan;
+ uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
+ uint8_t * quant_matrix = picture->intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ int mismatch;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ dest = picture->mc->blockptr;
+
+ if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
+ if ( scan == mpeg2_scan_norm ) {
+ scan = mpeg2_scan_norm_orig;
+ scan_ptable = mpeg2_scan_norm_ptable;
+ } else {
+ scan = mpeg2_scan_alt_orig;
+ scan_ptable = mpeg2_scan_alt_ptable;
+ }
+ }
+
+ i = 0;
+ mismatch = ~dest[0];
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ l = scan_ptable[j = scan[i]];
+
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = (tab->level * quantizer_scale * quant_matrix[l]) >> 4;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ l = scan_ptable[j = scan[i]];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = (SBITS (bit_buf, 12) *
+ quantizer_scale * quant_matrix[l]) / 16;
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+
+ dest[63] ^= mismatch & 1;
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_xvmc_intra_block_B15 (picture_t * picture)
+{
+ int i;
+ int j;
+ int l;
+ int val;
+ const uint8_t * scan = picture->scan;
+ uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
+ uint8_t * quant_matrix = picture->intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ int mismatch;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ dest = picture->mc->blockptr;
+
+ if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
+ if ( scan == mpeg2_scan_norm ) {
+ scan = mpeg2_scan_norm_orig;
+ scan_ptable = mpeg2_scan_norm_ptable;
+ } else {
+ scan = mpeg2_scan_alt_orig;
+ scan_ptable = mpeg2_scan_alt_ptable;
+ }
+ }
+
+ i = 0;
+ mismatch = ~dest[0];
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ while (1) {
+ if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B15_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64) {
+
+ normal_code:
+ l = scan_ptable[j = scan[i]];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = (tab->level * quantizer_scale * quant_matrix[l]) >> 4;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else {
+
+ /* end of block. I commented out this code because if we */
+ /* dont exit here we will still exit at the later test :) */
+
+ /* if (i >= 128) break; */ /* end of block */
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check against buffer overflow */
+
+ l = scan_ptable[j = scan[i]];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = (SBITS (bit_buf, 12) *
+ quantizer_scale * quant_matrix[l]) / 16;
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ }
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B15_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+
+ dest[63] ^= mismatch & 1;
+ DUMPBITS (bit_buf, bits, 4); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_xvmc_non_intra_block (picture_t * picture)
+{
+ int i;
+ int j;
+ int l;
+ int val;
+ const uint8_t * scan = picture->scan;
+ uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
+ uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ int mismatch;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ i = -1;
+ mismatch = 1;
+
+ dest = picture->mc->blockptr;
+
+ if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
+ if ( scan == mpeg2_scan_norm ) {
+ scan = mpeg2_scan_norm_orig;
+ scan_ptable = mpeg2_scan_norm_ptable;
+ } else {
+ scan = mpeg2_scan_alt_orig;
+ scan_ptable = mpeg2_scan_alt_ptable;
+ }
+ }
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ if (bit_buf >= 0x28000000) {
+ tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
+ goto entry_1;
+ } else
+ goto entry_2;
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ entry_1:
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ l = scan_ptable[j = scan[i]];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = ((2*tab->level+1) * quantizer_scale * quant_matrix[l]) >> 5;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ }
+
+ entry_2:
+ if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ l = scan_ptable[j = scan[i]];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = 2 * (SBITS (bit_buf, 12) + SBITS (bit_buf, 1)) + 1;
+ val = (val * quantizer_scale * quant_matrix[l]) / 32;
+
+ SATURATE (val);
+ dest[j] = val;
+ mismatch ^= val;
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ dest[63] ^= mismatch & 1;
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_xvmc_mpeg1_intra_block (picture_t * picture)
+{
+ int i;
+ int j;
+ int l;
+ int val;
+ const uint8_t * scan = picture->scan;
+ uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
+ uint8_t * quant_matrix = picture->intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ i = 0;
+
+ dest = picture->mc->blockptr;
+
+ if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
+ if ( scan == mpeg2_scan_norm ) {
+ scan = mpeg2_scan_norm_orig;
+ scan_ptable = mpeg2_scan_norm_ptable;
+ } else {
+ scan = mpeg2_scan_alt_orig;
+ scan_ptable = mpeg2_scan_alt_ptable;
+ }
+ }
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ l = scan_ptable[j = scan[i]];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = (tab->level * quantizer_scale * quant_matrix[l]) >> 4;
+
+ /* oddification */
+ val = (val - 1) | 1;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ l = scan_ptable[j = scan[i]];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = SBITS (bit_buf, 8);
+ if (! (val & 0x7f)) {
+ DUMPBITS (bit_buf, bits, 8);
+ val = UBITS (bit_buf, 8) + 2 * val;
+ }
+ val = (val * quantizer_scale * quant_matrix[l]) / 16;
+
+ /* oddification */
+ val = (val + ~SBITS (val, 1)) | 1;
+
+ SATURATE (val);
+ dest[j] = val;
+
+ DUMPBITS (bit_buf, bits, 8);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static void get_xvmc_mpeg1_non_intra_block (picture_t * picture)
+{
+ int i;
+ int j;
+ int l;
+ int val;
+ const uint8_t * scan = picture->scan;
+ uint8_t * scan_ptable = mpeg2_scan_orig_ptable;
+ uint8_t * quant_matrix = picture->non_intra_quantizer_matrix;
+ int quantizer_scale = picture->quantizer_scale;
+ const DCTtab * tab;
+ uint32_t bit_buf;
+ int bits;
+ uint8_t * bit_ptr;
+ int16_t * dest;
+
+ i = -1;
+
+ dest = picture->mc->blockptr;
+
+ if( picture->mc->xvmc_accel & IDCT_ACCEL ) {
+ if ( scan == mpeg2_scan_norm ) {
+ scan = mpeg2_scan_norm_orig;
+ scan_ptable = mpeg2_scan_norm_ptable;
+ } else {
+ scan = mpeg2_scan_alt_orig;
+ scan_ptable = mpeg2_scan_alt_ptable;
+ }
+ }
+
+ bit_buf = picture->bitstream_buf;
+ bits = picture->bitstream_bits;
+ bit_ptr = picture->bitstream_ptr;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ if (bit_buf >= 0x28000000) {
+ tab = DCT_B14DC_5 + (UBITS (bit_buf, 5) - 5);
+ goto entry_1;
+ } else
+ goto entry_2;
+
+ while (1) {
+ if (bit_buf >= 0x28000000) {
+
+ tab = DCT_B14AC_5 + (UBITS (bit_buf, 5) - 5);
+
+ entry_1:
+ i += tab->run;
+ if (i >= 64)
+ break; /* end of block */
+
+ normal_code:
+ l = scan_ptable[j = scan[i]];
+ bit_buf <<= tab->len;
+ bits += tab->len + 1;
+ val = ((2*tab->level+1) * quantizer_scale * quant_matrix[l]) >> 5;
+
+ /* oddification */
+ val = (val - 1) | 1;
+
+ /* if (bitstream_get (1)) val = -val; */
+ val = (val ^ SBITS (bit_buf, 1)) - SBITS (bit_buf, 1);
+
+ SATURATE (val);
+ dest[j] = val;
+
+ bit_buf <<= 1;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ }
+
+ entry_2:
+ if (bit_buf >= 0x04000000) {
+
+ tab = DCT_B14_8 + (UBITS (bit_buf, 8) - 4);
+
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+
+ /* escape code */
+
+ i += UBITS (bit_buf << 6, 6) - 64;
+ if (i >= 64)
+ break; /* illegal, check needed to avoid buffer overflow */
+
+ l = scan_ptable[j = scan[i]];
+
+ DUMPBITS (bit_buf, bits, 12);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ val = SBITS (bit_buf, 8);
+ if (! (val & 0x7f)) {
+ DUMPBITS (bit_buf, bits, 8);
+ val = UBITS (bit_buf, 8) + 2 * val;
+ }
+ val = 2 * (val + SBITS (val, 1)) + 1;
+ val = (val * quantizer_scale * quant_matrix[l]) / 32;
+
+ /* oddification */
+ val = (val + ~SBITS (val, 1)) | 1;
+
+ SATURATE (val);
+ dest[j] = val;
+
+ DUMPBITS (bit_buf, bits, 8);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ continue;
+
+ } else if (bit_buf >= 0x02000000) {
+ tab = DCT_B14_10 + (UBITS (bit_buf, 10) - 8);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00800000) {
+ tab = DCT_13 + (UBITS (bit_buf, 13) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else if (bit_buf >= 0x00200000) {
+ tab = DCT_15 + (UBITS (bit_buf, 15) - 16);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ } else {
+ tab = DCT_16 + UBITS (bit_buf, 16);
+ bit_buf <<= 16;
+ GETWORD (bit_buf, bits + 16, bit_ptr);
+ i += tab->run;
+ if (i < 64)
+ goto normal_code;
+ }
+ break; /* illegal, check needed to avoid buffer overflow */
+ }
+ DUMPBITS (bit_buf, bits, 2); /* dump end of block code */
+ picture->bitstream_buf = bit_buf;
+ picture->bitstream_bits = bits;
+ picture->bitstream_ptr = bit_ptr;
+}
+
+static inline void slice_xvmc_intra_DCT (picture_t * picture, int cc,
+ uint8_t * dest, int stride)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ /* Get the intra DC coefficient and inverse quantize it */
+
+ // printf("slice: slice_xvmc_intra_DCT cc=%d pred[0]=%d\n",cc,picture->dc_dct_pred[0]);
+ if (cc == 0)
+ picture->dc_dct_pred[0] += get_xvmc_luma_dc_dct_diff (picture);
+ else
+ picture->dc_dct_pred[cc] += get_xvmc_chroma_dc_dct_diff (picture);
+ //TODO conversion to signed format
+ // printf("slice: pred[0]=%d presision=%d\n",picture->dc_dct_pred[0],
+ // picture->intra_dc_precision);
+
+ mpeg2_zero_block(picture->mc->blockptr);
+
+ picture->mc->blockptr[0] = picture->dc_dct_pred[cc] << (3 - picture->intra_dc_precision);
+
+ if (picture->mpeg1) {
+ if (picture->picture_coding_type != D_TYPE)
+ get_xvmc_mpeg1_intra_block (picture);
+ } else if (picture->intra_vlc_format)
+ get_xvmc_intra_block_B15 (picture);
+ else
+ get_xvmc_intra_block_B14 (picture);
+
+ if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) {
+ //motion_comp only no idct acceleration so do it in software
+ mpeg2_idct (picture->mc->blockptr);
+ }
+ picture->mc->blockptr += 64;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static inline void slice_xvmc_non_intra_DCT (picture_t * picture, uint8_t * dest,
+ int stride)
+{
+ mpeg2_zero_block(picture->mc->blockptr);
+
+ if (picture->mpeg1)
+ get_xvmc_mpeg1_non_intra_block (picture);
+ else
+ get_xvmc_non_intra_block (picture);
+
+ if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL) {
+ // motion comp only no idct acceleration so do it in sw
+ mpeg2_idct (picture->mc->blockptr);
+ }
+ picture->mc->blockptr += 64;
+}
+
+static void motion_mp1 (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = (motion->pmv[0][0] +
+ (get_xvmc_motion_delta (picture,
+ motion->f_code[0]) << motion->f_code[1]));
+ motion_x = bound_motion_vector (motion_x,
+ motion->f_code[0] + motion->f_code[1]);
+ motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = (motion->pmv[0][1] +
+ (get_xvmc_motion_delta (picture,
+ motion->f_code[0]) << motion->f_code[1]));
+ motion_y = bound_motion_vector (motion_y,
+ motion->f_code[0] + motion->f_code[1]);
+ motion->pmv[0][1] = motion_y;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fr_frame (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fr_field (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int),
+ int dir)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y, field;
+ // unsigned int pos_x, pos_y, xy_half;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ field = UBITS (bit_buf, 1);
+ picture->XvMC_mv_field_sel[0][dir] = field;
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = (motion->pmv[0][1] >> 1) + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
+ motion->pmv[0][1] = motion_y << 1;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ field = UBITS (bit_buf, 1);
+ //TODO look at field select need bob (weave ok)
+ picture->XvMC_mv_field_sel[1][dir] = field;
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[1][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = (motion->pmv[1][1] >> 1) + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
+ motion->pmv[1][1] = motion_y << 1;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fr_dmv (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+
+ // TODO field select ?? possible need to be 0
+ picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ motion_y = (motion->pmv[0][1] >> 1) + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ /* motion_y = bound_motion_vector (motion_y, motion->f_code[1]); */
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y << 1;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_reuse (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+ int motion_x, motion_y;
+
+ motion_x = motion->pmv[0][0];
+ motion_y = motion->pmv[0][1];
+
+}
+
+/* like motion_frame, but parsing without actual motion compensation */
+static void motion_fr_conceal (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ tmp = (picture->f_motion.pmv[0][0] +
+ get_xvmc_motion_delta (picture, picture->f_motion.f_code[0]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ tmp = (picture->f_motion.pmv[0][1] +
+ get_xvmc_motion_delta (picture, picture->f_motion.f_code[1]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
+ picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
+
+ DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_field (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+ uint8_t ** ref_field;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ ref_field = motion->ref2[UBITS (bit_buf, 1)];
+
+ // TODO field select may need to do something here for bob (weave ok)
+ picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
+
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_16x8 (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+ uint8_t ** ref_field;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ ref_field = motion->ref2[UBITS (bit_buf, 1)];
+
+ // TODO field select may need to do something here bob (weave ok)
+ picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
+
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[0][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[0][1] = motion_y;
+
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ ref_field = motion->ref2[UBITS (bit_buf, 1)];
+
+ // TODO field select may need to do something here for bob (weave ok)
+ picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
+
+ DUMPBITS (bit_buf, bits, 1);
+
+ motion_x = motion->pmv[1][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion_x;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_y = motion->pmv[1][1] + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion_y;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+static void motion_fi_dmv (picture_t * picture, motion_t * motion,
+ void (** table) (uint8_t *, uint8_t *, int, int))
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int motion_x, motion_y;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ motion_x = motion->pmv[0][0] + get_xvmc_motion_delta (picture,
+ motion->f_code[0]);
+ motion_x = bound_motion_vector (motion_x, motion->f_code[0]);
+ motion->pmv[1][0] = motion->pmv[0][0] = motion_x;
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ motion_y = motion->pmv[0][1] + get_xvmc_motion_delta (picture,
+ motion->f_code[1]);
+ motion_y = bound_motion_vector (motion_y, motion->f_code[1]);
+ motion->pmv[1][1] = motion->pmv[0][1] = motion_y;
+
+ // TODO field select may need to do something here for bob (weave ok)
+ picture->XvMC_mv_field_sel[0][0] = picture->XvMC_mv_field_sel[1][0] = 0;
+
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+
+static void motion_fi_conceal (picture_t * picture)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ DUMPBITS (bit_buf, bits, 1); /* remove field_select */
+
+ tmp = (picture->f_motion.pmv[0][0] +
+ get_xvmc_motion_delta (picture, picture->f_motion.f_code[0]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[0]);
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[0][0] = tmp;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ tmp = (picture->f_motion.pmv[0][1] +
+ get_xvmc_motion_delta (picture, picture->f_motion.f_code[1]));
+ tmp = bound_motion_vector (tmp, picture->f_motion.f_code[1]);
+ picture->f_motion.pmv[1][1] = picture->f_motion.pmv[0][1] = tmp;
+
+ DUMPBITS (bit_buf, bits, 1); /* remove marker_bit */
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+#define MOTION_CALL(routine,direction) \
+do { \
+ if ((direction) & MACROBLOCK_MOTION_FORWARD) \
+ routine (picture, &(picture->f_motion), mpeg2_mc.put); \
+ if ((direction) & MACROBLOCK_MOTION_BACKWARD) \
+ routine (picture, &(picture->b_motion), \
+ ((direction) & MACROBLOCK_MOTION_FORWARD ? \
+ mpeg2_mc.avg : mpeg2_mc.put)); \
+} while (0)
+
+#define NEXT_MACROBLOCK \
+do { \
+ picture->offset += 16; \
+ if (picture->offset == picture->coded_picture_width) { \
+ do { /* just so we can use the break statement */ \
+ if (picture->current_frame->proc_slice) { \
+ picture->current_frame->proc_slice (picture->current_frame, \
+ picture->dest); \
+ if (picture->picture_coding_type == B_TYPE) \
+ break; \
+ } \
+ picture->dest[0] += 16 * picture->pitches[0]; \
+ picture->dest[1] += 8 * picture->pitches[1]; \
+ picture->dest[2] += 8 * picture->pitches[2]; \
+ } while (0); \
+ picture->v_offset += 16; \
+ if (picture->v_offset > picture->limit_y) { \
+ if (mpeg2_cpu_state_restore) \
+ mpeg2_cpu_state_restore (&cpu_state); \
+ return; \
+ } \
+ picture->offset = 0; \
+ } \
+} while (0)
+
+static inline int slice_xvmc_init (picture_t * picture, int code)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ int offset, height;
+ struct vo_frame_s * forward_reference_frame;
+ struct vo_frame_s * backward_reference_frame;
+ const MBAtab * mba;
+
+ offset = picture->picture_structure == BOTTOM_FIELD;
+ picture->pitches[0] = picture->current_frame->pitches[0];
+ picture->pitches[1] = picture->current_frame->pitches[1];
+ picture->pitches[2] = picture->current_frame->pitches[2];
+
+ if( picture->forward_reference_frame ) {
+ forward_reference_frame = picture->forward_reference_frame;
+ }
+ else {
+ /* return 1; */
+ forward_reference_frame = picture->current_frame;
+ }
+
+ if( picture->backward_reference_frame ) {
+ backward_reference_frame = picture->backward_reference_frame;
+ }
+ else {
+ /* return 1; */
+ backward_reference_frame = picture->current_frame;
+ }
+
+ picture->f_motion.ref[0][0] =
+ forward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
+ picture->f_motion.ref[0][1] =
+ forward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
+ picture->f_motion.ref[0][2] =
+ forward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
+
+ picture->b_motion.ref[0][0] =
+ backward_reference_frame->base[0] + (offset ? picture->pitches[0] : 0);
+ picture->b_motion.ref[0][1] =
+ backward_reference_frame->base[1] + (offset ? picture->pitches[1] : 0);
+ picture->b_motion.ref[0][2] =
+ backward_reference_frame->base[2] + (offset ? picture->pitches[2] : 0);
+
+ if (picture->picture_structure != FRAME_PICTURE) {
+ uint8_t ** forward_ref;
+ int bottom_field;
+
+ bottom_field = (picture->picture_structure == BOTTOM_FIELD);
+ picture->dmv_offset = bottom_field ? 1 : -1;
+ picture->f_motion.ref2[0] = picture->f_motion.ref[bottom_field];
+ picture->f_motion.ref2[1] = picture->f_motion.ref[!bottom_field];
+ picture->b_motion.ref2[0] = picture->b_motion.ref[bottom_field];
+ picture->b_motion.ref2[1] = picture->b_motion.ref[!bottom_field];
+
+ forward_ref = forward_reference_frame->base;
+ if (picture->second_field && (picture->picture_coding_type != B_TYPE))
+ forward_ref = picture->current_frame->base;
+
+ picture->f_motion.ref[1][0] = forward_ref[0] + (bottom_field ? 0 : picture->pitches[0]);
+ picture->f_motion.ref[1][1] = forward_ref[1] + (bottom_field ? 0 : picture->pitches[1]);
+ picture->f_motion.ref[1][2] = forward_ref[2] + (bottom_field ? 0 : picture->pitches[2]);
+
+ picture->b_motion.ref[1][0] =
+ backward_reference_frame->base[0] + (bottom_field ? 0 : picture->pitches[0]);
+ picture->b_motion.ref[1][1] =
+ backward_reference_frame->base[1] + (bottom_field ? 0 : picture->pitches[1]);
+ picture->b_motion.ref[1][2] =
+ backward_reference_frame->base[2] + (bottom_field ? 0 : picture->pitches[2]);
+ }
+
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+ picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
+ picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
+
+ picture->v_offset = (code - 1) * 16;
+ offset = (code - 1);
+ if (picture->current_frame->proc_slice && picture->picture_coding_type == B_TYPE)
+ offset = 0;
+ else if (picture->picture_structure != FRAME_PICTURE)
+ offset = 2 * offset;
+
+ picture->dest[0] = picture->current_frame->base[0] + picture->pitches[0] * offset * 16;
+ picture->dest[1] = picture->current_frame->base[1] + picture->pitches[1] * offset * 8;
+ picture->dest[2] = picture->current_frame->base[2] + picture->pitches[2] * offset * 8;
+
+ height = picture->coded_picture_height;
+ switch (picture->picture_structure) {
+ case BOTTOM_FIELD:
+ picture->dest[0] += picture->pitches[0];
+ picture->dest[1] += picture->pitches[1];
+ picture->dest[2] += picture->pitches[2];
+ /* follow thru */
+ case TOP_FIELD:
+ picture->pitches[0] <<= 1;
+ picture->pitches[1] <<= 1;
+ picture->pitches[2] <<= 1;
+ height >>= 1;
+ }
+ picture->limit_x = 2 * picture->coded_picture_width - 32;
+ picture->limit_y_16 = 2 * height - 32;
+ picture->limit_y_8 = 2 * height - 16;
+ picture->limit_y = height - 16;
+
+ //TODO conversion to signed format signed format
+ if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL &&
+ !(picture->mc->xvmc_accel & SIGNED_INTRA)) {
+ //Motion Comp only unsigned intra
+ // original:
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 1 << (picture->intra_dc_precision + 7);
+ } else {
+ //Motion Comp only signed intra MOTION_ACCEL+SIGNED_INTRA
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 0;
+ }
+
+ picture->quantizer_scale = get_xvmc_quantizer_scale (picture);
+
+ /* ignore intra_slice and all the extra data */
+ while (bit_buf & 0x80000000) {
+ DUMPBITS (bit_buf, bits, 9);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ }
+
+ /* decode initial macroblock address increment */
+ offset = 0;
+ while (1) {
+ if (bit_buf >= 0x08000000) {
+ mba = MBA_5 + (UBITS (bit_buf, 6) - 2);
+ break;
+ } else if (bit_buf >= 0x01800000) {
+ mba = MBA_11 + (UBITS (bit_buf, 12) - 24);
+ break;
+ } else switch (UBITS (bit_buf, 12)) {
+ case 8: /* macroblock_escape */
+ offset += 33;
+ DUMPBITS (bit_buf, bits, 11);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ continue;
+ case 15: /* macroblock_stuffing (MPEG1 only) */
+ bit_buf &= 0xfffff;
+ DUMPBITS (bit_buf, bits, 11);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ continue;
+ default: /* error */
+ return 1;
+ }
+ }
+ DUMPBITS (bit_buf, bits, mba->len + 1);
+ picture->offset = (offset + mba->mba) << 4;
+
+ while (picture->offset - picture->coded_picture_width >= 0) {
+ picture->offset -= picture->coded_picture_width;
+ if ((picture->current_frame->proc_slice == NULL) ||
+ (picture->picture_coding_type != B_TYPE)) {
+ picture->dest[0] += 16 * picture->pitches[0];
+ picture->dest[1] += 8 * picture->pitches[1];
+ picture->dest[2] += 8 * picture->pitches[2];
+ }
+ picture->v_offset += 16;
+ }
+ if (picture->v_offset > picture->limit_y)
+ return 1;
+
+ return 0;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
+void mpeg2_xvmc_slice (mpeg2dec_accel_t *accel, picture_t * picture, int code, uint8_t * buffer)
+{
+#define bit_buf (picture->bitstream_buf)
+#define bits (picture->bitstream_bits)
+#define bit_ptr (picture->bitstream_ptr)
+ cpu_state_t cpu_state;
+ xine_xvmc_t *xvmc = (xine_xvmc_t *) picture->current_frame->accel_data;
+
+ if (1 == code) {
+ accel->xvmc_last_slice_code = 0;
+ }
+ if ((code != accel->xvmc_last_slice_code + 1) &&
+ (code != accel->xvmc_last_slice_code))
+ return;
+
+ bitstream_init (picture, buffer);
+
+ if (slice_xvmc_init (picture, code))
+ return;
+
+ if (mpeg2_cpu_state_save)
+ mpeg2_cpu_state_save (&cpu_state);
+
+ while (1) {
+ int macroblock_modes;
+ int mba_inc;
+ const MBAtab * mba;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+
+ macroblock_modes = get_xvmc_macroblock_modes (picture); //macroblock_modes()
+ picture->XvMC_mb_type = macroblock_modes & 0x1F;
+ picture->XvMC_dct_type = (macroblock_modes & DCT_TYPE_INTERLACED)>>5;
+ picture->XvMC_motion_type = (macroblock_modes & MOTION_TYPE_MASK)>>6;
+
+ picture->XvMC_x = picture->offset/16;
+ picture->XvMC_y = picture->v_offset/16;
+
+ if((picture->XvMC_x == 0) && (picture->XvMC_y == 0)) {
+ picture->XvMC_mv_field_sel[0][0] =
+ picture->XvMC_mv_field_sel[1][0] =
+ picture->XvMC_mv_field_sel[0][1] =
+ picture->XvMC_mv_field_sel[1][1] = 0;
+ }
+
+ picture->XvMC_cbp = 0x3f; //TODO set for intra 4:2:0 6 blocks yyyyuv all enabled
+
+ /* maybe integrate MACROBLOCK_QUANT test into get_xvmc_macroblock_modes ? */
+ if (macroblock_modes & MACROBLOCK_QUANT)
+ picture->quantizer_scale = get_xvmc_quantizer_scale (picture);
+ if (macroblock_modes & MACROBLOCK_INTRA) {
+
+ int DCT_offset, DCT_stride;
+ int offset;
+ uint8_t * dest_y;
+
+ if (picture->concealment_motion_vectors) {
+ if (picture->picture_structure == FRAME_PICTURE)
+ motion_fr_conceal (picture);
+ else
+ motion_fi_conceal (picture);
+ } else {
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+ picture->b_motion.pmv[0][0] = picture->b_motion.pmv[0][1] = 0;
+ picture->b_motion.pmv[1][0] = picture->b_motion.pmv[1][1] = 0;
+ }
+
+ if (macroblock_modes & DCT_TYPE_INTERLACED) {
+ DCT_offset = picture->pitches[0];
+ DCT_stride = picture->pitches[0] * 2;
+ } else {
+ DCT_offset = picture->pitches[0] * 8;
+ DCT_stride = picture->pitches[0];
+ }
+ offset = picture->offset;
+ dest_y = picture->dest[0] + offset;
+ // unravaled loop of 6 block(i) calls in macroblock()
+ slice_xvmc_intra_DCT (picture, 0, dest_y, DCT_stride);
+ slice_xvmc_intra_DCT (picture, 0, dest_y + 8, DCT_stride);
+ slice_xvmc_intra_DCT (picture, 0, dest_y + DCT_offset, DCT_stride);
+ slice_xvmc_intra_DCT (picture, 0, dest_y + DCT_offset + 8, DCT_stride);
+ slice_xvmc_intra_DCT (picture, 1, picture->dest[1] + (offset >> 1),
+ picture->pitches[1]);
+ slice_xvmc_intra_DCT (picture, 2, picture->dest[2] + (offset >> 1),
+ picture->pitches[2]);
+
+ if (picture->picture_coding_type == D_TYPE) {
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ DUMPBITS (bit_buf, bits, 1);
+ }
+ } else {
+ picture->XvMC_cbp = 0;
+
+ if (picture->picture_structure == FRAME_PICTURE)
+ switch (macroblock_modes & MOTION_TYPE_MASK) {
+ case MC_FRAME:
+ if (picture->mpeg1) {
+ MOTION_CALL (motion_mp1, macroblock_modes);
+ } else {
+ MOTION_CALL (motion_fr_frame, macroblock_modes);
+ }
+ break;
+
+ case MC_FIELD:
+ //MOTION_CALL (motion_fr_field, macroblock_modes);
+
+ if ((macroblock_modes) & MACROBLOCK_MOTION_FORWARD)
+ motion_fr_field(picture, &(picture->f_motion),
+ mpeg2_mc.put,0);
+ if ((macroblock_modes) & MACROBLOCK_MOTION_BACKWARD)
+ motion_fr_field(picture, &(picture->b_motion),
+ ((macroblock_modes) & MACROBLOCK_MOTION_FORWARD ?
+ mpeg2_mc.avg : mpeg2_mc.put),1);
+
+ break;
+
+ case MC_DMV:
+ MOTION_CALL (motion_fr_dmv, MACROBLOCK_MOTION_FORWARD);
+ break;
+
+ case 0:
+ /* non-intra mb without forward mv in a P picture */
+ picture->f_motion.pmv[0][0] = 0;
+ picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = 0;
+ picture->f_motion.pmv[1][1] = 0;
+ // MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
+ break;
+ }
+ else
+ switch (macroblock_modes & MOTION_TYPE_MASK) {
+ case MC_FIELD:
+ MOTION_CALL (motion_fi_field, macroblock_modes);
+ break;
+
+ case MC_16X8:
+ MOTION_CALL (motion_fi_16x8, macroblock_modes);
+ break;
+
+ case MC_DMV:
+ MOTION_CALL (motion_fi_dmv, MACROBLOCK_MOTION_FORWARD);
+ break;
+
+ case 0:
+ /* non-intra mb without forward mv in a P picture */
+ picture->f_motion.pmv[0][0] = 0;
+ picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = 0;
+ picture->f_motion.pmv[1][1] = 0;
+ // MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
+ break;
+ }
+
+ if (macroblock_modes & MACROBLOCK_PATTERN) {
+ int coded_block_pattern;
+ int DCT_offset, DCT_stride;
+ int offset;
+ uint8_t * dest_y;
+
+ if (macroblock_modes & DCT_TYPE_INTERLACED) {
+ DCT_offset = picture->pitches[0];
+ DCT_stride = picture->pitches[0] * 2;
+ } else {
+ DCT_offset = picture->pitches[0] * 8;
+ DCT_stride = picture->pitches[0];
+ }
+
+ picture->XvMC_cbp = coded_block_pattern = get_xvmc_coded_block_pattern (picture);
+ offset = picture->offset;
+ dest_y = picture->dest[0] + offset;
+ // TODO optimize not fully used for idct accel only mc.
+ if (coded_block_pattern & 0x20)
+ slice_xvmc_non_intra_DCT (picture, dest_y, DCT_stride); // cc0 luma 0
+ if (coded_block_pattern & 0x10)
+ slice_xvmc_non_intra_DCT (picture, dest_y + 8, DCT_stride); // cc0 luma 1
+ if (coded_block_pattern & 0x08)
+ slice_xvmc_non_intra_DCT (picture, dest_y + DCT_offset,
+ DCT_stride); // cc0 luma 2
+ if (coded_block_pattern & 0x04)
+ slice_xvmc_non_intra_DCT (picture, dest_y + DCT_offset + 8,
+ DCT_stride); // cc0 luma 3
+ if (coded_block_pattern & 0x2)
+ slice_xvmc_non_intra_DCT (picture,
+ picture->dest[1] + (offset >> 1),
+ picture->pitches[1]); // cc1 croma
+ if (coded_block_pattern & 0x1)
+ slice_xvmc_non_intra_DCT (picture,
+ picture->dest[2] + (offset >> 1),
+ picture->pitches[2]); // cc2 croma
+ }
+
+ if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL &&
+ !(picture->mc->xvmc_accel & SIGNED_INTRA)) {
+ // original:
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
+
+ } else { // MOTION_ACCEL+SIGNED_INTRA
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 0;
+ }
+
+ }
+ xvmc->proc_macro_block(picture->XvMC_x, picture->XvMC_y,
+ picture->XvMC_mb_type,
+ picture->XvMC_motion_type,
+ picture->XvMC_mv_field_sel,
+ picture->XvMC_dmvector,
+ picture->XvMC_cbp,
+ picture->XvMC_dct_type,
+ picture->current_frame,
+ picture->forward_reference_frame,
+ picture->backward_reference_frame,
+ picture->picture_structure,
+ picture->second_field,
+ picture->f_motion.pmv,
+ picture->b_motion.pmv);
+
+
+ NEXT_MACROBLOCK;
+
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ mba_inc = 0;
+ while (1) {
+ if (bit_buf >= 0x10000000) {
+ mba = MBA_5 + (UBITS (bit_buf, 5) - 2);
+ break;
+ } else if (bit_buf >= 0x03000000) {
+ mba = MBA_11 + (UBITS (bit_buf, 11) - 24);
+ break;
+ } else switch (UBITS (bit_buf, 11)) {
+ case 8: /* macroblock_escape */
+ mba_inc += 33;
+ /* pass through */
+ case 15: /* macroblock_stuffing (MPEG1 only) */
+ DUMPBITS (bit_buf, bits, 11);
+ NEEDBITS (bit_buf, bits, bit_ptr);
+ continue;
+ default: /* end of slice, or error */
+ if (mpeg2_cpu_state_restore)
+ mpeg2_cpu_state_restore (&cpu_state);
+ accel->xvmc_last_slice_code = code;
+ return;
+ }
+ }
+ DUMPBITS (bit_buf, bits, mba->len);
+ mba_inc += mba->mba;
+ if (mba_inc) {
+ //TODO conversion to signed format signed format
+ if((picture->mc->xvmc_accel & ACCEL) == MOTION_ACCEL &&
+ !(picture->mc->xvmc_accel & SIGNED_INTRA)) {
+ // original:
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 128 << picture->intra_dc_precision;
+ } else { // MOTION_ACCEL+SIGNED_INTRA
+ picture->dc_dct_pred[0] = picture->dc_dct_pred[1] =
+ picture->dc_dct_pred[2] = 0;
+ }
+
+ picture->XvMC_cbp = 0;
+ if (picture->picture_coding_type == P_TYPE) {
+ picture->f_motion.pmv[0][0] = picture->f_motion.pmv[0][1] = 0;
+ picture->f_motion.pmv[1][0] = picture->f_motion.pmv[1][1] = 0;
+
+ do {
+ if(picture->mc->xvmc_accel) {
+
+ /* derive motion_type */
+ if(picture->picture_structure == FRAME_PICTURE) {
+ picture->XvMC_motion_type = XINE_MC_FRAME;
+ } else {
+ picture->XvMC_motion_type = XINE_MC_FIELD;
+ /* predict from field of same parity */
+ picture->XvMC_mv_field_sel[0][0] =
+ picture->XvMC_mv_field_sel[0][1] =
+ (picture->picture_structure==BOTTOM_FIELD);
+ }
+ picture->XvMC_mb_type = macroblock_modes & 0x1E;
+ picture->XvMC_x = picture->offset/16;
+ picture->XvMC_y = picture->v_offset/16;
+
+ xvmc->proc_macro_block(picture->XvMC_x,picture->XvMC_y,
+ picture->XvMC_mb_type,
+ picture->XvMC_motion_type,
+ picture->XvMC_mv_field_sel,
+ picture->XvMC_dmvector,
+ picture->XvMC_cbp,
+ picture->XvMC_dct_type,
+ picture->current_frame,
+ picture->forward_reference_frame,
+ picture->backward_reference_frame,
+ picture->picture_structure,
+ picture->second_field,
+ picture->f_motion.pmv,
+ picture->b_motion.pmv);
+ } else {
+ // MOTION_CALL (motion_zero, MACROBLOCK_MOTION_FORWARD);
+ }
+ NEXT_MACROBLOCK;
+ } while (--mba_inc);
+ } else {
+ do {
+ if(picture->mc->xvmc_accel) {
+
+ /* derive motion_type */
+ if(picture->picture_structure == FRAME_PICTURE) {
+ picture->XvMC_motion_type = XINE_MC_FRAME;
+ } else {
+ picture->XvMC_motion_type = XINE_MC_FIELD;
+ /* predict from field of same parity */
+ picture->XvMC_mv_field_sel[0][0] =
+ picture->XvMC_mv_field_sel[0][1] =
+ (picture->picture_structure==BOTTOM_FIELD);
+ }
+
+ picture->XvMC_mb_type = macroblock_modes & 0x1E;
+ picture->XvMC_x = picture->offset/16;
+ picture->XvMC_y = picture->v_offset/16;
+
+ xvmc->proc_macro_block(picture->XvMC_x,picture->XvMC_y,
+ picture->XvMC_mb_type,
+ picture->XvMC_motion_type,
+ picture->XvMC_mv_field_sel,
+ picture->XvMC_dmvector,
+ picture->XvMC_cbp,
+ picture->XvMC_dct_type,
+ picture->current_frame,
+ picture->forward_reference_frame,
+ picture->backward_reference_frame,
+ picture->picture_structure,
+ picture->second_field,
+ picture->f_motion.pmv,
+ picture->b_motion.pmv);
+ } else {
+ MOTION_CALL (motion_reuse, macroblock_modes);
+ }
+ NEXT_MACROBLOCK;
+ } while (--mba_inc);
+ }
+ }
+ }
+ accel->xvmc_last_slice_code = code;
+#undef bit_buf
+#undef bits
+#undef bit_ptr
+}
+
diff --git a/src/video_dec/libmpeg2/slice_xvmc_vld.c b/src/video_dec/libmpeg2/slice_xvmc_vld.c
new file mode 100644
index 000000000..60fa8b4f8
--- /dev/null
+++ b/src/video_dec/libmpeg2/slice_xvmc_vld.c
@@ -0,0 +1,229 @@
+/*
+ * Copyright (c) 2004 The Unichrome project. All rights reserved.
+ *
+ * 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, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTIES OR REPRESENTATIONS; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public 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 <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include "mpeg2.h"
+#include "mpeg2_internal.h"
+#include "xvmc_vld.h"
+
+static const uint8_t zig_zag_scan[64] ATTR_ALIGN(16) =
+{
+ /* Zig-Zag scan pattern */
+ 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
+};
+
+static const uint8_t alternate_scan [64] ATTR_ALIGN(16) =
+{
+ /* Alternate scan pattern */
+ 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
+};
+
+void mpeg2_xxmc_slice( mpeg2dec_accel_t *accel, picture_t *picture,
+ int code, uint8_t *buffer, uint32_t chunk_size,
+ uint8_t *chunk_buffer)
+
+{
+ vo_frame_t
+ *frame = picture->current_frame;
+ xine_xxmc_t
+ *xxmc = (xine_xxmc_t *) frame->accel_data;
+ xine_vld_frame_t
+ *vft = &xxmc->vld_frame;
+ unsigned
+ mb_frame_height;
+ int
+ i;
+ const uint8_t *
+ scan_pattern;
+ float
+ ms_per_slice;
+
+ if (1 == code && accel->xvmc_last_slice_code != 1) {
+ frame->bad_frame = 1;
+ accel->slices_per_row = 1;
+ accel->row_slice_count = 1;
+
+ /*
+ * Check that first field went through OK. Otherwise,
+ * indicate bad frame.
+ */
+
+ if (picture->second_field) {
+ accel->xvmc_last_slice_code = (xxmc->decoded) ? 0 : -1;
+ xxmc->decoded = 0;
+ } else {
+ accel->xvmc_last_slice_code = 0;
+ }
+
+ mb_frame_height =
+ (!(picture->mpeg1) && (picture->progressive_sequence)) ?
+ 2*((picture->coded_picture_height+31) >> 5) :
+ (picture->coded_picture_height+15) >> 4;
+ accel->xxmc_mb_pic_height = (picture->picture_structure == FRAME_PICTURE ) ?
+ mb_frame_height : mb_frame_height >> 1;
+
+ ms_per_slice = 1000. / (90000. * mb_frame_height) * frame->duration;
+ xxmc->sleep = 1. / (ms_per_slice * 0.45);
+ if (xxmc->sleep < 1.) xxmc->sleep = 1.;
+
+ if (picture->mpeg1) {
+ vft->mv_ranges[0][0] = picture->b_motion.f_code[0];
+ vft->mv_ranges[0][1] = picture->b_motion.f_code[0];
+ vft->mv_ranges[1][0] = picture->f_motion.f_code[0];
+ vft->mv_ranges[1][1] = picture->f_motion.f_code[0];
+ } else {
+ vft->mv_ranges[0][0] = picture->b_motion.f_code[0];
+ vft->mv_ranges[0][1] = picture->b_motion.f_code[1];
+ vft->mv_ranges[1][0] = picture->f_motion.f_code[0];
+ vft->mv_ranges[1][1] = picture->f_motion.f_code[1];
+ }
+
+ vft->picture_structure = picture->picture_structure;
+ vft->picture_coding_type = picture->picture_coding_type;
+ vft->mpeg_coding = (picture->mpeg1) ? 0 : 1;
+ vft->progressive_sequence = picture->progressive_sequence;
+ vft->scan = (picture->scan == mpeg2_scan_alt);
+ vft->pred_dct_frame = picture->frame_pred_frame_dct;
+ vft->concealment_motion_vectors =
+ picture->concealment_motion_vectors;
+ vft->q_scale_type = picture->q_scale_type;
+ vft->intra_vlc_format = picture->intra_vlc_format;
+ vft->intra_dc_precision = picture->intra_dc_precision;
+ vft->second_field = picture->second_field;
+
+ /*
+ * Translation of libmpeg2's Q-matrix layout to VLD XvMC's.
+ * Errors here will give
+ * blocky artifacts and sometimes wrong colors.
+ */
+
+ scan_pattern = (vft->scan) ? alternate_scan : zig_zag_scan;
+
+ if ((vft->load_intra_quantizer_matrix = picture->load_intra_quantizer_matrix)) {
+ for (i=0; i<64; ++i) {
+ vft->intra_quantizer_matrix[scan_pattern[i]] =
+ picture->intra_quantizer_matrix[picture->scan[i]];
+ }
+ }
+
+ if ((vft->load_non_intra_quantizer_matrix = picture->load_non_intra_quantizer_matrix)) {
+ for (i=0; i<64; ++i) {
+ vft->non_intra_quantizer_matrix[scan_pattern[i]] =
+ picture->non_intra_quantizer_matrix[picture->scan[i]];
+ }
+ }
+
+ picture->load_intra_quantizer_matrix = 0;
+ picture->load_non_intra_quantizer_matrix = 0;
+ vft->forward_reference_frame = picture->forward_reference_frame;
+ vft->backward_reference_frame = picture->backward_reference_frame;
+ xxmc->proc_xxmc_begin( frame );
+ if (xxmc->result != 0) {
+ accel->xvmc_last_slice_code=-1;
+ }
+ }
+
+ if (((code == accel->xvmc_last_slice_code + 1) ||
+ (code == accel->xvmc_last_slice_code))) {
+
+ /*
+ * Send this slice to the output plugin. May stall for a long
+ * time in proc_slice;
+ */
+
+ frame->bad_frame = 1;
+ xxmc->slice_data_size = chunk_size;
+ xxmc->slice_data = chunk_buffer;
+ xxmc->slice_code = code;
+
+ xxmc->proc_xxmc_slice( frame );
+
+ if (xxmc->result != 0) {
+ accel->xvmc_last_slice_code=-1;
+ return;
+ }
+ /*
+ * Keep track of slices.
+ */
+
+ accel->row_slice_count = (accel->xvmc_last_slice_code == code) ?
+ accel->row_slice_count + 1 : 1;
+ accel->slices_per_row = (accel->row_slice_count > accel->slices_per_row) ?
+ accel->row_slice_count:accel->slices_per_row;
+ accel->xvmc_last_slice_code = code;
+
+ } else {
+
+ /*
+ * An error has occured.
+ */
+
+ lprintf("libmpeg2: VLD XvMC: Slice error.\n");
+ accel->xvmc_last_slice_code = -1;
+ return;
+ }
+}
+
+void mpeg2_xxmc_vld_frame_complete(mpeg2dec_accel_t *accel, picture_t *picture, int code)
+{
+ vo_frame_t
+ *frame = picture->current_frame;
+ xine_xxmc_t
+ *xxmc = (xine_xxmc_t *) frame->accel_data;
+
+ if (xxmc->decoded) return;
+ if (accel->xvmc_last_slice_code == -1) {
+ xxmc->proc_xxmc_flush( frame );
+ return;
+ }
+
+ if ((code != 0xff) || ((accel->xvmc_last_slice_code ==
+ accel->xxmc_mb_pic_height) &&
+ accel->slices_per_row == accel->row_slice_count)) {
+
+ xxmc->proc_xxmc_flush( frame );
+
+ if (xxmc->result) {
+ accel->xvmc_last_slice_code=-1;
+ frame->bad_frame = 1;
+ return;
+ }
+ xxmc->decoded = 1;
+ accel->xvmc_last_slice_code = 0;
+ if (picture->picture_structure == 3 || picture->second_field) {
+ if (xxmc->result == 0)
+ frame->bad_frame = 0;
+ }
+ }
+}
diff --git a/src/video_dec/libmpeg2/stats.c b/src/video_dec/libmpeg2/stats.c
new file mode 100644
index 000000000..63c701179
--- /dev/null
+++ b/src/video_dec/libmpeg2/stats.c
@@ -0,0 +1,317 @@
+/*
+ * stats.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 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 <inttypes.h>
+
+#include "mpeg2_internal.h"
+
+static int debug_level = -1;
+
+/* Determine is debug output is required. */
+/* We could potentially have multiple levels of debug info */
+static int debug_is_on (void)
+{
+ char * env_var;
+
+ if (debug_level < 0) {
+ env_var = getenv ("MPEG2_DEBUG");
+
+ if (env_var)
+ debug_level = 1;
+ else
+ debug_level = 0;
+ }
+
+ return debug_level;
+}
+
+static void stats_picture (uint8_t * buffer)
+{
+ static const char *const picture_coding_type_str [8] = {
+ "Invalid picture type",
+ "I-type",
+ "P-type",
+ "B-type",
+ "D (very bad)",
+ "Invalid","Invalid","Invalid"
+ };
+
+ int picture_coding_type;
+ int temporal_reference;
+ int vbv_delay;
+
+ temporal_reference = (buffer[0] << 2) | (buffer[1] >> 6);
+ picture_coding_type = (buffer [1] >> 3) & 7;
+ vbv_delay = ((buffer[1] << 13) | (buffer[2] << 5) |
+ (buffer[3] >> 3)) & 0xffff;
+
+ fprintf (stderr, " (picture) %s temporal_reference %d, vbv_delay %d\n",
+ picture_coding_type_str [picture_coding_type],
+ temporal_reference, vbv_delay);
+}
+
+static void stats_user_data (uint8_t * buffer)
+{
+ fprintf (stderr, " (user_data)\n");
+}
+
+static void stats_sequence (uint8_t * buffer)
+{
+ static const char *const aspect_ratio_information_str[8] = {
+ "Invalid Aspect Ratio",
+ "1:1",
+ "4:3",
+ "16:9",
+ "2.21:1",
+ "Invalid Aspect Ratio",
+ "Invalid Aspect Ratio",
+ "Invalid Aspect Ratio"
+ };
+ static const char *const frame_rate_str[16] = {
+ "Invalid frame_rate_code",
+ "23.976", "24", "25" , "29.97",
+ "30" , "50", "59.94", "60" ,
+ "Invalid frame_rate_code", "Invalid frame_rate_code",
+ "Invalid frame_rate_code", "Invalid frame_rate_code",
+ "Invalid frame_rate_code", "Invalid frame_rate_code",
+ "Invalid frame_rate_code"
+ };
+
+ int horizontal_size;
+ int vertical_size;
+ int aspect_ratio_information;
+ int frame_rate_code;
+ int bit_rate_value;
+ int vbv_buffer_size_value;
+ int constrained_parameters_flag;
+ int load_intra_quantizer_matrix;
+ int load_non_intra_quantizer_matrix;
+
+ vertical_size = (buffer[0] << 16) | (buffer[1] << 8) | buffer[2];
+ horizontal_size = vertical_size >> 12;
+ vertical_size &= 0xfff;
+ aspect_ratio_information = buffer[3] >> 4;
+ frame_rate_code = buffer[3] & 15;
+ bit_rate_value = (buffer[4] << 10) | (buffer[5] << 2) | (buffer[6] >> 6);
+ vbv_buffer_size_value = ((buffer[6] << 5) | (buffer[7] >> 3)) & 0x3ff;
+ constrained_parameters_flag = buffer[7] & 4;
+ load_intra_quantizer_matrix = buffer[7] & 2;
+ if (load_intra_quantizer_matrix)
+ buffer += 64;
+ load_non_intra_quantizer_matrix = buffer[7] & 1;
+
+ fprintf (stderr, " (seq) %dx%d %s, %s fps, %5.0f kbps, VBV %d kB%s%s%s\n",
+ horizontal_size, vertical_size,
+ aspect_ratio_information_str [aspect_ratio_information],
+ frame_rate_str [frame_rate_code],
+ bit_rate_value * 400.0 / 1000.0,
+ 2 * vbv_buffer_size_value,
+ constrained_parameters_flag ? " , CP":"",
+ load_intra_quantizer_matrix ? " , Custom Intra Matrix":"",
+ load_non_intra_quantizer_matrix ? " , Custom Non-Intra Matrix":"");
+}
+
+static void stats_sequence_error (uint8_t * buffer)
+{
+ fprintf (stderr, " (sequence_error)\n");
+}
+
+static void stats_sequence_end (uint8_t * buffer)
+{
+ fprintf (stderr, " (sequence_end)\n");
+}
+
+static void stats_group (uint8_t * buffer)
+{
+ fprintf (stderr, " (group)%s%s\n",
+ (buffer[4] & 0x40) ? " closed_gop" : "",
+ (buffer[4] & 0x20) ? " broken_link" : "");
+}
+
+static void stats_slice (int code, uint8_t * buffer)
+{
+ /* fprintf (stderr, " (slice %d)\n", code); */
+}
+
+static void stats_sequence_extension (uint8_t * buffer)
+{
+ static const char *const chroma_format_str[4] = {
+ "Invalid Chroma Format",
+ "4:2:0 Chroma",
+ "4:2:2 Chroma",
+ "4:4:4 Chroma"
+ };
+
+ int progressive_sequence;
+ int chroma_format;
+
+ progressive_sequence = (buffer[1] >> 3) & 1;
+ chroma_format = (buffer[1] >> 1) & 3;
+
+ fprintf (stderr, " (seq_ext) progressive_sequence %d, %s\n",
+ progressive_sequence, chroma_format_str [chroma_format]);
+}
+
+static void stats_sequence_display_extension (uint8_t * buffer)
+{
+ fprintf (stderr, " (sequence_display_extension)\n");
+}
+
+static void stats_quant_matrix_extension (uint8_t * buffer)
+{
+ fprintf (stderr, " (quant_matrix_extension)\n");
+}
+
+static void stats_copyright_extension (uint8_t * buffer)
+{
+ fprintf (stderr, " (copyright_extension)\n");
+}
+
+
+static void stats_sequence_scalable_extension (uint8_t * buffer)
+{
+ fprintf (stderr, " (sequence_scalable_extension)\n");
+}
+
+static void stats_picture_display_extension (uint8_t * buffer)
+{
+ fprintf (stderr, " (picture_display_extension)\n");
+}
+
+static void stats_picture_coding_extension (uint8_t * buffer)
+{
+ static const char *const picture_structure_str[4] = {
+ "Invalid Picture Structure",
+ "Top field",
+ "Bottom field",
+ "Frame Picture"
+ };
+
+ int f_code[2][2];
+ int intra_dc_precision;
+ int picture_structure;
+ int top_field_first;
+ int frame_pred_frame_dct;
+ int concealment_motion_vectors;
+ int q_scale_type;
+ int intra_vlc_format;
+ int alternate_scan;
+ int repeat_first_field;
+ int progressive_frame;
+
+ f_code[0][0] = buffer[0] & 15;
+ f_code[0][1] = buffer[1] >> 4;
+ f_code[1][0] = buffer[1] & 15;
+ f_code[1][1] = buffer[2] >> 4;
+ intra_dc_precision = (buffer[2] >> 2) & 3;
+ picture_structure = buffer[2] & 3;
+ top_field_first = buffer[3] >> 7;
+ frame_pred_frame_dct = (buffer[3] >> 6) & 1;
+ concealment_motion_vectors = (buffer[3] >> 5) & 1;
+ q_scale_type = (buffer[3] >> 4) & 1;
+ intra_vlc_format = (buffer[3] >> 3) & 1;
+ alternate_scan = (buffer[3] >> 2) & 1;
+ repeat_first_field = (buffer[3] >> 1) & 1;
+ progressive_frame = buffer[4] >> 7;
+
+ fprintf (stderr,
+ " (pic_ext) %s\n", picture_structure_str [picture_structure]);
+ fprintf (stderr,
+ " (pic_ext) forward horizontal f_code % d, forward vertical f_code % d\n",
+ f_code[0][0], f_code[0][1]);
+ fprintf (stderr,
+ " (pic_ext) backward horizontal f_code % d, backward vertical f_code % d\n",
+ f_code[1][0], f_code[1][1]);
+ fprintf (stderr,
+ " (pic_ext) intra_dc_precision %d, top_field_first %d, frame_pred_frame_dct %d\n",
+ intra_dc_precision, top_field_first, frame_pred_frame_dct);
+ fprintf (stderr,
+ " (pic_ext) concealment_motion_vectors %d, q_scale_type %d, intra_vlc_format %d\n",
+ concealment_motion_vectors, q_scale_type, intra_vlc_format);
+ fprintf (stderr,
+ " (pic_ext) alternate_scan %d, repeat_first_field %d, progressive_frame %d\n",
+ alternate_scan, repeat_first_field, progressive_frame);
+}
+
+void mpeg2_stats (int code, uint8_t * buffer)
+{
+ if (! (debug_is_on ()))
+ return;
+
+ switch (code) {
+ case 0x00:
+ stats_picture (buffer);
+ break;
+ case 0xb2:
+ stats_user_data (buffer);
+ break;
+ case 0xb3:
+ stats_sequence (buffer);
+ break;
+ case 0xb4:
+ stats_sequence_error (buffer);
+ break;
+ case 0xb5:
+ switch (buffer[0] >> 4) {
+ case 1:
+ stats_sequence_extension (buffer);
+ break;
+ case 2:
+ stats_sequence_display_extension (buffer);
+ break;
+ case 3:
+ stats_quant_matrix_extension (buffer);
+ break;
+ case 4:
+ stats_copyright_extension (buffer);
+ break;
+ case 5:
+ stats_sequence_scalable_extension (buffer);
+ break;
+ case 7:
+ stats_picture_display_extension (buffer);
+ break;
+ case 8:
+ stats_picture_coding_extension (buffer);
+ break;
+ default:
+ fprintf (stderr, " (unknown extension %#x)\n", buffer[0] >> 4);
+ }
+ break;
+ case 0xb7:
+ stats_sequence_end (buffer);
+ break;
+ case 0xb8:
+ stats_group (buffer);
+ break;
+ default:
+ if (code < 0xb0)
+ stats_slice (code, buffer);
+ else
+ fprintf (stderr, " (unknown start code %#02x)\n", code);
+ }
+}
diff --git a/src/libmpeg2/vis.h b/src/video_dec/libmpeg2/vis.h
index 69dd49075..69dd49075 100644
--- a/src/libmpeg2/vis.h
+++ b/src/video_dec/libmpeg2/vis.h
diff --git a/src/libmpeg2/vlc.h b/src/video_dec/libmpeg2/vlc.h
index 65de9a840..65de9a840 100644
--- a/src/libmpeg2/vlc.h
+++ b/src/video_dec/libmpeg2/vlc.h
diff --git a/src/video_dec/libmpeg2/xine_mpeg2_decoder.c b/src/video_dec/libmpeg2/xine_mpeg2_decoder.c
new file mode 100644
index 000000000..c4c7fac2d
--- /dev/null
+++ b/src/video_dec/libmpeg2/xine_mpeg2_decoder.c
@@ -0,0 +1,173 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * stuff needed to turn libmpeg2 into a xine decoder plugin
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define LOG_MODULE "mpeg2_decoder"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include "mpeg2.h"
+#include "mpeg2_internal.h"
+#include <xine/buffer.h>
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} mpeg2_class_t;
+
+
+typedef struct mpeg2dec_decoder_s {
+ video_decoder_t video_decoder;
+ mpeg2dec_t mpeg2;
+ mpeg2_class_t *class;
+ xine_stream_t *stream;
+} mpeg2dec_decoder_t;
+
+static void mpeg2dec_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
+ mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+
+ lprintf ("decode_data, flags=0x%08x ...\n", buf->decoder_flags);
+
+ /* handle aspect hints from xine-dvdnav */
+ if (buf->decoder_flags & BUF_FLAG_SPECIAL) {
+ if (buf->decoder_info[1] == BUF_SPECIAL_ASPECT) {
+ this->mpeg2.force_aspect = buf->decoder_info[2];
+ if (buf->decoder_info[3] == 0x1 && buf->decoder_info[2] == 3)
+ /* letterboxing is denied, we have to do pan&scan */
+ this->mpeg2.force_pan_scan = 1;
+ else
+ this->mpeg2.force_pan_scan = 0;
+ }
+ return;
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW) {
+ mpeg2_find_sequence_header (&this->mpeg2, buf->content, buf->content + buf->size);
+ } else {
+
+ mpeg2_decode_data (&this->mpeg2, buf->content, buf->content + buf->size,
+ buf->pts);
+ }
+
+ lprintf ("decode_data...done\n");
+}
+
+static void mpeg2dec_flush (video_decoder_t *this_gen) {
+ mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+
+ lprintf ("flush\n");
+
+ mpeg2_flush (&this->mpeg2);
+}
+
+static void mpeg2dec_reset (video_decoder_t *this_gen) {
+ mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+
+ mpeg2_reset (&this->mpeg2);
+}
+
+static void mpeg2dec_discontinuity (video_decoder_t *this_gen) {
+ mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+
+ mpeg2_discontinuity (&this->mpeg2);
+}
+
+static void mpeg2dec_dispose (video_decoder_t *this_gen) {
+
+ mpeg2dec_decoder_t *this = (mpeg2dec_decoder_t *) this_gen;
+
+ lprintf ("close\n");
+
+ mpeg2_close (&this->mpeg2);
+
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+
+ free (this);
+}
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+ mpeg2dec_decoder_t *this ;
+
+ this = (mpeg2dec_decoder_t *) calloc(1, sizeof(mpeg2dec_decoder_t));
+
+ this->video_decoder.decode_data = mpeg2dec_decode_data;
+ this->video_decoder.flush = mpeg2dec_flush;
+ this->video_decoder.reset = mpeg2dec_reset;
+ this->video_decoder.discontinuity = mpeg2dec_discontinuity;
+ this->video_decoder.dispose = mpeg2dec_dispose;
+ this->stream = stream;
+ this->class = (mpeg2_class_t *) class_gen;
+ this->mpeg2.stream = stream;
+
+ mpeg2_init (&this->mpeg2, stream->video_out);
+ (stream->video_out->open) (stream->video_out, stream);
+ this->mpeg2.force_aspect = this->mpeg2.force_pan_scan = 0;
+
+ return &this->video_decoder;
+}
+
+/*
+ * mpeg2 plugin class
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ mpeg2_class_t *this;
+
+ this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "mpeg2dec";
+ this->decoder_class.description = N_("mpeg2 based video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
+
+static const decoder_info_t dec_info_mpeg2 = {
+ supported_types, /* supported types */
+ 7 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/libmpeg2/xvmc.h b/src/video_dec/libmpeg2/xvmc.h
index 5d61bcf83..5d61bcf83 100644
--- a/src/libmpeg2/xvmc.h
+++ b/src/video_dec/libmpeg2/xvmc.h
diff --git a/src/libmpeg2/xvmc_vld.h b/src/video_dec/libmpeg2/xvmc_vld.h
index 561d1789d..561d1789d 100644
--- a/src/libmpeg2/xvmc_vld.h
+++ b/src/video_dec/libmpeg2/xvmc_vld.h
diff --git a/src/video_dec/libmpeg2new/Makefile.am b/src/video_dec/libmpeg2new/Makefile.am
new file mode 100644
index 000000000..2ff66d089
--- /dev/null
+++ b/src/video_dec/libmpeg2new/Makefile.am
@@ -0,0 +1,20 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+SUBDIRS = include libmpeg2
+
+if ENABLE_MPEG2NEW
+mpeg2new_module = xineplug_decode_mpeg2new.la
+endif
+
+xineplug_LTLIBRARIES = $(mpeg2new_module)
+
+xineplug_decode_mpeg2new_la_SOURCES = \
+ xine_mpeg2new_decoder.c
+
+xineplug_decode_mpeg2new_la_LIBADD = $(XINE_LIB) libmpeg2/libmpeg2.la
+xineplug_decode_mpeg2new_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS)
diff --git a/src/video_dec/libmpeg2new/include/Makefile.am b/src/video_dec/libmpeg2new/include/Makefile.am
new file mode 100644
index 000000000..d9c7a4df6
--- /dev/null
+++ b/src/video_dec/libmpeg2new/include/Makefile.am
@@ -0,0 +1,5 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_builddir)/misc/Makefile.plugins
+include $(top_srcdir)/misc/Makefile.common
+
+EXTRA_DIST = video_out.h mmx.h alpha_asm.h vis.h attributes.h tendra.h mpeg2.h mpeg2convert.h
diff --git a/src/libmpeg2new/include/alpha_asm.h b/src/video_dec/libmpeg2new/include/alpha_asm.h
index bf1081f24..bf1081f24 100644
--- a/src/libmpeg2new/include/alpha_asm.h
+++ b/src/video_dec/libmpeg2new/include/alpha_asm.h
diff --git a/src/video_dec/libmpeg2new/include/attributes.h b/src/video_dec/libmpeg2new/include/attributes.h
new file mode 100644
index 000000000..83f1364a2
--- /dev/null
+++ b/src/video_dec/libmpeg2new/include/attributes.h
@@ -0,0 +1,33 @@
+/*
+ * attributes.h
+ * 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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+/* use gcc attribs to align critical data structures */
+#include <xine/attributes.h>
+
+#ifdef HAVE_BUILTIN_EXPECT
+#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
diff --git a/src/libmpeg2new/include/mmx.h b/src/video_dec/libmpeg2new/include/mmx.h
index 08b4d4776..08b4d4776 100644
--- a/src/libmpeg2new/include/mmx.h
+++ b/src/video_dec/libmpeg2new/include/mmx.h
diff --git a/src/libmpeg2new/include/mpeg2.h b/src/video_dec/libmpeg2new/include/mpeg2.h
index 6c1a3805b..6c1a3805b 100644
--- a/src/libmpeg2new/include/mpeg2.h
+++ b/src/video_dec/libmpeg2new/include/mpeg2.h
diff --git a/src/libmpeg2new/include/mpeg2convert.h b/src/video_dec/libmpeg2new/include/mpeg2convert.h
index aac5d1991..aac5d1991 100644
--- a/src/libmpeg2new/include/mpeg2convert.h
+++ b/src/video_dec/libmpeg2new/include/mpeg2convert.h
diff --git a/src/libmpeg2new/include/sse.h b/src/video_dec/libmpeg2new/include/sse.h
index 4bd853f8b..4bd853f8b 100644
--- a/src/libmpeg2new/include/sse.h
+++ b/src/video_dec/libmpeg2new/include/sse.h
diff --git a/src/libmpeg2new/include/tendra.h b/src/video_dec/libmpeg2new/include/tendra.h
index 09900916a..09900916a 100644
--- a/src/libmpeg2new/include/tendra.h
+++ b/src/video_dec/libmpeg2new/include/tendra.h
diff --git a/src/libmpeg2new/include/video_out.h b/src/video_dec/libmpeg2new/include/video_out.h
index 342c55197..342c55197 100644
--- a/src/libmpeg2new/include/video_out.h
+++ b/src/video_dec/libmpeg2new/include/video_out.h
diff --git a/src/libmpeg2new/include/vis.h b/src/video_dec/libmpeg2new/include/vis.h
index 69dd49075..69dd49075 100644
--- a/src/libmpeg2new/include/vis.h
+++ b/src/video_dec/libmpeg2new/include/vis.h
diff --git a/src/video_dec/libmpeg2new/libmpeg2/Makefile.am b/src/video_dec/libmpeg2new/libmpeg2/Makefile.am
new file mode 100644
index 000000000..3a69cd1b4
--- /dev/null
+++ b/src/video_dec/libmpeg2new/libmpeg2/Makefile.am
@@ -0,0 +1,23 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+
+if ENABLE_MPEG2NEW
+mpeg2new_libs = libmpeg2.la libmpeg2arch.la
+endif
+
+noinst_LTLIBRARIES = $(mpeg2new_libs)
+
+libmpeg2_la_SOURCES = alloc.c header.c decode.c slice.c motion_comp.c idct.c
+libmpeg2_la_LIBADD = libmpeg2arch.la
+
+AM_CPPFLAGS = -I$(srcdir)/../include
+
+libmpeg2arch_la_SOURCES = motion_comp_mmx.c idct_mmx.c \
+ motion_comp_altivec.c idct_altivec.c \
+ motion_comp_alpha.c idct_alpha.c \
+ motion_comp_vis.c \
+ cpu_accel.c cpu_state.c
+
+EXTRA_DIST = mpeg2_internal.h vlc.h
diff --git a/src/libmpeg2new/libmpeg2/alloc.c b/src/video_dec/libmpeg2new/libmpeg2/alloc.c
index f1a7afa1c..f1a7afa1c 100644
--- a/src/libmpeg2new/libmpeg2/alloc.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/alloc.c
diff --git a/src/libmpeg2new/libmpeg2/configure.incl b/src/video_dec/libmpeg2new/libmpeg2/configure.incl
index f8dbd5aef..f8dbd5aef 100644
--- a/src/libmpeg2new/libmpeg2/configure.incl
+++ b/src/video_dec/libmpeg2new/libmpeg2/configure.incl
diff --git a/src/libmpeg2new/libmpeg2/convert_internal.h b/src/video_dec/libmpeg2new/libmpeg2/convert_internal.h
index d1e63d5e3..d1e63d5e3 100644
--- a/src/libmpeg2new/libmpeg2/convert_internal.h
+++ b/src/video_dec/libmpeg2new/libmpeg2/convert_internal.h
diff --git a/src/libmpeg2new/libmpeg2/cpu_accel.c b/src/video_dec/libmpeg2new/libmpeg2/cpu_accel.c
index 7846f1e88..7846f1e88 100644
--- a/src/libmpeg2new/libmpeg2/cpu_accel.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/cpu_accel.c
diff --git a/src/libmpeg2new/libmpeg2/cpu_state.c b/src/video_dec/libmpeg2new/libmpeg2/cpu_state.c
index edbf2dd28..edbf2dd28 100644
--- a/src/libmpeg2new/libmpeg2/cpu_state.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/cpu_state.c
diff --git a/src/libmpeg2new/libmpeg2/decode.c b/src/video_dec/libmpeg2new/libmpeg2/decode.c
index 337ba4466..337ba4466 100644
--- a/src/libmpeg2new/libmpeg2/decode.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/decode.c
diff --git a/src/libmpeg2new/libmpeg2/header.c b/src/video_dec/libmpeg2new/libmpeg2/header.c
index 935a50aa3..935a50aa3 100644
--- a/src/libmpeg2new/libmpeg2/header.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/header.c
diff --git a/src/libmpeg2new/libmpeg2/idct.c b/src/video_dec/libmpeg2new/libmpeg2/idct.c
index 8b982bb33..8b982bb33 100644
--- a/src/libmpeg2new/libmpeg2/idct.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/idct.c
diff --git a/src/video_dec/libmpeg2new/libmpeg2/idct_alpha.c b/src/video_dec/libmpeg2new/libmpeg2/idct_alpha.c
new file mode 100644
index 000000000..1d8fd08ee
--- /dev/null
+++ b/src/video_dec/libmpeg2new/libmpeg2/idct_alpha.c
@@ -0,0 +1,379 @@
+/*
+ * idct_alpha.c
+ * Copyright (C) 2002-2003 Falk Hueffner <falk@debian.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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#ifdef ARCH_ALPHA
+
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "mpeg2.h"
+#include <xine/attributes.h>
+#include "mpeg2_internal.h"
+#include "alpha_asm.h"
+
+#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 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) */
+
+extern uint8_t mpeg2_clip[3840 * 2 + 256];
+#define CLIP(i) ((mpeg2_clip + 3840)[i])
+
+#if 0
+#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \
+do { \
+ t0 = W0 * d0 + W1 * d1; \
+ t1 = W0 * d1 - W1 * d0; \
+} while (0)
+#else
+#define BUTTERFLY(t0,t1,W0,W1,d0,d1) \
+do { \
+ int_fast32_t tmp = W0 * (d0 + d1); \
+ t0 = tmp + (W1 - W0) * d1; \
+ t1 = tmp - (W1 + W0) * d0; \
+} while (0)
+#endif
+
+static void inline idct_row (int16_t * const block)
+{
+ uint64_t l, r;
+ int_fast32_t d0, d1, d2, d3;
+ int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
+ int_fast32_t t0, t1, t2, t3;
+
+ l = ldq (block);
+ r = ldq (block + 4);
+
+ /* shortcut */
+ if (likely (!((l & ~0xffffUL) | r))) {
+ uint64_t tmp = (uint16_t) (l >> 1);
+ tmp |= tmp << 16;
+ tmp |= tmp << 32;
+ ((int32_t *)block)[0] = tmp;
+ ((int32_t *)block)[1] = tmp;
+ ((int32_t *)block)[2] = tmp;
+ ((int32_t *)block)[3] = tmp;
+ return;
+ }
+
+ d0 = (sextw (l) << 11) + 2048;
+ d1 = sextw (extwl (l, 2));
+ d2 = sextw (extwl (l, 4)) << 11;
+ d3 = sextw (extwl (l, 6));
+ t0 = d0 + d2;
+ t1 = d0 - d2;
+ BUTTERFLY (t2, t3, W6, W2, d3, d1);
+ a0 = t0 + t2;
+ a1 = t1 + t3;
+ a2 = t1 - t3;
+ a3 = t0 - t2;
+
+ d0 = sextw (r);
+ d1 = sextw (extwl (r, 2));
+ d2 = sextw (extwl (r, 4));
+ d3 = sextw (extwl (r, 6));
+ BUTTERFLY (t0, t1, W7, W1, d3, d0);
+ BUTTERFLY (t2, t3, W3, W5, d1, d2);
+ b0 = t0 + t2;
+ b3 = t1 + t3;
+ t0 -= t2;
+ t1 -= t3;
+ b1 = ((t0 + t1) >> 8) * 181;
+ b2 = ((t0 - t1) >> 8) * 181;
+
+ block[0] = (a0 + b0) >> 12;
+ block[1] = (a1 + b1) >> 12;
+ block[2] = (a2 + b2) >> 12;
+ block[3] = (a3 + b3) >> 12;
+ block[4] = (a3 - b3) >> 12;
+ block[5] = (a2 - b2) >> 12;
+ block[6] = (a1 - b1) >> 12;
+ block[7] = (a0 - b0) >> 12;
+}
+
+static void inline idct_col (int16_t * const block)
+{
+ int_fast32_t d0, d1, d2, d3;
+ int_fast32_t a0, a1, a2, a3, b0, b1, b2, b3;
+ int_fast32_t t0, t1, t2, t3;
+
+ d0 = (block[8*0] << 11) + 65536;
+ d1 = block[8*1];
+ d2 = block[8*2] << 11;
+ d3 = block[8*3];
+ t0 = d0 + d2;
+ t1 = d0 - d2;
+ BUTTERFLY (t2, t3, W6, W2, d3, d1);
+ a0 = t0 + t2;
+ a1 = t1 + t3;
+ a2 = t1 - t3;
+ a3 = t0 - t2;
+
+ d0 = block[8*4];
+ d1 = block[8*5];
+ d2 = block[8*6];
+ d3 = block[8*7];
+ BUTTERFLY (t0, t1, W7, W1, d3, d0);
+ BUTTERFLY (t2, t3, W3, W5, d1, d2);
+ b0 = t0 + t2;
+ b3 = t1 + t3;
+ t0 -= t2;
+ t1 -= t3;
+ b1 = ((t0 + t1) >> 8) * 181;
+ b2 = ((t0 - t1) >> 8) * 181;
+
+ block[8*0] = (a0 + b0) >> 17;
+ block[8*1] = (a1 + b1) >> 17;
+ block[8*2] = (a2 + b2) >> 17;
+ block[8*3] = (a3 + b3) >> 17;
+ block[8*4] = (a3 - b3) >> 17;
+ block[8*5] = (a2 - b2) >> 17;
+ block[8*6] = (a1 - b1) >> 17;
+ block[8*7] = (a0 - b0) >> 17;
+}
+
+void mpeg2_idct_copy_mvi (int16_t * block, uint8_t * dest, const int stride)
+{
+ uint64_t clampmask;
+ int i;
+
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+
+ clampmask = zap (-1, 0xaa); /* 0x00ff00ff00ff00ff */
+ do {
+ uint64_t shorts0, shorts1;
+
+ shorts0 = ldq (block);
+ shorts0 = maxsw4 (shorts0, 0);
+ shorts0 = minsw4 (shorts0, clampmask);
+ stl (pkwb (shorts0), dest);
+
+ shorts1 = ldq (block + 4);
+ shorts1 = maxsw4 (shorts1, 0);
+ shorts1 = minsw4 (shorts1, clampmask);
+ stl (pkwb (shorts1), dest + 4);
+
+ stq (0, block);
+ stq (0, block + 4);
+
+ dest += stride;
+ block += 8;
+ } while (--i);
+}
+
+void mpeg2_idct_add_mvi (const int last, int16_t * block,
+ uint8_t * dest, const int stride)
+{
+ uint64_t clampmask;
+ uint64_t signmask;
+ int i;
+
+ if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) {
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+ clampmask = zap (-1, 0xaa); /* 0x00ff00ff00ff00ff */
+ 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 (dest));
+ /* 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 (dest + 4));
+ signs1 = shorts1 & signmask;
+ shorts1 &= ~signmask;
+ shorts1 += pix1;
+ shorts1 ^= signs1;
+ shorts1 = maxsw4 (shorts1, 0);
+ shorts1 = minsw4 (shorts1, clampmask);
+
+ stl (pkwb (shorts0), dest);
+ stl (pkwb (shorts1), dest + 4);
+ stq (0, block);
+ stq (0, block + 4);
+
+ dest += stride;
+ block += 8;
+ } while (--i);
+ } else {
+ int DC;
+ uint64_t p0, p1, p2, p3, p4, p5, p6, p7;
+ uint64_t DCs;
+
+ DC = (block[0] + 64) >> 7;
+ block[0] = block[63] = 0;
+
+ p0 = ldq (dest + 0 * stride);
+ p1 = ldq (dest + 1 * stride);
+ p2 = ldq (dest + 2 * stride);
+ p3 = ldq (dest + 3 * stride);
+ p4 = ldq (dest + 4 * stride);
+ p5 = ldq (dest + 5 * stride);
+ p6 = ldq (dest + 6 * stride);
+ p7 = ldq (dest + 7 * stride);
+
+ if (DC > 0) {
+ DCs = BYTE_VEC (likely (DC <= 255) ? DC : 255);
+ p0 += minub8 (DCs, ~p0);
+ p1 += minub8 (DCs, ~p1);
+ p2 += minub8 (DCs, ~p2);
+ p3 += minub8 (DCs, ~p3);
+ p4 += minub8 (DCs, ~p4);
+ p5 += minub8 (DCs, ~p5);
+ p6 += minub8 (DCs, ~p6);
+ p7 += minub8 (DCs, ~p7);
+ } else {
+ DCs = BYTE_VEC (likely (-DC <= 255) ? -DC : 255);
+ p0 -= minub8 (DCs, p0);
+ p1 -= minub8 (DCs, p1);
+ p2 -= minub8 (DCs, p2);
+ p3 -= minub8 (DCs, p3);
+ p4 -= minub8 (DCs, p4);
+ p5 -= minub8 (DCs, p5);
+ p6 -= minub8 (DCs, p6);
+ p7 -= minub8 (DCs, p7);
+ }
+
+ stq (p0, dest + 0 * stride);
+ stq (p1, dest + 1 * stride);
+ stq (p2, dest + 2 * stride);
+ stq (p3, dest + 3 * stride);
+ stq (p4, dest + 4 * stride);
+ stq (p5, dest + 5 * stride);
+ stq (p6, dest + 6 * stride);
+ stq (p7, dest + 7 * stride);
+ }
+}
+
+void mpeg2_idct_copy_alpha (int16_t * block, uint8_t * dest, const int stride)
+{
+ int i;
+
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+ do {
+ dest[0] = CLIP (block[0]);
+ dest[1] = CLIP (block[1]);
+ dest[2] = CLIP (block[2]);
+ dest[3] = CLIP (block[3]);
+ dest[4] = CLIP (block[4]);
+ dest[5] = CLIP (block[5]);
+ dest[6] = CLIP (block[6]);
+ dest[7] = CLIP (block[7]);
+
+ stq(0, block);
+ stq(0, block + 4);
+
+ dest += stride;
+ block += 8;
+ } while (--i);
+}
+
+void mpeg2_idct_add_alpha (const int last, int16_t * block,
+ uint8_t * dest, const int stride)
+{
+ int i;
+
+ if (last != 129 || (block[0] & (7 << 4)) == (4 << 4)) {
+ for (i = 0; i < 8; i++)
+ idct_row (block + 8 * i);
+ for (i = 0; i < 8; i++)
+ idct_col (block + i);
+ do {
+ dest[0] = CLIP (block[0] + dest[0]);
+ dest[1] = CLIP (block[1] + dest[1]);
+ dest[2] = CLIP (block[2] + dest[2]);
+ dest[3] = CLIP (block[3] + dest[3]);
+ dest[4] = CLIP (block[4] + dest[4]);
+ dest[5] = CLIP (block[5] + dest[5]);
+ dest[6] = CLIP (block[6] + dest[6]);
+ dest[7] = CLIP (block[7] + dest[7]);
+
+ stq(0, block);
+ stq(0, block + 4);
+
+ dest += stride;
+ block += 8;
+ } while (--i);
+ } else {
+ int DC;
+
+ DC = (block[0] + 64) >> 7;
+ block[0] = block[63] = 0;
+ i = 8;
+ do {
+ dest[0] = CLIP (DC + dest[0]);
+ dest[1] = CLIP (DC + dest[1]);
+ dest[2] = CLIP (DC + dest[2]);
+ dest[3] = CLIP (DC + dest[3]);
+ dest[4] = CLIP (DC + dest[4]);
+ dest[5] = CLIP (DC + dest[5]);
+ dest[6] = CLIP (DC + dest[6]);
+ dest[7] = CLIP (DC + dest[7]);
+ dest += stride;
+ } while (--i);
+ }
+}
+
+void mpeg2_idct_alpha_init (void)
+{
+ extern uint8_t mpeg2_scan_norm[64];
+ extern uint8_t mpeg2_scan_alt[64];
+ int i, j;
+
+ for (i = 0; i < 64; i++) {
+ j = mpeg2_scan_norm[i];
+ mpeg2_scan_norm[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2);
+ j = mpeg2_scan_alt[i];
+ mpeg2_scan_alt[i] = ((j & 0x36) >> 1) | ((j & 0x09) << 2);
+ }
+}
+
+#endif /* ARCH_ALPHA */
diff --git a/src/video_dec/libmpeg2new/libmpeg2/idct_altivec.c b/src/video_dec/libmpeg2new/libmpeg2/idct_altivec.c
new file mode 100644
index 000000000..f15bca165
--- /dev/null
+++ b/src/video_dec/libmpeg2new/libmpeg2/idct_altivec.c
@@ -0,0 +1,288 @@
+/*
+ * idct_altivec.c
+ * 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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#ifdef ARCH_PPC
+
+#ifdef HAVE_ALTIVEC_H
+#include <altivec.h>
+#endif
+#include <inttypes.h>
+
+#include "mpeg2.h"
+#include <xine/attributes.h>
+#include "mpeg2_internal.h"
+
+typedef vector signed char vector_s8_t;
+typedef vector unsigned char vector_u8_t;
+typedef vector signed short vector_s16_t;
+typedef vector unsigned short vector_u16_t;
+typedef vector signed int vector_s32_t;
+typedef vector unsigned int vector_u32_t;
+
+#if defined(HAVE_ALTIVEC_H) && (__GNUC__ * 100 + __GNUC_MINOR__ < 303)
+/* work around gcc <3.3 vec_mergel bug */
+static inline vector_s16_t my_vec_mergel (vector_s16_t const A,
+ vector_s16_t const B)
+{
+ static const vector_u8_t mergel = {
+ 0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b,
+ 0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f
+ };
+ return vec_perm (A, B, mergel);
+}
+#undef vec_mergel
+#define vec_mergel my_vec_mergel
+#endif
+
+#ifdef HAVE_ALTIVEC_H /* gnu */
+#define VEC_S16(a,b,c,d,e,f,g,h) {a, b, c, d, e, f, g, h}
+#else /* apple */
+#define VEC_S16(a,b,c,d,e,f,g,h) (vector_s16_t) (a, b, c, d, e, f, g, h)
+#endif
+
+static const vector_s16_t constants ATTR_ALIGN(16) =
+ VEC_S16 (23170, 13573, 6518, 21895, -23170, -21895, 32, 31);
+static const vector_s16_t constants_1 ATTR_ALIGN(16) =
+ VEC_S16 (16384, 22725, 21407, 19266, 16384, 19266, 21407, 22725);
+static const vector_s16_t constants_2 ATTR_ALIGN(16) =
+ VEC_S16 (16069, 22289, 20995, 18895, 16069, 18895, 20995, 22289);
+static const vector_s16_t constants_3 ATTR_ALIGN(16) =
+ VEC_S16 (21407, 29692, 27969, 25172, 21407, 25172, 27969, 29692);
+static const vector_s16_t constants_4 ATTR_ALIGN(16) =
+ VEC_S16 (13623, 18895, 17799, 16019, 13623, 16019, 17799, 18895);
+
+#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); \
+ a0 = vec_splat (constants, 1); \
+ a1 = vec_splat (constants, 2); \
+ a2 = vec_splat (constants, 3); \
+ mc4 = vec_splat (constants, 4); \
+ ma2 = vec_splat (constants, 5); \
+ bias = (vector_s16_t)vec_splat ((vector_s32_t)constants, 3); \
+ \
+ zero = vec_splat_s16 (0); \
+ \
+ vx0 = vec_adds (block[0], block[4]); \
+ vx4 = vec_subs (block[0], block[4]); \
+ t5 = vec_mradds (vx0, constants_1, zero); \
+ t0 = vec_mradds (vx4, constants_1, zero); \
+ \
+ vx1 = vec_mradds (a1, block[7], block[1]); \
+ vx7 = vec_mradds (a1, block[1], vec_subs (zero, block[7])); \
+ t1 = vec_mradds (vx1, constants_2, zero); \
+ t8 = vec_mradds (vx7, constants_2, zero); \
+ \
+ vx2 = vec_mradds (a0, block[6], block[2]); \
+ vx6 = vec_mradds (a0, block[2], vec_subs (zero, block[6])); \
+ t2 = vec_mradds (vx2, constants_3, zero); \
+ t4 = vec_mradds (vx6, constants_3, zero); \
+ \
+ vx3 = vec_mradds (block[3], constants_4, zero); \
+ vx5 = vec_mradds (block[5], constants_4, zero); \
+ t7 = vec_mradds (a2, vx5, vx3); \
+ t3 = vec_mradds (ma2, vx3, vx5); \
+ \
+ t6 = vec_adds (t8, t3); \
+ t3 = vec_subs (t8, t3); \
+ t8 = vec_subs (t1, t7); \
+ t1 = vec_adds (t1, t7); \
+ t6 = vec_mradds (a0, t6, t6); /* a0+1 == 2*c4 */ \
+ t1 = vec_mradds (a0, t1, t1); /* a0+1 == 2*c4 */ \
+ \
+ 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); \
+ \
+ vy0 = vec_adds (t7, t1); \
+ vy7 = vec_subs (t7, t1); \
+ vy1 = vec_adds (t5, t3); \
+ vy6 = vec_subs (t5, t3); \
+ vy2 = vec_adds (t0, t4); \
+ vy5 = vec_subs (t0, t4); \
+ vy3 = vec_adds (t2, t6); \
+ vy4 = vec_subs (t2, t6); \
+ \
+ 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_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); \
+ \
+ vx0 = vec_adds (vx0, bias); \
+ t5 = vec_adds (vx0, vx4); \
+ t0 = vec_subs (vx0, vx4); \
+ \
+ t1 = vec_mradds (a1, vx7, vx1); \
+ t8 = vec_mradds (a1, vx1, vec_subs (zero, vx7)); \
+ \
+ t2 = vec_mradds (a0, vx6, vx2); \
+ t4 = vec_mradds (a0, vx2, vec_subs (zero, vx6)); \
+ \
+ t7 = vec_mradds (a2, vx5, vx3); \
+ t3 = vec_mradds (ma2, vx3, vx5); \
+ \
+ t6 = vec_adds (t8, t3); \
+ t3 = vec_subs (t8, t3); \
+ t8 = vec_subs (t1, t7); \
+ t1 = vec_adds (t1, t7); \
+ \
+ 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); \
+ \
+ 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); \
+ \
+ 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);
+
+void mpeg2_idct_copy_altivec (int16_t * const _block, uint8_t * dest,
+ const int stride)
+{
+ vector_s16_t * const block = (vector_s16_t *)_block;
+ vector_u8_t tmp;
+
+ 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)
+
+ block[0] = block[1] = block[2] = block[3] = zero;
+ block[4] = block[5] = block[6] = block[7] = zero;
+}
+
+void mpeg2_idct_add_altivec (const int last, int16_t * const _block,
+ uint8_t * dest, const int stride)
+{
+ vector_s16_t * const block = (vector_s16_t *)_block;
+ vector_u8_t tmp;
+ vector_s16_t tmp2, tmp3;
+ vector_u8_t perm0;
+ vector_u8_t perm1;
+ vector_u8_t p0, p1, p;
+
+ 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)
+
+ block[0] = block[1] = block[2] = block[3] = zero;
+ block[4] = block[5] = block[6] = block[7] = zero;
+}
+
+void mpeg2_idct_altivec_init (void)
+{
+ extern uint8_t mpeg2_scan_norm[64];
+ extern uint8_t mpeg2_scan_alt[64];
+ int i, j;
+
+ /* the altivec idct uses a transposed input, so we patch scan tables */
+ for (i = 0; i < 64; i++) {
+ j = mpeg2_scan_norm[i];
+ mpeg2_scan_norm[i] = (j >> 3) | ((j & 7) << 3);
+ j = mpeg2_scan_alt[i];
+ mpeg2_scan_alt[i] = (j >> 3) | ((j & 7) << 3);
+ }
+}
+
+#endif
diff --git a/src/libmpeg2new/libmpeg2/idct_mlib.c b/src/video_dec/libmpeg2new/libmpeg2/idct_mlib.c
index 55a2e9b64..55a2e9b64 100644
--- a/src/libmpeg2new/libmpeg2/idct_mlib.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/idct_mlib.c
diff --git a/src/libmpeg2new/libmpeg2/idct_mmx.c b/src/video_dec/libmpeg2new/libmpeg2/idct_mmx.c
index d5a5c08a4..d5a5c08a4 100644
--- a/src/libmpeg2new/libmpeg2/idct_mmx.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/idct_mmx.c
diff --git a/src/libmpeg2new/libmpeg2/libmpeg2.pc.in b/src/video_dec/libmpeg2new/libmpeg2/libmpeg2.pc.in
index d54500b0e..d54500b0e 100644
--- a/src/libmpeg2new/libmpeg2/libmpeg2.pc.in
+++ b/src/video_dec/libmpeg2new/libmpeg2/libmpeg2.pc.in
diff --git a/src/libmpeg2new/libmpeg2/libmpeg2convert.pc.in b/src/video_dec/libmpeg2new/libmpeg2/libmpeg2convert.pc.in
index 42383a6e2..42383a6e2 100644
--- a/src/libmpeg2new/libmpeg2/libmpeg2convert.pc.in
+++ b/src/video_dec/libmpeg2new/libmpeg2/libmpeg2convert.pc.in
diff --git a/src/libmpeg2new/libmpeg2/motion_comp.c b/src/video_dec/libmpeg2new/libmpeg2/motion_comp.c
index d5a265d5c..d5a265d5c 100644
--- a/src/libmpeg2new/libmpeg2/motion_comp.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/motion_comp.c
diff --git a/src/libmpeg2new/libmpeg2/motion_comp_alpha.c b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_alpha.c
index 73f6625d2..73f6625d2 100644
--- a/src/libmpeg2new/libmpeg2/motion_comp_alpha.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_alpha.c
diff --git a/src/libmpeg2new/libmpeg2/motion_comp_altivec.c b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_altivec.c
index cc1b72f56..cc1b72f56 100644
--- a/src/libmpeg2new/libmpeg2/motion_comp_altivec.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_altivec.c
diff --git a/src/libmpeg2new/libmpeg2/motion_comp_mlib.c b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_mlib.c
index 71c085029..71c085029 100644
--- a/src/libmpeg2new/libmpeg2/motion_comp_mlib.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_mlib.c
diff --git a/src/libmpeg2new/libmpeg2/motion_comp_mmx.c b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_mmx.c
index 8694bdfea..8694bdfea 100644
--- a/src/libmpeg2new/libmpeg2/motion_comp_mmx.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_mmx.c
diff --git a/src/libmpeg2new/libmpeg2/motion_comp_vis.c b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_vis.c
index e4b61aaa7..e4b61aaa7 100644
--- a/src/libmpeg2new/libmpeg2/motion_comp_vis.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/motion_comp_vis.c
diff --git a/src/libmpeg2new/libmpeg2/mpeg2_internal.h b/src/video_dec/libmpeg2new/libmpeg2/mpeg2_internal.h
index fec7d4744..fec7d4744 100644
--- a/src/libmpeg2new/libmpeg2/mpeg2_internal.h
+++ b/src/video_dec/libmpeg2new/libmpeg2/mpeg2_internal.h
diff --git a/src/video_dec/libmpeg2new/libmpeg2/rgb.c b/src/video_dec/libmpeg2new/libmpeg2/rgb.c
new file mode 100644
index 000000000..e4abcacc2
--- /dev/null
+++ b/src/video_dec/libmpeg2new/libmpeg2/rgb.c
@@ -0,0 +1,598 @@
+/*
+ * rgb.c
+ * 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 mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 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 <xine/attributes.h>
+
+#include <inttypes.h>
+
+#include "mpeg2.h"
+#include "mpeg2convert.h"
+#include "convert_internal.h"
+
+static int matrix_coefficients = 6;
+
+static const int Inverse_Table_6_9[8][4] = {
+ {117504, 138453, 13954, 34903}, /* no sequence_display_extension */
+ {117504, 138453, 13954, 34903}, /* ITU-R Rec. 709 (1990) */
+ {104597, 132201, 25675, 53279}, /* unspecified */
+ {104597, 132201, 25675, 53279}, /* reserved */
+ {104448, 132798, 24759, 53109}, /* FCC */
+ {104597, 132201, 25675, 53279}, /* ITU-R Rec. 624-4 System B, G */
+ {104597, 132201, 25675, 53279}, /* SMPTE 170M */
+ {117579, 136230, 16907, 35559} /* SMPTE 240M (1987) */
+};
+
+static const uint8_t dither[] ATTR_ALIGN(32) = {
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
+ 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
+ 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
+ 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
+ 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
+ 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
+ 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
+ 3, 9, 27, 63, 1, 4, 25, 59, 5, 12, 28, 67, 3, 7, 26, 62,
+ 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
+ 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
+ 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
+ 19, 45, 11, 27, 17, 41, 9, 22, 21, 49, 13, 30, 19, 44, 11, 26,
+ 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
+ 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
+ 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
+ 0, 2, 24, 57, 6, 15, 30, 70, 0, 1, 23, 55, 6, 14, 29, 69,
+ 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
+ 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
+ 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
+ 16, 38, 8, 20, 22, 52, 14, 34, 16, 37, 8, 19, 21, 51, 14, 33,
+ 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
+ 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
+ 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
+ 4, 11, 28, 66, 2, 6, 26, 61, 4, 10, 27, 65, 2, 5, 25, 60,
+ 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
+ 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
+ 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
+ 20, 47, 12, 29, 18, 43, 10, 25, 20, 46, 12, 28, 18, 42, 10, 23,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 0, 0, 23, 54, 5, 13, 29, 68, 1, 3, 24, 58, 7, 17, 30, 71,
+ 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35,
+ 15, 36, 7, 18, 21, 50, 13, 31, 17, 39, 9, 21, 22, 53, 15, 35
+};
+
+static const uint8_t dither_temporal[64] = {
+ 0x00, 0x20, 0x21, 0x01, 0x40, 0x60, 0x61, 0x41,
+ 0x42, 0x62, 0x63, 0x43, 0x02, 0x22, 0x23, 0x03,
+ 0x80, 0xa0, 0xa1, 0x81, 0xc0, 0xe0, 0xe1, 0xc1,
+ 0xc2, 0xe2, 0xe3, 0xc3, 0x82, 0xa2, 0xa3, 0x83,
+ 0x84, 0xa4, 0xa5, 0x85, 0xc4, 0xe4, 0xe5, 0xc5,
+ 0xc6, 0xe6, 0xe7, 0xc7, 0x86, 0xa6, 0xa7, 0x87,
+ 0x04, 0x24, 0x25, 0x05, 0x44, 0x64, 0x65, 0x45,
+ 0x46, 0x66, 0x67, 0x47, 0x06, 0x26, 0x27, 0x07
+};
+
+typedef struct {
+ convert_rgb_t base;
+ void * table_rV[256];
+ void * table_gU[256];
+ int table_gV[256];
+ void * table_bU[256];
+} convert_rgb_c_t;
+
+#define RGB(type,i) \
+ U = pu[i]; \
+ V = pv[i]; \
+ r = (type *) id->table_rV[V]; \
+ g = (type *) (((uint8_t *)id->table_gU[U]) + id->table_gV[V]); \
+ b = (type *) id->table_bU[U];
+
+#define DST(py,dst,i,j) \
+ Y = py[i]; \
+ dst[i] = r[Y] + g[Y] + b[Y];
+
+#define DSTRGB(py,dst,i,j) \
+ Y = py[i]; \
+ dst[3*i] = r[Y]; dst[3*i+1] = g[Y]; dst[3*i+2] = b[Y];
+
+#define DSTBGR(py,dst,i,j) \
+ Y = py[i]; \
+ dst[3*i] = b[Y]; dst[3*i+1] = g[Y]; dst[3*i+2] = r[Y];
+
+#define DSTDITHER(py,dst,i,j) \
+ Y = py[i]; \
+ dst[i] = r[Y+pd[2*i+96*j]] + g[Y-pd[2*i+96*j]] + b[Y+pd[2*i+1+96*j]];
+
+#define DO(x) x
+#define SKIP(x)
+
+#define DECLARE_420(func,type,num,DST,DITHER) \
+static void func (void * _id, uint8_t * const * src, \
+ unsigned int v_offset) \
+{ \
+ const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \
+ type * dst_1; \
+ const uint8_t * py_1, * pu, * pv; \
+ int i; \
+ DITHER(uint8_t dithpos = id->base.dither_offset;) \
+ \
+ dst_1 = (type *)(id->base.rgb_ptr + id->base.rgb_slice * v_offset); \
+ py_1 = src[0]; pu = src[1]; pv = src[2]; \
+ \
+ i = 8; \
+ do { \
+ const uint8_t * py_2; \
+ int j, U, V, Y; \
+ const type * r, * g, * b; \
+ type * dst_2; \
+ DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \
+ \
+ dst_2 = (type *)((char *)dst_1 + id->base.rgb_stride); \
+ py_2 = py_1 + id->base.y_stride; \
+ j = id->base.width; \
+ do { \
+ RGB (type, 0) \
+ DST (py_1, dst_1, 0, 0) \
+ DST (py_1, dst_1, 1, 0) \
+ DST (py_2, dst_2, 0, 1) \
+ DST (py_2, dst_2, 1, 1) \
+ \
+ RGB (type, 1) \
+ DST (py_2, dst_2, 2, 1) \
+ DST (py_2, dst_2, 3, 1) \
+ DST (py_1, dst_1, 2, 0) \
+ DST (py_1, dst_1, 3, 0) \
+ \
+ RGB (type, 2) \
+ DST (py_1, dst_1, 4, 0) \
+ DST (py_1, dst_1, 5, 0) \
+ DST (py_2, dst_2, 4, 1) \
+ DST (py_2, dst_2, 5, 1) \
+ \
+ RGB (type, 3) \
+ DST (py_2, dst_2, 6, 1) \
+ DST (py_2, dst_2, 7, 1) \
+ DST (py_1, dst_1, 6, 0) \
+ DST (py_1, dst_1, 7, 0) \
+ \
+ pu += 4; \
+ pv += 4; \
+ py_1 += 8; \
+ py_2 += 8; \
+ dst_1 += 8 * num; \
+ dst_2 += 8 * num; \
+ } while (--j); \
+ if (--i == id->base.field) { \
+ dst_1 = (type *)(id->base.rgb_ptr + \
+ id->base.rgb_slice * (v_offset + 1)); \
+ py_1 = src[0] + id->base.y_stride_frame; \
+ pu = src[1] + id->base.uv_stride_frame; \
+ pv = src[2] + id->base.uv_stride_frame; \
+ } else { \
+ py_1 += id->base.y_increm; \
+ pu += id->base.uv_increm; \
+ pv += id->base.uv_increm; \
+ dst_1 = (type *)((char *)dst_1 + id->base.rgb_increm); \
+ DITHER(dithpos += id->base.dither_stride;) \
+ } \
+ } while (i); \
+}
+
+DECLARE_420 (rgb_c_32_420, uint32_t, 1, DST, SKIP)
+DECLARE_420 (rgb_c_24_rgb_420, uint8_t, 3, DSTRGB, SKIP)
+DECLARE_420 (rgb_c_24_bgr_420, uint8_t, 3, DSTBGR, SKIP)
+DECLARE_420 (rgb_c_16_420, uint16_t, 1, DST, SKIP)
+DECLARE_420 (rgb_c_8_420, uint8_t, 1, DSTDITHER, DO)
+
+#define DECLARE_422(func,type,num,DST,DITHER) \
+static void func (void * _id, uint8_t * const * src, \
+ unsigned int v_offset) \
+{ \
+ const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \
+ type * dst; \
+ const uint8_t * py, * pu, * pv; \
+ int i; \
+ DITHER(uint8_t dithpos = id->base.dither_offset;) \
+ \
+ dst = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset); \
+ py = src[0]; pu = src[1]; pv = src[2]; \
+ \
+ i = 16; \
+ do { \
+ int j, U, V, Y; \
+ const type * r, * g, * b; \
+ DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \
+ \
+ j = id->base.width; \
+ do { \
+ RGB (type, 0) \
+ DST (py, dst, 0, 0) \
+ DST (py, dst, 1, 0) \
+ \
+ RGB (type, 1) \
+ DST (py, dst, 2, 0) \
+ DST (py, dst, 3, 0) \
+ \
+ RGB (type, 2) \
+ DST (py, dst, 4, 0) \
+ DST (py, dst, 5, 0) \
+ \
+ RGB (type, 3) \
+ DST (py, dst, 6, 0) \
+ DST (py, dst, 7, 0) \
+ \
+ pu += 4; \
+ pv += 4; \
+ py += 8; \
+ dst += 8 * num; \
+ } while (--j); \
+ py += id->base.y_increm; \
+ pu += id->base.uv_increm; \
+ pv += id->base.uv_increm; \
+ dst = (type *)((char *)dst + id->base.rgb_increm); \
+ DITHER(dithpos += id->base.dither_stride;) \
+ } while (--i); \
+}
+
+DECLARE_422 (rgb_c_32_422, uint32_t, 1, DST, SKIP)
+DECLARE_422 (rgb_c_24_rgb_422, uint8_t, 3, DSTRGB, SKIP)
+DECLARE_422 (rgb_c_24_bgr_422, uint8_t, 3, DSTBGR, SKIP)
+DECLARE_422 (rgb_c_16_422, uint16_t, 1, DST, SKIP)
+DECLARE_422 (rgb_c_8_422, uint8_t, 1, DSTDITHER, DO)
+
+#define DECLARE_444(func,type,num,DST,DITHER) \
+static void func (void * _id, uint8_t * const * src, \
+ unsigned int v_offset) \
+{ \
+ const convert_rgb_c_t * const id = (convert_rgb_c_t *) _id; \
+ type * dst; \
+ const uint8_t * py, * pu, * pv; \
+ int i; \
+ DITHER(uint8_t dithpos = id->base.dither_offset;) \
+ \
+ dst = (type *)(id->base.rgb_ptr + id->base.rgb_stride * v_offset); \
+ py = src[0]; pu = src[1]; pv = src[2]; \
+ \
+ i = 16; \
+ do { \
+ int j, U, V, Y; \
+ const type * r, * g, * b; \
+ DITHER(const uint8_t * const pd = dither + 2 * dithpos;) \
+ \
+ j = id->base.width; \
+ do { \
+ RGB (type, 0) \
+ DST (py, dst, 0, 0) \
+ RGB (type, 1) \
+ DST (py, dst, 1, 0) \
+ RGB (type, 2) \
+ DST (py, dst, 2, 0) \
+ RGB (type, 3) \
+ DST (py, dst, 3, 0) \
+ RGB (type, 4) \
+ DST (py, dst, 4, 0) \
+ RGB (type, 5) \
+ DST (py, dst, 5, 0) \
+ RGB (type, 6) \
+ DST (py, dst, 6, 0) \
+ RGB (type, 7) \
+ DST (py, dst, 7, 0) \
+ \
+ pu += 8; \
+ pv += 8; \
+ py += 8; \
+ dst += 8 * num; \
+ } while (--j); \
+ py += id->base.y_increm; \
+ pu += id->base.y_increm; \
+ pv += id->base.y_increm; \
+ dst = (type *)((char *)dst + id->base.rgb_increm); \
+ DITHER(dithpos += id->base.dither_stride;) \
+ } while (--i); \
+}
+
+DECLARE_444 (rgb_c_32_444, uint32_t, 1, DST, SKIP)
+DECLARE_444 (rgb_c_24_rgb_444, uint8_t, 3, DSTRGB, SKIP)
+DECLARE_444 (rgb_c_24_bgr_444, uint8_t, 3, DSTBGR, SKIP)
+DECLARE_444 (rgb_c_16_444, uint16_t, 1, DST, SKIP)
+DECLARE_444 (rgb_c_8_444, uint8_t, 1, DSTDITHER, DO)
+
+static void rgb_start (void * _id, const mpeg2_fbuf_t * fbuf,
+ const mpeg2_picture_t * picture,
+ const mpeg2_gop_t * gop)
+{
+ convert_rgb_t * id = (convert_rgb_t *) _id;
+ int uv_stride = id->uv_stride_frame;
+ id->y_stride = id->y_stride_frame;
+ id->rgb_ptr = fbuf->buf[0];
+ id->rgb_slice = id->rgb_stride = id->rgb_stride_frame;
+ id->dither_stride = 32;
+ id->dither_offset = dither_temporal[picture->temporal_reference & 63];
+ id->field = 0;
+ if ((picture->nb_fields == 1) ||
+ (id->chroma420 && !(picture->flags & PIC_FLAG_PROGRESSIVE_FRAME))) {
+ uv_stride <<= 1;
+ id->y_stride <<= 1;
+ id->rgb_stride <<= 1;
+ id->dither_stride <<= 1;
+ id->dither_offset += 16;
+ if (picture->nb_fields == 1) {
+ id->rgb_slice <<= 1;
+ if (!(picture->flags & PIC_FLAG_TOP_FIELD_FIRST)) {
+ id->rgb_ptr += id->rgb_stride_frame;
+ id->dither_offset += 32;
+ }
+ } else
+ id->field = 8 >> id->convert420;
+ }
+ id->y_increm = (id->y_stride << id->convert420) - id->y_stride_frame;
+ id->uv_increm = uv_stride - id->uv_stride_frame;
+ id->rgb_increm = (id->rgb_stride << id->convert420) - id->rgb_stride_min;
+ id->dither_stride <<= id->convert420;
+}
+
+static inline int div_round (int dividend, int divisor)
+{
+ if (dividend > 0)
+ return (dividend + (divisor>>1)) / divisor;
+ else
+ return -((-dividend + (divisor>>1)) / divisor);
+}
+
+static unsigned int rgb_c_init (convert_rgb_c_t * id,
+ mpeg2convert_rgb_order_t order,
+ unsigned int bpp)
+{
+ int i;
+ uint8_t table_Y[1024];
+ uint32_t * table_32 = 0;
+ uint16_t * table_16 = 0;
+ uint8_t * table_8 = 0;
+ uint8_t * table_332 = 0;
+ int entry_size = 0;
+ void * table_r = 0;
+ void * table_g = 0;
+ void * table_b = 0;
+
+ int crv = Inverse_Table_6_9[matrix_coefficients][0];
+ int cbu = Inverse_Table_6_9[matrix_coefficients][1];
+ int cgu = -Inverse_Table_6_9[matrix_coefficients][2];
+ int cgv = -Inverse_Table_6_9[matrix_coefficients][3];
+
+ for (i = 0; i < 1024; i++) {
+ int j;
+
+ j = (76309 * (i - 384 - 16) + 32768) >> 16;
+ table_Y[i] = (j < 0) ? 0 : ((j > 255) ? 255 : j);
+ }
+
+ switch (bpp) {
+ case 32:
+ if (!id)
+ return (197 + 2*682 + 256 + 132) * sizeof (uint32_t);
+ table_32 = (uint32_t *) (id + 1);
+ entry_size = sizeof (uint32_t);
+ table_r = table_32 + 197;
+ table_b = table_32 + 197 + 685;
+ table_g = table_32 + 197 + 2*682;
+
+ for (i = -197; i < 256+197; i++)
+ ((uint32_t *) table_r)[i] =
+ table_Y[i+384] << ((order == MPEG2CONVERT_RGB) ? 16 : 0);
+ for (i = -132; i < 256+132; i++)
+ ((uint32_t *) table_g)[i] = table_Y[i+384] << 8;
+ for (i = -232; i < 256+232; i++)
+ ((uint32_t *) table_b)[i] =
+ table_Y[i+384] << ((order == MPEG2CONVERT_RGB) ? 0 : 16);
+ break;
+
+ case 24:
+ if (!id)
+ return (256 + 2*232) * sizeof (uint8_t);
+ table_8 = (uint8_t *) (id + 1);
+ entry_size = sizeof (uint8_t);
+ table_r = table_g = table_b = table_8 + 232;
+
+ for (i = -232; i < 256+232; i++)
+ ((uint8_t * )table_b)[i] = table_Y[i+384];
+ break;
+
+ case 15:
+ case 16:
+ if (!id)
+ return (197 + 2*682 + 256 + 132) * sizeof (uint16_t);
+ table_16 = (uint16_t *) (id + 1);
+ entry_size = sizeof (uint16_t);
+ table_r = table_16 + 197;
+ table_b = table_16 + 197 + 685;
+ table_g = table_16 + 197 + 2*682;
+
+ for (i = -197; i < 256+197; i++) {
+ int j = table_Y[i+384] >> 3;
+
+ if (order == MPEG2CONVERT_RGB)
+ j <<= ((bpp==16) ? 11 : 10);
+
+ ((uint16_t *)table_r)[i] = j;
+ }
+ for (i = -132; i < 256+132; i++) {
+ int j = table_Y[i+384] >> ((bpp==16) ? 2 : 3);
+
+ ((uint16_t *)table_g)[i] = j << 5;
+ }
+ for (i = -232; i < 256+232; i++) {
+ int j = table_Y[i+384] >> 3;
+
+ if (order == MPEG2CONVERT_BGR)
+ j <<= ((bpp==16) ? 11 : 10);
+
+ ((uint16_t *)table_b)[i] = j;
+ }
+ break;
+
+ case 8:
+ if (!id)
+ return (197 + 2*682 + 256 + 232 + 71) * sizeof (uint8_t);
+ table_332 = (uint8_t *) (id + 1);
+ entry_size = sizeof (uint8_t);
+ table_r = table_332 + 197;
+ table_g = table_332 + 197 + 682 + 30;
+ table_b = table_332 + 197 + 2*682;
+
+ for (i = -197; i < 256+197+30; i++)
+ ((uint8_t *)table_r)[i] = ((table_Y[i+384] * 7 / 255) <<
+ (order == MPEG2CONVERT_RGB ? 5 : 0));
+ for (i = -132; i < 256+132+30; i++)
+ ((uint8_t *)table_g)[i-30] = ((table_Y[i+384] * 7 / 255) <<
+ (order == MPEG2CONVERT_RGB ? 2 : 3));
+ for (i = -232; i < 256+232+71; i++)
+ ((uint8_t *)table_b)[i] = ((table_Y[i+384] / 85) <<
+ (order == MPEG2CONVERT_RGB ? 0 : 6));
+ break;
+ }
+
+ for (i = 0; i < 256; i++) {
+ id->table_rV[i] = (((uint8_t *)table_r) +
+ entry_size * div_round (crv * (i-128), 76309));
+ id->table_gU[i] = (((uint8_t *)table_g) +
+ entry_size * div_round (cgu * (i-128), 76309));
+ id->table_gV[i] = entry_size * div_round (cgv * (i-128), 76309);
+ id->table_bU[i] = (((uint8_t *)table_b) +
+ entry_size * div_round (cbu * (i-128), 76309));
+ }
+
+ return 0;
+}
+
+static int rgb_internal (mpeg2convert_rgb_order_t order, unsigned int bpp,
+ int stage, void * _id, const mpeg2_sequence_t * seq,
+ int stride, uint32_t accel, void * arg,
+ mpeg2_convert_init_t * result)
+{
+ convert_rgb_t * id = (convert_rgb_t *) _id;
+ mpeg2convert_copy_t * copy = (mpeg2convert_copy_t *) 0;
+ unsigned int id_size = sizeof (convert_rgb_t);
+ int chroma420 = (seq->chroma_height < seq->height);
+ int convert420 = 0;
+ int rgb_stride_min = ((bpp + 7) >> 3) * seq->width;
+
+#ifdef ARCH_X86
+ if (!copy && (accel & MPEG2_ACCEL_X86_MMXEXT)) {
+ convert420 = 0;
+ copy = mpeg2convert_rgb_mmxext (order, bpp, seq);
+ }
+ if (!copy && (accel & MPEG2_ACCEL_X86_MMX)) {
+ convert420 = 0;
+ copy = mpeg2convert_rgb_mmx (order, bpp, seq);
+ }
+#endif
+#ifdef ARCH_SPARC
+ if (!copy && (accel & MPEG2_ACCEL_SPARC_VIS)) {
+ convert420 = chroma420;
+ copy = mpeg2convert_rgb_vis (order, bpp, seq);
+ }
+#endif
+ if (!copy) {
+ int src, dest;
+ static void (* rgb_c[3][5]) (void *, uint8_t * const *,
+ unsigned int) =
+ {{rgb_c_24_bgr_420, rgb_c_8_420, rgb_c_16_420,
+ rgb_c_24_rgb_420, rgb_c_32_420},
+ {rgb_c_24_bgr_422, rgb_c_8_422, rgb_c_16_422,
+ rgb_c_24_rgb_422, rgb_c_32_422},
+ {rgb_c_24_bgr_444, rgb_c_8_444, rgb_c_16_444,
+ rgb_c_24_rgb_444, rgb_c_32_444}};
+
+ convert420 = chroma420;
+ id_size = (sizeof (convert_rgb_c_t) +
+ rgb_c_init ((convert_rgb_c_t *) id, order, bpp));
+ src = ((seq->chroma_width == seq->width) +
+ (seq->chroma_height == seq->height));
+ dest = ((bpp == 24 && order == MPEG2CONVERT_BGR) ? 0 : (bpp + 7) >> 3);
+ copy = rgb_c[src][dest];
+ }
+
+ result->id_size = id_size;
+
+ if (stride < rgb_stride_min)
+ stride = rgb_stride_min;
+
+ if (stage == MPEG2_CONVERT_STRIDE)
+ return stride;
+ else if (stage == MPEG2_CONVERT_START) {
+ id->width = seq->width >> 3;
+ id->y_stride_frame = seq->width;
+ id->uv_stride_frame = seq->chroma_width;
+ id->rgb_stride_frame = stride;
+ id->rgb_stride_min = rgb_stride_min;
+ id->chroma420 = chroma420;
+ id->convert420 = convert420;
+ result->buf_size[0] = stride * seq->height;
+ result->buf_size[1] = result->buf_size[2] = 0;
+ result->start = rgb_start;
+ result->copy = copy;
+ }
+ return 0;
+}
+
+#define DECLARE(func,order,bpp) \
+int func (int stage, void * id, \
+ const mpeg2_sequence_t * sequence, int stride, \
+ uint32_t accel, void * arg, mpeg2_convert_init_t * result) \
+{ \
+ return rgb_internal (order, bpp, stage, id, sequence, stride, \
+ accel, arg, result); \
+}
+
+DECLARE (mpeg2convert_rgb32, MPEG2CONVERT_RGB, 32)
+DECLARE (mpeg2convert_rgb24, MPEG2CONVERT_RGB, 24)
+DECLARE (mpeg2convert_rgb16, MPEG2CONVERT_RGB, 16)
+DECLARE (mpeg2convert_rgb15, MPEG2CONVERT_RGB, 15)
+DECLARE (mpeg2convert_rgb8, MPEG2CONVERT_RGB, 8)
+DECLARE (mpeg2convert_bgr32, MPEG2CONVERT_BGR, 32)
+DECLARE (mpeg2convert_bgr24, MPEG2CONVERT_BGR, 24)
+DECLARE (mpeg2convert_bgr16, MPEG2CONVERT_BGR, 16)
+DECLARE (mpeg2convert_bgr15, MPEG2CONVERT_BGR, 15)
+DECLARE (mpeg2convert_bgr8, MPEG2CONVERT_BGR, 8)
+
+mpeg2_convert_t * mpeg2convert_rgb (mpeg2convert_rgb_order_t order,
+ unsigned int bpp)
+{
+ static mpeg2_convert_t * table[5][2] =
+ {{mpeg2convert_rgb15, mpeg2convert_bgr15},
+ {mpeg2convert_rgb8, mpeg2convert_bgr8},
+ {mpeg2convert_rgb16, mpeg2convert_bgr16},
+ {mpeg2convert_rgb24, mpeg2convert_bgr24},
+ {mpeg2convert_rgb32, mpeg2convert_bgr32}};
+
+ if (order == MPEG2CONVERT_RGB || order == MPEG2CONVERT_BGR) {
+ if (bpp == 15)
+ return table[0][order == MPEG2CONVERT_BGR];
+ else if (bpp >= 8 && bpp <= 32 && (bpp & 7) == 0)
+ return table[bpp >> 3][order == MPEG2CONVERT_BGR];
+ }
+ return (mpeg2_convert_t *) 0;
+}
diff --git a/src/video_dec/libmpeg2new/libmpeg2/rgb_mmx.c b/src/video_dec/libmpeg2new/libmpeg2/rgb_mmx.c
new file mode 100644
index 000000000..6ca7e65a8
--- /dev/null
+++ b/src/video_dec/libmpeg2new/libmpeg2/rgb_mmx.c
@@ -0,0 +1,321 @@
+/*
+ * rgb_mmx.c
+ * Copyright (C) 2000-2003 Silicon Integrated System Corp.
+ * All Rights Reserved.
+ *
+ * Author: Olie Lho <ollie@sis.com.tw>
+ *
+ * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#ifdef ARCH_X86
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <inttypes.h>
+
+#include "mpeg2.h"
+#include "mpeg2convert.h"
+#include "convert_internal.h"
+#include <xine/attributes.h>
+#include "mmx.h"
+
+#define CPU_MMXEXT 0
+#define CPU_MMX 1
+
+/* CPU_MMXEXT/CPU_MMX adaptation layer */
+
+#define movntq(src,dest) \
+do { \
+ if (cpu == CPU_MMXEXT) \
+ movntq_r2m (src, dest); \
+ else \
+ movq_r2m (src, dest); \
+} while (0)
+
+static inline void mmx_yuv2rgb (uint8_t * py, uint8_t * pu, uint8_t * pv)
+{
+ static mmx_t mmx_80w = {0x0080008000800080LL};
+ static mmx_t mmx_U_green = {0xf37df37df37df37dLL};
+ static mmx_t mmx_U_blue = {0x4093409340934093LL};
+ static mmx_t mmx_V_red = {0x3312331233123312LL};
+ static mmx_t mmx_V_green = {0xe5fce5fce5fce5fcLL};
+ static mmx_t mmx_10w = {0x1010101010101010LL};
+ static mmx_t mmx_00ffw = {0x00ff00ff00ff00ffLL};
+ static mmx_t mmx_Y_coeff = {0x253f253f253f253fLL};
+
+ movd_m2r (*pu, mm0); /* mm0 = 00 00 00 00 u3 u2 u1 u0 */
+ movd_m2r (*pv, mm1); /* mm1 = 00 00 00 00 v3 v2 v1 v0 */
+ movq_m2r (*py, mm6); /* mm6 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */
+ pxor_r2r (mm4, mm4); /* mm4 = 0 */
+ /* XXX might do cache preload for image here */
+
+ /*
+ * Do the multiply part of the conversion for even and odd pixels
+ * register usage:
+ * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels
+ * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd pixels
+ * mm6 -> Y even, mm7 -> Y odd
+ */
+
+ punpcklbw_r2r (mm4, mm0); /* mm0 = u3 u2 u1 u0 */
+ punpcklbw_r2r (mm4, mm1); /* mm1 = v3 v2 v1 v0 */
+ psubsw_m2r (mmx_80w, mm0); /* u -= 128 */
+ psubsw_m2r (mmx_80w, mm1); /* v -= 128 */
+ psllw_i2r (3, mm0); /* promote precision */
+ psllw_i2r (3, mm1); /* promote precision */
+ movq_r2r (mm0, mm2); /* mm2 = u3 u2 u1 u0 */
+ movq_r2r (mm1, mm3); /* mm3 = v3 v2 v1 v0 */
+ pmulhw_m2r (mmx_U_green, mm2); /* mm2 = u * u_green */
+ pmulhw_m2r (mmx_V_green, mm3); /* mm3 = v * v_green */
+ pmulhw_m2r (mmx_U_blue, mm0); /* mm0 = chroma_b */
+ pmulhw_m2r (mmx_V_red, mm1); /* mm1 = chroma_r */
+ paddsw_r2r (mm3, mm2); /* mm2 = chroma_g */
+
+ psubusb_m2r (mmx_10w, mm6); /* Y -= 16 */
+ movq_r2r (mm6, mm7); /* mm7 = Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0 */
+ pand_m2r (mmx_00ffw, mm6); /* mm6 = Y6 Y4 Y2 Y0 */
+ psrlw_i2r (8, mm7); /* mm7 = Y7 Y5 Y3 Y1 */
+ psllw_i2r (3, mm6); /* promote precision */
+ psllw_i2r (3, mm7); /* promote precision */
+ pmulhw_m2r (mmx_Y_coeff, mm6); /* mm6 = luma_rgb even */
+ pmulhw_m2r (mmx_Y_coeff, mm7); /* mm7 = luma_rgb odd */
+
+ /*
+ * Do the addition part of the conversion for even and odd pixels
+ * register usage:
+ * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels
+ * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd pixels
+ * mm6 -> Y even, mm7 -> Y odd
+ */
+
+ movq_r2r (mm0, mm3); /* mm3 = chroma_b */
+ movq_r2r (mm1, mm4); /* mm4 = chroma_r */
+ movq_r2r (mm2, mm5); /* mm5 = chroma_g */
+ paddsw_r2r (mm6, mm0); /* mm0 = B6 B4 B2 B0 */
+ paddsw_r2r (mm7, mm3); /* mm3 = B7 B5 B3 B1 */
+ paddsw_r2r (mm6, mm1); /* mm1 = R6 R4 R2 R0 */
+ paddsw_r2r (mm7, mm4); /* mm4 = R7 R5 R3 R1 */
+ paddsw_r2r (mm6, mm2); /* mm2 = G6 G4 G2 G0 */
+ paddsw_r2r (mm7, mm5); /* mm5 = G7 G5 G3 G1 */
+ packuswb_r2r (mm0, mm0); /* saturate to 0-255 */
+ packuswb_r2r (mm1, mm1); /* saturate to 0-255 */
+ packuswb_r2r (mm2, mm2); /* saturate to 0-255 */
+ packuswb_r2r (mm3, mm3); /* saturate to 0-255 */
+ packuswb_r2r (mm4, mm4); /* saturate to 0-255 */
+ packuswb_r2r (mm5, mm5); /* saturate to 0-255 */
+ punpcklbw_r2r (mm3, mm0); /* mm0 = B7 B6 B5 B4 B3 B2 B1 B0 */
+ punpcklbw_r2r (mm4, mm1); /* mm1 = R7 R6 R5 R4 R3 R2 R1 R0 */
+ punpcklbw_r2r (mm5, mm2); /* mm2 = G7 G6 G5 G4 G3 G2 G1 G0 */
+}
+
+static inline void mmx_unpack_16rgb (uint8_t * image, const int cpu)
+{
+ static mmx_t mmx_bluemask = {0xf8f8f8f8f8f8f8f8LL};
+ static mmx_t mmx_greenmask = {0xfcfcfcfcfcfcfcfcLL};
+ static mmx_t mmx_redmask = {0xf8f8f8f8f8f8f8f8LL};
+
+ /*
+ * convert RGB plane to RGB 16 bits
+ * mm0 -> B, mm1 -> R, mm2 -> G
+ * mm4 -> GB, mm5 -> AR pixel 4-7
+ * mm6 -> GB, mm7 -> AR pixel 0-3
+ */
+
+ pand_m2r (mmx_bluemask, mm0); /* mm0 = b7b6b5b4b3______ */
+ pand_m2r (mmx_greenmask, mm2); /* mm2 = g7g6g5g4g3g2____ */
+ pand_m2r (mmx_redmask, mm1); /* mm1 = r7r6r5r4r3______ */
+ psrlq_i2r (3, mm0); /* mm0 = ______b7b6b5b4b3 */
+ pxor_r2r (mm4, mm4); /* mm4 = 0 */
+ movq_r2r (mm0, mm5); /* mm5 = ______b7b6b5b4b3 */
+ movq_r2r (mm2, mm7); /* mm7 = g7g6g5g4g3g2____ */
+
+ punpcklbw_r2r (mm4, mm2);
+ punpcklbw_r2r (mm1, mm0);
+ psllq_i2r (3, mm2);
+ por_r2r (mm2, mm0);
+ movntq (mm0, *image);
+
+ punpckhbw_r2r (mm4, mm7);
+ punpckhbw_r2r (mm1, mm5);
+ psllq_i2r (3, mm7);
+ por_r2r (mm7, mm5);
+ movntq (mm5, *(image+8));
+}
+
+static inline void mmx_unpack_32rgb (uint8_t * image, const int cpu)
+{
+ /*
+ * convert RGB plane to RGB packed format,
+ * mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> 0,
+ * mm4 -> GB, mm5 -> AR pixel 4-7,
+ * mm6 -> GB, mm7 -> AR pixel 0-3
+ */
+
+ pxor_r2r (mm3, mm3);
+ movq_r2r (mm0, mm6);
+ movq_r2r (mm1, mm7);
+ movq_r2r (mm0, mm4);
+ movq_r2r (mm1, mm5);
+ punpcklbw_r2r (mm2, mm6);
+ punpcklbw_r2r (mm3, mm7);
+ punpcklwd_r2r (mm7, mm6);
+ movntq (mm6, *image);
+ movq_r2r (mm0, mm6);
+ punpcklbw_r2r (mm2, mm6);
+ punpckhwd_r2r (mm7, mm6);
+ movntq (mm6, *(image+8));
+ punpckhbw_r2r (mm2, mm4);
+ punpckhbw_r2r (mm3, mm5);
+ punpcklwd_r2r (mm5, mm4);
+ movntq (mm4, *(image+16));
+ movq_r2r (mm0, mm4);
+ punpckhbw_r2r (mm2, mm4);
+ punpckhwd_r2r (mm5, mm4);
+ movntq (mm4, *(image+24));
+}
+
+static inline void rgb16 (void * const _id, uint8_t * const * src,
+ const unsigned int v_offset, const int cpu)
+{
+ convert_rgb_t * const id = (convert_rgb_t *) _id;
+ uint8_t * dst;
+ uint8_t * py, * pu, * pv;
+ int i, j;
+
+ dst = id->rgb_ptr + id->rgb_slice * v_offset;
+ py = src[0]; pu = src[1]; pv = src[2];
+
+ i = 16;
+ do {
+ j = id->width;
+ do {
+ mmx_yuv2rgb (py, pu, pv);
+ mmx_unpack_16rgb (dst, cpu);
+ py += 8;
+ pu += 4;
+ pv += 4;
+ dst += 16;
+ } while (--j);
+
+ dst += id->rgb_increm;
+ py += id->y_increm;
+ if (--i == id->field) {
+ dst = id->rgb_ptr + id->rgb_slice * (v_offset + 1);
+ py = src[0] + id->y_stride_frame;
+ pu = src[1] + id->uv_stride_frame;
+ pv = src[2] + id->uv_stride_frame;
+ } else if (! (i & id->chroma420)) {
+ pu += id->uv_increm;
+ pv += id->uv_increm;
+ } else {
+ pu -= id->uv_stride_frame;
+ pv -= id->uv_stride_frame;
+ }
+ } while (i);
+}
+
+static inline void argb32 (void * const _id, uint8_t * const * src,
+ const unsigned int v_offset, const int cpu)
+{
+ convert_rgb_t * const id = (convert_rgb_t *) _id;
+ uint8_t * dst;
+ uint8_t * py, * pu, * pv;
+ int i, j;
+
+ dst = id->rgb_ptr + id->rgb_slice * v_offset;
+ py = src[0]; pu = src[1]; pv = src[2];
+
+ i = 16;
+ do {
+ j = id->width;
+ do {
+ mmx_yuv2rgb (py, pu, pv);
+ mmx_unpack_32rgb (dst, cpu);
+ py += 8;
+ pu += 4;
+ pv += 4;
+ dst += 32;
+ } while (--j);
+
+ dst += id->rgb_increm;
+ py += id->y_increm;
+ if (--i == id->field) {
+ dst = id->rgb_ptr + id->rgb_slice * (v_offset + 1);
+ py = src[0] + id->y_stride_frame;
+ pu = src[1] + id->uv_stride_frame;
+ pv = src[2] + id->uv_stride_frame;
+ } else if (! (i & id->chroma420)) {
+ pu += id->uv_increm;
+ pv += id->uv_increm;
+ } else {
+ pu -= id->uv_stride_frame;
+ pv -= id->uv_stride_frame;
+ }
+ } while (i);
+}
+
+static void mmxext_rgb16 (void * id, uint8_t * const * src,
+ unsigned int v_offset)
+{
+ rgb16 (id, src, v_offset, CPU_MMXEXT);
+}
+
+static void mmxext_argb32 (void * id, uint8_t * const * src,
+ unsigned int v_offset)
+{
+ argb32 (id, src, v_offset, CPU_MMXEXT);
+}
+
+static void mmx_rgb16 (void * id, uint8_t * const * src, unsigned int v_offset)
+{
+ rgb16 (id, src, v_offset, CPU_MMX);
+}
+
+static void mmx_argb32 (void * id, uint8_t * const * src,
+ unsigned int v_offset)
+{
+ argb32 (id, src, v_offset, CPU_MMX);
+}
+
+mpeg2convert_copy_t * mpeg2convert_rgb_mmxext (int order, int bpp,
+ const mpeg2_sequence_t * seq)
+{
+ if (order == MPEG2CONVERT_RGB && seq->chroma_width < seq->width) {
+ if (bpp == 16)
+ return mmxext_rgb16;
+ else if (bpp == 32)
+ return mmxext_argb32;
+ }
+ return NULL; /* Fallback to C */
+}
+
+mpeg2convert_copy_t * mpeg2convert_rgb_mmx (int order, int bpp,
+ const mpeg2_sequence_t * seq)
+{
+ if (order == MPEG2CONVERT_RGB && seq->chroma_width < seq->width) {
+ if (bpp == 16)
+ return mmx_rgb16;
+ else if (bpp == 32)
+ return mmx_argb32;
+ }
+ return NULL; /* Fallback to C */
+}
+#endif
diff --git a/src/video_dec/libmpeg2new/libmpeg2/rgb_vis.c b/src/video_dec/libmpeg2new/libmpeg2/rgb_vis.c
new file mode 100644
index 000000000..cbd7c7072
--- /dev/null
+++ b/src/video_dec/libmpeg2new/libmpeg2/rgb_vis.c
@@ -0,0 +1,384 @@
+/*
+ * rgb_vis.c
+ * Copyright (C) 2003 David S. Miller <davem@redhat.com>
+ *
+ * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
+ * See http://libmpeg2.sourceforge.net/ for updates.
+ *
+ * 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "config.h"
+
+#ifdef ARCH_SPARC
+
+#include <stddef.h>
+#include <inttypes.h>
+
+#include "mpeg2.h"
+#include "mpeg2convert.h"
+#include "convert_internal.h"
+#include <xine/attributes.h>
+#include "vis.h"
+
+/* Based partially upon the MMX yuv2rgb code, see there for credits.
+ *
+ * The difference here is that since we have enough registers we
+ * process both even and odd scanlines in one pass.
+ */
+
+static const uint16_t const_2048[] ATTR_ALIGN(8) = {2048, 2048, 2048, 2048};
+static const uint16_t const_1024[] ATTR_ALIGN(8) = {1024, 1024, 1024, 1024};
+static const uint16_t const_128[] ATTR_ALIGN(8) = {128, 128, 128, 128};
+static const uint8_t const_Ugreen[] ATTR_ALIGN(8) =
+ {0xf3, 0x00, 0xf3, 0x00, 0xf3, 0x00, 0xf3, 0x00};
+static const uint8_t const_Vgreen[] ATTR_ALIGN(8) =
+ {0xe6, 0x00, 0xe6, 0x00, 0xe6, 0x00, 0xe6, 0x00};
+static const uint8_t const_Ublue_Vred[] ATTR_ALIGN(8) =
+ {0x41, 0x41, 0x41, 0x41, 0x33, 0x33, 0x33, 0x33};
+static const uint8_t const_Ycoeff[] ATTR_ALIGN(4) = {0x25, 0x25, 0x25, 0x25};
+
+#define TMP0 0
+#define TMP1 1
+#define TMP2 2
+#define TMP3 3
+#define TMP4 4
+#define TMP5 5
+#define TMP6 6
+#define TMP7 7
+#define TMP8 8
+#define TMP9 9
+#define TMP10 10
+#define TMP11 11
+#define TMP12 12
+#define TMP13 13
+
+#define CONST_UBLUE 14
+#define CONST_VRED 15
+#define CONST_2048 16
+
+#define BLUE8_EVEN 18
+#define BLUE8_ODD 19
+#define RED8_EVEN 20
+#define RED8_ODD 21
+#define GREEN8_EVEN 22
+#define GREEN8_ODD 23
+
+#define BLUE8_2_EVEN 24
+#define BLUE8_2_ODD 25
+#define RED8_2_EVEN 26
+#define RED8_2_ODD 27
+#define GREEN8_2_EVEN 28
+#define GREEN8_2_ODD 29
+
+#define CONST_YCOEFF 30
+#define ZEROS 31
+
+#define PU_0 32
+#define PU_2 34
+#define PV_0 36
+#define PV_2 38
+#define PY_0 40
+#define PY_2 42
+#define PY_4 44
+#define PY_6 46
+
+#define CONST_128 56
+#define CONST_1024 58
+#define CONST_VGREEN 60
+#define CONST_UGREEN 62
+
+static inline void vis_init_consts(void)
+{
+ vis_set_gsr(7 << VIS_GSR_SCALEFACT_SHIFT);
+
+ vis_ld64(const_2048[0], CONST_2048);
+ vis_ld64(const_1024[0], CONST_1024);
+ vis_ld64(const_Ugreen[0], CONST_UGREEN);
+ vis_ld64(const_Vgreen[0], CONST_VGREEN);
+ vis_fzeros(ZEROS);
+ vis_ld64(const_Ublue_Vred[0], CONST_UBLUE);
+ vis_ld32(const_Ycoeff[0], CONST_YCOEFF);
+ vis_ld64(const_128[0], CONST_128);
+}
+
+static inline void vis_yuv2rgb(uint8_t *py, uint8_t *pu, uint8_t *pv,
+ int y_stride)
+{
+ vis_ld32(pu[0], TMP0);
+
+ vis_ld32(pv[0], TMP2);
+
+ vis_ld64(py[0], TMP4);
+ vis_mul8x16au(TMP0, CONST_2048, PU_0);
+
+ vis_ld64_2(py, y_stride, TMP8);
+ vis_mul8x16au(TMP2, CONST_2048, PV_0);
+
+ vis_pmerge(TMP4, TMP5, TMP6);
+
+ vis_pmerge(TMP6, TMP7, TMP4);
+
+ vis_pmerge(TMP8, TMP9, TMP10);
+
+ vis_pmerge(TMP10, TMP11, TMP8);
+ vis_mul8x16au(TMP4, CONST_2048, PY_0);
+
+ vis_psub16(PU_0, CONST_1024, PU_0);
+ vis_mul8x16au(TMP5, CONST_2048, PY_2);
+
+ vis_psub16(PV_0, CONST_1024, PV_0);
+ vis_mul8x16au(TMP8, CONST_2048, PY_4);
+
+ vis_psub16(PY_0, CONST_128, PY_0);
+ vis_mul8x16au(TMP9, CONST_2048, PY_6);
+
+ vis_psub16(PY_2, CONST_128, PY_2);
+ vis_mul8x16(CONST_YCOEFF, PY_0, PY_0);
+
+ vis_psub16(PY_4, CONST_128, PY_4);
+ vis_mul8x16(CONST_YCOEFF, PY_2, PY_2);
+
+ vis_psub16(PY_6, CONST_128, PY_6);
+ vis_mul8x16(CONST_YCOEFF, PY_4, PY_4);
+
+ vis_mul8x16(CONST_YCOEFF, PY_6, PY_6);
+
+ vis_mul8sux16(CONST_UGREEN, PU_0, TMP0);
+
+ vis_mul8sux16(CONST_VGREEN, PV_0, TMP2);
+
+ vis_mul8x16(CONST_UBLUE, PU_0, TMP4);
+
+ vis_mul8x16(CONST_VRED, PV_0, TMP6);
+ vis_padd16(TMP0, TMP2, TMP10);
+
+ vis_padd16(PY_0, TMP4, TMP0);
+
+ vis_padd16(PY_2, TMP4, TMP2);
+ vis_pack16(TMP0, BLUE8_EVEN);
+
+ vis_padd16(PY_4, TMP4, TMP0);
+ vis_pack16(TMP2, BLUE8_ODD);
+
+ vis_padd16(PY_6, TMP4, TMP2);
+ vis_pack16(TMP0, BLUE8_2_EVEN);
+
+ vis_padd16(PY_0, TMP6, TMP0);
+ vis_pack16(TMP2, BLUE8_2_ODD);
+
+ vis_padd16(PY_2, TMP6, TMP2);
+ vis_pack16(TMP0, RED8_EVEN);
+
+ vis_padd16(PY_4, TMP6, TMP0);
+ vis_pack16(TMP2, RED8_ODD);
+
+ vis_padd16(PY_6, TMP6, TMP2);
+ vis_pack16(TMP0, RED8_2_EVEN);
+
+ vis_padd16(PY_0, TMP10, TMP0);
+ vis_pack16(TMP2, RED8_2_ODD);
+
+ vis_padd16(PY_2, TMP10, TMP2);
+ vis_pack16(TMP0, GREEN8_EVEN);
+
+ vis_padd16(PY_4, TMP10, TMP0);
+ vis_pack16(TMP2, GREEN8_ODD);
+
+ vis_padd16(PY_6, TMP10, TMP2);
+ vis_pack16(TMP0, GREEN8_2_EVEN);
+
+ vis_pack16(TMP2, GREEN8_2_ODD);
+ vis_pmerge(BLUE8_EVEN, BLUE8_ODD, BLUE8_EVEN);
+
+ vis_pmerge(BLUE8_2_EVEN, BLUE8_2_ODD, BLUE8_2_EVEN);
+
+ vis_pmerge(RED8_EVEN, RED8_ODD, RED8_EVEN);
+
+ vis_pmerge(RED8_2_EVEN, RED8_2_ODD, RED8_2_EVEN);
+
+ vis_pmerge(GREEN8_EVEN, GREEN8_ODD, GREEN8_EVEN);
+
+ vis_pmerge(GREEN8_2_EVEN, GREEN8_2_ODD, GREEN8_2_EVEN);
+}
+
+static inline void vis_unpack_32rgb(uint8_t *image, int stride)
+{
+ vis_pmerge(ZEROS, GREEN8_EVEN, TMP0);
+ vis_pmerge(RED8_EVEN, BLUE8_EVEN, TMP2);
+
+ vis_pmerge(TMP0, TMP2, TMP4);
+ vis_st64(TMP4, image[0]);
+
+ vis_pmerge(TMP1, TMP3, TMP6);
+ vis_st64_2(TMP6, image, 8);
+
+ vis_pmerge(ZEROS, GREEN8_ODD, TMP8);
+ vis_pmerge(RED8_ODD, BLUE8_ODD, TMP10);
+
+ vis_pmerge(TMP8, TMP10, TMP0);
+ vis_st64_2(TMP0, image, 16);
+
+ vis_pmerge(TMP9, TMP11, TMP2);
+ vis_st64_2(TMP2, image, 24);
+
+ image += stride;
+
+ vis_pmerge(ZEROS, GREEN8_2_EVEN, TMP0);
+ vis_pmerge(RED8_2_EVEN, BLUE8_2_EVEN, TMP2);
+
+ vis_pmerge(TMP0, TMP2, TMP4);
+ vis_st64(TMP4, image[0]);
+
+ vis_pmerge(TMP1, TMP3, TMP6);
+ vis_st64_2(TMP6, image, 8);
+
+ vis_pmerge(ZEROS, GREEN8_2_ODD, TMP8);
+ vis_pmerge(RED8_2_ODD, BLUE8_2_ODD, TMP10);
+
+ vis_pmerge(TMP8, TMP10, TMP0);
+ vis_st64_2(TMP0, image, 16);
+
+ vis_pmerge(TMP9, TMP11, TMP2);
+ vis_st64_2(TMP2, image, 24);
+}
+
+static inline void vis_unpack_32bgr(uint8_t *image, int stride)
+{
+ vis_pmerge(ZEROS, GREEN8_EVEN, TMP0);
+ vis_pmerge(BLUE8_EVEN, RED8_EVEN, TMP2);
+
+ vis_pmerge(TMP0, TMP2, TMP4);
+ vis_st64(TMP4, image[0]);
+
+ vis_pmerge(TMP1, TMP3, TMP6);
+ vis_st64_2(TMP6, image, 8);
+
+ vis_pmerge(ZEROS, GREEN8_ODD, TMP8);
+ vis_pmerge(BLUE8_ODD, RED8_ODD, TMP10);
+
+ vis_pmerge(TMP8, TMP10, TMP0);
+ vis_st64_2(TMP0, image, 16);
+
+ vis_pmerge(TMP9, TMP11, TMP2);
+ vis_st64_2(TMP2, image, 24);
+
+ image += stride;
+
+ vis_pmerge(ZEROS, GREEN8_2_EVEN, TMP0);
+ vis_pmerge(BLUE8_2_EVEN, RED8_2_EVEN, TMP2);
+
+ vis_pmerge(TMP0, TMP2, TMP4);
+ vis_st64(TMP4, image[0]);
+
+ vis_pmerge(TMP1, TMP3, TMP6);
+ vis_st64_2(TMP6, image, 8);
+
+ vis_pmerge(ZEROS, GREEN8_2_ODD, TMP8);
+ vis_pmerge(BLUE8_2_ODD, RED8_2_ODD, TMP10);
+
+ vis_pmerge(TMP8, TMP10, TMP0);
+ vis_st64_2(TMP0, image, 16);
+
+ vis_pmerge(TMP9, TMP11, TMP2);
+ vis_st64_2(TMP2, image, 24);
+}
+
+static inline void vis_yuv420_argb32(uint8_t *image,
+ uint8_t *py, uint8_t *pu, uint8_t *pv,
+ int width, int height, int rgb_stride,
+ int y_stride, int uv_stride)
+{
+ height >>= 1;
+ uv_stride -= width >> 1;
+ do {
+ int i = width >> 3;
+ do {
+ vis_yuv2rgb(py, pu, pv, y_stride);
+ vis_unpack_32rgb(image, rgb_stride);
+ py += 8;
+ pu += 4;
+ pv += 4;
+ image += 32;
+ } while (--i);
+
+ py += (y_stride << 1) - width;
+ image += (rgb_stride << 1) - 4 * width;
+ pu += uv_stride;
+ pv += uv_stride;
+ } while (--height);
+}
+
+static inline void vis_yuv420_abgr32(uint8_t *image,
+ uint8_t *py, uint8_t *pu, uint8_t *pv,
+ int width, int height, int rgb_stride,
+ int y_stride, int uv_stride)
+{
+ height >>= 1;
+ uv_stride -= width >> 1;
+ do {
+ int i = width >> 3;
+ do {
+ vis_yuv2rgb(py, pu, pv, y_stride);
+ vis_unpack_32bgr(image, rgb_stride);
+ py += 8;
+ pu += 4;
+ pv += 4;
+ image += 32;
+ } while (--i);
+
+ py += (y_stride << 1) - width;
+ image += (rgb_stride << 1) - 4 * width;
+ pu += uv_stride;
+ pv += uv_stride;
+ } while (--height);
+}
+
+static void vis_argb32(void *_id, uint8_t * const *src,
+ unsigned int v_offset)
+{
+ convert_rgb_t *id = (convert_rgb_t *) _id;
+
+ vis_init_consts();
+ vis_yuv420_argb32(id->rgb_ptr + id->rgb_stride * v_offset,
+ src[0], src[1], src[2], id->width, 16,
+ id->rgb_stride, id->y_stride, id->y_stride >> 1);
+}
+
+static void vis_abgr32(void *_id, uint8_t * const *src,
+ unsigned int v_offset)
+{
+ convert_rgb_t *id = (convert_rgb_t *) _id;
+
+ vis_init_consts();
+ vis_yuv420_abgr32(id->rgb_ptr + id->rgb_stride * v_offset,
+ src[0], src[1], src[2], id->width, 16,
+ id->rgb_stride, id->y_stride, id->y_stride >> 1);
+}
+
+mpeg2convert_copy_t *mpeg2convert_rgb_vis(int order, int bpp,
+ const mpeg2_sequence_t * seq)
+{
+ if (bpp == 32 && seq->chroma_height < seq->height) {
+ if (order == MPEG2CONVERT_RGB)
+ return vis_argb32;
+ if (order == MPEG2CONVERT_BGR)
+ return vis_abgr32;
+ }
+
+ return NULL; /* Fallback to C */
+}
+
+#endif /* ARCH_SPARC */
diff --git a/src/libmpeg2new/libmpeg2/slice.c b/src/video_dec/libmpeg2new/libmpeg2/slice.c
index ce4508639..ce4508639 100644
--- a/src/libmpeg2new/libmpeg2/slice.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/slice.c
diff --git a/src/libmpeg2new/libmpeg2/uyvy.c b/src/video_dec/libmpeg2new/libmpeg2/uyvy.c
index 7f107ffad..7f107ffad 100644
--- a/src/libmpeg2new/libmpeg2/uyvy.c
+++ b/src/video_dec/libmpeg2new/libmpeg2/uyvy.c
diff --git a/src/libmpeg2new/libmpeg2/vlc.h b/src/video_dec/libmpeg2new/libmpeg2/vlc.h
index 57448ce04..57448ce04 100644
--- a/src/libmpeg2new/libmpeg2/vlc.h
+++ b/src/video_dec/libmpeg2new/libmpeg2/vlc.h
diff --git a/src/video_dec/libmpeg2new/xine_mpeg2new_decoder.c b/src/video_dec/libmpeg2new/xine_mpeg2new_decoder.c
new file mode 100644
index 000000000..2678168e2
--- /dev/null
+++ b/src/video_dec/libmpeg2new/xine_mpeg2new_decoder.c
@@ -0,0 +1,512 @@
+/*
+ * 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
+ *
+ * stuff needed to turn libmpeg2 into a xine decoder plugin
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <assert.h>
+
+#include "./include/mpeg2.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+
+/*
+#define LOG
+#define LOG_FRAME_ALLOC_FREE
+#define LOG_ENTRY
+#define LOG_FRAME_COUNTER
+*/
+
+#define _x_abort() do {} while (0)
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} mpeg2_class_t;
+
+typedef struct {
+ uint32_t id;
+ vo_frame_t * img;
+} img_state_t;
+
+typedef struct mpeg2_video_decoder_s {
+ video_decoder_t video_decoder;
+ mpeg2dec_t *mpeg2dec;
+ mpeg2_class_t *class;
+ xine_stream_t *stream;
+ int32_t force_aspect;
+ int force_pan_scan;
+ double ratio;
+ img_state_t img_state[30];
+ uint32_t frame_number;
+ uint32_t rff_pattern;
+
+} mpeg2_video_decoder_t;
+
+#ifndef LOG_FRAME_ALLOC_FREE
+inline static void mpeg2_video_print_bad_state(img_state_t * img_state) {}
+#else
+static void mpeg2_video_print_bad_state(img_state_t * img_state) {
+ int32_t n,m;
+ m=0;
+ for(n=0;n<30;n++) {
+ if (img_state[n].id>0) {
+ printf("%d = %u\n",n, img_state[n].id);
+ m++;
+ }
+ }
+ if (m > 3) _x_abort();
+ if (m == 0) printf("NO FRAMES\n");
+}
+#endif
+
+static void mpeg2_video_free_all(img_state_t * img_state) {
+ int32_t n,m;
+ vo_frame_t * img;
+ printf("libmpeg2new:free_all\n");
+ for(n=0;n<30;n++) {
+ if (img_state[n].id>0) {
+ img = img_state[n].img;
+ img->free(img);
+ img_state[n].id = 0;
+ }
+ }
+}
+
+
+static void mpeg2_video_print_fbuf(const mpeg2_fbuf_t * fbuf) {
+ printf("%p",fbuf);
+ vo_frame_t * img;
+ if (fbuf) {
+ img = (vo_frame_t *) fbuf->id;
+ if (img) {
+ printf (", img=%p, (id=%d)\n",
+ img, img->id);
+ } else {
+ printf (", img=NULL\n");
+ }
+ } else {
+ printf ("\n");
+ }
+}
+
+static void mpeg2_video_decode_data (video_decoder_t *this_gen, buf_element_t *buf_element) {
+ mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
+ uint8_t * current = buf_element->content;
+ uint8_t * end = buf_element->content + buf_element->size;
+ const mpeg2_info_t * info;
+ mpeg2_state_t state;
+ vo_frame_t * img;
+ uint32_t picture_structure;
+ int32_t frame_skipping;
+
+ /* handle aspect hints from xine-dvdnav */
+ if (buf_element->decoder_flags & BUF_FLAG_SPECIAL) {
+ if (buf_element->decoder_info[1] == BUF_SPECIAL_ASPECT) {
+ this->force_aspect = buf_element->decoder_info[2];
+ if (buf_element->decoder_info[3] == 0x1 && buf_element->decoder_info[2] == 3)
+ /* letterboxing is denied, we have to do pan&scan */
+ this->force_pan_scan = 1;
+ else
+ this->force_pan_scan = 0;
+ }
+
+ return;
+ }
+
+ if (buf_element->decoder_flags != 0) return;
+
+#ifdef LOG_ENTRY
+ printf ("libmpeg2: decode_data: enter\n");
+#endif
+
+ mpeg2_buffer (this->mpeg2dec, current, end);
+
+ info = mpeg2_info (this->mpeg2dec);
+
+ while ((state = mpeg2_parse (this->mpeg2dec)) != STATE_BUFFER) {
+ switch (state) {
+ case STATE_SEQUENCE:
+ /* might set nb fbuf, convert format, stride */
+ /* might set fbufs */
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_BITRATE, info->sequence->byte_rate * 8);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, info->sequence->picture_width);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, info->sequence->picture_height);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, info->sequence->frame_period / 300);
+ if (this->force_aspect) ((mpeg2_sequence_t *)info->sequence)->pixel_width = this->force_aspect; /* ugly... */
+ switch (info->sequence->pixel_width) {
+ case 3:
+ this->ratio = 16.0 / 9.0;
+ break;
+ case 4:
+ this->ratio = 2.11;
+ break;
+ case 2:
+ this->ratio = 4.0 / 3.0;
+ break;
+ case 1:
+ default:
+ this->ratio = (double)info->sequence->picture_width/(double)info->sequence->picture_height;
+ break;
+ }
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, (int)(10000*this->ratio));
+
+ if (info->sequence->flags & SEQ_FLAG_MPEG2) {
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MPEG 2 (libmpeg2new)");
+ } else {
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "MPEG 1 (libmpeg2new)");
+ }
+
+ break;
+ case STATE_PICTURE:
+ /* might skip */
+ /* might set fbuf */
+ if (info->current_picture->nb_fields == 1) {
+ picture_structure = info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST ? VO_TOP_FIELD : VO_BOTTOM_FIELD;
+ } else {
+ picture_structure = VO_BOTH_FIELDS;
+ }
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ info->sequence->picture_width,
+ info->sequence->picture_height,
+ this->ratio,
+ XINE_IMGFMT_YV12,
+ picture_structure);
+ this->frame_number++;
+#ifdef LOG_FRAME_COUNTER
+ printf("libmpeg2:frame_number=%d\n",this->frame_number);
+#endif
+ img->top_field_first = info->current_picture->flags & PIC_FLAG_TOP_FIELD_FIRST ? 1 : 0;
+ img->repeat_first_field = (info->current_picture->nb_fields > 2) ? 1 : 0;
+ img->duration=info->sequence->frame_period / 300;
+ if( ((this->rff_pattern & 0xff) == 0xaa ||
+ (this->rff_pattern & 0xff) == 0x55) ) {
+ /* special case for ntsc 3:2 pulldown */
+ img->duration += img->duration/4;
+ } else {
+ if( img->repeat_first_field ) {
+ img->duration = (img->duration * info->current_picture->nb_fields) / 2;
+ }
+ }
+
+ if ((info->current_picture->flags & 7) == 1) {
+ img->pts=buf_element->pts; /* If an I frame, use PTS */
+ } else {
+ img->pts=0;
+ }
+
+
+#ifdef LOG_FRAME_ALLOC_FREE
+ printf ("libmpeg2:decode_data:get_frame xine=%p (id=%d)\n", img,img->id);
+#endif
+ if (this->img_state[img->id].id != 0) {
+ printf ("libmpeg2:decode_data:get_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id].id);
+ _x_abort();
+ }
+
+ this->img_state[img->id].id = 1;
+ this->img_state[img->id].img = img;
+
+ mpeg2_set_buf (this->mpeg2dec, img->base, img);
+ break;
+ case STATE_SLICE:
+ case STATE_END:
+#if 0
+ printf("libmpeg2:decode_data:current_fbuf=");
+ mpeg2_video_print_fbuf(info->current_fbuf);
+ printf("libmpeg2:decode_data:display_fbuf=");
+ mpeg2_video_print_fbuf(info->display_fbuf);
+ printf("libmpeg2:decode_data:discard_fbuf=");
+ mpeg2_video_print_fbuf(info->discard_fbuf);
+#endif
+ /* draw current picture */
+ /* might free frame buffer */
+ if (info->display_fbuf && info->display_fbuf->id) {
+ img = (vo_frame_t *) info->display_fbuf->id;
+ /* this should be used to detect any special rff pattern */
+ this->rff_pattern = this->rff_pattern << 1;
+ this->rff_pattern |= img->repeat_first_field;
+
+#ifdef LOG_FRAME_ALLOC_FREE
+ printf ("libmpeg2:decode_data:draw_frame xine=%p, fbuf=%p, id=%d \n", img, info->display_fbuf, img->id);
+#endif
+ if (this->img_state[img->id].id != 1) {
+ printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id].id);
+ _x_abort();
+ }
+ if (this->img_state[img->id].id == 1) {
+ frame_skipping = img->draw (img, this->stream);
+ /* FIXME: Handle skipping */
+ this->img_state[img->id].id = 2;
+ }
+
+ }
+ if (info->discard_fbuf && !info->discard_fbuf->id) {
+ printf ("libmpeg2:decode_data:BAD free_frame discard: xine=%p, fbuf=%p\n", info->discard_fbuf->id, info->discard_fbuf);
+ //_x_abort();
+ }
+ if (info->discard_fbuf && info->discard_fbuf->id) {
+ img = (vo_frame_t *) info->discard_fbuf->id;
+#ifdef LOG_FRAME_ALLOC_FREE
+ printf ("libmpeg2:decode_data:free_frame xine=%p, fbuf=%p,id=%d\n", img, info->discard_fbuf, img->id);
+#endif
+ if (this->img_state[img->id].id != 2) {
+ printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id].id);
+ _x_abort();
+ }
+ if (this->img_state[img->id].id == 2) {
+ img->free(img);
+ this->img_state[img->id].id = 0;
+ }
+ }
+#ifdef LOG_FRAME_ALLOC_FREE
+ mpeg2_video_print_bad_state(this->img_state);
+#endif
+ break;
+ case STATE_GOP:
+ break;
+ default:
+ printf("libmpeg2new: STATE unknown %d\n",state);
+ break;
+ }
+
+ }
+#ifdef LOG_ENTRY
+ printf ("libmpeg2: decode_data: exit\n");
+#endif
+
+}
+
+static void mpeg2_video_flush (video_decoder_t *this_gen) {
+ mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
+
+#ifdef LOG_ENTRY
+ printf ("libmpeg2: flush\n");
+#endif
+
+/* mpeg2_flush (&this->mpeg2); */
+}
+
+static void mpeg2_video_reset (video_decoder_t *this_gen) {
+ mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
+ int32_t state;
+ const mpeg2_info_t * info;
+ vo_frame_t * img;
+ int32_t frame_skipping;
+
+#ifdef LOG_ENTRY
+ printf ("libmpeg2: reset\n");
+#endif
+ mpeg2_reset (this->mpeg2dec, 1); /* 1 for full reset */
+ mpeg2_video_free_all(this->img_state);
+
+
+#if 0 /* This bit of code does not work yet. */
+ info = mpeg2_info (this->mpeg2dec);
+ state = mpeg2_reset (this->mpeg2dec);
+ printf("reset state1:%d\n",state);
+ if (info->display_fbuf && info->display_fbuf->id) {
+ img = (vo_frame_t *) info->display_fbuf->id;
+
+ if (this->img_state[img->id] != 1) {
+ printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
+ _x_abort();
+ }
+ if (this->img_state[img->id] == 1) {
+ frame_skipping = img->draw (img, this->stream);
+ /* FIXME: Handle skipping */
+ this->img_state[img->id] = 2;
+ }
+ }
+
+ if (info->discard_fbuf && !info->discard_fbuf->id) {
+ printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
+ _x_abort();
+ }
+ if (info->discard_fbuf && info->discard_fbuf->id) {
+ img = (vo_frame_t *) info->discard_fbuf->id;
+ if (this->img_state[img->id] != 2) {
+ printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
+ _x_abort();
+ }
+ if (this->img_state[img->id] == 2) {
+ img->free(img);
+ this->img_state[img->id] = 0;
+ }
+ }
+ state = mpeg2_parse (this->mpeg2dec);
+ printf("reset state2:%d\n",state);
+ if (info->display_fbuf && info->display_fbuf->id) {
+ img = (vo_frame_t *) info->display_fbuf->id;
+
+ if (this->img_state[img->id] != 1) {
+ printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
+ _x_abort();
+ }
+ if (this->img_state[img->id] == 1) {
+ frame_skipping = img->draw (img, this->stream);
+ /* FIXME: Handle skipping */
+ this->img_state[img->id] = 2;
+ }
+ }
+
+ if (info->discard_fbuf && !info->discard_fbuf->id) {
+ printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
+ _x_abort();
+ }
+ if (info->discard_fbuf && info->discard_fbuf->id) {
+ img = (vo_frame_t *) info->discard_fbuf->id;
+ if (this->img_state[img->id] != 2) {
+ printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
+ _x_abort();
+ }
+ if (this->img_state[img->id] == 2) {
+ img->free(img);
+ this->img_state[img->id] = 0;
+ }
+ }
+ state = mpeg2_parse (this->mpeg2dec);
+ printf("reset state3:%d\n",state);
+ if (info->display_fbuf && info->display_fbuf->id) {
+ img = (vo_frame_t *) info->display_fbuf->id;
+
+ if (this->img_state[img->id] != 1) {
+ printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
+ _x_abort();
+ }
+ if (this->img_state[img->id] == 1) {
+ frame_skipping = img->draw (img, this->stream);
+ /* FIXME: Handle skipping */
+ this->img_state[img->id] = 2;
+ }
+ }
+
+ if (info->discard_fbuf && !info->discard_fbuf->id) {
+ printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
+ _x_abort();
+ }
+ if (info->discard_fbuf && info->discard_fbuf->id) {
+ img = (vo_frame_t *) info->discard_fbuf->id;
+ if (this->img_state[img->id] != 2) {
+ printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
+ _x_abort();
+ }
+ if (this->img_state[img->id] == 2) {
+ img->free(img);
+ this->img_state[img->id] = 0;
+ }
+ }
+#endif
+
+}
+
+static void mpeg2_video_discontinuity (video_decoder_t *this_gen) {
+ mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
+
+#ifdef LOG_ENTRY
+ printf ("libmpeg2: dicontinuity\n");
+#endif
+/* mpeg2_discontinuity (&this->mpeg2dec); */
+}
+
+static void mpeg2_video_dispose (video_decoder_t *this_gen) {
+
+ mpeg2_video_decoder_t *this = (mpeg2_video_decoder_t *) this_gen;
+
+#ifdef LOG_ENTRY
+ printf ("libmpeg2: close\n");
+#endif
+
+ mpeg2_close (this->mpeg2dec);
+
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+
+ free (this);
+}
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+ mpeg2_video_decoder_t *this ;
+ int32_t n;
+
+ this = (mpeg2_video_decoder_t *) calloc(1, sizeof(mpeg2_video_decoder_t));
+
+ this->video_decoder.decode_data = mpeg2_video_decode_data;
+ this->video_decoder.flush = mpeg2_video_flush;
+ this->video_decoder.reset = mpeg2_video_reset;
+ this->video_decoder.discontinuity = mpeg2_video_discontinuity;
+ this->video_decoder.dispose = mpeg2_video_dispose;
+ this->stream = stream;
+ this->class = (mpeg2_class_t *) class_gen;
+ this->frame_number=0;
+ this->rff_pattern=0;
+
+ this->mpeg2dec = mpeg2_init ();
+ mpeg2_custom_fbuf (this->mpeg2dec, 1); /* <- Force libmpeg2 to use xine frame buffers. */
+ (stream->video_out->open) (stream->video_out, stream);
+ this->force_aspect = this->force_pan_scan = 0;
+ for(n=0;n<30;n++) this->img_state[n].id=0;
+
+ return &this->video_decoder;
+}
+
+/*
+ * mpeg2 plugin class
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ mpeg2_class_t *this;
+
+ this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "mpeg2new";
+ this->decoder_class.description = N_("mpeg2 based video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t supported_types[] = { BUF_VIDEO_MPEG, 0 };
+
+static const decoder_info_t dec_info_mpeg2 = {
+ supported_types, /* supported types */
+ 6 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "mpeg2new", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/libvdpau/Makefile.am b/src/video_dec/libvdpau/Makefile.am
new file mode 100644
index 000000000..781001a04
--- /dev/null
+++ b/src/video_dec/libvdpau/Makefile.am
@@ -0,0 +1,42 @@
+include $(top_srcdir)/misc/Makefile.quiet
+include $(top_srcdir)/misc/Makefile.common
+
+AM_CFLAGS = $(DEFAULT_OCFLAGS) $(VISIBILITY_FLAG)
+AM_LDFLAGS = $(xineplug_ldflags)
+
+noinst_HEADERS = alterh264_decode.h alterh264_bits_reader.h bits_reader.h dpb.h cpb.h h264_parser.h nal.h
+
+if ENABLE_VDPAU
+vdpau_h264_module = xineplug_decode_vdpau_h264.la
+VDPAU_CFLAGS += -D_ISOC99_SOURCE
+
+vdpau_h264_alter_module = xineplug_decode_vdpau_h264_alter.la
+
+vdpau_mpeg12_module = xineplug_decode_vdpau_mpeg12.la
+
+vdpau_vc1_module = xineplug_decode_vdpau_vc1.la
+
+vdpau_mpeg4_module = xineplug_decode_vdpau_mpeg4.la
+endif
+
+xineplug_LTLIBRARIES = $(vdpau_h264_module) $(vdpau_h264_alter_module) $(vdpau_mpeg12_module) $(vdpau_vc1_module) $(vdpau_mpeg4_module)
+
+xineplug_decode_vdpau_h264_alter_la_SOURCES = alterh264_decode.c
+xineplug_decode_vdpau_h264_alter_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_decode_vdpau_h264_alter_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS)
+
+xineplug_decode_vdpau_h264_la_SOURCES = nal.c dpb.c cpb.c h264_parser.c vdpau_h264.c
+xineplug_decode_vdpau_h264_la_CFLAGS = $(AM_CFLAGS) $(VDPAU_CFLAGS) -fno-strict-aliasing
+xineplug_decode_vdpau_h264_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) -lm
+
+xineplug_decode_vdpau_mpeg12_la_SOURCES = vdpau_mpeg12.c
+xineplug_decode_vdpau_mpeg12_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_decode_vdpau_mpeg12_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS)
+
+xineplug_decode_vdpau_vc1_la_SOURCES = vdpau_vc1.c
+xineplug_decode_vdpau_vc1_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_decode_vdpau_vc1_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS)
+
+xineplug_decode_vdpau_mpeg4_la_SOURCES = vdpau_mpeg4.c
+xineplug_decode_vdpau_mpeg4_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
+xineplug_decode_vdpau_mpeg4_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS)
diff --git a/src/video_dec/libvdpau/alterh264_bits_reader.h b/src/video_dec/libvdpau/alterh264_bits_reader.h
new file mode 100644
index 000000000..47a26aca1
--- /dev/null
+++ b/src/video_dec/libvdpau/alterh264_bits_reader.h
@@ -0,0 +1,127 @@
+/* kate: tab-indent on; indent-width 4; mixedindent off; indent-mode cstyle; remove-trailing-space on; */
+#ifndef ALTERH264_BITS_READER_H
+#define ALTERH264_BITS_READER_H
+#include <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+
+
+
+typedef struct {
+ uint8_t *buffer, *start;
+ int offbits, length, oflow;
+} bits_reader_t;
+
+
+
+static void
+bits_reader_set (bits_reader_t * br, uint8_t * buf, int len)
+{
+ br->buffer = br->start = buf;
+ br->offbits = 0;
+ br->length = len;
+ br->oflow = 0;
+}
+
+
+
+static inline uint32_t
+more_rbsp_data (bits_reader_t * br)
+{
+ uint8_t val[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+ uint8_t *buf = br->start + br->length;
+ int bit;
+
+ while (--buf >= br->buffer)
+ {
+ for (bit = 7; bit > -1; bit--)
+ if (*buf & val[bit])
+ return ((buf - br->buffer) * 8) - br->offbits + bit;
+ }
+ return 0;
+}
+
+
+
+static inline uint8_t
+bits_reader_shift (bits_reader_t * br)
+{
+ br->offbits = 0;
+ if ((br->buffer + 1) > (br->start + br->length - 1))
+ {
+ br->oflow = 1;
+ //printf("!!!!! buffer overflow !!!!!\n");
+ return 0;
+ }
+ ++br->buffer;
+ if ((*(br->buffer) == 3) && ((br->buffer - br->start) > 2)
+ && (*(br->buffer - 2) == 0) && (*(br->buffer - 1) == 0))
+ {
+ if ((br->buffer + 1) > (br->start + br->length - 1))
+ {
+ br->oflow = 1;
+ //printf("!!!!! buffer overflow !!!!!\n");
+ return 0;
+ }
+ ++br->buffer;
+ }
+ return 1;
+}
+
+
+
+static inline uint32_t
+read_bits (bits_reader_t * br, int nbits)
+{
+ uint8_t val[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
+ uint32_t res = 0;
+
+ while (nbits)
+ {
+ res = (res << 1) + ((*br->buffer & val[br->offbits]) ? 1 : 0);
+ --nbits;
+ ++br->offbits;
+ if (br->offbits > 7)
+ if (!bits_reader_shift (br))
+ return 1;
+ }
+ return res;
+}
+
+
+
+static inline void
+skip_bits (bits_reader_t * br, int nbits)
+{
+ while (nbits)
+ {
+ --nbits;
+ ++br->offbits;
+ if (br->offbits > 7)
+ bits_reader_shift (br);
+ }
+}
+
+
+
+static inline uint32_t
+read_exp_ue (bits_reader_t * br)
+{
+ int leading = -1;
+ uint8_t b;
+
+ for (b = 0; !b; leading++)
+ b = read_bits (br, 1);
+
+ return (1 << leading) - 1 + read_bits (br, leading);
+}
+
+
+
+static inline int32_t
+read_exp_se (bits_reader_t * br)
+{
+ uint32_t res = read_exp_ue (br);
+ return (res & 0x01) ? (res + 1) / 2 : -(res / 2);
+}
+#endif /* ALTERH264_BITS_READER_H */
diff --git a/src/video_dec/libvdpau/alterh264_decode.c b/src/video_dec/libvdpau/alterh264_decode.c
new file mode 100644
index 000000000..f11162f3e
--- /dev/null
+++ b/src/video_dec/libvdpau/alterh264_decode.c
@@ -0,0 +1,2448 @@
+/* kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
+ * Copyright (C) 2008 the xine project
+ * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
+ *
+ * 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, USA
+ *
+ * alterh264_decode.c, a H264 video stream parser using VDPAU hardware decoder
+ *
+ */
+
+#include "alterh264_decode.h"
+
+
+#define MAX_DPB_SIZE 16
+#define MIN_BUFFER_SIZE 10000
+#define MAX_BUFFER_SIZE 3145728
+
+#define NAL_UNSPECIFIED 0
+#define NAL_SLICE_NO_IDR 1
+#define NAL_SLICE_IDR 5
+#define NAL_SEI 6
+#define NAL_SEQUENCE 7
+#define NAL_PICTURE 8
+#define NAL_ACCES 9
+#define NAL_END_SEQUENCE 10
+#define NAL_END_STREAM 11
+#define NAL_SEQUENCE_EXT 13
+
+#define SLICE_TYPE_P 0
+#define SLICE_TYPE_B 1
+#define SLICE_TYPE_I 2
+#define SLICE_TYPE_SP 3
+#define SLICE_TYPE_SI 4
+
+#define START_IDR_FLAG 1000
+
+#define MAX_POC 2147483647
+
+#define DPB_DRAW_CLEAR 1
+#define DPB_DRAW_REFS 2
+#define DPB_DRAW_CURRENT 3
+
+//#define MAKE_DAT /*do NOT define this, unless you know what you do */
+#ifdef MAKE_DAT
+static int nframes;
+static FILE *outfile;
+#endif
+
+
+/*-------- DPB -------------------------------------------*/
+static void
+dpb_print (sequence_t * sequence)
+{
+ int i;
+ dpb_frame_t *frame;
+ uint32_t sf;
+
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ frame = sequence->dpb[i];
+ if (!frame->used)
+ break;
+ vo_frame_t *vo = (vo_frame_t *) frame->videoSurface;
+ vdpau_accel_t *accel;
+ if (vo)
+ accel = (vdpau_accel_t *) vo->accel_data;
+ sf = (vo) ? accel->surface : -1;
+ fprintf (stderr,
+ "{ i:%d u:%d c:%d pn:%d-%d ir:%d-%d tpoc:%d bpoc:%d sf:%u }\n",
+ i, frame->used, frame->completed, frame->PicNum[0],
+ frame->PicNum[1], frame->is_reference[0], frame->is_reference[1],
+ frame->TopFieldOrderCnt, frame->BottomFieldOrderCnt, sf);
+ }
+}
+
+
+
+static void
+dpb_clear_all_pts (sequence_t * sequence)
+{
+ int i;
+
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ if (!sequence->dpb[i]->used)
+ break;
+ sequence->dpb[i]->pts = 0;
+ }
+ sequence->cur_pic.pts = 0;
+ sequence->cur_pic.drop_pts = 1;
+}
+
+
+static void
+dpb_reset (sequence_t * sequence)
+{
+ int i;
+
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ if (sequence->dpb[i]->videoSurface)
+ sequence->dpb[i]->videoSurface->free (sequence->dpb[i]->videoSurface);
+ memset (sequence->dpb[i], 0, sizeof (dpb_frame_t));
+ }
+ if (sequence->cur_pic.videoSurface && !sequence->cur_pic.is_reference[0]
+ && !sequence->cur_pic.is_reference[1])
+ {
+ //fprintf(stderr, "freeing cur_pic\n");
+ sequence->cur_pic.videoSurface->free (sequence->cur_pic.videoSurface);
+ }
+}
+
+
+
+static void
+dpb_remove (sequence_t * sequence, int index)
+{
+ lprintf ("|||||||||||||||||||||||||||||||||||||||| dbp_remove\n");
+ int i;
+
+ dpb_frame_t *frame = sequence->dpb[index];
+ if (frame->videoSurface)
+ frame->videoSurface->free (frame->videoSurface);
+ memset (frame, 0, sizeof (dpb_frame_t));
+ for (i = index; i < (MAX_DPB_SIZE - 1); i++)
+ {
+ sequence->dpb[i] = sequence->dpb[i + 1];
+ if (!sequence->dpb[i]->used)
+ {
+ sequence->dpb[i + 1] = frame;
+ break;
+ }
+ }
+ if (i == (MAX_DPB_SIZE - 1))
+ sequence->dpb[i] = frame;
+}
+
+
+
+static dpb_frame_t *
+dpb_get_prev_ref (sequence_t * sequence)
+{
+ int i = MAX_DPB_SIZE - 1;
+
+ while (i > -1)
+ {
+ if (sequence->dpb[i]->used)
+ return sequence->dpb[i];
+ --i;
+ }
+
+ return NULL;
+}
+
+
+
+static void
+dpb_draw_frames (vdpau_h264_alter_decoder_t * this_gen, int32_t curpoc,
+ int draw_mode)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ int i, index = 0;
+ int32_t poc, tpoc;
+ dpb_frame_t *frame;
+
+ while (index > -1)
+ {
+ index = -1;
+ poc = curpoc;
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ frame = seq->dpb[i];
+ if (!frame->used)
+ break;
+ tpoc =
+ (frame->TopFieldOrderCnt >
+ frame->BottomFieldOrderCnt) ? frame->TopFieldOrderCnt : frame->
+ BottomFieldOrderCnt;
+ if (!frame->videoSurface->drawn && (tpoc <= poc))
+ {
+ poc = tpoc;
+ index = i;
+ }
+ }
+ if ((index > -1) && (poc <= curpoc))
+ {
+ //fprintf(stderr,"|||||||||||||||||||||||||||||||||||||||| dpb_draw_frame = %d\n", poc);
+ frame = seq->dpb[index];
+ frame->videoSurface->pts = frame->pts;
+ //fprintf(stderr,"H264 PTS = %llu\n", frame->pts);
+ frame->videoSurface->top_field_first = frame->top_field_first;
+ frame->videoSurface->draw (frame->videoSurface, this_gen->stream);
+ frame->videoSurface->drawn++;
+ if ((draw_mode != DPB_DRAW_CLEAR) && !frame->is_reference[0]
+ && !frame->is_reference[1])
+ dpb_remove (seq, index);
+ }
+ else
+ index = -1;
+ }
+
+ if (draw_mode == DPB_DRAW_CURRENT)
+ {
+ //fprintf(stderr,"|||||||||||||||||||||||||||||||||||||||| dpb_draw_frame = %d\n", curpoc);
+ frame = &seq->cur_pic;
+ frame->videoSurface->pts = frame->pts;
+ //fprintf(stderr,"H264 PTS = %llu\n", frame->pts);
+ frame->videoSurface->top_field_first = frame->top_field_first;
+ frame->videoSurface->draw (frame->videoSurface, this_gen->stream);
+ frame->videoSurface->free (frame->videoSurface);
+ }
+ else if (draw_mode == DPB_DRAW_CLEAR)
+ dpb_reset (seq);
+}
+
+
+
+static dpb_frame_t *
+dpb_get_PicNum (sequence_t * sequence, int32_t pic_num, int *index)
+{
+ dpb_frame_t *frame;
+ int i = 0;
+
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ frame = sequence->dpb[i];
+ if (!frame->used)
+ break;
+ if ((frame->PicNum[0] == pic_num) || (frame->PicNum[1] == pic_num))
+ {
+ *index = i;
+ return frame;
+ }
+ }
+ return 0;
+}
+
+
+
+static void
+dpb_mmc1 (vdpau_h264_alter_decoder_t * this_gen, int32_t picnum)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ int index;
+
+ lprintf ("dpb_mmc1\n");
+
+ dpb_frame_t *frame = dpb_get_PicNum (seq, picnum, &index);
+
+ if (frame)
+ {
+ frame->is_reference[0] = frame->is_reference[1] = 0;
+ if (frame->videoSurface->drawn)
+ dpb_remove (seq, index);
+ else
+ dpb_draw_frames (this_gen,
+ (frame->TopFieldOrderCnt >
+ frame->BottomFieldOrderCnt) ? frame->
+ TopFieldOrderCnt : frame->BottomFieldOrderCnt,
+ DPB_DRAW_REFS);
+ }
+}
+
+
+
+static void
+dbp_append (vdpau_h264_alter_decoder_t * this_gen, int second_field)
+{
+ sequence_t *sequence = (sequence_t *) & this_gen->sequence;
+ int i, index = 0, refs = 0;
+ int32_t fnw = MAX_POC;
+ slice_param_t *sl = &sequence->slice_param;
+ pic_param_t *pic = sequence->pic_param[sl->pic_parameter_set_id];
+ seq_param_t *sp = sequence->seq_param[pic->seq_parameter_set_id];
+ dpb_frame_t *tmp = 0, *cur_pic = &sequence->cur_pic;
+ int max = sp->num_ref_frames ? sp->num_ref_frames : 1;
+ max = (max > MAX_DPB_SIZE) ? MAX_DPB_SIZE : max;
+
+ vo_frame_t *vo = (vo_frame_t *) cur_pic->videoSurface;
+ vdpau_accel_t *accel = (vdpau_accel_t *) vo->accel_data;
+ lprintf
+ ("|||||||||||||||||||||||||||||||||||||||| dbp_append surface = %d\n",
+ accel->surface);
+
+ if (second_field)
+ {
+ tmp = dpb_get_prev_ref (sequence);
+ if (tmp)
+ {
+ memcpy (tmp, cur_pic, sizeof (dpb_frame_t));
+ cur_pic->videoSurface = NULL;
+ }
+ else
+ fprintf (stderr, "OOPS, no frame to store the second field ?!\n");
+ return;
+ }
+
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ if (!sequence->dpb[i]->used)
+ break;
+ if (sequence->dpb[i]->FrameNumWrap < fnw)
+ {
+ fnw = sequence->dpb[i]->FrameNumWrap;
+ index = i;
+ }
+ refs++;
+ }
+
+ if (refs >= max)
+ {
+ lprintf ("sliding window\n");
+ tmp = sequence->dpb[index],
+ tmp->is_reference[0] = tmp->is_reference[1] = 0;
+ if (tmp->videoSurface->drawn)
+ dpb_remove (sequence, index);
+ else
+ dpb_draw_frames (this_gen,
+ (tmp->TopFieldOrderCnt >
+ tmp->BottomFieldOrderCnt) ? tmp->
+ TopFieldOrderCnt : tmp->BottomFieldOrderCnt,
+ DPB_DRAW_REFS);
+
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ {
+ if (!sequence->dpb[i]->used)
+ break;
+ }
+ }
+
+ if (i < MAX_DPB_SIZE)
+ {
+ memcpy (sequence->dpb[i], cur_pic, sizeof (dpb_frame_t));
+ if (!cur_pic->field_pic_flag)
+ cur_pic->videoSurface = NULL;
+ }
+}
+
+/*--------------------------------------------------------*/
+
+
+
+static void
+reset_slices (sequence_t * sequence)
+{
+ sequence->slices_count = 0;
+ sequence->slice_mode = 0;
+}
+
+
+
+static void
+reset_sequence (sequence_t * sequence)
+{
+ sequence->prevFrameNum = 0;
+ sequence->prevFrameNumOffset = 0;
+ sequence->prevMMC5 = 0;
+
+ sequence->startup_frame = 0;
+ sequence->reset = 0;
+ sequence->chroma = 0;
+ sequence->pic_pts = 0;
+ sequence->bufpos = 0;
+ sequence->bufseek = 0;
+ sequence->start = -1;
+ reset_slices (sequence);
+ dpb_reset (sequence);
+ memset (&sequence->cur_pic, 0, sizeof (dpb_frame_t));
+ sequence->reset = VO_NEW_SEQUENCE_FLAG;
+ sequence->color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+}
+
+
+
+static void
+set_ratio (sequence_t * seq, seq_param_t * sp)
+{
+ if (seq->mode_frame && seq->ratio)
+ return;
+ if (!seq->coded_height)
+ seq->coded_height = 1;
+ seq->ratio = (double) seq->coded_width / (double) seq->coded_height;
+ if (sp->vui.aspect_ratio_info)
+ {
+ switch (sp->vui.aspect_ratio_idc)
+ {
+ case ASPECT_1_1:
+ seq->ratio = 1 * seq->ratio;
+ break;
+ case ASPECT_12_11:
+ seq->ratio *= 12.0 / 11.0;
+ break;
+ case ASPECT_10_11:
+ seq->ratio *= 10.0 / 11.0;
+ break;
+ case ASPECT_16_11:
+ seq->ratio *= 16.0 / 11.0;
+ break;
+ case ASPECT_40_33:
+ seq->ratio *= 40.0 / 33.0;
+ break;
+ case ASPECT_24_11:
+ seq->ratio *= 24.0 / 11.0;
+ break;
+ case ASPECT_20_11:
+ seq->ratio *= 20.0 / 11.0;
+ break;
+ case ASPECT_32_11:
+ seq->ratio *= 32.0 / 11.0;
+ break;
+ case ASPECT_80_33:
+ seq->ratio *= 80.0 / 33.0;
+ break;
+ case ASPECT_18_11:
+ seq->ratio *= 18.0 / 11.0;
+ break;
+ case ASPECT_15_11:
+ seq->ratio *= 15.0 / 11.0;
+ break;
+ case ASPECT_64_33:
+ seq->ratio *= 64.0 / 33.0;
+ break;
+ case ASPECT_160_99:
+ seq->ratio *= 160.0 / 99.0;
+ break;
+ case ASPECT_4_3:
+ seq->ratio *= 4.0 / 3.0;
+ break;
+ case ASPECT_3_2:
+ seq->ratio *= 3.0 / 2.0;
+ break;
+ case ASPECT_2_1:
+ seq->ratio *= 2.0 / 1.0;
+ break;
+ case ASPECT_EXTENDED_SAR:
+ if (sp->vui.sar_height)
+ seq->ratio *= (double) sp->vui.sar_width / sp->vui.sar_height;
+ break;
+ }
+ }
+}
+
+
+
+static void
+parse_scaling_list (bits_reader_t * br, uint8_t * scaling_list, int len,
+ int index)
+{
+ int last_scale = 8;
+ int next_scale = 8;
+ int32_t delta_scale;
+ uint8_t use_default_scaling_matrix_flag = 0;
+ int i;
+
+ const uint8_t *zigzag = (len == 64) ? zigzag_8x8 : zigzag_4x4;
+
+ for (i = 0; i < len; i++)
+ {
+ if (next_scale != 0)
+ {
+ delta_scale = read_exp_se (br);
+ next_scale = (last_scale + delta_scale + 256) % 256;
+ if (i == 0 && next_scale == 0)
+ {
+ use_default_scaling_matrix_flag = 1;
+ break;
+ }
+ }
+ scaling_list[zigzag[i]] = last_scale =
+ (next_scale == 0) ? last_scale : next_scale;
+ }
+
+ if (use_default_scaling_matrix_flag)
+ {
+ switch (index)
+ {
+ case 0:
+ case 1:
+ case 2:
+ {
+ for (i = 0; i < sizeof (default_4x4_intra); i++)
+ scaling_list[zigzag_4x4[i]] = default_4x4_intra[i];
+ break;
+ }
+ case 3:
+ case 4:
+ case 5:
+ {
+ for (i = 0; i < sizeof (default_4x4_inter); i++)
+ scaling_list[zigzag_4x4[i]] = default_4x4_inter[i];
+ break;
+ }
+ case 6:
+ {
+ for (i = 0; i < sizeof (default_8x8_intra); i++)
+ scaling_list[zigzag_8x8[i]] = default_8x8_intra[i];
+ break;
+ }
+ case 7:
+ {
+ for (i = 0; i < sizeof (default_8x8_inter); i++)
+ scaling_list[zigzag_8x8[i]] = default_8x8_inter[i];
+ break;
+ }
+ }
+ }
+}
+
+
+
+static void
+scaling_list_fallback_A (uint8_t * scaling_lists_4x4,
+ uint8_t * scaling_lists_8x8, int i)
+{
+ int j;
+ switch (i)
+ {
+ case 0:
+ {
+ for (j = 0; j < sizeof (default_4x4_intra); j++)
+ scaling_lists_4x4[(i * 16) + zigzag_4x4[j]] = default_4x4_intra[j];
+ break;
+ }
+ case 3:
+ {
+ for (j = 0; j < sizeof (default_4x4_inter); j++)
+ scaling_lists_4x4[(i * 16) + zigzag_4x4[j]] = default_4x4_inter[j];
+ break;
+ }
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ memcpy (&scaling_lists_4x4[i * 16], &scaling_lists_4x4[(i - 1) * 16],
+ 6 * 16);
+ break;
+ case 6:
+ {
+ for (j = 0; j < sizeof (default_8x8_intra); j++)
+ scaling_lists_8x8[(i - 6) * 64 + zigzag_8x8[j]] =
+ default_8x8_intra[j];
+ break;
+ }
+ case 7:
+ {
+ for (j = 0; j < sizeof (default_8x8_inter); j++)
+ scaling_lists_8x8[(i - 6) * 64 + zigzag_8x8[j]] =
+ default_8x8_inter[j];
+ break;
+ }
+
+ }
+}
+
+
+
+static void
+scaling_list_fallback_B (seq_param_t * sp, pic_param_t * pic, int i)
+{
+ switch (i)
+ {
+ case 0:
+ case 3:
+ memcpy (pic->scaling_lists_4x4[i], sp->scaling_lists_4x4[i],
+ sizeof (pic->scaling_lists_4x4[i]));
+ break;
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ memcpy (pic->scaling_lists_4x4[i], pic->scaling_lists_4x4[i - 1],
+ sizeof (pic->scaling_lists_4x4[i]));
+ break;
+ case 6:
+ case 7:
+ memcpy (pic->scaling_lists_8x8[i - 6], sp->scaling_lists_8x8[i - 6],
+ sizeof (pic->scaling_lists_8x8[i - 6]));
+ break;
+ }
+}
+
+
+
+static void
+vui_parameters (sequence_t * seq, vui_param_t * vui)
+{
+ bits_reader_t *br = &seq->br;
+
+ vui->aspect_ratio_info = read_bits (br, 1);
+ lprintf ("aspect_ratio_info_present_flag = %d\n", vui->aspect_ratio_info);
+ if (vui->aspect_ratio_info)
+ {
+ vui->aspect_ratio_idc = read_bits (br, 8);
+ lprintf ("aspect_ratio_idc = %d\n", vui->aspect_ratio_idc);
+ if (vui->aspect_ratio_idc == 255)
+ {
+ vui->sar_width = read_bits (br, 16);
+ lprintf ("sar_width = %d\n", vui->sar_width);
+ vui->sar_height = read_bits (br, 16);
+ lprintf ("sar_height = %d\n", vui->sar_height);
+ }
+ }
+ if (read_bits (br, 1)) /* overscan_info_present_flag */
+ skip_bits (br, 1); /* overscan_appropriate_falg */
+ if (read_bits (br, 1))
+ { /* video_signal_type_present_flag */
+ skip_bits (br, 3); /*video_format */
+ skip_bits (br, 1); /*video_full_range_flag */
+ vui->colour_desc = read_bits (br, 1);
+ lprintf ("colour_desc = %d\n", vui->colour_desc);
+ if (vui->colour_desc)
+ {
+ vui->colour_primaries = read_bits (br, 8);
+ lprintf ("colour_primaries = %d\n", vui->colour_primaries);
+ skip_bits (br, 8); /* transfer_characteristics */
+ skip_bits (br, 8); /* matrix_coefficients */
+ switch (vui->colour_primaries)
+ {
+ case 1:
+ seq->color_standard = VDP_COLOR_STANDARD_ITUR_BT_709;
+ break;
+ case 6:
+ case 7:
+ seq->color_standard = VDP_COLOR_STANDARD_SMPTE_240M;
+ break;
+ }
+ }
+ }
+ if (read_bits (br, 1))
+ { /* chroma_loc_info_present_flag */
+ read_exp_ue (br); /* chroma_sample_loc_type_top_field */
+ read_exp_ue (br); /* chroma_sample_loc_type_bottom_field */
+ }
+ vui->timing_info = read_bits (br, 1);
+ lprintf ("timing_info = %d\n", vui->timing_info);
+ if (vui->timing_info)
+ {
+ vui->num_units_in_tick = read_bits (br, 32);
+ lprintf ("num_units_in_tick = %u\n", vui->num_units_in_tick);
+ vui->time_scale = read_bits (br, 32);
+ lprintf ("time_scale = %u\n", vui->time_scale);
+ if (vui->time_scale > 0)
+ seq->video_step =
+ 180000. * (double) vui->num_units_in_tick / (double) vui->time_scale;
+ }
+}
+
+
+
+static void
+seq_parameter_set_data (vdpau_h264_alter_decoder_t * this_gen)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ seq_param_t *sp;
+ int i;
+
+ uint8_t profile_idc = read_bits (&seq->br, 8);
+ lprintf ("profile_idc = %d\n", profile_idc);
+ uint8_t constraint_set0_flag = read_bits (&seq->br, 1);
+ lprintf ("constraint_set0_flag = %d\n", constraint_set0_flag);
+ uint8_t constraint_set1_flag = read_bits (&seq->br, 1);
+ lprintf ("constraint_set1_flag = %d\n", constraint_set1_flag);
+ uint8_t constraint_set2_flag = read_bits (&seq->br, 1);
+ lprintf ("constraint_set2_flag = %d\n", constraint_set2_flag);
+ uint8_t constraint_set3_flag = read_bits (&seq->br, 1);
+ lprintf ("constraint_set3_flag = %d\n", constraint_set3_flag);
+ skip_bits (&seq->br, 4);
+ uint8_t level_idc = read_bits (&seq->br, 8);
+ lprintf ("level_idc = %d\n", level_idc);
+
+ uint8_t seq_parameter_set_id = read_exp_ue (&seq->br);
+ lprintf ("seq_parameter_set_id = %d\n", seq_parameter_set_id);
+ if (seq_parameter_set_id > 31)
+ {
+ lprintf ("OOPS : seq_parameter_set_id > 31 !!\n");
+ return;
+ }
+
+ if (!seq->seq_param[seq_parameter_set_id])
+ seq->seq_param[seq_parameter_set_id] =
+ (seq_param_t *) calloc (1, sizeof (seq_param_t));
+ if (!seq->seq_param[seq_parameter_set_id])
+ {
+ lprintf ("OOPS : can't allocate SPS %d !!\n", seq_parameter_set_id);
+ return;
+ }
+
+ sp = seq->seq_param[seq_parameter_set_id];
+ sp->profile_idc = profile_idc;
+ switch (profile_idc)
+ {
+ case 100:
+ seq->profile = VDP_DECODER_PROFILE_H264_HIGH;
+ break;
+ case 77:
+ seq->profile = VDP_DECODER_PROFILE_H264_MAIN;
+ break;
+ case 66: /* nvidia's vdpau doesn't suppot baseline, force main */
+ default:
+ seq->profile = VDP_DECODER_PROFILE_H264_MAIN;
+ }
+ sp->constraint_set0_flag = constraint_set0_flag;
+ sp->constraint_set1_flag = constraint_set1_flag;
+ sp->constraint_set2_flag = constraint_set2_flag;
+ sp->constraint_set3_flag = constraint_set3_flag;
+ sp->level_idc = level_idc;
+
+ memset (&sp->scaling_lists_4x4, 16, sizeof (sp->scaling_lists_4x4));
+ memset (&sp->scaling_lists_8x8, 16, sizeof (sp->scaling_lists_8x8));
+
+ sp->chroma_format_idc = 1;
+ sp->separate_colour_plane_flag = 0;
+ if (sp->profile_idc == 100 || sp->profile_idc == 110
+ || sp->profile_idc == 122 || sp->profile_idc == 244
+ || sp->profile_idc == 44 || sp->profile_idc == 83
+ || sp->profile_idc == 86)
+ {
+ sp->chroma_format_idc = read_exp_ue (&seq->br);
+ lprintf ("chroma_format_idc = %u\n", sp->chroma_format_idc);
+ if (sp->chroma_format_idc == 3)
+ {
+ sp->separate_colour_plane_flag = read_bits (&seq->br, 1);
+ lprintf ("separate_colour_plane_flag = %d\n",
+ sp->separate_colour_plane_flag);
+ }
+ sp->bit_depth_luma_minus8 = read_exp_ue (&seq->br);
+ lprintf ("bit_depth_luma_minus8 = %u\n", sp->bit_depth_luma_minus8);
+ sp->bit_depth_chroma_minus8 = read_exp_ue (&seq->br);
+ lprintf ("bit_depth_chroma_minus8 = %u\n", sp->bit_depth_chroma_minus8);
+ sp->qpprime_y_zero_transform_bypass_flag = read_bits (&seq->br, 1);
+ lprintf ("qpprime_y_zero_transform_bypass_flag = %u\n",
+ sp->qpprime_y_zero_transform_bypass_flag);
+ sp->seq_scaling_matrix_present_flag = read_bits (&seq->br, 1);
+ lprintf ("seq_scaling_matrix_present_flag = %u\n",
+ sp->seq_scaling_matrix_present_flag);
+ if (sp->seq_scaling_matrix_present_flag)
+ {
+ for (i = 0; i < 8; i++)
+ {
+ int scaling_flag = read_bits (&seq->br, 1);
+ if (scaling_flag)
+ {
+ if (i < 6)
+ parse_scaling_list (&seq->br, &sp->scaling_lists_4x4[i][0], 16,
+ i);
+ else
+ parse_scaling_list (&seq->br, &sp->scaling_lists_8x8[i - 6][0],
+ 64, i);
+ }
+ else
+ scaling_list_fallback_A ((uint8_t *) sp->scaling_lists_4x4,
+ (uint8_t *) sp->scaling_lists_8x8, i);
+ }
+ }
+ }
+ sp->log2_max_frame_num_minus4 = read_exp_ue (&seq->br);
+ lprintf ("log2_max_frame_num_minus4 = %u\n", sp->log2_max_frame_num_minus4);
+ sp->pic_order_cnt_type = read_exp_ue (&seq->br);
+ lprintf ("pic_order_cnt_type = %u\n", sp->pic_order_cnt_type);
+ if (sp->pic_order_cnt_type == 0)
+ {
+ sp->log2_max_pic_order_cnt_lsb_minus4 = read_exp_ue (&seq->br);
+ lprintf ("log2_max_pic_order_cnt_lsb_minus4 = %u\n",
+ sp->log2_max_pic_order_cnt_lsb_minus4);
+ }
+ else if (sp->pic_order_cnt_type == 1)
+ {
+ sp->delta_pic_order_always_zero_flag = read_bits (&seq->br, 1);
+ lprintf ("delta_pic_order_always_zero_flag = %u\n",
+ sp->delta_pic_order_always_zero_flag);
+ sp->offset_for_non_ref_pic = read_exp_se (&seq->br);
+ lprintf ("offset_for_non_ref_pic = %d\n", sp->offset_for_non_ref_pic);
+ sp->offset_for_top_to_bottom_field = read_exp_se (&seq->br);
+ lprintf ("offset_for_top_to_bottom_field = %d\n",
+ sp->offset_for_top_to_bottom_field);
+ sp->num_ref_frames_in_pic_order_cnt_cycle = read_exp_ue (&seq->br);
+ lprintf ("num_ref_frames_in_pic_order_cnt_cycle = %u\n",
+ sp->num_ref_frames_in_pic_order_cnt_cycle);
+ for (i = 0; i < sp->num_ref_frames_in_pic_order_cnt_cycle; i++)
+ {
+ sp->offset_for_ref_frame[i] = read_exp_se (&seq->br);
+ lprintf ("offset_for_ref_frame[%d] = %d\n", i,
+ sp->offset_for_ref_frame[i]);
+ }
+ }
+ sp->num_ref_frames = read_exp_ue (&seq->br);
+ if (sp->num_ref_frames > 16)
+ sp->num_ref_frames = 16;
+ lprintf ("num_ref_frames = %u\n", sp->num_ref_frames);
+ sp->gaps_in_frame_num_value_allowed_flag = read_bits (&seq->br, 1);
+ lprintf ("gaps_in_frame_num_value_allowed_flag = %u\n",
+ sp->gaps_in_frame_num_value_allowed_flag);
+ sp->pic_width_in_mbs_minus1 = read_exp_ue (&seq->br);
+ lprintf ("pic_width_in_mbs_minus1 = %u\n", sp->pic_width_in_mbs_minus1);
+ sp->pic_height_in_map_units_minus1 = read_exp_ue (&seq->br);
+ lprintf ("pic_height_in_map_units_minus1 = %u\n",
+ sp->pic_height_in_map_units_minus1);
+ sp->frame_mbs_only_flag = read_bits (&seq->br, 1);
+ lprintf ("frame_mbs_only_flag = %u\n", sp->frame_mbs_only_flag);
+
+ seq->coded_width = (sp->pic_width_in_mbs_minus1 + 1) * 16;
+ seq->coded_height =
+ (2 - sp->frame_mbs_only_flag) * (sp->pic_height_in_map_units_minus1 +
+ 1) * 16;
+
+ if (!sp->frame_mbs_only_flag)
+ {
+ sp->mb_adaptive_frame_field_flag = read_bits (&seq->br, 1);
+ lprintf ("mb_adaptive_frame_field_flag = %u\n",
+ sp->mb_adaptive_frame_field_flag);
+ }
+ sp->direct_8x8_inference_flag = read_bits (&seq->br, 1);
+ lprintf ("direct_8x8_inference_flag = %u\n", sp->direct_8x8_inference_flag);
+ sp->frame_cropping_flag = read_bits (&seq->br, 1);
+ lprintf ("frame_cropping_flag = %u\n", sp->frame_cropping_flag);
+ if (sp->frame_cropping_flag)
+ {
+ sp->frame_crop_left_offset = read_exp_ue (&seq->br);
+ lprintf ("frame_crop_left_offset = %u\n", sp->frame_crop_left_offset);
+ sp->frame_crop_right_offset = read_exp_ue (&seq->br);
+ lprintf ("frame_crop_right_offset = %u\n", sp->frame_crop_right_offset);
+ sp->frame_crop_top_offset = read_exp_ue (&seq->br);
+ lprintf ("frame_crop_top_offset = %u\n", sp->frame_crop_top_offset);
+ sp->frame_crop_bottom_offset = read_exp_ue (&seq->br);
+ lprintf ("frame_crop_bottom_offset = %u\n", sp->frame_crop_bottom_offset);
+ seq->coded_height -=
+ (2 - sp->frame_mbs_only_flag) * 2 * sp->frame_crop_bottom_offset;
+ }
+ if (seq->coded_height == 1088)
+ seq->coded_height = 1080;
+ sp->vui_parameters_present_flag = read_bits (&seq->br, 1);
+ lprintf ("vui_parameters_present_flag = %u\n",
+ sp->vui_parameters_present_flag);
+ if (sp->vui_parameters_present_flag)
+ vui_parameters (seq, &sp->vui);
+ set_ratio (seq, sp);
+}
+
+
+
+static void
+pic_parameter_set (vdpau_h264_alter_decoder_t * this_gen)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ pic_param_t *pic;
+ seq_param_t *sp;
+ int i;
+
+ uint8_t pic_parameter_set_id = read_exp_ue (&seq->br);
+ lprintf ("pic_parameter_set_id = %u\n", pic_parameter_set_id);
+ if (!seq->pic_param[pic_parameter_set_id])
+ seq->pic_param[pic_parameter_set_id] =
+ (pic_param_t *) calloc (1, sizeof (pic_param_t));
+ if (!seq->pic_param[pic_parameter_set_id])
+ {
+ lprintf ("OOPS : can't allocate PPS %d !!\n", pic_parameter_set_id);
+ return;
+ }
+ pic = seq->pic_param[pic_parameter_set_id];
+
+ uint8_t seq_parameter_set_id = read_exp_ue (&seq->br);
+ lprintf ("seq_parameter_set_id = %u\n", seq_parameter_set_id);
+ if (seq_parameter_set_id > 31)
+ {
+ lprintf ("OOPS : referenced SPS (%d) does not exist !!\n",
+ seq_parameter_set_id);
+ return;
+ }
+ if (!seq->seq_param[seq_parameter_set_id])
+ {
+ lprintf ("OOPS : referenced SPS (%d) does not exist !!\n",
+ seq_parameter_set_id);
+ return;
+ }
+
+ pic->seq_parameter_set_id = seq_parameter_set_id;
+ sp = seq->seq_param[pic->seq_parameter_set_id];
+ pic->entropy_coding_mode_flag = read_bits (&seq->br, 1);
+ lprintf ("entropy_coding_mode_flag = %u\n", pic->entropy_coding_mode_flag);
+ pic->pic_order_present_flag = read_bits (&seq->br, 1);
+ lprintf ("pic_order_present_flag = %u\n", pic->pic_order_present_flag);
+ uint8_t num_slice_groups_minus1 = read_exp_ue (&seq->br);
+ lprintf ("num_slice_groups_minus1 = %u\n", num_slice_groups_minus1);
+ if (num_slice_groups_minus1 > 0)
+ {
+ uint8_t slice_group_map_type = read_exp_ue (&seq->br);
+ lprintf ("slice_group_map_type = %u\n", slice_group_map_type);
+ if (!slice_group_map_type)
+ {
+ for (i = 0; i < num_slice_groups_minus1; i++)
+ read_exp_ue (&seq->br);
+ }
+ else if (slice_group_map_type == 2)
+ {
+ for (i = 0; i < num_slice_groups_minus1; i++)
+ {
+ read_exp_ue (&seq->br);
+ read_exp_ue (&seq->br);
+ }
+ }
+ else if (slice_group_map_type == 3 || slice_group_map_type == 4
+ || slice_group_map_type == 5)
+ {
+ read_bits (&seq->br, 1);
+ read_exp_ue (&seq->br);
+ }
+ else if (slice_group_map_type == 6)
+ {
+ read_exp_ue (&seq->br);
+ }
+ }
+ pic->num_ref_idx_l0_active_minus1 = read_exp_ue (&seq->br);
+ lprintf ("num_ref_idx_l0_active_minus1 = %u\n",
+ pic->num_ref_idx_l0_active_minus1);
+ pic->num_ref_idx_l1_active_minus1 = read_exp_ue (&seq->br);
+ lprintf ("num_ref_idx_l1_active_minus1 = %u\n",
+ pic->num_ref_idx_l1_active_minus1);
+ pic->weighted_pred_flag = read_bits (&seq->br, 1);
+ lprintf ("weighted_pred_flag = %u\n", pic->weighted_pred_flag);
+ pic->weighted_bipred_idc = read_bits (&seq->br, 2);
+ lprintf ("weighted_bipred_idc = %u\n", pic->weighted_bipred_idc);
+ pic->pic_init_qp_minus26 = read_exp_se (&seq->br);
+ lprintf ("pic_init_qp_minus26 = %d\n", pic->pic_init_qp_minus26);
+ pic->pic_init_qs_minus26 = read_exp_se (&seq->br);
+ lprintf ("pic_init_qs_minus26 = %d\n", pic->pic_init_qs_minus26);
+ pic->chroma_qp_index_offset = read_exp_se (&seq->br);
+ lprintf ("chroma_qp_index_offset = %d\n", pic->chroma_qp_index_offset);
+ pic->deblocking_filter_control_present_flag = read_bits (&seq->br, 1);
+ lprintf ("deblocking_filter_control_present_flag = %u\n",
+ pic->deblocking_filter_control_present_flag);
+ pic->constrained_intra_pred_flag = read_bits (&seq->br, 1);
+ lprintf ("constrained_intra_pred_flag = %u\n",
+ pic->constrained_intra_pred_flag);
+ pic->redundant_pic_cnt_present_flag = read_bits (&seq->br, 1);
+ lprintf ("redundant_pic_cnt_present_flag = %u\n",
+ pic->redundant_pic_cnt_present_flag);
+
+ uint32_t more = more_rbsp_data (&seq->br);
+ lprintf ("more bits = %u (buflen = %d) (still = %d)\n", more,
+ seq->br.length, seq->br.start + seq->br.length - seq->br.buffer);
+ if (more)
+ {
+ pic->transform_8x8_mode_flag = read_bits (&seq->br, 1);
+ lprintf ("transform_8x8_mode_flag = %u\n", pic->transform_8x8_mode_flag);
+ pic->pic_scaling_matrix_present_flag = read_bits (&seq->br, 1);
+ lprintf ("pic_scaling_matrix_present_flag = %u\n",
+ pic->pic_scaling_matrix_present_flag);
+ if (pic->pic_scaling_matrix_present_flag)
+ {
+ for (i = 0; i < 8; i++)
+ {
+ if (i < 6 || pic->transform_8x8_mode_flag)
+ pic->pic_scaling_list_present_flag[i] = read_bits (&seq->br, 1);
+ else
+ pic->pic_scaling_list_present_flag[i] = 0;
+
+ if (pic->pic_scaling_list_present_flag[i])
+ {
+ if (i < 6)
+ parse_scaling_list (&seq->br, &pic->scaling_lists_4x4[i][0], 16,
+ i);
+ else
+ parse_scaling_list (&seq->br, &pic->scaling_lists_8x8[i - 6][0],
+ 64, i);
+ }
+ else
+ {
+ if (!sp->seq_scaling_matrix_present_flag)
+ scaling_list_fallback_A ((uint8_t *) pic->scaling_lists_4x4,
+ (uint8_t *) pic->scaling_lists_8x8, i);
+ else
+ scaling_list_fallback_B (sp, pic, i);
+ }
+ }
+ }
+ pic->second_chroma_qp_index_offset = read_exp_se (&seq->br);
+ lprintf ("second_chroma_qp_index_offset = %d\n",
+ pic->second_chroma_qp_index_offset);
+ }
+ else
+ {
+ pic->transform_8x8_mode_flag = 0;
+ pic->pic_scaling_matrix_present_flag = 0;
+ pic->second_chroma_qp_index_offset = pic->chroma_qp_index_offset;
+ }
+}
+
+
+
+static void
+pred_weight_table (vdpau_h264_alter_decoder_t * this_gen, uint8_t slice_type,
+ uint8_t ChromaArrayType, uint8_t l0, uint8_t l1)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ int i;
+
+ read_exp_ue (&seq->br);
+ if (ChromaArrayType)
+ read_exp_ue (&seq->br);
+ for (i = 0; i <= l0; i++)
+ {
+ if (read_bits (&seq->br, 1))
+ {
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ }
+ if (ChromaArrayType && read_bits (&seq->br, 1))
+ {
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ }
+ }
+ if (slice_type == SLICE_TYPE_B)
+ {
+ for (i = 0; i <= l1; i++)
+ {
+ if (read_bits (&seq->br, 1))
+ {
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ }
+ if (ChromaArrayType)
+ {
+ if (read_bits (&seq->br, 1))
+ {
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ read_exp_se (&seq->br);
+ }
+ }
+ }
+ }
+}
+
+
+
+static void
+ref_pic_list_reordering (vdpau_h264_alter_decoder_t * this_gen)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ slice_param_t *sl = &seq->slice_param;
+
+ if ((sl->slice_type != SLICE_TYPE_I) && (sl->slice_type != SLICE_TYPE_SI))
+ {
+ if (read_bits (&seq->br, 1))
+ {
+ uint32_t tmp, diff;
+ do
+ {
+ tmp = read_exp_ue (&seq->br);
+ if (tmp == 0 || tmp == 1)
+ diff = read_exp_ue (&seq->br);
+ else if (tmp == 2)
+ diff = read_exp_ue (&seq->br);
+ }
+ while (tmp != 3 && !seq->br.oflow);
+ }
+ }
+ if (sl->slice_type == SLICE_TYPE_B)
+ {
+ if (read_bits (&seq->br, 1))
+ {
+ uint32_t tmp2, diff2;
+ do
+ {
+ tmp2 = read_exp_ue (&seq->br);
+ if (tmp2 == 0 || tmp2 == 1)
+ diff2 = read_exp_ue (&seq->br);
+ else if (tmp2 == 2)
+ diff2 = read_exp_ue (&seq->br);
+ }
+ while (tmp2 != 3 && !seq->br.oflow);
+ }
+ }
+}
+
+
+
+static void
+dec_ref_pic_marking (vdpau_h264_alter_decoder_t * this_gen, uint8_t idr)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ int32_t pic_num;
+
+ if (idr)
+ {
+ uint8_t no_output_of_prior_pics_flag = read_bits (&seq->br, 1);
+ lprintf ("no_output_of_prior_pics_flag = %u\n",
+ no_output_of_prior_pics_flag);
+ uint8_t long_term_reference_flag = read_bits (&seq->br, 1);
+ lprintf ("long_term_reference_flag = %u\n", long_term_reference_flag);
+ }
+ else
+ {
+ uint8_t adaptive_ref_pic_marking_mode_flag = read_bits (&seq->br, 1);
+ lprintf ("adaptive_ref_pic_marking_mode_flag = %u\n",
+ adaptive_ref_pic_marking_mode_flag);
+ if (!adaptive_ref_pic_marking_mode_flag)
+ {
+ if (seq->cur_pic.field_pic_flag
+ && (seq->cur_pic.completed == PICTURE_DONE)
+ && (seq->cur_pic.is_reference[0] || seq->cur_pic.is_reference[1]))
+ {
+ seq->cur_pic.is_reference[0] = seq->cur_pic.is_reference[1] =
+ SHORT_TERM_REF;
+ lprintf ("short_ref marking\n");
+ }
+ // sliding window is always performed in dpb_append()
+ }
+ else
+ {
+ uint8_t memory_management_control_operation;
+ do
+ {
+ memory_management_control_operation = read_exp_ue (&seq->br);
+ lprintf ("memory_management_control_operation = %u\n",
+ memory_management_control_operation);
+ if (memory_management_control_operation == 1
+ || memory_management_control_operation == 3)
+ {
+ uint32_t difference_of_pic_nums_minus1 = read_exp_ue (&seq->br);
+ lprintf ("difference_of_pic_nums_minus1 = %u\n",
+ difference_of_pic_nums_minus1);
+ pic_num =
+ seq->cur_pic.PicNum[0] - (difference_of_pic_nums_minus1 + 1);
+ dpb_mmc1 (this_gen, pic_num);
+ }
+ if (memory_management_control_operation == 2)
+ {
+ uint32_t long_term_pic_num = read_exp_ue (&seq->br);
+ lprintf ("long_term_pic_num = %u\n", long_term_pic_num);
+ }
+ if (memory_management_control_operation == 3
+ || memory_management_control_operation == 6)
+ {
+ uint32_t long_term_frame_idx = read_exp_ue (&seq->br);
+ lprintf ("long_term_frame_idx = %u\n", long_term_frame_idx);
+ }
+ if (memory_management_control_operation == 4)
+ {
+ uint32_t max_long_term_frame_idx_plus1 = read_exp_ue (&seq->br);
+ lprintf ("max_long_term_frame_idx_plus1 = %u\n",
+ max_long_term_frame_idx_plus1);
+ }
+ }
+ while (memory_management_control_operation && !seq->br.oflow);
+ }
+ }
+}
+
+
+
+static void
+slice_header (vdpau_h264_alter_decoder_t * this_gen, uint8_t nal_ref_idc,
+ uint8_t nal_unit_type)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ slice_param_t *sl = &seq->slice_param;
+ pic_param_t *pic;
+ seq_param_t *sp;
+
+ sl->nal_ref_idc = nal_ref_idc;
+ sl->nal_unit_type = nal_unit_type;
+
+ read_exp_ue (&seq->br); /* first_mb_in_slice */
+ sl->slice_type = read_exp_ue (&seq->br) % 5;
+ lprintf ("slice_type = %u\n", sl->slice_type);
+ sl->pic_parameter_set_id = read_exp_ue (&seq->br);
+ lprintf ("pic_parameter_set_id = %u\n", sl->pic_parameter_set_id);
+ if (!seq->pic_param[sl->pic_parameter_set_id])
+ {
+ lprintf ("OOPS : referenced PPS (%d) does not exist !!\n",
+ sl->pic_parameter_set_id);
+ seq->cur_pic.missing_header = 1;
+ return;
+ }
+ pic = seq->pic_param[sl->pic_parameter_set_id];
+ if (!seq->seq_param[pic->seq_parameter_set_id])
+ {
+ lprintf ("OOPS : referenced SPS (%d) does not exist !!\n",
+ pic->seq_parameter_set_id);
+ seq->cur_pic.missing_header = 1;
+ return;
+ }
+
+ if (!seq->startup_frame && (sl->slice_type == SLICE_TYPE_I)
+ && !seq->cur_pic.completed)
+ seq->startup_frame = 1;
+
+ sp = seq->seq_param[pic->seq_parameter_set_id];
+ if (sp->separate_colour_plane_flag)
+ read_bits (&seq->br, 2); /* colour_plane_id */
+ sl->frame_num = read_bits (&seq->br, sp->log2_max_frame_num_minus4 + 4);
+ lprintf ("frame_num = %u\n", sl->frame_num);
+ sl->MaxFrameNum = 1 << (sp->log2_max_frame_num_minus4 + 4);
+
+ sl->field_pic_flag = sl->bottom_field_flag =
+ sl->delta_pic_order_cnt_bottom = 0;
+ sl->delta_pic_order_cnt[0] = sl->delta_pic_order_cnt[1] = 0;
+
+ if (!sp->frame_mbs_only_flag)
+ {
+ sl->field_pic_flag = read_bits (&seq->br, 1);
+ lprintf ("field_pic_flag = %u\n", sl->field_pic_flag);
+ if (sl->field_pic_flag)
+ {
+ sl->bottom_field_flag = read_bits (&seq->br, 1);
+ lprintf ("bottom_field_flag = %u\n", sl->bottom_field_flag);
+ }
+ }
+ if (nal_unit_type == NAL_SLICE_IDR)
+ {
+ sl->idr_pic_id = read_exp_ue (&seq->br);
+ lprintf ("idr_pic_id = %u\n", sl->idr_pic_id);
+ }
+ if (sp->pic_order_cnt_type == 0)
+ {
+ sl->pic_order_cnt_lsb =
+ read_bits (&seq->br, sp->log2_max_pic_order_cnt_lsb_minus4 + 4);
+ lprintf ("pic_order_cnt_lsb = %u\n", sl->pic_order_cnt_lsb);
+ if (pic->pic_order_present_flag && !sl->field_pic_flag)
+ {
+ sl->delta_pic_order_cnt_bottom = read_exp_se (&seq->br);
+ lprintf ("delta_pic_order_cnt_bottom = %d\n",
+ sl->delta_pic_order_cnt_bottom);
+ }
+ }
+ if (sp->pic_order_cnt_type == 1 && !sp->delta_pic_order_always_zero_flag)
+ {
+ sl->delta_pic_order_cnt[0] = read_exp_se (&seq->br);
+ lprintf ("delta_pic_order_cnt[0] = %d\n", sl->delta_pic_order_cnt[0]);
+ if (pic->pic_order_present_flag && !sl->field_pic_flag)
+ {
+ sl->delta_pic_order_cnt[1] = read_exp_se (&seq->br);
+ lprintf ("delta_pic_order_cnt[1] = %d\n", sl->delta_pic_order_cnt[1]);
+ }
+ }
+ if (pic->redundant_pic_cnt_present_flag)
+ {
+ sl->redundant_pic_cnt = read_exp_ue (&seq->br);
+ lprintf ("redundant_pic_cnt = %u\n", sl->redundant_pic_cnt);
+ }
+ if (sl->slice_type == SLICE_TYPE_B)
+ skip_bits (&seq->br, 1); /* direct_spatial_mv_pred_flag */
+
+ sl->num_ref_idx_l0_active_minus1 = pic->num_ref_idx_l0_active_minus1;
+ sl->num_ref_idx_l1_active_minus1 = pic->num_ref_idx_l1_active_minus1;
+
+ if (sl->slice_type == SLICE_TYPE_P || sl->slice_type == SLICE_TYPE_SP
+ || sl->slice_type == SLICE_TYPE_B)
+ {
+ if (read_bits (&seq->br, 1))
+ {
+ lprintf ("num_ref_idx_active_override_flag = 1\n");
+ sl->num_ref_idx_l0_active_minus1 = read_exp_ue (&seq->br);
+ if (sl->slice_type == SLICE_TYPE_B)
+ sl->num_ref_idx_l1_active_minus1 = read_exp_ue (&seq->br);
+ lprintf ("num_ref_idx_l0_active_minus1 = %u\n",
+ sl->num_ref_idx_l0_active_minus1);
+ lprintf ("num_ref_idx_l1_active_minus1 = %u\n",
+ sl->num_ref_idx_l1_active_minus1);
+ }
+ }
+}
+
+
+
+static void
+slice_header_post (vdpau_h264_alter_decoder_t * this_gen)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ slice_param_t *sl = &seq->slice_param;
+
+ if (!sl->nal_ref_idc)
+ return;
+
+ pic_param_t *pic = seq->pic_param[sl->pic_parameter_set_id];
+ seq_param_t *sp = seq->seq_param[pic->seq_parameter_set_id];
+
+ if ((pic->weighted_pred_flag
+ && ((sl->slice_type == SLICE_TYPE_P)
+ || (sl->slice_type == SLICE_TYPE_SP)))
+ || ((pic->weighted_bipred_idc == 1)
+ && (sl->slice_type == SLICE_TYPE_B)))
+ {
+ uint8_t chroma =
+ (sp->separate_colour_plane_flag) ? 0 : sp->chroma_format_idc;
+ pred_weight_table (this_gen, sl->slice_type, chroma,
+ sl->num_ref_idx_l0_active_minus1,
+ sl->num_ref_idx_l1_active_minus1);
+ }
+
+ dec_ref_pic_marking (this_gen, (sl->nal_unit_type == 5) ? 1 : 0);
+}
+
+
+
+static void
+decode_poc (vdpau_h264_alter_decoder_t * this_gen)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ slice_param_t *sl = &seq->slice_param;
+ pic_param_t *pic = seq->pic_param[sl->pic_parameter_set_id];
+ seq_param_t *sp = seq->seq_param[pic->seq_parameter_set_id];
+ int parity = sl->bottom_field_flag ? 1 : 0;
+
+ seq->cur_pic.used = 1;
+ seq->cur_pic.FrameNum = sl->frame_num;
+ seq->cur_pic.is_reference[parity] = sl->nal_ref_idc;
+ seq->cur_pic.field_pic_flag = sl->field_pic_flag;
+
+ if (sl->field_pic_flag)
+ {
+ if (!seq->cur_pic.completed)
+ seq->cur_pic.top_field_first = !parity;
+ seq->cur_pic.completed |=
+ (parity ? PICTURE_BOTTOM_DONE : PICTURE_TOP_DONE);
+ }
+ else
+ {
+ seq->cur_pic.is_reference[!parity] = seq->cur_pic.is_reference[parity];
+ seq->cur_pic.completed = PICTURE_DONE;
+ }
+
+ if (sp->pic_order_cnt_type == 0)
+ {
+ dpb_frame_t *prev_pic = dpb_get_prev_ref (seq);
+ int32_t prevPicOrderCntMsb, prevPicOrderCntLsb;
+ uint32_t MaxPicOrderCntLsb =
+ 1 << (sp->log2_max_pic_order_cnt_lsb_minus4 + 4);
+
+ seq->cur_pic.pic_order_cnt_lsb = sl->pic_order_cnt_lsb;
+ seq->cur_pic.top_field_first =
+ (sl->delta_pic_order_cnt_bottom < 0) ? 0 : 1;
+
+ if (!prev_pic)
+ {
+ seq->cur_pic.PicOrderCntMsb = seq->cur_pic.TopFieldOrderCnt =
+ seq->cur_pic.BottomFieldOrderCnt = 0;
+ return;
+ }
+ if (sl->nal_unit_type == NAL_SLICE_IDR)
+ prevPicOrderCntMsb = prevPicOrderCntLsb = 0;
+ else if (prev_pic->mmc5)
+ {
+ if (!sl->bottom_field_flag)
+ {
+ prevPicOrderCntMsb = 0;
+ prevPicOrderCntLsb = prev_pic->TopFieldOrderCnt;
+ }
+ else
+ prevPicOrderCntMsb = prevPicOrderCntLsb = 0;
+ }
+ else
+ {
+ prevPicOrderCntMsb = prev_pic->PicOrderCntMsb;
+ prevPicOrderCntLsb = prev_pic->pic_order_cnt_lsb;
+ }
+
+ if ((sl->pic_order_cnt_lsb < prevPicOrderCntLsb)
+ && ((prevPicOrderCntLsb - sl->pic_order_cnt_lsb) >=
+ (MaxPicOrderCntLsb / 2)))
+ seq->cur_pic.PicOrderCntMsb = prevPicOrderCntMsb + MaxPicOrderCntLsb;
+ else if ((sl->pic_order_cnt_lsb > prevPicOrderCntLsb)
+ && ((sl->pic_order_cnt_lsb - prevPicOrderCntLsb) >
+ (MaxPicOrderCntLsb / 2)))
+ seq->cur_pic.PicOrderCntMsb = prevPicOrderCntMsb - MaxPicOrderCntLsb;
+ else
+ seq->cur_pic.PicOrderCntMsb = prevPicOrderCntMsb;
+
+ if (!sl->field_pic_flag)
+ {
+ seq->cur_pic.TopFieldOrderCnt =
+ seq->cur_pic.PicOrderCntMsb + sl->pic_order_cnt_lsb;
+ seq->cur_pic.BottomFieldOrderCnt =
+ seq->cur_pic.TopFieldOrderCnt + sl->delta_pic_order_cnt_bottom;
+ }
+ else
+ {
+ if (sl->bottom_field_flag)
+ seq->cur_pic.BottomFieldOrderCnt =
+ seq->cur_pic.PicOrderCntMsb + sl->pic_order_cnt_lsb;
+ else
+ seq->cur_pic.TopFieldOrderCnt =
+ seq->cur_pic.PicOrderCntMsb + sl->pic_order_cnt_lsb;
+ }
+ }
+ else
+ {
+ int16_t FrameNumOffset, prevFrameNumOffset;
+ uint16_t MaxFrameNum = 1 << (sp->log2_max_frame_num_minus4 + 4);
+
+ if (sl->nal_unit_type == NAL_SLICE_IDR)
+ {
+ FrameNumOffset = 0;
+ }
+ else
+ {
+ if (seq->prevMMC5)
+ prevFrameNumOffset = 0;
+ else
+ prevFrameNumOffset = seq->prevFrameNumOffset;
+
+ if (seq->prevFrameNum > sl->frame_num)
+ FrameNumOffset = prevFrameNumOffset + MaxFrameNum;
+ else
+ FrameNumOffset = prevFrameNumOffset;
+ }
+
+ if (sp->pic_order_cnt_type == 1)
+ {
+ int16_t absFrameNum = 0, picOrderCntCycleCnt =
+ 0, frameNumInPicOrderCntCycle = 0, expectedDeltaPerPicOrderCntCycle =
+ 0, expectedPicOrderCnt = 0;
+ int i;
+ if (sp->num_ref_frames_in_pic_order_cnt_cycle)
+ absFrameNum = FrameNumOffset + sl->frame_num;
+ if (!sl->nal_ref_idc && (absFrameNum > 0))
+ --absFrameNum;
+
+ for (i = 0; i < sp->num_ref_frames_in_pic_order_cnt_cycle; i++)
+ expectedDeltaPerPicOrderCntCycle += sp->offset_for_ref_frame[i];
+
+ if (absFrameNum > 0)
+ {
+ picOrderCntCycleCnt =
+ (absFrameNum - 1) / sp->num_ref_frames_in_pic_order_cnt_cycle;
+ frameNumInPicOrderCntCycle =
+ (absFrameNum - 1) % sp->num_ref_frames_in_pic_order_cnt_cycle;
+ expectedPicOrderCnt =
+ picOrderCntCycleCnt * expectedDeltaPerPicOrderCntCycle;
+ for (i = 0; i < frameNumInPicOrderCntCycle; i++)
+ expectedPicOrderCnt += sp->offset_for_ref_frame[i];
+ }
+ if (!sl->nal_ref_idc)
+ expectedPicOrderCnt += sp->offset_for_non_ref_pic;
+
+ if (!sl->field_pic_flag)
+ {
+ seq->cur_pic.TopFieldOrderCnt =
+ expectedPicOrderCnt + sl->delta_pic_order_cnt[0];
+ seq->cur_pic.BottomFieldOrderCnt =
+ seq->cur_pic.TopFieldOrderCnt + sp->offset_for_top_to_bottom_field +
+ sl->delta_pic_order_cnt[1];
+ }
+ else if (!sl->bottom_field_flag)
+ seq->cur_pic.TopFieldOrderCnt =
+ expectedPicOrderCnt + sl->delta_pic_order_cnt[0];
+ else
+ seq->cur_pic.BottomFieldOrderCnt =
+ expectedPicOrderCnt + sp->offset_for_top_to_bottom_field +
+ sl->delta_pic_order_cnt[1];
+ }
+ else
+ {
+ int32_t tmpPicOrderCnt;
+ if (sl->nal_unit_type == NAL_SLICE_IDR)
+ tmpPicOrderCnt = 0;
+ else if (!sl->nal_ref_idc)
+ tmpPicOrderCnt = 2 * (FrameNumOffset + sl->frame_num) - 1;
+ else
+ tmpPicOrderCnt = 2 * (FrameNumOffset + sl->frame_num);
+
+ if (!sl->field_pic_flag)
+ seq->cur_pic.TopFieldOrderCnt = seq->cur_pic.BottomFieldOrderCnt =
+ tmpPicOrderCnt;
+ else if (sl->bottom_field_flag)
+ seq->cur_pic.BottomFieldOrderCnt = tmpPicOrderCnt;
+ else
+ seq->cur_pic.TopFieldOrderCnt = tmpPicOrderCnt;
+ }
+ seq->prevFrameNum = seq->cur_pic.FrameNum;
+ seq->prevFrameNumOffset = FrameNumOffset;
+ }
+
+ if (seq->cur_pic.completed < PICTURE_DONE)
+ {
+ if (sl->bottom_field_flag)
+ seq->cur_pic.TopFieldOrderCnt = seq->cur_pic.BottomFieldOrderCnt;
+ else
+ seq->cur_pic.BottomFieldOrderCnt = seq->cur_pic.TopFieldOrderCnt;
+ }
+}
+
+
+
+static void
+decode_picnum (vdpau_h264_alter_decoder_t * this_gen)
+{
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ slice_param_t *sl = &seq->slice_param;
+ dpb_frame_t *frame;
+ int i = 0;
+
+ int parity = sl->bottom_field_flag ? 1 : 0;
+
+ if (!seq->cur_pic.field_pic_flag)
+ seq->cur_pic.PicNum[0] = seq->cur_pic.FrameNum;
+ else
+ seq->cur_pic.PicNum[parity] = 2 * seq->cur_pic.FrameNum + 1;
+
+ while (i < MAX_DPB_SIZE)
+ {
+ frame = seq->dpb[i];
+ if (!frame->used)
+ break;
+ if (frame->FrameNum > seq->cur_pic.FrameNum)
+ frame->FrameNumWrap = frame->FrameNum - sl->MaxFrameNum;
+ else
+ frame->FrameNumWrap = frame->FrameNum;
+
+ if (!sl->field_pic_flag)
+ {
+ frame->PicNum[0] = frame->PicNum[1] = frame->FrameNumWrap;
+ }
+ else
+ {
+ frame->PicNum[0] = 2 * frame->FrameNumWrap + (parity ? 0 : 1);
+ frame->PicNum[1] = 2 * frame->FrameNumWrap + (parity ? 1 : 0);
+ }
+ ++i;
+ }
+}
+
+
+
+static int
+check_ref_list (vdpau_h264_alter_decoder_t * this_gen)
+{
+ int i, j, bad_frame = 0;
+ dpb_frame_t *frame;
+ sequence_t *seq = (sequence_t *) & this_gen->sequence;
+ slice_param_t *sl = &seq->slice_param;
+ pic_param_t *pic = seq->pic_param[sl->pic_parameter_set_id];
+ seq_param_t *sp = seq->seq_param[pic->seq_parameter_set_id];
+ int prefs = 0;
+ int brefs = 0;
+ int poc, curpoc;
+
+ //int fps = (double)sp->vui.time_scale / (double)sp->vui.num_units_in_tick / ( 2 - sl->field_pic_flag );
+ int fps = (1 + sl->field_pic_flag) * 2 * sp->num_ref_frames;
+
+ if (seq->startup_frame >= fps)
+ return 0;
+
+ curpoc =
+ (seq->cur_pic.TopFieldOrderCnt >
+ seq->cur_pic.BottomFieldOrderCnt) ? seq->cur_pic.TopFieldOrderCnt : seq->
+ cur_pic.BottomFieldOrderCnt;
+
+ for (i = 15; i > -1; i--)
+ {
+ frame = seq->dpb[i];
+ if (!frame->used)
+ continue;
+ poc =
+ (frame->TopFieldOrderCnt >
+ frame->BottomFieldOrderCnt) ? frame->TopFieldOrderCnt : frame->
+ BottomFieldOrderCnt;
+ if (seq->cur_pic.field_pic_flag)
+ {
+ if (!frame->videoSurface->bad_frame)
+ {
+ for (j = 0; j < 2; j++)
+ {
+ if (frame->is_reference[j])
+ {
+ if (poc <= curpoc)
+ ++prefs;
+ else
+ ++brefs;
+ }
+ }
+ }
+ }
+ else
+ {
+ if (!frame->videoSurface->bad_frame)
+ {
+ if (poc <= curpoc)
+ ++prefs;
+ else
+ ++brefs;
+ }
+ }
+ }
+
+ if (sl->slice_type != SLICE_TYPE_I)
+ {
+ if (prefs < (sl->num_ref_idx_l0_active_minus1 + 1))
+ bad_frame = 1;
+ if (sl->slice_type == SLICE_TYPE_B)
+ {
+ if (brefs < (sl->num_ref_idx_l1_active_minus1 + 1))
+ bad_frame = 1;
+ }
+ }
+
+ if (bad_frame)
+ fprintf (stderr,
+ "******** Missing refframes, dropping. nrf=%d lo=%d prefs=%d l1=%d brefs=%d type=%d (%d fps)\n",
+ sp->num_ref_frames, sl->num_ref_idx_l0_active_minus1 + 1, prefs,
+ sl->num_ref_idx_l1_active_minus1 + 1, brefs, sl->slice_type,
+ fps);
+ //else
+ //fprintf(stderr,"******** GOOD ! nrf=%d lo=%d prefs=%d l1=%d brefs=%d type=%d (%d fps)\n", sp->num_ref_frames, sl->num_ref_idx_l0_active_minus1 + 1, prefs, sl->num_ref_idx_l1_active_minus1 + 1, brefs, sl->slice_type, fps );
+
+ if (seq->cur_pic.is_reference[0] || seq->cur_pic.is_reference[1])
+ ++seq->startup_frame;
+
+ return bad_frame;
+}
+
+
+
+static void
+decode_render (vdpau_h264_alter_decoder_t * vd, int bad_frame)
+{
+ int i, j;
+ VdpPictureInfoH264 info;
+ seq_param_t *sp;
+ pic_param_t *pic;
+ slice_param_t *sl;
+ sequence_t *seq = (sequence_t *) & vd->sequence;
+ vo_frame_t *img;
+
+ if (!seq->cur_pic.field_pic_flag || (seq->cur_pic.completed < PICTURE_DONE))
+ {
+ img =
+ vd->stream->video_out->get_frame (vd->stream->video_out,
+ seq->coded_width, seq->coded_height,
+ seq->ratio, XINE_IMGFMT_VDPAU,
+ VO_BOTH_FIELDS | seq->chroma | seq->
+ reset);
+ seq->reset = 0;
+ img->drawn = 0;
+ }
+ else
+ img = seq->cur_pic.videoSurface;
+
+ if (!img)
+ { /* should not happen */
+ fprintf (stderr,
+ "vdpau_h264_alter : !!!!!!!!!!!!!!!!!!!!!! No vo_frame_t !!!!!!!!!!!!!!!!!!!!!!!\n");
+ return;
+ }
+
+ vdpau_accel_t *accel = (vdpau_accel_t *) img->accel_data;
+ if (!seq->accel_vdpau)
+ seq->accel_vdpau = accel;
+
+ if (seq->vdp_runtime_nr != *(seq->accel_vdpau->current_vdp_runtime_nr))
+ vd->decoder = VDP_INVALID_HANDLE;
+
+ sl = &vd->sequence.slice_param;
+ pic = vd->sequence.pic_param[sl->pic_parameter_set_id];
+ sp = vd->sequence.seq_param[pic->seq_parameter_set_id];
+
+ VdpStatus st;
+ if (vd->decoder == VDP_INVALID_HANDLE || vd->decoder_profile != seq->profile
+ || vd->decoder_width != seq->coded_width
+ || vd->decoder_height != seq->coded_height)
+ {
+ if (vd->decoder != VDP_INVALID_HANDLE)
+ {
+ accel->vdp_decoder_destroy (vd->decoder);
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+ st =
+ accel->vdp_decoder_create (accel->vdp_device, seq->profile,
+ seq->coded_width, seq->coded_height,
+ sp->num_ref_frames, &vd->decoder);
+ if (st != VDP_STATUS_OK)
+ fprintf (stderr, "vdpau_h264_alter : failed to create decoder !! %s\n",
+ accel->vdp_get_error_string (st));
+ else
+ {
+ vd->decoder_profile = seq->profile;
+ vd->decoder_width = seq->coded_width;
+ vd->decoder_height = seq->coded_height;
+ seq->vdp_runtime_nr = seq->accel_vdpau->vdp_runtime_nr;
+ }
+ }
+
+ info.slice_count = seq->slices_count;
+ info.field_order_cnt[0] = seq->cur_pic.TopFieldOrderCnt;
+ info.field_order_cnt[1] = seq->cur_pic.BottomFieldOrderCnt;
+ info.is_reference = sl->nal_ref_idc ? VDP_TRUE : VDP_FALSE;
+ info.frame_num = sl->frame_num;
+ info.field_pic_flag = sl->field_pic_flag;
+ info.bottom_field_flag = sl->bottom_field_flag;
+ info.num_ref_frames = sp->num_ref_frames;
+ info.mb_adaptive_frame_field_flag = sp->mb_adaptive_frame_field_flag
+ && !sl->field_pic_flag;
+ info.constrained_intra_pred_flag = pic->constrained_intra_pred_flag;
+ info.weighted_pred_flag = pic->weighted_pred_flag;
+ info.weighted_bipred_idc = pic->weighted_bipred_idc;
+ info.frame_mbs_only_flag = sp->frame_mbs_only_flag;
+ info.transform_8x8_mode_flag = pic->transform_8x8_mode_flag;
+ info.chroma_qp_index_offset = pic->chroma_qp_index_offset;
+ info.second_chroma_qp_index_offset = pic->second_chroma_qp_index_offset;
+ info.pic_init_qp_minus26 = pic->pic_init_qp_minus26;
+ info.num_ref_idx_l0_active_minus1 = pic->num_ref_idx_l0_active_minus1;
+ info.num_ref_idx_l1_active_minus1 = pic->num_ref_idx_l1_active_minus1;
+ info.log2_max_frame_num_minus4 = sp->log2_max_frame_num_minus4;
+ info.pic_order_cnt_type = sp->pic_order_cnt_type;
+ info.log2_max_pic_order_cnt_lsb_minus4 =
+ sp->log2_max_pic_order_cnt_lsb_minus4;
+ info.delta_pic_order_always_zero_flag =
+ sp->delta_pic_order_always_zero_flag;
+ info.direct_8x8_inference_flag = sp->direct_8x8_inference_flag;
+ info.entropy_coding_mode_flag = pic->entropy_coding_mode_flag;
+ info.pic_order_present_flag = pic->pic_order_present_flag;
+ info.deblocking_filter_control_present_flag =
+ pic->deblocking_filter_control_present_flag;
+ info.redundant_pic_cnt_present_flag = pic->redundant_pic_cnt_present_flag;
+
+ if (!pic->pic_scaling_matrix_present_flag)
+ {
+ xine_fast_memcpy (info.scaling_lists_4x4, sp->scaling_lists_4x4,
+ sizeof (info.scaling_lists_4x4));
+ xine_fast_memcpy (info.scaling_lists_8x8, sp->scaling_lists_8x8,
+ sizeof (info.scaling_lists_8x8));
+ }
+ else
+ {
+ xine_fast_memcpy (info.scaling_lists_4x4, pic->scaling_lists_4x4,
+ sizeof (info.scaling_lists_4x4));
+ xine_fast_memcpy (info.scaling_lists_8x8, pic->scaling_lists_8x8,
+ sizeof (info.scaling_lists_8x8));
+ }
+
+ j = 0;
+ for (i = (MAX_DPB_SIZE - 1); i > -1; i--)
+ {
+ if (!seq->dpb[i]->used)
+ continue;
+ vdpau_accel_t *accel =
+ (vdpau_accel_t *) seq->dpb[i]->videoSurface->accel_data;
+ info.referenceFrames[j].surface = accel->surface;
+ info.referenceFrames[j].is_long_term = 0;
+ info.referenceFrames[j].frame_idx = seq->dpb[i]->FrameNum;
+ info.referenceFrames[j].top_is_reference =
+ seq->dpb[i]->is_reference[0] ? VDP_TRUE : VDP_FALSE;
+ info.referenceFrames[j].bottom_is_reference =
+ seq->dpb[i]->is_reference[1] ? VDP_TRUE : VDP_FALSE;
+ info.referenceFrames[j].field_order_cnt[0] =
+ seq->dpb[i]->TopFieldOrderCnt;
+ info.referenceFrames[j].field_order_cnt[1] =
+ seq->dpb[i]->BottomFieldOrderCnt;
+ ++j;
+ }
+ for (; j < MAX_DPB_SIZE; j++)
+ {
+ info.referenceFrames[j].surface = VDP_INVALID_HANDLE;
+ info.referenceFrames[j].is_long_term = 0;
+ info.referenceFrames[j].frame_idx = 0;
+ info.referenceFrames[j].top_is_reference = 0;
+ info.referenceFrames[j].bottom_is_reference = 0;
+ info.referenceFrames[j].field_order_cnt[0] = 0;
+ info.referenceFrames[j].field_order_cnt[1] = 0;
+ }
+
+ uint8_t sc[3] = { 0, 0, 1 };
+ VdpBitstreamBuffer vbits[seq->slices_count * 2];
+ for (i = 0; i < seq->slices_count; i++)
+ {
+ vbits[i * 2].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ vbits[i * 2].bitstream = sc;
+ vbits[i * 2].bitstream_bytes = 3;
+ vbits[(i * 2) + 1].struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ vbits[(i * 2) + 1].bitstream = seq->buf + seq->slices[i].buf_offset;
+ vbits[(i * 2) + 1].bitstream_bytes = seq->slices[i].len;
+ }
+ st =
+ accel->vdp_decoder_render (vd->decoder, accel->surface,
+ (VdpPictureInfo *) & info,
+ seq->slices_count * 2, vbits);
+ if (st != VDP_STATUS_OK)
+ lprintf ("**********************DECODING failed! - surface = %d - %s\n",
+ accel->surface, accel->vdp_get_error_string (st));
+ else
+ lprintf ("**********************DECODING success! - surface = %d\n",
+ accel->surface);
+
+ if ((seq->ratio != seq->reported_ratio)
+ || (seq->coded_width != seq->reported_coded_width)
+ || (seq->coded_height != seq->reported_coded_height)
+ || (seq->video_step != seq->reported_video_step))
+ {
+ seq->reported_ratio = seq->ratio;
+ seq->reported_coded_width = seq->coded_width;
+ seq->reported_coded_height = seq->coded_height;
+ seq->reported_video_step = seq->video_step;
+ _x_stream_info_set (vd->stream, XINE_STREAM_INFO_VIDEO_WIDTH,
+ seq->coded_width);
+ _x_stream_info_set (vd->stream, XINE_STREAM_INFO_VIDEO_HEIGHT,
+ seq->coded_height);
+ _x_stream_info_set (vd->stream, XINE_STREAM_INFO_VIDEO_RATIO,
+ ((double) 10000 * seq->ratio));
+ _x_stream_info_set (vd->stream, XINE_STREAM_INFO_FRAME_DURATION,
+ seq->video_step);
+ _x_meta_info_set_utf8 (vd->stream, XINE_META_INFO_VIDEOCODEC,
+ "H264/AVC (vdpau_alter)");
+ xine_event_t event;
+ xine_format_change_data_t data;
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = vd->stream;
+ event.data = &data;
+ event.data_length = sizeof (data);
+ data.width = seq->coded_width;
+ data.height = seq->coded_height;
+ data.aspect = seq->ratio;
+ xine_event_send (vd->stream, &event);
+ }
+
+ accel->color_standard = seq->color_standard;
+
+ if (seq->cur_pic.completed == PICTURE_DONE)
+ {
+ seq->cur_pic.pts = seq->pic_pts;
+ seq->pic_pts = 0;
+ }
+ if (seq->cur_pic.drop_pts)
+ seq->cur_pic.pts = 0;
+ if (sp->frame_mbs_only_flag)
+ img->progressive_frame = -1;
+ img->bad_frame = bad_frame;
+ img->duration = seq->video_step;
+ seq->cur_pic.videoSurface = img;
+}
+
+
+
+static void
+decode_picture (vdpau_h264_alter_decoder_t * decoder)
+{
+ if (decoder->sequence.cur_pic.missing_header
+ || !decoder->sequence.startup_frame)
+ {
+ memset (&decoder->sequence.cur_pic, 0, sizeof (dpb_frame_t));
+ lprintf ("MISSING_HEADER or !startup_frame\n\n");
+ return;
+ }
+
+ slice_param_t *sl = &decoder->sequence.slice_param;
+ dpb_frame_t *cur_pic = &decoder->sequence.cur_pic;
+
+ if (cur_pic->completed && cur_pic->field_pic_flag)
+ {
+ int wrong_field = 0;
+ if ((sl->frame_num != cur_pic->FrameNum)
+ || (sl->bottom_field_flag
+ && (cur_pic->completed == PICTURE_BOTTOM_DONE))
+ || (!sl->bottom_field_flag
+ && (cur_pic->completed == PICTURE_TOP_DONE))
+ || !sl->field_pic_flag)
+ {
+ wrong_field = 1;
+ }
+ if (wrong_field)
+ {
+ fprintf (stderr, "vdpau_h264_alter : Wrong field, skipping.\n");
+ memset (cur_pic, 0, sizeof (dpb_frame_t));
+ dpb_reset (&decoder->sequence);
+ cur_pic->missing_header = 1;
+ decoder->sequence.startup_frame = 0;
+ return;
+ }
+ }
+
+ /* picture decoding */
+ decode_poc (decoder);
+ lprintf ("TopFieldOrderCnt = %d - BottomFieldOrderCnt = %d\n",
+ cur_pic->TopFieldOrderCnt, cur_pic->BottomFieldOrderCnt);
+ if (sl->nal_unit_type == 5)
+ {
+ dpb_draw_frames (decoder, MAX_POC, DPB_DRAW_CLEAR);
+ decoder->sequence.startup_frame = START_IDR_FLAG;
+ }
+ decode_picnum (decoder);
+ ref_pic_list_reordering (decoder);
+ lprintf ("............................. slices_count = %d\n",
+ decoder->sequence.slices_count);
+
+ decode_render (decoder, check_ref_list (decoder));
+
+ /* dec_ref_pic_marking */
+ slice_header_post (decoder);
+
+ if (!cur_pic->is_reference[0] && !cur_pic->is_reference[1])
+ {
+ if (cur_pic->completed == PICTURE_DONE)
+ {
+ dpb_draw_frames (decoder,
+ (cur_pic->TopFieldOrderCnt >
+ cur_pic->BottomFieldOrderCnt) ? cur_pic->
+ TopFieldOrderCnt : cur_pic->BottomFieldOrderCnt,
+ DPB_DRAW_CURRENT);
+ }
+ }
+ else
+ {
+ if (decoder->sequence.
+ seq_param[decoder->sequence.pic_param[sl->pic_parameter_set_id]->
+ seq_parameter_set_id]->pic_order_cnt_type == 2)
+ dpb_draw_frames (decoder,
+ (cur_pic->TopFieldOrderCnt >
+ cur_pic->BottomFieldOrderCnt) ? cur_pic->
+ TopFieldOrderCnt : cur_pic->BottomFieldOrderCnt,
+ DPB_DRAW_REFS);
+
+ if (!sl->field_pic_flag || cur_pic->completed < PICTURE_DONE)
+ dbp_append (decoder, 0);
+ else
+ dbp_append (decoder, 1);
+ }
+
+ if (cur_pic->completed == PICTURE_DONE)
+ memset (cur_pic, 0, sizeof (dpb_frame_t));
+
+
+ lprintf
+ ("\n___________________________________________________________________________________________\n\n");
+}
+
+
+
+static int
+parse_startcodes (vdpau_h264_alter_decoder_t * this_gen, uint8_t * buf,
+ uint32_t len)
+{
+ sequence_t *sequence = (sequence_t *) & this_gen->sequence;
+ bits_reader_set (&sequence->br, buf, len);
+ int ret = 0;
+
+ skip_bits (&sequence->br, 1); /* forbidden_zero_bit */
+ uint8_t nal_ref_idc = read_bits (&sequence->br, 2);
+ uint8_t nal_unit_type = read_bits (&sequence->br, 5);
+ lprintf ("NAL size = %d, nal_ref_idc = %d, nal_unit_type = %d\n", len,
+ nal_ref_idc, nal_unit_type);
+
+ switch (nal_unit_type)
+ {
+ case NAL_END_SEQUENCE:
+ break;
+ case NAL_SEQUENCE:
+ seq_parameter_set_data (this_gen);
+ break;
+ case NAL_PICTURE:
+ pic_parameter_set (this_gen);
+ break;
+ case NAL_SLICE_IDR:
+ slice_header (this_gen, nal_ref_idc, nal_unit_type);
+ sequence->slices[sequence->slices_count].buf_offset = buf - sequence->buf;
+ sequence->slices[sequence->slices_count].len = len;
+ ++sequence->slices_count;
+ sequence->slice_mode = NAL_SLICE_IDR;
+ break;
+ case NAL_SLICE_NO_IDR:
+ slice_header (this_gen, nal_ref_idc, nal_unit_type);
+ sequence->slices[sequence->slices_count].buf_offset = buf - sequence->buf;
+ sequence->slices[sequence->slices_count].len = len;
+ ++sequence->slices_count;
+ sequence->slice_mode = NAL_SLICE_NO_IDR;
+ break;
+ }
+
+ return ret;
+}
+
+
+
+static void
+parse_codec_private (vdpau_h264_alter_decoder_t * this_gen, uint8_t * buf,
+ uint32_t len)
+{
+ sequence_t *sequence = (sequence_t *) & this_gen->sequence;
+ bits_reader_set (&sequence->br, buf, len);
+ uint8_t *buffer = buf;
+ int i;
+
+ lprintf ("parse_codec_private\n");
+
+ sequence->mode_frame = 1;
+
+ // reserved
+ skip_bits (&sequence->br, 8);
+ skip_bits (&sequence->br, 8); /* profile_idc */
+ skip_bits (&sequence->br, 8);
+ skip_bits (&sequence->br, 8); /* level_idc */
+ skip_bits (&sequence->br, 6);
+
+ sequence->frame_header_size = read_bits (&sequence->br, 2) + 1;
+ //sequence->frame_header_size = 3;
+ skip_bits (&sequence->br, 3);
+ uint8_t count = read_bits (&sequence->br, 5);
+ buffer += 6;
+ for (i = 0; i < count; i++)
+ {
+ bits_reader_set (&sequence->br, buffer, len - (buffer - buf));
+ uint16_t sps_size = read_bits (&sequence->br, 16);
+ skip_bits (&sequence->br, 8);
+ seq_parameter_set_data (this_gen);
+ buffer += sps_size + 2;
+ }
+ count = buffer[0];
+ ++buffer;
+ for (i = 0; i < count; i++)
+ {
+ bits_reader_set (&sequence->br, buffer, len - (buffer - buf));
+ uint16_t pps_size = read_bits (&sequence->br, 16);
+ skip_bits (&sequence->br, 8);
+ pic_parameter_set (this_gen);
+ buffer += pps_size + 2;
+ }
+}
+
+
+
+static void
+flush_buffer (sequence_t * seq)
+{
+ if ((seq->bufpos - seq->bufseek) >= seq->bufseek)
+ {
+ seq->bufsize = (seq->bufpos - seq->bufseek) + MIN_BUFFER_SIZE;
+ lprintf ("buffer too short, have to allocate a new one.\n");
+ uint8_t *tmp = (uint8_t *) malloc (seq->bufsize);
+ xine_fast_memcpy (tmp, seq->buf + seq->bufseek,
+ seq->bufpos - seq->bufseek);
+ free (seq->buf);
+ seq->buf = tmp;
+ }
+ else
+ xine_fast_memcpy (seq->buf, seq->buf + seq->bufseek,
+ seq->bufpos - seq->bufseek);
+
+ seq->bufpos -= seq->bufseek;
+ seq->start = -1;
+ seq->bufseek = 0;
+ reset_slices (seq);
+}
+
+
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void
+vdpau_h264_alter_decode_data (video_decoder_t * this_gen, buf_element_t * buf)
+{
+ vdpau_h264_alter_decoder_t *this = (vdpau_h264_alter_decoder_t *) this_gen;
+ sequence_t *seq = (sequence_t *) & this->sequence;
+
+#ifdef MAKE_DAT
+ fwrite (buf->content, 1, buf->size, outfile);
+#endif
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE)
+ {
+ lprintf ("BUF_FLAG_FRAMERATE\n");
+ seq->video_step = buf->decoder_info[0];
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_ASPECT)
+ {
+ lprintf ("BUF_FLAG_ASPECT\n");
+ seq->ratio =
+ (double) buf->decoder_info[1] / (double) buf->decoder_info[2];
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER)
+ {
+ lprintf ("BUF_FLAG_STDHEADER\n");
+ seq->flag_header = 1;
+ xine_bmiheader *bih = (xine_bmiheader *) buf->content;
+ seq->coded_width = bih->biWidth;
+ seq->coded_height = bih->biHeight;
+ uint8_t *codec_private = buf->content + sizeof (xine_bmiheader);
+ uint32_t codec_private_len = bih->biSize - sizeof (xine_bmiheader);
+ if (codec_private_len > 0)
+ parse_codec_private (this, codec_private, codec_private_len);
+ return;
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_SPECIAL)
+ {
+ if (buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG)
+ {
+ lprintf ("BUF_SPECIAL_DECODER_CONFIG\n");
+ seq->flag_header = 1;
+ uint8_t *codec_private = buf->decoder_info_ptr[2];
+ uint32_t codec_private_len = buf->decoder_info[2];
+ if (codec_private_len > 0)
+ parse_codec_private (this, codec_private, codec_private_len);
+ }
+ return;
+ }
+
+ if (!buf->size)
+ return;
+
+ int size = seq->bufpos + buf->size;
+ if (seq->bufsize < size)
+ {
+ if (seq->bufsize > MAX_BUFFER_SIZE)
+ {
+ fprintf (stderr,
+ "vdpau_h264_alter : sorry, can't accumulate so much data, broken stream?\n");
+ reset_sequence (seq);
+ return;
+ }
+ seq->bufsize = size + MIN_BUFFER_SIZE;
+ seq->buf = (uint8_t *) realloc (seq->buf, seq->bufsize);
+ lprintf ("realloc new size = %d\n", seq->bufsize);
+ }
+ xine_fast_memcpy (seq->buf + seq->bufpos, buf->content, buf->size);
+ seq->bufpos += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_START)
+ seq->pic_pts = buf->pts;
+
+ int frame_end = buf->decoder_flags & BUF_FLAG_FRAME_END;
+
+ if (seq->mode_frame)
+ {
+ if (!seq->pic_pts)
+ seq->pic_pts = buf->pts;
+ if (frame_end)
+ {
+ if (buf->pts)
+ seq->pic_pts = buf->pts;
+ lprintf ("frame_end && seq->mode_frame\n");
+ int fhs;
+ uint8_t tb;
+ uint32_t j = 0;
+ while (j < seq->bufpos)
+ {
+ uint32_t s = 0;
+ for (fhs = 0; fhs < seq->frame_header_size; fhs++)
+ s |= seq->buf[j + fhs] << (8 * (seq->frame_header_size - 1 - fhs));
+ tb = *(seq->buf + j + seq->frame_header_size) & 0x1F;
+ if (seq->slice_mode && (tb != seq->slice_mode))
+ {
+ decode_picture (this);
+ reset_slices (seq);
+ }
+ parse_startcodes (this, seq->buf + j + seq->frame_header_size, s);
+ j += seq->frame_header_size + s;
+ }
+ if (seq->slice_mode)
+ {
+ decode_picture (this);
+ reset_slices (seq);
+ }
+ seq->bufpos = 0;
+ }
+ return;
+ }
+
+ while (seq->bufseek <= seq->bufpos - 4)
+ {
+ uint8_t *buffer = seq->buf + seq->bufseek;
+ if (buffer[0] == 0 && buffer[1] == 0 && buffer[2] == 1)
+ {
+ if (seq->start < 0)
+ {
+ seq->start = seq->bufseek;
+ uint8_t tb = buffer[3] & 0x1F;
+ if (((tb == NAL_SLICE_NO_IDR) || (tb == NAL_SLICE_IDR))
+ && !seq->pic_pts)
+ seq->pic_pts = buf->pts;
+ if (seq->slice_mode && (tb != seq->slice_mode))
+ {
+ decode_picture (this);
+ flush_buffer (seq);
+ }
+ if ((tb & 0x1F) == NAL_END_SEQUENCE)
+ {
+ dpb_print (seq);
+ dpb_draw_frames (this, MAX_POC, DPB_DRAW_CLEAR);
+ lprintf ("NAL_END_SEQUENCE\n");
+ dpb_print (seq);
+ }
+ }
+ else
+ {
+ parse_startcodes (this, seq->buf + seq->start + 3,
+ seq->bufseek - seq->start - 3);
+ seq->start = -1;
+ --seq->bufseek;
+ }
+ }
+ ++seq->bufseek;
+ }
+
+ if (frame_end && seq->flag_header && (seq->start > -1)
+ && (seq->bufseek > seq->start))
+ {
+ lprintf ("frame_end && seq->start\n");
+ seq->bufseek = seq->bufpos;
+ parse_startcodes (this, seq->buf + seq->start + 3,
+ seq->bufseek - seq->start - 3);
+ if (seq->slice_mode)
+ decode_picture (this);
+ flush_buffer (seq);
+ }
+}
+
+
+/*
+ * This function is called when xine needs to flush the system.
+ */
+static void
+vdpau_h264_alter_flush (video_decoder_t * this_gen)
+{
+ vdpau_h264_alter_decoder_t *this = (vdpau_h264_alter_decoder_t *) this_gen;
+
+ printf ("vdpau_h264_alter_flush\n");
+ dpb_draw_frames (this, MAX_POC, DPB_DRAW_REFS);
+}
+
+
+/*
+ * This function resets the video decoder.
+ */
+static void
+vdpau_h264_alter_reset (video_decoder_t * this_gen)
+{
+ vdpau_h264_alter_decoder_t *this = (vdpau_h264_alter_decoder_t *) this_gen;
+
+ lprintf ("vdpau_h264_alter_reset\n");
+ reset_sequence (&this->sequence);
+}
+
+
+/*
+ * The decoder should forget any stored pts values here.
+ */
+static void
+vdpau_h264_alter_discontinuity (video_decoder_t * this_gen)
+{
+ vdpau_h264_alter_decoder_t *this = (vdpau_h264_alter_decoder_t *) this_gen;
+ printf ("vdpau_h264_alter_discontinuity\n");
+
+ dpb_clear_all_pts (&this->sequence);
+ this->sequence.reset = VO_NEW_SEQUENCE_FLAG;
+}
+
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void
+vdpau_h264_alter_dispose (video_decoder_t * this_gen)
+{
+
+ vdpau_h264_alter_decoder_t *this = (vdpau_h264_alter_decoder_t *) this_gen;
+
+ lprintf ("vdpau_h264_alter_dispose\n");
+
+ if ((this->decoder != VDP_INVALID_HANDLE) && this->sequence.accel_vdpau)
+ {
+ this->sequence.accel_vdpau->vdp_decoder_destroy (this->decoder);
+ this->decoder = VDP_INVALID_HANDLE;
+ }
+ reset_sequence (&this->sequence);
+
+ int i;
+ for (i = 0; i < MAX_DPB_SIZE; i++)
+ free (this->sequence.dpb[i]);
+ for (i = 0; i < 32; i++)
+ if (this->sequence.seq_param[i])
+ free (this->sequence.seq_param[i]);
+ for (i = 0; i < 255; i++)
+ if (this->sequence.pic_param[i])
+ free (this->sequence.pic_param[i]);
+
+ this->stream->video_out->close (this->stream->video_out, this->stream);
+
+ free (this->sequence.buf);
+ free (this_gen);
+}
+
+
+/*
+ * This function allocates, initializes, and returns a private video
+ * decoder structure.
+ */
+static video_decoder_t *
+open_plugin (video_decoder_class_t * class_gen, xine_stream_t * stream)
+{
+
+ vdpau_h264_alter_decoder_t *this;
+
+ /* the videoout must be vdpau-capable to support this decoder */
+ if (!
+ (stream->video_driver->
+ get_capabilities (stream->video_driver) & VO_CAP_VDPAU_H264))
+ return NULL;
+
+ /* now check if vdpau has free decoder resource */
+ vo_frame_t *img =
+ stream->video_out->get_frame (stream->video_out, 1920, 1080, 1,
+ XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS);
+ vdpau_accel_t *accel = (vdpau_accel_t *) img->accel_data;
+ int runtime_nr = accel->vdp_runtime_nr;
+ img->free (img);
+ VdpDecoder decoder;
+ VdpStatus st =
+ accel->vdp_decoder_create (accel->vdp_device,
+ VDP_DECODER_PROFILE_H264_MAIN, 1920, 1080, 16,
+ &decoder);
+ if (st != VDP_STATUS_OK)
+ {
+ fprintf (stderr, "can't create vdpau decoder!\n");
+ return NULL;
+ }
+
+ accel->vdp_decoder_destroy (decoder);
+
+ this =
+ (vdpau_h264_alter_decoder_t *) calloc (1,
+ sizeof
+ (vdpau_h264_alter_decoder_t));
+
+ this->video_decoder.decode_data = vdpau_h264_alter_decode_data;
+ this->video_decoder.flush = vdpau_h264_alter_flush;
+ this->video_decoder.reset = vdpau_h264_alter_reset;
+ this->video_decoder.discontinuity = vdpau_h264_alter_discontinuity;
+ this->video_decoder.dispose = vdpau_h264_alter_dispose;
+
+ this->stream = stream;
+ this->class = (vdpau_h264_alter_class_t *) class_gen;
+
+ int i;
+ for (i = 0; i < 16; i++)
+ this->sequence.dpb[i] = (dpb_frame_t *) calloc (1, sizeof (dpb_frame_t));
+ this->sequence.bufsize = MIN_BUFFER_SIZE;
+ this->sequence.buf = (uint8_t *) malloc (this->sequence.bufsize);
+ this->sequence.vdp_runtime_nr = runtime_nr;
+ this->sequence.reset = VO_NEW_SEQUENCE_FLAG;
+ this->sequence.reset = VO_NEW_SEQUENCE_FLAG;
+ this->sequence.ratio = 0.0;
+ this->sequence.video_step = 3600;
+ this->sequence.coded_width = 1280;
+ this->sequence.coded_height = 720;
+ this->sequence.reported_ratio = 0.0;
+ this->sequence.reported_video_step = 0;
+ this->sequence.reported_coded_width = 0;
+ this->sequence.reported_coded_height = 0;
+ this->sequence.frame_header_size = 4;
+ this->sequence.flag_header = 0;
+ this->sequence.mode_frame = 0;
+ reset_sequence (&this->sequence);
+
+ this->decoder = VDP_INVALID_HANDLE;
+ this->sequence.accel_vdpau = NULL;
+
+ (stream->video_out->open) (stream->video_out, stream);
+
+#ifdef MAKE_DAT
+ outfile = fopen ("/tmp/h264.dat", "w");
+ nframes = 0;
+#endif
+
+ return &this->video_decoder;
+}
+
+
+/*
+ * This function allocates a private video decoder class and initializes
+ * the class's member functions.
+ */
+static void *
+init_plugin (xine_t * xine, void *data)
+{
+
+ vdpau_h264_alter_class_t *this;
+
+ this =
+ (vdpau_h264_alter_class_t *) calloc (1,
+ sizeof (vdpau_h264_alter_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "vdpau_h264_alter";
+ this->decoder_class.description =
+ N_
+ ("vdpau_h264_alter: H264 decoder plugin using VDPAU hardware decoding.\n"
+ "Must be used along with video_out_vdpau.");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+
+/*
+ * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
+ BUF_VIDEO_H264,
+ 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_video = {
+ video_types, /* supported types */
+ 9 /* 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, "name", version, special_info, init_function } */
+ {PLUGIN_VIDEO_DECODER, 19, "vdpau_h264_alter", XINE_VERSION_CODE,
+ &dec_info_video, init_plugin},
+ {PLUGIN_NONE, 0, "", 0, NULL, NULL}
+};
diff --git a/src/video_dec/libvdpau/alterh264_decode.h b/src/video_dec/libvdpau/alterh264_decode.h
new file mode 100644
index 000000000..88f5e638f
--- /dev/null
+++ b/src/video_dec/libvdpau/alterh264_decode.h
@@ -0,0 +1,339 @@
+/* kate: tab-indent on; indent-width 4; mixedindent off; indent-mode cstyle; remove-trailing-space on; */
+#ifndef ALTERH264_DECODE_H
+#define ALTERH264_DECODE_H
+
+//#define LOG
+#define LOG_MODULE "vdpau_h264"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "accel_vdpau.h"
+#include <vdpau/vdpau.h>
+
+#include "alterh264_bits_reader.h"
+
+
+
+enum aspect_ratio
+{
+ ASPECT_UNSPECIFIED = 0,
+ ASPECT_1_1,
+ ASPECT_12_11,
+ ASPECT_10_11,
+ ASPECT_16_11,
+ ASPECT_40_33,
+ ASPECT_24_11,
+ ASPECT_20_11,
+ ASPECT_32_11,
+ ASPECT_80_33,
+ ASPECT_18_11,
+ ASPECT_15_11,
+ ASPECT_64_33,
+ ASPECT_160_99,
+ ASPECT_4_3,
+ ASPECT_3_2,
+ ASPECT_2_1,
+ ASPECT_RESERVED,
+ ASPECT_EXTENDED_SAR = 255
+};
+
+
+
+static const uint8_t zigzag_4x4[16] = {
+ 0, 1, 4, 8,
+ 5, 2, 3, 6,
+ 9, 12, 13, 10,
+ 7, 11, 14, 15
+};
+
+static const uint8_t zigzag_8x8[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
+};
+
+static const uint8_t default_4x4_intra[16] = {
+ 6, 13, 13, 20,
+ 20, 20, 28, 28,
+ 28, 28, 32, 32,
+ 32, 37, 37, 42
+};
+
+static const uint8_t default_4x4_inter[16] = {
+ 10, 14, 14, 20,
+ 20, 20, 24, 24,
+ 24, 24, 27, 27,
+ 27, 30, 30, 34
+};
+
+static const uint8_t default_8x8_intra[64] = {
+ 6, 10, 10, 13, 11, 13, 16, 16,
+ 16, 16, 18, 18, 18, 18, 18, 23,
+ 23, 23, 23, 23, 23, 25, 25, 25,
+ 25, 25, 25, 25, 27, 27, 27, 27,
+ 27, 27, 27, 27, 29, 29, 29, 29,
+ 29, 29, 29, 31, 31, 31, 31, 31,
+ 31, 33, 33, 33, 33, 33, 36, 36,
+ 36, 36, 38, 38, 38, 40, 40, 42
+};
+
+static const uint8_t default_8x8_inter[64] = {
+ 9, 13, 13, 15, 13, 15, 17, 17,
+ 17, 17, 19, 19, 19, 19, 19, 21,
+ 21, 21, 21, 21, 21, 22, 22, 22,
+ 22, 22, 22, 22, 24, 24, 24, 24,
+ 24, 24, 24, 24, 25, 25, 25, 25,
+ 25, 25, 25, 27, 27, 27, 27, 27,
+ 27, 28, 28, 28, 28, 28, 30, 30,
+ 30, 30, 32, 32, 32, 33, 33, 35
+};
+
+
+
+typedef struct
+{
+ uint8_t aspect_ratio_info;
+ uint8_t aspect_ratio_idc;
+ uint16_t sar_width;
+ uint16_t sar_height;
+ uint8_t colour_desc;
+ uint8_t colour_primaries;
+ uint8_t timing_info;
+ uint32_t num_units_in_tick;
+ uint32_t time_scale;
+} vui_param_t;
+
+
+
+typedef struct
+{
+ uint8_t profile_idc;
+ uint8_t level_idc;
+ uint8_t seq_parameter_set_id;
+ uint8_t constraint_set0_flag;
+ uint8_t constraint_set1_flag;
+ uint8_t constraint_set2_flag;
+ uint8_t constraint_set3_flag;
+ uint8_t chroma_format_idc;
+ uint8_t separate_colour_plane_flag;
+ uint8_t bit_depth_luma_minus8;
+ uint8_t bit_depth_chroma_minus8;
+ uint8_t qpprime_y_zero_transform_bypass_flag;
+ uint8_t seq_scaling_matrix_present_flag;
+ uint8_t scaling_lists_4x4[6][16];
+ uint8_t scaling_lists_8x8[2][64];
+ uint8_t log2_max_frame_num_minus4;
+ uint8_t pic_order_cnt_type;
+ uint8_t log2_max_pic_order_cnt_lsb_minus4;
+ uint8_t delta_pic_order_always_zero_flag;
+ int32_t offset_for_non_ref_pic;
+ int32_t offset_for_top_to_bottom_field;
+ uint8_t num_ref_frames_in_pic_order_cnt_cycle;
+ int32_t offset_for_ref_frame[256];
+ uint8_t num_ref_frames;
+ uint8_t gaps_in_frame_num_value_allowed_flag;
+ uint8_t pic_width_in_mbs_minus1;
+ uint8_t pic_height_in_map_units_minus1;
+ uint8_t frame_mbs_only_flag;
+ uint8_t mb_adaptive_frame_field_flag;
+ uint8_t direct_8x8_inference_flag;
+ uint8_t frame_cropping_flag;
+ uint16_t frame_crop_left_offset;
+ uint16_t frame_crop_right_offset;
+ uint16_t frame_crop_top_offset;
+ uint16_t frame_crop_bottom_offset;
+ uint8_t vui_parameters_present_flag;
+ vui_param_t vui;
+} seq_param_t;
+
+
+
+typedef struct
+{
+ uint8_t pic_parameter_set_id;
+ uint8_t seq_parameter_set_id;
+ uint8_t entropy_coding_mode_flag;
+ uint8_t pic_order_present_flag;
+ /*uint8_t num_slice_groups_minus1;
+ uint8_t slice_group_map_type;
+ uint16_t run_length_minus1[64];
+ uint16_t top_left[64];
+ uint16_t bottom_right[64];
+ uint8_t slice_group_change_direction_flag;
+ uint16_t slice_group_change_rate_minus1;
+ uint16_t pic_size_in_map_units_minus1;
+ uint8_t slice_group_id[64]; */
+ uint8_t num_ref_idx_l0_active_minus1;
+ uint8_t num_ref_idx_l1_active_minus1;
+ uint8_t weighted_pred_flag;
+ uint8_t weighted_bipred_idc;
+ int8_t pic_init_qp_minus26;
+ int8_t pic_init_qs_minus26;
+ int8_t chroma_qp_index_offset;
+ uint8_t deblocking_filter_control_present_flag;
+ uint8_t constrained_intra_pred_flag;
+ uint8_t redundant_pic_cnt_present_flag;
+ uint8_t transform_8x8_mode_flag;
+ uint8_t pic_scaling_matrix_present_flag;
+ uint8_t pic_scaling_list_present_flag[8];
+ uint8_t scaling_lists_4x4[6][16];
+ uint8_t scaling_lists_8x8[2][64];
+ int8_t second_chroma_qp_index_offset;
+} pic_param_t;
+
+
+
+typedef struct
+{
+ uint8_t nal_ref_idc;
+ uint8_t nal_unit_type;
+ uint8_t slice_type;
+ uint8_t pic_parameter_set_id;
+ uint16_t frame_num;
+ uint32_t MaxFrameNum;
+ uint8_t field_pic_flag;
+ uint8_t bottom_field_flag;
+ uint16_t idr_pic_id;
+ uint16_t pic_order_cnt_lsb;
+ int32_t delta_pic_order_cnt_bottom;
+ int32_t delta_pic_order_cnt[2];
+ uint8_t redundant_pic_cnt;
+ uint8_t num_ref_idx_l0_active_minus1;
+ uint8_t num_ref_idx_l1_active_minus1;
+} slice_param_t;
+
+
+#define PICTURE_TOP_DONE 1
+#define PICTURE_BOTTOM_DONE 2
+#define PICTURE_DONE 3
+
+#define SHORT_TERM_REF 1
+#define LONG_TERM_REF 2
+
+typedef struct
+{
+ uint8_t used;
+ uint8_t missing_header;
+ int64_t pts;
+ uint8_t drop_pts;
+ uint8_t completed;
+ uint8_t top_field_first;
+ uint16_t FrameNum;
+ int32_t FrameNumWrap;
+ int32_t PicNum[2]; /* 0:top, 1:bottom */
+ uint8_t is_reference[2]; /* 0:top, 1:bottom, short or long term */
+ uint8_t field_pic_flag;
+ int32_t PicOrderCntMsb;
+ int32_t TopFieldOrderCnt;
+ int32_t BottomFieldOrderCnt;
+ uint16_t pic_order_cnt_lsb;
+ uint8_t mmc5;
+
+ vo_frame_t *videoSurface;
+} dpb_frame_t;
+
+
+
+typedef struct
+{
+ uint32_t buf_offset;
+ uint32_t len;
+} slice_t;
+
+
+
+typedef struct
+{
+ uint32_t coded_width;
+ uint32_t reported_coded_width;
+ uint32_t coded_height;
+ uint32_t reported_coded_height;
+ uint64_t video_step; /* frame duration in pts units */
+ uint64_t reported_video_step; /* frame duration in pts units */
+ double ratio;
+ double reported_ratio;
+
+ slice_t slices[68];
+ int slices_count;
+ int slice_mode;
+
+ seq_param_t *seq_param[32];
+ pic_param_t *pic_param[256];
+ slice_param_t slice_param;
+
+ dpb_frame_t *dpb[16];
+ dpb_frame_t cur_pic;
+ uint16_t prevFrameNum;
+ uint16_t prevFrameNumOffset;
+ uint8_t prevMMC5;
+
+ VdpColorStandard color_standard;
+ int chroma;
+ int top_field_first;
+ VdpDecoderProfile profile;
+
+ uint8_t *buf; /* accumulate data */
+ int bufseek;
+ uint32_t bufsize;
+ uint32_t bufpos;
+ int start;
+
+ int64_t pic_pts;
+
+ bits_reader_t br;
+
+ int vdp_runtime_nr;
+ vdpau_accel_t *accel_vdpau;
+
+ int reset;
+ int startup_frame;
+
+ uint8_t mode_frame;
+ uint8_t flag_header;
+ uint32_t frame_header_size;
+
+} sequence_t;
+
+
+
+typedef struct
+{
+ video_decoder_class_t decoder_class;
+} vdpau_h264_alter_class_t;
+
+
+
+typedef struct vdpau_mpeg12_decoder_s
+{
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ vdpau_h264_alter_class_t *class;
+ xine_stream_t *stream;
+
+ sequence_t sequence;
+
+ VdpDecoder decoder;
+ VdpDecoderProfile decoder_profile;
+ uint32_t decoder_width;
+ uint32_t decoder_height;
+
+} vdpau_h264_alter_decoder_t;
+
+#endif /* ALTERH264_DECODE_H */
diff --git a/src/video_dec/libvdpau/bits_reader.h b/src/video_dec/libvdpau/bits_reader.h
new file mode 100644
index 000000000..db7cdfc7e
--- /dev/null
+++ b/src/video_dec/libvdpau/bits_reader.h
@@ -0,0 +1,82 @@
+#include <sys/types.h>
+
+
+
+typedef struct {
+ uint8_t *buffer, *start;
+ int offbits, length, oflow;
+} bits_reader_t;
+
+
+
+static void bits_reader_set( bits_reader_t *br, uint8_t *buf, int len )
+{
+ br->buffer = br->start = buf;
+ br->offbits = 0;
+ br->length = len;
+ br->oflow = 0;
+}
+
+
+
+static uint32_t read_bits( bits_reader_t *br, int nbits )
+{
+ int i, nbytes;
+ uint32_t ret = 0;
+ uint8_t *buf;
+
+ buf = br->buffer;
+ nbytes = (br->offbits + nbits)/8;
+ if ( ((br->offbits + nbits) %8 ) > 0 )
+ nbytes++;
+ if ( (buf + nbytes) > (br->start + br->length) ) {
+ br->oflow = 1;
+ return 0;
+ }
+ for ( i=0; i<nbytes; i++ )
+ ret += buf[i]<<((nbytes-i-1)*8);
+ i = (4-nbytes)*8+br->offbits;
+ ret = ((ret<<i)>>i)>>((nbytes*8)-nbits-br->offbits);
+
+ br->offbits += nbits;
+ br->buffer += br->offbits / 8;
+ br->offbits %= 8;
+
+ return ret;
+}
+
+
+
+static void skip_bits( bits_reader_t *br, int nbits )
+{
+ br->offbits += nbits;
+ br->buffer += br->offbits / 8;
+ br->offbits %= 8;
+ if ( br->buffer > (br->start + br->length) ) {
+ br->oflow = 1;
+ }
+}
+
+
+
+static uint32_t get_bits( bits_reader_t *br, int nbits )
+{
+ int i, nbytes;
+ uint32_t ret = 0;
+ uint8_t *buf;
+
+ buf = br->buffer;
+ nbytes = (br->offbits + nbits)/8;
+ if ( ((br->offbits + nbits) %8 ) > 0 )
+ nbytes++;
+ if ( (buf + nbytes) > (br->start + br->length) ) {
+ br->oflow = 1;
+ return 0;
+ }
+ for ( i=0; i<nbytes; i++ )
+ ret += buf[i]<<((nbytes-i-1)*8);
+ i = (4-nbytes)*8+br->offbits;
+ ret = ((ret<<i)>>i)>>((nbytes*8)-nbits-br->offbits);
+
+ return ret;
+}
diff --git a/src/video_dec/libvdpau/cpb.c b/src/video_dec/libvdpau/cpb.c
new file mode 100644
index 000000000..d06238e5c
--- /dev/null
+++ b/src/video_dec/libvdpau/cpb.c
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2009 Julian Scheel
+ *
+ * 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, USA
+ *
+ * cpb.c: Coded Picture Buffer
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "cpb.h"
+
+#include <stdlib.h>
+
+struct coded_picture* create_coded_picture()
+{
+ struct coded_picture* pic = calloc(1, sizeof(struct coded_picture));
+ return pic;
+}
+
+void free_coded_picture(struct coded_picture *pic)
+{
+ if(!pic)
+ return;
+
+ release_nal_unit(pic->sei_nal);
+ release_nal_unit(pic->sps_nal);
+ release_nal_unit(pic->pps_nal);
+ release_nal_unit(pic->slc_nal);
+
+ free(pic);
+}
+
diff --git a/src/video_dec/libvdpau/cpb.h b/src/video_dec/libvdpau/cpb.h
new file mode 100644
index 000000000..37dbd94cf
--- /dev/null
+++ b/src/video_dec/libvdpau/cpb.h
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2009 Julian Scheel
+ *
+ * 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, USA
+ *
+ * cpb.h: Coded Picture Buffer
+ */
+
+#ifndef CPB_H_
+#define CPB_H_
+
+#include "nal.h"
+
+enum picture_flags {
+ IDR_PIC = 0x01,
+ REFERENCE = 0x02,
+ NOT_EXISTING = 0x04,
+ INTERLACED = 0x08
+};
+
+struct coded_picture
+{
+ uint32_t flag_mask;
+
+ uint32_t max_pic_num;
+ int32_t pic_num;
+
+ uint8_t used_for_long_term_ref;
+ uint32_t long_term_pic_num;
+ uint32_t long_term_frame_idx;
+
+ int32_t top_field_order_cnt;
+ int32_t bottom_field_order_cnt;
+
+ uint8_t repeat_pic;
+
+ /* buffer data for the image slices, which
+ * are passed to the decoder
+ */
+ uint32_t slice_cnt;
+
+ int64_t pts;
+
+ struct nal_unit *sei_nal;
+ struct nal_unit *sps_nal;
+ struct nal_unit *pps_nal;
+ struct nal_unit *slc_nal;
+};
+
+struct coded_picture* create_coded_picture(void);
+void free_coded_picture(struct coded_picture *pic);
+
+#endif /* CPB_H_ */
diff --git a/src/video_dec/libvdpau/dpb.c b/src/video_dec/libvdpau/dpb.c
new file mode 100644
index 000000000..c2afd42ba
--- /dev/null
+++ b/src/video_dec/libvdpau/dpb.c
@@ -0,0 +1,622 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * 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, USA
+ *
+ * dpb.c: Implementing Decoded Picture Buffer
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "cpb.h"
+#include "dpb.h"
+#include "nal.h"
+
+#include "h264_parser.h"
+
+#include "accel_vdpau.h"
+
+#include <xine/video_out.h>
+
+//#define DEBUG_DPB
+
+int dp_top_field_first(struct decoded_picture *decoded_pic)
+{
+ int top_field_first = 1;
+
+
+ if (decoded_pic->coded_pic[1] != NULL) {
+ if (!decoded_pic->coded_pic[0]->slc_nal->slc.bottom_field_flag &&
+ decoded_pic->coded_pic[1]->slc_nal->slc.bottom_field_flag &&
+ decoded_pic->coded_pic[0]->top_field_order_cnt !=
+ decoded_pic->coded_pic[1]->bottom_field_order_cnt) {
+ top_field_first = decoded_pic->coded_pic[0]->top_field_order_cnt < decoded_pic->coded_pic[1]->bottom_field_order_cnt;
+ } else if (decoded_pic->coded_pic[0]->slc_nal->slc.bottom_field_flag &&
+ !decoded_pic->coded_pic[1]->slc_nal->slc.bottom_field_flag &&
+ decoded_pic->coded_pic[0]->bottom_field_order_cnt !=
+ decoded_pic->coded_pic[1]->top_field_order_cnt) {
+ top_field_first = decoded_pic->coded_pic[0]->bottom_field_order_cnt > decoded_pic->coded_pic[1]->top_field_order_cnt;
+ }
+ }
+
+ if (decoded_pic->coded_pic[0]->flag_mask & PIC_STRUCT_PRESENT && decoded_pic->coded_pic[0]->sei_nal != NULL) {
+ uint8_t pic_struct = decoded_pic->coded_pic[0]->sei_nal->sei.pic_timing.pic_struct;
+ if(pic_struct == DISP_TOP_BOTTOM ||
+ pic_struct == DISP_TOP_BOTTOM_TOP) {
+ top_field_first = 1;
+ } else if (pic_struct == DISP_BOTTOM_TOP ||
+ pic_struct == DISP_BOTTOM_TOP_BOTTOM) {
+ top_field_first = 0;
+ } else if (pic_struct == DISP_FRAME) {
+ top_field_first = 1;
+ }
+ }
+
+ return top_field_first;
+}
+
+/**
+ * ----------------------------------------------------------------------------
+ * decoded picture
+ * ----------------------------------------------------------------------------
+ */
+
+void free_decoded_picture(struct decoded_picture *pic);
+
+struct decoded_picture* init_decoded_picture(struct coded_picture *cpic, vo_frame_t *img)
+{
+ struct decoded_picture *pic = calloc(1, sizeof(struct decoded_picture));
+
+ pic->coded_pic[0] = cpic;
+
+ decoded_pic_check_reference(pic);
+ pic->img = img;
+ pic->lock_counter = 1;
+
+ return pic;
+}
+
+void decoded_pic_check_reference(struct decoded_picture *pic)
+{
+ int i;
+ for(i = 0; i < 2; i++) {
+ struct coded_picture *cpic = pic->coded_pic[i];
+ if(cpic && (cpic->flag_mask & REFERENCE)) {
+ // FIXME: this assumes Top Field First!
+ if(i == 0) {
+ pic->top_is_reference = cpic->slc_nal->slc.field_pic_flag
+ ? (cpic->slc_nal->slc.bottom_field_flag ? 0 : 1) : 1;
+ }
+
+ pic->bottom_is_reference = cpic->slc_nal->slc.field_pic_flag
+ ? (cpic->slc_nal->slc.bottom_field_flag ? 1 : 0) : 1;
+ }
+ }
+}
+
+void decoded_pic_add_field(struct decoded_picture *pic,
+ struct coded_picture *cpic)
+{
+ pic->coded_pic[1] = cpic;
+
+ decoded_pic_check_reference(pic);
+}
+
+void release_decoded_picture(struct decoded_picture *pic)
+{
+ if(!pic)
+ return;
+
+ pic->lock_counter--;
+ //printf("release decoded picture: %p (%d)\n", pic, pic->lock_counter);
+
+ if(pic->lock_counter <= 0) {
+ free_decoded_picture(pic);
+ }
+}
+
+void lock_decoded_picture(struct decoded_picture *pic)
+{
+ if(!pic)
+ return;
+
+ pic->lock_counter++;
+ //printf("lock decoded picture: %p (%d)\n", pic, pic->lock_counter);
+}
+
+void free_decoded_picture(struct decoded_picture *pic)
+{
+ if(!pic)
+ return;
+
+ if(pic->img != NULL) {
+ pic->img->free(pic->img);
+ }
+
+ free_coded_picture(pic->coded_pic[1]);
+ free_coded_picture(pic->coded_pic[0]);
+ pic->coded_pic[0] = NULL;
+ pic->coded_pic[1] = NULL;
+ free(pic);
+}
+
+
+
+
+/**
+ * ----------------------------------------------------------------------------
+ * dpb code starting here
+ * ----------------------------------------------------------------------------
+ */
+
+struct dpb* create_dpb(void)
+{
+ struct dpb *dpb = calloc(1, sizeof(struct dpb));
+
+ dpb->output_list = xine_list_new();
+ dpb->reference_list = xine_list_new();
+
+ dpb->max_reorder_frames = MAX_DPB_COUNT;
+ dpb->max_dpb_frames = MAX_DPB_COUNT;
+
+ return dpb;
+}
+
+int dpb_total_frames(struct dpb *dpb)
+{
+ int num_frames = xine_list_size(dpb->output_list);
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while(ite) {
+ struct decoded_picture *pic = xine_list_get_value(dpb->reference_list, ite);
+ if (xine_list_find(dpb->output_list, pic) == NULL) {
+ num_frames++;
+ }
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return num_frames;
+}
+
+void release_dpb(struct dpb *dpb)
+{
+ if(!dpb)
+ return;
+
+ dpb_free_all(dpb);
+
+ xine_list_delete(dpb->output_list);
+ xine_list_delete(dpb->reference_list);
+
+ free(dpb);
+}
+
+struct decoded_picture* dpb_get_next_out_picture(struct dpb *dpb, int do_flush)
+{
+ struct decoded_picture *pic = NULL;;
+ struct decoded_picture *outpic = NULL;
+
+ if(!do_flush &&
+ xine_list_size(dpb->output_list) < dpb->max_reorder_frames &&
+ dpb_total_frames(dpb) < dpb->max_dpb_frames) {
+ return NULL;
+ }
+
+ xine_list_iterator_t ite = xine_list_back(dpb->output_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->output_list, ite);
+
+ int32_t out_top_field_order_cnt = outpic != NULL ?
+ outpic->coded_pic[0]->top_field_order_cnt : 0;
+ int32_t top_field_order_cnt = pic->coded_pic[0]->top_field_order_cnt;
+
+ int32_t out_bottom_field_order_cnt = outpic != NULL ?
+ (outpic->coded_pic[1] != NULL ?
+ outpic->coded_pic[1]->bottom_field_order_cnt :
+ outpic->coded_pic[0]->top_field_order_cnt) : 0;
+ int32_t bottom_field_order_cnt = pic->coded_pic[1] != NULL ?
+ pic->coded_pic[1]->bottom_field_order_cnt :
+ pic->coded_pic[0]->top_field_order_cnt;
+
+ if (outpic == NULL ||
+ (top_field_order_cnt <= out_top_field_order_cnt &&
+ bottom_field_order_cnt <= out_bottom_field_order_cnt) ||
+ (out_top_field_order_cnt <= 0 && top_field_order_cnt > 0 &&
+ out_bottom_field_order_cnt <= 0 && bottom_field_order_cnt > 0) ||
+ outpic->coded_pic[0]->flag_mask & IDR_PIC) {
+ outpic = pic;
+ }
+
+ ite = xine_list_prev(dpb->output_list, ite);
+ }
+
+ return outpic;
+}
+
+struct decoded_picture* dpb_get_picture(struct dpb *dpb, uint32_t picnum)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ if ((pic->coded_pic[0]->pic_num == picnum ||
+ (pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->pic_num == picnum))) {
+ return pic;
+ }
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return NULL;
+}
+
+struct decoded_picture* dpb_get_picture_by_ltpn(struct dpb *dpb,
+ uint32_t longterm_picnum)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ if (pic->coded_pic[0]->long_term_pic_num == longterm_picnum ||
+ (pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->long_term_pic_num == longterm_picnum)) {
+ return pic;
+ }
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return NULL;
+}
+
+struct decoded_picture* dpb_get_picture_by_ltidx(struct dpb *dpb,
+ uint32_t longterm_idx)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ if (pic->coded_pic[0]->long_term_frame_idx == longterm_idx ||
+ (pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->long_term_frame_idx == longterm_idx)) {
+ return pic;
+ }
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return NULL;
+}
+
+int dpb_set_unused_ref_picture_byltpn(struct dpb *dpb, uint32_t longterm_picnum)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ uint8_t found = 0;
+
+ if (pic->coded_pic[0]->long_term_pic_num == longterm_picnum) {
+ pic->coded_pic[0]->used_for_long_term_ref = 0;
+ found = 1;
+ }
+
+ if ((pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->long_term_pic_num == longterm_picnum)) {
+ pic->coded_pic[1]->used_for_long_term_ref = 0;
+ found = 1;
+ }
+
+ if(found && !pic->coded_pic[0]->used_for_long_term_ref &&
+ (pic->coded_pic[1] == NULL ||
+ !pic->coded_pic[1]->used_for_long_term_ref)) {
+ dpb_unmark_reference_picture(dpb, pic);
+ }
+
+ if (found)
+ return 0;
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return -1;
+}
+
+int dpb_set_unused_ref_picture_bylidx(struct dpb *dpb, uint32_t longterm_idx)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ uint8_t found = 0;
+
+ if (pic->coded_pic[0]->long_term_frame_idx == longterm_idx) {
+ pic->coded_pic[0]->used_for_long_term_ref = 0;
+ found = 1;
+ }
+
+ if ((pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->long_term_frame_idx == longterm_idx)) {
+ pic->coded_pic[1]->used_for_long_term_ref = 0;
+ found = 1;
+ }
+
+ if(found && !pic->coded_pic[0]->used_for_long_term_ref &&
+ (pic->coded_pic[1] == NULL ||
+ !pic->coded_pic[1]->used_for_long_term_ref)) {
+ dpb_unmark_reference_picture(dpb, pic);
+ }
+
+ if (found)
+ return 0;
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return -1;
+}
+
+int dpb_set_unused_ref_picture_lidx_gt(struct dpb *dpb, int32_t longterm_idx)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ uint8_t found = 0;
+
+ if (pic->coded_pic[0]->long_term_frame_idx >= longterm_idx) {
+ pic->coded_pic[0]->used_for_long_term_ref = 0;
+ found = 1;
+ }
+
+ if ((pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->long_term_frame_idx >= longterm_idx)) {
+ pic->coded_pic[1]->used_for_long_term_ref = 0;
+ found = 1;
+ }
+
+ if(found && !pic->coded_pic[0]->used_for_long_term_ref &&
+ (pic->coded_pic[1] == NULL ||
+ !pic->coded_pic[1]->used_for_long_term_ref)) {
+ dpb_unmark_reference_picture(dpb, pic);
+ }
+
+ ite = xine_list_next(dpb->reference_list, ite);
+ }
+
+ return -1;
+}
+
+
+int dpb_unmark_picture_delayed(struct dpb *dpb, struct decoded_picture *pic)
+{
+ if(!pic)
+ return -1;
+
+ xine_list_iterator_t ite = xine_list_find(dpb->output_list, pic);
+ if (ite) {
+ xine_list_remove(dpb->output_list, ite);
+ release_decoded_picture(pic);
+
+ return 0;
+ }
+
+ return -1;
+}
+
+int dpb_unmark_reference_picture(struct dpb *dpb, struct decoded_picture *pic)
+{
+ if(!pic)
+ return -1;
+
+ xine_list_iterator_t ite = xine_list_find(dpb->reference_list, pic);
+ if (ite) {
+ xine_list_remove(dpb->reference_list, ite);
+ release_decoded_picture(pic);
+
+ return 0;
+ }
+
+ return -1;
+}
+
+/*static int dpb_remove_picture_by_img(struct dpb *dpb, vo_frame_t *remimg)
+{
+ int retval = -1;
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->output_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->output_list, ite);
+
+ if (pic->img == remimg) {
+ dpb_unmark_picture_delayed(dpb, pic);
+ dpb->used--;
+ retval = 0;
+ }
+
+ ite = xine_list_next(dpb->output_list, ite);
+ }
+
+ return retval;
+}*/
+
+
+int dpb_add_picture(struct dpb *dpb, struct decoded_picture *pic, uint32_t num_ref_frames)
+{
+#if 0
+ /* this should never happen */
+ pic->img->lock(pic->img);
+ if (0 == dpb_remove_picture_by_img(dpb, pic->img))
+ lprintf("H264/DPB broken stream: current img was already in dpb -- freed it\n");
+ else
+ pic->img->free(pic->img);
+#endif
+
+ /* add the pic to the output picture list, as no
+ * pic would be immediately drawn.
+ * acquire a lock for this list
+ */
+ lock_decoded_picture(pic);
+ xine_list_push_back(dpb->output_list, pic);
+
+
+ /* check if the pic is a reference pic,
+ * if it is it should be added to the reference
+ * list. another lock has to be acquired in that case
+ */
+ if (pic->coded_pic[0]->flag_mask & REFERENCE ||
+ (pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->flag_mask & REFERENCE)) {
+ lock_decoded_picture(pic);
+ xine_list_push_back(dpb->reference_list, pic);
+
+ /*
+ * always apply the sliding window reference removal, if more reference
+ * frames than expected are in the list. we will always remove the oldest
+ * reference frame
+ */
+ if(xine_list_size(dpb->reference_list) > num_ref_frames) {
+ struct decoded_picture *discard = xine_list_get_value(dpb->reference_list, xine_list_front(dpb->reference_list));
+ dpb_unmark_reference_picture(dpb, discard);
+ }
+ }
+
+#if DEBUG_DPB
+ printf("DPB list sizes: Total: %2d, Output: %2d, Reference: %2d\n",
+ dpb_total_frames(dpb), xine_list_size(dpb->output_list),
+ xine_list_size(dpb->reference_list));
+#endif
+
+ return 0;
+}
+
+int dpb_flush(struct dpb *dpb)
+{
+ struct decoded_picture *pic = NULL;
+
+ xine_list_iterator_t ite = xine_list_front(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+
+ dpb_unmark_reference_picture(dpb, pic);
+
+ /* CAUTION: xine_list_next would return an item, but not the one we
+ * expect, as the current one was deleted
+ */
+ ite = xine_list_front(dpb->reference_list);
+ }
+
+ return 0;
+}
+
+void dpb_free_all(struct dpb *dpb)
+{
+ xine_list_iterator_t ite = xine_list_front(dpb->output_list);
+ while(ite) {
+ dpb_unmark_picture_delayed(dpb, xine_list_get_value(dpb->output_list, ite));
+ /* CAUTION: xine_list_next would return an item, but not the one we
+ * expect, as the current one was deleted
+ */
+ ite = xine_list_front(dpb->output_list);
+ }
+
+ ite = xine_list_front(dpb->reference_list);
+ while(ite) {
+ dpb_unmark_reference_picture(dpb, xine_list_get_value(dpb->reference_list, ite));
+ /* CAUTION: xine_list_next would return an item, but not the one we
+ * expect, as the current one was deleted
+ */
+ ite = xine_list_front(dpb->reference_list);
+ }
+}
+
+void dpb_clear_all_pts(struct dpb *dpb)
+{
+ xine_list_iterator_t ite = xine_list_front(dpb->output_list);
+ while(ite) {
+ struct decoded_picture *pic = xine_list_get_value(dpb->output_list, ite);
+ pic->img->pts = 0;
+
+ ite = xine_list_next(dpb->output_list, ite);
+ }
+}
+
+int fill_vdpau_reference_list(struct dpb *dpb, VdpReferenceFrameH264 *reflist)
+{
+ struct decoded_picture *pic = NULL;
+
+ int i = 0;
+ int used_refframes = 0;
+
+ xine_list_iterator_t ite = xine_list_back(dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(dpb->reference_list, ite);
+ reflist[i].surface = ((vdpau_accel_t*)pic->img->accel_data)->surface;
+ reflist[i].is_long_term = pic->coded_pic[0]->used_for_long_term_ref ||
+ (pic->coded_pic[1] != NULL && pic->coded_pic[1]->used_for_long_term_ref);
+
+ reflist[i].frame_idx = pic->coded_pic[0]->used_for_long_term_ref ?
+ pic->coded_pic[0]->long_term_pic_num :
+ pic->coded_pic[0]->slc_nal->slc.frame_num;
+ reflist[i].top_is_reference = pic->top_is_reference;
+ reflist[i].bottom_is_reference = pic->bottom_is_reference;
+ reflist[i].field_order_cnt[0] = pic->coded_pic[0]->top_field_order_cnt;
+ reflist[i].field_order_cnt[1] = pic->coded_pic[1] != NULL ?
+ pic->coded_pic[1]->bottom_field_order_cnt :
+ pic->coded_pic[0]->bottom_field_order_cnt;
+ i++;
+
+ ite = xine_list_prev(dpb->reference_list, ite);
+ }
+
+ used_refframes = i;
+
+ // fill all other frames with invalid handles
+ while(i < 16) {
+ reflist[i].bottom_is_reference = VDP_FALSE;
+ reflist[i].top_is_reference = VDP_FALSE;
+ reflist[i].frame_idx = 0;
+ reflist[i].is_long_term = VDP_FALSE;
+ reflist[i].surface = VDP_INVALID_HANDLE;
+ reflist[i].field_order_cnt[0] = 0;
+ reflist[i].field_order_cnt[1] = 0;
+ i++;
+ }
+
+ return used_refframes;
+}
diff --git a/src/video_dec/libvdpau/dpb.h b/src/video_dec/libvdpau/dpb.h
new file mode 100644
index 000000000..356bcbf70
--- /dev/null
+++ b/src/video_dec/libvdpau/dpb.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * 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, USA
+ *
+ * dpb.h: Decoded Picture Buffer
+ */
+
+#ifndef DPB_H_
+#define DPB_H_
+
+#define MAX_DPB_COUNT 16
+
+#include "nal.h"
+#include "cpb.h"
+#include <xine/video_out.h>
+#include <xine/list.h>
+
+#define USED_FOR_REF (top_is_reference || bottom_is_reference)
+
+/**
+ * ----------------------------------------------------------------------------
+ * decoded picture
+ * ----------------------------------------------------------------------------
+ */
+
+struct decoded_picture {
+ vo_frame_t *img; /* this is the image we block, to make sure
+ * the surface is not double-used */
+
+ /**
+ * a decoded picture always contains a whole frame,
+ * respective a field pair, so it can contain up to
+ * 2 coded pics
+ */
+ struct coded_picture *coded_pic[2];
+
+ int32_t frame_num_wrap;
+
+ uint8_t top_is_reference;
+ uint8_t bottom_is_reference;
+
+ uint32_t lock_counter;
+};
+
+struct decoded_picture* init_decoded_picture(struct coded_picture *cpic,
+ vo_frame_t *img);
+void release_decoded_picture(struct decoded_picture *pic);
+void lock_decoded_picture(struct decoded_picture *pic);
+void decoded_pic_check_reference(struct decoded_picture *pic);
+void decoded_pic_add_field(struct decoded_picture *pic,
+ struct coded_picture *cpic);
+
+
+/**
+ * ----------------------------------------------------------------------------
+ * dpb code starting here
+ * ----------------------------------------------------------------------------
+ */
+
+/* Decoded Picture Buffer */
+struct dpb {
+ xine_list_t *reference_list;
+ xine_list_t *output_list;
+
+ int max_reorder_frames;
+ int max_dpb_frames;
+};
+
+struct dpb* create_dpb(void);
+void release_dpb(struct dpb *dpb);
+
+/**
+ * calculates the total number of frames in the dpb
+ * when frames are used for reference and are not drawn
+ * yet the result would be less then reference_list-size+
+ * output_list-size
+ */
+int dpb_total_frames(struct dpb *dpb);
+
+struct decoded_picture* dpb_get_next_out_picture(struct dpb *dpb, int do_flush);
+
+struct decoded_picture* dpb_get_picture(struct dpb *dpb, uint32_t picnum);
+struct decoded_picture* dpb_get_picture_by_ltpn(struct dpb *dpb, uint32_t longterm_picnum);
+struct decoded_picture* dpb_get_picture_by_ltidx(struct dpb *dpb, uint32_t longterm_idx);
+
+int dpb_set_unused_ref_picture_byltpn(struct dpb *dpb, uint32_t longterm_picnum);
+int dpb_set_unused_ref_picture_bylidx(struct dpb *dpb, uint32_t longterm_idx);
+int dpb_set_unused_ref_picture_lidx_gt(struct dpb *dpb, int32_t longterm_idx);
+
+int dpb_unmark_picture_delayed(struct dpb *dpb, struct decoded_picture *pic);
+int dpb_unmark_reference_picture(struct dpb *dpb, struct decoded_picture *pic);
+
+int dpb_add_picture(struct dpb *dpb, struct decoded_picture *pic, uint32_t num_ref_frames);
+int dpb_flush(struct dpb *dpb);
+void dpb_free_all(struct dpb *dpb);
+void dpb_clear_all_pts(struct dpb *dpb);
+
+int fill_vdpau_reference_list(struct dpb *dpb, VdpReferenceFrameH264 *reflist);
+
+int dp_top_field_first(struct decoded_picture *decoded_pic);
+
+#endif /* DPB_H_ */
diff --git a/src/video_dec/libvdpau/h264_parser.c b/src/video_dec/libvdpau/h264_parser.c
new file mode 100644
index 000000000..d495bf483
--- /dev/null
+++ b/src/video_dec/libvdpau/h264_parser.c
@@ -0,0 +1,2038 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * 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, USA
+ *
+ * h264_parser.c: Almost full-features H264 NAL-Parser
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include "h264_parser.h"
+#include "nal.h"
+#include "cpb.h"
+
+/* default scaling_lists according to Table 7-2 */
+uint8_t default_4x4_intra[16] = { 6, 13, 13, 20, 20, 20, 28, 28, 28, 28, 32,
+ 32, 32, 37, 37, 42 };
+
+uint8_t default_4x4_inter[16] = { 10, 14, 14, 20, 20, 20, 24, 24, 24, 24, 27,
+ 27, 27, 30, 30, 34 };
+
+uint8_t default_8x8_intra[64] = { 6, 10, 10, 13, 11, 13, 16, 16, 16, 16, 18,
+ 18, 18, 18, 18, 23, 23, 23, 23, 23, 23, 25, 25, 25, 25, 25, 25, 25, 27, 27,
+ 27, 27, 27, 27, 27, 27, 29, 29, 29, 29, 29, 29, 29, 31, 31, 31, 31, 31, 31,
+ 33, 33, 33, 33, 33, 36, 36, 36, 36, 38, 38, 38, 40, 40, 42 };
+
+uint8_t default_8x8_inter[64] = { 9, 13, 13, 15, 13, 15, 17, 17, 17, 17, 19,
+ 19, 19, 19, 19, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 24, 24,
+ 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 27, 27, 27, 27, 27, 27,
+ 28, 28, 28, 28, 28, 30, 30, 30, 30, 32, 32, 32, 33, 33, 35 };
+
+struct buf_reader
+{
+ uint8_t *buf;
+ uint8_t *cur_pos;
+ int len;
+ int cur_offset;
+};
+
+struct h264_parser* init_parser();
+
+static inline uint32_t read_bits(struct buf_reader *buf, int len);
+uint32_t read_exp_golomb(struct buf_reader *buf);
+int32_t read_exp_golomb_s(struct buf_reader *buf);
+
+void calculate_pic_order(struct h264_parser *parser, struct coded_picture *pic,
+ struct slice_header *slc);
+void skip_scaling_list(struct buf_reader *buf, int size);
+void parse_scaling_list(struct buf_reader *buf, uint8_t *scaling_list,
+ int length, int index);
+
+struct nal_unit* parse_nal_header(struct buf_reader *buf,
+ struct coded_picture *pic, struct h264_parser *parser);
+static void sps_scaling_list_fallback(struct seq_parameter_set_rbsp *sps,
+ int i);
+static void pps_scaling_list_fallback(struct seq_parameter_set_rbsp *sps,
+ struct pic_parameter_set_rbsp *pps, int i);
+
+uint8_t parse_sps(struct buf_reader *buf, struct seq_parameter_set_rbsp *sps);
+void interpret_sps(struct coded_picture *pic, struct h264_parser *parser);
+
+void parse_vui_parameters(struct buf_reader *buf,
+ struct seq_parameter_set_rbsp *sps);
+void parse_hrd_parameters(struct buf_reader *buf, struct hrd_parameters *hrd);
+
+uint8_t parse_pps(struct buf_reader *buf, struct pic_parameter_set_rbsp *pps);
+void interpret_pps(struct coded_picture *pic);
+
+void parse_sei(struct buf_reader *buf, struct sei_message *sei,
+ struct h264_parser *parser);
+void interpret_sei(struct coded_picture *pic);
+
+uint8_t parse_slice_header(struct buf_reader *buf, struct nal_unit *slc_nal,
+ struct h264_parser *parser);
+void interpret_slice_header(struct h264_parser *parser, struct nal_unit *slc_nal);
+
+void parse_ref_pic_list_reordering(struct buf_reader *buf,
+ struct slice_header *slc);
+
+void calculate_pic_nums(struct h264_parser *parser, struct coded_picture *cpic);
+void execute_ref_pic_marking(struct coded_picture *cpic,
+ uint32_t memory_management_control_operation,
+ uint32_t marking_nr,
+ struct h264_parser *parser);
+void parse_pred_weight_table(struct buf_reader *buf, struct slice_header *slc,
+ struct h264_parser *parser);
+void parse_dec_ref_pic_marking(struct buf_reader *buf,
+ struct nal_unit *slc_nal);
+
+/* here goes the parser implementation */
+
+static void decode_nal(uint8_t **ret, int *len_ret, uint8_t *buf, int buf_len)
+{
+ // TODO: rework without copying
+ uint8_t *end = &buf[buf_len];
+ uint8_t *pos = malloc(buf_len);
+
+ *ret = pos;
+ while (buf < end) {
+ if (buf < end - 3 && buf[0] == 0x00 && buf[1] == 0x00 && buf[2] == 0x03) {
+
+ *pos++ = 0x00;
+ *pos++ = 0x00;
+
+ buf += 3;
+ continue;
+ }
+ *pos++ = *buf++;
+ }
+
+ *len_ret = pos - *ret;
+}
+
+#if 0
+static inline void dump_bits(const char *label, const struct buf_reader *buf, int bits)
+{
+ struct buf_reader lbuf;
+ memcpy(&lbuf, buf, sizeof(struct buf_reader));
+
+ int i;
+ printf("%s: 0b", label);
+ for(i=0; i < bits; i++)
+ printf("%d", read_bits(&lbuf, 1));
+ printf("\n");
+}
+#endif
+
+/**
+ * @return total number of bits read by the buf_reader
+ */
+static inline uint32_t bits_read(struct buf_reader *buf)
+{
+ int bits_read = 0;
+ bits_read = (buf->cur_pos - buf->buf)*8;
+ bits_read += (8-buf->cur_offset);
+
+ return bits_read;
+}
+
+/* skips stuffing bytes in the buf_reader */
+static inline void skip_emulation_prevention_three_byte(struct buf_reader *buf)
+{
+ if(buf->cur_pos - buf->buf > 2 &&
+ *(buf->cur_pos-2) == 0x00 &&
+ *(buf->cur_pos-1) == 0x00 &&
+ *buf->cur_pos == 0x03) {
+ buf->cur_pos++;
+ }
+}
+
+/*
+ * read len bits from the buffer and return them
+ * @return right aligned bits
+ */
+static inline uint32_t read_bits(struct buf_reader *buf, int len)
+{
+ static uint32_t i_mask[33] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 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, 0xffffffff };
+
+ int i_shr;
+ uint32_t bits = 0;
+
+ while (len > 0 && (buf->cur_pos - buf->buf) < buf->len) {
+ if ((i_shr = buf->cur_offset - len) >= 0) {
+ bits |= (*buf->cur_pos >> i_shr) & i_mask[len];
+ buf->cur_offset -= len;
+ if (buf->cur_offset == 0) {
+ buf->cur_pos++;
+ buf->cur_offset = 8;
+
+ skip_emulation_prevention_three_byte(buf);
+ }
+ return bits;
+ }
+ else {
+ bits |= (*buf->cur_pos & i_mask[buf->cur_offset]) << -i_shr;
+ len -= buf->cur_offset;
+ buf->cur_pos++;
+ buf->cur_offset = 8;
+
+ skip_emulation_prevention_three_byte(buf);
+ }
+ }
+ return bits;
+}
+
+/* determines if following bits are rtsb_trailing_bits */
+static inline int rbsp_trailing_bits(uint8_t *buf, int buf_len)
+{
+ uint8_t *cur_buf = buf+(buf_len-1);
+ uint8_t cur_val;
+ int parsed_bits = 0;
+ int i;
+
+ while(buf_len > 0) {
+ cur_val = *cur_buf;
+ for(i = 0; i < 9; i++) {
+ if (cur_val&1)
+ return parsed_bits+i;
+ cur_val>>=1;
+ }
+ parsed_bits += 8;
+ cur_buf--;
+ }
+
+ lprintf("rbsp trailing bits could not be found\n");
+ return 0;
+}
+
+uint32_t read_exp_golomb(struct buf_reader *buf)
+{
+ int leading_zero_bits = 0;
+
+ while (read_bits(buf, 1) == 0 && leading_zero_bits < 32)
+ leading_zero_bits++;
+
+ uint32_t code = (1 << leading_zero_bits) - 1 + read_bits(buf,
+ leading_zero_bits);
+ return code;
+}
+
+int32_t read_exp_golomb_s(struct buf_reader *buf)
+{
+ uint32_t ue = read_exp_golomb(buf);
+ int32_t code = ue & 0x01 ? (ue + 1) / 2 : -(ue / 2);
+ return code;
+}
+
+
+/**
+ * parses the NAL header data and calls the subsequent
+ * parser methods that handle specific NAL units
+ */
+struct nal_unit* parse_nal_header(struct buf_reader *buf,
+ struct coded_picture *pic, struct h264_parser *parser)
+{
+ if (buf->len < 1)
+ return NULL;
+
+
+ struct nal_unit *nal = create_nal_unit();
+
+ nal->nal_ref_idc = (buf->buf[0] >> 5) & 0x03;
+ nal->nal_unit_type = buf->buf[0] & 0x1f;
+
+ buf->cur_pos = buf->buf + 1;
+ //lprintf("NAL: %d\n", nal->nal_unit_type);
+
+ struct buf_reader ibuf;
+ ibuf.cur_offset = 8;
+
+ switch (nal->nal_unit_type) {
+ case NAL_SPS:
+ parse_sps(buf, &nal->sps);
+ break;
+ case NAL_PPS:
+ parse_pps(buf, &nal->pps);
+ break;
+ case NAL_SLICE:
+ case NAL_PART_A:
+ case NAL_PART_B:
+ case NAL_PART_C:
+ case NAL_SLICE_IDR:
+ parse_slice_header(buf, nal, parser);
+ break;
+ case NAL_SEI:
+ memset(&(nal->sei), 0x00, sizeof(struct sei_message));
+ parse_sei(buf, &nal->sei, parser);
+ break;
+ default:
+ break;
+ }
+
+ return nal;
+}
+
+/**
+ * calculates the picture order count according to ITU-T Rec. H.264 (11/2007)
+ * chapter 8.2.1, p104f
+ */
+void calculate_pic_order(struct h264_parser *parser, struct coded_picture *pic,
+ struct slice_header *slc)
+{
+ /* retrieve sps and pps from the buffers */
+ struct nal_unit *pps_nal =
+ nal_buffer_get_by_pps_id(parser->pps_buffer, slc->pic_parameter_set_id);
+
+ if (pps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: calculate_pic_order: pic_parameter_set_id %d not found in buffers\n",
+ slc->pic_parameter_set_id);
+ return;
+ }
+
+ struct pic_parameter_set_rbsp *pps = &pps_nal->pps;
+
+ struct nal_unit *sps_nal =
+ nal_buffer_get_by_sps_id(parser->sps_buffer, pps->seq_parameter_set_id);
+
+ if (sps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: calculate_pic_order: seq_parameter_set_id %d not found in buffers\n",
+ pps->seq_parameter_set_id);
+ return;
+ }
+
+ struct seq_parameter_set_rbsp *sps = &sps_nal->sps;
+
+ if (sps->pic_order_cnt_type == 0) {
+
+ if (pic->flag_mask & IDR_PIC) {
+ parser->prev_pic_order_cnt_lsb = 0;
+ parser->prev_pic_order_cnt_msb = 0;
+
+
+ // FIXME
+ parser->frame_num_offset = 0;
+ }
+
+ const int max_poc_lsb = 1 << (sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
+
+ uint32_t pic_order_cnt_msb = 0;
+
+ if (slc->pic_order_cnt_lsb < parser->prev_pic_order_cnt_lsb
+ && parser->prev_pic_order_cnt_lsb - slc->pic_order_cnt_lsb
+ >= max_poc_lsb / 2)
+ pic_order_cnt_msb = parser->prev_pic_order_cnt_msb + max_poc_lsb;
+ else if (slc->pic_order_cnt_lsb > parser->prev_pic_order_cnt_lsb
+ && parser->prev_pic_order_cnt_lsb - slc->pic_order_cnt_lsb
+ < -max_poc_lsb / 2)
+ pic_order_cnt_msb = parser->prev_pic_order_cnt_msb - max_poc_lsb;
+ else
+ pic_order_cnt_msb = parser->prev_pic_order_cnt_msb;
+
+ if(!slc->field_pic_flag || !slc->bottom_field_flag) {
+ pic->top_field_order_cnt = pic_order_cnt_msb + slc->pic_order_cnt_lsb;
+ parser->prev_top_field_order_cnt = pic->top_field_order_cnt;
+ }
+
+ if (pic->flag_mask & REFERENCE) {
+ parser->prev_pic_order_cnt_msb = pic_order_cnt_msb;
+ }
+
+ pic->bottom_field_order_cnt = 0;
+
+ if(!slc->field_pic_flag)
+ pic->bottom_field_order_cnt = pic->top_field_order_cnt + slc->delta_pic_order_cnt_bottom;
+ else //if(slc->bottom_field_flag) //TODO: this is not spec compliant, but works...
+ pic->bottom_field_order_cnt = pic_order_cnt_msb + slc->pic_order_cnt_lsb;
+
+ if(slc->field_pic_flag && slc->bottom_field_flag)
+ pic->top_field_order_cnt = parser->prev_top_field_order_cnt;
+
+ } else if (sps->pic_order_cnt_type == 2) {
+ uint32_t prev_frame_num = parser->last_vcl_nal ? parser->last_vcl_nal->slc.frame_num : 0;
+ uint32_t prev_frame_num_offset = parser->frame_num_offset;
+ uint32_t temp_pic_order_cnt = 0;
+
+ if (parser->pic->flag_mask & IDR_PIC)
+ parser->frame_num_offset = 0;
+ else if (prev_frame_num > slc->frame_num)
+ parser->frame_num_offset = prev_frame_num_offset + sps->max_frame_num;
+ else
+ parser->frame_num_offset = prev_frame_num_offset;
+
+ if(parser->pic->flag_mask & IDR_PIC)
+ temp_pic_order_cnt = 0;
+ else if(!(parser->pic->flag_mask & REFERENCE))
+ temp_pic_order_cnt = 2 * (parser->frame_num_offset + slc->frame_num)-1;
+ else
+ temp_pic_order_cnt = 2 * (parser->frame_num_offset + slc->frame_num);
+
+ if(!slc->field_pic_flag)
+ pic->top_field_order_cnt = pic->bottom_field_order_cnt = temp_pic_order_cnt;
+ else if(slc->bottom_field_flag)
+ pic->bottom_field_order_cnt = temp_pic_order_cnt;
+ else
+ pic->top_field_order_cnt = temp_pic_order_cnt;
+
+ } else {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "FIXME: Unsupported poc_type: %d\n", sps->pic_order_cnt_type);
+ }
+}
+
+void skip_scaling_list(struct buf_reader *buf, int size)
+{
+ int i;
+ for (i = 0; i < size; i++) {
+ read_exp_golomb_s(buf);
+ }
+}
+
+void parse_scaling_list(struct buf_reader *buf, uint8_t *scaling_list,
+ int length, int index)
+{
+ int last_scale = 8;
+ int next_scale = 8;
+ int32_t delta_scale;
+ uint8_t use_default_scaling_matrix_flag = 0;
+ int i;
+
+ const uint8_t *zigzag = (length==64) ? zigzag_8x8 : zigzag_4x4;
+
+ for (i = 0; i < length; i++) {
+ if (next_scale != 0) {
+ delta_scale = read_exp_golomb_s(buf);
+ next_scale = (last_scale + delta_scale + 256) % 256;
+ if (i == 0 && next_scale == 0) {
+ use_default_scaling_matrix_flag = 1;
+ break;
+ }
+ }
+ scaling_list[zigzag[i]] = last_scale = (next_scale == 0) ? last_scale : next_scale;
+ }
+
+ if (use_default_scaling_matrix_flag) {
+ switch (index) {
+ case 0:
+ case 1:
+ case 2: {
+ for(i = 0; i < sizeof(default_4x4_intra); i++) {
+ scaling_list[zigzag_4x4[i]] = default_4x4_intra[i];
+ }
+ //memcpy(scaling_list, default_4x4_intra, sizeof(default_4x4_intra));
+ break;
+ }
+ case 3:
+ case 4:
+ case 5: {
+ for(i = 0; i < sizeof(default_4x4_inter); i++) {
+ scaling_list[zigzag_4x4[i]] = default_4x4_inter[i];
+ }
+ //memcpy(scaling_list, default_4x4_inter, sizeof(default_4x4_inter));
+ break;
+ }
+ case 6: {
+ for(i = 0; i < sizeof(default_8x8_intra); i++) {
+ scaling_list[zigzag_8x8[i]] = default_8x8_intra[i];
+ }
+ //memcpy(scaling_list, default_8x8_intra, sizeof(default_8x8_intra));
+ break;
+ }
+ case 7: {
+ for(i = 0; i < sizeof(default_8x8_inter); i++) {
+ scaling_list[zigzag_8x8[i]] = default_8x8_inter[i];
+ }
+ //memcpy(scaling_list, default_8x8_inter, sizeof(default_8x8_inter));
+ break;
+ }
+ }
+ }
+}
+
+static void sps_scaling_list_fallback(struct seq_parameter_set_rbsp *sps, int i)
+{
+ int j;
+ switch (i) {
+ case 0: {
+ for(j = 0; j < sizeof(default_4x4_intra); j++) {
+ sps->scaling_lists_4x4[i][zigzag_4x4[j]] = default_4x4_intra[j];
+ }
+ //memcpy(sps->scaling_lists_4x4[i], default_4x4_intra, sizeof(sps->scaling_lists_4x4[i]));
+ break;
+ }
+ case 3: {
+ for(j = 0; j < sizeof(default_4x4_inter); j++) {
+ sps->scaling_lists_4x4[i][zigzag_4x4[j]] = default_4x4_inter[j];
+ }
+ //memcpy(sps->scaling_lists_4x4[i], default_4x4_inter, sizeof(sps->scaling_lists_4x4[i]));
+ break;
+ }
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ memcpy(sps->scaling_lists_4x4[i], sps->scaling_lists_4x4[i-1], sizeof(sps->scaling_lists_4x4[i]));
+ break;
+ case 6: {
+ for(j = 0; j < sizeof(default_8x8_intra); j++) {
+ sps->scaling_lists_8x8[i-6][zigzag_8x8[j]] = default_8x8_intra[j];
+ }
+ //memcpy(sps->scaling_lists_8x8[i-6], default_8x8_intra, sizeof(sps->scaling_lists_8x8[i-6]));
+ break;
+ }
+ case 7: {
+ for(j = 0; j < sizeof(default_8x8_inter); j++) {
+ sps->scaling_lists_8x8[i-6][zigzag_8x8[j]] = default_8x8_inter[j];
+ }
+ //memcpy(sps->scaling_lists_8x8[i-6], default_8x8_inter, sizeof(sps->scaling_lists_8x8[i-6]));
+ break;
+ }
+
+ }
+}
+
+static void pps_scaling_list_fallback(struct seq_parameter_set_rbsp *sps, struct pic_parameter_set_rbsp *pps, int i)
+{
+ switch (i) {
+ case 0:
+ case 3:
+ memcpy(pps->scaling_lists_4x4[i], sps->scaling_lists_4x4[i], sizeof(pps->scaling_lists_4x4[i]));
+ break;
+ case 1:
+ case 2:
+ case 4:
+ case 5:
+ memcpy(pps->scaling_lists_4x4[i], pps->scaling_lists_4x4[i-1], sizeof(pps->scaling_lists_4x4[i]));
+ break;
+ case 6:
+ case 7:
+ memcpy(pps->scaling_lists_8x8[i-6], sps->scaling_lists_8x8[i-6], sizeof(pps->scaling_lists_8x8[i-6]));
+ break;
+
+ }
+}
+
+
+uint8_t parse_sps(struct buf_reader *buf, struct seq_parameter_set_rbsp *sps)
+{
+ sps->profile_idc = read_bits(buf, 8);
+ sps->constraint_setN_flag = read_bits(buf, 4);
+ read_bits(buf, 4);
+ sps->level_idc = read_bits(buf, 8);
+
+ sps->seq_parameter_set_id = read_exp_golomb(buf);
+
+ memset(sps->scaling_lists_4x4, 16, sizeof(sps->scaling_lists_4x4));
+ memset(sps->scaling_lists_8x8, 16, sizeof(sps->scaling_lists_8x8));
+ if (sps->profile_idc == 100 || sps->profile_idc == 110 || sps->profile_idc
+ == 122 || sps->profile_idc == 244 || sps->profile_idc == 44 ||
+ sps->profile_idc == 83 || sps->profile_idc == 86) {
+ sps->chroma_format_idc = read_exp_golomb(buf);
+ if (sps->chroma_format_idc == 3) {
+ sps->separate_colour_plane_flag = read_bits(buf, 1);
+ }
+
+ sps->bit_depth_luma_minus8 = read_exp_golomb(buf);
+ sps->bit_depth_chroma_minus8 = read_exp_golomb(buf);
+ sps->qpprime_y_zero_transform_bypass_flag = read_bits(buf, 1);
+ sps->seq_scaling_matrix_present_flag = read_bits(buf, 1);
+ if (sps->seq_scaling_matrix_present_flag) {
+ int i;
+ for (i = 0; i < 8; i++) {
+ sps->seq_scaling_list_present_flag[i] = read_bits(buf, 1);
+
+ if (sps->seq_scaling_list_present_flag[i]) {
+ if (i < 6)
+ parse_scaling_list(buf, sps->scaling_lists_4x4[i], 16, i);
+ else
+ parse_scaling_list(buf, sps->scaling_lists_8x8[i - 6], 64, i);
+ } else {
+ sps_scaling_list_fallback(sps, i);
+ }
+ }
+ }
+ } else
+ sps->chroma_format_idc = 1;
+
+ sps->log2_max_frame_num_minus4 = read_exp_golomb(buf);
+ sps->max_frame_num = 1 << (sps->log2_max_frame_num_minus4 + 4);
+
+ sps->pic_order_cnt_type = read_exp_golomb(buf);
+ if (!sps->pic_order_cnt_type)
+ sps->log2_max_pic_order_cnt_lsb_minus4 = read_exp_golomb(buf);
+ else if(sps->pic_order_cnt_type == 1) {
+ sps->delta_pic_order_always_zero_flag = read_bits(buf, 1);
+ sps->offset_for_non_ref_pic = read_exp_golomb_s(buf);
+ sps->offset_for_top_to_bottom_field = read_exp_golomb_s(buf);
+ sps->num_ref_frames_in_pic_order_cnt_cycle = read_exp_golomb(buf);
+ int i;
+ for (i = 0; i < sps->num_ref_frames_in_pic_order_cnt_cycle; i++) {
+ sps->offset_for_ref_frame[i] = read_exp_golomb_s(buf);
+ }
+ }
+
+ sps->num_ref_frames = read_exp_golomb(buf);
+ sps->gaps_in_frame_num_value_allowed_flag = read_bits(buf, 1);
+
+ /*sps->pic_width_in_mbs_minus1 = read_exp_golomb(buf);
+ sps->pic_height_in_map_units_minus1 = read_exp_golomb(buf);*/
+ sps->pic_width = 16 * (read_exp_golomb(buf) + 1);
+ sps->pic_height = 16 * (read_exp_golomb(buf) + 1);
+
+ sps->frame_mbs_only_flag = read_bits(buf, 1);
+
+ /* compute the height correctly even for interlaced material */
+ sps->pic_height = (2 - sps->frame_mbs_only_flag) * sps->pic_height;
+ if (sps->pic_height == 1088)
+ sps->pic_height = 1080;
+
+ if (!sps->frame_mbs_only_flag)
+ sps->mb_adaptive_frame_field_flag = read_bits(buf, 1);
+
+ sps->direct_8x8_inference_flag = read_bits(buf, 1);
+ sps->frame_cropping_flag = read_bits(buf, 1);
+ if (sps->frame_cropping_flag) {
+ sps->frame_crop_left_offset = read_exp_golomb(buf);
+ sps->frame_crop_right_offset = read_exp_golomb(buf);
+ sps->frame_crop_top_offset = read_exp_golomb(buf);
+ sps->frame_crop_bottom_offset = read_exp_golomb(buf);
+ }
+ sps->vui_parameters_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters_present_flag) {
+ parse_vui_parameters(buf, sps);
+ }
+
+ return 0;
+}
+
+/* evaluates values parsed by sps and modifies the current
+ * picture according to them
+ */
+void interpret_sps(struct coded_picture *pic, struct h264_parser *parser)
+{
+ if(pic->sps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "WARNING: Picture contains no seq_parameter_set\n");
+ return;
+ }
+
+ struct seq_parameter_set_rbsp *sps = &pic->sps_nal->sps;
+
+ if(sps->vui_parameters_present_flag &&
+ sps->vui_parameters.pic_struct_present_flag) {
+ parser->flag_mask |= PIC_STRUCT_PRESENT;
+ } else {
+ parser->flag_mask &= ~PIC_STRUCT_PRESENT;
+ }
+
+ if(sps->vui_parameters_present_flag &&
+ (sps->vui_parameters.nal_hrd_parameters_present_flag ||
+ sps->vui_parameters.vc1_hrd_parameters_present_flag)) {
+ parser->flag_mask |= CPB_DPB_DELAYS_PRESENT;
+ } else {
+ parser->flag_mask &= ~(CPB_DPB_DELAYS_PRESENT);
+ }
+
+ if(pic->slc_nal != NULL) {
+ struct slice_header *slc = &pic->slc_nal->slc;
+ if (slc->field_pic_flag == 0) {
+ pic->max_pic_num = sps->max_frame_num;
+ parser->curr_pic_num = slc->frame_num;
+ } else {
+ pic->max_pic_num = 2 * sps->max_frame_num;
+ parser->curr_pic_num = 2 * slc->frame_num + 1;
+ }
+ }
+}
+
+void parse_sei(struct buf_reader *buf, struct sei_message *sei,
+ struct h264_parser *parser)
+{
+ uint8_t tmp;
+
+ struct nal_unit *sps_nal =
+ nal_buffer_get_last(parser->sps_buffer);
+
+ if (sps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: parse_sei: seq_parameter_set_id not found in buffers\n");
+ return;
+ }
+
+ struct seq_parameter_set_rbsp *sps = &sps_nal->sps;
+
+ sei->payload_type = 0;
+ while((tmp = read_bits(buf, 8)) == 0xff) {
+ sei->payload_type += 255;
+ }
+ sei->last_payload_type_byte = tmp;
+ sei->payload_type += sei->last_payload_type_byte;
+
+ sei->payload_size = 0;
+ while((tmp = read_bits(buf, 8)) == 0xff) {
+ sei->payload_size += 255;
+ }
+ sei->last_payload_size_byte = tmp;
+ sei->payload_size += sei->last_payload_size_byte;
+
+ /* pic_timing */
+ if(sei->payload_type == 1) {
+ if(parser->flag_mask & CPB_DPB_DELAYS_PRESENT) {
+ sei->pic_timing.cpb_removal_delay = read_bits(buf, 5);
+ sei->pic_timing.dpb_output_delay = read_bits(buf, 5);
+ }
+
+ if(parser->flag_mask & PIC_STRUCT_PRESENT) {
+ sei->pic_timing.pic_struct = read_bits(buf, 4);
+
+ uint8_t NumClockTs = 0;
+ switch(sei->pic_timing.pic_struct) {
+ case 0:
+ case 1:
+ case 2:
+ NumClockTs = 1;
+ break;
+ case 3:
+ case 4:
+ case 7:
+ NumClockTs = 2;
+ break;
+ case 5:
+ case 6:
+ case 8:
+ NumClockTs = 3;
+ break;
+ }
+
+ int i;
+ for(i = 0; i < NumClockTs; i++) {
+ if(read_bits(buf, 1)) { /* clock_timestamp_flag == 1 */
+ sei->pic_timing.ct_type = read_bits(buf, 2);
+ sei->pic_timing.nuit_field_based_flag = read_bits(buf, 1);
+ sei->pic_timing.counting_type = read_bits(buf, 5);
+ sei->pic_timing.full_timestamp_flag = read_bits(buf, 1);
+ sei->pic_timing.discontinuity_flag = read_bits(buf, 1);
+ sei->pic_timing.cnt_dropped_flag = read_bits(buf, 1);
+ sei->pic_timing.n_frames = read_bits(buf, 8);
+ if(sei->pic_timing.full_timestamp_flag) {
+ sei->pic_timing.seconds_value = read_bits(buf, 6);
+ sei->pic_timing.minutes_value = read_bits(buf, 6);
+ sei->pic_timing.hours_value = read_bits(buf, 5);
+ } else {
+ if(read_bits(buf, 1)) {
+ sei->pic_timing.seconds_value = read_bits(buf, 6);
+
+ if(read_bits(buf, 1)) {
+ sei->pic_timing.minutes_value = read_bits(buf, 6);
+
+ if(read_bits(buf, 1)) {
+ sei->pic_timing.hours_value = read_bits(buf, 5);
+ }
+ }
+ }
+ }
+
+ if(sps->vui_parameters_present_flag &&
+ sps->vui_parameters.nal_hrd_parameters_present_flag) {
+ sei->pic_timing.time_offset =
+ read_bits(buf,
+ sps->vui_parameters.nal_hrd_parameters.time_offset_length);
+ }
+ }
+ }
+ }
+ } /*else {
+ fprintf(stderr, "Unimplemented SEI payload: %d\n", sei->payload_type);
+ }*/
+
+}
+
+void interpret_sei(struct coded_picture *pic)
+{
+ if(!pic->sps_nal || !pic->sei_nal)
+ return;
+
+ struct seq_parameter_set_rbsp *sps = &pic->sps_nal->sps;
+ struct sei_message *sei = &pic->sei_nal->sei;
+
+ if(sps && sps->vui_parameters_present_flag &&
+ sps->vui_parameters.pic_struct_present_flag) {
+ switch(sei->pic_timing.pic_struct) {
+ case DISP_FRAME:
+ pic->flag_mask &= ~INTERLACED;
+ pic->repeat_pic = 0;
+ break;
+ case DISP_TOP:
+ case DISP_BOTTOM:
+ case DISP_TOP_BOTTOM:
+ case DISP_BOTTOM_TOP:
+ pic->flag_mask |= INTERLACED;
+ break;
+ case DISP_TOP_BOTTOM_TOP:
+ case DISP_BOTTOM_TOP_BOTTOM:
+ pic->flag_mask |= INTERLACED;
+ pic->repeat_pic = 1;
+ break;
+ case DISP_FRAME_DOUBLING:
+ pic->flag_mask &= ~INTERLACED;
+ pic->repeat_pic = 2;
+ break;
+ case DISP_FRAME_TRIPLING:
+ pic->flag_mask &= ~INTERLACED;
+ pic->repeat_pic = 3;
+ }
+ }
+}
+
+void parse_vui_parameters(struct buf_reader *buf,
+ struct seq_parameter_set_rbsp *sps)
+{
+ sps->vui_parameters.aspect_ration_info_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.aspect_ration_info_present_flag == 1) {
+ sps->vui_parameters.aspect_ratio_idc = read_bits(buf, 8);
+ if (sps->vui_parameters.aspect_ratio_idc == ASPECT_EXTENDED_SAR) {
+ sps->vui_parameters.sar_width = read_bits(buf, 16);
+ sps->vui_parameters.sar_height = read_bits(buf, 16);
+ }
+ }
+
+ sps->vui_parameters.overscan_info_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.overscan_info_present_flag) {
+ sps->vui_parameters.overscan_appropriate_flag = read_bits(buf, 1);
+ }
+
+ sps->vui_parameters.video_signal_type_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.video_signal_type_present_flag) {
+ sps->vui_parameters.video_format = read_bits(buf, 3);
+ sps->vui_parameters.video_full_range_flag = read_bits(buf, 1);
+ sps->vui_parameters.colour_description_present = read_bits(buf, 1);
+ if (sps->vui_parameters.colour_description_present) {
+ sps->vui_parameters.colour_primaries = read_bits(buf, 8);
+ sps->vui_parameters.transfer_characteristics = read_bits(buf, 8);
+ sps->vui_parameters.matrix_coefficients = read_bits(buf, 8);
+ }
+ }
+
+ sps->vui_parameters.chroma_loc_info_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.chroma_loc_info_present_flag) {
+ sps->vui_parameters.chroma_sample_loc_type_top_field = read_exp_golomb(buf);
+ sps->vui_parameters.chroma_sample_loc_type_bottom_field = read_exp_golomb(
+ buf);
+ }
+
+ sps->vui_parameters.timing_info_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.timing_info_present_flag) {
+ uint32_t num_units_in_tick = read_bits(buf, 32);
+ uint32_t time_scale = read_bits(buf, 32);
+ sps->vui_parameters.num_units_in_tick = num_units_in_tick;
+ sps->vui_parameters.time_scale = time_scale;
+ sps->vui_parameters.fixed_frame_rate_flag = read_bits(buf, 1);
+ }
+
+ sps->vui_parameters.nal_hrd_parameters_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.nal_hrd_parameters_present_flag)
+ parse_hrd_parameters(buf, &sps->vui_parameters.nal_hrd_parameters);
+
+ sps->vui_parameters.vc1_hrd_parameters_present_flag = read_bits(buf, 1);
+ if (sps->vui_parameters.vc1_hrd_parameters_present_flag)
+ parse_hrd_parameters(buf, &sps->vui_parameters.vc1_hrd_parameters);
+
+ if (sps->vui_parameters.nal_hrd_parameters_present_flag
+ || sps->vui_parameters.vc1_hrd_parameters_present_flag)
+ sps->vui_parameters.low_delay_hrd_flag = read_bits(buf, 1);
+
+ sps->vui_parameters.pic_struct_present_flag = read_bits(buf, 1);
+ sps->vui_parameters.bitstream_restriction_flag = read_bits(buf, 1);
+
+ if (sps->vui_parameters.bitstream_restriction_flag) {
+ sps->vui_parameters.motion_vectors_over_pic_boundaries = read_bits(buf, 1);
+ sps->vui_parameters.max_bytes_per_pic_denom = read_exp_golomb(buf);
+ sps->vui_parameters.max_bits_per_mb_denom = read_exp_golomb(buf);
+ sps->vui_parameters.log2_max_mv_length_horizontal = read_exp_golomb(buf);
+ sps->vui_parameters.log2_max_mv_length_vertical = read_exp_golomb(buf);
+ sps->vui_parameters.num_reorder_frames = read_exp_golomb(buf);
+ sps->vui_parameters.max_dec_frame_buffering = read_exp_golomb(buf);
+ }
+}
+
+void parse_hrd_parameters(struct buf_reader *buf, struct hrd_parameters *hrd)
+{
+ hrd->cpb_cnt_minus1 = read_exp_golomb(buf);
+ hrd->bit_rate_scale = read_bits(buf, 4);
+ hrd->cpb_size_scale = read_bits(buf, 4);
+
+ int i;
+ for (i = 0; i <= hrd->cpb_cnt_minus1; i++) {
+ hrd->bit_rate_value_minus1[i] = read_exp_golomb(buf);
+ hrd->cpb_size_value_minus1[i] = read_exp_golomb(buf);
+ hrd->cbr_flag[i] = read_bits(buf, 1);
+ }
+
+ hrd->initial_cpb_removal_delay_length_minus1 = read_bits(buf, 5);
+ hrd->cpb_removal_delay_length_minus1 = read_bits(buf, 5);
+ hrd->dpb_output_delay_length_minus1 = read_bits(buf, 5);
+ hrd->time_offset_length = read_bits(buf, 5);
+}
+
+uint8_t parse_pps(struct buf_reader *buf, struct pic_parameter_set_rbsp *pps)
+{
+ pps->pic_parameter_set_id = read_exp_golomb(buf);
+ pps->seq_parameter_set_id = read_exp_golomb(buf);
+ pps->entropy_coding_mode_flag = read_bits(buf, 1);
+ pps->pic_order_present_flag = read_bits(buf, 1);
+
+ pps->num_slice_groups_minus1 = read_exp_golomb(buf);
+ if (pps->num_slice_groups_minus1 > 0) {
+ pps->slice_group_map_type = read_exp_golomb(buf);
+ if (pps->slice_group_map_type == 0) {
+ int i_group;
+ for (i_group = 0; i_group <= pps->num_slice_groups_minus1; i_group++) {
+ if (i_group < 64)
+ pps->run_length_minus1[i_group] = read_exp_golomb(buf);
+ else { // FIXME: skips if more than 64 groups exist
+ lprintf("Error: Only 64 slice_groups are supported\n");
+ read_exp_golomb(buf);
+ }
+ }
+ }
+ else if (pps->slice_group_map_type == 3 || pps->slice_group_map_type == 4
+ || pps->slice_group_map_type == 5) {
+ pps->slice_group_change_direction_flag = read_bits(buf, 1);
+ pps->slice_group_change_rate_minus1 = read_exp_golomb(buf);
+ }
+ else if (pps->slice_group_map_type == 6) {
+ pps->pic_size_in_map_units_minus1 = read_exp_golomb(buf);
+ int i_group;
+ for (i_group = 0; i_group <= pps->num_slice_groups_minus1; i_group++) {
+ pps->slice_group_id[i_group] = read_bits(buf, ceil(log(
+ pps->num_slice_groups_minus1 + 1)));
+ }
+ }
+ }
+
+ pps->num_ref_idx_l0_active_minus1 = read_exp_golomb(buf);
+ pps->num_ref_idx_l1_active_minus1 = read_exp_golomb(buf);
+ pps->weighted_pred_flag = read_bits(buf, 1);
+ pps->weighted_bipred_idc = read_bits(buf, 2);
+ pps->pic_init_qp_minus26 = read_exp_golomb_s(buf);
+ pps->pic_init_qs_minus26 = read_exp_golomb_s(buf);
+ pps->chroma_qp_index_offset = read_exp_golomb_s(buf);
+ pps->deblocking_filter_control_present_flag = read_bits(buf, 1);
+ pps->constrained_intra_pred_flag = read_bits(buf, 1);
+ pps->redundant_pic_cnt_present_flag = read_bits(buf, 1);
+
+ int bit_length = (buf->len*8)-rbsp_trailing_bits(buf->buf, buf->len);
+ int bit_read = bits_read(buf);
+
+ memset(pps->scaling_lists_4x4, 16, sizeof(pps->scaling_lists_4x4));
+ memset(pps->scaling_lists_8x8, 16, sizeof(pps->scaling_lists_8x8));
+ if (bit_length-bit_read > 1) {
+ pps->transform_8x8_mode_flag = read_bits(buf, 1);
+ pps->pic_scaling_matrix_present_flag = read_bits(buf, 1);
+ if (pps->pic_scaling_matrix_present_flag) {
+ int i;
+ for (i = 0; i < 8; i++) {
+ if(i < 6 || pps->transform_8x8_mode_flag)
+ pps->pic_scaling_list_present_flag[i] = read_bits(buf, 1);
+ else
+ pps->pic_scaling_list_present_flag[i] = 0;
+
+ if (pps->pic_scaling_list_present_flag[i]) {
+ if (i < 6)
+ parse_scaling_list(buf, pps->scaling_lists_4x4[i], 16, i);
+ else
+ parse_scaling_list(buf, pps->scaling_lists_8x8[i - 6], 64, i);
+ }
+ }
+ }
+
+ pps->second_chroma_qp_index_offset = read_exp_golomb_s(buf);
+ } else
+ pps->second_chroma_qp_index_offset = pps->chroma_qp_index_offset;
+
+ return 0;
+}
+
+void interpret_pps(struct coded_picture *pic)
+{
+ if(pic->sps_nal == NULL) {
+ lprintf("WARNING: Picture contains no seq_parameter_set\n");
+ return;
+ } else if(pic->pps_nal == NULL) {
+ lprintf("WARNING: Picture contains no pic_parameter_set\n");
+ return;
+ }
+
+ struct seq_parameter_set_rbsp *sps = &pic->sps_nal->sps;
+ struct pic_parameter_set_rbsp *pps = &pic->pps_nal->pps;
+
+ int i;
+ for (i = 0; i < 8; i++) {
+ if (!pps->pic_scaling_list_present_flag[i]) {
+ pps_scaling_list_fallback(sps, pps, i);
+ }
+ }
+
+ if (!pps->pic_scaling_matrix_present_flag && sps != NULL) {
+ memcpy(pps->scaling_lists_4x4, sps->scaling_lists_4x4,
+ sizeof(pps->scaling_lists_4x4));
+ memcpy(pps->scaling_lists_8x8, sps->scaling_lists_8x8,
+ sizeof(pps->scaling_lists_8x8));
+ }
+}
+
+uint8_t parse_slice_header(struct buf_reader *buf, struct nal_unit *slc_nal,
+ struct h264_parser *parser)
+{
+ struct slice_header *slc = &slc_nal->slc;
+
+ slc->first_mb_in_slice = read_exp_golomb(buf);
+ /* we do some parsing on the slice type, because the list is doubled */
+ slc->slice_type = slice_type(read_exp_golomb(buf));
+
+ //print_slice_type(slc->slice_type);
+ slc->pic_parameter_set_id = read_exp_golomb(buf);
+
+ /* retrieve sps and pps from the buffers */
+ struct nal_unit *pps_nal =
+ nal_buffer_get_by_pps_id(parser->pps_buffer, slc->pic_parameter_set_id);
+
+ if (pps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: parse_slice_header: pic_parameter_set_id %d not found in buffers\n",
+ slc->pic_parameter_set_id);
+ return -1;
+ }
+
+ struct pic_parameter_set_rbsp *pps = &pps_nal->pps;
+
+ struct nal_unit *sps_nal =
+ nal_buffer_get_by_sps_id(parser->sps_buffer, pps->seq_parameter_set_id);
+
+ if (sps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: parse_slice_header: seq_parameter_set_id %d not found in buffers\n",
+ pps->seq_parameter_set_id);
+ return -1;
+ }
+
+ struct seq_parameter_set_rbsp *sps = &sps_nal->sps;
+
+ if(sps->separate_colour_plane_flag)
+ slc->colour_plane_id = read_bits(buf, 2);
+
+ slc->frame_num = read_bits(buf, sps->log2_max_frame_num_minus4 + 4);
+ if (!sps->frame_mbs_only_flag) {
+ slc->field_pic_flag = read_bits(buf, 1);
+ if (slc->field_pic_flag)
+ slc->bottom_field_flag = read_bits(buf, 1);
+ else
+ slc->bottom_field_flag = 0;
+ }
+ else {
+ slc->field_pic_flag = 0;
+ slc->bottom_field_flag = 0;
+ }
+
+ if (slc_nal->nal_unit_type == NAL_SLICE_IDR)
+ slc->idr_pic_id = read_exp_golomb(buf);
+
+ if (!sps->pic_order_cnt_type) {
+ slc->pic_order_cnt_lsb = read_bits(buf,
+ sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
+ if (pps->pic_order_present_flag && !slc->field_pic_flag)
+ slc->delta_pic_order_cnt_bottom = read_exp_golomb_s(buf);
+ }
+
+ if (sps->pic_order_cnt_type == 1 && !sps->delta_pic_order_always_zero_flag) {
+ slc->delta_pic_order_cnt[0] = read_exp_golomb_s(buf);
+ if (pps->pic_order_present_flag && !slc->field_pic_flag)
+ slc->delta_pic_order_cnt[1] = read_exp_golomb_s(buf);
+ }
+
+ if (pps->redundant_pic_cnt_present_flag == 1) {
+ slc->redundant_pic_cnt = read_exp_golomb(buf);
+ }
+
+ if (slc->slice_type == SLICE_B)
+ slc->direct_spatial_mv_pred_flag = read_bits(buf, 1);
+
+ /* take default values in case they are not set here */
+ slc->num_ref_idx_l0_active_minus1 = pps->num_ref_idx_l0_active_minus1;
+ slc->num_ref_idx_l1_active_minus1 = pps->num_ref_idx_l1_active_minus1;
+
+ if (slc->slice_type == SLICE_P || slc->slice_type == SLICE_SP
+ || slc->slice_type == SLICE_B) {
+ slc->num_ref_idx_active_override_flag = read_bits(buf, 1);
+
+ if (slc->num_ref_idx_active_override_flag == 1) {
+ slc->num_ref_idx_l0_active_minus1 = read_exp_golomb(buf);
+
+ if (slc->slice_type == SLICE_B) {
+ slc->num_ref_idx_l1_active_minus1 = read_exp_golomb(buf);
+ }
+ }
+ }
+
+ /* --- ref_pic_list_reordering --- */
+ parse_ref_pic_list_reordering(buf, slc);
+
+ /* --- pred_weight_table --- */
+ if ((pps->weighted_pred_flag && (slc->slice_type == SLICE_P
+ || slc->slice_type == SLICE_SP)) || (pps->weighted_bipred_idc == 1
+ && slc->slice_type == SLICE_B)) {
+ parse_pred_weight_table(buf, slc, parser);
+ }
+
+ /* --- dec_ref_pic_marking --- */
+ if (slc_nal->nal_ref_idc != 0)
+ parse_dec_ref_pic_marking(buf, slc_nal);
+ else
+ slc->dec_ref_pic_marking_count = 0;
+
+ return 0;
+}
+
+void interpret_slice_header(struct h264_parser *parser, struct nal_unit *slc_nal)
+{
+ struct coded_picture *pic = parser->pic;
+ struct slice_header *slc = &slc_nal->slc;
+
+ /* retrieve sps and pps from the buffers */
+ struct nal_unit *pps_nal =
+ nal_buffer_get_by_pps_id(parser->pps_buffer, slc->pic_parameter_set_id);
+
+ if (pps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: interpret_slice_header: pic_parameter_set_id %d not found in buffers\n",
+ slc->pic_parameter_set_id);
+ return;
+ }
+
+ struct nal_unit *sps_nal =
+ nal_buffer_get_by_sps_id(parser->sps_buffer, pps_nal->pps.seq_parameter_set_id);
+
+ if (sps_nal == NULL) {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "ERR: interpret_slice_header: seq_parameter_set_id %d not found in buffers\n",
+ pps_nal->pps.seq_parameter_set_id);
+ return;
+ }
+
+ if (pic->sps_nal) {
+ release_nal_unit(pic->sps_nal);
+ }
+ if (pic->pps_nal) {
+ release_nal_unit(pic->pps_nal);
+ }
+ lock_nal_unit(sps_nal);
+ pic->sps_nal = sps_nal;
+ lock_nal_unit(pps_nal);
+ pic->pps_nal = pps_nal;
+}
+
+void parse_ref_pic_list_reordering(struct buf_reader *buf, struct slice_header *slc)
+{
+ if (slc->slice_type != SLICE_I && slc->slice_type != SLICE_SI) {
+ slc->ref_pic_list_reordering.ref_pic_list_reordering_flag_l0 = read_bits(
+ buf, 1);
+
+ if (slc->ref_pic_list_reordering.ref_pic_list_reordering_flag_l0 == 1) {
+ do {
+ slc->ref_pic_list_reordering.reordering_of_pic_nums_idc
+ = read_exp_golomb(buf);
+
+ if (slc->ref_pic_list_reordering.reordering_of_pic_nums_idc == 0
+ || slc->ref_pic_list_reordering.reordering_of_pic_nums_idc == 1) {
+ slc->ref_pic_list_reordering.abs_diff_pic_num_minus1
+ = read_exp_golomb(buf);
+ }
+ else if (slc->ref_pic_list_reordering.reordering_of_pic_nums_idc == 2) {
+ slc->ref_pic_list_reordering.long_term_pic_num = read_exp_golomb(buf);
+ }
+ } while (slc->ref_pic_list_reordering.reordering_of_pic_nums_idc != 3);
+ }
+ }
+
+ if (slc->slice_type == SLICE_B) {
+ slc->ref_pic_list_reordering.ref_pic_list_reordering_flag_l1 = read_bits(
+ buf, 1);
+
+ if (slc->ref_pic_list_reordering.ref_pic_list_reordering_flag_l1 == 1) {
+ do {
+ slc->ref_pic_list_reordering.reordering_of_pic_nums_idc
+ = read_exp_golomb(buf);
+
+ if (slc->ref_pic_list_reordering.reordering_of_pic_nums_idc == 0
+ || slc->ref_pic_list_reordering.reordering_of_pic_nums_idc == 1) {
+ slc->ref_pic_list_reordering.abs_diff_pic_num_minus1
+ = read_exp_golomb(buf);
+ }
+ else if (slc->ref_pic_list_reordering.reordering_of_pic_nums_idc == 2) {
+ slc->ref_pic_list_reordering.long_term_pic_num = read_exp_golomb(buf);
+ }
+ } while (slc->ref_pic_list_reordering.reordering_of_pic_nums_idc != 3);
+ }
+ }
+}
+
+void parse_pred_weight_table(struct buf_reader *buf, struct slice_header *slc,
+ struct h264_parser *parser)
+{
+ /* retrieve sps and pps from the buffers */
+ struct pic_parameter_set_rbsp *pps =
+ &nal_buffer_get_by_pps_id(parser->pps_buffer, slc->pic_parameter_set_id)
+ ->pps;
+
+ struct seq_parameter_set_rbsp *sps =
+ &nal_buffer_get_by_sps_id(parser->sps_buffer, pps->seq_parameter_set_id)
+ ->sps;
+
+ slc->pred_weight_table.luma_log2_weight_denom = read_exp_golomb(buf);
+
+ uint32_t ChromaArrayType = sps->chroma_format_idc;
+ if(sps->separate_colour_plane_flag)
+ ChromaArrayType = 0;
+
+ if (ChromaArrayType != 0)
+ slc->pred_weight_table.chroma_log2_weight_denom = read_exp_golomb(buf);
+
+ int i;
+ for (i = 0; i <= slc->num_ref_idx_l0_active_minus1; i++) {
+ uint8_t luma_weight_l0_flag = read_bits(buf, 1);
+
+ if (luma_weight_l0_flag == 1) {
+ slc->pred_weight_table.luma_weight_l0[i] = read_exp_golomb_s(buf);
+ slc->pred_weight_table.luma_offset_l0[i] = read_exp_golomb_s(buf);
+ }
+
+ if (ChromaArrayType != 0) {
+ uint8_t chroma_weight_l0_flag = read_bits(buf, 1);
+
+ if (chroma_weight_l0_flag == 1) {
+ int j;
+ for (j = 0; j < 2; j++) {
+ slc->pred_weight_table.chroma_weight_l0[i][j]
+ = read_exp_golomb_s(buf);
+ slc->pred_weight_table.chroma_offset_l0[i][j]
+ = read_exp_golomb_s(buf);
+ }
+ }
+ }
+ }
+
+ if ((slc->slice_type % 5) == SLICE_B) {
+ /* FIXME: Being spec-compliant here and loop to num_ref_idx_l0_active_minus1
+ * will break Divx7 files. Keep this in mind if any other streams are broken
+ */
+ for (i = 0; i <= slc->num_ref_idx_l1_active_minus1; i++) {
+ uint8_t luma_weight_l1_flag = read_bits(buf, 1);
+
+ if (luma_weight_l1_flag == 1) {
+ slc->pred_weight_table.luma_weight_l1[i] = read_exp_golomb_s(buf);
+ slc->pred_weight_table.luma_offset_l1[i] = read_exp_golomb_s(buf);
+ }
+
+ if (ChromaArrayType != 0) {
+ uint8_t chroma_weight_l1_flag = read_bits(buf, 1);
+
+ if (chroma_weight_l1_flag == 1) {
+ int j;
+ for (j = 0; j < 2; j++) {
+ slc->pred_weight_table.chroma_weight_l1[i][j]
+ = read_exp_golomb_s(buf);
+ slc->pred_weight_table.chroma_offset_l1[i][j]
+ = read_exp_golomb_s(buf);
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ * PicNum calculation following ITU-T H264 11/2007
+ * 8.2.4.1 p112f
+ */
+void calculate_pic_nums(struct h264_parser *parser, struct coded_picture *cpic)
+{
+ struct decoded_picture *pic = NULL;
+ struct slice_header *cslc = &cpic->slc_nal->slc;
+
+ xine_list_iterator_t ite = xine_list_front(parser->dpb->reference_list);
+ while (ite) {
+ pic = xine_list_get_value(parser->dpb->reference_list, ite);
+
+ int i;
+ for (i=0; i<2; i++) {
+ if(pic->coded_pic[i] == NULL)
+ continue;
+
+ struct slice_header *slc = &pic->coded_pic[i]->slc_nal->slc;
+ struct seq_parameter_set_rbsp *sps = &pic->coded_pic[i]->sps_nal->sps;
+
+ if (!pic->coded_pic[i]->used_for_long_term_ref) {
+ int32_t frame_num_wrap = 0;
+ if (slc->frame_num > cslc->frame_num)
+ frame_num_wrap = slc->frame_num - sps->max_frame_num;
+ else
+ frame_num_wrap = slc->frame_num;
+
+ if(i == 0) {
+ pic->frame_num_wrap = frame_num_wrap;
+ }
+
+ if (cslc->field_pic_flag == 0) {
+ pic->coded_pic[i]->pic_num = frame_num_wrap;
+ } else {
+ pic->coded_pic[i]->pic_num = 2 * frame_num_wrap;
+ if((slc->field_pic_flag == 1 &&
+ cslc->bottom_field_flag == slc->bottom_field_flag) ||
+ (slc->field_pic_flag == 0 && !cslc->bottom_field_flag))
+ pic->coded_pic[i]->pic_num++;
+ }
+ } else {
+ pic->coded_pic[i]->long_term_pic_num = pic->coded_pic[i]->long_term_frame_idx;
+ if(slc->bottom_field_flag == cslc->bottom_field_flag)
+ pic->coded_pic[i]->long_term_pic_num++;
+ }
+ }
+
+ ite = xine_list_next(parser->dpb->reference_list, ite);
+ }
+}
+
+void execute_ref_pic_marking(struct coded_picture *cpic,
+ uint32_t memory_management_control_operation,
+ uint32_t marking_nr,
+ struct h264_parser *parser)
+{
+ /**
+ * according to NOTE 6, p83 the dec_ref_pic_marking
+ * structure is identical for all slice headers within
+ * a coded picture, so we can simply use the last
+ * slice_header we saw in the pic
+ */
+ if (!cpic->slc_nal)
+ return;
+ struct slice_header *slc = &cpic->slc_nal->slc;
+ struct dpb *dpb = parser->dpb;
+
+ calculate_pic_nums(parser, cpic);
+
+ if (cpic->flag_mask & IDR_PIC) {
+ if(slc->dec_ref_pic_marking[marking_nr].long_term_reference_flag) {
+ cpic->used_for_long_term_ref = 1;
+ dpb_set_unused_ref_picture_lidx_gt(dpb, 0);
+ } else {
+ dpb_set_unused_ref_picture_lidx_gt(dpb, -1);
+ }
+ return;
+ }
+
+ /* MMC operation == 1 : 8.2.5.4.1, p. 120 */
+ if (memory_management_control_operation == 1) {
+ // short-term -> unused for reference
+ int32_t pic_num_x = (parser->curr_pic_num
+ - (slc->dec_ref_pic_marking[marking_nr].difference_of_pic_nums_minus1 + 1));
+ //% cpic->max_pic_num;
+ struct decoded_picture* pic = NULL;
+ if ((pic = dpb_get_picture(dpb, pic_num_x)) != NULL) {
+ if (cpic->slc_nal->slc.field_pic_flag == 0) {
+ dpb_unmark_reference_picture(dpb, pic);
+ } else {
+
+ if (pic->coded_pic[0]->slc_nal->slc.field_pic_flag == 1) {
+ if (pic->top_is_reference)
+ pic->top_is_reference = 0;
+ else if (pic->bottom_is_reference)
+ pic->bottom_is_reference = 0;
+
+ if(!pic->top_is_reference && !pic->bottom_is_reference)
+ dpb_unmark_reference_picture(dpb, pic);
+ } else {
+ pic->top_is_reference = pic->bottom_is_reference = 0;
+ dpb_unmark_reference_picture(dpb, pic);
+ }
+ }
+ } else {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "H264: mmc 1 failed: %d not existent - curr_pic: %d\n",
+ pic_num_x, parser->curr_pic_num);
+ }
+ } else if (memory_management_control_operation == 2) {
+ // long-term -> unused for reference
+ struct decoded_picture* pic = dpb_get_picture_by_ltpn(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_pic_num);
+ if (pic != NULL) {
+ if (cpic->slc_nal->slc.field_pic_flag == 0)
+ dpb_set_unused_ref_picture_byltpn(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_pic_num);
+ else {
+
+ if (pic->coded_pic[0]->slc_nal->slc.field_pic_flag == 1) {
+ if (pic->top_is_reference)
+ pic->top_is_reference = 0;
+ else if (pic->bottom_is_reference)
+ pic->bottom_is_reference = 0;
+
+ if(!pic->top_is_reference && !pic->bottom_is_reference) {
+ dpb_set_unused_ref_picture_byltpn(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_pic_num);
+ }
+ } else {
+ pic->top_is_reference = pic->bottom_is_reference = 0;
+ dpb_set_unused_ref_picture_byltpn(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_pic_num);
+ }
+ }
+ }
+ } else if (memory_management_control_operation == 3) {
+ // short-term -> long-term, set long-term frame index
+ uint32_t pic_num_x = parser->curr_pic_num
+ - (slc->dec_ref_pic_marking[marking_nr].difference_of_pic_nums_minus1 + 1);
+ struct decoded_picture* pic = dpb_get_picture_by_ltidx(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_pic_num);
+ if (pic != NULL)
+ dpb_set_unused_ref_picture_bylidx(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx);
+
+ pic = dpb_get_picture(dpb, pic_num_x);
+ if (pic) {
+ pic = dpb_get_picture(dpb, pic_num_x);
+
+ if (pic->coded_pic[0]->slc_nal->slc.field_pic_flag == 0) {
+ pic->coded_pic[0]->long_term_frame_idx
+ = slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx;
+ pic->coded_pic[0]->long_term_pic_num = pic->coded_pic[0]->long_term_frame_idx;
+ }
+ else {
+ if(pic->coded_pic[0]->pic_num == pic_num_x) {
+ pic->coded_pic[0]->long_term_frame_idx
+ = slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx;
+ pic->coded_pic[0]->long_term_pic_num = pic->coded_pic[0]->long_term_frame_idx * 2 + 1;
+ } else if(pic->coded_pic[1] != NULL &&
+ pic->coded_pic[1]->pic_num == pic_num_x) {
+ pic->coded_pic[1]->long_term_frame_idx
+ = slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx;
+ pic->coded_pic[1]->long_term_pic_num = pic->coded_pic[1]->long_term_frame_idx * 2 + 1;
+ }
+ }
+ }
+ else {
+ xprintf(parser->xine, XINE_VERBOSITY_DEBUG,
+ "memory_management_control_operation: 3 failed. No such picture.\n");
+ }
+
+ } else if (memory_management_control_operation == 4) {
+ /* set max-long-term frame index,
+ * mark all long-term pictures with long-term frame idx
+ * greater max-long-term farme idx as unused for ref */
+ if (slc->dec_ref_pic_marking[marking_nr].max_long_term_frame_idx_plus1 == 0)
+ dpb_set_unused_ref_picture_lidx_gt(dpb, 0);
+ else
+ dpb_set_unused_ref_picture_lidx_gt(dpb,
+ slc->dec_ref_pic_marking[marking_nr].max_long_term_frame_idx_plus1 - 1);
+ } else if (memory_management_control_operation == 5) {
+ /* mark all ref pics as unused for reference,
+ * set max-long-term frame index = no long-term frame idxs */
+ dpb_flush(dpb);
+
+ if (!slc->bottom_field_flag) {
+ parser->prev_pic_order_cnt_lsb = cpic->top_field_order_cnt;
+ parser->prev_pic_order_cnt_msb = 0;
+ } else {
+ parser->prev_pic_order_cnt_lsb = 0;
+ parser->prev_pic_order_cnt_msb = 0;
+ }
+ } else if (memory_management_control_operation == 6) {
+ /* mark current picture as used for long-term ref,
+ * assing long-term frame idx to it */
+ struct decoded_picture* pic = dpb_get_picture_by_ltidx(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx);
+ if (pic != NULL)
+ dpb_set_unused_ref_picture_bylidx(dpb,
+ slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx);
+
+ cpic->long_term_frame_idx = slc->dec_ref_pic_marking[marking_nr].long_term_frame_idx;
+ cpic->used_for_long_term_ref = 1;
+
+ if (slc->field_pic_flag == 0) {
+ cpic->long_term_pic_num = cpic->long_term_frame_idx;
+ }
+ else {
+ cpic->long_term_pic_num = cpic->long_term_frame_idx * 2 + 1;
+ }
+
+ }
+}
+
+void parse_dec_ref_pic_marking(struct buf_reader *buf,
+ struct nal_unit *slc_nal)
+{
+ struct slice_header *slc = &slc_nal->slc;
+
+ if (!slc)
+ return;
+
+ slc->dec_ref_pic_marking_count = 0;
+ int i = slc->dec_ref_pic_marking_count;
+
+ if (slc_nal->nal_unit_type == NAL_SLICE_IDR) {
+ slc->dec_ref_pic_marking[i].no_output_of_prior_pics_flag = read_bits(buf, 1);
+ slc->dec_ref_pic_marking[i].long_term_reference_flag = read_bits(buf, 1);
+ i+=2;
+ } else {
+ slc->dec_ref_pic_marking[i].adaptive_ref_pic_marking_mode_flag = read_bits(
+ buf, 1);
+
+ if (slc->dec_ref_pic_marking[i].adaptive_ref_pic_marking_mode_flag) {
+ do {
+ slc->dec_ref_pic_marking[i].memory_management_control_operation
+ = read_exp_golomb(buf);
+
+ if (slc->dec_ref_pic_marking[i].memory_management_control_operation == 1
+ || slc->dec_ref_pic_marking[i].memory_management_control_operation
+ == 3)
+ slc->dec_ref_pic_marking[i].difference_of_pic_nums_minus1
+ = read_exp_golomb(buf);
+
+ if (slc->dec_ref_pic_marking[i].memory_management_control_operation == 2)
+ slc->dec_ref_pic_marking[i].long_term_pic_num = read_exp_golomb(buf);
+
+ if (slc->dec_ref_pic_marking[i].memory_management_control_operation == 3
+ || slc->dec_ref_pic_marking[i].memory_management_control_operation
+ == 6)
+ slc->dec_ref_pic_marking[i].long_term_frame_idx = read_exp_golomb(buf);
+
+ if (slc->dec_ref_pic_marking[i].memory_management_control_operation == 4)
+ slc->dec_ref_pic_marking[i].max_long_term_frame_idx_plus1
+ = read_exp_golomb(buf);
+
+ i++;
+ if(i >= 10) {
+ lprintf("Error: Not more than 10 MMC operations supported per slice. Dropping some.\n");
+ i = 0;
+ }
+ } while (slc->dec_ref_pic_marking[i-1].memory_management_control_operation
+ != 0);
+ }
+ }
+
+ slc->dec_ref_pic_marking_count = (i>0) ? (i-1) : 0;
+}
+
+/* ----------------- NAL parser ----------------- */
+
+struct h264_parser* init_parser(xine_t *xine)
+{
+ struct h264_parser *parser = calloc(1, sizeof(struct h264_parser));
+ parser->pic = create_coded_picture();
+ parser->position = NON_VCL;
+ parser->last_vcl_nal = NULL;
+ parser->sps_buffer = create_nal_buffer(32);
+ parser->pps_buffer = create_nal_buffer(32);
+ parser->xine = xine;
+ parser->dpb = create_dpb();
+
+ return parser;
+}
+
+void reset_parser(struct h264_parser *parser)
+{
+ parser->position = NON_VCL;
+ parser->buf_len = parser->prebuf_len = 0;
+ parser->next_nal_position = 0;
+ parser->last_nal_res = 0;
+
+ if(parser->last_vcl_nal) {
+ release_nal_unit(parser->last_vcl_nal);
+ }
+ parser->last_vcl_nal = NULL;
+
+ parser->prev_pic_order_cnt_msb = 0;
+ parser->prev_pic_order_cnt_lsb = 0;
+ parser->frame_num_offset = 0;
+ parser->prev_top_field_order_cnt = 0;
+ parser->curr_pic_num = 0;
+ parser->flag_mask = 0;
+
+ if(parser->pic != NULL) {
+ free_coded_picture(parser->pic);
+ parser->pic = create_coded_picture();
+ }
+}
+
+void free_parser(struct h264_parser *parser)
+{
+ dpb_free_all(parser->dpb);
+ release_dpb(parser->dpb);
+ free_nal_buffer(parser->pps_buffer);
+ free_nal_buffer(parser->sps_buffer);
+ free(parser);
+}
+
+void parse_codec_private(struct h264_parser *parser, uint8_t *inbuf, int inbuf_len)
+{
+ struct buf_reader bufr;
+
+ bufr.buf = inbuf;
+ bufr.cur_pos = inbuf;
+ bufr.cur_offset = 8;
+ bufr.len = inbuf_len;
+
+ // FIXME: Might be broken!
+ struct nal_unit *nal = calloc(1, sizeof(struct nal_unit));
+
+
+ /* reserved */
+ read_bits(&bufr, 8);
+ nal->sps.profile_idc = read_bits(&bufr, 8);
+ read_bits(&bufr, 8);
+ nal->sps.level_idc = read_bits(&bufr, 8);
+ read_bits(&bufr, 6);
+
+ parser->nal_size_length = read_bits(&bufr, 2) + 1;
+ parser->nal_size_length_buf = calloc(1, parser->nal_size_length);
+ read_bits(&bufr, 3);
+ uint8_t sps_count = read_bits(&bufr, 5);
+
+ inbuf += 6;
+ inbuf_len -= 6;
+ int i;
+
+ struct coded_picture *dummy = NULL;
+ for(i = 0; i < sps_count; i++) {
+ uint16_t sps_size = read_bits(&bufr, 16);
+ inbuf += 2;
+ inbuf_len -= 2;
+ parse_nal(inbuf, sps_size, parser, &dummy);
+ inbuf += sps_size;
+ inbuf_len -= sps_size;
+ }
+
+ bufr.buf = inbuf;
+ bufr.cur_pos = inbuf;
+ bufr.cur_offset = 8;
+ bufr.len = inbuf_len;
+
+ uint8_t pps_count = read_bits(&bufr, 8);
+ inbuf += 1;
+ for(i = 0; i < pps_count; i++) {
+ uint16_t pps_size = read_bits(&bufr, 16);
+ inbuf += 2;
+ inbuf_len -= 2;
+ parse_nal(inbuf, pps_size, parser, &dummy);
+ inbuf += pps_size;
+ inbuf_len -= pps_size;
+ }
+
+ nal_buffer_append(parser->sps_buffer, nal);
+}
+
+void process_mmc_operations(struct h264_parser *parser, struct coded_picture *picture)
+{
+ if (picture->flag_mask & REFERENCE) {
+ parser->prev_pic_order_cnt_lsb
+ = picture->slc_nal->slc.pic_order_cnt_lsb;
+ }
+
+ int i;
+ for(i = 0; i < picture->slc_nal->slc.
+ dec_ref_pic_marking_count; i++) {
+ execute_ref_pic_marking(
+ picture,
+ picture->slc_nal->slc.dec_ref_pic_marking[i].
+ memory_management_control_operation,
+ i,
+ parser);
+ }
+}
+
+int parse_frame(struct h264_parser *parser, uint8_t *inbuf, int inbuf_len,
+ int64_t pts,
+ uint8_t **ret_buf, uint32_t *ret_len, struct coded_picture **ret_pic)
+{
+ int32_t next_nal = 0;
+ int32_t offset = 0;
+ int start_seq_len = 3;
+
+ *ret_pic = NULL;
+ *ret_buf = NULL;
+ *ret_len = 0;
+
+ if(parser->nal_size_length > 0)
+ start_seq_len = offset = parser->nal_size_length;
+
+ if (parser->prebuf_len + inbuf_len > MAX_FRAME_SIZE) {
+ xprintf(parser->xine, XINE_VERBOSITY_LOG,"h264_parser: prebuf underrun\n");
+ *ret_len = 0;
+ *ret_buf = NULL;
+ parser->prebuf_len = 0;
+ return inbuf_len;
+ }
+
+ /* copy the whole inbuf to the prebuf,
+ * then search for a nal-start sequence in the prebuf,
+ * if it's in there, parse the nal and append to parser->buf
+ * or return a frame */
+
+ xine_fast_memcpy(parser->prebuf + parser->prebuf_len, inbuf, inbuf_len);
+ parser->prebuf_len += inbuf_len;
+
+ while((next_nal = seek_for_nal(parser->prebuf+start_seq_len-offset, parser->prebuf_len-start_seq_len+offset, parser)) > 0) {
+
+ struct coded_picture *completed_pic = NULL;
+
+ if(!parser->nal_size_length &&
+ (parser->prebuf[0] != 0x00 || parser->prebuf[1] != 0x00 ||
+ parser->prebuf[2] != 0x01)) {
+ xprintf(parser->xine, XINE_VERBOSITY_LOG, "Broken NAL, skip it.\n");
+ parser->last_nal_res = 2;
+ } else {
+ parser->last_nal_res = parse_nal(parser->prebuf+start_seq_len,
+ next_nal, parser, &completed_pic);
+ }
+
+ if (completed_pic != NULL &&
+ completed_pic->slice_cnt > 0 &&
+ parser->buf_len > 0) {
+
+ //lprintf("Frame complete: %d bytes\n", parser->buf_len);
+ *ret_len = parser->buf_len;
+ *ret_buf = malloc(parser->buf_len);
+ xine_fast_memcpy(*ret_buf, parser->buf, parser->buf_len);
+
+ *ret_pic = completed_pic;
+
+ parser->buf_len = 0;
+
+ if (pts != 0 && (parser->pic->pts == 0 || parser->pic->pts != pts)) {
+ parser->pic->pts = pts;
+ }
+
+ /**
+ * if the new coded picture started with a VCL nal
+ * we have to copy this to buffer for the next picture
+ * now.
+ */
+ if(parser->last_nal_res == 1) {
+ if(parser->nal_size_length > 0) {
+ static const uint8_t start_seq[3] = { 0x00, 0x00, 0x01 };
+ xine_fast_memcpy(parser->buf, start_seq, 3);
+ parser->buf_len += 3;
+ }
+
+ xine_fast_memcpy(parser->buf+parser->buf_len, parser->prebuf+offset, next_nal+start_seq_len-2*offset);
+ parser->buf_len += next_nal+start_seq_len-2*offset;
+ }
+
+ memmove(parser->prebuf, parser->prebuf+(next_nal+start_seq_len-offset), parser->prebuf_len-(next_nal+start_seq_len-offset));
+ parser->prebuf_len -= next_nal+start_seq_len-offset;
+
+ return inbuf_len;
+ }
+
+ /* got a new nal, which is part of the current
+ * coded picture. add it to buf
+ */
+ if (parser->last_nal_res < 2) {
+ if (parser->buf_len + next_nal+start_seq_len-offset > MAX_FRAME_SIZE) {
+ xprintf(parser->xine, XINE_VERBOSITY_LOG, "h264_parser: buf underrun!\n");
+ parser->buf_len = 0;
+ *ret_len = 0;
+ *ret_buf = NULL;
+ return inbuf_len;
+ }
+
+ if(parser->nal_size_length > 0) {
+ static const uint8_t start_seq[3] = { 0x00, 0x00, 0x01 };
+ xine_fast_memcpy(parser->buf+parser->buf_len, start_seq, 3);
+ parser->buf_len += 3;
+ }
+
+ xine_fast_memcpy(parser->buf+parser->buf_len, parser->prebuf+offset, next_nal+start_seq_len-2*offset);
+ parser->buf_len += next_nal+start_seq_len-2*offset;
+
+ memmove(parser->prebuf, parser->prebuf+(next_nal+start_seq_len-offset), parser->prebuf_len-(next_nal+start_seq_len-offset));
+ parser->prebuf_len -= next_nal+start_seq_len-offset;
+ } else {
+ /* got a non-relevant nal, just remove it */
+ memmove(parser->prebuf, parser->prebuf+(next_nal+start_seq_len-offset), parser->prebuf_len-(next_nal+start_seq_len-offset));
+ parser->prebuf_len -= next_nal+start_seq_len-offset;
+ }
+ }
+
+ if (pts != 0 && (parser->pic->pts == 0 || parser->pic->pts != pts)) {
+ parser->pic->pts = pts;
+ }
+
+ *ret_buf = NULL;
+ *ret_len = 0;
+ return inbuf_len;
+}
+
+
+/**
+ * @return 0: NAL is part of coded picture
+ * 2: NAL is not part of coded picture
+ * 1: NAL is the beginning of a new coded picture
+ * 3: NAL is marked as END_OF_SEQUENCE
+ */
+int parse_nal(uint8_t *buf, int buf_len, struct h264_parser *parser,
+ struct coded_picture **completed_picture)
+{
+ int ret = 0;
+
+ struct buf_reader bufr;
+
+ bufr.buf = buf;
+ bufr.cur_pos = buf;
+ bufr.cur_offset = 8;
+ bufr.len = buf_len;
+
+ *completed_picture = NULL;
+
+ struct nal_unit *nal = parse_nal_header(&bufr, parser->pic, parser);
+
+ /**
+ * we detect the start of a new access unit if
+ * a non-vcl nal unit is received after a vcl
+ * nal unit
+ * NAL_END_OF_SEQUENCE terminates the current
+ * access unit
+ */
+ if (nal->nal_unit_type >= NAL_SLICE &&
+ nal->nal_unit_type <= NAL_SLICE_IDR) {
+ parser->position = VCL;
+ } else if ((parser->position == VCL &&
+ nal->nal_unit_type >= NAL_SEI &&
+ nal->nal_unit_type <= NAL_PPS) ||
+ nal->nal_unit_type == NAL_AU_DELIMITER ||
+ nal->nal_unit_type == NAL_END_OF_SEQUENCE) {
+ /* start of a new access unit! */
+ *completed_picture = parser->pic;
+ parser->pic = create_coded_picture();
+
+ if(parser->last_vcl_nal != NULL) {
+ release_nal_unit(parser->last_vcl_nal);
+ parser->last_vcl_nal = NULL;
+ }
+ parser->position = NON_VCL;
+ } else {
+ parser->position = NON_VCL;
+ }
+
+ switch(nal->nal_unit_type) {
+ case NAL_SPS:
+ nal_buffer_append(parser->sps_buffer, nal);
+ break;
+ case NAL_PPS:
+ nal_buffer_append(parser->pps_buffer, nal);
+ break;
+ case NAL_SEI: {
+ if (parser->pic != NULL) {
+ if(parser->pic->sei_nal) {
+ release_nal_unit(parser->pic->sei_nal);
+ }
+ lock_nal_unit(nal);
+ parser->pic->sei_nal = nal;
+ interpret_sei(parser->pic);
+ }
+ }
+ default:
+ break;
+ }
+
+ /**
+ * in case of an access unit which does not contain any
+ * non-vcl nal units we have to detect the new access
+ * unit through the algorithm for detecting first vcl nal
+ * units of a primary coded picture
+ */
+ if (parser->position == VCL && parser->last_vcl_nal != NULL &&
+ nal->nal_unit_type >= NAL_SLICE && nal->nal_unit_type <= NAL_SLICE_IDR) {
+ /**
+ * frame boundary detection according to
+ * ITU-T Rec. H264 (11/2007) chapt 7.4.1.2.4, p65
+ */
+ struct nal_unit* last_nal = parser->last_vcl_nal;
+
+ if (nal == NULL || last_nal == NULL) {
+ ret = 1;
+ } else if (nal->slc.frame_num != last_nal->slc.frame_num) {
+ ret = 1;
+ } else if (nal->slc.pic_parameter_set_id
+ != last_nal->slc.pic_parameter_set_id) {
+ ret = 1;
+ } else if (nal->slc.field_pic_flag
+ != last_nal->slc.field_pic_flag) {
+ ret = 1;
+ } else if (nal->slc.bottom_field_flag
+ != last_nal->slc.bottom_field_flag) {
+ ret = 1;
+ } else if (nal->nal_ref_idc != last_nal->nal_ref_idc &&
+ (nal->nal_ref_idc == 0 || last_nal->nal_ref_idc == 0)) {
+ ret = 1;
+ } else if (nal->sps.pic_order_cnt_type == 0
+ && last_nal->sps.pic_order_cnt_type == 0
+ && (nal->slc.pic_order_cnt_lsb != last_nal->slc.pic_order_cnt_lsb
+ || nal->slc.delta_pic_order_cnt_bottom
+ != last_nal->slc.delta_pic_order_cnt_bottom)) {
+ ret = 1;
+ } else if (nal->sps.pic_order_cnt_type == 1
+ && last_nal->sps.pic_order_cnt_type == 1
+ && (nal->slc.delta_pic_order_cnt[0]
+ != last_nal->slc.delta_pic_order_cnt[0]
+ || nal->slc.delta_pic_order_cnt[1]
+ != last_nal->slc.delta_pic_order_cnt[1])) {
+ ret = 1;
+ } else if (nal->nal_unit_type != last_nal->nal_unit_type && (nal->nal_unit_type
+ == NAL_SLICE_IDR || last_nal->nal_unit_type == NAL_SLICE_IDR)) {
+ ret = 1;
+ } else if (nal->nal_unit_type == NAL_SLICE_IDR
+ && last_nal->nal_unit_type == NAL_SLICE_IDR && nal->slc.idr_pic_id
+ != last_nal->slc.idr_pic_id) {
+ ret = 1;
+ }
+
+ /* increase the slice_cnt until a new frame is detected */
+ if (ret && *completed_picture == NULL) {
+ *completed_picture = parser->pic;
+ parser->pic = create_coded_picture();
+ }
+
+ } else if (nal->nal_unit_type == NAL_PPS || nal->nal_unit_type == NAL_SPS) {
+ ret = 2;
+ } else if (nal->nal_unit_type == NAL_AU_DELIMITER) {
+ ret = 2;
+ } else if (nal->nal_unit_type == NAL_END_OF_SEQUENCE) {
+ ret = 3;
+ } else if (nal->nal_unit_type >= NAL_SEI) {
+ ret = 2;
+ }
+
+ if (parser->pic) {
+
+ if (nal->nal_unit_type == NAL_SLICE_IDR) {
+ parser->pic->flag_mask |= IDR_PIC;
+ }
+
+ /* reference flag is only set for slice NALs,
+ * as PPS/SPS/SEI only references are not relevant
+ * for the vdpau decoder.
+ */
+ if (nal->nal_ref_idc &&
+ nal->nal_unit_type <= NAL_SLICE_IDR) {
+ parser->pic->flag_mask |= REFERENCE;
+ } else if (!nal->nal_ref_idc &&
+ nal->nal_unit_type >= NAL_SLICE &&
+ nal->nal_unit_type <= NAL_PART_C) {
+ /* remove reference flag if a picture is not
+ * continously flagged as reference. */
+ parser->pic->flag_mask &= ~REFERENCE;
+ }
+
+ if (nal->nal_unit_type >= NAL_SLICE &&
+ nal->nal_unit_type <= NAL_SLICE_IDR) {
+ lock_nal_unit(nal);
+ if(parser->last_vcl_nal) {
+ release_nal_unit(parser->last_vcl_nal);
+ }
+ parser->last_vcl_nal = nal;
+
+ parser->pic->slice_cnt++;
+ if(parser->pic->slc_nal) {
+ release_nal_unit(parser->pic->slc_nal);
+ }
+ lock_nal_unit(nal);
+ parser->pic->slc_nal = nal;
+
+ interpret_slice_header(parser, nal);
+ }
+
+ if (*completed_picture != NULL &&
+ (*completed_picture)->slice_cnt > 0) {
+ calculate_pic_order(parser, *completed_picture,
+ &((*completed_picture)->slc_nal->slc));
+ interpret_sps(*completed_picture, parser);
+ interpret_pps(*completed_picture);
+ }
+ }
+
+ release_nal_unit(nal);
+ return ret;
+}
+
+int seek_for_nal(uint8_t *buf, int buf_len, struct h264_parser *parser)
+{
+ if(buf_len <= 0)
+ return -1;
+
+ if(parser->nal_size_length > 0) {
+ if(buf_len < parser->nal_size_length) {
+ return -1;
+ }
+
+ uint32_t next_nal = parser->next_nal_position;
+ if(!next_nal) {
+ struct buf_reader bufr;
+
+ bufr.buf = buf;
+ bufr.cur_pos = buf;
+ bufr.cur_offset = 8;
+ bufr.len = buf_len;
+
+ next_nal = read_bits(&bufr, parser->nal_size_length*8)+parser->nal_size_length;
+ }
+
+ if(next_nal > buf_len) {
+ parser->next_nal_position = next_nal;
+ return -1;
+ } else
+ parser->next_nal_position = 0;
+
+ return next_nal;
+ }
+
+ /* NAL_END_OF_SEQUENCE has only 1 byte, so
+ * we do not need to search for the next start sequence */
+ if(buf[0] == NAL_END_OF_SEQUENCE)
+ return 1;
+
+ int i;
+ for (i = 0; i < buf_len - 2; i++) {
+ if (buf[i] == 0x00 && buf[i + 1] == 0x00 && buf[i + 2] == 0x01) {
+ //lprintf("found nal at: %d\n", i);
+ return i;
+ }
+ }
+
+ return -1;
+}
diff --git a/src/video_dec/libvdpau/h264_parser.h b/src/video_dec/libvdpau/h264_parser.h
new file mode 100644
index 000000000..49bc56bab
--- /dev/null
+++ b/src/video_dec/libvdpau/h264_parser.h
@@ -0,0 +1,110 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * 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, USA
+ *
+ * h264_parser.h: Almost full-features H264 NAL-Parser
+ */
+
+#ifndef NAL_PARSER_H_
+#define NAL_PARSER_H_
+
+#include <stdlib.h>
+
+#include <xine/xine_internal.h>
+#include "nal.h"
+#include "dpb.h"
+
+#define MAX_FRAME_SIZE 1024*1024
+
+/* specifies wether the parser last parsed
+ * non-vcl or vcl nal units. depending on
+ * this the access unit boundaries are detected
+ */
+enum parser_position {
+ NON_VCL,
+ VCL
+};
+
+enum parser_flags {
+ CPB_DPB_DELAYS_PRESENT = 0x01,
+ PIC_STRUCT_PRESENT = 0x02
+};
+
+struct h264_parser {
+ uint8_t buf[MAX_FRAME_SIZE];
+ uint32_t buf_len;
+
+ /* prebuf is used to store the currently
+ * processed nal unit */
+ uint8_t prebuf[MAX_FRAME_SIZE];
+ uint32_t prebuf_len;
+ uint32_t next_nal_position;
+
+ uint8_t last_nal_res;
+
+ uint8_t nal_size_length;
+ uint32_t next_nal_size;
+ uint8_t *nal_size_length_buf;
+ uint8_t have_nal_size_length_buf;
+
+ enum parser_position position;
+
+ struct coded_picture *pic;
+
+ struct nal_unit *last_vcl_nal;
+ struct nal_buffer *sps_buffer;
+ struct nal_buffer *pps_buffer;
+
+ uint32_t prev_pic_order_cnt_lsb;
+ uint32_t prev_pic_order_cnt_msb;
+ uint32_t frame_num_offset;
+
+ int32_t prev_top_field_order_cnt;
+
+ uint32_t curr_pic_num;
+
+ uint16_t flag_mask;
+
+ /* this is dpb used for reference frame
+ * heading to vdpau + unordered frames
+ */
+ struct dpb *dpb;
+
+ xine_t *xine;
+};
+
+int parse_nal(uint8_t *buf, int buf_len, struct h264_parser *parser,
+ struct coded_picture **completed_picture);
+
+int seek_for_nal(uint8_t *buf, int buf_len, struct h264_parser *parser);
+
+struct h264_parser* init_parser(xine_t *xine);
+void reset_parser(struct h264_parser *parser);
+void free_parser(struct h264_parser *parser);
+int parse_frame(struct h264_parser *parser, uint8_t *inbuf, int inbuf_len,
+ int64_t pts,
+ uint8_t **ret_buf, uint32_t *ret_len, struct coded_picture **ret_pic);
+
+/* this has to be called after decoding the frame delivered by parse_frame,
+ * but before adding a decoded frame to the dpb.
+ */
+void process_mmc_operations(struct h264_parser *parser, struct coded_picture *picture);
+
+void parse_codec_private(struct h264_parser *parser, uint8_t *inbuf, int inbuf_len);
+
+#endif
diff --git a/src/video_dec/libvdpau/nal.c b/src/video_dec/libvdpau/nal.c
new file mode 100644
index 000000000..c3693c5f2
--- /dev/null
+++ b/src/video_dec/libvdpau/nal.c
@@ -0,0 +1,213 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * 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, USA
+ *
+ * nal.c: nal-structure utility functions
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "nal.h"
+#include <xine/xine_internal.h>
+
+struct nal_buffer* create_nal_buffer(uint8_t max_size)
+{
+ struct nal_buffer *nal_buffer = calloc(1, sizeof(struct nal_buffer));
+ nal_buffer->max_size = max_size;
+
+ return nal_buffer;
+}
+
+/**
+ * destroys a nal buffer. all referenced nals are released
+ */
+void free_nal_buffer(struct nal_buffer *nal_buffer)
+{
+ struct nal_unit *nal = nal_buffer->first;
+
+ while (nal) {
+ struct nal_unit *delete = nal;
+ nal = nal->next;
+ release_nal_unit(delete);
+ }
+
+ free(nal_buffer);
+}
+
+/**
+ * appends a nal unit to the end of the buffer
+ */
+void nal_buffer_append(struct nal_buffer *nal_buffer, struct nal_unit *nal)
+{
+ if(nal_buffer->used == nal_buffer->max_size) {
+ nal_buffer_remove(nal_buffer, nal_buffer->first);
+ }
+
+ if (nal_buffer->first == NULL) {
+ nal_buffer->first = nal_buffer->last = nal;
+ nal->prev = nal->next = NULL;
+
+ lock_nal_unit(nal);
+ nal_buffer->used++;
+ } else if (nal_buffer->last != NULL) {
+ nal_buffer->last->next = nal;
+ nal->prev = nal_buffer->last;
+ nal_buffer->last = nal;
+
+ lock_nal_unit(nal);
+ nal_buffer->used++;
+ } else {
+ lprintf("ERR: nal_buffer is in a broken state\n");
+ }
+}
+
+void nal_buffer_remove(struct nal_buffer *nal_buffer, struct nal_unit *nal)
+{
+ if (nal == nal_buffer->first && nal == nal_buffer->last) {
+ nal_buffer->first = nal_buffer->last = NULL;
+ } else {
+ if (nal == nal_buffer->first) {
+ nal_buffer->first = nal->next;
+ nal_buffer->first->prev = NULL;
+ } else {
+ nal->prev->next = nal->next;
+ }
+
+ if (nal == nal_buffer->last) {
+ nal_buffer->last = nal->prev;
+ nal_buffer->last->next = NULL;
+ } else {
+ nal->next->prev = nal->prev;
+ }
+ }
+
+ nal->next = nal->prev = NULL;
+ release_nal_unit(nal);
+
+ nal_buffer->used--;
+}
+
+void nal_buffer_flush(struct nal_buffer *nal_buffer)
+{
+ while(nal_buffer->used > 0) {
+ nal_buffer_remove(nal_buffer, nal_buffer->first);
+ }
+}
+
+/**
+ * returns the last element in the buffer
+ */
+struct nal_unit *nal_buffer_get_last(struct nal_buffer *nal_buffer)
+{
+ return nal_buffer->last;
+}
+
+/**
+ * get a nal unit from a nal_buffer from it's
+ * seq parameter_set_id
+ */
+struct nal_unit* nal_buffer_get_by_sps_id(struct nal_buffer *nal_buffer,
+ uint32_t seq_parameter_set_id)
+{
+ struct nal_unit *nal = nal_buffer->last;
+
+ if (nal != NULL) {
+ do {
+ if(nal->nal_unit_type == NAL_SPS) {
+ if(nal->sps.seq_parameter_set_id == seq_parameter_set_id) {
+ return nal;
+ }
+ }
+
+ nal = nal->prev;
+ } while(nal != NULL);
+ }
+
+ return NULL;
+}
+
+/**
+ * get a nal unit from a nal_buffer from it's
+ * pic parameter_set_id
+ */
+struct nal_unit* nal_buffer_get_by_pps_id(struct nal_buffer *nal_buffer,
+ uint32_t pic_parameter_set_id)
+{
+ struct nal_unit *nal = nal_buffer->last;
+
+ if (nal != NULL) {
+ do {
+ if(nal->nal_unit_type == NAL_PPS) {
+ if(nal->pps.pic_parameter_set_id == pic_parameter_set_id) {
+ return nal;
+ }
+ }
+
+ nal = nal->prev;
+ } while(nal != NULL);
+ }
+
+ return NULL;
+}
+
+/**
+ * create a new nal unit, with a lock_counter of 1
+ */
+struct nal_unit* create_nal_unit()
+{
+ struct nal_unit *nal = calloc(1, sizeof(struct nal_unit));
+ nal->lock_counter = 1;
+
+ return nal;
+}
+
+void lock_nal_unit(struct nal_unit *nal)
+{
+ nal->lock_counter++;
+}
+
+void release_nal_unit(struct nal_unit *nal)
+{
+ if(!nal)
+ return;
+
+ nal->lock_counter--;
+
+ if(nal->lock_counter <= 0) {
+ free(nal);
+ }
+}
+
+/**
+ * creates a copy of a nal unit with a single lock
+ */
+void copy_nal_unit(struct nal_unit *dest, struct nal_unit *src)
+{
+ /* size without pps, sps and slc units: */
+ int size = sizeof(struct nal_unit);
+
+ xine_fast_memcpy(dest, src, size);
+ dest->lock_counter = 1;
+ dest->prev = dest->next = NULL;
+}
diff --git a/src/video_dec/libvdpau/nal.h b/src/video_dec/libvdpau/nal.h
new file mode 100644
index 000000000..f40617cd0
--- /dev/null
+++ b/src/video_dec/libvdpau/nal.h
@@ -0,0 +1,501 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * 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, USA
+ *
+ * nal.h: H264 NAL structures
+ */
+
+#ifndef NAL_H_
+#define NAL_H_
+#include <stdint.h>
+#include <vdpau/vdpau.h>
+
+enum nal_unit_types
+{
+ NAL_UNSPECIFIED = 0,
+ NAL_SLICE,
+ NAL_PART_A,
+ NAL_PART_B,
+ NAL_PART_C,
+ NAL_SLICE_IDR,
+ NAL_SEI,
+ NAL_SPS,
+ NAL_PPS,
+ NAL_AU_DELIMITER,
+ NAL_END_OF_SEQUENCE,
+ NAL_END_OF_STREAM,
+ NAL_FILLER_DATA,
+ NAL_SPS_EXT
+};
+
+enum pic_struct {
+ DISP_FRAME = 0,
+ DISP_TOP,
+ DISP_BOTTOM,
+ DISP_TOP_BOTTOM,
+ DISP_BOTTOM_TOP,
+ DISP_TOP_BOTTOM_TOP,
+ DISP_BOTTOM_TOP_BOTTOM,
+ DISP_FRAME_DOUBLING,
+ DISP_FRAME_TRIPLING
+};
+
+enum ct_type {
+ CT_PROGRESSIVE = 0,
+ CT_INTERLACED,
+ CT_UNKNOWN,
+ CT_RESERVED
+};
+
+/* slice types repeat from 5-9, we
+ * need a helper function for comparison
+ */
+enum slice_types
+{
+ SLICE_P = 0, SLICE_B, SLICE_I, SLICE_SP, SLICE_SI
+};
+
+enum aspect_ratio
+{
+ ASPECT_UNSPECIFIED = 0,
+ ASPECT_1_1,
+ ASPECT_12_11,
+ ASPECT_10_11,
+ ASPECT_16_11,
+ ASPECT_40_33,
+ ASPECT_24_11,
+ ASPECT_20_11,
+ ASPECT_32_11,
+ ASPECT_80_33,
+ ASPECT_18_11,
+ ASPECT_15_11,
+ ASPECT_64_33,
+ ASPECT_160_99,
+ ASPECT_4_3,
+ ASPECT_3_2,
+ ASPECT_2_1,
+ ASPECT_RESERVED,
+ ASPECT_EXTENDED_SAR=255
+};
+
+static const uint8_t zigzag_4x4[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 zigzag_8x8[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,
+};
+
+static inline uint32_t slice_type(uint32_t slice_type)
+{
+ return (slice_type < 10 ? slice_type % 5 : slice_type);
+}
+
+#if 0
+static inline void print_slice_type(uint32_t slice_type)
+{
+ switch(slice_type) {
+ case SLICE_P:
+ printf("SLICE_P\n");
+ break;
+ case SLICE_B:
+ printf("SLICE_B\n");
+ break;
+ case SLICE_I:
+ printf("SLICE_I\n");
+ break;
+ case SLICE_SP:
+ printf("SLICE_SP\n");
+ break;
+ case SLICE_SI:
+ printf("SLICE_SI\n");
+ break;
+ default:
+ printf("Unknown SLICE\n");
+ }
+}
+#endif
+
+struct hrd_parameters
+{
+ uint32_t cpb_cnt_minus1;
+ uint8_t bit_rate_scale;
+ uint8_t cpb_size_scale;
+
+ uint32_t bit_rate_value_minus1[32];
+ uint32_t cpb_size_value_minus1[32];
+ uint8_t cbr_flag[32];
+
+ uint8_t initial_cpb_removal_delay_length_minus1;
+ uint8_t cpb_removal_delay_length_minus1;
+ uint8_t dpb_output_delay_length_minus1;
+ uint8_t time_offset_length;
+};
+
+struct seq_parameter_set_rbsp
+{
+ uint8_t profile_idc; // 0xff
+ uint8_t constraint_setN_flag; // 0x0f
+ uint8_t level_idc; // 0xff
+ uint32_t seq_parameter_set_id;
+ uint32_t chroma_format_idc;
+ uint8_t separate_colour_plane_flag; // 0x01
+ uint32_t bit_depth_luma_minus8;
+ uint32_t bit_depth_chroma_minus8;
+ uint8_t qpprime_y_zero_transform_bypass_flag;
+ uint8_t seq_scaling_matrix_present_flag;
+
+ /* if(seq_scaling_matrix_present_flag) */
+ uint8_t seq_scaling_list_present_flag[8];
+
+ uint8_t scaling_lists_4x4[6][16];
+ uint8_t scaling_lists_8x8[2][64];
+ /* endif */
+
+ uint32_t log2_max_frame_num_minus4;
+ uint32_t max_frame_num;
+ uint32_t pic_order_cnt_type;
+ // if pic_order_cnt_type==0
+ uint32_t log2_max_pic_order_cnt_lsb_minus4;
+ // else
+ uint8_t delta_pic_order_always_zero_flag;
+ int32_t offset_for_non_ref_pic;
+ int32_t offset_for_top_to_bottom_field;
+ uint8_t num_ref_frames_in_pic_order_cnt_cycle;
+ int32_t offset_for_ref_frame[256];
+ // TODO: some more ignored here
+ uint32_t num_ref_frames;
+ uint8_t gaps_in_frame_num_value_allowed_flag;
+ /*uint32_t pic_width_in_mbs_minus1;
+ uint32_t pic_height_in_map_units_minus1;*/
+ uint32_t pic_width;
+ uint32_t pic_height;
+ uint8_t frame_mbs_only_flag;
+ uint8_t mb_adaptive_frame_field_flag;
+ uint8_t direct_8x8_inference_flag;
+ uint8_t frame_cropping_flag;
+ uint32_t frame_crop_left_offset;
+ uint32_t frame_crop_right_offset;
+ uint32_t frame_crop_top_offset;
+ uint32_t frame_crop_bottom_offset;
+ uint8_t vui_parameters_present_flag;
+
+ /* vui_parameters */
+ struct
+ {
+ uint8_t aspect_ration_info_present_flag;
+
+ /* aspect_ration_info_present_flag == 1 */
+ uint8_t aspect_ratio_idc;
+ uint16_t sar_width;
+ uint16_t sar_height;
+
+ uint8_t overscan_info_present_flag;
+ /* overscan_info_present_flag == 1 */
+ uint8_t overscan_appropriate_flag;
+
+ uint8_t video_signal_type_present_flag;
+ /* video_signal_type_present_flag == 1 */
+ uint8_t video_format;
+ uint8_t video_full_range_flag;
+ uint8_t colour_description_present;
+ /* colour_description_present == 1 */
+ uint8_t colour_primaries;
+ uint8_t transfer_characteristics;
+ uint8_t matrix_coefficients;
+
+ uint8_t chroma_loc_info_present_flag;
+ /* chroma_loc_info_present_flag == 1 */
+ uint8_t chroma_sample_loc_type_top_field;
+ uint8_t chroma_sample_loc_type_bottom_field;
+
+ uint8_t timing_info_present_flag;
+ /* timing_info_present_flag == 1 */
+ uint32_t num_units_in_tick;
+ uint32_t time_scale;
+ uint8_t fixed_frame_rate_flag;
+
+ uint8_t nal_hrd_parameters_present_flag;
+ struct hrd_parameters nal_hrd_parameters;
+
+ uint8_t vc1_hrd_parameters_present_flag;
+ struct hrd_parameters vc1_hrd_parameters;
+
+ uint8_t low_delay_hrd_flag;
+
+ uint8_t pic_struct_present_flag;
+ uint8_t bitstream_restriction_flag;
+
+ /* bitstream_restriction_flag == 1 */
+ uint8_t motion_vectors_over_pic_boundaries;
+ uint32_t max_bytes_per_pic_denom;
+ uint32_t max_bits_per_mb_denom;
+ uint32_t log2_max_mv_length_horizontal;
+ uint32_t log2_max_mv_length_vertical;
+ uint32_t num_reorder_frames;
+ uint32_t max_dec_frame_buffering;
+ } vui_parameters;
+
+};
+
+struct pic_parameter_set_rbsp
+{
+ uint32_t pic_parameter_set_id;
+ uint32_t seq_parameter_set_id;
+ uint8_t entropy_coding_mode_flag;
+ uint8_t pic_order_present_flag;
+
+ uint32_t num_slice_groups_minus1;
+
+ /* num_slice_groups_minus1 > 0 */
+ uint32_t slice_group_map_type;
+
+ /* slice_group_map_type == 1 */
+ uint32_t run_length_minus1[64];
+
+ /* slice_group_map_type == 2 */
+ uint32_t top_left[64];
+ uint32_t bottom_right[64];
+
+ /* slice_group_map_type == 3,4,5 */
+ uint8_t slice_group_change_direction_flag;
+ uint32_t slice_group_change_rate_minus1;
+
+ /* slice_group_map_type == 6 */
+ uint32_t pic_size_in_map_units_minus1;
+ uint8_t slice_group_id[64];
+
+ uint32_t num_ref_idx_l0_active_minus1;
+ uint32_t num_ref_idx_l1_active_minus1;
+ uint8_t weighted_pred_flag;
+ uint8_t weighted_bipred_idc;
+ int32_t pic_init_qp_minus26;
+ int32_t pic_init_qs_minus26;
+ int32_t chroma_qp_index_offset;
+ uint8_t deblocking_filter_control_present_flag;
+ uint8_t constrained_intra_pred_flag;
+ uint8_t redundant_pic_cnt_present_flag;
+
+ /* if(more_rbsp_data) */
+ uint8_t transform_8x8_mode_flag;
+ uint8_t pic_scaling_matrix_present_flag;
+
+ /* if(pic_scaling_matrix_present_flag) */
+ uint8_t pic_scaling_list_present_flag[8];
+
+ uint8_t scaling_lists_4x4[6][16];
+ uint8_t scaling_lists_8x8[2][64];
+
+ int32_t second_chroma_qp_index_offset;
+};
+
+/*struct clock_timestamp {
+ uint8_t ct_type;
+ uint8_t nuit_fiel_based_flag;
+ uint8_t counting_type;
+ uint8_t full_timestamp_flag;
+ uint8_t discontinuity_flag;
+ uint8_t cnt_dropped_flag;
+ uint8_t n_frames
+};*/
+
+/* sei contains several additional info, we do
+ * only care for pic_timing, to handle display
+ * reordering
+ */
+struct sei_message
+{
+ uint32_t payload_type;
+ uint8_t last_payload_type_byte;
+ uint32_t payload_size;
+ uint8_t last_payload_size_byte;
+
+ struct
+ {
+ /* cpb_dpb_delays_present_flag == 1 */
+ uint8_t cpb_removal_delay;
+ uint8_t dpb_output_delay;
+
+ uint8_t pic_struct;
+ uint8_t ct_type : 1;
+ uint8_t nuit_field_based_flag : 1;
+ uint8_t counting_type : 5;
+ uint8_t full_timestamp_flag : 1;
+ uint8_t discontinuity_flag : 1;
+ uint8_t cnt_dropped_flag : 1;
+ uint8_t n_frames;
+
+ uint8_t seconds_value : 6;
+ uint8_t minutes_value : 6;
+ uint8_t hours_value : 5;
+
+ int32_t time_offset;
+ } pic_timing;
+};
+
+struct slice_header
+{
+ uint32_t first_mb_in_slice;
+ uint32_t slice_type;
+ uint32_t pic_parameter_set_id;
+ uint8_t colour_plane_id;
+ uint32_t frame_num;
+ uint8_t field_pic_flag;
+ uint8_t bottom_field_flag;
+ uint32_t idr_pic_id;
+
+ /* sps->pic_order_cnt_type == 0 */
+ uint32_t pic_order_cnt_lsb;
+ int32_t delta_pic_order_cnt_bottom;
+ /* sps->pic_order_cnt_type == 1 && !sps->delta_pic_order_always_zero_flag */
+ int32_t delta_pic_order_cnt[2];
+
+ /* pps->redundant_pic_cnt_present_flag == 1 */
+ int32_t redundant_pic_cnt;
+
+ /* slice_type == B */
+ uint8_t direct_spatial_mv_pred_flag;
+
+ /* slice_type == P, SP, B */
+ uint8_t num_ref_idx_active_override_flag;
+ /* num_ref_idx_active_override_flag == 1 */
+ uint32_t num_ref_idx_l0_active_minus1;
+ /* slice type == B */
+ uint32_t num_ref_idx_l1_active_minus1;
+
+ /* ref_pic_list_reordering */
+ struct
+ {
+ /* slice_type != I && slice_type != SI */
+ uint8_t ref_pic_list_reordering_flag_l0;
+
+ /* slice_type == B */
+ uint8_t ref_pic_list_reordering_flag_l1;
+
+ /* ref_pic_list_reordering_flag_l0 == 1 */
+ uint32_t reordering_of_pic_nums_idc;
+
+ /* reordering_of_pic_nums_idc == 0, 1 */
+ uint32_t abs_diff_pic_num_minus1;
+
+ /* reordering_of_pic_nums_idc == 2) */
+ uint32_t long_term_pic_num;
+ } ref_pic_list_reordering;
+
+ /* pred_weight_table */
+ struct
+ {
+ uint32_t luma_log2_weight_denom;
+
+ /* chroma_format_idc != 0 */
+ uint32_t chroma_log2_weight_denom;
+
+ int32_t luma_weight_l0[32];
+ int32_t luma_offset_l0[32];
+
+ int32_t chroma_weight_l0[32][2];
+ int32_t chroma_offset_l0[32][2];
+
+ int32_t luma_weight_l1[32];
+ int32_t luma_offset_l1[32];
+
+ int32_t chroma_weight_l1[32][2];
+ int32_t chroma_offset_l1[32][2];
+ } pred_weight_table;
+
+ /* def_rec_pic_marking */
+ struct
+ {
+
+ /* nal_unit_type == NAL_SLICE_IDR */
+ uint8_t no_output_of_prior_pics_flag;
+ uint8_t long_term_reference_flag;
+
+ /* else */
+ uint8_t adaptive_ref_pic_marking_mode_flag;
+ uint32_t memory_management_control_operation;
+
+ uint32_t difference_of_pic_nums_minus1;
+ uint32_t long_term_pic_num;
+ uint32_t long_term_frame_idx;
+ uint32_t max_long_term_frame_idx_plus1;
+ } dec_ref_pic_marking[10];
+ uint32_t dec_ref_pic_marking_count;
+};
+
+struct nal_unit {
+ uint8_t nal_ref_idc; // 0x03
+ enum nal_unit_types nal_unit_type; // 0x1f
+
+ //union {
+ struct sei_message sei;
+ struct seq_parameter_set_rbsp sps;
+ struct pic_parameter_set_rbsp pps;
+ struct slice_header slc;
+ //};
+
+ struct nal_unit *prev;
+ struct nal_unit *next;
+
+ uint32_t lock_counter;
+};
+
+struct nal_buffer {
+ struct nal_unit *first;
+ struct nal_unit *last;
+
+ uint8_t max_size;
+ uint8_t used;
+};
+
+struct nal_buffer* create_nal_buffer(uint8_t max_size);
+void free_nal_buffer(struct nal_buffer *nal_buffer);
+void nal_buffer_append(struct nal_buffer *nal_buffer, struct nal_unit *nal);
+void nal_buffer_remove(struct nal_buffer *nal_buffer, struct nal_unit *nal);
+void nal_buffer_flush(struct nal_buffer *nal_buffer);
+
+struct nal_unit* nal_buffer_get_by_sps_id(struct nal_buffer *nal_buffer,
+ uint32_t seq_parameter_set_id);
+struct nal_unit* nal_buffer_get_by_pps_id(struct nal_buffer *nal_buffer,
+ uint32_t pic_parameter_set_id);
+struct nal_unit* nal_buffer_get_last(struct nal_buffer *nal_buffer);
+
+struct nal_unit* create_nal_unit(void);
+void lock_nal_unit(struct nal_unit *nal);
+void release_nal_unit(struct nal_unit *nal);
+void copy_nal_unit(struct nal_unit *dest, struct nal_unit *src);
+
+#endif /* NAL_H_ */
diff --git a/src/video_dec/libvdpau/vdpau_h264.c b/src/video_dec/libvdpau/vdpau_h264.c
new file mode 100644
index 000000000..25ed62295
--- /dev/null
+++ b/src/video_dec/libvdpau/vdpau_h264.c
@@ -0,0 +1,1014 @@
+/*
+ * Copyright (C) 2008 Julian Scheel
+ *
+ * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
+ *
+ * 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, USA
+ *
+ * vdpau_h264.c: H264 Video Decoder utilizing nvidia VDPAU engine
+ */
+
+#define LOG_MODULE "vdpau_h264"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <vdpau/vdpau.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+#include "accel_vdpau.h"
+#include "h264_parser.h"
+#include "dpb.h"
+#include "cpb.h"
+
+//#define DEBUG_H264
+
+#define VIDEOBUFSIZE 128*1024
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} vdpau_h264_class_t;
+
+typedef struct vdpau_h264_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ vdpau_h264_class_t *class;
+ xine_stream_t *stream;
+
+ /* these are traditional variables in a video decoder object */
+ uint64_t video_step; /* frame duration in pts units */
+ uint64_t reported_video_step; /* frame duration in pts units */
+
+ int width; /* the width of a video frame */
+ int height; /* the height of a video frame */
+ double ratio; /* the width to height ratio */
+
+
+ struct h264_parser *nal_parser; /* h264 nal parser. extracts stream data for vdpau */
+
+ struct decoded_picture *incomplete_pic;
+ uint32_t last_top_field_order_cnt;
+
+ int have_frame_boundary_marks;
+ int wait_for_frame_start;
+
+ VdpDecoder decoder;
+ int decoder_started;
+ int progressive_cnt; /* count of progressive marked frames in line */
+
+ VdpColorStandard color_standard;
+ VdpDecoderProfile profile;
+ vdpau_accel_t *vdpau_accel;
+
+ xine_t *xine;
+
+ struct coded_picture *completed_pic;
+ vo_frame_t *dangling_img;
+
+ uint8_t *codec_private;
+ uint32_t codec_private_len;
+
+ int vdp_runtime_nr;
+
+ int reset;
+
+} vdpau_h264_decoder_t;
+
+static void vdpau_h264_reset (video_decoder_t *this_gen);
+static void vdpau_h264_flush (video_decoder_t *this_gen);
+
+/**************************************************************************
+ * vdpau_h264 specific decode functions
+ *************************************************************************/
+
+/**************************************************************************
+ * xine video plugin functions
+ *************************************************************************/
+
+#ifdef DEBUG_H264
+static inline void dump_pictureinfo_h264(VdpPictureInfoH264 *pic)
+{
+ printf("C: slice_count: %d\n", pic->slice_count);
+ printf("C: field_order_cnt[0]: %d\n", pic->field_order_cnt[0]);
+ printf("C: field_order_cnt[1]: %d\n", pic->field_order_cnt[1]);
+ printf("C: is_reference: %d\n", pic->is_reference);
+ printf("C: frame_num: %d\n", pic->frame_num);
+ printf("C: field_pic_flag: %d\n", pic->field_pic_flag);
+ printf("C: bottom_field_flag: %d\n", pic->bottom_field_flag);
+ printf("C: num_ref_frames: %d\n", pic->num_ref_frames);
+ printf("C: mb_adaptive_frame_field_flag: %d\n", pic->mb_adaptive_frame_field_flag);
+ printf("C: constrained_intra_pred_flag: %d\n", pic->constrained_intra_pred_flag);
+ printf("C: weighted_pred_flag: %d\n", pic->weighted_pred_flag);
+ printf("C: weighted_bipred_idc: %d\n", pic->weighted_bipred_idc);
+ printf("C: frame_mbs_only_flag: %d\n", pic->frame_mbs_only_flag);
+ printf("C: transform_8x8_mode_flag: %d\n", pic->transform_8x8_mode_flag);
+ printf("C: chroma_qp_index_offset: %d\n", pic->chroma_qp_index_offset);
+ printf("C: second_chroma_qp_index_offset: %d\n", pic->second_chroma_qp_index_offset);
+ printf("C: pic_init_qp_minus26: %d\n", pic->pic_init_qp_minus26);
+ printf("C: num_ref_idx_l0_active_minus1: %d\n", pic->num_ref_idx_l0_active_minus1);
+ printf("C: num_ref_idx_l1_active_minus1: %d\n", pic->num_ref_idx_l1_active_minus1);
+ printf("C: log2_max_frame_num_minus4: %d\n", pic->log2_max_frame_num_minus4);
+ printf("C: pic_order_cnt_type: %d\n", pic->pic_order_cnt_type);
+ printf("C: log2_max_pic_order_cnt_lsb_minus4: %d\n", pic->log2_max_pic_order_cnt_lsb_minus4);
+ printf("C: delta_pic_order_always_zero_flag: %d\n", pic->delta_pic_order_always_zero_flag);
+ printf("C: direct_8x8_inference_flag: %d\n", pic->direct_8x8_inference_flag);
+ printf("C: entropy_coding_mode_flag: %d\n", pic->entropy_coding_mode_flag);
+ printf("C: pic_order_present_flag: %d\n", pic->pic_order_present_flag);
+ printf("C: deblocking_filter_control_present_flag: %d\n", pic->deblocking_filter_control_present_flag);
+ printf("C: redundant_pic_cnt_present_flag: %d\n", pic->redundant_pic_cnt_present_flag);
+
+ int i, j;
+ for(i = 0; i < 6; i++) {
+ printf("C: scalint_list4x4[%d]:\nC:", i);
+ for(j = 0; j < 16; j++) {
+ printf(" [%d]", pic->scaling_lists_4x4[i][j]);
+ if(j%8 == 0)
+ printf("\nC:");
+ }
+ printf("C: \n");
+ }
+ for(i = 0; i < 2; i++) {
+ printf("C: scalint_list8x8[%d]:\nC:", i);
+ for(j = 0; j < 64; j++) {
+ printf(" [%d] ", pic->scaling_lists_8x8[i][j]);
+ if(j%8 == 0)
+ printf("\nC:");
+ }
+ printf("C: \n");
+ }
+
+ //int i;
+ for(i = 0; i < 16; i++) {
+ if(pic->referenceFrames[i].surface != VDP_INVALID_HANDLE) {
+ printf("C: -------------------\n");
+ printf("C: Reference Frame %d:\n", i);
+ printf("C: frame_idx: %d\n", pic->referenceFrames[i].frame_idx);
+ printf("C: field_order_cnt[0]: %d\n", pic->referenceFrames[i].field_order_cnt[0]);
+ printf("C: field_order_cnt[1]: %d\n", pic->referenceFrames[i].field_order_cnt[0]);
+ printf("C: is_long_term: %d\n", pic->referenceFrames[i].is_long_term);
+ printf("C: top_is_reference: %d\n", pic->referenceFrames[i].top_is_reference);
+ printf("C: bottom_is_reference: %d\n", pic->referenceFrames[i].bottom_is_reference);
+ }
+ }
+ printf("C: ---------------------------------------------------------------\n");
+ /*memcpy(pic.scaling_lists_4x4, pps->scaling_lists_4x4, 6*16);
+ memcpy(pic.scaling_lists_8x8, pps->scaling_lists_8x8, 2*64);
+ memcpy(pic.referenceFrames, this->reference_frames, sizeof(this->reference_frames));*/
+
+}
+#endif
+
+static void set_ratio(video_decoder_t *this_gen)
+{
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *)this_gen;
+
+ this->ratio = (double)this->width / (double)this->height;
+ if(this->completed_pic->sps_nal->sps.vui_parameters.aspect_ration_info_present_flag) {
+ switch(this->completed_pic->sps_nal->sps.vui_parameters.aspect_ratio_idc) {
+ case ASPECT_1_1:
+ this->ratio = 1 * this->ratio;
+ break;
+ case ASPECT_12_11:
+ this->ratio *= 12.0/11.0;
+ break;
+ case ASPECT_10_11:
+ this->ratio *= 10.0/11.0;
+ break;
+ case ASPECT_16_11:
+ this->ratio *= 16.0/11.0;
+ break;
+ case ASPECT_40_33:
+ this->ratio *= 40.0/33.0;
+ break;
+ case ASPECT_24_11:
+ this->ratio *= 24.0/11.0;
+ break;
+ case ASPECT_20_11:
+ this->ratio *= 20.0/11.0;
+ break;
+ case ASPECT_32_11:
+ this->ratio *= 32.0/11.0;
+ break;
+ case ASPECT_80_33:
+ this->ratio *= 80.0/33.0;
+ break;
+ case ASPECT_18_11:
+ this->ratio *= 18.0/11.0;
+ break;
+ case ASPECT_15_11:
+ this->ratio *= 15.0/11.0;
+ break;
+ case ASPECT_64_33:
+ this->ratio *= 64.0/33.0;
+ break;
+ case ASPECT_160_99:
+ this->ratio *= 160.0/99.0;
+ break;
+ case ASPECT_4_3:
+ this->ratio *= 4.0/3.0;
+ break;
+ case ASPECT_3_2:
+ this->ratio *= 3.0/2.0;
+ break;
+ case ASPECT_2_1:
+ this->ratio *= 2.0/1.0;
+ break;
+ case ASPECT_EXTENDED_SAR:
+ this->ratio *=
+ (double)this->completed_pic->sps_nal->sps.vui_parameters.sar_width/
+ (double)this->completed_pic->sps_nal->sps.vui_parameters.sar_height;
+ break;
+ }
+ }
+}
+
+static void fill_vdpau_pictureinfo_h264(video_decoder_t *this_gen, uint32_t slice_count, VdpPictureInfoH264 *pic)
+{
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *)this_gen;
+
+ struct pic_parameter_set_rbsp *pps = &this->completed_pic->pps_nal->pps;
+ struct seq_parameter_set_rbsp *sps = &this->completed_pic->sps_nal->sps;
+ struct slice_header *slc = &this->completed_pic->slc_nal->slc;
+
+ pic->slice_count = slice_count;
+ pic->field_order_cnt[0] = this->completed_pic->top_field_order_cnt;
+ pic->field_order_cnt[1] = this->completed_pic->bottom_field_order_cnt;
+ pic->is_reference =
+ (this->completed_pic->flag_mask & REFERENCE) ? VDP_TRUE : VDP_FALSE;
+ pic->frame_num = slc->frame_num;
+ pic->field_pic_flag = slc->field_pic_flag;
+ pic->bottom_field_flag = slc->bottom_field_flag;
+ pic->num_ref_frames = sps->num_ref_frames;
+ pic->mb_adaptive_frame_field_flag = sps->mb_adaptive_frame_field_flag && !slc->field_pic_flag;
+ pic->constrained_intra_pred_flag = pps->constrained_intra_pred_flag;
+ pic->weighted_pred_flag = pps->weighted_pred_flag;
+ pic->weighted_bipred_idc = pps->weighted_bipred_idc;
+ pic->frame_mbs_only_flag = sps->frame_mbs_only_flag;
+ pic->transform_8x8_mode_flag = pps->transform_8x8_mode_flag;
+ pic->chroma_qp_index_offset = pps->chroma_qp_index_offset;
+ pic->second_chroma_qp_index_offset = pps->second_chroma_qp_index_offset;
+ pic->pic_init_qp_minus26 = pps->pic_init_qp_minus26;
+ pic->num_ref_idx_l0_active_minus1 = pps->num_ref_idx_l0_active_minus1;
+ pic->num_ref_idx_l1_active_minus1 = pps->num_ref_idx_l1_active_minus1;
+ pic->log2_max_frame_num_minus4 = sps->log2_max_frame_num_minus4;
+ pic->pic_order_cnt_type = sps->pic_order_cnt_type;
+ pic->log2_max_pic_order_cnt_lsb_minus4 = sps->log2_max_pic_order_cnt_lsb_minus4;
+ pic->delta_pic_order_always_zero_flag = sps->delta_pic_order_always_zero_flag;
+ pic->direct_8x8_inference_flag = sps->direct_8x8_inference_flag;
+ pic->entropy_coding_mode_flag = pps->entropy_coding_mode_flag;
+ pic->pic_order_present_flag = pps->pic_order_present_flag;
+ pic->deblocking_filter_control_present_flag = pps->deblocking_filter_control_present_flag;
+ pic->redundant_pic_cnt_present_flag = pps->redundant_pic_cnt_present_flag;
+
+ memcpy(pic->scaling_lists_4x4, pps->scaling_lists_4x4, sizeof(pic->scaling_lists_4x4));
+ memcpy(pic->scaling_lists_8x8, pps->scaling_lists_8x8, sizeof(pic->scaling_lists_8x8));
+
+ /* set num_ref_frames to the number of actually available reference frames,
+ * if this is not set generation 3 decoders will fail. */
+ /*pic->num_ref_frames =*/
+ fill_vdpau_reference_list(this->nal_parser->dpb, pic->referenceFrames);
+
+}
+
+static int check_progressive(video_decoder_t *this_gen, struct decoded_picture *dpic)
+{
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *)this_gen;
+ int progressive = 0;
+ int i;
+
+ for(i = 0; i < 2; i++) {
+ struct coded_picture *pic = dpic->coded_pic[i];
+ if (!pic) {
+ continue;
+ }
+
+ if (pic->flag_mask & PIC_STRUCT_PRESENT && pic->sei_nal != NULL) {
+ uint8_t pic_struct = pic->sei_nal->sei.pic_timing.pic_struct;
+
+ if (pic_struct == DISP_FRAME) {
+ progressive = 1;
+ continue;
+ } else if (pic_struct == DISP_TOP_BOTTOM ||
+ pic_struct == DISP_BOTTOM_TOP) {
+ progressive = 0;
+ break;
+ }
+
+ /* FIXME: seems unreliable, maybe it's has to be interpreted more complex */
+ /*if (pic->sei_nal->sei.pic_timing.ct_type == CT_INTERLACED) {
+ return 0;
+ } else if (pic->sei_nal->sei.pic_timing.ct_type == CT_PROGRESSIVE) {
+ return 1;
+ } */
+ }
+
+ if (pic->slc_nal->slc.field_pic_flag && pic->pps_nal->pps.pic_order_present_flag) {
+ if(pic->slc_nal->slc.delta_pic_order_cnt_bottom == 1 ||
+ pic->slc_nal->slc.delta_pic_order_cnt_bottom == -1) {
+ progressive = 0;
+ break;
+ } else {
+ progressive = 1;
+ continue;
+ }
+ }
+ if (!pic->slc_nal->slc.field_pic_flag && pic->sps_nal->sps.frame_mbs_only_flag) {
+ progressive = 1;
+ continue;
+ }
+ }
+
+ if (progressive) {
+ this->progressive_cnt++;
+ } else {
+ this->progressive_cnt = 0;
+ }
+
+ /* only switch to progressive mode if at least 5
+ * frames in order were marked as progressive */
+ return (this->progressive_cnt >= 5);
+}
+
+static int vdpau_decoder_init(video_decoder_t *this_gen)
+{
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *)this_gen;
+ vo_frame_t *img;
+
+ if(this->width == 0) {
+ this->width = this->completed_pic->sps_nal->sps.pic_width;
+ this->height = this->completed_pic->sps_nal->sps.pic_height;
+ }
+
+ set_ratio(this_gen);
+
+ _x_stream_info_set( this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->width );
+ _x_stream_info_set( this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->height );
+ _x_stream_info_set( this->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*this->ratio) );
+ _x_stream_info_set( this->stream, XINE_STREAM_INFO_FRAME_DURATION, (this->reported_video_step = this->video_step) );
+ _x_meta_info_set_utf8( this->stream, XINE_META_INFO_VIDEOCODEC, "H264/AVC (vdpau)" );
+ xine_event_t event;
+ xine_format_change_data_t data;
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = this->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = this->width;
+ data.height = this->height;
+ data.aspect = this->ratio;
+ xine_event_send( this->stream, &event );
+
+ switch(this->completed_pic->sps_nal->sps.profile_idc) {
+ case 100:
+ this->profile = VDP_DECODER_PROFILE_H264_HIGH;
+ break;
+ case 77:
+ this->profile = VDP_DECODER_PROFILE_H264_MAIN;
+ break;
+ case 66:
+ default:
+ // nvidia's VDPAU doesn't support BASELINE. But most (every?) streams marked BASELINE do not use BASELINE specifics,
+ // so, just force MAIN.
+ //this->profile = VDP_DECODER_PROFILE_H264_BASELINE;
+ this->profile = VDP_DECODER_PROFILE_H264_MAIN;
+ break;
+ }
+
+ // Level 4.1 limits:
+ int ref_frames = 0;
+ if(this->completed_pic->sps_nal->sps.num_ref_frames) {
+ ref_frames = this->completed_pic->sps_nal->sps.num_ref_frames;
+ } else {
+ uint32_t round_width = (this->width + 15) & ~15;
+ uint32_t round_height = (this->height + 15) & ~15;
+ uint32_t surf_size = (round_width * round_height * 3) / 2;
+ ref_frames = (12 * 1024 * 1024) / surf_size;
+ }
+
+ if (ref_frames > 16) {
+ ref_frames = 16;
+ }
+
+ xprintf(this->xine, XINE_VERBOSITY_LOG, "Allocate %d reference frames\n",
+ ref_frames);
+ /* get the vdpau context from vo */
+ //(this->stream->video_out->open) (this->stream->video_out, this->stream);
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio,
+ XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS | this->reset);
+ this->reset = 0;
+
+ this->vdpau_accel = (vdpau_accel_t*)img->accel_data;
+
+ img->free(img);
+ img = NULL;
+
+ /*VdpBool is_supported;
+ uint32_t max_level, max_references, max_width, max_height;*/
+ if(this->vdpau_accel->vdp_runtime_nr > 0) {
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ "Create decoder: vdp_device: %d, profile: %d, res: %dx%d\n",
+ this->vdpau_accel->vdp_device, this->profile, this->width, this->height);
+
+ VdpStatus status = this->vdpau_accel->vdp_decoder_create(this->vdpau_accel->vdp_device,
+ this->profile, this->width, this->height, 16, &this->decoder);
+
+ if(status != VDP_STATUS_OK) {
+ xprintf(this->xine, XINE_VERBOSITY_LOG, "vdpau_h264: ERROR: VdpDecoderCreate returned status != OK (%s)\n", this->vdpau_accel->vdp_get_error_string(status));
+ return 0;
+ }
+ }
+ return 1;
+}
+
+static void draw_frames(video_decoder_t *this_gen, int flush)
+{
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *)this_gen;
+
+ struct decoded_picture *decoded_pic = NULL;
+ while ((decoded_pic = dpb_get_next_out_picture(this->nal_parser->dpb, flush)) != NULL) {
+ decoded_pic->img->top_field_first = dp_top_field_first(decoded_pic);
+ decoded_pic->img->progressive_frame = check_progressive(this_gen, decoded_pic);
+#ifdef DEBUG_H264
+ printf("progressive: %d\n", decoded_pic->img->progressive_frame);
+#endif
+ if (flush) {
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG,
+ "h264 flush, draw pts: %"PRId64"\n", decoded_pic->img->pts);
+ }
+
+ decoded_pic->img->draw(decoded_pic->img, this->stream);
+ dpb_unmark_picture_delayed(this->nal_parser->dpb, decoded_pic);
+ decoded_pic = NULL;
+ }
+}
+
+static int vdpau_decoder_render(video_decoder_t *this_gen, VdpBitstreamBuffer *vdp_buffer, uint32_t slice_count)
+{
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *)this_gen;
+ vo_frame_t *img = NULL;
+
+ /* if we wait for a second field for this frame, we
+ * have to render to the same surface again.
+ */
+ if (this->incomplete_pic) {
+ img = this->incomplete_pic->img;
+ }
+
+ // FIXME: what is if this is the second field of a field coded
+ // picture? - should we keep the first field in dpb?
+ if(this->completed_pic->flag_mask & IDR_PIC) {
+ dpb_flush(this->nal_parser->dpb);
+ if(this->incomplete_pic) {
+ release_decoded_picture(this->incomplete_pic);
+ this->incomplete_pic = NULL;
+ }
+ }
+
+ struct seq_parameter_set_rbsp *sps = &this->completed_pic->sps_nal->sps;
+ struct slice_header *slc = &this->completed_pic->slc_nal->slc;
+
+ if(sps->vui_parameters_present_flag &&
+ sps->vui_parameters.timing_info_present_flag &&
+ this->video_step == 0) {
+ this->video_step = 2*90000/(1/((double)sps->vui_parameters.num_units_in_tick/(double)sps->vui_parameters.time_scale));
+ }
+
+ /* go and decode a frame */
+
+ /* check if we expect a second field, but got a frame */
+ if (this->incomplete_pic && img) {
+ if ((this->completed_pic->slc_nal->slc.frame_num !=
+ this->incomplete_pic->coded_pic[0]->slc_nal->slc.frame_num) ||
+ !slc->field_pic_flag) {
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG, "H264 warning: Expected a second field, stream might be broken\n");
+
+ /* remove this pic from dpb, as it is not complete */
+ dpb_unmark_picture_delayed(this->nal_parser->dpb, this->incomplete_pic);
+ dpb_unmark_reference_picture(this->nal_parser->dpb, this->incomplete_pic);
+
+ release_decoded_picture(this->incomplete_pic);
+ this->incomplete_pic = NULL;
+ img = NULL;
+ }
+ }
+
+
+ VdpPictureInfoH264 pic;
+
+ fill_vdpau_pictureinfo_h264(this_gen, slice_count, &pic);
+
+#ifdef DEBUG_H264
+ dump_pictureinfo_h264(&pic);
+
+ int i;
+ printf("E: Bytes used: %d\n", vdp_buffer->bitstream_bytes);
+ printf("E: Decode data: \nE:");
+ for(i = 0; i < ((vdp_buffer->bitstream_bytes < 20) ? vdp_buffer->bitstream_bytes : 20); i++) {
+ printf("%02x ", ((uint8_t*)vdp_buffer->bitstream)[i]);
+ if((i+1) % 10 == 0)
+ printf("\nE:");
+ }
+ printf("\n...\n");
+ for(i = vdp_buffer->bitstream_bytes - 20; i < vdp_buffer->bitstream_bytes; i++) {
+ printf("%02x ", ((uint8_t*)vdp_buffer->bitstream)[i]);
+ if((i+1) % 10 == 0)
+ printf("\nE:");
+ }
+ printf("\nE: ---------------------------------------------------------------\n");
+#endif
+
+ if(!this->decoder_started && !pic.is_reference)
+ return 0;
+
+ this->decoder_started = 1;
+
+ if(img == NULL) {
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio,
+ XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS);
+ this->vdpau_accel = (vdpau_accel_t*)img->accel_data;
+
+ img->duration = this->video_step;
+ img->pts = this->completed_pic->pts;
+
+ if (this->dangling_img) {
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ "broken stream: current img wasn't processed -- freeing it!\n");
+ this->dangling_img->free(this->dangling_img);
+ }
+ this->dangling_img = img;
+ } else {
+ if (img->pts == 0) {
+ img->pts = this->completed_pic->pts;
+ }
+ }
+
+ if(this->vdp_runtime_nr != *(this->vdpau_accel->current_vdp_runtime_nr)) {
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ "VDPAU was preempted. Reinitialise the decoder.\n");
+ this->decoder = VDP_INVALID_HANDLE;
+ vdpau_h264_reset(this_gen);
+ this->vdp_runtime_nr = this->vdpau_accel->vdp_runtime_nr;
+ return 0;
+ }
+
+ VdpVideoSurface surface = this->vdpau_accel->surface;
+
+ /*xprintf(this->xine, XINE_VERBOSITY_DEBUG,
+ "Decode: NUM: %d, REF: %d, BYTES: %d, PTS: %lld\n", pic.frame_num, pic.is_reference, vdp_buffer->bitstream_bytes, this->completed_pic->pts);*/
+ VdpStatus status = this->vdpau_accel->vdp_decoder_render(this->decoder,
+ surface, (VdpPictureInfo*)&pic, 1, vdp_buffer);
+
+ /* free the image data */
+ if(((uint8_t*)vdp_buffer->bitstream) != NULL) {
+ free((uint8_t*)vdp_buffer->bitstream);
+ }
+
+ process_mmc_operations(this->nal_parser, this->completed_pic);
+
+ if(status != VDP_STATUS_OK)
+ {
+ xprintf(this->xine, XINE_VERBOSITY_LOG, "vdpau_h264: Decoder failure: %s\n", this->vdpau_accel->vdp_get_error_string(status));
+ if (this->dangling_img)
+ this->dangling_img->free(this->dangling_img);
+ img = NULL;
+ this->dangling_img = NULL;
+ free_coded_picture(this->completed_pic);
+ this->completed_pic = NULL;
+ }
+ else {
+ img->bad_frame = 0;
+
+ if(!img->progressive_frame && this->completed_pic->repeat_pic)
+ img->repeat_first_field = 1;
+ //else if(img->progressive_frame && this->nal_parser->current_nal->repeat_pic)
+ // img->duration *= this->nal_parser->current_nal->repeat_pic;
+
+ /* only bt601 and bt701 handled so far. others seem to be rarely used */
+ if(sps->vui_parameters.colour_description_present) {
+ switch (sps->vui_parameters.colour_primaries) {
+ case 1:
+ this->color_standard = VDP_COLOR_STANDARD_ITUR_BT_709;
+ break;
+ case 5:
+ case 6:
+ default:
+ this->color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+ break;
+ }
+ }
+
+ this->vdpau_accel->color_standard = this->color_standard;
+
+ struct decoded_picture *decoded_pic = NULL;
+
+
+ uint8_t draw_frame = 0;
+ if (!slc->field_pic_flag) { /* frame coded: simply add to dpb */
+ decoded_pic = init_decoded_picture(this->completed_pic, img);
+ this->completed_pic = NULL;
+ this->dangling_img = NULL;
+
+ dpb_add_picture(this->nal_parser->dpb, decoded_pic, sps->num_ref_frames);
+
+ draw_frame = 1;
+ } else { /* field coded: check for second field */
+ if (!this->incomplete_pic) {
+ decoded_pic = init_decoded_picture(this->completed_pic, img);
+ this->completed_pic = NULL;
+ this->dangling_img = NULL;
+ this->incomplete_pic = decoded_pic;
+ lock_decoded_picture(this->incomplete_pic);
+
+ dpb_add_picture(this->nal_parser->dpb, decoded_pic, sps->num_ref_frames);
+
+ /* don't do a draw yet as the field was incomplete */
+ draw_frame = 0;
+ } else {
+ decoded_pic = this->incomplete_pic;
+ lock_decoded_picture(decoded_pic);
+
+ /* picture is complete now */
+ release_decoded_picture(this->incomplete_pic);
+ this->incomplete_pic = NULL;
+ this->dangling_img = NULL;
+
+ decoded_pic_add_field(decoded_pic, this->completed_pic);
+ this->completed_pic = NULL;
+
+ draw_frame = 1;
+ }
+ }
+
+ release_decoded_picture(decoded_pic);
+
+ /* draw the next frame in display order */
+ if (draw_frame) {
+ draw_frames(this_gen, 0);
+ }
+ }
+
+ return 1;
+}
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void vdpau_h264_decode_data (video_decoder_t *this_gen,
+ buf_element_t *buf) {
+
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen;
+
+ VdpBitstreamBuffer vdp_buffer;
+ vdp_buffer.struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+
+ /* a video decoder does not care about this flag (?) */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if(buf->decoder_flags & BUF_FLAG_FRAME_START || buf->decoder_flags & BUF_FLAG_FRAME_END)
+ this->have_frame_boundary_marks = 1;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
+ this->video_step = buf->decoder_info[0];
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
+ }
+
+ if (this->video_step != this->reported_video_step){
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, (this->reported_video_step = this->video_step));
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
+ this->have_frame_boundary_marks = 0;
+
+ xine_bmiheader *bih = (xine_bmiheader*)buf->content;
+ this->width = bih->biWidth;
+ this->height = bih->biHeight;
+
+ uint8_t *codec_private = buf->content + sizeof(xine_bmiheader);
+ uint32_t codec_private_len = bih->biSize - sizeof(xine_bmiheader);
+ this->codec_private_len = codec_private_len;
+ this->codec_private = malloc(codec_private_len);
+ memcpy(this->codec_private, codec_private, codec_private_len);
+
+ if(codec_private_len > 0) {
+ parse_codec_private(this->nal_parser, codec_private, codec_private_len);
+ }
+ } else if (buf->decoder_flags & BUF_FLAG_SPECIAL) {
+ this->have_frame_boundary_marks = 0;
+
+ if(buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG) {
+ uint8_t *codec_private = buf->decoder_info_ptr[2];
+ uint32_t codec_private_len = buf->decoder_info[2];
+ this->codec_private_len = codec_private_len;
+ this->codec_private = malloc(codec_private_len);
+ memcpy(this->codec_private, codec_private, codec_private_len);
+
+ if(codec_private_len > 0) {
+ parse_codec_private(this->nal_parser, codec_private, codec_private_len);
+ }
+ } else if (buf->decoder_info[1] == BUF_SPECIAL_PALETTE) {
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ "SPECIAL PALETTE is not yet handled\n");
+ } else
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ "UNKNOWN SPECIAL HEADER\n");
+
+ } else {
+ /* parse the first nal packages to retrieve profile type */
+ int len = 0;
+
+ while(len < buf->size && !(this->wait_for_frame_start && !(buf->decoder_flags & BUF_FLAG_FRAME_START))) {
+ this->wait_for_frame_start = 0;
+ len += parse_frame(this->nal_parser, buf->content + len, buf->size - len,
+ buf->pts,
+ (uint8_t**)&vdp_buffer.bitstream, &vdp_buffer.bitstream_bytes, &this->completed_pic);
+
+ if(this->decoder == VDP_INVALID_HANDLE &&
+ this->completed_pic &&
+ this->completed_pic->sps_nal != NULL &&
+ this->completed_pic->sps_nal->sps.pic_width > 0 &&
+ this->completed_pic->sps_nal->sps.pic_height > 0) {
+
+ vdpau_decoder_init(this_gen);
+ }
+
+ if(this->completed_pic &&
+ this->completed_pic->sps_nal != NULL &&
+ this->completed_pic->sps_nal->sps.vui_parameters_present_flag &&
+ this->completed_pic->sps_nal->sps.vui_parameters.bitstream_restriction_flag) {
+
+ this->nal_parser->dpb->max_reorder_frames =
+ this->completed_pic->sps_nal->sps.vui_parameters.num_reorder_frames + 1;
+ this->nal_parser->dpb->max_dpb_frames = this->completed_pic->sps_nal->sps.vui_parameters.max_dec_frame_buffering + 1;
+
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG,
+ "max reorder count: %d, max dpb count %d\n",
+ this->nal_parser->dpb->max_reorder_frames,
+ this->nal_parser->dpb->max_dpb_frames);
+ }
+
+ if(this->decoder != VDP_INVALID_HANDLE &&
+ vdp_buffer.bitstream_bytes > 0 &&
+ this->completed_pic->slc_nal != NULL &&
+ this->completed_pic->pps_nal != NULL) {
+ vdpau_decoder_render(this_gen, &vdp_buffer, this->completed_pic->slice_cnt);
+ } else if (this->completed_pic != NULL) {
+ free_coded_picture(this->completed_pic);
+ }
+
+ /* in case the last nal was detected as END_OF_SEQUENCE
+ * we will flush the dpb, so that all pictures get drawn
+ */
+ if(this->nal_parser->last_nal_res == 3) {
+ xprintf(this->xine, XINE_VERBOSITY_DEBUG,
+ "END_OF_SEQUENCE, flush buffers\n");
+ vdpau_h264_flush(this_gen);
+ }
+ }
+ }
+
+ if(buf->decoder_flags & BUF_FLAG_FRAME_END)
+ this->wait_for_frame_start = 0;
+}
+
+/*
+ * This function is called when xine needs to flush the system.
+ */
+static void vdpau_h264_flush (video_decoder_t *this_gen) {
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t*) this_gen;
+ struct decoded_picture *decoded_pic = NULL;
+
+ if(this->dangling_img){
+ this->dangling_img->free(this->dangling_img);
+ this->dangling_img = NULL;
+ }
+
+ if (this->incomplete_pic) {
+ release_decoded_picture(this->incomplete_pic);
+ this->incomplete_pic = NULL;
+ }
+
+ draw_frames(this_gen, 1);
+ dpb_free_all(this->nal_parser->dpb);
+ this->reset = VO_NEW_SEQUENCE_FLAG;
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void vdpau_h264_reset (video_decoder_t *this_gen) {
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen;
+
+ dpb_free_all(this->nal_parser->dpb);
+
+ if (this->decoder != VDP_INVALID_HANDLE) {
+ this->vdpau_accel->vdp_decoder_destroy( this->decoder );
+ this->decoder = VDP_INVALID_HANDLE;
+ }
+
+ // Doing a full parser reinit here works more reliable than
+ // resetting
+
+ //reset_parser(this->nal_parser);
+ free_parser(this->nal_parser);
+ this->nal_parser = init_parser(this->xine);
+
+ this->color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+ this->video_step = 0;
+
+ if(this->codec_private_len > 0) {
+ parse_codec_private(this->nal_parser, this->codec_private, this->codec_private_len);
+
+ /* if the stream does not contain frame boundary marks we
+ * have to hope that the next nal will start with the next
+ * incoming buf... seems to work, though...
+ */
+ this->wait_for_frame_start = this->have_frame_boundary_marks;
+ }
+
+ if (this->incomplete_pic) {
+ release_decoded_picture(this->incomplete_pic);
+ this->incomplete_pic = NULL;
+ }
+
+ if (this->dangling_img) {
+ this->dangling_img->free(this->dangling_img);
+ this->dangling_img = NULL;
+ }
+
+ this->progressive_cnt = 0;
+ this->reset = VO_NEW_SEQUENCE_FLAG;
+}
+
+/*
+ * The decoder should forget any stored pts values here.
+ */
+static void vdpau_h264_discontinuity (video_decoder_t *this_gen) {
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen;
+
+ dpb_clear_all_pts(this->nal_parser->dpb);
+ this->reset = VO_NEW_SEQUENCE_FLAG;
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void vdpau_h264_dispose (video_decoder_t *this_gen) {
+
+ vdpau_h264_decoder_t *this = (vdpau_h264_decoder_t *) this_gen;
+
+ if (this->incomplete_pic) {
+ release_decoded_picture(this->incomplete_pic);
+ this->incomplete_pic = NULL;
+ }
+
+ if (this->dangling_img) {
+ this->dangling_img->free(this->dangling_img);
+ this->dangling_img = NULL;
+ }
+
+ dpb_free_all(this->nal_parser->dpb);
+
+ if (this->decoder != VDP_INVALID_HANDLE) {
+ this->vdpau_accel->vdp_decoder_destroy( this->decoder );
+ this->decoder = VDP_INVALID_HANDLE;
+ }
+
+ this->stream->video_out->close( this->stream->video_out, this->stream );
+
+ free_parser (this->nal_parser);
+ free (this_gen);
+}
+
+/*
+ * This function allocates, initializes, and returns a private video
+ * decoder structure.
+ */
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ vdpau_h264_decoder_t *this ;
+
+ /* the videoout must be vdpau-capable to support this decoder */
+ if ( !(stream->video_driver->get_capabilities(stream->video_driver) & VO_CAP_VDPAU_H264) )
+ return NULL;
+
+ /* now check if vdpau has free decoder resource */
+ vo_frame_t *img = stream->video_out->get_frame( stream->video_out, 1920, 1080, 1, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS );
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ int runtime_nr = accel->vdp_runtime_nr;
+ img->free(img);
+ VdpDecoder decoder;
+ VdpStatus st = accel->vdp_decoder_create( accel->vdp_device, VDP_DECODER_PROFILE_H264_MAIN, 1920, 1080, 16, &decoder );
+ if ( st!=VDP_STATUS_OK ) {
+ lprintf( "can't create vdpau decoder.\n" );
+ return NULL;
+ }
+
+ accel->vdp_decoder_destroy( decoder );
+
+ this = (vdpau_h264_decoder_t *) calloc(1, sizeof(vdpau_h264_decoder_t));
+
+ this->nal_parser = init_parser(stream->xine);
+
+ this->video_decoder.decode_data = vdpau_h264_decode_data;
+ this->video_decoder.flush = vdpau_h264_flush;
+ this->video_decoder.reset = vdpau_h264_reset;
+ this->video_decoder.discontinuity = vdpau_h264_discontinuity;
+ this->video_decoder.dispose = vdpau_h264_dispose;
+
+ this->stream = stream;
+ this->xine = stream->xine;
+ this->class = (vdpau_h264_class_t *) class_gen;
+
+ this->decoder = VDP_INVALID_HANDLE;
+ this->vdp_runtime_nr = runtime_nr;
+ this->color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+ this->progressive_cnt = 0;
+
+ this->reset = VO_NEW_SEQUENCE_FLAG;
+
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+
+ return &this->video_decoder;
+}
+
+/*
+ * This function allocates a private video decoder class and initializes
+ * the class's member functions.
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ vdpau_h264_class_t *this;
+
+ this = (vdpau_h264_class_t *) calloc(1, sizeof(vdpau_h264_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "vdpau_h264";
+ this->decoder_class.description =
+ N_("vdpau_h264: h264 decoder plugin using VDPAU hardware decoding.\n"
+ "Must be used along with video_out_vdpau.");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
+ /* BUF_VIDEO_FOOVIDEO, */
+ BUF_VIDEO_H264,
+ 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_video = {
+ video_types, /* supported types */
+ 7 /* 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, "name", version, special_info, init_function } */
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 19, "vdpau_h264", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/libvdpau/vdpau_mpeg12.c b/src/video_dec/libvdpau/vdpau_mpeg12.c
new file mode 100644
index 000000000..1067f8634
--- /dev/null
+++ b/src/video_dec/libvdpau/vdpau_mpeg12.c
@@ -0,0 +1,1101 @@
+/*
+ * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
+ * Copyright (C) 2008 the xine project
+ * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
+ *
+ * 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, USA
+ *
+ * vdpau_mpeg12.c, a mpeg1/2 video stream parser using VDPAU hardware decoder
+ *
+ */
+
+/*#define LOG*/
+#define LOG_MODULE "vdpau_mpeg12"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "accel_vdpau.h"
+#include "bits_reader.h"
+
+#include <vdpau/vdpau.h>
+
+#define sequence_header_code 0xb3
+#define sequence_error_code 0xb4
+#define sequence_end_code 0xb7
+#define group_start_code 0xb8
+#define extension_start_code 0xb5
+#define user_data_start_code 0xb2
+#define picture_start_code 0x00
+#define begin_slice_start_code 0x01
+#define end_slice_start_code 0xaf
+
+#define sequence_ext_sc 1
+#define quant_matrix_ext_sc 3
+#define picture_coding_ext_sc 8
+#define sequence_display_ext_sc 2
+
+#define I_FRAME 1
+#define P_FRAME 2
+#define B_FRAME 3
+
+#define PICTURE_TOP 1
+#define PICTURE_BOTTOM 2
+#define PICTURE_FRAME 3
+
+/*#define MAKE_DAT*/ /*do NOT define this, unless you know what you do */
+#ifdef MAKE_DAT
+static int nframes;
+static FILE *outfile;
+#endif
+
+
+
+/* default intra quant matrix, in zig-zag order */
+static const uint8_t default_intra_quantizer_matrix[64] = {
+ 8,
+ 16, 16,
+ 19, 16, 19,
+ 22, 22, 22, 22,
+ 22, 22, 26, 24, 26,
+ 27, 27, 27, 26, 26, 26,
+ 26, 27, 27, 27, 29, 29, 29,
+ 34, 34, 34, 29, 29, 29, 27, 27,
+ 29, 29, 32, 32, 34, 34, 37,
+ 38, 37, 35, 35, 34, 35,
+ 38, 38, 40, 40, 40,
+ 48, 48, 46, 46,
+ 56, 56, 58,
+ 69, 69,
+ 83
+};
+
+uint8_t mpeg2_scan_norm[64] = {
+ /* Zig-Zag scan pattern */
+ 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
+};
+
+
+
+typedef struct {
+ VdpPictureInfoMPEG1Or2 vdp_infos; /* first field, also used for frame */
+ VdpPictureInfoMPEG1Or2 vdp_infos2; /* second field */
+ int slices_count, slices_count2;
+ uint8_t *slices;
+ int slices_size;
+ int slices_pos, slices_pos_top;
+
+ int progressive_frame;
+ int repeat_first_field;
+} picture_t;
+
+
+
+typedef struct {
+ uint32_t coded_width;
+ uint32_t coded_height;
+
+ double video_step; /* frame duration in pts units */
+ double reported_video_step; /* frame duration in pts units */
+ double ratio;
+
+ VdpDecoderProfile profile;
+ int horizontal_size_value;
+ int vertical_size_value;
+ int aspect_ratio_information;
+ int frame_rate_code;
+ int progressive_sequence;
+ int chroma;
+ int horizontal_size_extension;
+ int vertical_size_extension;
+ int frame_rate_extension_n;
+ int frame_rate_extension_d;
+ int display_horizontal_size;
+ int display_vertical_size;
+ int top_field_first;
+
+ int have_header;
+ int have_display_extension;
+
+ uint8_t *buf; /* accumulate data */
+ int bufseek;
+ uint32_t bufsize;
+ uint32_t bufpos;
+ int start;
+
+ picture_t picture;
+ vo_frame_t *forward_ref;
+ vo_frame_t *backward_ref;
+
+ int64_t cur_pts, seq_pts;
+
+ vdpau_accel_t *accel_vdpau;
+
+ bits_reader_t br;
+
+ int vdp_runtime_nr;
+ int reset;
+
+} sequence_t;
+
+
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} vdpau_mpeg12_class_t;
+
+
+
+typedef struct vdpau_mpeg12_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ vdpau_mpeg12_class_t *class;
+ xine_stream_t *stream;
+
+ sequence_t sequence;
+
+ VdpDecoder decoder;
+ VdpDecoderProfile decoder_profile;
+ uint32_t decoder_width;
+ uint32_t decoder_height;
+
+} vdpau_mpeg12_decoder_t;
+
+
+static void picture_ready( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence );
+
+
+
+static void reset_picture( picture_t *pic )
+{
+ lprintf( "reset_picture\n" );
+ pic->vdp_infos.picture_structure = pic->vdp_infos2.picture_structure = 0;
+ pic->vdp_infos2.intra_dc_precision = pic->vdp_infos.intra_dc_precision = 0;
+ pic->vdp_infos2.frame_pred_frame_dct = pic->vdp_infos.frame_pred_frame_dct = 1;
+ pic->vdp_infos2.concealment_motion_vectors = pic->vdp_infos.concealment_motion_vectors = 0;
+ pic->vdp_infos2.intra_vlc_format = pic->vdp_infos.intra_vlc_format = 0;
+ pic->vdp_infos2.alternate_scan = pic->vdp_infos.alternate_scan = 0;
+ pic->vdp_infos2.q_scale_type = pic->vdp_infos.q_scale_type = 0;
+ pic->vdp_infos2.top_field_first = pic->vdp_infos.top_field_first = 1;
+ pic->slices_count = 0;
+ pic->slices_count2 = 0;
+ pic->slices_pos = 0;
+ pic->slices_pos_top = 0;
+ pic->progressive_frame = 0;
+ pic->repeat_first_field = 0;
+}
+
+
+
+static void init_picture( picture_t *pic )
+{
+ pic->slices_size = 2048;
+ pic->slices = (uint8_t*)malloc(pic->slices_size);
+ reset_picture( pic );
+}
+
+
+
+static void reset_sequence( sequence_t *sequence, int free_refs )
+{
+ sequence->cur_pts = sequence->seq_pts = 0;
+ if ( sequence->forward_ref )
+ sequence->forward_ref->pts = 0;
+ if ( sequence->backward_ref )
+ sequence->backward_ref->pts = 0;
+
+ if ( !free_refs )
+ return;
+
+ sequence->bufpos = 0;
+ sequence->bufseek = 0;
+ sequence->start = -1;
+ if ( sequence->forward_ref )
+ sequence->forward_ref->free( sequence->forward_ref );
+ sequence->forward_ref = NULL;
+ if ( sequence->backward_ref )
+ sequence->backward_ref->free( sequence->backward_ref );
+ sequence->backward_ref = NULL;
+ sequence->top_field_first = 0;
+ sequence->reset = VO_NEW_SEQUENCE_FLAG;
+}
+
+
+
+static void free_sequence( sequence_t *sequence )
+{
+ lprintf( "init_sequence\n" );
+ sequence->have_header = 0;
+ sequence->profile = VDP_DECODER_PROFILE_MPEG1;
+ sequence->chroma = 0;
+ sequence->video_step = 3600;
+ reset_sequence( sequence, 1 );
+}
+
+
+
+static void sequence_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ int i, j;
+
+ if ( !sequence->have_header )
+ sequence->have_header = 1;
+
+ sequence->profile = VDP_DECODER_PROFILE_MPEG1;
+ sequence->horizontal_size_extension = 0;
+ sequence->vertical_size_extension = 0;
+ sequence->have_display_extension = 0;
+
+ bits_reader_set( &sequence->br, buf, len );
+ sequence->horizontal_size_value = read_bits( &sequence->br, 12 );
+ lprintf( "horizontal_size_value: %d\n", sequence->horizontal_size_value );
+ sequence->vertical_size_value = read_bits( &sequence->br, 12 );
+ lprintf( "vertical_size_value: %d\n", sequence->vertical_size_value );
+ sequence->aspect_ratio_information = read_bits( &sequence->br, 4 );
+ lprintf( "aspect_ratio_information: %d\n", sequence->aspect_ratio_information );
+ sequence->frame_rate_code = read_bits( &sequence->br, 4 );
+ lprintf( "frame_rate_code: %d\n", sequence->frame_rate_code );
+ int tmp;
+ tmp = read_bits( &sequence->br, 18 );
+ lprintf( "bit_rate_value: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 1 );
+ lprintf( "marker_bit: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 10 );
+ lprintf( "vbv_buffer_size_value: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 1 );
+ lprintf( "constrained_parameters_flag: %d\n", tmp );
+ i = read_bits( &sequence->br, 1 );
+ lprintf( "load_intra_quantizer_matrix: %d\n", i );
+ if ( i ) {
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos2.intra_quantizer_matrix[mpeg2_scan_norm[j]] = sequence->picture.vdp_infos.intra_quantizer_matrix[mpeg2_scan_norm[j]] = read_bits( &sequence->br, 8 );
+ }
+ }
+ else {
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos2.intra_quantizer_matrix[mpeg2_scan_norm[j]] = sequence->picture.vdp_infos.intra_quantizer_matrix[mpeg2_scan_norm[j]] = default_intra_quantizer_matrix[j];
+ }
+ }
+
+ i = read_bits( &sequence->br, 1 );
+ lprintf( "load_non_intra_quantizer_matrix: %d\n", i );
+ if ( i ) {
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos2.non_intra_quantizer_matrix[mpeg2_scan_norm[j]] = sequence->picture.vdp_infos.non_intra_quantizer_matrix[mpeg2_scan_norm[j]] = read_bits( &sequence->br, 8 );
+ }
+ }
+ else {
+ memset( sequence->picture.vdp_infos.non_intra_quantizer_matrix, 16, 64 );
+ memset( sequence->picture.vdp_infos2.non_intra_quantizer_matrix, 16, 64 );
+ }
+}
+
+
+
+static void process_sequence_mpeg12_dependent_data( vdpau_mpeg12_decoder_t *this_gen )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ int frame_rate_value_n, frame_rate_value_d;
+
+ sequence->coded_width = sequence->horizontal_size_value | (sequence->horizontal_size_extension << 14);
+ sequence->coded_height = sequence->vertical_size_value | (sequence->vertical_size_extension << 14);
+
+ switch ( sequence->frame_rate_code ) {
+ case 1: frame_rate_value_n = 24; frame_rate_value_d = 1001; break; /* 23.976.. */
+ case 2: frame_rate_value_n = 24; frame_rate_value_d = 1000; break; /* 24 */
+ case 3: frame_rate_value_n = 25; frame_rate_value_d = 1000; break; /* 25 */
+ case 4: frame_rate_value_n = 30; frame_rate_value_d = 1001; break; /* 29.97.. */
+ case 5: frame_rate_value_n = 30; frame_rate_value_d = 1000; break; /* 30 */
+ case 6: frame_rate_value_n = 50; frame_rate_value_d = 1000; break; /* 50 */
+ case 7: frame_rate_value_n = 60; frame_rate_value_d = 1001; break; /* 59.94.. */
+ case 8: frame_rate_value_n = 60; frame_rate_value_d = 1000; break; /* 60 */
+ default: frame_rate_value_n = 50; frame_rate_value_d = 1000; /* assume 50 */
+ }
+
+ sequence->video_step = 90.0 * (frame_rate_value_d * (sequence->frame_rate_extension_d + 1))
+ / (frame_rate_value_n * (sequence->frame_rate_extension_n + 1));
+
+ if ( sequence->profile==VDP_DECODER_PROFILE_MPEG1 ) {
+ double pel_aspect_ratio; /* height / width */
+
+ switch ( sequence->aspect_ratio_information ) {
+ case 1: pel_aspect_ratio = 1.0000;
+ case 2: pel_aspect_ratio = 0.6735;
+ case 3: pel_aspect_ratio = 0.7031;
+ case 4: pel_aspect_ratio = 0.7615;
+ case 5: pel_aspect_ratio = 0.8055;
+ case 6: pel_aspect_ratio = 0.8437;
+ case 7: pel_aspect_ratio = 0.8935;
+ case 8: pel_aspect_ratio = 0.9157;
+ case 9: pel_aspect_ratio = 0.9815;
+ case 10: pel_aspect_ratio = 1.0255;
+ case 11: pel_aspect_ratio = 1.0695;
+ case 12: pel_aspect_ratio = 1.0950;
+ case 13: pel_aspect_ratio = 1.1575;
+ case 14: pel_aspect_ratio = 1.2015;
+ default: pel_aspect_ratio = 1.0000; /* fallback */
+ }
+
+ sequence->ratio = ((double)sequence->coded_width/(double)sequence->coded_height)/pel_aspect_ratio;
+ }
+ else {
+ switch ( sequence->aspect_ratio_information ) {
+ case 1: sequence->ratio = sequence->have_display_extension
+ ? ((double)sequence->display_horizontal_size/(double)sequence->display_vertical_size)/1.0
+ : ((double)sequence->coded_width/(double)sequence->coded_height)/1.0;
+ break;
+ case 2: sequence->ratio = 4.0/3.0; break;
+ case 3: sequence->ratio = 16.0/9.0; break;
+ case 4: sequence->ratio = 2.21; break;
+ default: sequence->ratio = ((double)sequence->coded_width/(double)sequence->coded_height)/1.0;
+ }
+ }
+
+ if ( sequence->have_header == 1 ) {
+ sequence->have_header = 2;
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_WIDTH, sequence->coded_width );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, sequence->coded_height );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*sequence->ratio) );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, (sequence->reported_video_step = sequence->video_step) );
+ _x_meta_info_set_utf8( this_gen->stream, XINE_META_INFO_VIDEOCODEC, "MPEG1/2 (vdpau)" );
+ xine_event_t event;
+ xine_format_change_data_t data;
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = this_gen->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = sequence->coded_width;
+ data.height = sequence->coded_height;
+ data.aspect = sequence->ratio;
+ xine_event_send( this_gen->stream, &event );
+ }
+ else if ( sequence->have_header == 2 && sequence->reported_video_step != sequence->video_step ) {
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, (sequence->reported_video_step = sequence->video_step) );
+ }
+}
+
+
+
+static void picture_header( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ process_sequence_mpeg12_dependent_data(this_gen);
+
+ if ( sequence->profile==VDP_DECODER_PROFILE_MPEG1 )
+ sequence->picture.vdp_infos.picture_structure = PICTURE_FRAME;
+
+ VdpPictureInfoMPEG1Or2 *infos = &sequence->picture.vdp_infos;
+
+ if ( sequence->picture.vdp_infos.picture_structure==PICTURE_FRAME ) {
+ picture_ready( this_gen, 0 );
+ reset_picture( &sequence->picture );
+ }
+ else if ( sequence->picture.vdp_infos.picture_structure && sequence->picture.vdp_infos2.picture_structure ) {
+ picture_ready( this_gen, 0 );
+ reset_picture( &sequence->picture );
+ }
+ else if ( sequence->picture.vdp_infos.picture_structure ) {
+ infos = &sequence->picture.vdp_infos2;
+ sequence->picture.slices_pos_top = sequence->picture.slices_pos;
+
+ sequence->cur_pts = 0; /* ignore pts of second field */
+ }
+
+ /* take over pts for next issued image */
+ if ( sequence->cur_pts ) {
+ sequence->seq_pts = sequence->cur_pts;
+ sequence->cur_pts = 0;
+ }
+
+ bits_reader_set( &sequence->br, buf, len );
+ int tmp = read_bits( &sequence->br, 10 );
+ lprintf( "temporal_reference: %d\n", tmp );
+ infos->picture_coding_type = read_bits( &sequence->br, 3 );
+ lprintf( "picture_coding_type: %d\n", infos->picture_coding_type );
+ infos->forward_reference = VDP_INVALID_HANDLE;
+ infos->backward_reference = VDP_INVALID_HANDLE;
+ skip_bits( &sequence->br, 16 );
+ if ( infos->picture_coding_type > I_FRAME ) {
+ infos->full_pel_forward_vector = read_bits( &sequence->br, 1 );
+ infos->f_code[0][0] = infos->f_code[0][1] = read_bits( &sequence->br, 3 );
+ if ( infos->picture_coding_type==B_FRAME ) {
+ infos->full_pel_backward_vector = read_bits( &sequence->br, 1 );
+ infos->f_code[1][0] = infos->f_code[1][1] = read_bits( &sequence->br, 3 );
+ }
+ }
+ else {
+ infos->full_pel_forward_vector = 0;
+ infos->full_pel_backward_vector = 0;
+ }
+}
+
+
+
+static void sequence_extension( sequence_t *sequence, uint8_t *buf, int len )
+{
+ bits_reader_set( &sequence->br, buf, len );
+ int tmp = read_bits( &sequence->br, 4 );
+ lprintf( "extension_start_code_identifier: %d\n", tmp );
+ skip_bits( &sequence->br, 1 );
+ switch ( read_bits( &sequence->br, 3 ) ) {
+ case 5: sequence->profile = VDP_DECODER_PROFILE_MPEG2_SIMPLE; break;
+ default: sequence->profile = VDP_DECODER_PROFILE_MPEG2_MAIN;
+ }
+ skip_bits( &sequence->br, 4 );
+ sequence->progressive_sequence = read_bits( &sequence->br, 1 );
+ lprintf( "progressive_sequence: %d\n", sequence->progressive_sequence );
+ if ( read_bits( &sequence->br, 2 ) == 2 )
+ sequence->chroma = VO_CHROMA_422;
+ tmp = read_bits( &sequence->br, 2 );
+ lprintf( "horizontal_size_extension: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 2 );
+ lprintf( "vertical_size_extension: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 12 );
+ lprintf( "bit_rate_extension: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 1 );
+ lprintf( "marker_bit: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 8 );
+ lprintf( "vbv_buffer_size_extension: %d\n", tmp );
+ tmp = read_bits( &sequence->br, 1 );
+ lprintf( "low_delay: %d\n", tmp );
+ sequence->frame_rate_extension_n = read_bits( &sequence->br, 2 );
+ lprintf( "frame_rate_extension_n: %d\n", sequence->frame_rate_extension_n );
+ sequence->frame_rate_extension_d = read_bits( &sequence->br, 5 );
+ lprintf( "frame_rate_extension_d: %d\n", sequence->frame_rate_extension_d );
+}
+
+
+
+static void picture_coding_extension( sequence_t *sequence, uint8_t *buf, int len )
+{
+ VdpPictureInfoMPEG1Or2 *infos = &sequence->picture.vdp_infos;
+ if ( infos->picture_structure && infos->picture_structure!=PICTURE_FRAME )
+ infos = &sequence->picture.vdp_infos2;
+
+ bits_reader_set( &sequence->br, buf, len );
+ int tmp = read_bits( &sequence->br, 4 );
+ lprintf( "extension_start_code_identifier: %d\n", tmp );
+ infos->f_code[0][0] = read_bits( &sequence->br, 4 );
+ infos->f_code[0][1] = read_bits( &sequence->br, 4 );
+ infos->f_code[1][0] = read_bits( &sequence->br, 4 );
+ infos->f_code[1][1] = read_bits( &sequence->br, 4 );
+ lprintf( "f_code_0_0: %d\n", infos->f_code[0][0] );
+ lprintf( "f_code_0_1: %d\n", infos->f_code[0][1] );
+ lprintf( "f_code_1_0: %d\n", infos->f_code[1][0] );
+ lprintf( "f_code_1_1: %d\n", infos->f_code[1][1] );
+ infos->intra_dc_precision = read_bits( &sequence->br, 2 );
+ lprintf( "intra_dc_precision: %d\n", infos->intra_dc_precision );
+ infos->picture_structure = read_bits( &sequence->br, 2 );
+ lprintf( "picture_structure: %d\n", infos->picture_structure );
+ infos->top_field_first = read_bits( &sequence->br, 1 );
+ lprintf( "top_field_first: %d\n", infos->top_field_first );
+ infos->frame_pred_frame_dct = read_bits( &sequence->br, 1 );
+ lprintf( "frame_pred_frame_dct: %d\n", infos->frame_pred_frame_dct );
+ infos->concealment_motion_vectors = read_bits( &sequence->br, 1 );
+ lprintf( "concealment_motion_vectors: %d\n", infos->concealment_motion_vectors );
+ infos->q_scale_type = read_bits( &sequence->br, 1 );
+ lprintf( "q_scale_type: %d\n", infos->q_scale_type );
+ infos->intra_vlc_format = read_bits( &sequence->br, 1 );
+ lprintf( "intra_vlc_format: %d\n", infos->intra_vlc_format );
+ infos->alternate_scan = read_bits( &sequence->br, 1 );
+ lprintf( "alternate_scan: %d\n", infos->alternate_scan );
+ sequence->picture.repeat_first_field = read_bits( &sequence->br, 1 );
+ lprintf( "repeat_first_field: %d\n", sequence->picture.repeat_first_field );
+ tmp = read_bits( &sequence->br, 1 );
+ lprintf( "chroma_420_type: %d\n", tmp );
+ sequence->picture.progressive_frame = read_bits( &sequence->br, 1 );
+ lprintf( "progressive_frame: %d\n", sequence->picture.progressive_frame );
+}
+
+
+
+static void quant_matrix_extension( sequence_t *sequence, uint8_t *buf, int len )
+{
+ int i, j;
+
+ bits_reader_set( &sequence->br, buf, len );
+ skip_bits( &sequence->br, 4 );
+ i = read_bits( &sequence->br, 1 );
+ lprintf( "load_intra_quantizer_matrix: %d\n", i );
+ if ( i ) {
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos2.intra_quantizer_matrix[mpeg2_scan_norm[j]] = sequence->picture.vdp_infos.intra_quantizer_matrix[mpeg2_scan_norm[j]] = read_bits( &sequence->br, 8 );
+ }
+ }
+ else {
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos2.intra_quantizer_matrix[mpeg2_scan_norm[j]] = sequence->picture.vdp_infos.intra_quantizer_matrix[mpeg2_scan_norm[j]] = default_intra_quantizer_matrix[j];
+ }
+ }
+
+ i = read_bits( &sequence->br, 1 );
+ lprintf( "load_non_intra_quantizer_matrix: %d\n", i );
+ if ( i ) {
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos2.non_intra_quantizer_matrix[mpeg2_scan_norm[j]] = sequence->picture.vdp_infos.non_intra_quantizer_matrix[mpeg2_scan_norm[j]] = read_bits( &sequence->br, 8 );
+ }
+ }
+ else {
+ memset( sequence->picture.vdp_infos.non_intra_quantizer_matrix, 16, 64 );
+ memset( sequence->picture.vdp_infos2.non_intra_quantizer_matrix, 16, 64 );
+ }
+}
+
+
+
+static void copy_slice( sequence_t *sequence, uint8_t *buf, int len )
+{
+ int size = sequence->picture.slices_pos+len;
+ if ( sequence->picture.slices_size < size ) {
+ sequence->picture.slices_size = size+1024;
+ sequence->picture.slices = realloc( sequence->picture.slices, sequence->picture.slices_size );
+ }
+ xine_fast_memcpy( sequence->picture.slices+sequence->picture.slices_pos, buf, len );
+ sequence->picture.slices_pos += len;
+ if ( sequence->picture.slices_pos_top )
+ sequence->picture.slices_count2++;
+ else
+ sequence->picture.slices_count++;
+}
+
+
+
+static int parse_code( vdpau_mpeg12_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ if ( !sequence->have_header && buf[3]!=sequence_header_code ) {
+ lprintf( " ----------- no sequence header yet.\n" );
+ return 0;
+ }
+
+ if ( (buf[3] >= begin_slice_start_code) && (buf[3] <= end_slice_start_code) ) {
+ lprintf( " ----------- slice_start_code\n" );
+ copy_slice( sequence, buf, len );
+ return 0;
+ }
+
+ switch ( buf[3] ) {
+ case sequence_header_code:
+ lprintf( " ----------- sequence_header_code\n" );
+ sequence_header( this_gen, buf+4, len-4 );
+ break;
+ case extension_start_code: {
+ switch ( buf[4]>>4 ) {
+ case sequence_ext_sc:
+ lprintf( " ----------- sequence_extension_start_code\n" );
+ sequence_extension( sequence, buf+4, len-4 );
+ break;
+ case quant_matrix_ext_sc:
+ lprintf( " ----------- quant_matrix_extension_start_code\n" );
+ quant_matrix_extension( sequence, buf+4, len-4 );
+ break;
+ case picture_coding_ext_sc:
+ lprintf( " ----------- picture_coding_extension_start_code\n" );
+ picture_coding_extension( sequence, buf+4, len-4 );
+ break;
+ case sequence_display_ext_sc:
+ lprintf( " ----------- sequence_display_extension_start_code\n" );
+ break;
+ }
+ break;
+ }
+ case user_data_start_code:
+ lprintf( " ----------- user_data_start_code\n" );
+ break;
+ case group_start_code:
+ lprintf( " ----------- group_start_code\n" );
+ break;
+ case picture_start_code:
+ lprintf( " ----------- picture_start_code\n" );
+ picture_header( this_gen, buf+4, len-4 );
+ break;
+ case sequence_error_code:
+ lprintf( " ----------- sequence_error_code\n" );
+ break;
+ case sequence_end_code:
+ lprintf( " ----------- sequence_end_code\n" );
+ break;
+ }
+ return 0;
+}
+
+
+
+static void decode_render( vdpau_mpeg12_decoder_t *vd, vdpau_accel_t *accel )
+{
+ sequence_t *seq = (sequence_t*)&vd->sequence;
+ picture_t *pic = (picture_t*)&seq->picture;
+
+ pic->vdp_infos.slice_count = pic->slices_count;
+ pic->vdp_infos2.slice_count = pic->slices_count2;
+
+ VdpStatus st;
+ if ( vd->decoder==VDP_INVALID_HANDLE || vd->decoder_profile!=seq->profile || vd->decoder_width!=seq->coded_width || vd->decoder_height!=seq->coded_height ) {
+ if ( vd->decoder!=VDP_INVALID_HANDLE ) {
+ accel->vdp_decoder_destroy( vd->decoder );
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+ st = accel->vdp_decoder_create( accel->vdp_device, seq->profile, seq->coded_width, seq->coded_height, 2, &vd->decoder);
+ if ( st!=VDP_STATUS_OK )
+ lprintf( "failed to create decoder !! %s\n", accel->vdp_get_error_string( st ) );
+ else {
+ vd->decoder_profile = seq->profile;
+ vd->decoder_width = seq->coded_width;
+ vd->decoder_height = seq->coded_height;
+ seq->vdp_runtime_nr = accel->vdp_runtime_nr;
+ }
+ }
+
+ VdpBitstreamBuffer vbit;
+ vbit.struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ vbit.bitstream = pic->slices;
+ vbit.bitstream_bytes = (pic->vdp_infos.picture_structure==PICTURE_FRAME)? pic->slices_pos : pic->slices_pos_top;
+ st = accel->vdp_decoder_render( vd->decoder, accel->surface, (VdpPictureInfo*)&pic->vdp_infos, 1, &vbit );
+ if ( st!=VDP_STATUS_OK )
+ lprintf( "decoder failed : %d!! %s\n", st, accel->vdp_get_error_string( st ) );
+ else {
+ lprintf( "DECODER SUCCESS : frame_type:%d, slices=%d, slices_bytes=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n",
+ pic->vdp_infos.picture_coding_type, pic->vdp_infos.slice_count, vbit.bitstream_bytes, accel->surface, pic->vdp_infos.forward_reference, pic->vdp_infos.backward_reference, seq->cur_pts );
+ VdpPictureInfoMPEG1Or2 *info = &pic->vdp_infos;
+ lprintf("%d %d %d %d %d %d %d %d %d %d %d %d %d\n", info->intra_dc_precision, info->frame_pred_frame_dct, info->concealment_motion_vectors,
+ info->intra_vlc_format, info->alternate_scan, info->q_scale_type, info->top_field_first, info->full_pel_forward_vector,
+ info->full_pel_backward_vector, info->f_code[0][0], info->f_code[0][1], info->f_code[1][0], info->f_code[1][1] );
+ }
+
+ if ( pic->vdp_infos.picture_structure != PICTURE_FRAME ) {
+ pic->vdp_infos2.backward_reference = VDP_INVALID_HANDLE;
+ pic->vdp_infos2.forward_reference = VDP_INVALID_HANDLE;
+ if ( pic->vdp_infos2.picture_coding_type==P_FRAME ) {
+ if ( pic->vdp_infos.picture_coding_type==I_FRAME )
+ pic->vdp_infos2.forward_reference = accel->surface;
+ else
+ pic->vdp_infos2.forward_reference = pic->vdp_infos.forward_reference;
+ }
+ else if ( pic->vdp_infos.picture_coding_type==B_FRAME ) {
+ pic->vdp_infos2.forward_reference = pic->vdp_infos.forward_reference;
+ pic->vdp_infos2.backward_reference = pic->vdp_infos.backward_reference;
+ }
+ vbit.struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ vbit.bitstream = pic->slices+pic->slices_pos_top;
+ vbit.bitstream_bytes = pic->slices_pos-pic->slices_pos_top;
+ st = accel->vdp_decoder_render( vd->decoder, accel->surface, (VdpPictureInfo*)&pic->vdp_infos2, 1, &vbit );
+ if ( st!=VDP_STATUS_OK )
+ lprintf( "decoder failed : %d!! %s\n", st, accel->vdp_get_error_string( st ) );
+ else
+ lprintf( "DECODER SUCCESS : frame_type:%d, slices=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n",
+ pic->vdp_infos2.picture_coding_type, pic->vdp_infos2.slice_count, accel->surface, pic->vdp_infos2.forward_reference, pic->vdp_infos2.backward_reference, seq->cur_pts );
+ }
+}
+
+
+
+static void decode_picture( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence )
+{
+ sequence_t *seq = (sequence_t*)&vd->sequence;
+ picture_t *pic = (picture_t*)&seq->picture;
+ vdpau_accel_t *ref_accel;
+
+ if ( seq->profile == VDP_DECODER_PROFILE_MPEG1 )
+ pic->vdp_infos.picture_structure=PICTURE_FRAME;
+
+ if ( pic->vdp_infos.picture_coding_type==P_FRAME ) {
+ if ( seq->backward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->backward_ref->accel_data;
+ pic->vdp_infos.forward_reference = ref_accel->surface;
+ }
+ else
+ return;
+ }
+ else if ( pic->vdp_infos.picture_coding_type==B_FRAME ) {
+ if ( seq->forward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->forward_ref->accel_data;
+ pic->vdp_infos.forward_reference = ref_accel->surface;
+ }
+ else
+ return;
+ if ( seq->backward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->backward_ref->accel_data;
+ pic->vdp_infos.backward_reference = ref_accel->surface;
+ }
+ else
+ return;
+ }
+
+ int still_image = (end_of_sequence) ? VO_STILL_IMAGE : 0;
+ vo_frame_t *img = vd->stream->video_out->get_frame( vd->stream->video_out, seq->coded_width, seq->coded_height,
+ seq->ratio, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS | seq->chroma | seq->reset | still_image );
+ seq->reset = 0;
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ if ( !seq->accel_vdpau )
+ seq->accel_vdpau = accel;
+
+ if( seq->vdp_runtime_nr != *(seq->accel_vdpau->current_vdp_runtime_nr) ) {
+ seq->accel_vdpau = accel;
+ if ( seq->forward_ref )
+ seq->forward_ref->free( seq->forward_ref );
+ seq->forward_ref = NULL;
+ if ( seq->backward_ref )
+ seq->backward_ref->free( seq->backward_ref );
+ seq->backward_ref = NULL;
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+
+ decode_render( vd, accel );
+
+#ifdef MAKE_DAT
+ if ( nframes==0 ) {
+ fwrite( &seq->coded_width, 1, sizeof(seq->coded_width), outfile );
+ fwrite( &seq->coded_height, 1, sizeof(seq->coded_height), outfile );
+ fwrite( &seq->ratio, 1, sizeof(seq->ratio), outfile );
+ fwrite( &seq->profile, 1, sizeof(seq->profile), outfile );
+ }
+
+ if ( nframes++ < 25 ) {
+ fwrite( &pic->vdp_infos, 1, sizeof(pic->vdp_infos), outfile );
+ fwrite( &pic->slices_pos, 1, sizeof(pic->slices_pos), outfile );
+ fwrite( pic->slices, 1, pic->slices_pos, outfile );
+ }
+#endif
+
+ img->drawn = 0;
+ img->pts = seq->seq_pts;
+ seq->seq_pts = 0; /* reset */
+ img->bad_frame = 0;
+
+ if ( end_of_sequence ) {
+ if ( seq->backward_ref )
+ seq->backward_ref->free( seq->backward_ref );
+ seq->backward_ref = NULL;
+ }
+
+#if 0
+ /* trying to deal with (french) buggy streams that randomly set bottom_field_first
+ while stream is top_field_first. So we assume that when top_field_first
+ is set one time, the stream _is_ top_field_first. */
+ lprintf("pic->vdp_infos.top_field_first = %d\n", pic->vdp_infos.top_field_first);
+ if ( pic->vdp_infos.top_field_first )
+ seq->top_field_first = 1;
+ img->top_field_first = seq->top_field_first;
+#else
+ img->top_field_first = pic->vdp_infos.top_field_first;
+#endif
+
+ /* progressive_frame is unreliable with most mpeg2 streams */
+ if ( pic->vdp_infos.picture_structure!=PICTURE_FRAME )
+ img->progressive_frame = 0;
+ else
+ img->progressive_frame = pic->progressive_frame;
+
+ img->repeat_first_field = pic->repeat_first_field;
+
+ double duration = seq->video_step;
+
+ if ( img->repeat_first_field ) {
+ if( !seq->progressive_sequence && pic->progressive_frame ) {
+ /* decoder should output 3 fields, so adjust duration to
+ count on this extra field time */
+ duration *= 3;
+ duration /= 2;
+ } else if ( seq->progressive_sequence ) {
+ /* for progressive sequences the output should repeat the
+ frame 1 or 2 times depending on top_field_first flag. */
+ duration *= (pic->vdp_infos.top_field_first ? 3 : 2);
+ }
+ }
+
+ img->duration = (int)(duration + .5);
+
+ if ( pic->vdp_infos.picture_coding_type!=B_FRAME ) {
+ if ( pic->vdp_infos.picture_coding_type==I_FRAME && !seq->backward_ref ) {
+ img->pts = 0;
+ img->draw( img, vd->stream );
+ ++img->drawn;
+ }
+ if ( seq->forward_ref ) {
+ seq->forward_ref->drawn = 0;
+ seq->forward_ref->free( seq->forward_ref );
+ }
+ seq->forward_ref = seq->backward_ref;
+ if ( seq->forward_ref && !seq->forward_ref->drawn ) {
+ seq->forward_ref->draw( seq->forward_ref, vd->stream );
+ }
+ seq->backward_ref = img;
+ }
+ else {
+ img->draw( img, vd->stream );
+ img->free( img );
+ }
+}
+
+
+
+static void picture_ready( vdpau_mpeg12_decoder_t *vd, uint8_t end_of_sequence )
+{
+ picture_t *pic = (picture_t*)&vd->sequence.picture;
+ if ( !pic->slices_count )
+ return;
+ if ( pic->vdp_infos2.picture_structure && !pic->slices_count2 )
+ return;
+ decode_picture( vd, end_of_sequence );
+}
+
+
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void vdpau_mpeg12_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
+{
+ vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen;
+ sequence_t *seq = (sequence_t*)&this->sequence;
+
+ /* preview buffers shall not be decoded and drawn -- use them only to supply stream information */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if ( !buf->size )
+ return;
+
+ if ( buf->pts )
+ seq->cur_pts = buf->pts;
+
+ int size = seq->bufpos+buf->size;
+ if ( seq->bufsize < size ) {
+ seq->bufsize = size+1024;
+ seq->buf = realloc( seq->buf, seq->bufsize );
+ }
+ xine_fast_memcpy( seq->buf+seq->bufpos, buf->content, buf->size );
+ seq->bufpos += buf->size;
+
+ while ( seq->bufseek <= seq->bufpos-4 ) {
+ uint8_t *buffer = seq->buf+seq->bufseek;
+ if ( buffer[0]==0 && buffer[1]==0 && buffer[2]==1 ) {
+ if ( seq->start<0 ) {
+ seq->start = seq->bufseek;
+ }
+ else {
+ parse_code( this, seq->buf+seq->start, seq->bufseek-seq->start );
+ uint8_t *tmp = (uint8_t*)malloc(seq->bufsize);
+ xine_fast_memcpy( tmp, seq->buf+seq->bufseek, seq->bufpos-seq->bufseek );
+ seq->bufpos -= seq->bufseek;
+ seq->start = -1;
+ seq->bufseek = -1;
+ free( seq->buf );
+ seq->buf = tmp;
+ }
+ }
+ ++seq->bufseek;
+ }
+
+ /* still image detection -- don't wait for further data if buffer ends in sequence end code */
+ if (seq->start >= 0 && seq->buf[seq->start + 3] == sequence_end_code) {
+ decode_picture(this, 1);
+ parse_code(this, seq->buf+seq->start, 4);
+ seq->start = -1;
+ }
+}
+
+/*
+ * This function is called when xine needs to flush the system.
+ */
+static void vdpau_mpeg12_flush (video_decoder_t *this_gen) {
+ vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg12_flush\n" );
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void vdpau_mpeg12_reset (video_decoder_t *this_gen) {
+ vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg12_reset\n" );
+ reset_sequence( &this->sequence, 1 );
+}
+
+/*
+ * The decoder should forget any stored pts values here.
+ */
+static void vdpau_mpeg12_discontinuity (video_decoder_t *this_gen) {
+ vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg12_discontinuity\n" );
+ reset_sequence( &this->sequence, 0 );
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void vdpau_mpeg12_dispose (video_decoder_t *this_gen) {
+
+ vdpau_mpeg12_decoder_t *this = (vdpau_mpeg12_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg12_dispose\n" );
+
+ if ( this->decoder!=VDP_INVALID_HANDLE && this->sequence.accel_vdpau ) {
+ this->sequence.accel_vdpau->vdp_decoder_destroy( this->decoder );
+ this->decoder = VDP_INVALID_HANDLE;
+ }
+
+ free_sequence( &this->sequence );
+
+ this->stream->video_out->close( this->stream->video_out, this->stream );
+
+ free( this->sequence.picture.slices );
+ free( this->sequence.buf );
+ free( this_gen );
+}
+
+/*
+ * This function allocates, initializes, and returns a private video
+ * decoder structure.
+ */
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ vdpau_mpeg12_decoder_t *this ;
+
+ lprintf( "open_plugin\n" );
+
+ /* the videoout must be vdpau-capable to support this decoder */
+ if ( !(stream->video_driver->get_capabilities(stream->video_driver) & VO_CAP_VDPAU_MPEG12) )
+ return NULL;
+
+ /* now check if vdpau has free decoder resource */
+ vo_frame_t *img = stream->video_out->get_frame( stream->video_out, 1920, 1080, 1, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS );
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ int runtime_nr = accel->vdp_runtime_nr;
+ img->free(img);
+ VdpDecoder decoder;
+ VdpStatus st = accel->vdp_decoder_create( accel->vdp_device, VDP_DECODER_PROFILE_MPEG2_MAIN, 1920, 1080, 2, &decoder );
+ if ( st!=VDP_STATUS_OK ) {
+ lprintf( "can't create vdpau decoder.\n" );
+ return NULL;
+ }
+
+ accel->vdp_decoder_destroy( decoder );
+
+ this = (vdpau_mpeg12_decoder_t *) calloc(1, sizeof(vdpau_mpeg12_decoder_t));
+
+ this->video_decoder.decode_data = vdpau_mpeg12_decode_data;
+ this->video_decoder.flush = vdpau_mpeg12_flush;
+ this->video_decoder.reset = vdpau_mpeg12_reset;
+ this->video_decoder.discontinuity = vdpau_mpeg12_discontinuity;
+ this->video_decoder.dispose = vdpau_mpeg12_dispose;
+
+ this->stream = stream;
+ this->class = (vdpau_mpeg12_class_t *) class_gen;
+
+ this->sequence.bufsize = 1024;
+ this->sequence.buf = (uint8_t*)malloc(this->sequence.bufsize);
+ this->sequence.forward_ref = 0;
+ this->sequence.backward_ref = 0;
+ this->sequence.vdp_runtime_nr = runtime_nr;
+ free_sequence( &this->sequence );
+ this->sequence.ratio = 1;
+ this->sequence.reset = VO_NEW_SEQUENCE_FLAG;
+
+ init_picture( &this->sequence.picture );
+
+ this->decoder = VDP_INVALID_HANDLE;
+ this->sequence.accel_vdpau = NULL;
+
+ (stream->video_out->open)(stream->video_out, stream);
+
+#ifdef MAKE_DAT
+ outfile = fopen( "/tmp/mpg.dat","w");
+ nframes = 0;
+#endif
+
+ return &this->video_decoder;
+}
+
+/*
+ * This function allocates a private video decoder class and initializes
+ * the class's member functions.
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ vdpau_mpeg12_class_t *this;
+
+ this = (vdpau_mpeg12_class_t *) calloc(1, sizeof(vdpau_mpeg12_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "vdpau_mpeg12";
+ this->decoder_class.description =
+ N_("vdpau_mpeg12: mpeg1/2 decoder plugin using VDPAU hardware decoding.\n"
+ "Must be used along with video_out_vdpau.");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
+ BUF_VIDEO_MPEG,
+ 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_video = {
+ video_types, /* supported types */
+ 8 /* 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, "name", version, special_info, init_function } */
+ { PLUGIN_VIDEO_DECODER, 19, "vdpau_mpeg12", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/libvdpau/vdpau_mpeg4.c b/src/video_dec/libvdpau/vdpau_mpeg4.c
new file mode 100644
index 000000000..4d7dee1ed
--- /dev/null
+++ b/src/video_dec/libvdpau/vdpau_mpeg4.c
@@ -0,0 +1,1194 @@
+/*
+ * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
+ *
+ * Copyright (C) 2010 the xine project
+ * Copyright (C) 2010 Christophe Thommeret <hftom@free.fr>
+ *
+ * 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, USA
+ *
+ * vdpau_mpeg4.c, a mpeg4-part-2 video stream parser using VDPAU hardware decoder
+ *
+ */
+
+/*#define LOG*/
+#define LOG_MODULE "vdpau_mpeg4"
+
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "accel_vdpau.h"
+#include "bits_reader.h"
+
+#include <vdpau/vdpau.h>
+
+#define begin_vo_start_code 0x00
+#define end_vo_start_code 0x1f
+#define begin_vol_start_code 0x20
+#define end_vol_start_code 0x2f
+#define viso_sequence_start_code 0xb0
+#define viso_sequence_end_code 0xb1
+#define viso_start_code 0xb5
+#define group_start_code 0xb3
+#define user_data_start_code 0xb2
+#define vop_start_code 0xb6
+
+#define I_FRAME 0
+#define P_FRAME 1
+#define B_FRAME 2
+
+#define PICTURE_TOP 1
+#define PICTURE_BOTTOM 2
+#define PICTURE_FRAME 3
+
+#define SHAPE_RECT 0
+#define SHAPE_BIN 1
+#define SHAPE_BINONLY 2
+#define SHAPE_GRAY 3
+
+#define SPRITE_STATIC 1
+#define SPRITE_GMC 2
+
+static int nframe;
+
+/*#define MAKE_DAT*/ /*do NOT define this, unless you know what you do */
+#ifdef MAKE_DAT
+static int nframes;
+static FILE *outfile;
+#endif
+
+
+
+/* default intra quant matrix, in zig-zag order */
+static const uint8_t default_intra_quantizer_matrix[64] = {
+ 8,
+ 17, 17,
+ 20, 18, 18,
+ 19, 19, 21, 21,
+ 22, 22, 22, 21, 21,
+ 23, 23, 23, 23, 23, 23,
+ 25, 24, 24, 24, 24, 25, 25,
+ 27, 27, 26, 26, 26, 26, 26, 27,
+ 28, 28, 28, 28, 28, 28, 28,
+ 30, 30, 30, 30, 30, 30,
+ 32, 32, 32, 32, 32,
+ 35, 35, 35, 35,
+ 38, 38, 38,
+ 41, 41,
+ 45
+};
+
+/* default non intra quant matrix, in zig-zag order */
+static const uint8_t default_non_intra_quantizer_matrix[64] = {
+ 16,
+ 17, 17,
+ 18, 18, 18,
+ 19, 19, 19, 19,
+ 20, 20, 20, 20, 20,
+ 21, 21, 21, 21, 21, 21,
+ 22, 22, 22, 22, 22, 22, 22,
+ 23, 23, 23, 23, 23, 23, 23, 23,
+ 24, 24, 24, 25, 24, 24, 24,
+ 25, 26, 26, 26, 26, 25,
+ 27, 27, 27, 27, 27,
+ 28, 28, 28, 28,
+ 30, 30, 30,
+ 31, 31,
+ 33
+};
+
+uint8_t mpeg_scan_norm[64] = {
+ /* Zig-Zag scan pattern */
+ 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
+};
+
+
+
+typedef struct {
+ VdpPictureInfoMPEG4Part2 vdp_infos; /* first field, also used for frame */
+
+ int viso_verid;
+ int newpred_enable;
+ int reduced_resolution_vop_enable;
+ int vol_shape;
+ int complexity_estimation_disable;
+ int sprite_enable;
+ int quant_precision;
+
+ int progressive_frame;
+} picture_t;
+
+
+
+typedef struct {
+ uint32_t coded_width;
+ uint32_t coded_height;
+
+ uint64_t video_step; /* frame duration in pts units */
+ double ratio;
+ VdpDecoderProfile profile;
+ int chroma;
+ int top_field_first;
+
+ int have_header;
+
+ uint8_t *buf; /* accumulate data */
+ int bufseek;
+ uint32_t bufsize;
+ uint32_t bufpos;
+ int start;
+
+ picture_t picture;
+ vo_frame_t *forward_ref;
+ vo_frame_t *backward_ref;
+
+ int64_t cur_pts, seq_pts;
+
+ vdpau_accel_t *accel_vdpau;
+
+ VdpColorStandard color_standard;
+
+ bits_reader_t br;
+
+ int vdp_runtime_nr;
+ int reset;
+
+ int have_codec_name;
+ char codec_name[256];
+
+ int fixed_vop_time_increment;
+ int time_increment_bits;
+ int last_time_base;
+ int time_base;
+ int time;
+ int last_non_b_time;
+ int t_frame;
+
+} sequence_t;
+
+
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} vdpau_mpeg4_class_t;
+
+
+
+typedef struct vdpau_mpeg4_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ vdpau_mpeg4_class_t *class;
+ xine_stream_t *stream;
+
+ sequence_t sequence;
+
+ VdpDecoder decoder;
+ VdpDecoderProfile decoder_profile;
+ uint32_t decoder_width;
+ uint32_t decoder_height;
+
+} vdpau_mpeg4_decoder_t;
+
+
+
+static void reset_picture( picture_t *pic )
+{
+ lprintf( "reset_picture\n" );
+ pic->vdp_infos.vop_coding_type = 0;
+ pic->vdp_infos.alternate_vertical_scan_flag = 0;
+ pic->vdp_infos.quant_type = 0;
+ pic->vdp_infos.vop_time_increment_resolution = 0;
+ pic->vdp_infos.vop_fcode_forward = 1;
+ pic->vdp_infos.vop_fcode_backward = 1;
+ pic->vdp_infos.resync_marker_disable = 0;
+ pic->vdp_infos.interlaced = 0;
+ pic->vdp_infos.quarter_sample = 0;
+ pic->vdp_infos.short_video_header = 0;
+ pic->vdp_infos.rounding_control = 0;
+ pic->vdp_infos.top_field_first = 1;
+ pic->progressive_frame = 1;
+ pic->viso_verid = 1;
+ pic->newpred_enable = 0;
+ pic->reduced_resolution_vop_enable = 0;
+ pic->complexity_estimation_disable = 1;
+ pic->vol_shape = SHAPE_RECT;
+ pic->quant_precision = 5;
+ pic->vdp_infos.trd[0] = pic->vdp_infos.trd[1] = 0;
+ pic->vdp_infos.trb[0] = pic->vdp_infos.trb[1] = 0;
+}
+
+
+
+static void init_picture( picture_t *pic )
+{
+ reset_picture( pic );
+}
+
+
+
+static void reset_sequence( sequence_t *sequence, int free_refs )
+{
+ sequence->cur_pts = sequence->seq_pts = 0;
+ if ( sequence->forward_ref )
+ sequence->forward_ref->pts = 0;
+ if ( sequence->backward_ref )
+ sequence->backward_ref->pts = 0;
+
+ if ( !free_refs )
+ return;
+
+ sequence->bufpos = 0;
+ sequence->bufseek = 0;
+ sequence->start = -1;
+ if ( sequence->forward_ref )
+ sequence->forward_ref->free( sequence->forward_ref );
+ sequence->forward_ref = NULL;
+ if ( sequence->backward_ref )
+ sequence->backward_ref->free( sequence->backward_ref );
+ sequence->backward_ref = NULL;
+ sequence->top_field_first = 0;
+ sequence->reset = VO_NEW_SEQUENCE_FLAG;
+ sequence->color_standard = VDP_COLOR_STANDARD_ITUR_BT_709;
+
+ sequence->last_time_base = 0;
+ sequence->time_base = 0;
+ sequence->time = 0;
+ sequence->last_non_b_time = 0;
+ sequence->t_frame = 0;
+}
+
+
+
+static void free_sequence( sequence_t *sequence )
+{
+ lprintf( "init_sequence\n" );
+ sequence->have_header = 0;
+ sequence->profile = VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
+ sequence->chroma = 0;
+ sequence->video_step = 3600;
+ sequence->have_codec_name = 0;
+ strcpy( sequence->codec_name, "MPEG4 / XviD / DivX (vdpau)" );
+ reset_sequence( sequence, 1 );
+}
+
+
+
+static void update_metadata( vdpau_mpeg4_decoder_t *this_gen )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_WIDTH, sequence->coded_width );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, sequence->coded_height );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*sequence->ratio) );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, sequence->video_step );
+ _x_meta_info_set_utf8( this_gen->stream, XINE_META_INFO_VIDEOCODEC, sequence->codec_name );
+ xine_event_t event;
+ xine_format_change_data_t data;
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = this_gen->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = sequence->coded_width;
+ data.height = sequence->coded_height;
+ data.aspect = sequence->ratio;
+ xine_event_send( this_gen->stream, &event );
+}
+
+
+
+static void visual_object( vdpau_mpeg4_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ picture_t *picture = (picture_t*)&sequence->picture;
+ bits_reader_set( &sequence->br, buf, len );
+
+ if ( read_bits( &sequence->br, 1 ) ) {
+ picture->viso_verid = read_bits( &sequence->br, 4 );
+ lprintf("visual_object_verid: %d\n", picture->viso_verid);
+ skip_bits( &sequence->br, 3 );
+ }
+ if ( read_bits( &sequence->br, 4 ) == 1 ) {
+ if ( read_bits( &sequence->br, 1 ) ) {
+ skip_bits( &sequence->br, 4 );
+ if ( read_bits( &sequence->br, 1 ) ) {
+ if ( read_bits( &sequence->br, 8 ) == 7 ) {
+ lprintf("color_standard: smpte_240M\n");
+ sequence->color_standard = VDP_COLOR_STANDARD_SMPTE_240M;
+ }
+ skip_bits( &sequence->br, 16 );
+ }
+ }
+ }
+}
+
+
+
+static void video_object_layer( vdpau_mpeg4_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ picture_t *picture = (picture_t*)&sequence->picture;
+ bits_reader_set( &sequence->br, buf, len );
+
+ int vol_verid = 1;
+
+ picture->vdp_infos.short_video_header = 0;
+ sequence->t_frame = 0;
+
+ skip_bits( &sequence->br, 9 );
+ if ( read_bits( &sequence->br, 1 ) ) {
+ vol_verid = read_bits( &sequence->br, 4 );
+ lprintf("video_object_layer_verid: %d\n", vol_verid);
+ skip_bits( &sequence->br, 3 );
+ }
+ double parw=1, parh=1;
+ int ar = read_bits( &sequence->br, 4 );
+ lprintf("aspect_ratio_info: %d\n", ar);
+ switch ( ar ) {
+ case 1: parw = parh = 1; break;
+ case 2: parw = 12; parh = 11; break;
+ case 3: parw = 10; parh = 11; break;
+ case 4: parw = 16; parh = 11; break;
+ case 5: parw = 40; parh = 33; break;
+ case 15: {
+ parw = read_bits( &sequence->br, 8 );
+ parh = read_bits( &sequence->br, 8 );
+ break;
+ }
+ }
+ lprintf("parw: %f, parh: %f\n", parw, parh);
+ if ( read_bits( &sequence->br, 1 ) ) {
+ skip_bits( &sequence->br, 3 );
+ if ( read_bits( &sequence->br, 1 ) ) {
+ read_bits( &sequence->br, 16 );
+ read_bits( &sequence->br, 16 );
+ read_bits( &sequence->br, 16 );
+ read_bits( &sequence->br, 15 );
+ read_bits( &sequence->br, 16 );
+ }
+ }
+
+ picture->vol_shape = read_bits( &sequence->br, 2 );
+ if ( (picture->vol_shape == SHAPE_GRAY) && (vol_verid != 1) ) {
+ skip_bits( &sequence->br, 4 );
+ fprintf(stderr, "vdpau_mpeg4: unsupported SHAPE_GRAY!\n");
+ }
+ skip_bits( &sequence->br, 1 );
+ picture->vdp_infos.vop_time_increment_resolution = read_bits( &sequence->br, 16 );
+ lprintf("vop_time_increment_resolution: %d\n", picture->vdp_infos.vop_time_increment_resolution);
+ int length=1, max=2;
+ while ( (max - 1) < picture->vdp_infos.vop_time_increment_resolution ) {
+ ++length;
+ max *= 2;
+ }
+ sequence->time_increment_bits = length;
+ if ( sequence->time_increment_bits < 1 )
+ sequence->time_increment_bits = 1;
+ skip_bits( &sequence->br, 1 );
+
+ if ( read_bits( &sequence->br, 1 ) ) {
+ sequence->fixed_vop_time_increment = read_bits( &sequence->br, sequence->time_increment_bits );
+ }
+ else
+ sequence->fixed_vop_time_increment = 1;
+
+ sequence->video_step = 90000 / (picture->vdp_infos.vop_time_increment_resolution / sequence->fixed_vop_time_increment);
+ lprintf("fixed_vop_time_increment: %d\n", sequence->fixed_vop_time_increment);
+ lprintf("video_step: %d\n", (int)sequence->video_step);
+
+ if ( picture->vol_shape != SHAPE_BINONLY ) {
+ if ( picture->vol_shape == SHAPE_RECT ) {
+ skip_bits( &sequence->br, 1 );
+ sequence->coded_width = read_bits( &sequence->br, 13 );
+ lprintf("vol_width: %d\n", sequence->coded_width);
+ skip_bits( &sequence->br, 1 );
+ sequence->coded_height = read_bits( &sequence->br, 13 );
+ lprintf("vol_height: %d\n", sequence->coded_height);
+ skip_bits( &sequence->br, 1 );
+ }
+ sequence->ratio = ((double)sequence->coded_width * parw) / ((double)sequence->coded_height * parh);
+ lprintf("aspect_ratio: %f\n", sequence->ratio);
+ picture->vdp_infos.interlaced = read_bits( &sequence->br, 1 );
+ skip_bits( &sequence->br, 1 );
+
+ picture->sprite_enable = 0;
+ if ( vol_verid == 1 )
+ picture->sprite_enable = read_bits( &sequence->br, 1 );
+ else
+ picture->sprite_enable = read_bits( &sequence->br, 2 );
+
+ if ( (picture->sprite_enable == SPRITE_STATIC) || (picture->sprite_enable == SPRITE_GMC) ) {
+ if ( picture->sprite_enable != SPRITE_GMC ) {
+ skip_bits( &sequence->br, 14 );
+ skip_bits( &sequence->br, 14 );
+ skip_bits( &sequence->br, 14 );
+ skip_bits( &sequence->br, 14 );
+ }
+ skip_bits( &sequence->br, 9 );
+ if ( picture->sprite_enable != SPRITE_GMC )
+ skip_bits( &sequence->br, 1 );
+ }
+ if ( (vol_verid != 1) && (picture->vol_shape != SHAPE_RECT) )
+ skip_bits( &sequence->br, 1 );
+
+ if ( read_bits( &sequence->br, 1 ) ) {
+ picture->quant_precision = read_bits( &sequence->br, 4 );
+ skip_bits( &sequence->br, 4 );
+ }
+ else
+ picture->quant_precision = 5;
+
+ if ( picture->vol_shape == SHAPE_GRAY )
+ skip_bits( &sequence->br, 3 );
+
+ picture->vdp_infos.quant_type = read_bits( &sequence->br, 1 );
+
+ /* load default matrices */
+ int j;
+ for ( j=0; j<64; ++j ) {
+ sequence->picture.vdp_infos.intra_quantizer_matrix[mpeg_scan_norm[j]] = default_intra_quantizer_matrix[j];
+ sequence->picture.vdp_infos.non_intra_quantizer_matrix[mpeg_scan_norm[j]] = default_non_intra_quantizer_matrix[j];
+ }
+ if ( picture->vdp_infos.quant_type ) {
+ int val, last = 0;
+ if ( read_bits( &sequence->br, 1 ) ) { /* load_intra_quant_matrix */
+ lprintf("load_intra_quant_matrix\n");
+ for ( j=0; j<64; ++j ) {
+ val = read_bits( &sequence->br, 8 );
+ if ( !val )
+ break;
+ last = sequence->picture.vdp_infos.intra_quantizer_matrix[j] = val;
+ }
+ for ( ; j<64; ++j )
+ sequence->picture.vdp_infos.intra_quantizer_matrix[j] = last;
+ }
+ if ( read_bits( &sequence->br, 1 ) ) { /* load_non_intra_quant_matrix */
+ lprintf("load_non_intra_quant_matrix\n");
+ for ( j=0; j<64; ++j ) {
+ val = read_bits( &sequence->br, 8 );
+ if ( !val )
+ break;
+ last = sequence->picture.vdp_infos.non_intra_quantizer_matrix[j] = val;
+ }
+ for ( ; j<64; ++j )
+ sequence->picture.vdp_infos.non_intra_quantizer_matrix[j] = last;
+ }
+ if ( picture->vol_shape == SHAPE_GRAY ) { /* FIXME */
+ fprintf(stderr, "vdpau_mpeg4: grayscale shape not supported!\n");
+ return;
+ }
+ }
+ if ( vol_verid != 1 )
+ sequence->picture.vdp_infos.quarter_sample = read_bits( &sequence->br, 1 );
+ else
+ sequence->picture.vdp_infos.quarter_sample = 0;
+
+ picture->complexity_estimation_disable = read_bits( &sequence->br, 1 );
+ if ( !picture->complexity_estimation_disable ) { /* define_vop_complexity_estimation_header */
+ int estimation_method = read_bits( &sequence->br, 2 );
+ if ( (estimation_method == 0) || (estimation_method == 1) ){
+ if ( !read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 6 );
+ if ( !read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 4 );
+ skip_bits( &sequence->br, 1 );
+ if ( !read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 4 );
+ if ( !read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 6 );
+ skip_bits( &sequence->br, 1 );
+ if ( estimation_method == 1 ) {
+ if ( !read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 2 );
+ }
+ }
+ }
+
+ picture->vdp_infos.resync_marker_disable = read_bits( &sequence->br, 1 );
+
+ if ( read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 1 );
+ if ( vol_verid != 1 ) {
+ picture->newpred_enable = read_bits( &sequence->br, 1 );
+ if ( picture->newpred_enable )
+ skip_bits( &sequence->br, 3 );
+ picture->reduced_resolution_vop_enable = read_bits( &sequence->br, 1 );
+ }
+ else {
+ picture->newpred_enable = 0;
+ picture->reduced_resolution_vop_enable = 0;
+ }
+ /* .... */
+ }
+ else {
+ if ( vol_verid != 1 ) {
+ if ( read_bits( &sequence->br, 1 ) )
+ skip_bits( &sequence->br, 24 );
+ }
+ picture->vdp_infos.resync_marker_disable = read_bits( &sequence->br, 1 );
+ }
+
+ if ( !sequence->have_header ) {
+ update_metadata( this_gen );
+ sequence->have_header = 1;
+ }
+}
+
+
+#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
+
+static void video_object_plane( vdpau_mpeg4_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ picture_t *picture = (picture_t*)&sequence->picture;
+ bits_reader_set( &sequence->br, buf, len );
+ int time_inc=0, time_increment;
+
+ sequence->seq_pts = sequence->cur_pts;
+ sequence->cur_pts = 0;
+
+ picture->vdp_infos.vop_coding_type = read_bits( &sequence->br, 2 );
+ while ( read_bits( &sequence->br, 1 ) )
+ ++time_inc;
+
+ skip_bits( &sequence->br, 1 );
+
+ if ( sequence->time_increment_bits == 0 || !(get_bits( &sequence->br, sequence->time_increment_bits + 1) & 1) ) {
+ for ( sequence->time_increment_bits = 1; sequence->time_increment_bits < 16; ++sequence->time_increment_bits ) {
+ if ( picture->vdp_infos.vop_coding_type == P_FRAME ) {
+ if ( (get_bits( &sequence->br, sequence->time_increment_bits + 6 ) & 0x37) == 0x30 )
+ break;
+ }
+ else {
+ if ( (get_bits( &sequence->br, sequence->time_increment_bits + 5 ) & 0x1f) == 0x18 )
+ break;
+ }
+ fprintf(stderr, "Headers are not complete, guessing time_increment_bits: %d\n", sequence->time_increment_bits);
+ }
+ }
+
+ time_increment = read_bits( &sequence->br, sequence->time_increment_bits );
+
+ if ( picture->vdp_infos.vop_coding_type != B_FRAME ) {
+ sequence->last_time_base = sequence->time_base;
+ sequence->time_base += time_inc;
+ sequence->time = sequence->time_base * picture->vdp_infos.vop_time_increment_resolution + time_increment;
+ if ( sequence->time < sequence->last_non_b_time ) {
+ ++sequence->time_base;
+ sequence->time += picture->vdp_infos.vop_time_increment_resolution;
+ }
+ picture->vdp_infos.trd[0] = sequence->time - sequence->last_non_b_time;
+ sequence->last_non_b_time = sequence->time;
+ }
+ else {
+ sequence->time = (sequence->last_time_base + time_inc) * picture->vdp_infos.vop_time_increment_resolution + time_increment;
+ picture->vdp_infos.trb[0] = picture->vdp_infos.trd[0] - (sequence->last_non_b_time - sequence->time);
+ if ( (picture->vdp_infos.trd[0] <= picture->vdp_infos.trb[0] ) || (picture->vdp_infos.trd[0] <= (picture->vdp_infos.trd[0] - picture->vdp_infos.trb[0])) || (picture->vdp_infos.trd[0] <= 0) ) {
+ /* FIXME */
+ }
+ if ( sequence->t_frame == 0 )
+ sequence->t_frame = picture->vdp_infos.trb[0];
+ if ( sequence->t_frame == 0 )
+ sequence->t_frame = 1;
+ picture->vdp_infos.trd[1] = ( ROUNDED_DIV(sequence->last_non_b_time, sequence->t_frame) - ROUNDED_DIV(sequence->last_non_b_time - picture->vdp_infos.trd[0], sequence->t_frame));
+ picture->vdp_infos.trb[1] = ( ROUNDED_DIV(sequence->time, sequence->t_frame) - ROUNDED_DIV(sequence->last_non_b_time - picture->vdp_infos.trd[0], sequence->t_frame));
+ if ( picture->vdp_infos.interlaced ) {
+ /* FIXME */
+ }
+ }
+
+ /*if ( sequence->fixed_vop_time_increment )
+ sequence->seq_pts = ( sequence->time + sequence->fixed_vop_time_increment/2 ) / sequence->fixed_vop_time_increment;*/
+
+ skip_bits( &sequence->br, 1 );
+ if ( !read_bits( &sequence->br, 1 ) )
+ return; /* vop_coded == 0 */
+
+ if ( picture->newpred_enable ) { /* FIXME */
+ fprintf(stderr, "vdpau_mpeg4: newpred_enable, dunno what to do !!!\n");
+ return;
+ }
+
+ if ( (picture->vol_shape != SHAPE_BINONLY) && (picture->vdp_infos.vop_coding_type == P_FRAME) )
+ picture->vdp_infos.rounding_control = read_bits( &sequence->br, 1 );
+ else
+ picture->vdp_infos.rounding_control = 0;
+
+ if ( picture->reduced_resolution_vop_enable && (picture->vol_shape == SHAPE_RECT) && (picture->vdp_infos.vop_coding_type != B_FRAME) )
+ skip_bits( &sequence->br, 1 );
+ if ( picture->vol_shape != SHAPE_RECT ) { /* FIXME */
+ fprintf(stderr, "vdpau_mpeg4: vol_shape != SHAPE_RECT, return\n");
+ return;
+ }
+
+ if ( picture->vol_shape != SHAPE_BINONLY ) {
+ if ( !picture->complexity_estimation_disable ) { /* FIXME */
+ fprintf(stderr, "vdpau_mpeg4: TODO: read_vop_complexity_estimation_header\n");
+ return;
+ }
+ }
+
+ if ( picture->vol_shape != SHAPE_BINONLY ) {
+ skip_bits( &sequence->br, 3 );
+ if ( picture->vdp_infos.interlaced ) {
+ picture->vdp_infos.top_field_first = read_bits( &sequence->br, 1 );
+ picture->vdp_infos.alternate_vertical_scan_flag = read_bits( &sequence->br, 1 );
+ }
+ }
+
+ if ( picture->vol_shape != SHAPE_BINONLY ) {
+ skip_bits( &sequence->br, picture->quant_precision );
+ if ( picture->vol_shape == SHAPE_GRAY ) { /* FIXME */
+ fprintf(stderr, "vdpau_mpeg4: unsupported SHAPE_GRAY!\n");
+ return;
+ }
+ if ( picture->vdp_infos.vop_coding_type != I_FRAME )
+ picture->vdp_infos.vop_fcode_forward = read_bits( &sequence->br, 3 );
+ if ( picture->vdp_infos.vop_coding_type == B_FRAME )
+ picture->vdp_infos.vop_fcode_backward = read_bits( &sequence->br, 3 );
+ }
+}
+
+
+
+static void gop_header( vdpau_mpeg4_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ int h, m, s;
+
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ bits_reader_set( &sequence->br, buf, len );
+
+ h = read_bits( &sequence->br, 5 );
+ m = read_bits( &sequence->br, 6 );
+ skip_bits( &sequence->br, 1 );
+ s = read_bits( &sequence->br, 6 );
+
+ sequence->time_base = s + (60 * (m + (60 * h)));
+}
+
+
+
+static void user_data( vdpau_mpeg4_decoder_t *this_gen, uint8_t *buffer, int len )
+{
+ /* code from ffmpeg's mpeg4videodec.c */
+
+ char buf[256];
+ int i, e, ver = 0, build = 0, ver2 = 0, ver3 = 0;
+ char last;
+
+ if ( this_gen->sequence.have_codec_name )
+ return;
+
+ for( i=0; i<255 && i<len; i++ ) {
+ if ( buffer[i] == 0 )
+ break;
+ buf[i]= buffer[i];
+ }
+ 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 ) {
+ strcpy( this_gen->sequence.codec_name, "MPEG4 / DivX " );
+ sprintf( buf, "%d", ver );
+ strcat( this_gen->sequence.codec_name, " (vdpau)" );
+ this_gen->sequence.have_codec_name = 1;
+ }
+
+ /* 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 ) {
+ strcpy( this_gen->sequence.codec_name, "MPEG4 / FFmpeg " );
+ sprintf( buf, "%d", build );
+ strcat( this_gen->sequence.codec_name, " (vdpau)" );
+ this_gen->sequence.have_codec_name = 1;
+ }
+ else {
+ if(strcmp(buf, "ffmpeg")==0) {
+ strcpy( this_gen->sequence.codec_name, "MPEG4 / FFmpeg " );
+ strcpy( this_gen->sequence.codec_name, "4600" );
+ strcat( this_gen->sequence.codec_name, " (vdpau)" );
+ this_gen->sequence.have_codec_name = 1;
+ }
+ }
+
+ /* Xvid detection */
+ e = sscanf(buf, "XviD%d", &build);
+ if ( e == 1 ) {
+ strcpy( this_gen->sequence.codec_name, "MPEG4 / XviD " );
+ sprintf( buf, "%d", build );
+ strcat( this_gen->sequence.codec_name, " (vdpau)" );
+ this_gen->sequence.have_codec_name = 1;
+ }
+
+ update_metadata( this_gen );
+}
+
+
+
+static int parse_code( vdpau_mpeg4_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ if ( (buf[3] >= begin_vo_start_code) && (buf[3] <= end_vo_start_code) ) {
+ lprintf( " ----------- vo_start_code\n" );
+ return 0;
+ }
+
+ if ( (buf[3] >= begin_vol_start_code) && (buf[3] <= end_vol_start_code) ) {
+ lprintf( " ----------- vol_start_code\n" );
+ video_object_layer( this_gen, buf+4, len-4);
+ return 0;
+ }
+
+ switch ( buf[3] ) {
+ case viso_sequence_start_code:
+ lprintf( " ----------- viso_sequence_start_code\n" );
+ break;
+ case viso_sequence_end_code:
+ lprintf( " ----------- viso_sequence_end_code\n" );
+ break;
+ case viso_start_code:
+ lprintf( " ----------- viso_start_code\n" );
+ visual_object( this_gen, buf+4, len-4 );
+ break;
+ }
+
+ if ( !sequence->have_header )
+ return 0;
+
+ switch ( buf[3] ) {
+ case group_start_code:
+ lprintf( " ----------- group_start_code\n" );
+ gop_header( this_gen, buf+4, len-4 );
+ break;
+ case user_data_start_code:
+ lprintf( " ----------- user_data_start_code\n" );
+ user_data( this_gen, buf+4, len-4 );
+ break;
+ case vop_start_code:
+ lprintf( " ----------- vop_start_code\n" );
+ video_object_plane( this_gen, buf+4, len-4 );
+ return 1;
+ break;
+ }
+ return 0;
+}
+
+
+
+static void decode_render( vdpau_mpeg4_decoder_t *vd, vdpau_accel_t *accel, uint8_t *buf, int len )
+{
+ sequence_t *seq = (sequence_t*)&vd->sequence;
+ picture_t *pic = (picture_t*)&seq->picture;
+
+ VdpStatus st;
+ if ( vd->decoder==VDP_INVALID_HANDLE || vd->decoder_profile!=seq->profile || vd->decoder_width!=seq->coded_width || vd->decoder_height!=seq->coded_height ) {
+ if ( vd->decoder!=VDP_INVALID_HANDLE ) {
+ accel->vdp_decoder_destroy( vd->decoder );
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+ st = accel->vdp_decoder_create( accel->vdp_device, seq->profile, seq->coded_width, seq->coded_height, 2, &vd->decoder);
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_mpeg4: failed to create decoder !! %s\n", accel->vdp_get_error_string( st ) );
+ else {
+ lprintf( "decoder created.\n" );
+ vd->decoder_profile = seq->profile;
+ vd->decoder_width = seq->coded_width;
+ vd->decoder_height = seq->coded_height;
+ seq->vdp_runtime_nr = accel->vdp_runtime_nr;
+ }
+ }
+
+ VdpPictureInfoMPEG4Part2 *infos = (VdpPictureInfoMPEG4Part2*)&pic->vdp_infos;
+ printf("%d: %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", ++nframe, infos->vop_coding_type,infos->vop_time_increment_resolution, infos->vop_fcode_forward, infos->vop_fcode_backward, infos->resync_marker_disable, infos->interlaced, infos->quant_type, infos->quarter_sample, infos->short_video_header, infos->rounding_control, infos->alternate_vertical_scan_flag, len, infos->trd[0], infos->trd[1], infos->trb[0], infos->trb[1]);
+
+ VdpBitstreamBuffer vbit;
+ vbit.struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ vbit.bitstream = buf;
+ vbit.bitstream_bytes = len;
+ st = accel->vdp_decoder_render( vd->decoder, accel->surface, (VdpPictureInfo*)&pic->vdp_infos, 1, &vbit );
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_mpeg4: decoder failed : %d!! %s\n", st, accel->vdp_get_error_string( st ) );
+ else {
+ lprintf( "DECODER SUCCESS : vop_coding_type=%d, bytes=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n",
+ pic->vdp_infos.vop_coding_type, vbit.bitstream_bytes, accel->surface, pic->vdp_infos.forward_reference, pic->vdp_infos.backward_reference, seq->seq_pts );
+ }
+}
+
+
+
+static void decode_picture( vdpau_mpeg4_decoder_t *vd )
+{
+ sequence_t *seq = (sequence_t*)&vd->sequence;
+ picture_t *pic = (picture_t*)&seq->picture;
+ vdpau_accel_t *ref_accel;
+
+ uint8_t *buf = seq->buf;
+ int len = seq->bufpos;
+
+ pic->vdp_infos.forward_reference = VDP_INVALID_HANDLE;
+ pic->vdp_infos.backward_reference = VDP_INVALID_HANDLE;
+
+ if ( pic->vdp_infos.vop_coding_type == P_FRAME ) {
+ if ( seq->backward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->backward_ref->accel_data;
+ pic->vdp_infos.forward_reference = ref_accel->surface;
+ }
+ else {
+ /* reset_picture( &seq->picture ); */
+ return;
+ }
+ }
+ else if ( pic->vdp_infos.vop_coding_type == B_FRAME ) {
+ if ( seq->forward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->forward_ref->accel_data;
+ pic->vdp_infos.forward_reference = ref_accel->surface;
+ }
+ else {
+ /* reset_picture( &seq->picture ); */
+ return;
+ }
+ if ( seq->backward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->backward_ref->accel_data;
+ pic->vdp_infos.backward_reference = ref_accel->surface;
+ }
+ else {
+ /* reset_picture( &seq->picture );*/
+ return;
+ }
+ }
+
+ vo_frame_t *img = vd->stream->video_out->get_frame( vd->stream->video_out, seq->coded_width, seq->coded_height, seq->ratio, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS );
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ if ( !seq->accel_vdpau )
+ seq->accel_vdpau = accel;
+
+ if( seq->vdp_runtime_nr != *(seq->accel_vdpau->current_vdp_runtime_nr) ) {
+ seq->accel_vdpau = accel;
+ if ( seq->forward_ref )
+ seq->forward_ref->free( seq->forward_ref );
+ seq->forward_ref = NULL;
+ if ( seq->backward_ref )
+ seq->backward_ref->free( seq->backward_ref );
+ seq->backward_ref = NULL;
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+
+ decode_render( vd, accel, buf, len );
+
+
+#ifdef MAKE_DAT
+ if ( nframes==0 ) {
+ fwrite( &seq->coded_width, 1, sizeof(seq->coded_width), outfile );
+ fwrite( &seq->coded_height, 1, sizeof(seq->coded_height), outfile );
+ fwrite( &seq->ratio, 1, sizeof(seq->ratio), outfile );
+ fwrite( &seq->profile, 1, sizeof(seq->profile), outfile );
+ }
+
+ if ( nframes++ < 25 ) {
+ fwrite( &pic->vdp_infos, 1, sizeof(pic->vdp_infos), outfile );
+ fwrite( &len, 1, sizeof(len), outfile );
+ fwrite( buf, 1, len, outfile );
+ printf( "picture_type = %d\n", pic->vdp_infos.picture_type);
+ }
+#endif
+
+ if ( pic->vdp_infos.interlaced ) {
+ img->progressive_frame = 0;
+ img->top_field_first = pic->vdp_infos.top_field_first;
+ }
+ else {
+ img->progressive_frame = -1; /* set to -1 to let the vo know that it MUST NOT deinterlace */
+ img->top_field_first = 1;
+ }
+ img->pts = seq->seq_pts;
+ img->bad_frame = 0;
+ if ( seq->video_step > 900 ) /* some buggy streams */
+ img->duration = seq->video_step;
+ accel->color_standard = seq->color_standard;
+
+ if ( pic->vdp_infos.vop_coding_type < B_FRAME ) {
+ if ( pic->vdp_infos.vop_coding_type == I_FRAME && !seq->backward_ref ) {
+ img->pts = 0;
+ img->draw( img, vd->stream );
+ ++img->drawn;
+ }
+ if ( seq->forward_ref ) {
+ seq->forward_ref->drawn = 0;
+ seq->forward_ref->free( seq->forward_ref );
+ }
+ seq->forward_ref = seq->backward_ref;
+ if ( seq->forward_ref && !seq->forward_ref->drawn ) {
+ seq->forward_ref->draw( seq->forward_ref, vd->stream );
+ }
+ seq->backward_ref = img;
+ }
+ else {
+ img->draw( img, vd->stream );
+ img->free( img );
+ }
+}
+
+
+
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void vdpau_mpeg4_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
+{
+ vdpau_mpeg4_decoder_t *this = (vdpau_mpeg4_decoder_t *) this_gen;
+ sequence_t *seq = (sequence_t*)&this->sequence;
+
+ /* preview buffers shall not be decoded and drawn -- use them only to supply stream information */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if ( !buf->size )
+ return;
+
+ if ( buf->pts )
+ seq->cur_pts = buf->pts;
+
+ int size = seq->bufpos+buf->size;
+ if ( seq->bufsize < size ) {
+ seq->bufsize = size+1024;
+ seq->buf = realloc( seq->buf, seq->bufsize );
+ }
+ xine_fast_memcpy( seq->buf+seq->bufpos, buf->content, buf->size );
+ seq->bufpos += buf->size;
+
+ while ( seq->bufseek <= seq->bufpos-4 ) {
+ uint8_t *buffer = seq->buf+seq->bufseek;
+ if ( buffer[0]==0 && buffer[1]==0 && buffer[2]==1 ) {
+ if ( seq->start<0 ) {
+ seq->start = seq->bufseek;
+ }
+ else {
+ if ( parse_code( this, seq->buf+seq->start, seq->bufseek-seq->start ) ) {
+ decode_picture( this );
+ }
+ uint8_t *tmp = (uint8_t*)malloc(seq->bufsize);
+ xine_fast_memcpy( tmp, seq->buf+seq->bufseek, seq->bufpos-seq->bufseek );
+ seq->bufpos -= seq->bufseek;
+ seq->start = -1;
+ seq->bufseek = -1;
+ free( seq->buf );
+ seq->buf = tmp;
+ }
+ }
+ ++seq->bufseek;
+ }
+}
+
+/*
+ * This function is called when xine needs to flush the system.
+ */
+static void vdpau_mpeg4_flush (video_decoder_t *this_gen) {
+ vdpau_mpeg4_decoder_t *this = (vdpau_mpeg4_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg4_flush\n" );
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void vdpau_mpeg4_reset (video_decoder_t *this_gen) {
+ vdpau_mpeg4_decoder_t *this = (vdpau_mpeg4_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg4_reset\n" );
+ reset_sequence( &this->sequence, 1 );
+}
+
+/*
+ * The decoder should forget any stored pts values here.
+ */
+static void vdpau_mpeg4_discontinuity (video_decoder_t *this_gen) {
+ vdpau_mpeg4_decoder_t *this = (vdpau_mpeg4_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg4_discontinuity\n" );
+ reset_sequence( &this->sequence, 0 );
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void vdpau_mpeg4_dispose (video_decoder_t *this_gen) {
+
+ vdpau_mpeg4_decoder_t *this = (vdpau_mpeg4_decoder_t *) this_gen;
+
+ lprintf( "vdpau_mpeg4_dispose\n" );
+
+ if ( this->decoder!=VDP_INVALID_HANDLE && this->sequence.accel_vdpau ) {
+ this->sequence.accel_vdpau->vdp_decoder_destroy( this->decoder );
+ this->decoder = VDP_INVALID_HANDLE;
+ }
+
+ free_sequence( &this->sequence );
+
+ this->stream->video_out->close( this->stream->video_out, this->stream );
+
+ free( this->sequence.buf );
+ free( this_gen );
+}
+
+/*
+ * This function allocates, initializes, and returns a private video
+ * decoder structure.
+ */
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ vdpau_mpeg4_decoder_t *this ;
+
+ lprintf( "open_plugin\n" );
+
+ /* the videoout must be vdpau-capable to support this decoder */
+ if ( !(stream->video_driver->get_capabilities(stream->video_driver) & VO_CAP_VDPAU_MPEG4) )
+ return NULL;
+
+ /* now check if vdpau has free decoder resource */
+ vo_frame_t *img = stream->video_out->get_frame( stream->video_out, 1920, 1080, 1, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS );
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ int runtime_nr = accel->vdp_runtime_nr;
+ img->free(img);
+ VdpDecoder decoder;
+ VdpStatus st = accel->vdp_decoder_create( accel->vdp_device, VDP_DECODER_PROFILE_MPEG4_PART2_ASP, 1920, 1080, 2, &decoder );
+ if ( st!=VDP_STATUS_OK ) {
+ lprintf( "can't create vdpau decoder.\n" );
+ return NULL;
+ }
+
+ accel->vdp_decoder_destroy( decoder );
+
+ this = (vdpau_mpeg4_decoder_t *) calloc(1, sizeof(vdpau_mpeg4_decoder_t));
+
+ this->video_decoder.decode_data = vdpau_mpeg4_decode_data;
+ this->video_decoder.flush = vdpau_mpeg4_flush;
+ this->video_decoder.reset = vdpau_mpeg4_reset;
+ this->video_decoder.discontinuity = vdpau_mpeg4_discontinuity;
+ this->video_decoder.dispose = vdpau_mpeg4_dispose;
+
+ this->stream = stream;
+ this->class = (vdpau_mpeg4_class_t *) class_gen;
+
+ this->sequence.bufsize = 1024;
+ this->sequence.buf = (uint8_t*)malloc(this->sequence.bufsize);
+ this->sequence.forward_ref = 0;
+ this->sequence.backward_ref = 0;
+ this->sequence.vdp_runtime_nr = runtime_nr;
+ free_sequence( &this->sequence );
+ this->sequence.ratio = 1;
+ this->sequence.reset = VO_NEW_SEQUENCE_FLAG;
+
+ init_picture( &this->sequence.picture );
+
+ this->decoder = VDP_INVALID_HANDLE;
+ this->sequence.accel_vdpau = NULL;
+
+ (stream->video_out->open)(stream->video_out, stream);
+
+#ifdef MAKE_DAT
+ outfile = fopen( "/tmp/mpeg4.dat","w");
+ nframes = 0;
+#endif
+ nframe = 0;
+
+ return &this->video_decoder;
+}
+
+/*
+ * This function allocates a private video decoder class and initializes
+ * the class's member functions.
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ vdpau_mpeg4_class_t *this;
+
+ this = (vdpau_mpeg4_class_t *) calloc(1, sizeof(vdpau_mpeg4_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "vdpau_mpeg4";
+ this->decoder_class.description =
+ N_("vdpau_mpeg4: mpeg4 part 2 decoder plugin using VDPAU hardware decoding.\n"
+ "Must be used along with video_out_vdpau.");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
+ BUF_VIDEO_MPEG4,
+ BUF_VIDEO_XVID,
+ BUF_VIDEO_DIVX5,
+ BUF_VIDEO_3IVX,
+ 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_video = {
+ video_types, /* supported types */
+ 0 /* 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, "name", version, special_info, init_function } */
+ { PLUGIN_VIDEO_DECODER, 19, "vdpau_mpeg4", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/libvdpau/vdpau_vc1.c b/src/video_dec/libvdpau/vdpau_vc1.c
new file mode 100644
index 000000000..fe6ce26b4
--- /dev/null
+++ b/src/video_dec/libvdpau/vdpau_vc1.c
@@ -0,0 +1,1176 @@
+/*
+ * Copyright (C) 2008 the xine project
+ * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
+ *
+ * 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, USA
+ *
+ * vdpau_vc1.c, a vc1 video stream parser using VDPAU hardware decoder
+ *
+ */
+
+/*#define LOG*/
+#define LOG_MODULE "vdpau_vc1"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "accel_vdpau.h"
+#include "bits_reader.h"
+
+#include <vdpau/vdpau.h>
+
+#define sequence_header_code 0x0f
+#define sequence_end_code 0x0a
+#define entry_point_code 0x0e
+#define frame_start_code 0x0d
+#define field_start_code 0x0c
+#define slice_start_code 0x0b
+
+#define PICTURE_FRAME 0
+#define PICTURE_FRAME_INTERLACE 2
+#define PICTURE_FIELD_INTERLACE 3
+
+#define I_FRAME 0
+#define P_FRAME 1
+#define B_FRAME 3
+#define BI_FRAME 4
+
+#define FIELDS_I_I 0
+#define FIELDS_I_P 1
+#define FIELDS_P_I 2
+#define FIELDS_P_P 3
+#define FIELDS_B_B 4
+#define FIELDS_B_BI 5
+#define FIELDS_BI_B 6
+#define FIELDS_BI_BI 7
+
+#define MODE_STARTCODE 0
+#define MODE_FRAME 1
+
+/*#define MAKE_DAT*/ /*do NOT define this, unless you know what you do */
+#ifdef MAKE_DAT
+static int nframes;
+static FILE *outfile;
+#endif
+
+
+
+const double aspect_ratio[] = {
+ 0.0,
+ 1.0,
+ 12./11.,
+ 10./11.,
+ 16./11.,
+ 40./33.,
+ 24./11.,
+ 20./11.,
+ 32./11.,
+ 80./33.,
+ 18./11.,
+ 15./11.,
+ 64./33.,
+ 160./99.
+};
+
+
+
+typedef struct {
+ VdpPictureInfoVC1 vdp_infos;
+ int slices;
+ int fptype;
+ int field;
+ int header_size;
+ int hrd_param_flag;
+ int hrd_num_leaky_buckets;
+ int repeat_first_field;
+ int top_field_first;
+ int skipped;
+} picture_t;
+
+
+
+typedef struct {
+ uint32_t coded_width;
+ uint32_t coded_height;
+
+ uint64_t video_step; /* frame duration in pts units */
+ uint64_t reported_video_step; /* frame duration in pts units */
+ double ratio;
+ VdpDecoderProfile profile;
+
+ int mode;
+ int have_header;
+
+ uint8_t *buf; /* accumulate data */
+ int bufseek;
+ int start;
+ int code_start, current_code;
+ uint32_t bufsize;
+ uint32_t bufpos;
+
+ picture_t picture;
+ vo_frame_t *forward_ref;
+ vo_frame_t *backward_ref;
+
+ int64_t seq_pts;
+ int64_t cur_pts;
+
+ vdpau_accel_t *accel_vdpau;
+
+ bits_reader_t br;
+
+ int vdp_runtime_nr;
+
+} sequence_t;
+
+
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} vdpau_vc1_class_t;
+
+
+
+typedef struct vdpau_vc1_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ vdpau_vc1_class_t *class;
+ xine_stream_t *stream;
+
+ sequence_t sequence;
+
+ VdpDecoder decoder;
+ VdpDecoderProfile decoder_profile;
+ uint32_t decoder_width;
+ uint32_t decoder_height;
+
+} vdpau_vc1_decoder_t;
+
+
+
+static void init_picture( picture_t *pic )
+{
+ memset( pic, 0, sizeof( picture_t ) );
+}
+
+
+
+static void reset_picture( picture_t *pic )
+{
+ pic->slices = 1;
+}
+
+
+
+static void reset_sequence( sequence_t *sequence )
+{
+ lprintf( "reset_sequence\n" );
+ sequence->bufpos = 0;
+ sequence->bufseek = 0;
+ sequence->start = -1;
+ sequence->code_start = sequence->current_code = 0;
+ sequence->seq_pts = sequence->cur_pts = 0;
+ if ( sequence->forward_ref )
+ sequence->forward_ref->free( sequence->forward_ref );
+ sequence->forward_ref = NULL;
+ if ( sequence->backward_ref )
+ sequence->backward_ref->free( sequence->backward_ref );
+ sequence->backward_ref = NULL;
+ reset_picture( &sequence->picture );
+}
+
+
+
+static void init_sequence( sequence_t *sequence )
+{
+ lprintf( "init_sequence\n" );
+ sequence->have_header = 0;
+ sequence->profile = VDP_DECODER_PROFILE_VC1_SIMPLE;
+ sequence->ratio = 0;
+ sequence->video_step = 0;
+ sequence->picture.hrd_param_flag = 0;
+ reset_sequence( sequence );
+}
+
+
+
+static void update_metadata( vdpau_vc1_decoder_t *this_gen )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ if ( !sequence->have_header ) {
+ sequence->have_header = 1;
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_WIDTH, sequence->coded_width );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, sequence->coded_height );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_VIDEO_RATIO, ((double)10000*sequence->ratio) );
+ _x_stream_info_set( this_gen->stream, XINE_STREAM_INFO_FRAME_DURATION, (sequence->reported_video_step = sequence->video_step) );
+ _x_meta_info_set_utf8( this_gen->stream, XINE_META_INFO_VIDEOCODEC, "VC1/WMV9 (vdpau)" );
+ xine_event_t event;
+ xine_format_change_data_t data;
+ event.type = XINE_EVENT_FRAME_FORMAT_CHANGE;
+ event.stream = this_gen->stream;
+ event.data = &data;
+ event.data_length = sizeof(data);
+ data.width = sequence->coded_width;
+ data.height = sequence->coded_height;
+ data.aspect = sequence->ratio;
+ xine_event_send( this_gen->stream, &event );
+ }
+}
+
+
+
+static void sequence_header_advanced( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ lprintf( "sequence_header_advanced\n" );
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ if ( len < 5 )
+ return;
+
+ sequence->profile = VDP_DECODER_PROFILE_VC1_ADVANCED;
+ lprintf("VDP_DECODER_PROFILE_VC1_ADVANCED\n");
+ bits_reader_set( &sequence->br, buf, len );
+ skip_bits( &sequence->br, 15 );
+ sequence->picture.vdp_infos.postprocflag = read_bits( &sequence->br, 1 );
+ sequence->coded_width = (read_bits( &sequence->br, 12 )+1)<<1;
+ sequence->coded_height = (read_bits( &sequence->br, 12 )+1)<<1;
+ sequence->picture.vdp_infos.pulldown = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.interlace = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.tfcntrflag = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.finterpflag = read_bits( &sequence->br, 1 );
+ skip_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.psf = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.maxbframes = 7;
+ if ( read_bits( &sequence->br, 1 ) ) {
+ double w, h;
+ int ar=0;
+ w = read_bits( &sequence->br, 14 )+1;
+ h = read_bits( &sequence->br, 14 )+1;
+ if ( read_bits( &sequence->br, 1 ) ) {
+ ar = read_bits( &sequence->br, 4 );
+ }
+ if ( ar==15 ) {
+ w = read_bits( &sequence->br, 8 );
+ h = read_bits( &sequence->br, 8 );
+ sequence->ratio = w/h;
+ lprintf("aspect_ratio (w/h) = %f\n", sequence->ratio);
+ }
+ else if ( ar && ar<14 ) {
+ sequence->ratio = sequence->coded_width*aspect_ratio[ar]/sequence->coded_height;
+ lprintf("aspect_ratio = %f\n", sequence->ratio);
+ }
+
+ if ( read_bits( &sequence->br, 1 ) ) {
+ if ( read_bits( &sequence->br, 1 ) ) {
+ int exp = read_bits( &sequence->br, 16 );
+ lprintf("framerate exp = %d\n", exp);
+ }
+ else {
+ double nr = read_bits( &sequence->br, 8 );
+ switch ((int)nr) {
+ case 1: nr = 24000; break;
+ case 2: nr = 25000; break;
+ case 3: nr = 30000; break;
+ case 4: nr = 50000; break;
+ case 5: nr = 60000; break;
+ default: nr = 0;
+ }
+ double dr = read_bits( &sequence->br, 4 );
+ switch ((int)dr) {
+ case 2: dr = 1001; break;
+ default: dr = 1000;
+ }
+ sequence->video_step = 90000/(nr/dr);
+ lprintf("framerate = %f video_step = %d\n", nr/dr, sequence->video_step);
+ }
+ }
+ if ( read_bits( &sequence->br, 1 ) ) {
+ int col = read_bits( &sequence->br, 8 );
+ lprintf("color_standard = %d\n", col);
+ skip_bits( &sequence->br, 16 );
+ }
+ }
+ sequence->picture.hrd_param_flag = read_bits( &sequence->br, 1 );
+ if ( sequence->picture.hrd_param_flag )
+ sequence->picture.hrd_num_leaky_buckets = read_bits( &sequence->br, 5 );
+
+ update_metadata( this_gen );
+}
+
+
+
+static void sequence_header( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ lprintf( "sequence_header\n" );
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ if ( len < 4 )
+ return;
+
+ bits_reader_set( &sequence->br, buf, len );
+ switch ( read_bits( &sequence->br, 2 ) ) {
+ case 0: sequence->profile = VDP_DECODER_PROFILE_VC1_SIMPLE; lprintf("VDP_DECODER_PROFILE_VC1_SIMPLE\n"); break;
+ case 1: sequence->profile = VDP_DECODER_PROFILE_VC1_MAIN; lprintf("VDP_DECODER_PROFILE_VC1_MAIN\n"); break;
+ case 2: sequence->profile = VDP_DECODER_PROFILE_VC1_MAIN; fprintf(stderr, "vc1_complex profile not supported by vdpau, forcing vc1_main, expect corruption!.\n"); break;
+ case 3: return sequence_header_advanced( this_gen, buf, len ); break;
+ default: return; /* illegal value, broken header? */
+ }
+ skip_bits( &sequence->br, 10 );
+ sequence->picture.vdp_infos.loopfilter = read_bits( &sequence->br, 1 );
+ skip_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.multires = read_bits( &sequence->br, 1 );
+ skip_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.fastuvmc = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.extended_mv = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.dquant = read_bits( &sequence->br, 2 );
+ sequence->picture.vdp_infos.vstransform = read_bits( &sequence->br, 1 );
+ skip_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.overlap = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.syncmarker = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.rangered = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.maxbframes = read_bits( &sequence->br, 3 );
+ sequence->picture.vdp_infos.quantizer = read_bits( &sequence->br, 2 );
+ sequence->picture.vdp_infos.finterpflag = read_bits( &sequence->br, 1 );
+
+ update_metadata( this_gen );
+}
+
+
+
+static void entry_point( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ lprintf( "entry_point\n" );
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ bits_reader_set( &sequence->br, buf, len );
+ skip_bits( &sequence->br, 2 );
+ sequence->picture.vdp_infos.panscan_flag = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.refdist_flag = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.loopfilter = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.fastuvmc = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.extended_mv = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.dquant = read_bits( &sequence->br, 2 );
+ sequence->picture.vdp_infos.vstransform = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.overlap = read_bits( &sequence->br, 1 );
+ sequence->picture.vdp_infos.quantizer = read_bits( &sequence->br, 2 );
+
+ if ( sequence->picture.hrd_param_flag ) {
+ int i;
+ for ( i=0; i<sequence->picture.hrd_num_leaky_buckets; ++i )
+ skip_bits( &sequence->br, 8 );
+ }
+
+ if ( read_bits( &sequence->br, 1 ) ) {
+ sequence->coded_width = (read_bits( &sequence->br, 12 )+1)<<1;
+ sequence->coded_height = (read_bits( &sequence->br, 12 )+1)<<1;
+ }
+
+ if ( sequence->picture.vdp_infos.extended_mv )
+ sequence->picture.vdp_infos.extended_dmv = read_bits( &sequence->br, 1 );
+
+ sequence->picture.vdp_infos.range_mapy_flag = read_bits( &sequence->br, 1 );
+ if ( sequence->picture.vdp_infos.range_mapy_flag ) {
+ sequence->picture.vdp_infos.range_mapy = read_bits( &sequence->br, 3 );
+ }
+ sequence->picture.vdp_infos.range_mapuv_flag = read_bits( &sequence->br, 1 );
+ if ( sequence->picture.vdp_infos.range_mapuv_flag ) {
+ sequence->picture.vdp_infos.range_mapuv = read_bits( &sequence->br, 3 );
+ }
+}
+
+
+
+static void picture_header( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ picture_t *pic = (picture_t*)&sequence->picture;
+ VdpPictureInfoVC1 *info = &(sequence->picture.vdp_infos);
+ int tmp;
+
+ lprintf("picture_header\n");
+
+ bits_reader_set( &sequence->br, buf, len );
+ skip_bits( &sequence->br, 2 );
+
+ if ( info->finterpflag )
+ skip_bits( &sequence->br, 1 );
+ if ( info->rangered ) {
+ /*info->rangered &= ~2;
+ info->rangered |= get_bits( buf,off++,1 ) << 1;*/
+ info->rangered = (read_bits( &sequence->br, 1 ) << 1) +1;
+ }
+ if ( !info->maxbframes ) {
+ if ( read_bits( &sequence->br, 1 ) )
+ info->picture_type = P_FRAME;
+ else
+ info->picture_type = I_FRAME;
+ }
+ else {
+ if ( read_bits( &sequence->br, 1 ) )
+ info->picture_type = P_FRAME;
+ else {
+ if ( read_bits( &sequence->br, 1 ) )
+ info->picture_type = I_FRAME;
+ else
+ info->picture_type = B_FRAME;
+ }
+ }
+ if ( info->picture_type == B_FRAME ) {
+ tmp = read_bits( &sequence->br, 3 );
+ if ( tmp==7 ) {
+ tmp = (tmp<<4) | read_bits( &sequence->br, 4 );
+ if ( tmp==127 )
+ info->picture_type = BI_FRAME;
+ }
+ }
+}
+
+
+
+static void picture_header_advanced( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ picture_t *pic = (picture_t*)&sequence->picture;
+ VdpPictureInfoVC1 *info = &(sequence->picture.vdp_infos);
+
+ lprintf("picture_header_advanced\n");
+
+ bits_reader_set( &sequence->br, buf, len );
+
+ if ( info->interlace ) {
+ lprintf("frame->interlace=1\n");
+ if ( !read_bits( &sequence->br, 1 ) ) {
+ lprintf("progressive frame\n");
+ info->frame_coding_mode = PICTURE_FRAME;
+ }
+ else {
+ if ( !read_bits( &sequence->br, 1 ) ) {
+ lprintf("frame interlaced\n");
+ info->frame_coding_mode = PICTURE_FRAME_INTERLACE;
+ }
+ else {
+ lprintf("field interlaced\n");
+ info->frame_coding_mode = PICTURE_FIELD_INTERLACE;
+ }
+ }
+ }
+ if ( info->interlace && info->frame_coding_mode == PICTURE_FIELD_INTERLACE ) {
+ pic->fptype = read_bits( &sequence->br, 3 );
+ switch ( pic->fptype ) {
+ case FIELDS_I_I:
+ case FIELDS_I_P:
+ info->picture_type = I_FRAME; break;
+ case FIELDS_P_I:
+ case FIELDS_P_P:
+ info->picture_type = P_FRAME; break;
+ case FIELDS_B_B:
+ case FIELDS_B_BI:
+ info->picture_type = B_FRAME; break;
+ default:
+ info->picture_type = BI_FRAME;
+ }
+ }
+ else {
+ if ( !read_bits( &sequence->br, 1 ) )
+ info->picture_type = P_FRAME;
+ else {
+ if ( !read_bits( &sequence->br, 1 ) )
+ info->picture_type = B_FRAME;
+ else {
+ if ( !read_bits( &sequence->br, 1 ) )
+ info->picture_type = I_FRAME;
+ else {
+ if ( !read_bits( &sequence->br, 1 ) )
+ info->picture_type = BI_FRAME;
+ else {
+ info->picture_type = P_FRAME;
+ pic->skipped = 1;
+ }
+ }
+ }
+ }
+ }
+ if ( info->tfcntrflag ) {
+ lprintf("tfcntrflag=1\n");
+ skip_bits( &sequence->br, 8 );
+ }
+ if ( info->pulldown && info->interlace ) {
+ pic->top_field_first = read_bits( &sequence->br, 1 );
+ pic->repeat_first_field = read_bits( &sequence->br, 1 );
+ }
+}
+
+
+
+static void parse_header( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+ int off=0;
+
+ while ( off < (len-4) ) {
+ uint8_t *buffer = buf+off;
+ if ( buffer[0]==0 && buffer[1]==0 && buffer[2]==1 ) {
+ switch ( buffer[3] ) {
+ case sequence_header_code: sequence_header( this_gen, buf+off+4, len-off-4 ); break;
+ case entry_point_code: entry_point( this_gen, buf+off+4, len-off-4 ); break;
+ }
+ }
+ ++off;
+ }
+ if ( !sequence->have_header )
+ sequence_header( this_gen, buf, len );
+}
+
+
+
+static void remove_emulation_prevention( uint8_t *src, uint8_t *dst, int src_len, int *dst_len )
+{
+ int i;
+ int len = 0;
+ int removed = 0;
+
+ for ( i=0; i<src_len-3; ++i ) {
+ if ( src[i]==0 && src[i+1]==0 && src[i+2]==3 ) {
+ lprintf("removed emulation prevention byte\n");
+ dst[len++] = src[i];
+ dst[len++] = src[i+1];
+ i += 2;
+ ++removed;
+ }
+ else {
+ memcpy( dst+len, src+i, 4 );
+ ++len;
+ }
+ }
+ for ( ; i<src_len; ++i )
+ dst[len++] = src[i];
+ *dst_len = src_len-removed;
+}
+
+
+
+static int parse_code( vdpau_vc1_decoder_t *this_gen, uint8_t *buf, int len )
+{
+ sequence_t *sequence = (sequence_t*)&this_gen->sequence;
+
+ if ( !sequence->have_header && buf[3]!=sequence_header_code )
+ return 0;
+
+ if ( sequence->code_start == frame_start_code ) {
+ if ( sequence->current_code==field_start_code || sequence->current_code==slice_start_code ) {
+ sequence->picture.slices++;
+ return -1;
+ }
+ return 1; /* frame complete, decode */
+ }
+
+ switch ( buf[3] ) {
+ int dst_len;
+ uint8_t *tmp;
+ case sequence_header_code:
+ lprintf("sequence_header_code\n");
+ tmp = malloc( len );
+ remove_emulation_prevention( buf, tmp, len, &dst_len );
+ sequence_header( this_gen, tmp+4, dst_len-4 );
+ free( tmp );
+ break;
+ case entry_point_code:
+ lprintf("entry_point_code\n");
+ tmp = malloc( len );
+ remove_emulation_prevention( buf, tmp, len, &dst_len );
+ entry_point( this_gen, tmp+4, dst_len-4 );
+ free( tmp );
+ break;
+ case sequence_end_code:
+ lprintf("sequence_end_code\n");
+ break;
+ case frame_start_code:
+ lprintf("frame_start_code, len=%d\n", len);
+ break;
+ case field_start_code:
+ lprintf("field_start_code\n");
+ break;
+ case slice_start_code:
+ lprintf("slice_start_code, len=%d\n", len);
+ break;
+ }
+ return 0;
+}
+
+
+
+static void decode_render( vdpau_vc1_decoder_t *vd, vdpau_accel_t *accel, uint8_t *buf, int len )
+{
+ sequence_t *seq = (sequence_t*)&vd->sequence;
+ picture_t *pic = (picture_t*)&seq->picture;
+
+ VdpStatus st;
+ if ( vd->decoder==VDP_INVALID_HANDLE || vd->decoder_profile!=seq->profile || vd->decoder_width!=seq->coded_width || vd->decoder_height!=seq->coded_height ) {
+ if ( vd->decoder!=VDP_INVALID_HANDLE ) {
+ accel->vdp_decoder_destroy( vd->decoder );
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+ st = accel->vdp_decoder_create( accel->vdp_device, seq->profile, seq->coded_width, seq->coded_height, 2, &vd->decoder);
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_vc1: failed to create decoder !! %s\n", accel->vdp_get_error_string( st ) );
+ else {
+ lprintf( "decoder created.\n" );
+ vd->decoder_profile = seq->profile;
+ vd->decoder_width = seq->coded_width;
+ vd->decoder_height = seq->coded_height;
+ seq->vdp_runtime_nr = accel->vdp_runtime_nr;
+ }
+ }
+
+ VdpBitstreamBuffer vbit;
+ vbit.struct_version = VDP_BITSTREAM_BUFFER_VERSION;
+ vbit.bitstream = buf;
+ vbit.bitstream_bytes = len;
+ if ( pic->field )
+ vbit.bitstream_bytes = pic->field;
+ st = accel->vdp_decoder_render( vd->decoder, accel->surface, (VdpPictureInfo*)&pic->vdp_infos, 1, &vbit );
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_vc1: decoder failed : %d!! %s\n", st, accel->vdp_get_error_string( st ) );
+ else {
+ lprintf( "DECODER SUCCESS : slices=%d, slices_bytes=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n",
+ pic->vdp_infos.slice_count, vbit.bitstream_bytes, accel->surface, pic->vdp_infos.forward_reference, pic->vdp_infos.backward_reference, seq->seq_pts );
+ }
+ VdpPictureInfoVC1 *info = &(seq->picture.vdp_infos);
+ lprintf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", info->slice_count, info->picture_type, info->frame_coding_mode,
+ info->postprocflag, info->pulldown, info->interlace, info->tfcntrflag, info->finterpflag, info->psf, info->dquant, info->panscan_flag, info->refdist_flag,
+ info->quantizer, info->extended_mv, info->extended_dmv, info->overlap, info->vstransform, info->loopfilter, info->fastuvmc, info->range_mapy_flag, info->range_mapy,
+ info->range_mapuv_flag, info->range_mapuv, info->multires, info->syncmarker, info->rangered, info->maxbframes, info->deblockEnable, info->pquant );
+
+ if ( pic->field ) {
+ int old_type = pic->vdp_infos.picture_type;
+ switch ( pic->fptype ) {
+ case FIELDS_I_I:
+ case FIELDS_P_I:
+ pic->vdp_infos.picture_type = I_FRAME;
+ pic->vdp_infos.backward_reference = VDP_INVALID_HANDLE;
+ pic->vdp_infos.forward_reference = VDP_INVALID_HANDLE;
+ break;
+ case FIELDS_I_P:
+ pic->vdp_infos.forward_reference = accel->surface;
+ pic->vdp_infos.picture_type = P_FRAME;
+ break;
+ case FIELDS_P_P:
+ if ( seq->backward_ref )
+ pic->vdp_infos.forward_reference = ((vdpau_accel_t*)seq->backward_ref->accel_data)->surface;
+ pic->vdp_infos.picture_type = P_FRAME;
+ break;
+ case FIELDS_B_B:
+ case FIELDS_BI_B:
+ pic->vdp_infos.picture_type = B_FRAME;
+ break;
+ default:
+ pic->vdp_infos.picture_type = BI_FRAME;
+ }
+ vbit.bitstream = buf+pic->field+4;
+ vbit.bitstream_bytes = len-pic->field-4;
+ st = accel->vdp_decoder_render( vd->decoder, accel->surface, (VdpPictureInfo*)&pic->vdp_infos, 1, &vbit );
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_vc1: decoder failed : %d!! %s\n", st, accel->vdp_get_error_string( st ) );
+ else {
+ lprintf( "DECODER SUCCESS (second field): slices=%d, slices_bytes=%d, current=%d, forwref:%d, backref:%d, pts:%lld\n",
+ pic->vdp_infos.slice_count, vbit.bitstream_bytes, accel->surface, pic->vdp_infos.forward_reference, pic->vdp_infos.backward_reference, seq->seq_pts );
+ }
+ VdpPictureInfoVC1 *info = &(seq->picture.vdp_infos);
+ lprintf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n", info->slice_count, info->picture_type, info->frame_coding_mode,
+ info->postprocflag, info->pulldown, info->interlace, info->tfcntrflag, info->finterpflag, info->psf, info->dquant, info->panscan_flag, info->refdist_flag,
+ info->quantizer, info->extended_mv, info->extended_dmv, info->overlap, info->vstransform, info->loopfilter, info->fastuvmc, info->range_mapy_flag, info->range_mapy,
+ info->range_mapuv_flag, info->range_mapuv, info->multires, info->syncmarker, info->rangered, info->maxbframes, info->deblockEnable, info->pquant );
+
+ pic->vdp_infos.picture_type = old_type;
+ }
+}
+
+
+
+static int search_field( vdpau_vc1_decoder_t *vd, uint8_t *buf, int len )
+{
+ int i;
+ lprintf("search_fields, len=%d\n", len);
+ for ( i=0; i<len-4; ++i ) {
+ if ( buf[i]==0 && buf[i+1]==0 && buf[i+2]==1 && buf[i+3]==field_start_code ) {
+ lprintf("found field_start_code at %d\n", i);
+ return i;
+ }
+ }
+ return 0;
+}
+
+
+
+static void decode_picture( vdpau_vc1_decoder_t *vd )
+{
+ sequence_t *seq = (sequence_t*)&vd->sequence;
+ picture_t *pic = (picture_t*)&seq->picture;
+ vdpau_accel_t *ref_accel;
+ int field;
+
+ uint8_t *buf;
+ int len;
+
+ pic->skipped = 0;
+ pic->field = 0;
+
+ if ( seq->mode == MODE_FRAME ) {
+ buf = seq->buf;
+ len = seq->bufpos;
+ if ( seq->profile==VDP_DECODER_PROFILE_VC1_ADVANCED )
+ picture_header_advanced( vd, buf, len );
+ else
+ picture_header( vd, buf, len );
+
+ if ( len < 2 )
+ pic->skipped = 1;
+ }
+ else {
+ seq->picture.vdp_infos.slice_count = seq->picture.slices;
+ buf = seq->buf+seq->start+4;
+ len = seq->bufseek-seq->start-4;
+ if ( seq->profile==VDP_DECODER_PROFILE_VC1_ADVANCED ) {
+ int tmplen = (len>50) ? 50 : len;
+ uint8_t *tmp = malloc( tmplen );
+ remove_emulation_prevention( buf, tmp, tmplen, &tmplen );
+ picture_header_advanced( vd, tmp, tmplen );
+ free( tmp );
+ }
+ else
+ picture_header( vd, buf, len );
+
+ if ( len < 2 )
+ pic->skipped = 1;
+ }
+
+ if ( pic->skipped )
+ pic->vdp_infos.picture_type = P_FRAME;
+
+ if ( pic->vdp_infos.interlace && pic->vdp_infos.frame_coding_mode == PICTURE_FIELD_INTERLACE ) {
+ if ( !(field = search_field( vd, buf, len )) )
+ lprintf("error, no fields found!\n");
+ else
+ pic->field = field;
+ }
+
+ pic->vdp_infos.forward_reference = VDP_INVALID_HANDLE;
+ pic->vdp_infos.backward_reference = VDP_INVALID_HANDLE;
+
+ if ( pic->vdp_infos.picture_type==P_FRAME ) {
+ if ( seq->backward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->backward_ref->accel_data;
+ pic->vdp_infos.forward_reference = ref_accel->surface;
+ }
+ else {
+ reset_picture( &seq->picture );
+ return;
+ }
+ }
+ else if ( pic->vdp_infos.picture_type>=B_FRAME ) {
+ if ( seq->forward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->forward_ref->accel_data;
+ pic->vdp_infos.forward_reference = ref_accel->surface;
+ }
+ else {
+ reset_picture( &seq->picture );
+ return;
+ }
+ if ( seq->backward_ref ) {
+ ref_accel = (vdpau_accel_t*)seq->backward_ref->accel_data;
+ pic->vdp_infos.backward_reference = ref_accel->surface;
+ }
+ else {
+ reset_picture( &seq->picture );
+ return;
+ }
+ }
+
+ vo_frame_t *img = vd->stream->video_out->get_frame( vd->stream->video_out, seq->coded_width, seq->coded_height,
+ seq->ratio, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS );
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ if ( !seq->accel_vdpau )
+ seq->accel_vdpau = accel;
+
+ if( seq->vdp_runtime_nr != *(seq->accel_vdpau->current_vdp_runtime_nr) ) {
+ seq->accel_vdpau = accel;
+ if ( seq->forward_ref )
+ seq->forward_ref->free( seq->forward_ref );
+ seq->forward_ref = NULL;
+ if ( seq->backward_ref )
+ seq->backward_ref->free( seq->backward_ref );
+ seq->backward_ref = NULL;
+ vd->decoder = VDP_INVALID_HANDLE;
+ }
+
+ decode_render( vd, accel, buf, len );
+
+
+#ifdef MAKE_DAT
+ if ( nframes==0 ) {
+ fwrite( &seq->coded_width, 1, sizeof(seq->coded_width), outfile );
+ fwrite( &seq->coded_height, 1, sizeof(seq->coded_height), outfile );
+ fwrite( &seq->ratio, 1, sizeof(seq->ratio), outfile );
+ fwrite( &seq->profile, 1, sizeof(seq->profile), outfile );
+ }
+
+ if ( nframes++ < 25 ) {
+ fwrite( &pic->vdp_infos, 1, sizeof(pic->vdp_infos), outfile );
+ fwrite( &len, 1, sizeof(len), outfile );
+ fwrite( buf, 1, len, outfile );
+ printf( "picture_type = %d\n", pic->vdp_infos.picture_type);
+ }
+#endif
+
+ if ( pic->vdp_infos.interlace && pic->vdp_infos.frame_coding_mode ) {
+ img->progressive_frame = 0;
+ img->top_field_first = pic->top_field_first;
+ }
+ else {
+ img->progressive_frame = 1;
+ img->top_field_first = 1;
+ }
+ img->pts = seq->seq_pts;
+ img->bad_frame = 0;
+ img->duration = seq->video_step;
+ accel->color_standard = VDP_COLOR_STANDARD_ITUR_BT_709;
+
+ if ( pic->vdp_infos.picture_type<B_FRAME ) {
+ if ( pic->vdp_infos.picture_type==I_FRAME && !seq->backward_ref ) {
+ img->pts = 0;
+ img->draw( img, vd->stream );
+ ++img->drawn;
+ }
+ if ( seq->forward_ref ) {
+ seq->forward_ref->drawn = 0;
+ seq->forward_ref->free( seq->forward_ref );
+ }
+ seq->forward_ref = seq->backward_ref;
+ if ( seq->forward_ref && !seq->forward_ref->drawn ) {
+ seq->forward_ref->draw( seq->forward_ref, vd->stream );
+ }
+ seq->backward_ref = img;
+ }
+ else {
+ img->draw( img, vd->stream );
+ img->free( img );
+ }
+
+ seq->seq_pts +=seq->video_step;
+
+ reset_picture( &seq->picture );
+}
+
+
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void vdpau_vc1_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
+{
+ vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen;
+ sequence_t *seq = (sequence_t*)&this->sequence;
+
+ /* a video decoder does not care about this flag (?) */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW) {
+ lprintf("BUF_FLAG_PREVIEW\n");
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
+ lprintf("BUF_FLAG_FRAMERATE=%d\n", buf->decoder_info[0]);
+ if ( buf->decoder_info[0] > 0 ) {
+ this->sequence.video_step = buf->decoder_info[0];
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->sequence.video_step);
+ }
+ }
+
+ if (this->sequence.reported_video_step != this->sequence.video_step){
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, (this->sequence.reported_video_step = this->sequence.video_step));
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_HEADER) {
+ lprintf("BUF_FLAG_HEADER\n");
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_ASPECT) {
+ lprintf("BUF_FLAG_ASPECT\n");
+ seq->ratio = (double)buf->decoder_info[1]/(double)buf->decoder_info[2];
+ lprintf("arx=%d ary=%d ratio=%f\n", buf->decoder_info[1], buf->decoder_info[2], seq->ratio);
+ }
+
+ if ( !buf->size )
+ return;
+
+ seq->cur_pts = buf->pts;
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
+ lprintf("BUF_FLAG_STDHEADER\n");
+ xine_bmiheader *bih = (xine_bmiheader *) buf->content;
+ int bs = sizeof( xine_bmiheader );
+ seq->coded_width = bih->biWidth;
+ seq->coded_height = bih->biHeight;
+ lprintf( "width=%d height=%d\n", bih->biWidth, bih->biHeight );
+ if ( buf->size > bs ) {
+ seq->mode = MODE_FRAME;
+ parse_header( this, buf->content+bs, buf->size-bs );
+ }
+ return;
+ }
+
+ int size = seq->bufpos+buf->size;
+ if ( seq->bufsize < size ) {
+ seq->bufsize = size+10000;
+ seq->buf = realloc( seq->buf, seq->bufsize );
+ lprintf("sequence buffer realloced = %d\n", seq->bufsize );
+ }
+ xine_fast_memcpy( seq->buf+seq->bufpos, buf->content, buf->size );
+ seq->bufpos += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_START) {
+ lprintf("BUF_FLAG_FRAME_START\n");
+ seq->seq_pts = buf->pts;
+ seq->mode = MODE_FRAME;
+ if ( seq->bufpos > 3 ) {
+ if ( seq->buf[0]==0 && seq->buf[1]==0 && seq->buf[2]==1 ) {
+ seq->mode = MODE_STARTCODE;
+ }
+ }
+ }
+
+ if ( seq->mode == MODE_FRAME ) {
+ if ( buf->decoder_flags & BUF_FLAG_FRAME_END ) {
+ lprintf("BUF_FLAG_FRAME_END\n");
+ decode_picture( this );
+ seq->bufpos = 0;
+ }
+ return;
+ }
+
+ int res, startcode=0;
+ while ( seq->bufseek <= seq->bufpos-4 ) {
+ uint8_t *buffer = seq->buf+seq->bufseek;
+ if ( buffer[0]==0 && buffer[1]==0 && buffer[2]==1 ) {
+ startcode = 1;
+ seq->current_code = buffer[3];
+ lprintf("current_code = %d\n", seq->current_code);
+ if ( seq->start<0 ) {
+ seq->start = seq->bufseek;
+ seq->code_start = buffer[3];
+ lprintf("code_start = %d\n", seq->code_start);
+ if ( seq->cur_pts )
+ seq->seq_pts = seq->cur_pts;
+ }
+ else {
+ res = parse_code( this, seq->buf+seq->start, seq->bufseek-seq->start );
+ if ( res==1 ) {
+ seq->mode = MODE_STARTCODE;
+ decode_picture( this );
+ parse_code( this, seq->buf+seq->start, seq->bufseek-seq->start );
+ }
+ if ( res!=-1 ) {
+ uint8_t *tmp = (uint8_t*)malloc(seq->bufsize);
+ xine_fast_memcpy( tmp, seq->buf+seq->bufseek, seq->bufpos-seq->bufseek );
+ seq->bufpos -= seq->bufseek;
+ seq->start = -1;
+ seq->bufseek = -1;
+ free( seq->buf );
+ seq->buf = tmp;
+ }
+ }
+ }
+ ++seq->bufseek;
+ }
+}
+
+
+
+/*
+ * This function is called when xine needs to flush the system.
+ */
+static void vdpau_vc1_flush (video_decoder_t *this_gen) {
+ vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen;
+
+ lprintf( "vdpau_vc1_flush\n" );
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void vdpau_vc1_reset (video_decoder_t *this_gen) {
+ vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen;
+
+ lprintf( "vdpau_vc1_reset\n" );
+ reset_sequence( &this->sequence );
+}
+
+/*
+ * The decoder should forget any stored pts values here.
+ */
+static void vdpau_vc1_discontinuity (video_decoder_t *this_gen) {
+ vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen;
+
+ lprintf( "vdpau_vc1_discontinuity\n" );
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void vdpau_vc1_dispose (video_decoder_t *this_gen) {
+
+ vdpau_vc1_decoder_t *this = (vdpau_vc1_decoder_t *) this_gen;
+
+ lprintf( "vdpau_vc1_dispose\n" );
+
+ if ( this->decoder!=VDP_INVALID_HANDLE && this->sequence.accel_vdpau ) {
+ this->sequence.accel_vdpau->vdp_decoder_destroy( this->decoder );
+ this->decoder = VDP_INVALID_HANDLE;
+ }
+
+ reset_sequence( &this->sequence );
+
+ this->stream->video_out->close( this->stream->video_out, this->stream );
+
+ free( this->sequence.buf );
+ free( this_gen );
+}
+
+/*
+ * This function allocates, initializes, and returns a private video
+ * decoder structure.
+ */
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ vdpau_vc1_decoder_t *this ;
+
+ lprintf( "open_plugin\n" );
+
+ /* the videoout must be vdpau-capable to support this decoder */
+ if ( !(stream->video_driver->get_capabilities(stream->video_driver) & VO_CAP_VDPAU_VC1) )
+ return NULL;
+
+ /* now check if vdpau has free decoder resource */
+ vo_frame_t *img = stream->video_out->get_frame( stream->video_out, 1920, 1080, 1, XINE_IMGFMT_VDPAU, VO_BOTH_FIELDS );
+ vdpau_accel_t *accel = (vdpau_accel_t*)img->accel_data;
+ int runtime_nr = accel->vdp_runtime_nr;
+ img->free(img);
+ VdpDecoder decoder;
+ VdpStatus st = accel->vdp_decoder_create( accel->vdp_device, VDP_DECODER_PROFILE_VC1_MAIN, 1920, 1080, 2, &decoder );
+ if ( st!=VDP_STATUS_OK ) {
+ lprintf( "can't create vdpau decoder.\n" );
+ return NULL;
+ }
+
+ accel->vdp_decoder_destroy( decoder );
+
+ this = (vdpau_vc1_decoder_t *) calloc(1, sizeof(vdpau_vc1_decoder_t));
+
+ this->video_decoder.decode_data = vdpau_vc1_decode_data;
+ this->video_decoder.flush = vdpau_vc1_flush;
+ this->video_decoder.reset = vdpau_vc1_reset;
+ this->video_decoder.discontinuity = vdpau_vc1_discontinuity;
+ this->video_decoder.dispose = vdpau_vc1_dispose;
+
+ this->stream = stream;
+ this->class = (vdpau_vc1_class_t *) class_gen;
+
+ this->sequence.bufsize = 10000;
+ this->sequence.buf = (uint8_t*)malloc(this->sequence.bufsize);
+ this->sequence.forward_ref = 0;
+ this->sequence.backward_ref = 0;
+ this->sequence.vdp_runtime_nr = runtime_nr;
+ init_sequence( &this->sequence );
+
+ init_picture( &this->sequence.picture );
+
+ this->decoder = VDP_INVALID_HANDLE;
+ this->sequence.accel_vdpau = NULL;
+ this->sequence.mode = MODE_STARTCODE;
+
+ (stream->video_out->open)(stream->video_out, stream);
+
+#ifdef MAKE_DAT
+ outfile = fopen( "/tmp/vc1.dat","w");
+ nframes = 0;
+#endif
+
+ return &this->video_decoder;
+}
+
+/*
+ * This function allocates a private video decoder class and initializes
+ * the class's member functions.
+ */
+static void *init_plugin (xine_t *xine, void *data) {
+
+ vdpau_vc1_class_t *this;
+
+ this = (vdpau_vc1_class_t *) calloc(1, sizeof(vdpau_vc1_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "vdpau_vc1";
+ this->decoder_class.description =
+ N_("vdpau_vc1: vc1 decoder plugin using VDPAU hardware decoding.\n"
+ "Must be used along with video_out_vdpau.");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * This is a list of all of the internal xine video 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 const uint32_t video_types[] = {
+ BUF_VIDEO_VC1, BUF_VIDEO_WMV9,
+ 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_video = {
+ video_types, /* supported types */
+ 8 /* 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, "name", version, special_info, init_function } */
+ { PLUGIN_VIDEO_DECODER, 19, "vdpau_vc1", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/rgb.c b/src/video_dec/rgb.c
new file mode 100644
index 000000000..678ce8194
--- /dev/null
+++ b/src/video_dec/rgb.c
@@ -0,0 +1,451 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * Raw RGB "Decoder" by Mike Melanson (melanson@pcisys.net)
+ * Actually, this decoder just converts a raw RGB image to a YUY2 map
+ * suitable for display under xine.
+ *
+ * This decoder deals with raw RGB data from Microsoft and Quicktime files.
+ * Data from a MS file can be 32-, 24-, 16-, or 8-bit. The latter can also
+ * be grayscale, depending on whether a palette is present. Data from a QT
+ * file can be 32-, 24-, 16-, 8-, 4-, 2-, or 1-bit. Any resolutions <= 8
+ * can also be greyscale depending on what the QT file specifies.
+ *
+ * One more catch: Raw RGB from a Microsoft file is upside down. This is
+ * indicated by a negative height parameter.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#define LOG_MODULE "rgb"
+#define LOG_VERBOSE
+/*
+#define LOG
+*/
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} rgb_class_t;
+
+typedef struct rgb_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ rgb_class_t *class;
+ xine_stream_t *stream;
+
+ /* these are traditional variables in a video decoder object */
+ uint64_t video_step; /* frame duration in pts units */
+ int decoder_ok; /* current decoder status */
+ int skipframes;
+
+ unsigned char *buf; /* the accumulated buffer data */
+ int bufsize; /* the maximum size of buf */
+ int size; /* the current size of buf */
+
+ int width; /* the width of a video frame */
+ int height; /* the height of a video frame */
+ double ratio; /* the width to height ratio */
+ int bytes_per_pixel;
+ int bit_depth;
+ int upside_down;
+
+ unsigned char yuv_palette[256 * 4];
+ yuv_planes_t yuv_planes;
+
+} rgb_decoder_t;
+
+static void rgb_decode_data (video_decoder_t *this_gen,
+ buf_element_t *buf) {
+
+ rgb_decoder_t *this = (rgb_decoder_t *) this_gen;
+ xine_bmiheader *bih;
+ palette_entry_t *palette;
+ int i;
+ int pixel_ptr, row_ptr;
+ int palette_index;
+ int buf_ptr;
+ unsigned int packed_pixel;
+ unsigned char r, g, b;
+ int pixels_left;
+ unsigned char pixel_byte = 0;
+
+ vo_frame_t *img; /* video out frame */
+
+ /* a video decoder does not care about this flag (?) */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if ((buf->decoder_flags & BUF_FLAG_SPECIAL) &&
+ (buf->decoder_info[1] == BUF_SPECIAL_PALETTE)) {
+ palette = (palette_entry_t *)buf->decoder_info_ptr[2];
+ for (i = 0; i < buf->decoder_info[2]; i++) {
+ this->yuv_palette[i * 4 + 0] =
+ COMPUTE_Y(palette[i].r, palette[i].g, palette[i].b);
+ this->yuv_palette[i * 4 + 1] =
+ COMPUTE_U(palette[i].r, palette[i].g, palette[i].b);
+ this->yuv_palette[i * 4 + 2] =
+ COMPUTE_V(palette[i].r, palette[i].g, palette[i].b);
+ }
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
+ this->video_step = buf->decoder_info[0];
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+
+ bih = (xine_bmiheader *) buf->content;
+ this->width = (bih->biWidth + 3) & ~0x03;
+ this->height = (bih->biHeight + 3) & ~0x03;
+ if (this->height < 0) {
+ this->upside_down = 1;
+ this->height = -this->height;
+ } else {
+ this->upside_down = 0;
+ }
+ this->ratio = (double)this->width/(double)this->height;
+
+ this->bit_depth = bih->biBitCount;
+ if (this->bit_depth > 32)
+ this->bit_depth &= 0x1F;
+ /* round this number up in case of 15 */
+ lprintf("width = %d, height = %d, bit_depth = %d\n", this->width, this->height, this->bit_depth);
+
+ this->bytes_per_pixel = (this->bit_depth + 1) / 8;
+
+ free (this->buf);
+
+ /* minimal buffer size */
+ this->bufsize = this->width * this->height * this->bytes_per_pixel;
+ this->buf = calloc(1, this->bufsize);
+ this->size = 0;
+
+ init_yuv_planes(&this->yuv_planes, this->width, this->height);
+
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+ this->decoder_ok = 1;
+
+ /* load the stream/meta info */
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw RGB");
+
+ return;
+ } else if (this->decoder_ok) {
+
+ if (this->size + buf->size > this->bufsize) {
+ this->bufsize = this->size + 2 * buf->size;
+ this->buf = realloc (this->buf, this->bufsize);
+ }
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+
+ this->size += buf->size;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YUY2,
+ VO_BOTH_FIELDS);
+
+ img->duration = this->video_step;
+ img->pts = buf->pts;
+ img->bad_frame = 0;
+
+
+ /* iterate through each row */
+ buf_ptr = 0;
+
+ if (this->upside_down) {
+ for (row_ptr = this->yuv_planes.row_width * (this->yuv_planes.row_count - 1);
+ row_ptr >= 0; row_ptr -= this->yuv_planes.row_width) {
+ for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) {
+
+ if (this->bytes_per_pixel == 1) {
+
+ palette_index = this->buf[buf_ptr++];
+
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 0];
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 1];
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 2];
+
+ } else if (this->bytes_per_pixel == 2) {
+
+ /* ABGR1555 format, little-endian order */
+ packed_pixel = _X_LE_16(&this->buf[buf_ptr]);
+ buf_ptr += 2;
+ UNPACK_BGR15(packed_pixel, r, g, b);
+
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ COMPUTE_Y(r, g, b);
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ COMPUTE_U(r, g, b);
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ COMPUTE_V(r, g, b);
+
+ } else {
+
+ /* BGR24 or BGRA32 */
+ b = this->buf[buf_ptr++];
+ g = this->buf[buf_ptr++];
+ r = this->buf[buf_ptr++];
+
+ /* the next line takes care of 'A' in the 32-bit case */
+ buf_ptr += this->bytes_per_pixel - 3;
+
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ COMPUTE_Y(r, g, b);
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ COMPUTE_U(r, g, b);
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ COMPUTE_V(r, g, b);
+
+ }
+ }
+ }
+ } else {
+
+ for (row_ptr = 0; row_ptr < this->yuv_planes.row_width * this->yuv_planes.row_count; row_ptr += this->yuv_planes.row_width) {
+ pixels_left = 0;
+ for (pixel_ptr = 0; pixel_ptr < this->width; pixel_ptr++) {
+
+ if (this->bit_depth == 1) {
+
+ if (pixels_left == 0) {
+ pixels_left = 8;
+ pixel_byte = *this->buf++;
+ }
+
+ if (pixel_byte & 0x80) {
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ this->yuv_palette[1 * 4 + 0];
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ this->yuv_palette[1 * 4 + 1];
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ this->yuv_palette[1 * 4 + 2];
+ } else {
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ this->yuv_palette[0 * 4 + 0];
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ this->yuv_palette[0 * 4 + 1];
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ this->yuv_palette[0 * 4 + 2];
+ }
+ pixels_left--;
+ pixel_byte <<= 1;
+
+ } else if (this->bit_depth == 2) {
+
+ if (pixels_left == 0) {
+ pixels_left = 4;
+ pixel_byte = *this->buf++;
+ }
+
+ palette_index = (pixel_byte & 0xC0) >> 6;
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 0];
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 1];
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 2];
+
+ pixels_left--;
+ pixel_byte <<= 2;
+
+ } else if (this->bit_depth == 4) {
+
+ if (pixels_left == 0) {
+ pixels_left = 2;
+ pixel_byte = *this->buf++;
+ }
+
+ palette_index = (pixel_byte & 0xF0) >> 4;
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 0];
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 1];
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 2];
+
+ pixels_left--;
+ pixel_byte <<= 4;
+
+ } else if (this->bytes_per_pixel == 1) {
+
+ palette_index = this->buf[buf_ptr++];
+
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 0];
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 1];
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ this->yuv_palette[palette_index * 4 + 2];
+
+ } else if (this->bytes_per_pixel == 2) {
+
+ /* ARGB1555 format, big-endian order */
+ packed_pixel = _X_BE_16(&this->buf[buf_ptr]);
+ buf_ptr += 2;
+ UNPACK_RGB15(packed_pixel, r, g, b);
+
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ COMPUTE_Y(r, g, b);
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ COMPUTE_U(r, g, b);
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ COMPUTE_V(r, g, b);
+
+ } else {
+
+ /* RGB24 or ARGB32; the next line takes care of 'A' in the
+ * 32-bit case */
+ buf_ptr += this->bytes_per_pixel - 3;
+
+ r = this->buf[buf_ptr++];
+ g = this->buf[buf_ptr++];
+ b = this->buf[buf_ptr++];
+
+ this->yuv_planes.y[row_ptr + pixel_ptr] =
+ COMPUTE_Y(r, g, b);
+ this->yuv_planes.u[row_ptr + pixel_ptr] =
+ COMPUTE_U(r, g, b);
+ this->yuv_planes.v[row_ptr + pixel_ptr] =
+ COMPUTE_V(r, g, b);
+
+ }
+ }
+ }
+ }
+
+ yuv444_to_yuy2(&this->yuv_planes, img->base[0], img->pitches[0]);
+
+ img->draw(img, this->stream);
+ img->free(img);
+
+ this->size = 0;
+ }
+ }
+}
+
+/*
+ * This function is called when xine needs to flush the system. Not
+ * sure when or if this is used or even if it needs to do anything.
+ */
+static void rgb_flush (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void rgb_reset (video_decoder_t *this_gen) {
+ rgb_decoder_t *this = (rgb_decoder_t *) this_gen;
+
+ this->size = 0;
+}
+
+static void rgb_discontinuity (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void rgb_dispose (video_decoder_t *this_gen) {
+ rgb_decoder_t *this = (rgb_decoder_t *) this_gen;
+
+ free (this->buf);
+
+ if (this->decoder_ok) {
+ this->decoder_ok = 0;
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ }
+
+ free (this_gen);
+}
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ rgb_decoder_t *this ;
+
+ this = (rgb_decoder_t *) calloc(1, sizeof(rgb_decoder_t));
+
+ this->video_decoder.decode_data = rgb_decode_data;
+ this->video_decoder.flush = rgb_flush;
+ this->video_decoder.reset = rgb_reset;
+ this->video_decoder.discontinuity = rgb_discontinuity;
+ this->video_decoder.dispose = rgb_dispose;
+ this->size = 0;
+
+ this->stream = stream;
+ this->class = (rgb_class_t *) class_gen;
+
+ this->decoder_ok = 0;
+ this->buf = NULL;
+
+ return &this->video_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ rgb_class_t *this;
+
+ this = (rgb_class_t *) calloc(1, sizeof(rgb_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "RGB";
+ this->decoder_class.description = N_("Raw RGB video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t video_types[] = {
+ BUF_VIDEO_RGB,
+ 0
+ };
+
+static const decoder_info_t dec_info_video = {
+ video_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "rgb", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_dec/yuv.c b/src/video_dec/yuv.c
new file mode 100644
index 000000000..c1a8b1829
--- /dev/null
+++ b/src/video_dec/yuv.c
@@ -0,0 +1,377 @@
+/*
+ * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
+ *
+ * YUV "Decoder" by Mike Melanson (melanson@pcisys.net)
+ * Actually, this decoder just reorganizes chunks of raw YUV data in such
+ * a way that xine can display them.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include "bswap.h"
+
+#define VIDEOBUFSIZE 128*1024
+
+typedef struct {
+ video_decoder_class_t decoder_class;
+} yuv_class_t;
+
+typedef struct yuv_decoder_s {
+ video_decoder_t video_decoder; /* parent video decoder structure */
+
+ yuv_class_t *class;
+ xine_stream_t *stream;
+
+ /* these are traditional variables in a video decoder object */
+ uint64_t video_step; /* frame duration in pts units */
+ int decoder_ok; /* current decoder status */
+ int skipframes;
+
+ unsigned char *buf; /* the accumulated buffer data */
+ int bufsize; /* the maximum size of buf */
+ int size; /* the current size of buf */
+
+ int width; /* the width of a video frame */
+ int height; /* the height of a video frame */
+ double ratio; /* the width to height ratio */
+
+ int progressive;
+ int top_field_first;
+
+} yuv_decoder_t;
+
+/**************************************************************************
+ * xine video plugin functions
+ *************************************************************************/
+
+/*
+ * This function receives a buffer of data from the demuxer layer and
+ * figures out how to handle it based on its header flags.
+ */
+static void yuv_decode_data (video_decoder_t *this_gen,
+ buf_element_t *buf) {
+
+ yuv_decoder_t *this = (yuv_decoder_t *) this_gen;
+ xine_bmiheader *bih;
+
+ vo_frame_t *img; /* video out frame */
+
+ /* a video decoder does not care about this flag (?) */
+ if (buf->decoder_flags & BUF_FLAG_PREVIEW)
+ return;
+
+ if (buf->decoder_flags & BUF_FLAG_FRAMERATE) {
+ this->video_step = buf->decoder_info[0];
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_FRAME_DURATION, this->video_step);
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_STDHEADER) { /* need to initialize */
+ (this->stream->video_out->open) (this->stream->video_out, this->stream);
+
+ bih = (xine_bmiheader *) buf->content;
+ this->width = (bih->biWidth + 3) & ~0x03;
+ this->height = (bih->biHeight + 3) & ~0x03;
+
+ if (buf->decoder_flags & BUF_FLAG_ASPECT)
+ this->ratio = (double)buf->decoder_info[1] / (double)buf->decoder_info[2];
+ else
+ this->ratio = (double)this->width / (double)this->height;
+
+ this->progressive = buf->decoder_info[3];
+ this->top_field_first = buf->decoder_info[4];
+
+ free (this->buf);
+ this->buf = NULL;
+
+ this->bufsize = VIDEOBUFSIZE;
+ this->buf = malloc(this->bufsize);
+ this->size = 0;
+
+ this->decoder_ok = 1;
+
+ /* load the stream/meta info */
+ switch (buf->type) {
+
+ case BUF_VIDEO_YUY2:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw YUY2");
+ break;
+
+ case BUF_VIDEO_YV12:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw YV12");
+ break;
+
+ case BUF_VIDEO_YVU9:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw YVU9");
+ break;
+
+ case BUF_VIDEO_GREY:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Greyscale YUV");
+ break;
+
+ case BUF_VIDEO_I420:
+ _x_meta_info_set_utf8(this->stream, XINE_META_INFO_VIDEOCODEC, "Raw I420");
+ break;
+
+ }
+
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_WIDTH, this->width);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_HEIGHT, this->height);
+ _x_stream_info_set(this->stream, XINE_STREAM_INFO_VIDEO_RATIO, this->ratio*10000);
+
+ return;
+ } else if (this->decoder_ok && !(buf->decoder_flags & BUF_FLAG_SPECIAL)) {
+ uint8_t *src;
+
+ /* if buffer contains an entire frame then there's no need to copy it
+ * into our internal buffer */
+ if ((buf->decoder_flags & BUF_FLAG_FRAME_START) &&
+ (buf->decoder_flags & BUF_FLAG_FRAME_END))
+ src = buf->content;
+ else {
+ if (this->size + buf->size > this->bufsize) {
+ this->bufsize = this->size + 2 * buf->size;
+ this->buf = realloc (this->buf, this->bufsize);
+ }
+
+ xine_fast_memcpy (&this->buf[this->size], buf->content, buf->size);
+
+ this->size += buf->size;
+
+ src = this->buf;
+ }
+
+ if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
+
+ if (buf->type == BUF_VIDEO_YUY2) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YUY2, VO_BOTH_FIELDS);
+
+ yuy2_to_yuy2(
+ /* src */
+ src, this->width*2,
+ /* dst */
+ img->base[0], img->pitches[0],
+ /* width x height */
+ this->width, this->height);
+
+ } else if (buf->type == BUF_VIDEO_YV12) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
+
+ yv12_to_yv12(
+ /* Y */
+ src, this->width,
+ img->base[0], img->pitches[0],
+ /* U */
+ src + (this->width * this->height * 5/4), this->width/2,
+ img->base[1], img->pitches[1],
+ /* V */
+ src + (this->width * this->height), this->width/2,
+ img->base[2], img->pitches[2],
+ /* width x height */
+ this->width, this->height);
+
+ } else if (buf->type == BUF_VIDEO_I420) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
+
+ yv12_to_yv12(
+ /* Y */
+ src, this->width,
+ img->base[0], img->pitches[0],
+ /* U */
+ src + (this->width * this->height), this->width/2,
+ img->base[1], img->pitches[1],
+ /* V */
+ src + (this->width * this->height * 5/4), this->width/2,
+ img->base[2], img->pitches[2],
+ /* width x height */
+ this->width, this->height);
+
+ } else if (buf->type == BUF_VIDEO_YVU9) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
+
+
+ yuv9_to_yv12(
+ /* Y */
+ src,
+ this->width,
+ img->base[0],
+ img->pitches[0],
+ /* U */
+ src + (this->width * this->height),
+ this->width / 4,
+ img->base[1],
+ img->pitches[1],
+ /* V */
+ src + (this->width * this->height) +
+ (this->width * this->height / 16),
+ this->width / 4,
+ img->base[2],
+ img->pitches[2],
+ /* width x height */
+ this->width,
+ this->height);
+
+ } else if (buf->type == BUF_VIDEO_GREY) {
+
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
+
+ xine_fast_memcpy(img->base[0], src, this->width * this->height);
+ memset( img->base[1], 0x80, this->width * this->height / 4 );
+ memset( img->base[2], 0x80, this->width * this->height / 4 );
+
+ } else {
+
+ /* just allocate something to avoid compiler warnings */
+ img = this->stream->video_out->get_frame (this->stream->video_out,
+ this->width, this->height,
+ this->ratio, XINE_IMGFMT_YV12, VO_BOTH_FIELDS);
+
+ }
+
+ img->duration = this->video_step;
+ img->pts = buf->pts;
+ img->bad_frame = 0;
+
+ img->draw(img, this->stream);
+ img->free(img);
+
+ this->size = 0;
+ }
+ }
+}
+
+/*
+ * This function is called when xine needs to flush the system. Not
+ * sure when or if this is used or even if it needs to do anything.
+ */
+static void yuv_flush (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function resets the video decoder.
+ */
+static void yuv_reset (video_decoder_t *this_gen) {
+ yuv_decoder_t *this = (yuv_decoder_t *) this_gen;
+
+ this->size = 0;
+}
+
+static void yuv_discontinuity (video_decoder_t *this_gen) {
+}
+
+/*
+ * This function frees the video decoder instance allocated to the decoder.
+ */
+static void yuv_dispose (video_decoder_t *this_gen) {
+ yuv_decoder_t *this = (yuv_decoder_t *) this_gen;
+
+ free (this->buf);
+
+ if (this->decoder_ok) {
+ this->decoder_ok = 0;
+ this->stream->video_out->close(this->stream->video_out, this->stream);
+ }
+
+ free (this_gen);
+}
+
+static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
+
+ yuv_decoder_t *this ;
+
+ this = (yuv_decoder_t *) calloc(1, sizeof(yuv_decoder_t));
+
+ this->video_decoder.decode_data = yuv_decode_data;
+ this->video_decoder.flush = yuv_flush;
+ this->video_decoder.reset = yuv_reset;
+ this->video_decoder.discontinuity = yuv_discontinuity;
+ this->video_decoder.dispose = yuv_dispose;
+ this->size = 0;
+
+ this->stream = stream;
+ this->class = (yuv_class_t *) class_gen;
+
+ this->decoder_ok = 0;
+ this->buf = NULL;
+
+ return &this->video_decoder;
+}
+
+static void *init_plugin (xine_t *xine, void *data) {
+
+ yuv_class_t *this;
+
+ this = (yuv_class_t *) calloc(1, sizeof(yuv_class_t));
+
+ this->decoder_class.open_plugin = open_plugin;
+ this->decoder_class.identifier = "YUV";
+ this->decoder_class.description = N_("Raw YUV video decoder plugin");
+ this->decoder_class.dispose = default_video_decoder_class_dispose;
+
+ return this;
+}
+
+/*
+ * exported plugin catalog entry
+ */
+
+static const uint32_t video_types[] = {
+ BUF_VIDEO_YUY2,
+ BUF_VIDEO_YV12,
+ BUF_VIDEO_YVU9,
+ BUF_VIDEO_GREY,
+ BUF_VIDEO_I420,
+ 0
+ };
+
+static const decoder_info_t dec_info_video = {
+ video_types, /* supported types */
+ 1 /* priority */
+};
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_DECODER, 19, "yuv", XINE_VERSION_CODE, &dec_info_video, init_plugin },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_out/Makefile.am b/src/video_out/Makefile.am
index 4923bea57..9ae05d6f7 100644
--- a/src/video_out/Makefile.am
+++ b/src/video_out/Makefile.am
@@ -1,15 +1,20 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_builddir)/misc/Makefile.plugins
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 =
-EXTRA_DIST = video_out_directfb.c video_out_directfb_fb.c video_out_directfb_x.c video_out_directx.c video_out_macosx.m
+if ENABLE_MACOSX_VIDEO
+SUBDIRS += macosx
+endif
+
+EXTRA_DIST = 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 = yuv2rgb.h x11osd.h xcbosd.h xv_common.h
if HAVE_X11
X11OSD = x11osd.c
@@ -17,86 +22,88 @@ 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
-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_VDPAU
+vdpau_module = xineplug_vo_out_vdpau.la
+endif
+
+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
noinst_LTLIBRARIES = libyuv2rgb.la
libyuv2rgb_la_SOURCES = yuv2rgb.c yuv2rgb_mmx.c yuv2rgb_mlib.c
-libyuv2rgb_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS)
+libyuv2rgb_la_CFLAGS = $(AM_CFLAGS) $(MLIB_CFLAGS) $(AVUTIL_CFLAGS)
# All YUV lib info here to avoid polluting the .la with this info
-YUV_LIBS = libyuv2rgb.la $(XINE_LIB) $(MLIB_LIBS)
+YUV_LIBS = libyuv2rgb.la $(XINE_LIB) $(MLIB_LIBS) $(AVUTIL_LIBS)
xineplug_LTLIBRARIES = $(xshm_module) $(xv_module) $(xvmc_module) \
$(opengl_module) \
- $(syncfb_module) \
$(pgx64_module) $(pgx32_module)\
$(vidix_module) \
$(aa_module) \
@@ -109,106 +116,101 @@ xineplug_LTLIBRARIES = $(xshm_module) $(xv_module) $(xvmc_module) \
$(xxmc_module) \
$(xcbshm_module) \
$(xcbxv_module) \
+ $(vdpau_module) \
xineplug_vo_out_raw.la \
xineplug_vo_out_none.la
+xineplug_vo_out_vdpau_la_SOURCES = video_out_vdpau.c
+xineplug_vo_out_vdpau_la_LIBADD = $(XINE_LIB) $(MLIB_LIBS) $(AVUTIL_LIBS) $(PTHREAD_LIBS) $(X_LIBS) $(LTLIBINTL) $(VDPAU_LIBS) -lm
+xineplug_vo_out_vdpau_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS) $(X_CFLAGS) $(VDPAU_CFLAGS) $(AVUTIL_CFLAGS) -fno-strict-aliasing
+
xineplug_vo_out_xcbshm_la_SOURCES = video_out_xcbshm.c $(XCBOSD)
xineplug_vo_out_xcbshm_la_LIBADD = $(YUV_LIBS) $(PTHREAD_LIBS) $(XCB_LIBS) $(XCBSHM_LIBS) $(LTLIBINTL)
-xineplug_vo_out_xcbshm_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS) $(XCB_CFLAGS) $(XCBSHM_CFLAGS) -fno-strict-aliasing
+xineplug_vo_out_xcbshm_la_CFLAGS = $(AM_CFLAGS) $(XCB_CFLAGS) $(XCBSHM_CFLAGS) $(AVUTIL_CFLAGS) -fno-strict-aliasing
-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) -fno-strict-aliasing
+xineplug_vo_out_xcbxv_la_CFLAGS = $(AM_CFLAGS) $(XCB_CFLAGS) $(XCBXV_CFLAGS) -fno-strict-aliasing
xineplug_vo_out_xshm_la_SOURCES = video_out_xshm.c $(X11OSD)
xineplug_vo_out_xshm_la_LIBADD = $(YUV_LIBS) $(X_LIBS) $(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) $(AVUTIL_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 = $(XINE_LIB) $(XV_LIBS) $(X_LIBS) $(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 = $(XINE_LIB) $(XVMC_LIBS) $(XV_LIBS) $(X_LIBS) $(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) -fno-strict-aliasing
-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 = $(XINE_LIB) $(XXMC_LIBS) $(XV_LIBS) $(X_LIBS) $(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 = video_out_opengl.c myglext.h $(X11OSD)
-xineplug_vo_out_opengl_la_LIBADD = $(YUV_LIBS) $(OPENGL_LIBS) \
+xineplug_vo_out_opengl_la_LIBADD = $(YUV_LIBS) $(OPENGL_LIBS) $(GLUT_LIBS) \
$(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_opengl_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS) $(MLIB_CFLAGS) -fno-strict-aliasing
-
-xineplug_vo_out_syncfb_la_SOURCES = video_out_syncfb.c
-xineplug_vo_out_syncfb_la_LIBADD = $(XINE_LIB) $(X_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_syncfb_la_CFLAGS = $(VISIBILITY_FLAG) $(X_CFLAGS)
+xineplug_vo_out_opengl_la_CFLAGS = $(AM_CFLAGS) $(X_CFLAGS) $(AVUTIL_CFLAGS) -fno-strict-aliasing
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 = $(XINE_LIB) $(AALIB_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_aa_la_CFLAGS = $(VISIBILITY_FLAG) $(AALIB_CFLAGS)
+xineplug_vo_out_aa_la_LIBADD = $(XINE_LIB) $(AALIB_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL) $(AVUTIL_LIBS)
+xineplug_vo_out_aa_la_CFLAGS = $(AM_CFLAGS) $(AALIB_CFLAGS) $(AVUTIL_CFLAGS)
xineplug_vo_out_caca_la_SOURCES = video_out_caca.c
xineplug_vo_out_caca_la_LIBADD = $(YUV_LIBS) $(CACA_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_caca_la_CFLAGS = $(VISIBILITY_FLAG) $(CACA_CFLAGS)
+xineplug_vo_out_caca_la_CFLAGS = $(AM_CFLAGS) $(CACA_CFLAGS) $(AVUTIL_CFLAGS)
xineplug_vo_out_fb_la_SOURCES = video_out_fb.c
xineplug_vo_out_fb_la_LIBADD = $(YUV_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_fb_la_CFLAGS = $(VISIBILITY_FLAG) $(MLIB_CFLAGS)
+xineplug_vo_out_fb_la_CFLAGS = $(AM_CFLAGS) $(AVUTIL_CFLAGS)
-xineplug_vo_out_directfb_la_SOURCES = video_out_directfb_fb.c
+xineplug_vo_out_directfb_la_SOURCES = video_out_directfb.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_SOURCES = video_out_directfb.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 -DDIRECTFB_X11
xineplug_vo_out_sdl_la_SOURCES = video_out_sdl.c
xineplug_vo_out_sdl_la_LIBADD = $(XINE_LIB) $(SDL_LIBS) $(X_LIBS) $(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 = video_out_directx.c
-xineplug_vo_out_directx_la_CPPFLAGS = $(AM_CPPFLAGS) $(DIRECTX_CPPFLAGS)
xineplug_vo_out_directx_la_LIBADD = $(YUV_LIBS) $(DIRECTX_VIDEO_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-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_raw_la_SOURCES = video_out_raw.c
xineplug_vo_out_raw_la_LIBADD = $(YUV_LIBS) $(PTHREAD_LIBS) $(LTLIBINTL)
-xineplug_vo_out_raw_la_CFLAGS = $(VISIBILITY_FLAG)
+xineplug_vo_out_raw_la_CFLAGS = $(AM_CFLAGS) $(AVUTIL_CFLAGS) -fno-strict-aliasing
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 = $(XINE_LIB) $(MLIB_LIBS) $(OPENGL_LIBS) \
- $(GLUT_LIBS) $(GLU_LIBS) $(X_LIBS) $(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 xv_common.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 6d90caca0..000000000
--- a/src/video_out/deinterlace.c
+++ /dev/null
@@ -1,863 +0,0 @@
- /*
- * Copyright (C) 2001-2008 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, 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
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include "xine_internal.h"
-#include "deinterlace.h"
-#include "xineutils.h"
-
-
-const char *deinterlace_methods[] = {
- "none",
- "bob",
- "weave",
- "greedy",
- "onefield",
- "onefield_xv",
- "linearblend",
- NULL
-};
-
-
-/*
- 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 d7712f581..000000000
--- a/src/video_out/deinterlace.h
+++ /dev/null
@@ -1,46 +0,0 @@
- /*
- * Copyright (C) 2001-2008 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, 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
-
-extern const char *deinterlace_methods[];
-
-#endif
diff --git a/src/video_out/libdha/Makefile.am b/src/video_out/libdha/Makefile.am
deleted file mode 100644
index 9412bcd50..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/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/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/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/sysdep/Makefile.am b/src/video_out/libdha/sysdep/Makefile.am
deleted file mode 100644
index 0896a8ded..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/macosx/Makefile.am b/src/video_out/macosx/Makefile.am
index a69f30dc5..57c49dcc8 100644
--- a/src/video_out/macosx/Makefile.am
+++ b/src/video_out/macosx/Makefile.am
@@ -1,27 +1,13 @@
+include $(top_srcdir)/misc/Makefile.quiet
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/macosx/XineOpenGLView.m b/src/video_out/macosx/XineOpenGLView.m
index 1f947ca16..cad087551 100644
--- a/src/video_out/macosx/XineOpenGLView.m
+++ b/src/video_out/macosx/XineOpenGLView.m
@@ -30,11 +30,7 @@
#import "XineOpenGLView.h"
-#ifdef XINE_COMPILE
-# include "xineutils.h"
-#else
-# include <xine/xineutils.h>
-#endif
+#include <xine/xineutils.h>
NSString *XineViewDidResizeNotification EXPORTED = @"XineViewDidResizeNotification";
diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c
index 2f20bd7c0..1af250162 100644
--- a/src/video_out/video_out_aa.c
+++ b/src/video_out/video_out_aa.c
@@ -35,12 +35,18 @@
#include <sys/mman.h>
#include <sys/time.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#include <aalib.h>
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
/*
* global variables
@@ -51,7 +57,6 @@ typedef struct aa_frame_s {
vo_frame_t vo_frame;
int width, height;
- uint8_t *mem[3];
double ratio;
@@ -87,12 +92,9 @@ static uint32_t aa_get_capabilities (vo_driver_t *this) {
static void aa_dispose_frame (vo_frame_t *vo_img) {
aa_frame_t *frame = (aa_frame_t *)vo_img;
- if (frame->mem[0])
- free (frame->mem[0]);
- if (frame->mem[1])
- free (frame->mem[1]);
- if (frame->mem[2])
- free (frame->mem[2]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
free (frame);
}
@@ -132,19 +134,9 @@ static void aa_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img,
if ((frame->width != width) || (frame->height != height)
|| (frame->format != format)) {
- if (frame->mem[0]) {
- free (frame->mem[0]);
- frame->mem[0] = NULL;
- }
- if (frame->mem[1]) {
- free (frame->mem[1]);
- frame->mem[1] = NULL;
- }
-
- if (frame->mem[2]) {
- free (frame->mem[2]);
- frame->mem[2] = NULL;
- }
+ av_freep (&frame->vo_frame.base[0]);
+ av_freep (&frame->vo_frame.base[1]);
+ av_freep (&frame->vo_frame.base[2]);
frame->width = width;
frame->height = height;
@@ -155,15 +147,15 @@ static void aa_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img,
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[1] * ((height+1)/2), (void**) &frame->mem[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[2] * ((height+1)/2), (void**) &frame->mem[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
/* printf ("allocated yuv memory for %d x %d image\n", width, height); */
} else if (format == XINE_IMGFMT_YUY2) {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
} else {
xprintf (this->xine, XINE_VERBOSITY_DEBUG, "alert! unsupported image format %04x\n", format);
_x_abort();
@@ -300,18 +292,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
return &this->vo_driver;
}
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "AA";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the ascii-art library");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- aa_class_t *this = (aa_class_t *) this_gen;
- free(this);
-}
static void *init_class (xine_t *xine, void *visual_gen) {
/* aa_context *context = (aa_context*) visual_gen; */
aa_class_t *this;
@@ -319,9 +299,9 @@ static void *init_class (xine_t *xine, void *visual_gen) {
this = calloc(1, sizeof(aa_class_t));
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->driver_class.identifier = "AA";
+ this->driver_class.description = N_("xine video output plugin using the ascii-art library");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -336,6 +316,6 @@ static const vo_info_t vo_info_aa = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "aa", XINE_VERSION_CODE, &vo_info_aa, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "aa", XINE_VERSION_CODE, &vo_info_aa, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c
index 5a060151e..f50a39779 100644
--- a/src/video_out/video_out_caca.c
+++ b/src/video_out/video_out_caca.c
@@ -37,11 +37,17 @@
#include <cucul.h>
#include <caca.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
/*
* structures
@@ -54,7 +60,6 @@ typedef struct caca_frame_s {
cucul_dither_t *pixmap_s; /* pixmap info structure */
uint8_t *pixmap_d; /* pixmap data */
int width, height;
- uint8_t *mem[3];
int format; /* XINE_IMGFMT_* flags */
@@ -94,15 +99,11 @@ static uint32_t caca_get_capabilities (vo_driver_t *this) {
static void caca_dispose_frame (vo_frame_t *vo_img) {
caca_frame_t *frame = (caca_frame_t *)vo_img;
- if (frame->mem[0])
- free (frame->mem[0]);
- if (frame->mem[1])
- free (frame->mem[1]);
- if (frame->mem[2])
- free (frame->mem[2]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
- if (frame->pixmap_d)
- free (frame->pixmap_d);
+ free (frame->pixmap_d);
if (frame->pixmap_s)
cucul_free_dither (frame->pixmap_s);
@@ -148,23 +149,12 @@ static void caca_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img,
if ((frame->width != width) || (frame->height != height)
|| (frame->format != format)) {
- if (frame->mem[0]) {
- free (frame->mem[0]);
- frame->mem[0] = NULL;
- }
- if (frame->mem[1]) {
- free (frame->mem[1]);
- frame->mem[1] = NULL;
- }
- if (frame->mem[2]) {
- free (frame->mem[2]);
- frame->mem[2] = NULL;
- }
+ av_freep (&frame->vo_frame.base[0]);
+ av_freep (&frame->vo_frame.base[1]);
+ av_freep (&frame->vo_frame.base[2]);
+
+ free (frame->pixmap_d); frame->pixmap_d = NULL;
- if (frame->pixmap_d) {
- free (frame->pixmap_d);
- frame->pixmap_d = NULL;
- }
if (frame->pixmap_s) {
cucul_free_dither (frame->pixmap_s);
frame->pixmap_s = NULL;
@@ -182,19 +172,15 @@ static void caca_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img,
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[1] * ((height+1)/2), (void**) &frame->mem[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[2] * ((height+1)/2), (void**) &frame->mem[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
frame->yuv2rgb->configure (frame->yuv2rgb,
width, height, frame->vo_frame.pitches[0], frame->vo_frame.pitches[1],
width, height, width * 4);
} else if (format == XINE_IMGFMT_YUY2) {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[0] * height, (void**) &frame->mem[0]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
frame->yuv2rgb->configure (frame->yuv2rgb,
width, height, frame->vo_frame.pitches[0], frame->vo_frame.pitches[0],
width, height, width * 4);
@@ -313,27 +299,15 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
return &this->vo_driver;
}
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "CACA";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the Color AsCii Art library");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- caca_class_t *this = (caca_class_t *) this_gen;
- free(this);
-}
static void *init_class (xine_t *xine, void *visual_gen) {
caca_class_t *this;
this = calloc(1, sizeof(caca_class_t));
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->driver_class.identifier = "CACA";
+ this->driver_class.description = N_("xine video output plugin using the Color AsCii Art library");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -348,6 +322,6 @@ static const vo_info_t vo_info_caca = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "caca", XINE_VERSION_CODE, &vo_info_caca, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "caca", XINE_VERSION_CODE, &vo_info_caca, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index d9968151c..2b6c31552 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.c
@@ -39,10 +39,10 @@
#define LOG_VERBOSE
#include "xine.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#ifdef DIRECTFB_X11
# include "x11osd.h"
@@ -155,7 +155,7 @@ typedef struct {
#define DEFAULT_COLORKEY 0x202040
#define DIRECTFB_OPTIONS "no-banner,"\
- "bg-color=00000000,"\
+ "bg-colour=00000000,"\
"no-vt-switch,"\
"no-vt-switching,"\
"no-sighandler,"\
@@ -500,7 +500,7 @@ static void directfb_subpicture_paint (directfb_driver_t *this,
colors[index].a = alpha | (alpha << 4);
}
- lprintf ("color change to %02x%02x%02x%02x.\n",
+ lprintf ("colour change to %02x%02x%02x%02x.\n",
colors[index].a, colors[index].r,
colors[index].g, colors[index].b);
this->spic_surface->SetColor (this->spic_surface,
@@ -949,7 +949,7 @@ static int directfb_set_property (vo_driver_t *this_gen,
value = XINE_VO_ASPECT_NUM_RATIOS-1;
xprintf (this->xine, XINE_VERBOSITY_DEBUG,
"video_out_directfb: aspect ratio changed to %s.\n",
- _x_vo_scale_aspect_ratio_name (value));
+ _x_vo_scale_aspect_ratio_name_table[value]);
this->sc.user_ratio = value;
_x_vo_scale_compute_ideal_size (&this->sc);
this->sc.force_redraw = 1;
@@ -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,
@@ -1742,6 +1742,20 @@ static void directfb_frame_output_cb (void *user_data, int video_width, int vide
/*** DirectFB plugin functions ***/
+static inline int convert_caps (DFBDisplayLayerCapabilities caps)
+{
+ int vo = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_CROP | VO_CAP_ZOOM_X | VO_CAP_ZOOM_Y;
+ if (caps & DLCAPS_HUE)
+ vo |= VO_CAP_HUE;
+ if (caps & DLCAPS_SATURATION)
+ vo |= VO_CAP_SATURATION;
+ if (caps & DLCAPS_CONTRAST)
+ vo |= VO_CAP_CONTRAST;
+ if (caps & DLCAPS_BRIGHTNESS)
+ vo |= VO_CAP_BRIGHTNESS;
+ return vo;
+}
+
static vo_driver_t *open_plugin_fb (video_driver_class_t *class_gen, const void *visual_gen) {
directfb_class_t *class = (directfb_class_t *) class_gen;
directfb_driver_t *this;
@@ -1821,7 +1835,7 @@ static vo_driver_t *open_plugin_fb (video_driver_class_t *class_gen, const void
return NULL;
}
- this->capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_CROP;
+ this->capabilities = convert_caps (this->caps);
/* set default configuration */
this->buffermode = 1; // double
this->vsync = 0;
@@ -1880,19 +1894,6 @@ static vo_driver_t *open_plugin_fb (video_driver_class_t *class_gen, const void
return &this->vo_driver;
}
-static char* get_identifier_fb (video_driver_class_t *this_gen) {
- return "DirectFB";
-}
-
-static char* get_description_fb (video_driver_class_t *this_gen) {
- return _("xine video output plugin using DirectFB.");
-}
-
-static void dispose_class_fb (video_driver_class_t *this_gen) {
- directfb_class_t *this = (directfb_class_t *) this_gen;
- free (this);
-}
-
#ifndef DIRECTFB_X11
static void *init_class_fb (xine_t *xine, void *visual_gen) {
directfb_class_t *this;
@@ -1910,9 +1911,9 @@ static void *init_class_fb (xine_t *xine, void *visual_gen) {
this = (directfb_class_t *) calloc(1, sizeof(directfb_class_t));
this->driver_class.open_plugin = open_plugin_fb;
- this->driver_class.get_identifier = get_identifier_fb;
- this->driver_class.get_description = get_description_fb;
- this->driver_class.dispose = dispose_class_fb;
+ this->driver_class.identifier = "DirectFB";
+ this->driver_class.description = N_("xine video output plugin using DirectFB.");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->xine = xine;
@@ -2013,7 +2014,7 @@ static vo_driver_t *open_plugin_x11 (video_driver_class_t *class_gen, const void
xprintf (this->xine, XINE_VERBOSITY_LOG,
_("video_out_directfb: using display layer #%d.\n"), id);
- this->capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_CROP;
+ this->capabilities = convert_caps (this->caps);
/* set default configuration */
this->buffermode = 1; // double
this->vsync = 0;
@@ -2088,20 +2089,6 @@ static vo_driver_t *open_plugin_x11 (video_driver_class_t *class_gen, const void
return &this->vo_driver;
}
-static char* get_identifier_x11 (video_driver_class_t *this_gen) {
- return "XDirectFB";
-}
-
-static char* get_description_x11 (video_driver_class_t *this_gen) {
- return _("xine video output plugin using DirectFB under XDirectFB.");
-}
-
-static void dispose_class_x11 (video_driver_class_t *this_gen) {
- directfb_class_t *this = (directfb_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class_x11 (xine_t *xine, void *visual_gen) {
directfb_class_t *this;
x11_visual_t *visual = (x11_visual_t *) visual_gen;
@@ -2129,9 +2116,9 @@ static void *init_class_x11 (xine_t *xine, void *visual_gen) {
this = (directfb_class_t *) calloc(1, sizeof(directfb_class_t));
this->driver_class.open_plugin = open_plugin_x11;
- this->driver_class.get_identifier = get_identifier_x11;
- this->driver_class.get_description = get_description_x11;
- this->driver_class.dispose = dispose_class_x11;
+ this->driver_class.identifier = "XDirectFB";
+ this->driver_class.description = N_("xine video output plugin using DirectFB under XDirectFB.");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->visual_type = XINE_VISUAL_TYPE_X11;
this->xine = xine;
diff --git a/src/video_out/video_out_directfb_fb.c b/src/video_out/video_out_directfb_fb.c
deleted file mode 100644
index bb01c187b..000000000
--- a/src/video_out/video_out_directfb_fb.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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, USA
- *
- *
- * DirectFB output plugin (console version wrapper)
- */
-
-#undef DIRECTFB_X11
-#include "video_out_directfb.c"
diff --git a/src/video_out/video_out_directfb_x.c b/src/video_out/video_out_directfb_x.c
deleted file mode 100644
index 78aaa9588..000000000
--- a/src/video_out/video_out_directfb_x.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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, USA
- *
- *
- * DirectFB output plugin (X version wrapper)
- */
-
-#define DIRECTFB_X11
-#include "video_out_directfb.c"
diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c
index 834548091..f37c730b8 100644
--- a/src/video_out/video_out_directx.c
+++ b/src/video_out/video_out_directx.c
@@ -39,10 +39,10 @@ typedef unsigned char boolean;
*/
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
#define NEW_YUV 1
@@ -1313,21 +1313,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *wi
return ( vo_driver_t * ) win32_driver;
}
-
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "DirectX";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin for win32 using directx");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- directx_class_t *directx = (directx_class_t *) this_gen;
-
- free (directx);
-}
-
static void *init_class (xine_t *xine, void *visual_gen) {
directx_class_t *directx;
@@ -1338,9 +1323,9 @@ static void *init_class (xine_t *xine, void *visual_gen) {
directx = calloc(1, sizeof (directx_class_t));
directx->driver_class.open_plugin = open_plugin;
- directx->driver_class.get_identifier = get_identifier;
- directx->driver_class.get_description = get_description;
- directx->driver_class.dispose = dispose_class;
+ directx->driver_class.identifier = "DirectX";
+ directx->driver_class.description = N_("xine video output plugin for win32 using directx");
+ directx->driver_class.dispose = default_video_driver_class_dispose;
directx->xine = xine;
directx->config = xine->config;
@@ -1359,6 +1344,6 @@ static const vo_info_t vo_info_win32 = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "vo_directx", XINE_VERSION_CODE, &vo_info_win32, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "vo_directx", XINE_VERSION_CODE, &vo_info_win32, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index aa066c9c7..0d4376336 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.
*
@@ -16,28 +16,28 @@
* You 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, USA
+ */
+
+/**
+ * @file
+ * @brief Frame buffer xine driver
*
- * video_out_fb.c, frame buffer xine driver by Miguel Freitas
- *
- * 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
@@ -54,9 +54,6 @@
#include <sys/stat.h>
#include <fcntl.h>
-#include "xine.h"
-#include "video_out.h"
-
#include <errno.h>
#include <sys/ipc.h>
@@ -68,6 +65,12 @@
#include <pthread.h>
#include <netinet/in.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#include <linux/fb.h>
#include <linux/kd.h>
#include <linux/vt.h>
@@ -78,10 +81,12 @@
#define LOG
*/
-#include "xine_internal.h"
+#include "xine.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
typedef struct fb_frame_s
{
@@ -92,8 +97,6 @@ typedef struct fb_frame_s
vo_scale_t sc;
- void *chunk[3]; /* mem alloc by xmalloc_aligned */
-
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter for this frame */
uint8_t *rgb_dst;
int yuv_stride;
@@ -155,7 +158,7 @@ typedef struct
static uint32_t fb_get_capabilities(vo_driver_t *this_gen)
{
- return VO_CAP_YV12 | VO_CAP_YUY2;
+ return VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS | VO_CAP_CONTRAST | VO_CAP_SATURATION;
}
static void fb_frame_proc_slice(vo_frame_t *vo_img, uint8_t **src)
@@ -324,10 +327,9 @@ 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)
{
- free(frame->chunk[0]);
- free(frame->chunk[1]);
- free(frame->chunk[2]);
- memset(frame->chunk, 0, sizeof(frame->chunk[0])*3);
+ av_freep(&frame->vo_frame.base[0]);
+ av_freep(&frame->vo_frame.base[1]);
+ av_freep(&frame->vo_frame.base[2]);
if(this->use_zero_copy)
{
@@ -349,35 +351,15 @@ static void frame_reallocate(fb_driver_t *this, fb_frame_t *frame,
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] =
- xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[0] *
- height,
- (void **)&frame->chunk[0]);
-
- frame->vo_frame.base[1] =
- xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[1] *
- ((height+1)/2),
- (void **)&frame->chunk[1]);
-
- frame->vo_frame.base[2] =
- xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[2] *
- ((height+1)/2),
- (void **)&frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
}
else
{
frame->vo_frame.pitches[0] = 8 * ((width + 3) / 4);
- frame->vo_frame.base[0] =
- xine_xmalloc_aligned(16,
- frame->vo_frame.pitches[0] *
- height,
- (void **)&frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
}
}
@@ -428,7 +410,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)
@@ -632,7 +614,7 @@ static int fb_set_property(vo_driver_t *this_gen, int property, int value)
value = XINE_VO_ASPECT_AUTO;
this->sc.user_ratio = value;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_fb: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ "video_out_fb: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
break;
case VO_PROP_BRIGHTNESS:
@@ -808,8 +790,8 @@ 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? */
- char *device_name;
+ static const char devkey[] = "video.device.fb_device";
+ const char *device_name;
int fd;
/* This config entry is security critical, is it really necessary
@@ -890,7 +872,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;
}
@@ -947,16 +929,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
{
@@ -964,8 +946,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);
@@ -1033,12 +1015,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,
@@ -1057,30 +1040,14 @@ error:
return 0;
}
-static char* fb_get_identifier(video_driver_class_t *this_gen)
-{
- return "fb";
-}
-
-static char* fb_get_description(video_driver_class_t *this_gen)
-{
- return _("Xine video output plugin using the Linux frame buffer device");
-}
-
-static void fb_dispose_class(video_driver_class_t *this_gen)
-{
- fb_class_t *this = (fb_class_t *)this_gen;
- free(this);
-}
-
static void *fb_init_class(xine_t *xine, void *visual_gen)
{
fb_class_t *this = calloc(1, sizeof(fb_class_t));
this->driver_class.open_plugin = fb_open_plugin;
- this->driver_class.get_identifier = fb_get_identifier;
- this->driver_class.get_description = fb_get_description;
- this->driver_class.dispose = fb_dispose_class;
+ this->driver_class.identifier = "fb";
+ this->driver_class.description = N_("Xine video output plugin using the Linux frame buffer device");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -1091,16 +1058,13 @@ 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 */
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "fb", XINE_VERSION_CODE, &vo_info_fb, fb_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "fb", XINE_VERSION_CODE, &vo_info_fb, fb_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
+
diff --git a/src/video_out/video_out_macosx.m b/src/video_out/video_out_macosx.m
index b5b4d731c..3a87908df 100644
--- a/src/video_out/video_out_macosx.m
+++ b/src/video_out/video_out_macosx.m
@@ -36,11 +36,11 @@
#define LOG
*/
-#include "video_out.h"
-#include "vo_scale.h"
#include "xine.h"
-#include "xine_internal.h"
-#include "xineutils.h"
+#include "xine/video_out.h"
+#include "xine/vo_scale.h"
+#include "xine/xine_internal.h"
+#include "xine/xineutils.h"
#include "macosx/video_window.h"
@@ -349,19 +349,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void *
/*
* Class related functions.
*/
-static char* get_identifier (video_driver_class_t *driver_class) {
- return "MacOSX";
-}
-
-static char* get_description (video_driver_class_t *driver_class) {
- return _("xine video output plugin for Mac OS X");
-}
-
-static void dispose_class (video_driver_class_t *driver_class) {
- macosx_class_t *this = (macosx_class_t *) driver_class;
-
- free (this);
-}
static void *init_class (xine_t *xine, void *visual) {
macosx_class_t *this;
@@ -369,9 +356,9 @@ static void *init_class (xine_t *xine, void *visual) {
this = calloc(1, sizeof(macosx_class_t));
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->driver_class.identifier = "MacOSX";
+ this->driver_class.description = N_("xine video output plugin for Mac OS X");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -389,7 +376,7 @@ plugin_info_t xine_plugin_info[] EXPORTED = {
/* work around the problem that dlclose() is not allowed to
* get rid of an image module which contains objective C code and simply
* crashes with a Trace/BPT trap when we try to do so */
- { PLUGIN_VIDEO_OUT | PLUGIN_NO_UNLOAD, 21, "macosx", XINE_VERSION_CODE, &vo_info_macosx, init_class },
+ { PLUGIN_VIDEO_OUT | PLUGIN_NO_UNLOAD, 22, "macosx", XINE_VERSION_CODE, &vo_info_macosx, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c
index 15bc52abe..b6bba95da 100644
--- a/src/video_out/video_out_none.c
+++ b/src/video_out/video_out_none.c
@@ -33,10 +33,10 @@
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
typedef struct {
vo_frame_t vo_frame;
@@ -269,29 +269,15 @@ static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void *
/*
* Class related functions.
*/
-static char* get_identifier (video_driver_class_t *driver_class) {
- return "None";
-}
-
-static char* get_description (video_driver_class_t *driver_class) {
- return _("xine video output plugin which displays nothing");
-}
-
-static void dispose_class (video_driver_class_t *driver_class) {
- none_class_t *this = (none_class_t *) driver_class;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *visual) {
none_class_t *this;
this = calloc(1, sizeof(none_class_t));
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->driver_class.identifier = "none";
+ this->driver_class.description = N_("xine video output plugin which displays nothing");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -306,6 +292,6 @@ static const vo_info_t vo_info_none = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "none", XINE_VERSION_CODE, &vo_info_none, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "none", XINE_VERSION_CODE, &vo_info_none, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index ef0e83530..570afa2fd 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -47,6 +47,12 @@
#include <ctype.h>
#include <pthread.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
/* defines for debugging extensions only */
/* #define GL_GLEXT_LEGACY */
#include <GL/gl.h>
@@ -88,11 +94,11 @@
#endif
#include "xine.h"
-#include "video_out.h"
+#include <xine/video_out.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
#include "x11osd.h"
@@ -140,7 +146,6 @@ typedef struct {
int width, height, format, flags;
double ratio;
- uint8_t *chunk[4]; /* mem alloc by xmalloc_aligned */
uint8_t *rgb, *rgb_dst;
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */
@@ -1204,7 +1209,7 @@ static void *render_run (opengl_driver_t *this) {
static uint32_t opengl_get_capabilities (vo_driver_t *this_gen) {
/* opengl_driver_t *this = (opengl_driver_t *) this_gen; */
- uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2;
+ uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS | VO_CAP_CONTRAST | VO_CAP_SATURATION;
/* TODO: somehow performance goes down during the first few frames */
/* if (this->xoverlay) */
@@ -1273,10 +1278,10 @@ static void opengl_frame_dispose (vo_frame_t *vo_img) {
frame->yuv2rgb->dispose (frame->yuv2rgb);
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
- free (frame->chunk[3]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
+ av_free (frame->rgb);
free (frame);
}
@@ -1354,26 +1359,23 @@ static void opengl_update_frame_format (vo_driver_t *this_gen,
XLockDisplay (this->display);
/* (re-) allocate render space */
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
- free (frame->chunk[3]);
+ av_freep(&frame->vo_frame.base[0]);
+ av_freep(&frame->vo_frame.base[1]);
+ av_freep(&frame->vo_frame.base[2]);
+ av_freep(&frame->rgb);
if (format == XINE_IMGFMT_YV12) {
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), (void **) &frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), (void **) &frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
} else {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
}
- frame->rgb = xine_xmalloc_aligned (16, BYTES_PER_PIXEL*width*height,
- (void **) &frame->chunk[3]);
+ frame->rgb = av_mallocz(BYTES_PER_PIXEL*width*height);
/* set up colorspace converter */
switch (flags) {
@@ -1631,7 +1633,7 @@ static int opengl_set_property (vo_driver_t *this_gen,
this->sc.force_redraw = 1; /* trigger re-calc of output size */
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_opengl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ "video_out_opengl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
break;
case VO_PROP_BRIGHTNESS:
this->yuv2rgb_brightness = value;
@@ -2018,20 +2020,6 @@ static int opengl_verify_direct (x11_visual_t *vis) {
return ret;
}
-static char* opengl_get_identifier (video_driver_class_t *this_gen) {
- return "opengl";
-}
-
-static char* opengl_get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the OpenGL 3D graphics API");
-}
-
-static void opengl_dispose_class (video_driver_class_t *this_gen) {
- opengl_class_t *this = (opengl_class_t *) this_gen;
-
- free (this);
-}
-
static void *opengl_init_class (xine_t *xine, void *visual_gen) {
opengl_class_t *this;
@@ -2047,9 +2035,9 @@ static void *opengl_init_class (xine_t *xine, void *visual_gen) {
this = (opengl_class_t *) calloc (1, sizeof(opengl_class_t));
this->driver_class.open_plugin = opengl_open_plugin;
- this->driver_class.get_identifier = opengl_get_identifier;
- this->driver_class.get_description = opengl_get_description;
- this->driver_class.dispose = opengl_dispose_class;
+ this->driver_class.identifier = "opengl";
+ this->driver_class.description = N_("xine video output plugin using the OpenGL 3D graphics API");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->xine = xine;
return this;
@@ -2068,6 +2056,6 @@ static const vo_info_t vo_info_opengl = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "opengl", XINE_VERSION_CODE, &vo_info_opengl, opengl_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "opengl", XINE_VERSION_CODE, &vo_info_opengl, opengl_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_pgx32.c b/src/video_out/video_out_pgx32.c
index fa1b0ef99..ac19ef382 100644
--- a/src/video_out/video_out_pgx32.c
+++ b/src/video_out/video_out_pgx32.c
@@ -41,10 +41,10 @@
#include <X11/Xatom.h>
#include <dga/dga.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "bswap.h"
-#include "vo_scale.h"
-#include "xineutils.h"
+#include <xine/vo_scale.h>
+#include <xine/xineutils.h>
/* gfxp register defines */
@@ -783,13 +783,6 @@ static void pgx32_dispose(vo_driver_t *this_gen)
* XINE VIDEO DRIVER CLASS FUNCTIONS
*/
-static void pgx32_dispose_class(video_driver_class_t *class_gen)
-{
- pgx32_driver_class_t *class = (pgx32_driver_class_t *)(void *)class_gen;
-
- free(class);
-}
-
static const vo_info_t vo_info_pgx32 = {
10,
XINE_VISUAL_TYPE_X11
@@ -855,16 +848,6 @@ static vo_driver_t *pgx32_init_driver(video_driver_class_t *class_gen, const voi
return (vo_driver_t *)this;
}
-static char *pgx32_get_identifier(video_driver_class_t *class_gen)
-{
- return "pgx32";
-}
-
-static char *pgx32_get_description(video_driver_class_t *class_gen)
-{
- return "xine video output plugin for Sun PGX32 framebuffers";
-}
-
static void *pgx32_init_class(xine_t *xine, void *visual_gen)
{
pgx32_driver_class_t *class;
@@ -877,9 +860,9 @@ static void *pgx32_init_class(xine_t *xine, void *visual_gen)
DGA_INIT();
class->vo_driver_class.open_plugin = pgx32_init_driver;
- class->vo_driver_class.get_identifier = pgx32_get_identifier;
- class->vo_driver_class.get_description = pgx32_get_description;
- class->vo_driver_class.dispose = pgx32_dispose_class;
+ class->vo_driver_class.identifier = "pgx32";
+ class->vo_driver_class.description = N_("xine video output plugin for Sun PGX32 framebuffers");
+ class->vo_driver_class.dispose = default_video_driver_class_dispose;
class->xine = xine;
class->config = xine->config;
@@ -888,6 +871,6 @@ static void *pgx32_init_class(xine_t *xine, void *visual_gen)
}
const plugin_info_t xine_plugin_info[] EXPORTED = {
- {PLUGIN_VIDEO_OUT, 21, "pgx32", XINE_VERSION_CODE, &vo_info_pgx32, pgx32_init_class},
+ {PLUGIN_VIDEO_OUT, 22, "pgx32", XINE_VERSION_CODE, &vo_info_pgx32, pgx32_init_class},
{PLUGIN_NONE, 0, "", 0, NULL, NULL}
};
diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c
index 29d51194e..7c82f6145 100644
--- a/src/video_out/video_out_pgx64.c
+++ b/src/video_out/video_out_pgx64.c
@@ -43,10 +43,10 @@
#include <X11/Xatom.h>
#include <dga/dga.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "bswap.h"
-#include "vo_scale.h"
-#include "xineutils.h"
+#include <xine/vo_scale.h>
+#include <xine/xineutils.h>
/*
* The maximum number of frames that can be used in multi-buffering
@@ -552,8 +552,7 @@ static uint32_t pgx64_get_capabilities(vo_driver_t *this_gen)
{
/*pgx64_driver_t *this = (pgx64_driver_t *)(void *)this_gen;*/
- return VO_CAP_YV12 |
- VO_CAP_YUY2;
+ return VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS | VO_CAP_SATURATION;
}
static vo_frame_t *pgx64_alloc_frame(vo_driver_t *this_gen)
@@ -1332,14 +1331,6 @@ static void pgx64_config_changed(void *user_data, xine_cfg_entry_t *entry)
/*
* XINE VIDEO DRIVER CLASS FUNCTIONS
*/
-
-static void pgx64_dispose_class(video_driver_class_t *class_gen)
-{
- pgx64_driver_class_t *class = (pgx64_driver_class_t *)(void *)class_gen;
-
- free(class);
-}
-
static const vo_info_t vo_info_pgx64 = {
10,
XINE_VISUAL_TYPE_X11
@@ -1479,16 +1470,6 @@ static vo_driver_t *pgx64_init_driver(video_driver_class_t *class_gen, const voi
return (vo_driver_t *)this;
}
-static char *pgx64_get_identifier(video_driver_class_t *class_gen)
-{
- return "pgx64";
-}
-
-static char *pgx64_get_description(video_driver_class_t *class_gen)
-{
- return "xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers";
-}
-
static void *pgx64_init_class(xine_t *xine, void *visual_gen)
{
pgx64_driver_class_t *class;
@@ -1501,9 +1482,9 @@ static void *pgx64_init_class(xine_t *xine, void *visual_gen)
DGA_INIT();
class->vo_driver_class.open_plugin = pgx64_init_driver;
- class->vo_driver_class.get_identifier = pgx64_get_identifier;
- class->vo_driver_class.get_description = pgx64_get_description;
- class->vo_driver_class.dispose = pgx64_dispose_class;
+ class->vo_driver_class.identifier = "pgx64";
+ class->vo_driver_class.description = N_("xine video output plugin for Sun XVR100/PGX64/PGX24 framebuffers");
+ class->vo_driver_class.dispose = default_video_driver_class_dispose;
class->xine = xine;
class->config = xine->config;
@@ -1512,6 +1493,6 @@ static void *pgx64_init_class(xine_t *xine, void *visual_gen)
}
const plugin_info_t xine_plugin_info[] EXPORTED = {
- {PLUGIN_VIDEO_OUT, 21, "pgx64", XINE_VERSION_CODE, &vo_info_pgx64, pgx64_init_class},
+ {PLUGIN_VIDEO_OUT, 22, "pgx64", XINE_VERSION_CODE, &vo_info_pgx64, pgx64_init_class},
{PLUGIN_NONE, 0, "", 0, NULL, NULL}
};
diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c
index 456b3392f..50f385959 100644
--- a/src/video_out/video_out_raw.c
+++ b/src/video_out/video_out_raw.c
@@ -1,3 +1,4 @@
+
/*
* Copyright (C) 2007-2008 the xine project
*
@@ -47,21 +48,24 @@
#include <ctype.h>
#include <pthread.h>
-#include "xine.h"
-#include "video_out.h"
+#include <xine.h>
+#include <xine/video_out.h>
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
-
+#include <xine/xineutils.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
typedef struct {
vo_frame_t vo_frame;
int width, height, format, flags;
double ratio;
- void *chunk[4]; /* mem alloc by xmalloc_aligned */
uint8_t *rgb, *rgb_dst;
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */
@@ -163,11 +167,16 @@ static int raw_process_ovl( raw_driver_t *this_gen, vo_overlay_t *overlay )
clr = rle->color;
alpha = trans[clr];
for ( i=0; i<rlelen; ++i ) {
- rgba[0] = colors[clr].y;
- rgba[1] = colors[clr].cr;
- rgba[2] = colors[clr].cb;
- rgba[3] = alpha*255/15;
- rgba+= 4;
+ if ( alpha == 0 ) {
+ rgba[0] = rgba[1] = rgba[2] = rgba[3] = 0;
+ }
+ else {
+ rgba[0] = colors[clr].y;
+ rgba[1] = colors[clr].cr;
+ rgba[2] = colors[clr].cb;
+ rgba[3] = alpha*255/15;
+ }
+ rgba+= 4;
++pos;
}
++rle;
@@ -278,10 +287,10 @@ static void raw_frame_dispose (vo_frame_t *vo_img)
frame->yuv2rgb->dispose (frame->yuv2rgb);
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
- free (frame->chunk[3]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
+ av_free (frame->rgb);
free (frame);
}
@@ -297,6 +306,9 @@ static vo_frame_t *raw_alloc_frame (vo_driver_t *this_gen)
if (!frame)
return NULL;
+ frame->vo_frame.base[0] = frame->vo_frame.base[1] = frame->vo_frame.base[2] = frame->rgb = NULL;
+ frame->width = frame->height = frame->format = frame->flags = 0;
+
pthread_mutex_init (&frame->vo_frame.mutex, NULL);
/*
@@ -330,32 +342,29 @@ static void raw_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_ge
|| (frame->flags != flags)) {
/* lprintf ("updating frame to %d x %d (ratio=%g, format=%08x)\n", width, height, ratio, format); */
- flags &= VO_BOTH_FIELDS;
-
/* (re-) allocate render space */
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
- free (frame->chunk[3]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
+ av_free (frame->rgb);
if (format == XINE_IMGFMT_YV12) {
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), (void **) &frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), (void **) &frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz (frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz (frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz (frame->vo_frame.pitches[2] * ((height+1)/2));
} else {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz (frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = NULL;
+ frame->vo_frame.base[2] = NULL;
}
- frame->rgb = xine_xmalloc_aligned (16, BYTES_PER_PIXEL*width*height,
- (void **) &frame->chunk[3]);
+ frame->rgb = av_mallocz (BYTES_PER_PIXEL*width*height);
/* set up colorspace converter */
- switch (flags) {
+ switch (flags & VO_BOTH_FIELDS) {
case VO_TOP_FIELD:
case VO_BOTTOM_FIELD:
frame->yuv2rgb->configure (frame->yuv2rgb,
@@ -382,6 +391,7 @@ static void raw_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_ge
frame->width = width;
frame->height = height;
frame->format = format;
+ frame->flags = flags;
raw_frame_field ((vo_frame_t *)frame, flags);
}
@@ -556,36 +566,14 @@ static vo_driver_t *raw_open_plugin (video_driver_class_t *class_gen, const void
* class functions
*/
-static char* raw_get_identifier (video_driver_class_t *this_gen)
-{
- return "raw";
-}
-
-
-
-static char* raw_get_description (video_driver_class_t *this_gen)
-{
- return _("xine video output plugin passing raw data to supplied callback");
-}
-
-
-
-static void raw_dispose_class (video_driver_class_t *this_gen)
-{
- raw_class_t *this = (raw_class_t *) this_gen;
- free (this);
-}
-
-
-
static void *raw_init_class (xine_t *xine, void *visual_gen)
{
raw_class_t *this = (raw_class_t *) calloc(1, sizeof(raw_class_t));
this->driver_class.open_plugin = raw_open_plugin;
- this->driver_class.get_identifier = raw_get_identifier;
- this->driver_class.get_description = raw_get_description;
- this->driver_class.dispose = raw_dispose_class;
+ this->driver_class.identifier = "raw";
+ this->driver_class.description = _("xine video output plugin passing raw data to supplied callback");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->xine = xine;
return this;
@@ -605,6 +593,6 @@ static const vo_info_t vo_info_raw = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "raw", XINE_VERSION_CODE, &vo_info_raw, raw_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "raw", XINE_VERSION_CODE, &vo_info_raw, raw_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c
index 36d66cd86..bc26c6300 100644
--- a/src/video_out/video_out_sdl.c
+++ b/src/video_out/video_out_sdl.c
@@ -59,10 +59,10 @@
*/
#include "xine.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#ifdef HAVE_X11
#include <X11/Xlib.h>
@@ -384,7 +384,7 @@ static int sdl_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_sdl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ "video_out_sdl: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
sdl_compute_ideal_size (this);
this->sc.force_redraw = 1;
@@ -577,19 +577,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
/**
* Class Functions
*/
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "SDL";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the Simple Direct Media Layer");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- free(this_gen);
-}
-
-
static void *init_class (xine_t *xine, void *visual_gen) {
/* x11_visual_t *visual = (x11_visual_t *) visual_gen; */
sdl_class_t *this;
@@ -605,9 +592,9 @@ static void *init_class (xine_t *xine, void *visual_gen) {
this = (sdl_class_t*) calloc(1, sizeof(sdl_class_t));
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->driver_class.identifier = "SDL";
+ this->driver_class.description = N_("xine video output plugin using the Simple Direct Media Layer");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -622,6 +609,6 @@ static const vo_info_t vo_info_sdl = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "sdl", XINE_VERSION_CODE, &vo_info_sdl, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "sdl", XINE_VERSION_CODE, &vo_info_sdl, init_class },
{ PLUGIN_NONE, 0, "" , 0 , NULL, NULL}
};
diff --git a/src/video_out/video_out_stk.c b/src/video_out/video_out_stk.c
index 647760fd2..eb6ccb0a9 100644
--- a/src/video_out/video_out_stk.c
+++ b/src/video_out/video_out_stk.c
@@ -59,10 +59,10 @@
*/
#include "xine.h"
-#include "xine_internal.h"
-#include "video_out.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
/* Extend the video frame class with stk private data */
typedef struct stk_frame_s {
@@ -327,7 +327,7 @@ static int stk_set_property (vo_driver_t* this_gen, int property, int value) {
value = XINE_VO_ASPECT_AUTO;
this->sc.user_ratio = value;
xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_stk: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name(value));
+ "video_out_stk: aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
stk_compute_ideal_size (this);
this->sc.force_redraw = 1;
@@ -442,22 +442,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
/**
* Class Functions
*/
-static char* get_identifier (video_driver_class_t *this_gen) {
- //printf("video_out_stk: get_identifier()\n");
- return "stk";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- //printf("video_out_stk: get_description()\n");
- return _("xine video output plugin using the Libstk Surface Set-top Toolkit");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- //printf("video_out_stk: dispose_class()\n");
- free(this_gen);
-}
-
-
static void *init_class (xine_t *xine, void *visual_gen) {
stk_class_t* this;
@@ -466,9 +450,9 @@ static void *init_class (xine_t *xine, void *visual_gen) {
this = calloc(1, sizeof(stk_class_t));
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->driver_class.identifier = "stk";
+ this->driver_class.description = N_("xine video output plugin using the Libstk Surface Set-top Toolkit");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -484,7 +468,7 @@ static const vo_info_t vo_info_stk = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "stk", XINE_VERSION_CODE, &vo_info_stk, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "stk", XINE_VERSION_CODE, &vo_info_stk, init_class },
{ PLUGIN_NONE, 0, "" , 0 , NULL, NULL}
};
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
deleted file mode 100644
index 68a04c33d..000000000
--- a/src/video_out/video_out_syncfb.c
+++ /dev/null
@@ -1,1133 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine
- *
- * based on video_out_xv.c by (see file for original authors)
- *
- * with lot's of code from:
- * video_out_syncfb.c by Joachim Koenig <joachim.koenig@gmx.net>
- * and by Matthias Oelmann <mao@well.com>
- * video_out_mga by Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
- *
- * glued together for xine by Matthias Dahl <matthew2k@web.de>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef __sun
-#include <sys/ioccom.h>
-#endif
-
-#include <sys/ioctl.h>
-#if defined (__FreeBSD__)
-#include <sys/types.h>
-#endif
-#include <sys/mman.h>
-#include <math.h>
-#include <fcntl.h>
-#include <unistd.h>
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-
-#include "video_out_syncfb.h"
-
-#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "vo_scale.h"
-
-/*#define DEBUG_OUTPUT*/
-
-typedef struct syncfb_driver_s syncfb_driver_t;
-
-typedef struct {
- int value;
- int min;
- int max;
-} syncfb_property_t;
-
-typedef struct {
- vo_frame_t vo_frame;
-/* uint8_t* data_mem[3];*/
- int width, height, format;
- double ratio;
-} syncfb_frame_t;
-
-struct syncfb_driver_s {
-
- vo_driver_t vo_driver;
-
- config_values_t *config;
-
- /* X11 related stuff */
- Display *display;
- int screen;
- Drawable drawable;
- XVisualInfo vinfo;
- GC gc;
- XColor black;
-
- vo_scale_t sc;
-
- int virtual_screen_width;
- int virtual_screen_height;
- int screen_depth;
-
- syncfb_property_t props[VO_NUM_PROPERTIES];
-
- syncfb_frame_t* cur_frame;
- vo_overlay_t* overlay;
-
- /* syncfb module related stuff */
- int fd; /* file descriptor of the syncfb device */
- int yuv_format; /* either YUV420P3, YUV420P2 or YUV422 */
- int overlay_state; /* 0 = off, 1 = on */
- uint8_t* video_mem; /* mmapped video memory */
- int default_repeat; /* how many times a frame will be repeatedly displayed */
- uint32_t supported_capabilities;
-
- syncfb_config_t syncfb_config;
- syncfb_capability_t capabilities;
- syncfb_buffer_info_t bufinfo;
- syncfb_param_t params;
-
- int video_win_visibility;
- xine_t *xine;
-
- alphablend_t alphablend_extra_data;
-};
-
-typedef struct {
- video_driver_class_t driver_class;
-
- config_values_t *config;
- char *device_name;
- xine_t *xine;
-} syncfb_class_t;
-
-/*
- * internal video_out_syncfb functions
- */
-
-/* returns boolean value (1 success, 0 failure) */
-static int syncfb_overlay_on(syncfb_driver_t* this)
-{
- if(ioctl(this->fd, SYNCFB_ON)) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (on ioctl failed)\n");
- return 0;
- } else {
- this->overlay_state = 1;
- return 1;
- }
-}
-
-/* returns boolean value (1 success, 0 failure) */
-static int syncfb_overlay_off(syncfb_driver_t* this)
-{
- if(ioctl(this->fd, SYNCFB_OFF)) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (off ioctl failed)\n");
- return 0;
- } else {
- this->overlay_state = 0;
- return 1;
- }
-}
-
-static void write_frame_YUV422(syncfb_driver_t* this, syncfb_frame_t* frame)
-{
- uint8_t* y = (uint_8 *)frame->vo_frame.base[0];
- uint8_t* cb = (uint_8 *)frame->vo_frame.base[1];
- uint8_t* cr = (uint_8 *)frame->vo_frame.base[2];
- uint8_t* crp;
- uint8_t* cbp;
- uint32_t* dst32 = (uint32_t *)(this->video_mem + this->bufinfo.offset);
- int h,w;
-
- for(h = 0; h < (frame->height / 2); h++) {
- cbp = cb;
- crp = cr;
-
- for(w = 0; w < (frame->width / 2); w++) {
- *dst32++ = (*y) + ((*cb)<<8) + ((*(y+1))<<16) + ((*cr)<<24);
- y++; y++; cb++; cr++;
- }
-
- dst32 += (this->syncfb_config.src_pitch - frame->width) / 2;
-
- for(w=0; w < (frame->width / 2); w++) {
- *dst32++ = (*y) + ((*cbp)<<8) + ((*(y+1))<<16) + ((*crp)<<24);
- y++; y++; cbp++; crp++;
- }
-
- dst32 += (this->syncfb_config.src_pitch - frame->width) / 2;
- }
-}
-
-static void write_frame_YUV420P2(syncfb_driver_t* this, syncfb_frame_t* frame)
-{
- uint8_t* y = (uint8_t *)frame->vo_frame.base[0];
- uint8_t* cb = (uint8_t *)frame->vo_frame.base[1];
- uint8_t* cr = (uint8_t *)frame->vo_frame.base[2];
- uint8_t* dst8 = this->video_mem + this->bufinfo.offset_p2;
- int h, w;
-
- register uint32_t* tmp32;
- register uint8_t* rcr;
- register uint8_t* rcb;
-
- rcr = cr;
- rcb = cb;
-
- for(h = 0; h < (frame->height / 2); h++) {
- tmp32 = (uint32_t *)dst8;
- w = (frame->width / 8) * 2;
-
- while(w--) {
- register uint32_t temp;
-
- temp = (*rcb) | (*rcr << 8);
- rcr++;
- rcb++;
- temp |= (*rcb << 16) | (*rcr << 24);
- rcr++;
- rcb++;
- *tmp32 = temp;
- tmp32++;
- }
-
- dst8 += this->syncfb_config.src_pitch;
- }
-
- dst8 = this->video_mem + this->bufinfo.offset;
- for(h = 0; h < frame->height; h++) {
- xine_fast_memcpy(dst8, y, frame->width);
- y += frame->width;
- dst8 += this->syncfb_config.src_pitch;
- }
-}
-
-static void write_frame_YUV420P3(syncfb_driver_t* this, syncfb_frame_t* frame)
-{
- uint8_t* y = (uint8_t *)frame->vo_frame.base[0];
- uint8_t* cb = (uint8_t *)frame->vo_frame.base[1];
- uint8_t* cr = (uint8_t *)frame->vo_frame.base[2];
- uint8_t* dst8 = this->video_mem + this->bufinfo.offset;
- int h, half_width = (frame->width/2);
-
- for(h = 0; h < frame->height; h++) {
- xine_fast_memcpy(dst8, y, frame->width);
- y += frame->width;
- dst8 += this->syncfb_config.src_pitch;
- }
-
- dst8 = this->video_mem;
- for(h = 0; h < (frame->height / 2); h++) {
- xine_fast_memcpy((dst8 + this->bufinfo.offset_p2), cb, half_width);
- xine_fast_memcpy((dst8 + this->bufinfo.offset_p3), cr, half_width);
-
- cb += half_width;
- cr += half_width;
-
- dst8 += (this->syncfb_config.src_pitch / 2);
- }
-}
-
-static void write_frame_YUY2(syncfb_driver_t* this, syncfb_frame_t* frame)
-{
- uint8_t* src8 = (uint8_t *)frame->vo_frame.base[0];
- uint8_t* dst8 = (uint8_t *)(this->video_mem + this->bufinfo.offset);
- int h, double_width = (frame->width * 2);
-
- for(h = 0; h < frame->height; h++) {
- xine_fast_memcpy(dst8, src8, double_width);
-
- dst8 += (this->syncfb_config.src_pitch * 2);
- src8 += double_width;
- }
-}
-
-static void write_frame_sfb(syncfb_driver_t* this, syncfb_frame_t* frame)
-{
- switch(frame->format) {
- case XINE_IMGFMT_YUY2:
- if(this->capabilities.palettes & (1<<VIDEO_PALETTE_YUV422))
- write_frame_YUY2(this, frame);
- else
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_syncfb: error. (YUY2 not supported by your graphic card)\n"));
- break;
-
- case XINE_IMGFMT_YV12:
- switch(this->yuv_format) {
- case VIDEO_PALETTE_YUV422:
- write_frame_YUV422(this, frame);
- break;
- case VIDEO_PALETTE_YUV420P2:
- write_frame_YUV420P2(this, frame);
- break;
- case VIDEO_PALETTE_YUV420P3:
- write_frame_YUV420P3(this, frame);
- break;
- default:
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_syncfb: error. (YV12 not supported by your graphic card)\n"));
- }
- break;
-
- default:
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_syncfb: error. (unknown frame format)\n");
- break;
- }
-
- frame->vo_frame.free(&frame->vo_frame);
-}
-
-static void free_framedata(syncfb_frame_t* frame)
-{
-/* if(frame->data_mem[0]) {
- free(frame->data_mem[0]);
- frame->data_mem[0] = NULL;
- }
-
- if(frame->data_mem[1]) {
- free(frame->data_mem[1]);
- frame->data_mem[1] = NULL;
- }
-
- if(frame->data_mem[2]) {
- free(frame->data_mem[2]);
- frame->data_mem[2] = NULL;
- }*/
-
- if(frame->vo_frame.base[0]) {
- free(frame->vo_frame.base[0]);
- frame->vo_frame.base[0] = NULL;
- }
-
- if(frame->vo_frame.base[1]) {
- free(frame->vo_frame.base[1]);
- frame->vo_frame.base[1] = NULL;
- }
-
- if(frame->vo_frame.base[2]) {
- free(frame->vo_frame.base[2]);
- frame->vo_frame.base[2] = NULL;
- }
-}
-
-static void syncfb_clean_output_area(syncfb_driver_t* this)
-{
- XLockDisplay (this->display);
-
- XSetForeground (this->display, this->gc, this->black.pixel);
-
- XFillRectangle(this->display, this->drawable, this->gc,
- this->sc.gui_x, this->sc.gui_y, this->sc.gui_width, this->sc.gui_height);
-
- XUnlockDisplay (this->display);
-}
-
-
-static void syncfb_compute_ideal_size (syncfb_driver_t *this)
-{
- _x_vo_scale_compute_ideal_size( &this->sc );
-}
-
-/* make ideal width/height "fit" into the gui */
-static void syncfb_compute_output_size(syncfb_driver_t *this)
-{
- _x_vo_scale_compute_output_size( &this->sc );
-
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (frame source %d x %d, screen output %d x %d)\n",
- this->sc.delivered_width, this->sc.delivered_height,
- this->sc.output_width, this->sc.output_height);
-#endif
-
- /*
- * configuring SyncFB module from this point on.
- */
- syncfb_overlay_off(this);
-
- /* sanity checking - certain situations *may* crash the SyncFB module, so
- * take care that we always have valid numbers.
- */
- if(this->sc.output_xoffset >= 0 && this->sc.output_yoffset >= 0 &&
- this->cur_frame->width > 0 && this->cur_frame->height > 0 &&
- this->sc.output_width > 0 && this->sc.output_height > 0 &&
- this->cur_frame->format > 0 && this->video_win_visibility) {
-
- if(ioctl(this->fd, SYNCFB_GET_CONFIG, &this->syncfb_config))
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (get_config ioctl failed)\n");
-
- this->syncfb_config.syncfb_mode = SYNCFB_FEATURE_SCALE | SYNCFB_FEATURE_CROP;
-
- if(this->props[VO_PROP_INTERLACED].value)
- this->syncfb_config.syncfb_mode |= SYNCFB_FEATURE_DEINTERLACE;
-
- switch(this->cur_frame->format) {
- case XINE_IMGFMT_YV12:
- this->syncfb_config.src_palette = this->yuv_format;
- break;
- case XINE_IMGFMT_YUY2:
- this->syncfb_config.src_palette = VIDEO_PALETTE_YUV422;
- break;
- default:
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (unknown frame format)\n");
- this->syncfb_config.src_palette = 0;
- break;
- }
-
- this->syncfb_config.fb_screen_size = this->virtual_screen_width * this->virtual_screen_height * (this->screen_depth / 8) * 2;
- this->syncfb_config.src_width = this->cur_frame->width;
- this->syncfb_config.src_height = this->cur_frame->height;
-
- this->syncfb_config.image_width = this->sc.output_width;
- this->syncfb_config.image_height = this->sc.output_height;
-
- this->syncfb_config.image_xorg = this->sc.output_xoffset + this->sc.gui_win_x;
- this->syncfb_config.image_yorg = this->sc.output_yoffset + this->sc.gui_win_y;
-
- this->syncfb_config.src_crop_top = this->sc.displayed_yoffset;
- this->syncfb_config.src_crop_bot = (this->props[VO_PROP_INTERLACED].value && this->sc.displayed_yoffset == 0) ? 1 : this->sc.displayed_yoffset;
- this->syncfb_config.src_crop_left = this->sc.displayed_xoffset;
- this->syncfb_config.src_crop_right = this->sc.displayed_xoffset;
-
- this->syncfb_config.default_repeat = (this->props[VO_PROP_INTERLACED].value) ? 1 : this->default_repeat;
-
- if(this->capabilities.palettes & (1<<this->syncfb_config.src_palette)) {
- if(ioctl(this->fd,SYNCFB_SET_CONFIG,&this->syncfb_config))
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_syncfb: error. (set_config ioctl failed)\n");
-
- syncfb_overlay_on(this);
- }
- }
-}
-
-/*
- * public functions defined and used by the xine interface
- */
-
-static int syncfb_redraw_needed(vo_driver_t* this_gen)
-{
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
-
- int ret = 0;
-
- if( _x_vo_scale_redraw_needed( &this->sc ) ) {
-
- syncfb_compute_output_size (this);
-
- syncfb_clean_output_area (this);
-
- ret = 1;
- }
-
- return ret;
-}
-
-static uint32_t syncfb_get_capabilities (vo_driver_t *this_gen)
-{
- syncfb_driver_t *this = (syncfb_driver_t *) this_gen;
-
- return this->supported_capabilities;
-}
-
-static void syncfb_frame_field (vo_frame_t *vo_img, int which_field)
-{
- /* not needed for SyncFB */
-}
-
-static void syncfb_frame_dispose(vo_frame_t* vo_img)
-{
- syncfb_frame_t* frame = (syncfb_frame_t *) vo_img;
-
- if(frame) {
- free_framedata(frame);
- free(frame);
- }
-}
-
-static vo_frame_t* syncfb_alloc_frame(vo_driver_t* this_gen)
-{
- /* syncfb_driver_t *this = (syncfb_driver_t *) this_gen; */
- syncfb_frame_t *frame;
-
- frame = calloc(1, sizeof(syncfb_frame_t));
- if(!frame)
- return NULL;
-
- pthread_mutex_init(&frame->vo_frame.mutex, NULL);
-
- frame->vo_frame.base[0] = NULL;
- frame->vo_frame.base[1] = NULL;
- frame->vo_frame.base[2] = NULL;
-
- /*
- * supply required functions
- */
- frame->vo_frame.proc_slice = NULL;
- frame->vo_frame.proc_frame = NULL;
- frame->vo_frame.field = syncfb_frame_field;
- frame->vo_frame.dispose = syncfb_frame_dispose;
-
- frame->vo_frame.driver = this_gen;
-
- return (vo_frame_t *) frame;
-}
-
-static void syncfb_update_frame_format(vo_driver_t* this_gen,
- vo_frame_t* frame_gen,
- uint32_t width, uint32_t height,
- double ratio, int format, int flags)
-{
- syncfb_driver_t *this = (syncfb_driver_t *) this_gen;
- syncfb_frame_t *frame = (syncfb_frame_t *) frame_gen;
- /* uint32_t frame_size = width*height; */
-
- if((frame->width != width)
- || (frame->height != height)
- || (frame->format != format)) {
-
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (update frame format: old values [width=%d, height=%d, format=%04x], new values [width=%d, height=%d, format=%04x])\n", frame->width, frame->height, frame->format, width, height, format);
-#endif
- free_framedata(frame);
-
- frame->width = width;
- frame->height = height;
- frame->format = format;
-
- switch(format) {
- case XINE_IMGFMT_YV12:
-/* frame->vo_frame.base[0] = xine_xmalloc_aligned(16, frame_size, (void **)&frame->data_mem[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned(16, frame_size/4, (void **)&frame->data_mem[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned(16, frame_size/4, (void **)&frame->data_mem[2]);*/
- frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
- frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
- frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height);
- frame->vo_frame.base[1] = malloc(frame->vo_frame.pitches[1] * ((height+1)/2));
- frame->vo_frame.base[2] = malloc(frame->vo_frame.pitches[2] * ((height+1)/2));
- break;
- case XINE_IMGFMT_YUY2:
-/* frame->vo_frame.base[0] = xine_xmalloc_aligned(16, (frame_size*2), (void **)&frame->data_mem[0]);*/
- frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = malloc(frame->vo_frame.pitches[0] * height);
- frame->vo_frame.base[1] = NULL;
- frame->vo_frame.base[2] = NULL;
- break;
- default:
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (unable to allocate "
- "framedata because of unknown frame format: %04x)\n", format);
- }
-
-/* if((format == IMGFMT_YV12 && (frame->data_mem[0] == NULL || frame->data_mem[1] == NULL || frame->data_mem[2] == NULL))
- || (format == IMGFMT_YUY2 && frame->data_mem[0] == NULL)) {*/
- if((format == XINE_IMGFMT_YV12 && (frame->vo_frame.base[0] == NULL || frame->vo_frame.base[1] == NULL || frame->vo_frame.base[2] == NULL))
- || (format == XINE_IMGFMT_YUY2 && frame->vo_frame.base[0] == NULL)) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (framedata allocation failed: out of memory)\n");
-
- free_framedata(frame);
- }
- }
-
- frame->ratio = ratio;
-}
-
-static void syncfb_overlay_blend(vo_driver_t* this_gen, vo_frame_t* frame_gen, vo_overlay_t* overlay)
-{
- syncfb_frame_t* frame = (syncfb_frame_t *) frame_gen;
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
-
- this->alphablend_extra_data.offset_x = frame_gen->overlay_offset_x;
- this->alphablend_extra_data.offset_y = frame_gen->overlay_offset_y;
-
- /* alpha blend here */
- if (overlay->rle) {
- if (frame->format == XINE_IMGFMT_YV12)
- _x_blend_yuv(frame->vo_frame.base, overlay, frame->width, frame->height, frame->vo_frame.pitches, &this->alphablend_extra_data);
- else
- _x_blend_yuy2(frame->vo_frame.base[0], overlay, frame->width, frame->height, frame->vo_frame.pitches[0], &this->alphablend_extra_data);
- }
-}
-
-static void syncfb_display_frame(vo_driver_t* this_gen, vo_frame_t* frame_gen)
-{
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
- syncfb_frame_t* frame = (syncfb_frame_t *) frame_gen;
-
- this->cur_frame = frame;
-
- /*
- * let's see if this frame is different in size / aspect
- * ratio from the previous one
- */
- if((frame->width != this->sc.delivered_width)
- || (frame->height != this->sc.delivered_height)
- || (frame->ratio != this->sc.delivered_ratio)) {
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (frame format changed)\n");
-#endif
-
- this->sc.delivered_width = frame->width;
- this->sc.delivered_height = frame->height;
- this->sc.delivered_ratio = frame->ratio;
-
- this->sc.crop_left = frame->vo_frame.crop_left;
- this->sc.crop_right = frame->vo_frame.crop_right;
- this->sc.crop_top = frame->vo_frame.crop_top;
- this->sc.crop_bottom = frame->vo_frame.crop_bottom;
-
- syncfb_compute_ideal_size(this);
-
- this->sc.force_redraw = 1;
- }
-
- /*
- * tell gui that we are about to display a frame,
- * ask for offset and output size
- */
- syncfb_redraw_needed(this_gen);
-
- /* the rest is only successful and safe, if the overlay is really on */
- if(this->overlay_state) {
- if(this->bufinfo.id != -1) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (invalid syncfb image buffer state)\n");
- frame->vo_frame.free(&frame->vo_frame);
-
- return;
- }
-
- if(ioctl(this->fd, SYNCFB_REQUEST_BUFFER, &this->bufinfo))
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_syncfb: error. (request ioctl failed)\n");
-
- if(this->bufinfo.id == -1) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (syncfb module couldn't allocate image buffer)\n");
- frame->vo_frame.free(&frame->vo_frame);
-
- /*
- * there are several "fixable" situations when this request will fail.
- * for example when the screen resolution changes, the kernel module
- * will get confused - reinitializing everything will fix things for
- * the next frame in that case.
- */
- syncfb_compute_ideal_size(this);
- syncfb_compute_output_size(this);
- syncfb_clean_output_area(this);
-
- return;
- }
-
- write_frame_sfb(this, frame);
-
- if(ioctl(this->fd, SYNCFB_COMMIT_BUFFER, &this->bufinfo))
- xprintf(this->xine, XINE_VERBOSITY_DEBUG, "video_out_syncfb: error. (commit ioctl failed)\n");
- }
- else
- frame->vo_frame.free(&frame->vo_frame);
-
- this->bufinfo.id = -1;
-}
-
-static int syncfb_get_property(vo_driver_t* this_gen, int property)
-{
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
-
- switch (property) {
- case VO_PROP_WINDOW_WIDTH:
- this->props[property].value = this->sc.gui_width;
- break;
- case VO_PROP_WINDOW_HEIGHT:
- this->props[property].value = this->sc.gui_height;
- break;
- case VO_PROP_OUTPUT_WIDTH:
- this->props[property].value = this->sc.output_width;
- break;
- case VO_PROP_OUTPUT_HEIGHT:
- this->props[property].value = this->sc.output_height;
- break;
- case VO_PROP_OUTPUT_XOFFSET:
- this->props[property].value = this->sc.output_xoffset;
- break;
- case VO_PROP_OUTPUT_YOFFSET:
- this->props[property].value = this->sc.output_yoffset;
- break;
- }
-
- return this->props[property].value;
-}
-
-static int syncfb_set_property(vo_driver_t* this_gen, int property, int value)
-{
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
-
- switch (property) {
- case VO_PROP_INTERLACED:
- this->props[property].value = value;
-
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (VO_PROP_INTERLACED(%d))\n",
- this->props[property].value);
-#endif
-
- syncfb_compute_ideal_size(this);
- syncfb_compute_output_size(this);
- syncfb_clean_output_area(this);
- break;
-
- case VO_PROP_ASPECT_RATIO:
- if(value >= XINE_VO_ASPECT_NUM_RATIOS)
- value = XINE_VO_ASPECT_AUTO;
-
- this->props[property].value = value;
- this->sc.user_ratio = value;
-
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (VO_PROP_ASPECT_RATIO(%d))\n",
- this->props[property].value);
-#endif
-
- syncfb_compute_ideal_size(this);
- syncfb_compute_output_size(this);
- syncfb_clean_output_area(this);
- break;
-
- case VO_PROP_ZOOM_X:
- if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
- this->props[property].value = value;
- this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;
-
- syncfb_compute_ideal_size (this);
-
- this->sc.force_redraw = 1;
- }
-/*
- printf("video_out_syncfb: info. (the zooming feature is not supported at the moment because of a bug with the SyncFB kernel driver, please refer to README.syncfb)\n");
-*/
- break;
-
- case VO_PROP_ZOOM_Y:
- if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
- this->props[property].value = value;
- this->sc.zoom_factor_y = (double)value / (double)XINE_VO_ZOOM_STEP;
-
- syncfb_compute_ideal_size (this);
-
- this->sc.force_redraw = 1;
- }
-/*
- printf("video_out_syncfb: info. (the zooming feature is not supported at the moment because of a bug with the SyncFB kernel driver, please refer to README.syncfb)\n");
-*/
- break;
-
- case VO_PROP_CONTRAST:
- this->props[property].value = value;
-
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (VO_PROP_CONTRAST(%d))\n",
- this->props[property].value);
-#endif
-
- this->params.contrast = value;
- this->params.brightness = this->props[VO_PROP_BRIGHTNESS].value;
- this->params.image_width = this->syncfb_config.image_width; /* FIXME */
- this->params.image_height = this->syncfb_config.image_height;
- this->params.image_xorg = this->syncfb_config.image_xorg;
- this->params.image_yorg = this->syncfb_config.image_yorg;
-
- if(ioctl(this->fd,SYNCFB_SET_PARAMS,&this->params))
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (setting of contrast value failed)\n");
-
- break;
-
- case VO_PROP_BRIGHTNESS:
- this->props[property].value = value;
-
-#ifdef DEBUG_OUTPUT
- printf("video_out_syncfb: debug. (VO_PROP_BRIGHTNESS(%d))\n",
- this->props[property].value);
-#endif
-
- this->params.brightness = value;
- this->params.contrast = this->props[VO_PROP_CONTRAST].value;
- this->params.image_width = this->syncfb_config.image_width; /* FIXME */
- this->params.image_height = this->syncfb_config.image_height;
- this->params.image_xorg = this->syncfb_config.image_xorg;
- this->params.image_yorg = this->syncfb_config.image_yorg;
-
- if(ioctl(this->fd,SYNCFB_SET_PARAMS,&this->params))
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: error. (setting of brightness value failed)\n");
-
- break;
- }
-
- return value;
-}
-
-static void syncfb_get_property_min_max(vo_driver_t *this_gen,
- int property, int *min, int *max)
-{
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
-
- *min = this->props[property].min;
- *max = this->props[property].max;
-}
-
-static int syncfb_gui_data_exchange(vo_driver_t* this_gen, int data_type,
- void *data)
-{
- syncfb_driver_t* this = (syncfb_driver_t *) this_gen;
-
- switch (data_type) {
- case XINE_GUI_SEND_DRAWABLE_CHANGED:
- this->drawable = (Drawable) data;
-
- XLockDisplay (this->display);
- XFreeGC(this->display, this->gc);
- this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
- XUnlockDisplay (this->display);
- break;
- case XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO:
- {
- int x1, y1, x2, y2;
- x11_rectangle_t *rect = data;
-
- _x_vo_scale_translate_gui2video(&this->sc, rect->x, rect->y,
- &x1, &y1);
- _x_vo_scale_translate_gui2video(&this->sc, rect->x + rect->w, rect->y + rect->h,
- &x2, &y2);
- rect->x = x1;
- rect->y = y1;
- rect->w = x2-x1;
- rect->h = y2-y1;
- }
- break;
- /*
- case XINE_GUI_DATA_EX_VIDEOWIN_VISIBLE:
- this->video_win_visibility = (int)(int *)data;
- syncfb_compute_output_size(this);
- break;
- */
-
- default:
- return -1;
- }
-
- return 0;
-}
-
-static void syncfb_dispose(vo_driver_t *this_gen)
-{
- syncfb_driver_t *this = (syncfb_driver_t *) this_gen;
-
- /* get it off the screen - I wanna see my desktop again :-) */
- syncfb_overlay_off(this);
-
- /* don't know if it is necessary are even right, but anyway...?! */
- munmap(0, this->capabilities.memory_size);
-
- close(this->fd);
-
- XLockDisplay (this->display);
- XFreeGC(this->display, this->gc);
- XUnlockDisplay (this->display);
-
- _x_alphablend_free(&this->alphablend_extra_data);
-
- free(this);
-}
-
-static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) {
-
- syncfb_class_t *class = (syncfb_class_t *) class_gen;
- config_values_t *config = class->config;
- syncfb_driver_t* this;
- unsigned int i;
- x11_visual_t* visual = (x11_visual_t *) visual_gen;
- XColor dummy;
- XWindowAttributes attr;
-
- if(!(this = calloc(1, sizeof (syncfb_driver_t))))
- return NULL;
-
- _x_alphablend_init(&this->alphablend_extra_data, class->xine);
-
- /* check for syncfb device */
- if((this->fd = xine_open_cloexec(class->device_name, O_RDWR)) < 0) {
- xprintf(class->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: aborting. (unable to open syncfb device \"%s\")\n", class->device_name);
- free(this);
- return NULL;
- }
-
- this->xine = class->xine;
-
- /* get capabilities from the syncfb module */
- if(ioctl(this->fd, SYNCFB_GET_CAPS, &this->capabilities)) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: aborting. (syncfb_get_caps ioctl failed)\n");
-
- close(this->fd);
- free(this);
-
- return NULL;
- }
-
- /* mmap whole video memory */
- this->video_mem = (uint8_t *) mmap(0, this->capabilities.memory_size, PROT_WRITE, MAP_SHARED, this->fd, 0);
-
- if(this->video_mem == MAP_FAILED) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: aborting. (mmap of video memory failed)\n");
-
- close(this->fd);
- free(this);
-
- return NULL;
- }
-
- /*
- * init properties and capabilities
- */
- for (i = 0; i<VO_NUM_PROPERTIES; i++) {
- this->props[i].value = 0;
- this->props[i].min = 0;
- this->props[i].max = 0;
- }
-
- 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;
- this->props[VO_PROP_ZOOM_Y].value = 100;
-
- /* check for formats we need... */
- this->supported_capabilities = VO_CAP_CROP;
- this->yuv_format = 0;
-
- /*
- * simple fallback mechanism - we want YUV 4:2:0 (3 plane) but we can also
- * convert YV12 material to YUV 4:2:0 (2 plane) and YUV 4:2:2 ...
- */
- if(this->capabilities.palettes & (1<<VIDEO_PALETTE_YUV420P3)) {
- this->supported_capabilities |= VO_CAP_YV12;
- this->yuv_format = VIDEO_PALETTE_YUV420P3;
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (3 plane))\n"));
- } else if(this->capabilities.palettes & (1<<VIDEO_PALETTE_YUV420P2)) {
- this->supported_capabilities |= VO_CAP_YV12;
- this->yuv_format = VIDEO_PALETTE_YUV420P2;
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_syncfb: info. (SyncFB module supports YUV 4:2:0 (2 plane))\n"));
- } else if(this->capabilities.palettes & (1<<VIDEO_PALETTE_YUV422)) {
- this->supported_capabilities |= VO_CAP_YV12;
- this->yuv_format = VIDEO_PALETTE_YUV422;
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- _("video_out_syncfb: info. (SyncFB module supports YUV 4:2:2)\n"));
- }
-
- if(this->capabilities.palettes & (1<<VIDEO_PALETTE_YUV422)) {
- this->supported_capabilities |= VO_CAP_YUY2;
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- _("video_out_syncfb: info. (SyncFB module supports YUY2)\n"));
- }
- if(this->capabilities.palettes & (1<<VIDEO_PALETTE_RGB565)) {
- /* FIXME: no RGB support yet
- * this->supported_capabilities |= VO_CAP_RGB;
- */
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- _("video_out_syncfb: info. (SyncFB module supports RGB565)\n"));
- }
-
- if(!this->supported_capabilities) {
- xprintf(this->xine, XINE_VERBOSITY_DEBUG,
- _("video_out_syncfb: aborting. (SyncFB module does not support YV12, YUY2 nor RGB565)\n"));
-
- munmap(0, this->capabilities.memory_size);
- close(this->fd);
- free(this);
-
- return NULL;
- }
-
- if(ioctl(this->fd,SYNCFB_GET_PARAMS,&this->params) == 0) {
- this->props[VO_PROP_CONTRAST].value = this->params.contrast;
- this->props[VO_PROP_CONTRAST].min = 0;
- this->props[VO_PROP_CONTRAST].max = 255;
-
- this->props[VO_PROP_BRIGHTNESS].value = this->params.brightness;
- this->props[VO_PROP_BRIGHTNESS].min = -128;
- this->props[VO_PROP_BRIGHTNESS].max = 127;
- } else {
- xprintf(this->xine, XINE_VERBOSITY_LOG,
- _("video_out_syncfb: info. (brightness/contrast control won\'t be available because "
- "your SyncFB kernel module seems to be outdated. Please refer to README."
- "syncfb for information on how to update it.)\n"));
- }
-
- /* check for virtual screen size and screen depth - this is rather important
- because that data is later used for free memory calculation */
- XGetWindowAttributes(visual->display, DefaultRootWindow(visual->display), &attr);
-
- this->virtual_screen_height = attr.height;
- this->virtual_screen_width = attr.width;
- this->screen_depth = attr.depth;
-
- /* initialize the rest of the variables now with default values */
- this->bufinfo.id = -1;
- this->config = config;
- this->cur_frame = NULL;
-
- /* FIXME: setting the default_repeat to anything higher than 1 will result
- in a distorted video, so for now, set this manually to 0 until
- the kernel driver is fixed... */
-#if 0
- this->default_repeat = config->register_range(config,
- "video.device.syncfb_default_repeat", 3, 1, 4,
- _("default number of frame repetitions"),
- _("This specifies how many times a single video "
- "frame will be displayed consecutively."),
- 10, NULL, NULL);
-#endif
- this->default_repeat = 0;
-
- this->display = visual->display;
- this->drawable = visual->d;
- this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
-
- _x_vo_scale_init (&this->sc, 1, 0, config );
- this->sc.frame_output_cb = visual->frame_output_cb;
- this->sc.user_data = visual->user_data;
-
- this->overlay = NULL;
- this->screen = visual->screen;
- this->video_win_visibility = 1;
-
- XAllocNamedColor(this->display,
- DefaultColormap(this->display, this->screen),
- "black", &this->black, &dummy);
-
- this->vo_driver.get_capabilities = syncfb_get_capabilities;
- this->vo_driver.alloc_frame = syncfb_alloc_frame;
- this->vo_driver.update_frame_format = syncfb_update_frame_format;
- this->vo_driver.overlay_begin = NULL; /* not used */
- this->vo_driver.overlay_blend = syncfb_overlay_blend;
- this->vo_driver.overlay_end = NULL; /* not used */
- this->vo_driver.display_frame = syncfb_display_frame;
- this->vo_driver.get_property = syncfb_get_property;
- this->vo_driver.set_property = syncfb_set_property;
- this->vo_driver.get_property_min_max = syncfb_get_property_min_max;
- this->vo_driver.gui_data_exchange = syncfb_gui_data_exchange;
- this->vo_driver.dispose = syncfb_dispose;
- this->vo_driver.redraw_needed = syncfb_redraw_needed;
-
- return &this->vo_driver;
-}
-
-/*
- * class functions
- */
-
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "SyncFB";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the SyncFB module for Matrox G200/G400 cards");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
-
- syncfb_class_t *this = (syncfb_class_t *) this_gen;
-
- free (this);
-}
-
-static void *init_class (xine_t *xine, void *visual_gen) {
-
- syncfb_class_t *this;
- char* device_name;
- int fd;
-
- device_name = xine->config->register_filename(xine->config, "video.device.syncfb_device", "/dev/syncfb",
- XINE_CONFIG_STRING_IS_DEVICE_NAME,
- _("SyncFB device name"),
- _("Specifies the file name for the SyncFB (TeleTux) device "
- "to be used.\nThis setting is security critical, "
- "because when changed to a different file, xine "
- "can be used to fill this file with arbitrary content. "
- "So you should be careful that the value you enter "
- "really is a proper framebuffer device."),
- XINE_CONFIG_SECURITY, NULL, NULL);
-
- /* check for syncfb device */
- if((fd = xine_open_cloexec(device_name, O_RDWR)) < 0) {
- xprintf(xine, XINE_VERBOSITY_DEBUG,
- "video_out_syncfb: aborting. (unable to open syncfb device \"%s\")\n", device_name);
- return NULL;
- }
- close(fd);
-
- /*
- * from this point on, nothing should go wrong anymore
- */
- this = calloc(1, sizeof (syncfb_class_t));
-
- 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->config = xine->config;
- this->xine = xine;
- this->device_name = device_name;
-
- return this;
-}
-
-static const vo_info_t vo_info_syncfb = {
- 7, /* priority */
- XINE_VISUAL_TYPE_X11 /* visual type */
-};
-
-/*
- * exported plugin catalog entry
- */
-
-const plugin_info_t xine_plugin_info[] EXPORTED = {
- /* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "SyncFB", XINE_VERSION_CODE, &vo_info_syncfb, init_class },
- { PLUGIN_NONE, 0, "", 0, NULL, NULL }
-};
-
diff --git a/src/video_out/video_out_syncfb.h b/src/video_out/video_out_syncfb.h
deleted file mode 100644
index 069cbcedc..000000000
--- a/src/video_out/video_out_syncfb.h
+++ /dev/null
@@ -1,236 +0,0 @@
-#ifndef __LINUX_SYNCFB_H
-#define __LINUX_SYNCFB_H
-
-#ifdef __KERNEL__
-#include <linux/version.h>
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/sched.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/errno.h>
-#include <linux/malloc.h>
-#include <linux/pci.h>
-#include <linux/init.h>
-#include <linux/videodev.h>
-
-#include <asm/mtrr.h>
-#include <asm/uaccess.h>
-#include <asm/system.h>
-#include <asm/io.h>
-
-#define TRUE 1
-#define FALSE 0
-
-#define SFB_STATUS_FREE 0
-#define SFB_STATUS_OFFS 1
-#define SFB_STATUS_WAIT 2
-#define SFB_STATUS_LIVE 3
-
-#endif /* KERNEL */
-
-
-#ifndef AARONS_TYPES
-typedef unsigned long uint_32;
-typedef unsigned char uint_8;
-#endif
-
-#define SYNCFB_MAJOR 178
-
-#define SYNCFB_ERROR_NO_ERROR 0;
-#define SYNCFB_ERROR_NO_BUFFER_AVAILABLE 1;
-#define SYNCFB_ERROR_PALETTE_NOT_SUPPORTED 2;
-#define SYNCFB_ERROR_NOT_ENOUGH_MEMORY 3;
-
-
-
-#ifndef __LINUX_VIDEODEV_H
-#define VIDEO_PALETTE_GREY 1 /* Linear greyscale */
-#define VIDEO_PALETTE_HI240 2 /* High 240 cube (BT848) */
-#define VIDEO_PALETTE_RGB565 3 /* 565 16 bit RGB */
-#define VIDEO_PALETTE_RGB24 4 /* 24bit RGB */
-#define VIDEO_PALETTE_RGB32 5 /* 32bit RGB */
-#define VIDEO_PALETTE_RGB555 6 /* 555 15bit RGB */
-#define VIDEO_PALETTE_YUV422 7 /* YUV422 capture */
-#define VIDEO_PALETTE_YUYV 8
-#define VIDEO_PALETTE_UYVY 9 /* The great thing about standards is ... */
-#define VIDEO_PALETTE_YUV420 10
-#define VIDEO_PALETTE_YUV411 11 /* YUV411 capture */
-#define VIDEO_PALETTE_RAW 12 /* RAW capture (BT848) */
-#define VIDEO_PALETTE_YUV422P 13 /* YUV 4:2:2 Planar */
-#define VIDEO_PALETTE_YUV411P 14 /* YUV 4:1:1 Planar */
-#define VIDEO_PALETTE_YUV420P 15 /* YUV 4:2:0 Planar */
-#define VIDEO_PALETTE_YUV410P 16 /* YUV 4:1:0 Planar */
-#define VIDEO_PALETTE_PLANAR 13 /* start of planar entries */
-#define VIDEO_PALETTE_COMPONENT 7 /* start of component entries */
-#endif
-
-
-#define VIDEO_PALETTE_YUV422P3 13 /* YUV 4:2:2 Planar (3 Plane, same as YUV422P) */
-#define VIDEO_PALETTE_YUV422P2 17 /* YUV 4:2:2 Planar (2 Plane) */
-
-#define VIDEO_PALETTE_YUV411P3 14 /* YUV 4:1:1 Planar (3 Plane, same as YUV411P) */
-#define VIDEO_PALETTE_YUV411P2 18 /* YUV 4:1:1 Planar (2 Plane) */
-
-#define VIDEO_PALETTE_YUV420P3 15 /* YUV 4:2:0 Planar (3 Plane, same as YUV420P) */
-#define VIDEO_PALETTE_YUV420P2 19 /* YUV 4:2:0 Planar (2 Plane) */
-
-#define VIDEO_PALETTE_YUV410P3 16 /* YUV 4:1:0 Planar (3 Plane, same as YUV410P) */
-#define VIDEO_PALETTE_YUV410P2 20 /* YUV 4:1:0 Planar (2 Plane) */
-
-
-
-#define SYNCFB_FEATURE_SCALE_H 1
-#define SYNCFB_FEATURE_SCALE_V 2
-#define SYNCFB_FEATURE_SCALE 3
-#define SYNCFB_FEATURE_CROP 4
-#define SYNCFB_FEATURE_OFFSET 8
-#define SYNCFB_FEATURE_DEINTERLACE 16
-#define SYNCFB_FEATURE_PROCAMP 32
-#define SYNCFB_FEATURE_TRANSITIONS 64
-#define SYNCFB_FEATURE_COLKEY 128
-#define SYNCFB_FEATURE_MIRROR_H 256
-#define SYNCFB_FEATURE_MIRROR_V 512
-#define SYNCFB_FEATURE_BLOCK_REQUEST 1024
-#define SYNCFB_FEATURE_FREQDIV2 2048
-
-
-typedef struct syncfb_config_s
-{
- uint_32 syncfb_mode; /* bitfield: turn on/off the available features */
- uint_32 error_code; /* RO: returns 0 on successful config calls, error code otherwise */
-
- uint_32 fb_screen_size; /* WO, size in bytes of video memory reserved for fbdev */
- uint_32 fb_screen_width; /* WO, visible screen width in pixel */
- uint_32 fb_screen_height; /* WO, visible screen height in pixel */
-
- uint_32 buffers; /* RO, number of available buffers */
- uint_32 buffer_size; /* RO, filled in by syncfb */
-
- uint_32 default_repeat; /* default repeat time for a single frame, can be overridden in syncfb_buffer_info_t */
-
- uint_32 src_width; /* source image width in pixel */
- uint_32 src_height; /* source image height in pixel */
- uint_32 src_palette; /* set palette mode, see videodev.h for palettes */
- uint_32 src_pitch; /* RO: filled in by ioctl: actual line length in pixel */
-
- uint_32 image_xorg; /* x position of the image on the screen */
- uint_32 image_yorg; /* y position of the image on the screen */
-
- /* if syncfb has FEATURE_SCALE */
- uint_32 scale_filters; /* 0: no filtering, 255: all filters on */
- uint_32 image_width; /* onscreen image width */
- uint_32 image_height; /* onscreen image height */
-
- /* if syncfb has FEATURE_CROP */
- uint_32 src_crop_left; /* */
- uint_32 src_crop_right; /* */
- uint_32 src_crop_top; /* */
- uint_32 src_crop_bot; /* */
-
- /* if syncfb has FEATURE_OFFSET */
- uint_32 image_offset_left; /* */
- uint_32 image_offset_right; /* */
- uint_32 image_offset_top; /* */
- uint_32 image_offset_bot; /* */
-
- /* if syncfb has FEATURE_COLKEY */
- uint_8 colkey_red;
- uint_8 colkey_green;
- uint_8 colkey_blue;
-
-} syncfb_config_t;
-
-
-/*
- picture parameters,
-*/
-typedef struct syncfb_param_s
-{
- /* the idea is to enable smooth transitions between eg. image sizes (not yet implemented) */
- /* if syncfb has FEATURE_TRANSITIONS */
- uint_32 transition_time;
-
- /* if syncfb has FEATURE_PROCAMP */
- uint_32 contrast; /* 0: least contrast, 1000: normal contrast, */
- uint_32 brightness;
- uint_32 color; /* for syncfb_matrox: color=0: b/w else: full color */
-
- /* if syncfb has FEATURE_SCALE , currently only supported in CONFIG call */
- uint_8 scale_filters; /* 0: no filtering, 255: all filters on */
- uint_32 image_xorg; /* x position of the image on the screen */
- uint_32 image_yorg; /* y position of the image on the screen */
- uint_32 image_width; /* onscreen image width */
- uint_32 image_height; /* onscreen image height */
-
-} syncfb_param_t;
-
-
-
-typedef struct syncfb_status_info_s
-{
- uint_32 field_cnt; /* basically all vbi's since the start of syncfb */
- uint_32 frame_cnt; /* number of frames comitted & output */
-
- uint_32 hold_field_cnt; /* number of repeated fields becaus no new data was available */
- uint_32 skip_field_cnt; /* skipped fields when fifo was about to fill up */
-
- uint_32 request_frames; /* number of request_buffer calls */
- uint_32 commit_frames; /* number of commit_buffer calls */
-
- uint_32 failed_requests; /* number of calls to request_buffer that failed */
-
- uint_32 buffers_waiting;
- uint_32 buffers_free;
-
-} syncfb_status_info_t;
-
-
-
-
-typedef struct syncfb_capability_s
-{
- char name[64]; /* A name for the syncfb ... */
- uint_32 palettes; /* supported palettes - see videodev.h for palettes, test the corresponding bit here */
- uint_32 features; /* supported features - see SYNCFB_FEATURE_* */
- uint_32 memory_size; /* total size of mappable video memory */
-
-} syncfb_capability_t;
-
-
-
-typedef struct syncfb_buffer_info_s
-{
- int id; /* buffer id: a return value of -1 means no buffer available */
- uint_32 repeat; /* the buffer will be shown <repeat> times */
- uint_32 offset; /* buffer offset from start of video memory */
- uint_32 offset_p2; /* yuv plane 2 buffer offset from start of video memory */
- uint_32 offset_p3; /* yuv plane 3 buffer offset from start of video memory */
-
-} syncfb_buffer_info_t;
-
-
-
-
-
-
-
-/* get syncfb capabilities */
-#define SYNCFB_GET_CAPS _IOR('J', 1, syncfb_config_t)
-
-#define SYNCFB_GET_CONFIG _IOR('J', 2, syncfb_config_t)
-#define SYNCFB_SET_CONFIG _IOR('J', 3, syncfb_config_t)
-#define SYNCFB_ON _IO ('J', 4)
-#define SYNCFB_OFF _IO ('J', 5)
-#define SYNCFB_REQUEST_BUFFER _IOR ('J', 6, syncfb_buffer_info_t)
-#define SYNCFB_COMMIT_BUFFER _IOR ('J', 7, syncfb_buffer_info_t)
-#define SYNCFB_STATUS _IOR ('J', 8, syncfb_status_info_t)
-#define SYNCFB_VBI _IO ('J', 9) /* simulate interrupt - debugging only */
-#define SYNCFB_SET_PARAMS _IOR('J', 10, syncfb_param_t)
-#define SYNCFB_GET_PARAMS _IOR('J', 11, syncfb_param_t)
-
-
-
-
-#endif /* __LINUX_SYNCFB_H */
-
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
new file mode 100644
index 000000000..29f365a78
--- /dev/null
+++ b/src/video_out/video_out_vdpau.c
@@ -0,0 +1,3273 @@
+/*
+ * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
+ * Copyright (C) 2008 the xine project
+ * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
+ *
+ * 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
+ *
+ *
+ * video_out_vdpau.c, a video output plugin
+ * using VDPAU (Video Decode and Presentation Api for Unix)
+ *
+ *
+ */
+
+/* #define LOG */
+#define LOG_MODULE "video_out_vdpau"
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+#include <ctype.h>
+#include <pthread.h>
+
+#include <xine.h>
+#include <xine/video_out.h>
+#include <xine/vo_scale.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+
+#include <vdpau/vdpau_x11.h>
+#include "accel_vdpau.h"
+
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
+#define NUM_FRAMES_BACK 1
+
+#define LOCKDISPLAY /*define this if you have a buggy libX11/xcb*/
+//#undef LOCKDISPLAY
+
+
+#define DEINT_BOB 1
+#define DEINT_HALF_TEMPORAL 2
+#define DEINT_HALF_TEMPORAL_SPATIAL 3
+#define DEINT_TEMPORAL 4
+#define DEINT_TEMPORAL_SPATIAL 5
+
+#define NUMBER_OF_DEINTERLACERS 5
+
+static const char *const vdpau_deinterlacer_name[] = {
+ "bob",
+ "half temporal",
+ "half temporal_spatial",
+ "temporal",
+ "temporal_spatial",
+ NULL
+};
+
+static const char *const vdpau_deinterlacer_description [] = {
+ "bob\nBasic deinterlacing, doing 50i->50p.\n\n",
+ "half temporal\nDisplays first field only, doing 50i->25p\n\n",
+ "half temporal_spatial\nDisplays first field only, doing 50i->25p\n\n",
+ "temporal\nVery good, 50i->50p\n\n",
+ "temporal_spatial\nThe best, but very GPU intensive.\n\n",
+ NULL
+};
+
+
+static const char *const vdpau_sd_only_properties[] = {
+ "none",
+ "noise",
+ "sharpness",
+ "noise+sharpness",
+ NULL
+};
+
+static const VdpOutputSurfaceRenderBlendState blend = {
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION,
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE,
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_COLOR,
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE,
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD,
+ VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD,
+ { 0 }
+};
+
+
+
+VdpDevice vdp_device;
+VdpPresentationQueue vdp_queue;
+VdpPresentationQueueTarget vdp_queue_target;
+
+VdpDeviceDestroy *vdp_device_destroy;
+
+VdpGetProcAddress *vdp_get_proc_address;
+
+VdpGetApiVersion *vdp_get_api_version;
+VdpGetInformationString *vdp_get_information_string;
+VdpGetErrorString *vdp_get_error_string;
+
+VdpVideoSurfaceQueryCapabilities *vdp_video_surface_query_capabilities;
+VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities *vdp_video_surface_query_get_put_bits_ycbcr_capabilities;
+VdpVideoSurfaceCreate *vdp_video_surface_create;
+VdpVideoSurfaceDestroy *vdp_video_surface_destroy;
+VdpVideoSurfacePutBitsYCbCr *vdp_video_surface_putbits_ycbcr;
+VdpVideoSurfaceGetBitsYCbCr *vdp_video_surface_getbits_ycbcr;
+VdpVideoSurfaceGetParameters *vdp_video_surface_get_parameters;
+
+VdpOutputSurfaceQueryCapabilities *vdp_output_surface_query_capabilities;
+VdpOutputSurfaceQueryGetPutBitsNativeCapabilities *vdp_output_surface_query_get_put_bits_native_capabilities;
+VdpOutputSurfaceQueryPutBitsYCbCrCapabilities *vdp_output_surface_query_put_bits_ycbcr_capabilities;
+VdpOutputSurfaceCreate *vdp_output_surface_create;
+VdpOutputSurfaceDestroy *vdp_output_surface_destroy;
+VdpOutputSurfaceRenderOutputSurface *vdp_output_surface_render_output_surface;
+VdpOutputSurfaceGetBitsNative *vdp_output_surface_get_bits;
+VdpOutputSurfacePutBitsNative *vdp_output_surface_put_bits;
+VdpOutputSurfacePutBitsYCbCr *vdp_output_surface_put_bits_ycbcr;
+
+VdpVideoMixerCreate *vdp_video_mixer_create;
+VdpVideoMixerDestroy *vdp_video_mixer_destroy;
+VdpVideoMixerRender *vdp_video_mixer_render;
+VdpVideoMixerSetAttributeValues *vdp_video_mixer_set_attribute_values;
+VdpVideoMixerSetFeatureEnables *vdp_video_mixer_set_feature_enables;
+VdpVideoMixerGetFeatureEnables *vdp_video_mixer_get_feature_enables;
+VdpVideoMixerQueryFeatureSupport *vdp_video_mixer_query_feature_support;
+VdpVideoMixerQueryParameterSupport *vdp_video_mixer_query_parameter_support;
+VdpVideoMixerQueryAttributeSupport *vdp_video_mixer_query_attribute_support;
+VdpVideoMixerQueryParameterValueRange *vdp_video_mixer_query_parameter_value_range;
+VdpVideoMixerQueryAttributeValueRange *vdp_video_mixer_query_attribute_value_range;
+
+VdpGenerateCSCMatrix *vdp_generate_csc_matrix;
+
+VdpPresentationQueueTargetCreateX11 *vdp_queue_target_create_x11;
+VdpPresentationQueueTargetDestroy *vdp_queue_target_destroy;
+VdpPresentationQueueCreate *vdp_queue_create;
+VdpPresentationQueueDestroy *vdp_queue_destroy;
+VdpPresentationQueueDisplay *vdp_queue_display;
+VdpPresentationQueueBlockUntilSurfaceIdle *vdp_queue_block;
+VdpPresentationQueueSetBackgroundColor *vdp_queue_set_background_color;
+VdpPresentationQueueGetTime *vdp_queue_get_time;
+VdpPresentationQueueQuerySurfaceStatus *vdp_queue_query_surface_status;
+
+VdpDecoderQueryCapabilities *vdp_decoder_query_capabilities;
+VdpDecoderCreate *vdp_decoder_create;
+VdpDecoderDestroy *vdp_decoder_destroy;
+VdpDecoderRender *vdp_decoder_render;
+
+VdpPreemptionCallbackRegister *vdp_preemption_callback_register;
+
+static void vdp_preemption_callback( VdpDevice device, void *context );
+static void vdpau_reinit( vo_driver_t *this_gen );
+
+static VdpVideoSurfaceCreate *orig_vdp_video_surface_create;
+static VdpVideoSurfaceDestroy *orig_vdp_video_surface_destroy;
+
+static VdpOutputSurfaceCreate *orig_vdp_output_surface_create;
+static VdpOutputSurfaceDestroy *orig_vdp_output_surface_destroy;
+
+static VdpVideoSurfacePutBitsYCbCr *orig_vdp_video_surface_putbits_ycbcr;
+
+static VdpDecoderCreate *orig_vdp_decoder_create;
+static VdpDecoderDestroy *orig_vdp_decoder_destroy;
+static VdpDecoderRender *orig_vdp_decoder_render;
+
+#ifdef LOCKDISPLAY
+#define DO_LOCKDISPLAY XLockDisplay(guarded_display)
+#define DO_UNLOCKDISPLAY XUnlockDisplay(guarded_display)
+static Display *guarded_display;
+#else
+#define DO_LOCKDISPLAY
+#define DO_UNLOCKDISPLAY
+#endif
+
+static VdpStatus guarded_vdp_video_surface_putbits_ycbcr(VdpVideoSurface surface, VdpYCbCrFormat source_ycbcr_format, void const *const *source_data, uint32_t const *source_pitches)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_video_surface_putbits_ycbcr(surface, source_ycbcr_format, source_data, source_pitches);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+static VdpStatus guarded_vdp_video_surface_create(VdpDevice device, VdpChromaType chroma_type, uint32_t width, uint32_t height,VdpVideoSurface *surface)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_video_surface_create(device, chroma_type, width, height, surface);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+static VdpStatus guarded_vdp_video_surface_destroy(VdpVideoSurface surface)
+{
+ VdpStatus r;
+ /*XLockDisplay(guarded_display);*/
+ r = orig_vdp_video_surface_destroy(surface);
+ /*XUnlockDisplay(guarded_display);*/
+ return r;
+}
+
+static VdpStatus guarded_vdp_output_surface_create(VdpDevice device, VdpChromaType chroma_type, uint32_t width, uint32_t height,VdpVideoSurface *surface)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_output_surface_create(device, chroma_type, width, height, surface);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+static VdpStatus guarded_vdp_output_surface_destroy(VdpVideoSurface surface)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_output_surface_destroy(surface);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+static VdpStatus guarded_vdp_decoder_create(VdpDevice device, VdpDecoderProfile profile, uint32_t width, uint32_t height, uint32_t max_references, VdpDecoder *decoder)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_decoder_create(device, profile, width, height, max_references, decoder);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+static VdpStatus guarded_vdp_decoder_destroy(VdpDecoder decoder)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_decoder_destroy(decoder);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+static VdpStatus guarded_vdp_decoder_render(VdpDecoder decoder, VdpVideoSurface target, VdpPictureInfo const *picture_info, uint32_t bitstream_buffer_count, VdpBitstreamBuffer const *bitstream_buffers)
+{
+ VdpStatus r;
+ DO_LOCKDISPLAY;
+ r = orig_vdp_decoder_render(decoder, target, picture_info, bitstream_buffer_count, bitstream_buffers);
+ DO_UNLOCKDISPLAY;
+ return r;
+}
+
+
+
+typedef struct {
+ VdpOutputSurface surface;
+ uint32_t width;
+ uint32_t height;
+ uint32_t size;
+} vdpau_output_surface_t;
+
+
+typedef struct {
+ xine_grab_video_frame_t grab_frame;
+
+ vo_driver_t *vo_driver;
+ vdpau_output_surface_t render_surface;
+ int width, height;
+ uint32_t *rgba;
+} vdpau_grab_video_frame_t;
+
+
+typedef struct {
+ vo_frame_t vo_frame;
+
+ int width, height, format, flags;
+ double ratio;
+
+ int surface_cleared_nr;
+
+ vdpau_accel_t vdpau_accel_data;
+} vdpau_frame_t;
+
+
+typedef struct {
+
+ int x; /* x start of subpicture area */
+ int y; /* y start of subpicture area */
+ int width; /* width of subpicture area */
+ int height; /* height of subpicture area */
+
+ /* area within osd extent to scale video to */
+ int video_window_x;
+ int video_window_y;
+ int video_window_width;
+ int video_window_height;
+
+ /* extent of reference coordinate system */
+ int extent_width;
+ int extent_height;
+
+ int unscaled; /* true if it should be blended unscaled */
+ int use_dirty_rect; /* true if update of dirty rect only is possible */
+
+ vo_overlay_t *ovl;
+
+ vdpau_output_surface_t render_surface;
+} vdpau_overlay_t;
+
+
+typedef struct {
+
+ vo_driver_t vo_driver;
+ vo_scale_t sc;
+
+ Display *display;
+ int screen;
+ Drawable drawable;
+ pthread_mutex_t drawable_lock;
+ uint32_t display_width;
+ uint32_t display_height;
+
+ config_values_t *config;
+
+ int ovl_changed;
+ int num_ovls;
+ int old_num_ovls;
+ vdpau_overlay_t overlays[XINE_VORAW_MAX_OVL];
+ uint32_t *ovl_pixmap;
+ int ovl_pixmap_size;
+ VdpOutputSurface ovl_layer_surface;
+ VdpRect ovl_src_rect;
+ VdpRect ovl_dest_rect;
+ VdpRect ovl_video_dest_rect;
+ vdpau_output_surface_t ovl_main_render_surface;
+
+ VdpVideoSurface soft_surface;
+ uint32_t soft_surface_width;
+ uint32_t soft_surface_height;
+ int soft_surface_format;
+
+#define NOUTPUTSURFACEBUFFER 25
+ vdpau_output_surface_t output_surface_buffer[NOUTPUTSURFACEBUFFER];
+ int output_surface_buffer_size;
+ int num_big_output_surfaces_created;
+
+#define NOUTPUTSURFACE 8
+ VdpOutputSurface output_surface[NOUTPUTSURFACE];
+ uint8_t current_output_surface;
+ uint32_t output_surface_width[NOUTPUTSURFACE];
+ uint32_t output_surface_height[NOUTPUTSURFACE];
+ uint8_t init_queue;
+ uint8_t queue_length;
+
+ vdpau_grab_video_frame_t *pending_grab_request;
+ pthread_mutex_t grab_lock;
+ pthread_cond_t grab_cond;
+
+ VdpVideoMixer video_mixer;
+ VdpChromaType video_mixer_chroma;
+ uint32_t video_mixer_width;
+ uint32_t video_mixer_height;
+ VdpColorStandard color_standard;
+ VdpBool temporal_spatial_is_supported;
+ VdpBool temporal_is_supported;
+ VdpBool noise_reduction_is_supported;
+ VdpBool sharpness_is_supported;
+ VdpBool inverse_telecine_is_supported;
+ VdpBool skip_chroma_is_supported;
+ VdpBool background_is_supported;
+
+ const char* deinterlacers_name[NUMBER_OF_DEINTERLACERS+1];
+ int deinterlacers_method[NUMBER_OF_DEINTERLACERS];
+
+ int scaling_level_max;
+ int scaling_level_current;
+
+ VdpColor back_color;
+
+ vdpau_frame_t *back_frame[ NUM_FRAMES_BACK ];
+
+ uint32_t capabilities;
+ xine_t *xine;
+
+ int hue;
+ int saturation;
+ int brightness;
+ int contrast;
+ int sharpness;
+ int noise;
+ int deinterlace;
+ int deinterlace_method_hd;
+ int deinterlace_method_sd;
+ int enable_inverse_telecine;
+ int honor_progressive;
+ int skip_chroma;
+ int sd_only_properties;
+ int studio_levels;
+ int background;
+
+ int vdp_runtime_nr;
+ int reinit_needed;
+
+ int surface_cleared_nr;
+
+ int allocated_surfaces;
+ int zoom_x;
+ int zoom_y;
+} vdpau_driver_t;
+
+
+typedef struct {
+ video_driver_class_t driver_class;
+ xine_t *xine;
+} vdpau_class_t;
+
+
+
+static VdpStatus vdpau_get_output_surface (vdpau_driver_t *this, uint32_t width, uint32_t height, vdpau_output_surface_t *r)
+{
+ int i, full = 1;
+ vdpau_output_surface_t *smallest = NULL, *best = NULL;
+ vdpau_output_surface_t *l = &this->output_surface_buffer[0];
+ VdpStatus st = VDP_STATUS_OK;
+
+ for (i = this->output_surface_buffer_size; i; --i, ++l) {
+ if (l->surface == VDP_INVALID_HANDLE)
+ full = 0;
+ else if ((l->width >= width && l->height >= height) && (best == NULL || l->size < best->size))
+ best = l;
+ else if (smallest == NULL || l->size < smallest->size)
+ smallest = l;
+ }
+
+ if (best != NULL) {
+ *r = *best;
+ best->surface = VDP_INVALID_HANDLE;
+ } else if (full) {
+ *r = *smallest;
+ smallest->surface = VDP_INVALID_HANDLE;
+ } else
+ r->surface = VDP_INVALID_HANDLE;
+
+ if (r->surface != VDP_INVALID_HANDLE && (r->width < width || r->height < height)) {
+ lprintf("destroy output surface %d\n", (int)r->surface);
+ st = vdp_output_surface_destroy(r->surface);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vdpau_get_output_surface: vdp_output_surface_destroy failed : %s\n", vdp_get_error_string(st));
+ r->surface = VDP_INVALID_HANDLE;
+ }
+
+ if (r->surface == VDP_INVALID_HANDLE) {
+ if (this->num_big_output_surfaces_created < this->output_surface_buffer_size) {
+ /* We create big output surfaces which should fit for many output buffer requests as long
+ * as the reuse buffer can hold them */
+ if (width < this->video_mixer_width)
+ width = this->video_mixer_width;
+ if (height < this->video_mixer_height)
+ height = this->video_mixer_height;
+
+ if (width < this->display_width)
+ width = this->display_width;
+ if (height < this->display_height)
+ height = this->display_height;
+
+ ++this->num_big_output_surfaces_created;
+ }
+
+ st = vdp_output_surface_create(vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, width, height, &r->surface);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vdpau_get_output_surface: vdp_output_surface_create failed : %s\n", vdp_get_error_string(st));
+ r->width = width;
+ r->height = height;
+ r->size = width * height;
+ lprintf("create output surface %dx%d -> %d\n", (int)r->width, (int)r->height, (int)r->surface);
+ }
+
+ return st;
+}
+
+
+
+static void vdpau_free_output_surface (vdpau_driver_t *this, vdpau_output_surface_t *os)
+{
+ if (os->surface == VDP_INVALID_HANDLE)
+ return;
+
+ vdpau_output_surface_t *smallest = NULL;
+ vdpau_output_surface_t *l = &this->output_surface_buffer[0];
+ int i;
+ for (i = this->output_surface_buffer_size; i; --i, ++l) {
+ if (l->surface == VDP_INVALID_HANDLE) {
+ *l = *os;
+ os->surface = VDP_INVALID_HANDLE;
+ return;
+ } else if (smallest == NULL || l->size < smallest->size)
+ smallest = l;
+ }
+
+ VdpOutputSurface surface;
+ if (smallest && smallest->size < os->size) {
+ surface = smallest->surface;
+ *smallest = *os;
+ } else
+ surface = os->surface;
+
+ lprintf("destroy output surface %d\n", (int)surface);
+ VdpStatus st = vdp_output_surface_destroy (surface);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vdpau_free_output_surface: vdp_output_surface_destroy failed : %s\n", vdp_get_error_string(st));
+
+ os->surface = VDP_INVALID_HANDLE;
+}
+
+
+static void vdpau_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->ovl_changed = changed;
+ if ( changed ) {
+ this->old_num_ovls = this->num_ovls;
+ this->num_ovls = 0;
+ lprintf("overlay begin\n");
+ }
+}
+
+
+static void vdpau_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *voovl)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ if (!this->ovl_changed)
+ return;
+
+ int i = this->num_ovls;
+ if (i >= XINE_VORAW_MAX_OVL)
+ return;
+
+ if (voovl->width <= 0 || voovl->height <= 0 || (!voovl->rle && (!voovl->argb_layer || !voovl->argb_layer->buffer)))
+ return;
+
+ if (voovl->rle)
+ lprintf("overlay[%d] rle %s%s %dx%d@%d,%d extend %dx%d hili %d,%d-%d,%d video %dx%d@%d,%d\n", i,
+ voovl->unscaled ? " unscaled ": " scaled ",
+ (voovl->rgb_clut > 0 || voovl->hili_rgb_clut > 0) ? " rgb ": " ycbcr ",
+ voovl->width, voovl->height, voovl->x, voovl->y,
+ voovl->extent_width, voovl->extent_height,
+ voovl->hili_left, voovl->hili_top,
+ voovl->hili_right, voovl->hili_bottom,
+ voovl->video_window_width,voovl->video_window_height,
+ voovl->video_window_x,voovl->video_window_y);
+ if (voovl->argb_layer && voovl->argb_layer->buffer)
+ lprintf("overlay[%d] argb %s %dx%d@%d,%d extend %dx%d, dirty %d,%d-%d,%d video %dx%d@%d,%d\n", i,
+ voovl->unscaled ? " unscaled ": " scaled ",
+ voovl->width, voovl->height, voovl->x, voovl->y,
+ voovl->extent_width, voovl->extent_height,
+ voovl->argb_layer->x1, voovl->argb_layer->y1,
+ voovl->argb_layer->x2, voovl->argb_layer->y2,
+ voovl->video_window_width,voovl->video_window_height,
+ voovl->video_window_x,voovl->video_window_y);
+
+ vdpau_overlay_t *ovl = &this->overlays[i];
+
+ if (i >= this->old_num_ovls ||
+ (ovl->use_dirty_rect &&
+ (ovl->render_surface.surface == VDP_INVALID_HANDLE ||
+ voovl->rle ||
+ ovl->x != voovl->x || ovl->y != voovl->y ||
+ ovl->width != voovl->width || ovl->height != voovl->height)))
+ ovl->use_dirty_rect = 0;
+
+ ovl->ovl = voovl;
+ ovl->x = voovl->x;
+ ovl->y = voovl->y;
+ ovl->width = voovl->width;
+ ovl->height = voovl->height;
+ ovl->extent_width = voovl->extent_width;
+ ovl->extent_height = voovl->extent_height;
+ ovl->unscaled = voovl->unscaled;
+ ovl->video_window_x = voovl->video_window_x;
+ ovl->video_window_y = voovl->video_window_y;
+ ovl->video_window_width = voovl->video_window_width;
+ ovl->video_window_height = voovl->video_window_height;
+
+ this->num_ovls = i + 1;
+}
+
+
+static void vdpau_overlay_end (vo_driver_t *this_gen, vo_frame_t *frame_gen)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ if (!this->ovl_changed)
+ return;
+
+ int i;
+ for (i = 0; i < this->old_num_ovls; ++i) {
+ vdpau_overlay_t *ovl = &this->overlays[i];
+ if (i >= this->num_ovls || !ovl->use_dirty_rect) {
+ lprintf("overlay[%d] free render surface %d\n", i, (int)ovl->render_surface.surface);
+ vdpau_free_output_surface(this, &ovl->render_surface);
+ }
+ }
+ if (this->ovl_main_render_surface.surface != VDP_INVALID_HANDLE) {
+ lprintf("overlay free main render surface %d\n", (int)this->ovl_main_render_surface.surface);
+ vdpau_free_output_surface(this, &this->ovl_main_render_surface);
+ }
+
+ for (i = 0; i < this->num_ovls; ++i) {
+ vdpau_overlay_t *ovl = &this->overlays[i];
+ vo_overlay_t *voovl = ovl->ovl;
+
+ if (!ovl->use_dirty_rect) {
+ vdpau_get_output_surface(this, ovl->width, ovl->height, &ovl->render_surface);
+ lprintf("overlay[%d] get render surface %dx%d -> %d\n", i, ovl->width, ovl->height, (int)ovl->render_surface.surface);
+ }
+
+ uint32_t *pixmap;
+ int is_argb = 1;
+ if (voovl->rle) {
+ if ((ovl->width * ovl->height) > this->ovl_pixmap_size) {
+ this->ovl_pixmap_size = ovl->width * ovl->height;
+ free(this->ovl_pixmap);
+ this->ovl_pixmap = calloc(this->ovl_pixmap_size, sizeof(uint32_t));
+ }
+
+ pixmap = this->ovl_pixmap;
+ rle_elem_t *rle = voovl->rle;
+ int num_rle = voovl->num_rle;
+ int pos = 0;
+ while (num_rle > 0) {
+ int x = pos % ovl->width;
+ int y = pos / ovl->width;
+ clut_t *colors;
+ uint8_t *trans;
+ if (x >= voovl->hili_left && x <= voovl->hili_right && y >= voovl->hili_top && y <= voovl->hili_bottom) {
+ colors = (clut_t*)voovl->hili_color;
+ trans = voovl->hili_trans;
+ is_argb = voovl->hili_rgb_clut;
+ } else {
+ colors = (clut_t*)voovl->color;
+ trans = voovl->trans;
+ is_argb = voovl->rgb_clut;
+ }
+
+ int clr = rle->color;
+ uint32_t pixel;
+ if ( trans[clr] == 0 )
+ pixel = 0;
+ else if (is_argb)
+ pixel = (((uint32_t)trans[clr] * 255 / 15) << 24) | (((uint32_t)colors[clr].y) << 16) | (((uint32_t)colors[clr].cr) << 8) | ((uint32_t)colors[clr].cb);
+ else
+ pixel = (((uint32_t)trans[clr] * 255 / 15) << 24) | (((uint32_t)colors[clr].y) << 16) | (((uint32_t)colors[clr].cb) << 8) | ((uint32_t)colors[clr].cr);
+
+ int rlelen = rle->len;
+ pos += rlelen;
+ while (rlelen > 0) {
+ *pixmap++ = pixel;
+ --rlelen;
+ }
+ ++rle;
+ --num_rle;
+ }
+
+ int n = ovl->width * ovl->height - pos;
+ if (n > 0)
+ memset(pixmap, 0, n * sizeof(uint32_t));
+
+ pixmap = this->ovl_pixmap;
+ } else {
+ pthread_mutex_lock(&voovl->argb_layer->mutex);
+ pixmap = voovl->argb_layer->buffer;
+ }
+
+ VdpRect put_rect;
+ if (ovl->use_dirty_rect) {
+ put_rect.x0 = voovl->argb_layer->x1;
+ put_rect.y0 = voovl->argb_layer->y1;
+ put_rect.x1 = voovl->argb_layer->x2;
+ put_rect.y1 = voovl->argb_layer->y2;
+ } else {
+ put_rect.x0 = 0;
+ put_rect.y0 = 0;
+ put_rect.x1 = ovl->width;
+ put_rect.y1 = ovl->height;
+ }
+
+ VdpStatus st;
+ uint32_t pitch = ovl->width * sizeof(uint32_t);
+ if (is_argb) {
+ lprintf("overlay[%d] put %s %d,%d:%d,%d\n", i, ovl->use_dirty_rect ? "dirty argb": "argb", put_rect.x0, put_rect.y0, put_rect.x1, put_rect.y1);
+ st = vdp_output_surface_put_bits(ovl->render_surface.surface, &pixmap, &pitch, &put_rect);
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_overlay_end: vdp_output_surface_put_bits_native failed : %s\n", vdp_get_error_string(st));
+ } else {
+ lprintf("overlay[%d] put ycbcr %d,%d:%d,%d\n", i, put_rect.x0, put_rect.y0, put_rect.x1, put_rect.y1);
+ st = vdp_output_surface_put_bits_ycbcr(ovl->render_surface.surface, VDP_YCBCR_FORMAT_V8U8Y8A8, &pixmap, &pitch, &put_rect, NULL);
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vdpau_overlay_end: vdp_output_surface_put_bits_ycbcr failed : %s\n", vdp_get_error_string(st));
+ }
+
+ if (voovl->rle)
+ ovl->use_dirty_rect = 0;
+ else {
+ pthread_mutex_unlock(&voovl->argb_layer->mutex);
+ ovl->use_dirty_rect = 1;
+ }
+ }
+}
+
+
+static void vdpau_process_overlays (vdpau_driver_t *this)
+{
+ int novls = this->num_ovls;
+ if (!novls) {
+ this->ovl_changed = 0;
+ return;
+ }
+
+ int zoom = (this->sc.delivered_width > this->sc.displayed_width || this->sc.delivered_height > this->sc.displayed_height);
+
+ VdpRect vid_src_rect;
+ if (zoom) {
+ /* compute displayed video window coordinates */
+ vid_src_rect.x0 = this->sc.displayed_xoffset;
+ vid_src_rect.y0 = this->sc.displayed_yoffset;
+ vid_src_rect.x1 = this->sc.displayed_width + this->sc.displayed_xoffset;
+ vid_src_rect.y1 = this->sc.displayed_height + this->sc.displayed_yoffset;
+ }
+
+ /* compute video window output coordinates */
+ VdpRect vid_rect;
+ vid_rect.x0 = this->sc.output_xoffset;
+ vid_rect.y0 = this->sc.output_yoffset;
+ vid_rect.x1 = this->sc.output_xoffset + this->sc.output_width;
+ vid_rect.y1 = this->sc.output_yoffset + this->sc.output_height;
+ this->ovl_video_dest_rect = vid_rect;
+
+ VdpRect ovl_rects[XINE_VORAW_MAX_OVL], ovl_src_rects[XINE_VORAW_MAX_OVL];
+ int i, first_visible = 0, nvisible = 0;
+ for (i = 0; i < novls; ++i) {
+ vdpau_overlay_t *ovl = &this->overlays[i];
+
+ /* compute unscaled displayed overlay window coordinates */
+ VdpRect ovl_src_rect;
+ ovl_src_rect.x0 = 0;
+ ovl_src_rect.y0 = 0;
+ ovl_src_rect.x1 = ovl->width;
+ ovl_src_rect.y1 = ovl->height;
+
+ /* compute unscaled overlay window output coordinates */
+ VdpRect ovl_rect;
+ ovl_rect.x0 = ovl->x;
+ ovl_rect.y0 = ovl->y;
+ ovl_rect.x1 = ovl->x + ovl->width;
+ ovl_rect.y1 = ovl->y + ovl->height;
+
+ /* Note: Always coordinates of last overlay osd video window is taken into account */
+ if (ovl->video_window_width > 0 && ovl->video_window_height > 0) {
+ /* compute unscaled osd video window output coordinates */
+ vid_rect.x0 = ovl->video_window_x;
+ vid_rect.y0 = ovl->video_window_y;
+ vid_rect.x1 = ovl->video_window_x + ovl->video_window_width;
+ vid_rect.y1 = ovl->video_window_y + ovl->video_window_height;
+ this->ovl_video_dest_rect = vid_rect;
+ }
+
+ if (!ovl->unscaled) {
+ double rx, ry;
+ VdpRect clip_rect;
+ if (ovl->extent_width > 0 && ovl->extent_height > 0) {
+ if (zoom) {
+ /* compute frame size to extend size scaling factor */
+ rx = (double)ovl->extent_width / (double)this->sc.delivered_width;
+ ry = (double)ovl->extent_height / (double)this->sc.delivered_height;
+
+ /* scale displayed video window coordinates to extend coordinates */
+ clip_rect.x0 = vid_src_rect.x0 * rx + 0.5;
+ clip_rect.y0 = vid_src_rect.y0 * ry + 0.5;
+ clip_rect.x1 = vid_src_rect.x1 * rx + 0.5;
+ clip_rect.y1 = vid_src_rect.y1 * ry + 0.5;
+
+ /* compute displayed size to output size scaling factor */
+ rx = (double)this->sc.output_width / (double)(clip_rect.x1 - clip_rect.x0);
+ ry = (double)this->sc.output_height / (double)(clip_rect.y1 - clip_rect.y0);
+
+ } else {
+ /* compute extend size to output size scaling factor */
+ rx = (double)this->sc.output_width / (double)ovl->extent_width;
+ ry = (double)this->sc.output_height / (double)ovl->extent_height;
+ }
+ } else {
+ if (zoom)
+ clip_rect = vid_src_rect;
+
+ /* compute displayed size to output size scaling factor */
+ rx = (double)this->sc.output_width / (double)this->sc.displayed_width;
+ ry = (double)this->sc.output_height / (double)this->sc.displayed_height;
+ }
+
+ if (zoom) {
+ /* clip overlay window to margins of displayed video window */
+ if (ovl_rect.x0 < clip_rect.x0) {
+ ovl_src_rect.x0 = clip_rect.x0 - ovl_rect.x0;
+ ovl_rect.x0 = clip_rect.x0;
+ }
+ if (ovl_rect.y0 < clip_rect.y0) {
+ ovl_src_rect.y0 = clip_rect.y0 - ovl_rect.y0;
+ ovl_rect.y0 = clip_rect.y0;
+ }
+ if (ovl_rect.x1 > clip_rect.x1) {
+ ovl_src_rect.x1 -= (ovl_rect.x1 - clip_rect.x1);
+ ovl_rect.x1 = clip_rect.x1;
+ }
+ if (ovl_rect.y1 > clip_rect.y1) {
+ ovl_src_rect.y1 -= (ovl_rect.y1 - clip_rect.y1);
+ ovl_rect.y1 = clip_rect.y1;
+ }
+
+ ovl_rect.x0 -= clip_rect.x0;
+ ovl_rect.y0 -= clip_rect.y0;
+ ovl_rect.x1 -= clip_rect.x0;
+ ovl_rect.y1 -= clip_rect.y0;
+ }
+
+ /* scale overlay window coordinates to output window coordinates */
+ ovl_rect.x0 = (double)ovl_rect.x0 * rx + 0.5;
+ ovl_rect.y0 = (double)ovl_rect.y0 * ry + 0.5;
+ ovl_rect.x1 = (double)ovl_rect.x1 * rx + 0.5;
+ ovl_rect.y1 = (double)ovl_rect.y1 * ry + 0.5;
+
+ ovl_rect.x0 += this->sc.output_xoffset;
+ ovl_rect.y0 += this->sc.output_yoffset;
+ ovl_rect.x1 += this->sc.output_xoffset;
+ ovl_rect.y1 += this->sc.output_yoffset;
+
+ if (ovl->video_window_width > 0 && ovl->video_window_height > 0) {
+ if (zoom) {
+ /* clip osd video window to margins of displayed video window */
+ if (vid_rect.x0 < clip_rect.x0)
+ vid_rect.x0 = clip_rect.x0;
+ if (vid_rect.y0 < clip_rect.y0)
+ vid_rect.y0 = clip_rect.y0;
+ if (vid_rect.x1 > clip_rect.x1)
+ vid_rect.x1 = clip_rect.x1;
+ if (vid_rect.y1 > clip_rect.y1)
+ vid_rect.y1 = clip_rect.y1;
+
+ vid_rect.x0 -= clip_rect.x0;
+ vid_rect.y0 -= clip_rect.y0;
+ vid_rect.x1 -= clip_rect.x0;
+ vid_rect.y1 -= clip_rect.y0;
+ }
+
+ /* scale osd video window coordinates to output window coordinates */
+ vid_rect.x0 = (double)vid_rect.x0 * rx + 0.5;
+ vid_rect.y0 = (double)vid_rect.y0 * ry + 0.5;
+ vid_rect.x1 = (double)vid_rect.x1 * rx + 0.5;
+ vid_rect.y1 = (double)vid_rect.y1 * ry + 0.5;
+
+ vid_rect.x0 += this->sc.output_xoffset;
+ vid_rect.y0 += this->sc.output_yoffset;
+ vid_rect.x1 += this->sc.output_xoffset;
+ vid_rect.y1 += this->sc.output_yoffset;
+
+ /* take only visible osd video windows into account */
+ if (vid_rect.x0 < vid_rect.x1 && vid_rect.y0 < vid_rect.y1)
+ this->ovl_video_dest_rect = vid_rect;
+ }
+
+ this->ovl_changed = 1;
+ }
+
+ ovl_rects[i] = ovl_rect;
+ ovl_src_rects[i] = ovl_src_rect;
+
+ /* take only visible overlays into account */
+ if (ovl_rect.x0 < ovl_rect.x1 && ovl_rect.y0 < ovl_rect.y1) {
+ /* compute overall output window size */
+ if (nvisible == 0) {
+ first_visible = i;
+ this->ovl_dest_rect = ovl_rect;
+ } else {
+ if (ovl_rect.x0 < this->ovl_dest_rect.x0)
+ this->ovl_dest_rect.x0 = ovl_rect.x0;
+ if (ovl_rect.y0 < this->ovl_dest_rect.y0)
+ this->ovl_dest_rect.y0 = ovl_rect.y0;
+ if (ovl_rect.x1 > this->ovl_dest_rect.x1)
+ this->ovl_dest_rect.x1 = ovl_rect.x1;
+ if (ovl_rect.y1 > this->ovl_dest_rect.y1)
+ this->ovl_dest_rect.y1 = ovl_rect.y1;
+ }
+ ++nvisible;
+ }
+ }
+
+ if (nvisible == 0) {
+ this->ovl_layer_surface = VDP_INVALID_HANDLE;
+ this->ovl_changed = 0;
+ lprintf("overlays not visible\n");
+ return;
+ } else if (nvisible == 1) {
+ /* we have only one visible overlay object so we can use it directly as overlay layer surface */
+ this->ovl_src_rect = ovl_src_rects[first_visible];
+ this->ovl_layer_surface = this->overlays[first_visible].render_surface.surface;
+ } else {
+ this->ovl_src_rect.x0 = 0;
+ this->ovl_src_rect.y0 = 0;
+ this->ovl_src_rect.x1 = this->ovl_dest_rect.x1 - this->ovl_dest_rect.x0;
+ this->ovl_src_rect.y1 = this->ovl_dest_rect.y1 - this->ovl_dest_rect.y0;
+ this->ovl_layer_surface = this->ovl_main_render_surface.surface;
+ }
+
+ lprintf("overlay output %d,%d:%d,%d -> %d,%d:%d,%d video window %d,%d:%d,%d\n",
+ this->ovl_src_rect.x0, this->ovl_src_rect.y0, this->ovl_src_rect.x1, this->ovl_src_rect.y1,
+ this->ovl_dest_rect.x0, this->ovl_dest_rect.y0, this->ovl_dest_rect.x1, this->ovl_dest_rect.y1,
+ this->ovl_video_dest_rect.x0, this->ovl_video_dest_rect.y0, this->ovl_video_dest_rect.x1, this->ovl_video_dest_rect.y1);
+
+ if (!this->ovl_changed)
+ return;
+
+ if (nvisible == 1) {
+ this->ovl_changed = 0;
+ return;
+ }
+
+ if (this->ovl_main_render_surface.surface != VDP_INVALID_HANDLE) {
+ lprintf("overlay free main render surface %d\n", (int)this->ovl_main_render_surface.surface);
+ vdpau_free_output_surface(this, &this->ovl_main_render_surface);
+ }
+
+ vdpau_get_output_surface(this, this->ovl_src_rect.x1, this->ovl_src_rect.y1, &this->ovl_main_render_surface);
+ lprintf("overlay get main render surface %dx%d -> %d\n", this->ovl_src_rect.x1, this->ovl_src_rect.y1, (int)this->ovl_main_render_surface.surface);
+
+ this->ovl_layer_surface = this->ovl_main_render_surface.surface;
+
+ /* Clear main render surface if first overlay does not cover hole output window */
+ if (this->ovl_dest_rect.x0 != ovl_rects[first_visible].x0 ||
+ this->ovl_dest_rect.x1 != ovl_rects[first_visible].x1 ||
+ this->ovl_dest_rect.y0 != ovl_rects[first_visible].y0 ||
+ this->ovl_dest_rect.y1 != ovl_rects[first_visible].y1) {
+ lprintf("overlay clear main render output surface %dx%d\n", this->ovl_src_rect.x1, this->ovl_src_rect.y1);
+
+ if (this->ovl_src_rect.x1 > this->ovl_pixmap_size) {
+ this->ovl_pixmap_size = this->ovl_src_rect.x1;
+ free(this->ovl_pixmap);
+ this->ovl_pixmap = calloc(this->ovl_pixmap_size, sizeof(uint32_t));
+ } else {
+ memset(this->ovl_pixmap, 0, (this->ovl_src_rect.x1 * sizeof(uint32_t)));
+ }
+
+ uint32_t pitch = 0;
+ VdpStatus st = vdp_output_surface_put_bits(this->ovl_layer_surface, &this->ovl_pixmap, &pitch, &this->ovl_src_rect);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vdpau_process_overlays: vdp_output_surface_put_bits (clear) failed : %s\n", vdp_get_error_string(st));
+ }
+
+ /* Render all visible overlays into main render surface */
+ for (i = 0; i < novls; ++i) {
+ vdpau_overlay_t *ovl = &this->overlays[i];
+
+ if (ovl_rects[i].x0 < ovl_rects[i].x1 && ovl_rects[i].y0 < ovl_rects[i].y1) {
+ /* compensate overall output offset of main render surface */
+ VdpRect render_rect;
+ render_rect.x0 = ovl_rects[i].x0 - this->ovl_dest_rect.x0;
+ render_rect.x1 = ovl_rects[i].x1 - this->ovl_dest_rect.x0;
+ render_rect.y0 = ovl_rects[i].y0 - this->ovl_dest_rect.y0;
+ render_rect.y1 = ovl_rects[i].y1 - this->ovl_dest_rect.y0;
+
+ lprintf("overlay[%d] render %d,%d:%d,%d -> %d,%d:%d,%d\n",
+ i, ovl_rects[i].x0, ovl_rects[i].y0, ovl_rects[i].x1, ovl_rects[i].y1, render_rect.x0, render_rect.y0, render_rect.x1, render_rect.y1);
+
+ VdpOutputSurfaceRenderBlendState *bs = (i > first_visible) ? &blend: NULL;
+ VdpStatus st = vdp_output_surface_render_output_surface(this->ovl_layer_surface, &render_rect, ovl->render_surface.surface, &ovl_src_rects[i], 0, bs, 0 );
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vdpau_process_overlays: vdp_output_surface_render_output_surface failed : %s\n", vdp_get_error_string(st));
+ }
+ }
+ this->ovl_changed = 0;
+}
+
+
+
+static void vdpau_frame_proc_slice (vo_frame_t *vo_img, uint8_t **src)
+{
+ vdpau_frame_t *frame = (vdpau_frame_t *) vo_img ;
+
+ vo_img->proc_called = 1;
+}
+
+
+
+static void vdpau_frame_field (vo_frame_t *vo_img, int which_field)
+{
+}
+
+
+
+static void vdpau_frame_dispose (vo_frame_t *vo_img)
+{
+ vdpau_frame_t *frame = (vdpau_frame_t *) vo_img ;
+
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
+ if ( frame->vdpau_accel_data.surface != VDP_INVALID_HANDLE )
+ vdp_video_surface_destroy( frame->vdpau_accel_data.surface );
+ free (frame);
+}
+
+
+
+static vo_frame_t *vdpau_alloc_frame (vo_driver_t *this_gen)
+{
+ vdpau_frame_t *frame;
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ lprintf( "vo_vdpau: vdpau_alloc_frame\n" );
+
+ frame = (vdpau_frame_t *) calloc(1, sizeof(vdpau_frame_t));
+
+ if (!frame)
+ return NULL;
+
+ frame->vo_frame.base[0] = frame->vo_frame.base[1] = frame->vo_frame.base[2] = NULL;
+ frame->width = frame->height = frame->format = frame->flags = 0;
+
+ frame->vo_frame.accel_data = &frame->vdpau_accel_data;
+
+ pthread_mutex_init (&frame->vo_frame.mutex, NULL);
+
+ /*
+ * supply required functions/fields
+ */
+ frame->vo_frame.proc_duplicate_frame_data = NULL;
+ frame->vo_frame.proc_slice = vdpau_frame_proc_slice;
+ frame->vo_frame.proc_frame = NULL;
+ frame->vo_frame.field = vdpau_frame_field;
+ frame->vo_frame.dispose = vdpau_frame_dispose;
+ frame->vo_frame.driver = this_gen;
+
+ frame->surface_cleared_nr = 0;
+
+ frame->vdpau_accel_data.vo_frame = &frame->vo_frame;
+ frame->vdpau_accel_data.vdp_device = vdp_device;
+ frame->vdpau_accel_data.surface = VDP_INVALID_HANDLE;
+ frame->vdpau_accel_data.chroma = VDP_CHROMA_TYPE_420;
+ frame->vdpau_accel_data.color_standard = this->color_standard;
+ frame->vdpau_accel_data.vdp_decoder_create = vdp_decoder_create;
+ frame->vdpau_accel_data.vdp_decoder_destroy = vdp_decoder_destroy;
+ frame->vdpau_accel_data.vdp_decoder_render = vdp_decoder_render;
+ frame->vdpau_accel_data.vdp_get_error_string = vdp_get_error_string;
+ frame->vdpau_accel_data.vdp_runtime_nr = this->vdp_runtime_nr;
+ frame->vdpau_accel_data.current_vdp_runtime_nr = &this->vdp_runtime_nr;
+
+ return (vo_frame_t *) frame;
+}
+
+
+
+static void vdpau_provide_standard_frame_data (vo_frame_t *this, xine_current_frame_data_t *data)
+{
+ VdpStatus st;
+ VdpYCbCrFormat format;
+ uint32_t pitches[3];
+ void *base[3];
+
+ if (this->format != XINE_IMGFMT_VDPAU) {
+ fprintf(stderr, "vdpau_provide_standard_frame_data: unexpected frame format 0x%08x!\n", this->format);
+ return;
+ }
+
+ vdpau_accel_t *accel = (vdpau_accel_t *) this->accel_data;
+
+ if (accel->vdp_runtime_nr != *(accel->current_vdp_runtime_nr))
+ return;
+
+ this = accel->vo_frame;
+
+ if (accel->chroma == VDP_CHROMA_TYPE_420) {
+ data->format = XINE_IMGFMT_YV12;
+ data->img_size = this->width * this->height
+ + ((this->width + 1) / 2) * ((this->height + 1) / 2)
+ + ((this->width + 1) / 2) * ((this->height + 1) / 2);
+ if (data->img) {
+ pitches[0] = this->width;
+ pitches[2] = this->width / 2;
+ pitches[1] = this->width / 2;
+ base[0] = data->img;
+ base[2] = data->img + this->width * this->height;
+ base[1] = data->img + this->width * this->height + this->width * this->height / 4;
+ format = VDP_YCBCR_FORMAT_YV12;
+ }
+ } else {
+ data->format = XINE_IMGFMT_YUY2;
+ data->img_size = this->width * this->height
+ + ((this->width + 1) / 2) * this->height
+ + ((this->width + 1) / 2) * this->height;
+ if (data->img) {
+ pitches[0] = this->width * 2;
+ base[0] = data->img;
+ format = VDP_YCBCR_FORMAT_YUYV;
+ }
+ }
+
+ if (data->img) {
+ st = vdp_video_surface_getbits_ycbcr(accel->surface, format, base, pitches);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: failed to get surface bits !! %s\n", vdp_get_error_string(st));
+ }
+}
+
+
+
+static void vdpau_duplicate_frame_data (vo_frame_t *this_gen, vo_frame_t *original)
+{
+ vdpau_frame_t *this = (vdpau_frame_t *)this_gen;
+ vdpau_frame_t *orig = (vdpau_frame_t *)original;
+ VdpStatus st;
+ VdpYCbCrFormat format;
+
+ if (orig->vo_frame.format != XINE_IMGFMT_VDPAU) {
+ fprintf(stderr, "vdpau_duplicate_frame_data: unexpected frame format 0x%08x!\n", orig->vo_frame.format);
+ return;
+ }
+
+ if(orig->vdpau_accel_data.vdp_runtime_nr != this->vdpau_accel_data.vdp_runtime_nr) {
+ fprintf(stderr, "vdpau_duplicate_frame_data: called with invalid frame\n");
+ return;
+ }
+
+ if (!(orig->flags & VO_CHROMA_422)) {
+ this->vo_frame.pitches[0] = 8*((orig->vo_frame.width + 7) / 8);
+ this->vo_frame.pitches[1] = 8*((orig->vo_frame.width + 15) / 16);
+ this->vo_frame.pitches[2] = 8*((orig->vo_frame.width + 15) / 16);
+ this->vo_frame.base[0] = av_mallocz(this->vo_frame.pitches[0] * orig->vo_frame.height);
+ this->vo_frame.base[1] = av_mallocz(this->vo_frame.pitches[1] * ((orig->vo_frame.height+1)/2));
+ this->vo_frame.base[2] = av_mallocz(this->vo_frame.pitches[2] * ((orig->vo_frame.height+1)/2));
+ format = VDP_YCBCR_FORMAT_YV12;
+ } else {
+ this->vo_frame.pitches[0] = 8*((orig->vo_frame.width + 3) / 4);
+ this->vo_frame.base[0] = av_mallocz(this->vo_frame.pitches[0] * orig->vo_frame.height);
+ format = VDP_YCBCR_FORMAT_YUYV;
+ }
+
+ st = vdp_video_surface_getbits_ycbcr(orig->vdpau_accel_data.surface, format, this->vo_frame.base, this->vo_frame.pitches);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: failed to get surface bits !! %s\n", vdp_get_error_string(st));
+
+ st = vdp_video_surface_putbits_ycbcr(this->vdpau_accel_data.surface, format, this->vo_frame.base, this->vo_frame.pitches);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: failed to put surface bits !! %s\n", vdp_get_error_string(st));
+
+ this->vdpau_accel_data.color_standard = orig->vdpau_accel_data.color_standard;
+
+ av_freep (&this->vo_frame.base[0]);
+ av_freep (&this->vo_frame.base[1]);
+ av_freep (&this->vo_frame.base[2]);
+}
+
+
+
+static void vdpau_update_frame_format (vo_driver_t *this_gen, vo_frame_t *frame_gen,
+ uint32_t width, uint32_t height, double ratio, int format, int flags)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ vdpau_frame_t *frame = (vdpau_frame_t *) frame_gen;
+ uint32_t requested_width = width;
+ uint32_t requested_height = height;
+
+ int clear = 0;
+
+ if ( flags & VO_NEW_SEQUENCE_FLAG )
+ ++this->surface_cleared_nr;
+
+ VdpChromaType chroma = (flags & VO_CHROMA_422) ? VDP_CHROMA_TYPE_422 : VDP_CHROMA_TYPE_420;
+
+ /* adjust width and height to meet xine and VDPAU constraints */
+ width = (width + ((flags & VO_CHROMA_422) ? 3 : 15)) & ~((flags & VO_CHROMA_422) ? 3 : 15); /* xine constraint */
+ height = (height + 3) & ~3; /* VDPAU constraint */
+ /* any excess pixels from the adjustment will be cropped away */
+ frame->vo_frame.width = width;
+ frame->vo_frame.height = height;
+ frame->vo_frame.crop_right += width - requested_width;
+ frame->vo_frame.crop_bottom += height - requested_height;
+
+ /* Check frame size and format and reallocate if necessary */
+ if ( (frame->width != width) || (frame->height != height) || (frame->format != format) || (frame->format==XINE_IMGFMT_VDPAU && frame->vdpau_accel_data.chroma!=chroma) ||
+ (frame->vdpau_accel_data.vdp_runtime_nr != this->vdp_runtime_nr)) {
+
+ /* (re-) allocate render space */
+ av_freep (&frame->vo_frame.base[0]);
+ av_freep (&frame->vo_frame.base[1]);
+ av_freep (&frame->vo_frame.base[2]);
+
+ if (format == XINE_IMGFMT_YV12) {
+ frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
+ frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
+ frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
+ frame->vo_frame.base[0] = av_mallocz (frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz (frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz (frame->vo_frame.pitches[2] * ((height+1)/2));
+ } else if (format == XINE_IMGFMT_YUY2){
+ frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
+ frame->vo_frame.base[0] = av_mallocz (frame->vo_frame.pitches[0] * height);
+ }
+
+ if ( frame->vdpau_accel_data.vdp_runtime_nr != this->vdp_runtime_nr ) {
+ frame->vdpau_accel_data.surface = VDP_INVALID_HANDLE;
+ frame->vdpau_accel_data.vdp_runtime_nr = this->vdp_runtime_nr;
+ frame->vdpau_accel_data.vdp_device = vdp_device;
+ frame->vo_frame.proc_duplicate_frame_data = NULL;
+ frame->vo_frame.proc_provide_standard_frame_data = NULL;
+ }
+
+ if ( frame->vdpau_accel_data.surface != VDP_INVALID_HANDLE ) {
+ if ( (frame->width != width) || (frame->height != height) || (format != XINE_IMGFMT_VDPAU) || frame->vdpau_accel_data.chroma != chroma ) {
+ lprintf("vo_vdpau: update_frame - destroy surface\n");
+ vdp_video_surface_destroy( frame->vdpau_accel_data.surface );
+ frame->vdpau_accel_data.surface = VDP_INVALID_HANDLE;
+ --this->allocated_surfaces;
+ frame->vo_frame.proc_duplicate_frame_data = NULL;
+ frame->vo_frame.proc_provide_standard_frame_data = NULL;
+ }
+ }
+
+ if ( (format == XINE_IMGFMT_VDPAU) && (frame->vdpau_accel_data.surface == VDP_INVALID_HANDLE) ) {
+ VdpStatus st = vdp_video_surface_create( vdp_device, chroma, width, height, &frame->vdpau_accel_data.surface );
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: failed to create surface !! %s\n", vdp_get_error_string( st ) );
+ else {
+ clear = 1;
+ frame->vdpau_accel_data.chroma = chroma;
+ ++this->allocated_surfaces;
+ frame->vo_frame.proc_duplicate_frame_data = vdpau_duplicate_frame_data;
+ frame->vo_frame.proc_provide_standard_frame_data = vdpau_provide_standard_frame_data;
+
+ /* check whether allocated surface matches constraints */
+ {
+ VdpChromaType ct = (VdpChromaType)-1;
+ int w = -1;
+ int h = -1;
+
+ st = vdp_video_surface_get_parameters(frame->vdpau_accel_data.surface, &ct, &w, &h);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: failed to get parameters !! %s\n", vdp_get_error_string(st));
+ else if (w != width || h != height) {
+
+ fprintf(stderr, "vo_vdpau: video surface doesn't match size contraints (%d x %d) -> (%d x %d) != (%d x %d). Segfaults ahead!\n"
+ , requested_width, requested_height, width, height, w, h);
+ }
+ }
+ }
+ }
+
+ frame->width = width;
+ frame->height = height;
+ frame->format = format;
+ frame->flags = flags;
+
+ vdpau_frame_field ((vo_frame_t *)frame, flags);
+ }
+
+ if ( (format == XINE_IMGFMT_VDPAU) && (clear || (frame->surface_cleared_nr != this->surface_cleared_nr)) ) {
+ lprintf( "clear surface: %d\n", frame->vdpau_accel_data.surface );
+ if ( frame->vdpau_accel_data.chroma == VDP_CHROMA_TYPE_422 ) {
+ uint8_t *cb = malloc( frame->width * 2 );
+ memset( cb, 127, frame->width * 2 );
+ uint32_t pitches[] = { 0 };
+ void* data[] = { cb };
+ VdpStatus st = vdp_video_surface_putbits_ycbcr( frame->vdpau_accel_data.surface, VDP_YCBCR_FORMAT_YUYV, &data, pitches );
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: failed to clear surface: %s\n", vdp_get_error_string( st ) );
+ free( cb );
+ }
+ else {
+ uint8_t *cb = malloc( frame->width );
+ memset( cb, 127, frame->width );
+ uint32_t pitches[] = { 0, 0, 0 };
+ void* data[] = { cb, cb, cb };
+ VdpStatus st = vdp_video_surface_putbits_ycbcr( frame->vdpau_accel_data.surface, VDP_YCBCR_FORMAT_YV12, &data, pitches );
+ if ( st!=VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: failed to clear surface: %s\n", vdp_get_error_string( st ) );
+ free( cb );
+ }
+ if ( frame->surface_cleared_nr != this->surface_cleared_nr )
+ frame->surface_cleared_nr = this->surface_cleared_nr;
+ }
+
+ frame->vdpau_accel_data.color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+ frame->ratio = ratio;
+ frame->vo_frame.future_frame = NULL;
+}
+
+
+
+static int vdpau_redraw_needed (vo_driver_t *this_gen)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ _x_vo_scale_compute_ideal_size( &this->sc );
+ if ( _x_vo_scale_redraw_needed( &this->sc ) ) {
+ _x_vo_scale_compute_output_size( &this->sc );
+ return 1;
+ }
+ return 0;
+}
+
+
+
+static void vdpau_release_back_frames( vo_driver_t *this_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ int i;
+
+ for ( i=0; i<NUM_FRAMES_BACK; ++i ) {
+ if ( this->back_frame[ i ])
+ this->back_frame[ i ]->vo_frame.free( &this->back_frame[ i ]->vo_frame );
+ this->back_frame[ i ] = NULL;
+ }
+}
+
+
+
+static void vdpau_backup_frame( vo_driver_t *this_gen, vo_frame_t *frame_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ vdpau_frame_t *frame = (vdpau_frame_t *) frame_gen;
+
+ int i;
+ if ( this->back_frame[NUM_FRAMES_BACK-1]) {
+ this->back_frame[NUM_FRAMES_BACK-1]->vo_frame.free (&this->back_frame[NUM_FRAMES_BACK-1]->vo_frame);
+ }
+ for ( i=NUM_FRAMES_BACK-1; i>0; i-- )
+ this->back_frame[i] = this->back_frame[i-1];
+ this->back_frame[0] = frame;
+}
+
+
+
+static void vdpau_set_deinterlace( vo_driver_t *this_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ VdpVideoMixerFeature features[2];
+ VdpBool feature_enables[2];
+ int features_count = 0;
+ int deinterlace_method;
+
+ if ( this->temporal_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL;
+ ++features_count;
+ }
+ if ( this->temporal_spatial_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL;
+ ++features_count;
+ }
+
+ if ( !features_count )
+ return;
+
+ if ( this->deinterlace ) {
+ if ( this->video_mixer_width < 800 )
+ deinterlace_method = this->deinterlace_method_sd;
+ else
+ deinterlace_method = this->deinterlace_method_hd;
+
+ switch ( this->deinterlacers_method[deinterlace_method] ) {
+ case DEINT_BOB:
+ feature_enables[0] = feature_enables[1] = 0;
+ fprintf(stderr, "vo_vdpau: deinterlace: bob\n" );
+ break;
+ case DEINT_HALF_TEMPORAL:
+ feature_enables[0] = 1; feature_enables[1] = 0;
+ fprintf(stderr, "vo_vdpau: deinterlace: half_temporal\n" );
+ break;
+ case DEINT_TEMPORAL:
+ feature_enables[0] = 1; feature_enables[1] = 0;
+ fprintf(stderr, "vo_vdpau: deinterlace: temporal\n" );
+ break;
+ case DEINT_HALF_TEMPORAL_SPATIAL:
+ feature_enables[0] = feature_enables[1] = 1;
+ fprintf(stderr, "vo_vdpau: deinterlace: half_temporal_spatial\n" );
+ break;
+ case DEINT_TEMPORAL_SPATIAL:
+ feature_enables[0] = feature_enables[1] = 1;
+ fprintf(stderr, "vo_vdpau: deinterlace: temporal_spatial\n" );
+ break;
+ }
+ }
+ else {
+ feature_enables[0] = feature_enables[1] = 0;
+ fprintf(stderr, "vo_vdpau: deinterlace: none\n" );
+ }
+
+ vdp_video_mixer_set_feature_enables( this->video_mixer, features_count, features, feature_enables );
+}
+
+
+
+static void vdpau_set_inverse_telecine( vo_driver_t *this_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ if ( !this->inverse_telecine_is_supported )
+ return;
+
+ VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE };
+ VdpBool feature_enables[1];
+ if ( this->deinterlace && this->enable_inverse_telecine )
+ feature_enables[0] = 1;
+ else
+ feature_enables[0] = 0;
+
+ vdp_video_mixer_set_feature_enables( this->video_mixer, 1, features, feature_enables );
+ vdp_video_mixer_get_feature_enables( this->video_mixer, 1, features, feature_enables );
+ fprintf(stderr, "vo_vdpau: enabled features: inverse_telecine=%d\n", feature_enables[0] );
+}
+
+
+
+static void vdpau_update_deinterlace_method_sd( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->deinterlace_method_sd = entry->num_value;
+ fprintf(stderr, "vo_vdpau: deinterlace_method_sd=%d\n", this->deinterlace_method_sd );
+ vdpau_set_deinterlace( (vo_driver_t*)this_gen );
+}
+
+
+
+static void vdpau_update_deinterlace_method_hd( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->deinterlace_method_hd = entry->num_value;
+ fprintf(stderr, "vo_vdpau: deinterlace_method_hd=%d\n", this->deinterlace_method_hd );
+ vdpau_set_deinterlace( (vo_driver_t*)this_gen );
+}
+
+
+
+static void vdpau_set_scaling_level( vo_driver_t *this_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ int i;
+ VdpVideoMixerFeature features[9];
+ VdpBool feature_enables[9];
+#ifdef VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1
+ for ( i=0; i<this->scaling_level_max; ++i ) {
+ features[i] = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + i;
+ feature_enables[i] = 0;
+ }
+ vdp_video_mixer_set_feature_enables( this->video_mixer, this->scaling_level_max, features, feature_enables );
+
+ if ( this->scaling_level_current ) {
+ features[0] = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 - 1 + this->scaling_level_current;
+ feature_enables[0] = 1;
+ vdp_video_mixer_set_feature_enables( this->video_mixer, 1, features, feature_enables );
+ }
+
+ fprintf(stderr, "vo_vdpau: set_scaling_level=%d\n", this->scaling_level_current );
+#endif
+}
+
+
+
+static void vdpau_update_scaling_level( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->scaling_level_current = entry->num_value;
+ fprintf(stderr, "vo_vdpau: scaling_quality=%d\n", this->scaling_level_current );
+ vdpau_set_scaling_level( (vo_driver_t*)this_gen );
+}
+
+
+
+static void vdpau_update_enable_inverse_telecine( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->enable_inverse_telecine = entry->num_value;
+ fprintf(stderr, "vo_vdpau: enable inverse_telecine=%d\n", this->enable_inverse_telecine );
+ vdpau_set_inverse_telecine( (vo_driver_t*)this_gen );
+}
+
+
+
+static void vdpau_honor_progressive_flag( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->honor_progressive = entry->num_value;
+ fprintf(stderr, "vo_vdpau: honor_progressive=%d\n", this->honor_progressive );
+}
+
+
+
+static void vdpau_update_noise( vdpau_driver_t *this_gen )
+{
+ if ( !this_gen->noise_reduction_is_supported )
+ return;
+
+ float value = this_gen->noise/100.0;
+ if ( value==0 || ((this_gen->sd_only_properties & 1) && this_gen->video_mixer_width >= 800)) {
+ VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION };
+ VdpBool feature_enables[] = { 0 };
+ vdp_video_mixer_set_feature_enables( this_gen->video_mixer, 1, features, feature_enables );
+ fprintf(stderr, "vo_vdpau: disable noise reduction.\n" );
+ return;
+ }
+ else {
+ VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION };
+ VdpBool feature_enables[] = { 1 };
+ vdp_video_mixer_set_feature_enables( this_gen->video_mixer, 1, features, feature_enables );
+ fprintf(stderr, "vo_vdpau: enable noise reduction.\n" );
+ }
+
+ VdpVideoMixerAttribute attributes [] = { VDP_VIDEO_MIXER_ATTRIBUTE_NOISE_REDUCTION_LEVEL };
+ void* attribute_values[] = { &value };
+ VdpStatus st = vdp_video_mixer_set_attribute_values( this_gen->video_mixer, 1, attributes, attribute_values );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: error, can't set noise reduction level !!\n" );
+}
+
+
+
+static void vdpau_update_sharpness( vdpau_driver_t *this_gen )
+{
+ if ( !this_gen->sharpness_is_supported )
+ return;
+
+ float value = this_gen->sharpness/100.0;
+ if ( value==0 || (this_gen->sd_only_properties >= 2 && this_gen->video_mixer_width >= 800)) {
+ VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_SHARPNESS };
+ VdpBool feature_enables[] = { 0 };
+ vdp_video_mixer_set_feature_enables( this_gen->video_mixer, 1, features, feature_enables );
+ fprintf(stderr, "vo_vdpau: disable sharpness.\n" );
+ return;
+ }
+ else {
+ VdpVideoMixerFeature features[] = { VDP_VIDEO_MIXER_FEATURE_SHARPNESS };
+ VdpBool feature_enables[] = { 1 };
+ vdp_video_mixer_set_feature_enables( this_gen->video_mixer, 1, features, feature_enables );
+ fprintf(stderr, "vo_vdpau: enable sharpness.\n" );
+ }
+
+ VdpVideoMixerAttribute attributes [] = { VDP_VIDEO_MIXER_ATTRIBUTE_SHARPNESS_LEVEL };
+ void* attribute_values[] = { &value };
+ VdpStatus st = vdp_video_mixer_set_attribute_values( this_gen->video_mixer, 1, attributes, attribute_values );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: error, can't set sharpness level !!\n" );
+}
+
+
+
+static void vdpau_update_sd_only_properties( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ this->sd_only_properties = entry->num_value;
+ printf( "vo_vdpau: enable sd only noise=%d, sd only sharpness %d\n", ((this->sd_only_properties & 1) != 0), (this->sd_only_properties >= 2) );
+ vdpau_update_noise(this);
+ vdpau_update_sharpness(this);
+}
+
+
+
+static void vdpau_update_csc( vdpau_driver_t *this_gen )
+{
+ float hue = this_gen->hue/100.0;
+ float saturation = this_gen->saturation/100.0;
+ float contrast = this_gen->contrast/100.0;
+ float brightness = this_gen->brightness/100.0;
+
+ fprintf(stderr, "vo_vdpau: vdpau_update_csc: hue=%f, saturation=%f, contrast=%f, brightness=%f, color_standard=%d studio_levels=%d\n", hue, saturation, contrast, brightness, this_gen->color_standard, this_gen->studio_levels );
+
+ VdpStatus st;
+ VdpCSCMatrix matrix;
+ VdpProcamp procamp = { VDP_PROCAMP_VERSION, brightness, contrast, saturation, hue };
+
+ if ( this_gen->studio_levels ) {
+ int i;
+ float Kr, Kg, Kb;
+ float uvcos = procamp.saturation * cos(procamp.hue);
+ float uvsin = procamp.saturation * sin(procamp.hue);
+ int rgbmin = 16;
+ int rgbr = 235 - 16;
+ switch ( this_gen->color_standard ) {
+ case VDP_COLOR_STANDARD_SMPTE_240M:
+ Kr = 0.2122;
+ Kg = 0.7013;
+ Kb = 0.0865;
+ break;
+ case VDP_COLOR_STANDARD_ITUR_BT_709:
+ Kr = 0.2125;
+ Kg = 0.7154;
+ Kb = 0.0721;
+ break;
+ case VDP_COLOR_STANDARD_ITUR_BT_601:
+ default:
+ Kr = 0.299;
+ Kg = 0.587;
+ Kb = 0.114;
+ break;
+ }
+ float uv_coeffs[3][2] = {{ 0.000, (rgbr / 112.0) * (1 - Kr) },
+ {-(rgbr / 112.0) * (1 - Kb) * Kb / Kg, -(rgbr / 112.0) * (1 - Kr) * Kr / Kg },
+ { (rgbr / 112.0) * (1 - Kb), 0.000 }};
+ for (i = 0; i < 3; ++i) {
+ matrix[i][3] = procamp.brightness;
+ matrix[i][0] = rgbr * procamp.contrast / 219;
+ matrix[i][3] += (-16 / 255.0) * matrix[i][0];
+ matrix[i][1] = uv_coeffs[i][0] * uvcos + uv_coeffs[i][1] * uvsin;
+ matrix[i][3] += (-128 / 255.0) * matrix[i][1];
+ matrix[i][2] = uv_coeffs[i][0] * uvsin + uv_coeffs[i][1] * uvcos;
+ matrix[i][3] += (-128 / 255.0) * matrix[i][2];
+ matrix[i][3] += rgbmin / 255.0;
+ matrix[i][3] += 0.5 - procamp.contrast / 2.0;
+ }
+ }
+ else {
+ st = vdp_generate_csc_matrix( &procamp, this_gen->color_standard, &matrix );
+ if ( st != VDP_STATUS_OK ) {
+ fprintf(stderr, "vo_vdpau: error, can't generate csc matrix !!\n" );
+ return;
+ }
+ }
+ VdpVideoMixerAttribute attributes [] = { VDP_VIDEO_MIXER_ATTRIBUTE_CSC_MATRIX };
+ void* attribute_values[] = { &matrix };
+ st = vdp_video_mixer_set_attribute_values( this_gen->video_mixer, 1, attributes, attribute_values );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: error, can't set csc matrix !!\n" );
+}
+
+
+
+static void vdpau_update_skip_chroma( vdpau_driver_t *this_gen )
+{
+ if ( !this_gen->skip_chroma_is_supported )
+ return;
+
+ VdpVideoMixerAttribute attributes [] = { VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE };
+ void* attribute_values[] = { &(this_gen->skip_chroma) };
+ VdpStatus st = vdp_video_mixer_set_attribute_values( this_gen->video_mixer, 1, attributes, attribute_values );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: error, can't set skip_chroma !!\n" );
+ else
+ fprintf(stderr, "vo_vdpau: skip_chroma = %d\n", this_gen->skip_chroma );
+}
+
+
+
+static void vdpau_set_skip_chroma( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ this->skip_chroma = entry->num_value;
+ vdpau_update_skip_chroma( this );
+}
+
+
+
+static void vdpau_set_studio_levels( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ this->studio_levels = entry->num_value;
+ vdpau_update_csc( this );
+}
+
+
+
+static void vdpau_update_background( vdpau_driver_t *this_gen )
+{
+ if ( !this_gen->background_is_supported )
+ return;
+
+ VdpVideoMixerAttribute attributes [] = { VDP_VIDEO_MIXER_ATTRIBUTE_BACKGROUND_COLOR };
+ VdpColor bg = { (this_gen->background >> 16) / 255.f, ((this_gen->background >> 8) & 0xff) / 255.f, (this_gen->background & 0xff) / 255.f, 1 };
+ void* attribute_values[] = { &bg };
+ VdpStatus st = vdp_video_mixer_set_attribute_values( this_gen->video_mixer, 1, attributes, attribute_values );
+ if ( st != VDP_STATUS_OK )
+ printf( "vo_vdpau: error, can't set background_color !!\n" );
+ else
+ printf( "vo_vdpau: background_color = %d\n", this_gen->background );
+}
+
+
+
+static void vdpau_set_background( void *this_gen, xine_cfg_entry_t *entry )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ entry->num_value &= 0xffffff;
+ this->background = entry->num_value;
+ vdpau_update_background( this );
+}
+
+
+
+static void vdpau_shift_queue( vo_driver_t *this_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ if ( this->init_queue < this->queue_length )
+ ++this->init_queue;
+ ++this->current_output_surface;
+ if ( this->current_output_surface >= this->queue_length )
+ this->current_output_surface = 0;
+}
+
+
+
+static void vdpau_check_output_size( vo_driver_t *this_gen )
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ if ( (this->sc.gui_width > this->output_surface_width[this->current_output_surface]) || (this->sc.gui_height > this->output_surface_height[this->current_output_surface]) ) {
+ /* recreate output surface to match window size */
+ lprintf( "vo_vdpau: output_surface size update\n" );
+ this->output_surface_width[this->current_output_surface] = this->sc.gui_width;
+ this->output_surface_height[this->current_output_surface] = this->sc.gui_height;
+
+ VdpStatus st = vdp_output_surface_destroy( this->output_surface[this->current_output_surface] );
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: Can't destroy output surface: %s\n", vdp_get_error_string (st));
+
+ st = vdp_output_surface_create( vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, this->output_surface_width[this->current_output_surface], this->output_surface_height[this->current_output_surface], &this->output_surface[this->current_output_surface] );
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: Can't create output surface: %s\n", vdp_get_error_string (st));
+ }
+}
+
+
+static void vdpau_grab_current_output_surface (vdpau_driver_t *this, int64_t vpts)
+{
+ pthread_mutex_lock(&this->grab_lock);
+
+ vdpau_grab_video_frame_t *frame = this->pending_grab_request;
+ if (frame) {
+ VdpStatus st;
+
+ this->pending_grab_request = NULL;
+ frame->grab_frame.vpts = -1;
+
+ VdpOutputSurface grab_surface = this->output_surface[this->current_output_surface];
+ int width = this->sc.gui_width;
+ int height = this->sc.gui_height;
+
+ /* take cropping parameters into account */
+ width = width - frame->grab_frame.crop_left - frame->grab_frame.crop_right;
+ height = height - frame->grab_frame.crop_top - frame->grab_frame.crop_bottom;
+ if (width < 1)
+ width = 1;
+ if (height < 1)
+ height = 1;
+
+ /* if caller does not specify frame size we return the actual size of grabbed frame */
+ if (frame->grab_frame.width <= 0)
+ frame->grab_frame.width = width;
+ if (frame->grab_frame.height <= 0)
+ frame->grab_frame.height = height;
+
+ if (frame->grab_frame.width != frame->width || frame->grab_frame.height != frame->height) {
+ free(frame->rgba);
+ free(frame->grab_frame.img);
+ frame->rgba = NULL;
+ frame->grab_frame.img = NULL;
+
+ frame->width = frame->grab_frame.width;
+ frame->height = frame->grab_frame.height;
+ }
+
+ if (frame->rgba == NULL) {
+ frame->rgba = (uint32_t *) calloc(frame->width * frame->height, sizeof(uint32_t));
+ if (frame->rgba == NULL) {
+ pthread_cond_broadcast(&this->grab_cond);
+ pthread_mutex_unlock(&this->grab_lock);
+ return;
+ }
+ }
+
+ if (frame->grab_frame.img == NULL) {
+ frame->grab_frame.img = (uint8_t *) calloc(frame->width * frame->height, 3);
+ if (frame->grab_frame.img == NULL) {
+ pthread_cond_broadcast(&this->grab_cond);
+ pthread_mutex_unlock(&this->grab_lock);
+ return;
+ }
+ }
+
+ uint32_t pitches = frame->width * sizeof(uint32_t);
+ VdpRect src_rect = { frame->grab_frame.crop_left, frame->grab_frame.crop_top, width+frame->grab_frame.crop_left, height+frame->grab_frame.crop_top };
+ if (frame->width != width || frame->height != height) {
+ st = vdpau_get_output_surface(this, frame->width, frame->height, &frame->render_surface);
+ if (st == VDP_STATUS_OK) {
+ lprintf("grab got render output surface %dx%d -> %d\n", frame->width, frame->height, (int)frame->render_surface.surface);
+
+ VdpRect dst_rect = { 0, 0, frame->width, frame->height };
+ st = vdp_output_surface_render_output_surface(frame->render_surface.surface, &dst_rect, grab_surface, &src_rect, NULL, NULL, VDP_OUTPUT_SURFACE_RENDER_ROTATE_0);
+ if (st == VDP_STATUS_OK) {
+ st = vdp_output_surface_get_bits(frame->render_surface.surface, &dst_rect, &frame->rgba, &pitches);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: Can't get output surface bits for raw frame grabbing: %s\n", vdp_get_error_string (st));
+ } else
+ fprintf(stderr, "vo_vdpau: Can't render output surface for raw frame grabbing: %s\n", vdp_get_error_string (st));
+
+ vdpau_free_output_surface(this, &frame->render_surface);
+ }
+ } else {
+ st = vdp_output_surface_get_bits(grab_surface, &src_rect, &frame->rgba, &pitches);
+ if (st != VDP_STATUS_OK)
+ fprintf(stderr, "vo_vdpau: Can't get output surface bits for raw frame grabbing: %s\n", vdp_get_error_string (st));
+ }
+
+ if (st == VDP_STATUS_OK)
+ frame->grab_frame.vpts = vpts;
+
+ pthread_cond_broadcast(&this->grab_cond);
+ }
+
+ pthread_mutex_unlock(&this->grab_lock);
+}
+
+
+static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ vdpau_frame_t *frame = (vdpau_frame_t *) frame_gen;
+ VdpStatus st;
+ VdpVideoSurface surface;
+ VdpChromaType chroma = this->video_mixer_chroma;
+ VdpColorStandard color_standard = this->color_standard;
+ uint32_t mix_w = this->video_mixer_width;
+ uint32_t mix_h = this->video_mixer_height;
+ VdpTime stream_speed;
+
+ if ( (frame->width != this->sc.delivered_width) ||
+ (frame->height != this->sc.delivered_height) ||
+ (frame->ratio != this->sc.delivered_ratio) ||
+ (frame->vo_frame.crop_left != this->sc.crop_left) ||
+ (frame->vo_frame.crop_right != this->sc.crop_right) ||
+ (frame->vo_frame.crop_top != this->sc.crop_top) ||
+ (frame->vo_frame.crop_bottom != this->sc.crop_bottom) ) {
+ this->sc.force_redraw = 1; /* trigger re-calc of output size */
+ }
+
+ this->sc.delivered_height = frame->height;
+ this->sc.delivered_width = frame->width;
+ this->sc.delivered_ratio = frame->ratio;
+ this->sc.crop_left = frame->vo_frame.crop_left;
+ this->sc.crop_right = frame->vo_frame.crop_right;
+ this->sc.crop_top = frame->vo_frame.crop_top;
+ this->sc.crop_bottom = frame->vo_frame.crop_bottom;
+
+ int redraw_needed = vdpau_redraw_needed( this_gen );
+
+ pthread_mutex_lock(&this->drawable_lock); /* protect drawble from being changed */
+
+ if(this->reinit_needed)
+ vdpau_reinit(this_gen);
+
+ if ( (frame->format == XINE_IMGFMT_YV12) || (frame->format == XINE_IMGFMT_YUY2) ) {
+ chroma = ( frame->format==XINE_IMGFMT_YV12 )? VDP_CHROMA_TYPE_420 : VDP_CHROMA_TYPE_422;
+ if ( (frame->width != this->soft_surface_width) || (frame->height != this->soft_surface_height) || (frame->format != this->soft_surface_format) ) {
+ lprintf( "vo_vdpau: soft_surface size update\n" );
+ /* recreate surface to match frame changes */
+ this->soft_surface_width = frame->width;
+ this->soft_surface_height = frame->height;
+ this->soft_surface_format = frame->format;
+ vdp_video_surface_destroy( this->soft_surface );
+ this->soft_surface = VDP_INVALID_HANDLE;
+ vdp_video_surface_create( vdp_device, chroma, this->soft_surface_width, this->soft_surface_height, &this->soft_surface );
+ }
+ /* FIXME: have to swap U and V planes to get correct colors !! */
+ uint32_t pitches[] = { frame->vo_frame.pitches[0], frame->vo_frame.pitches[2], frame->vo_frame.pitches[1] };
+ void* data[] = { frame->vo_frame.base[0], frame->vo_frame.base[2], frame->vo_frame.base[1] };
+ if ( frame->format==XINE_IMGFMT_YV12 ) {
+ st = vdp_video_surface_putbits_ycbcr( this->soft_surface, VDP_YCBCR_FORMAT_YV12, &data, pitches );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: vdp_video_surface_putbits_ycbcr YV12 error : %s\n", vdp_get_error_string( st ) );
+ }
+ else {
+ st = vdp_video_surface_putbits_ycbcr( this->soft_surface, VDP_YCBCR_FORMAT_YUYV, &data, pitches );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: vdp_video_surface_putbits_ycbcr YUY2 error : %s\n", vdp_get_error_string( st ) );
+ }
+ surface = this->soft_surface;
+ mix_w = this->soft_surface_width;
+ mix_h = this->soft_surface_height;
+ }
+ else if (frame->format == XINE_IMGFMT_VDPAU) {
+ surface = frame->vdpau_accel_data.surface;
+ mix_w = frame->width;
+ mix_h = frame->height;
+ chroma = (frame->vo_frame.flags & VO_CHROMA_422) ? VDP_CHROMA_TYPE_422 : VDP_CHROMA_TYPE_420;
+ color_standard = frame->vdpau_accel_data.color_standard;
+ }
+ else {
+ /* unknown format */
+ fprintf(stderr, "vo_vdpau: got an unknown image -------------\n" );
+ frame->vo_frame.free( &frame->vo_frame );
+ pthread_mutex_unlock(&this->drawable_lock); /* allow changing drawable again */
+ return;
+ }
+
+ if ( (mix_w != this->video_mixer_width) || (mix_h != this->video_mixer_height) || (chroma != this->video_mixer_chroma)) {
+ vdpau_release_back_frames( this_gen ); /* empty past frames array */
+ lprintf("vo_vdpau: recreate mixer to match frames: width=%d, height=%d, chroma=%d\n", mix_w, mix_h, chroma);
+ vdp_video_mixer_destroy( this->video_mixer );
+ this->video_mixer = VDP_INVALID_HANDLE;
+ VdpVideoMixerFeature features[15];
+ int features_count = 0;
+ if ( this->noise_reduction_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION;
+ ++features_count;
+ }
+ if ( this->sharpness_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS;
+ ++features_count;
+ }
+ if ( this->temporal_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL;
+ ++features_count;
+ }
+ if ( this->temporal_spatial_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL;
+ ++features_count;
+ }
+ if ( this->inverse_telecine_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE;
+ ++features_count;
+ }
+ int i;
+#ifdef VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1
+ for ( i=0; i<this->scaling_level_max; ++i ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + i;
+ ++features_count;
+ }
+#endif
+ VdpVideoMixerParameter params[] = { VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH, VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT,
+ VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE, VDP_VIDEO_MIXER_PARAMETER_LAYERS };
+ int num_layers = 1;
+ void const *param_values[] = { &mix_w, &mix_h, &chroma, &num_layers };
+ vdp_video_mixer_create( vdp_device, features_count, features, 4, params, param_values, &this->video_mixer );
+ this->video_mixer_chroma = chroma;
+ this->video_mixer_width = mix_w;
+ this->video_mixer_height = mix_h;
+ vdpau_set_deinterlace( this_gen );
+ vdpau_set_scaling_level( this_gen );
+ vdpau_set_inverse_telecine( this_gen );
+ vdpau_update_noise( this );
+ vdpau_update_sharpness( this );
+ this->color_standard = color_standard;
+ vdpau_update_csc( this );
+ vdpau_update_skip_chroma( this );
+ vdpau_update_background( this );
+ }
+
+ if (color_standard != this->color_standard) {
+ lprintf("vo_vdpau: update color_standard: %d\n", color_standard);
+ this->color_standard = color_standard;
+ vdpau_update_csc( this );
+ }
+
+ if (this->ovl_changed || redraw_needed)
+ vdpau_process_overlays(this);
+
+ uint32_t layer_count;
+ VdpLayer *layer, ovl_layer;
+ VdpRect *vid_dest, vid_dest_rect;
+ if (this->num_ovls && this->ovl_layer_surface != VDP_INVALID_HANDLE) {
+ ovl_layer.struct_version = VDP_LAYER_VERSION;
+ ovl_layer.source_surface = this->ovl_layer_surface;
+ ovl_layer.source_rect = &this->ovl_src_rect;
+ ovl_layer.destination_rect = &this->ovl_dest_rect;
+ layer = &ovl_layer;
+ layer_count = 1;
+ vid_dest = &this->ovl_video_dest_rect;
+ } else {
+ layer = NULL;
+ layer_count = 0;
+ vid_dest_rect.x0 = this->sc.output_xoffset;
+ vid_dest_rect.y0 = this->sc.output_yoffset;
+ vid_dest_rect.x1 = this->sc.output_xoffset + this->sc.output_width;
+ vid_dest_rect.y1 = this->sc.output_yoffset + this->sc.output_height;
+ vid_dest = &vid_dest_rect;
+ }
+
+ VdpRect vid_source, out_dest;
+ vid_source.x0 = this->sc.displayed_xoffset; vid_source.y0 = this->sc.displayed_yoffset;
+ vid_source.x1 = this->sc.displayed_width+this->sc.displayed_xoffset; vid_source.y1 = this->sc.displayed_height+this->sc.displayed_yoffset;
+ out_dest.x0 = out_dest.y0 = 0;
+ out_dest.x1 = this->sc.gui_width; out_dest.y1 = this->sc.gui_height;
+
+ stream_speed = frame->vo_frame.stream ? xine_get_param(frame->vo_frame.stream, XINE_PARAM_FINE_SPEED) : 0;
+
+ /* try to get frame duration from previous img->pts when frame->duration is 0 */
+ int frame_duration = frame->vo_frame.duration;
+ if ( !frame_duration && this->back_frame[0] ) {
+ int duration = frame->vo_frame.pts - this->back_frame[0]->vo_frame.pts;
+ if ( duration>0 && duration<4000 )
+ frame_duration = duration;
+ }
+ int non_progressive;
+ if ( frame->vo_frame.progressive_frame < 0 )
+ non_progressive = 0;
+ else
+ non_progressive = (this->honor_progressive && !frame->vo_frame.progressive_frame) || !this->honor_progressive;
+
+ VdpTime last_time;
+
+ if ( this->init_queue>1 )
+ vdp_queue_block( vdp_queue, this->output_surface[this->current_output_surface], &last_time );
+
+ DO_LOCKDISPLAY;
+
+ vdpau_check_output_size( this_gen );
+
+ if ( frame->format==XINE_IMGFMT_VDPAU && this->deinterlace && non_progressive && !(frame->vo_frame.flags & VO_STILL_IMAGE) && frame_duration>2500 ) {
+ VdpTime current_time = 0;
+ VdpVideoSurface past[2];
+ VdpVideoSurface future[1];
+ VdpVideoMixerPictureStructure picture_structure;
+
+ past[1] = past[0] = (this->back_frame[0] && (this->back_frame[0]->format==XINE_IMGFMT_VDPAU)) ? this->back_frame[0]->vdpau_accel_data.surface : VDP_INVALID_HANDLE;
+ future[0] = surface;
+ picture_structure = ( frame->vo_frame.top_field_first ) ? VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD : VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD;
+
+ st = vdp_video_mixer_render( this->video_mixer, VDP_INVALID_HANDLE, 0, picture_structure,
+ 2, past, surface, 1, future, &vid_source, this->output_surface[this->current_output_surface], &out_dest, vid_dest, layer_count, layer );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) );
+
+ vdpau_grab_current_output_surface( this, frame->vo_frame.vpts );
+ vdp_queue_get_time( vdp_queue, &current_time );
+ vdp_queue_display( vdp_queue, this->output_surface[this->current_output_surface], this->sc.gui_width, this->sc.gui_height, 0 ); /* display _now_ */
+ vdpau_shift_queue( this_gen );
+
+ int dm;
+ if ( this->video_mixer_width < 800 )
+ dm = this->deinterlacers_method[this->deinterlace_method_sd];
+ else
+ dm = this->deinterlacers_method[this->deinterlace_method_hd];
+
+ if ( (dm != DEINT_HALF_TEMPORAL) && (dm != DEINT_HALF_TEMPORAL_SPATIAL) && frame->vo_frame.future_frame ) { /* process second field */
+ if ( this->init_queue >= this->queue_length ) {
+ DO_UNLOCKDISPLAY;
+ vdp_queue_block( vdp_queue, this->output_surface[this->current_output_surface], &last_time );
+ DO_LOCKDISPLAY;
+ }
+
+ vdpau_check_output_size( this_gen );
+
+ picture_structure = ( frame->vo_frame.top_field_first ) ? VDP_VIDEO_MIXER_PICTURE_STRUCTURE_BOTTOM_FIELD : VDP_VIDEO_MIXER_PICTURE_STRUCTURE_TOP_FIELD;
+ past[0] = surface;
+ if ( frame->vo_frame.future_frame!=NULL && ((vdpau_frame_t*)(frame->vo_frame.future_frame))->format==XINE_IMGFMT_VDPAU )
+ future[0] = ((vdpau_frame_t*)(frame->vo_frame.future_frame))->vdpau_accel_data.surface;
+ else
+ future[0] = VDP_INVALID_HANDLE;
+
+ st = vdp_video_mixer_render( this->video_mixer, VDP_INVALID_HANDLE, 0, picture_structure,
+ 2, past, surface, 1, future, &vid_source, this->output_surface[this->current_output_surface], &out_dest, vid_dest, layer_count, layer );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) );
+
+ if ( stream_speed > 0 )
+ current_time += frame->vo_frame.duration * 1000000ull * XINE_FINE_SPEED_NORMAL / (180 * stream_speed);
+
+ vdp_queue_display( vdp_queue, this->output_surface[this->current_output_surface], this->sc.gui_width, this->sc.gui_height, current_time );
+ vdpau_shift_queue( this_gen );
+ }
+ }
+ else {
+ if ( frame->vo_frame.flags & VO_STILL_IMAGE )
+ lprintf( "vo_vdpau: VO_STILL_IMAGE\n");
+ st = vdp_video_mixer_render( this->video_mixer, VDP_INVALID_HANDLE, 0, VDP_VIDEO_MIXER_PICTURE_STRUCTURE_FRAME,
+ 0, 0, surface, 0, 0, &vid_source, this->output_surface[this->current_output_surface], &out_dest, vid_dest, layer_count, layer );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: vdp_video_mixer_render error : %s\n", vdp_get_error_string( st ) );
+
+ vdpau_grab_current_output_surface( this, frame->vo_frame.vpts );
+ vdp_queue_display( vdp_queue, this->output_surface[this->current_output_surface], this->sc.gui_width, this->sc.gui_height, 0 );
+ vdpau_shift_queue( this_gen );
+ }
+
+ DO_UNLOCKDISPLAY;
+
+ if ( stream_speed )
+ vdpau_backup_frame( this_gen, frame_gen );
+ else /* do not release past frame if paused, it will be used for redrawing */
+ frame->vo_frame.free( &frame->vo_frame );
+
+ pthread_mutex_unlock(&this->drawable_lock); /* allow changing drawable again */
+}
+
+
+
+static int vdpau_get_property (vo_driver_t *this_gen, int property)
+{
+ vdpau_driver_t *this = (vdpau_driver_t*)this_gen;
+
+ switch (property) {
+ case VO_PROP_MAX_NUM_FRAMES:
+ return 30;
+ case VO_PROP_WINDOW_WIDTH:
+ return this->sc.gui_width;
+ case VO_PROP_WINDOW_HEIGHT:
+ return this->sc.gui_height;
+ case VO_PROP_OUTPUT_WIDTH:
+ return this->sc.output_width;
+ case VO_PROP_OUTPUT_HEIGHT:
+ return this->sc.output_height;
+ case VO_PROP_OUTPUT_XOFFSET:
+ return this->sc.output_xoffset;
+ case VO_PROP_OUTPUT_YOFFSET:
+ return this->sc.output_yoffset;
+ case VO_PROP_HUE:
+ return this->hue;
+ case VO_PROP_SATURATION:
+ return this->saturation;
+ case VO_PROP_CONTRAST:
+ return this->contrast;
+ case VO_PROP_BRIGHTNESS:
+ return this->brightness;
+ case VO_PROP_SHARPNESS:
+ return this->sharpness;
+ case VO_PROP_NOISE_REDUCTION:
+ return this->noise;
+ case VO_PROP_ZOOM_X:
+ return this->zoom_x;
+ case VO_PROP_ZOOM_Y:
+ return this->zoom_y;
+ case VO_PROP_ASPECT_RATIO:
+ return this->sc.user_ratio;
+ }
+
+ return -1;
+}
+
+
+
+static int vdpau_set_property (vo_driver_t *this_gen, int property, int value)
+{
+ vdpau_driver_t *this = (vdpau_driver_t*)this_gen;
+
+ fprintf(stderr,"vdpau_set_property: property=%d, value=%d\n", property, value );
+
+ switch (property) {
+ case VO_PROP_INTERLACED:
+ this->deinterlace = value;
+ vdpau_set_deinterlace( this_gen );
+ break;
+ case VO_PROP_ZOOM_X:
+ if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
+ this->zoom_x = value;
+ this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP;
+ _x_vo_scale_compute_ideal_size( &this->sc );
+ this->sc.force_redraw = 1; /* trigger re-calc of output size */
+ }
+ break;
+ case VO_PROP_ZOOM_Y:
+ if ((value >= XINE_VO_ZOOM_MIN) && (value <= XINE_VO_ZOOM_MAX)) {
+ this->zoom_y = value;
+ this->sc.zoom_factor_y = (double)value / (double)XINE_VO_ZOOM_STEP;
+ _x_vo_scale_compute_ideal_size( &this->sc );
+ this->sc.force_redraw = 1; /* trigger re-calc of output size */
+ }
+ break;
+ case VO_PROP_ASPECT_RATIO:
+ if ( value>=XINE_VO_ASPECT_NUM_RATIOS )
+ value = XINE_VO_ASPECT_AUTO;
+ this->sc.user_ratio = value;
+ this->sc.force_redraw = 1; /* trigger re-calc of output size */
+ break;
+ case VO_PROP_HUE: this->hue = value; vdpau_update_csc( this ); break;
+ case VO_PROP_SATURATION: this->saturation = value; vdpau_update_csc( this ); break;
+ case VO_PROP_CONTRAST: this->contrast = value; vdpau_update_csc( this ); break;
+ case VO_PROP_BRIGHTNESS: this->brightness = value; vdpau_update_csc( this ); break;
+ case VO_PROP_SHARPNESS: this->sharpness = value; vdpau_update_sharpness( this ); break;
+ case VO_PROP_NOISE_REDUCTION: this->noise = value; vdpau_update_noise( this ); break;
+ }
+
+ return value;
+}
+
+
+
+static void vdpau_get_property_min_max (vo_driver_t *this_gen, int property, int *min, int *max)
+{
+ switch ( property ) {
+ case VO_PROP_HUE:
+ *max = 314; *min = -314; break;
+ case VO_PROP_SATURATION:
+ *max = 1000; *min = 0; break;
+ case VO_PROP_CONTRAST:
+ *max = 1000; *min = 0; break;
+ case VO_PROP_BRIGHTNESS:
+ *max = 100; *min = -100; break;
+ case VO_PROP_SHARPNESS:
+ *max = 100; *min = -100; break;
+ case VO_PROP_NOISE_REDUCTION:
+ *max = 100; *min = 0; break;
+ default:
+ *max = 0; *min = 0;
+ }
+}
+
+
+/*
+ * functions for grabbing RGB images from displayed frames
+ */
+static void vdpau_dispose_grab_video_frame(xine_grab_video_frame_t *frame_gen)
+{
+ vdpau_grab_video_frame_t *frame = (vdpau_grab_video_frame_t *) frame_gen;
+
+ free(frame->grab_frame.img);
+ free(frame->rgba);
+ free(frame);
+}
+
+
+/*
+ * grab next displayed output surface.
+ * Note: This feature only supports grabbing of next displayed frame (implicit VO_GRAB_FRAME_FLAGS_WAIT_NEXT)
+ */
+static int vdpau_grab_grab_video_frame (xine_grab_video_frame_t *frame_gen) {
+ vdpau_grab_video_frame_t *frame = (vdpau_grab_video_frame_t *) frame_gen;
+ vdpau_driver_t *this = (vdpau_driver_t *) frame->vo_driver;
+ struct timeval tvnow, tvdiff, tvtimeout;
+ struct timespec ts;
+
+ /* calculate absolute timeout time */
+ tvdiff.tv_sec = frame->grab_frame.timeout / 1000;
+ tvdiff.tv_usec = frame->grab_frame.timeout % 1000;
+ tvdiff.tv_usec *= 1000;
+ gettimeofday(&tvnow, NULL);
+ timeradd(&tvnow, &tvdiff, &tvtimeout);
+ ts.tv_sec = tvtimeout.tv_sec;
+ ts.tv_nsec = tvtimeout.tv_usec;
+ ts.tv_nsec *= 1000;
+
+ pthread_mutex_lock(&this->grab_lock);
+
+ /* wait until other pending grab request is finished */
+ while (this->pending_grab_request) {
+ if (pthread_cond_timedwait(&this->grab_cond, &this->grab_lock, &ts) == ETIMEDOUT) {
+ pthread_mutex_unlock(&this->grab_lock);
+ return 1; /* no frame available */
+ }
+ }
+
+ this->pending_grab_request = frame;
+
+ /* wait until our request is finished */
+ while (this->pending_grab_request) {
+ if (pthread_cond_timedwait(&this->grab_cond, &this->grab_lock, &ts) == ETIMEDOUT) {
+ this->pending_grab_request = NULL;
+ pthread_mutex_unlock(&this->grab_lock);
+ return 1; /* no frame available */
+ }
+ }
+
+ pthread_mutex_unlock(&this->grab_lock);
+
+ if (frame->grab_frame.vpts == -1)
+ return -1; /* error happened */
+
+ /* convert ARGB image to RGB image */
+ uint32_t *src = frame->rgba;
+ uint8_t *dst = frame->grab_frame.img;
+ int n = frame->width * frame->height;
+ while (n--) {
+ uint32_t rgba = *src++;
+ *dst++ = (uint8_t)(rgba >> 16); /*R*/
+ *dst++ = (uint8_t)(rgba >> 8); /*G*/
+ *dst++ = (uint8_t)(rgba); /*B*/
+ }
+
+ return 0;
+}
+
+
+static xine_grab_video_frame_t * vdpau_new_grab_video_frame(vo_driver_t *this)
+{
+ vdpau_grab_video_frame_t *frame = calloc(1, sizeof(vdpau_grab_video_frame_t));
+ if (frame) {
+ frame->grab_frame.dispose = vdpau_dispose_grab_video_frame;
+ frame->grab_frame.grab = vdpau_grab_grab_video_frame;
+ frame->grab_frame.vpts = -1;
+ frame->grab_frame.timeout = XINE_GRAB_VIDEO_FRAME_DEFAULT_TIMEOUT;
+ frame->vo_driver = this;
+ frame->render_surface.surface = VDP_INVALID_HANDLE;
+ }
+
+ return (xine_grab_video_frame_t *) frame;
+}
+
+
+static int vdpau_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *data)
+{
+ vdpau_driver_t *this = (vdpau_driver_t*)this_gen;
+
+ switch (data_type) {
+#ifndef XINE_DISABLE_DEPRECATED_FEATURES
+ case XINE_GUI_SEND_COMPLETION_EVENT:
+ break;
+#endif
+
+ case XINE_GUI_SEND_EXPOSE_EVENT: {
+ if ( this->init_queue ) {
+ pthread_mutex_lock(&this->drawable_lock); /* wait for other thread which is currently displaying */
+ DO_LOCKDISPLAY;
+ int previous;
+ if ( this->current_output_surface )
+ previous = this->current_output_surface - 1;
+ else
+ previous = this->queue_length - 1;
+ vdp_queue_display( vdp_queue, this->output_surface[previous], 0, 0, 0 );
+ DO_UNLOCKDISPLAY;
+ pthread_mutex_unlock(&this->drawable_lock);
+ }
+ break;
+ }
+
+ case XINE_GUI_SEND_DRAWABLE_CHANGED: {
+ VdpStatus st;
+ pthread_mutex_lock(&this->drawable_lock); /* wait for other thread which is currently displaying */
+ DO_LOCKDISPLAY;
+ this->drawable = (Drawable) data;
+ vdp_queue_destroy( vdp_queue );
+ vdp_queue_target_destroy( vdp_queue_target );
+ st = vdp_queue_target_create_x11( vdp_device, this->drawable, &vdp_queue_target );
+ if ( st != VDP_STATUS_OK ) {
+ fprintf(stderr, "vo_vdpau: FATAL !! Can't recreate presentation queue target after drawable change !!\n" );
+ DO_UNLOCKDISPLAY;
+ pthread_mutex_unlock(&this->drawable_lock);
+ break;
+ }
+ st = vdp_queue_create( vdp_device, vdp_queue_target, &vdp_queue );
+ if ( st != VDP_STATUS_OK ) {
+ fprintf(stderr, "vo_vdpau: FATAL !! Can't recreate presentation queue after drawable change !!\n" );
+ DO_UNLOCKDISPLAY;
+ pthread_mutex_unlock(&this->drawable_lock);
+ break;
+ }
+ vdp_queue_set_background_color( vdp_queue, &this->back_color );
+ DO_UNLOCKDISPLAY;
+ pthread_mutex_unlock(&this->drawable_lock);
+ this->sc.force_redraw = 1;
+ break;
+ }
+
+ case XINE_GUI_SEND_TRANSLATE_GUI_TO_VIDEO: {
+ int x1, y1, x2, y2;
+ x11_rectangle_t *rect = data;
+
+ _x_vo_scale_translate_gui2video(&this->sc, rect->x, rect->y, &x1, &y1);
+ _x_vo_scale_translate_gui2video(&this->sc, rect->x + rect->w, rect->y + rect->h, &x2, &y2);
+ rect->x = x1;
+ rect->y = y1;
+ rect->w = x2-x1;
+ rect->h = y2-y1;
+ break;
+ }
+
+ default:
+ return -1;
+ }
+
+ return 0;
+}
+
+
+
+static uint32_t vdpau_get_capabilities (vo_driver_t *this_gen)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+
+ return this->capabilities;
+}
+
+
+
+static void vdpau_dispose (vo_driver_t *this_gen)
+{
+ vdpau_driver_t *this = (vdpau_driver_t *) this_gen;
+ int i;
+
+ if ( vdp_queue != VDP_INVALID_HANDLE )
+ vdp_queue_destroy( vdp_queue );
+
+ if ( vdp_queue_target != VDP_INVALID_HANDLE )
+ vdp_queue_target_destroy( vdp_queue_target );
+
+ if ( this->video_mixer!=VDP_INVALID_HANDLE )
+ vdp_video_mixer_destroy( this->video_mixer );
+
+ if ( this->soft_surface != VDP_INVALID_HANDLE )
+ vdp_video_surface_destroy( this->soft_surface );
+
+ if ( vdp_output_surface_destroy ) {
+ if (this->ovl_main_render_surface.surface != VDP_INVALID_HANDLE)
+ vdp_output_surface_destroy( this->ovl_main_render_surface.surface );
+ for (i = 0; i < this->num_ovls; ++i) {
+ vdpau_overlay_t *ovl = &this->overlays[i];
+ if (ovl->render_surface.surface != VDP_INVALID_HANDLE)
+ vdp_output_surface_destroy( ovl->render_surface.surface );
+ }
+ for ( i=0; i<this->queue_length; ++i ) {
+ if ( this->output_surface[i] != VDP_INVALID_HANDLE )
+ vdp_output_surface_destroy( this->output_surface[i] );
+ }
+ for ( i=0; i<this->output_surface_buffer_size; ++i ) {
+ if ( this->output_surface_buffer[i].surface != VDP_INVALID_HANDLE )
+ vdp_output_surface_destroy( this->output_surface_buffer[i].surface );
+ }
+ }
+
+ for ( i=0; i<NUM_FRAMES_BACK; i++ )
+ if ( this->back_frame[i] )
+ this->back_frame[i]->vo_frame.dispose( &this->back_frame[i]->vo_frame );
+
+ if ( (vdp_device != VDP_INVALID_HANDLE) && vdp_device_destroy )
+ vdp_device_destroy( vdp_device );
+
+ pthread_mutex_destroy(&this->grab_lock);
+ pthread_cond_destroy(&this->grab_cond);
+ pthread_mutex_destroy(&this->drawable_lock);
+ free(this->ovl_pixmap);
+ free (this);
+}
+
+
+
+static void vdpau_update_display_dimension (vdpau_driver_t *this)
+{
+ XLockDisplay (this->display);
+
+ this->display_width = DisplayWidth(this->display, this->screen);
+ this->display_height = DisplayHeight(this->display, this->screen);
+
+ XUnlockDisplay(this->display);
+}
+
+
+
+static int vdpau_reinit_error( VdpStatus st, const char *msg )
+{
+ if ( st != VDP_STATUS_OK ) {
+ fprintf(stderr, "vo_vdpau: %s : %s\n", msg, vdp_get_error_string( st ) );
+ return 1;
+ }
+ return 0;
+}
+
+
+
+static void vdpau_reinit( vo_driver_t *this_gen )
+{
+ fprintf(stderr,"vo_vdpau: VDPAU was pre-empted. Reinit.\n");
+ vdpau_driver_t *this = (vdpau_driver_t *)this_gen;
+
+ DO_LOCKDISPLAY;
+ vdpau_release_back_frames(this_gen);
+
+ VdpStatus st = vdp_device_create_x11( this->display, this->screen, &vdp_device, &vdp_get_proc_address );
+
+ if ( st != VDP_STATUS_OK ) {
+ fprintf(stderr, "vo_vdpau: Can't create vdp device : " );
+ if ( st == VDP_STATUS_NO_IMPLEMENTATION )
+ fprintf(stderr, "No vdpau implementation.\n" );
+ else
+ fprintf(stderr, "unsupported GPU?\n" );
+ DO_UNLOCKDISPLAY;
+ return;
+ }
+
+ st = vdp_queue_target_create_x11( vdp_device, this->drawable, &vdp_queue_target );
+ if ( vdpau_reinit_error( st, "Can't create presentation queue target !!" ) ) {
+ DO_UNLOCKDISPLAY;
+ return;
+ }
+ st = vdp_queue_create( vdp_device, vdp_queue_target, &vdp_queue );
+ if ( vdpau_reinit_error( st, "Can't create presentation queue !!" ) ) {
+ DO_UNLOCKDISPLAY;
+ return;
+ }
+ vdp_queue_set_background_color( vdp_queue, &this->back_color );
+
+
+ VdpChromaType chroma = VDP_CHROMA_TYPE_420;
+ st = orig_vdp_video_surface_create( vdp_device, chroma, this->soft_surface_width, this->soft_surface_height, &this->soft_surface );
+ if ( vdpau_reinit_error( st, "Can't create video surface !!" ) ) {
+ DO_UNLOCKDISPLAY;
+ return;
+ }
+
+ vdpau_update_display_dimension(this);
+ this->current_output_surface = 0;
+ this->init_queue = 0;
+ int i;
+ for ( i=0; i<this->queue_length; ++i ) {
+ this->output_surface_width[i] = this->display_width;
+ this->output_surface_height[i] = this->display_height;
+ st = vdp_output_surface_create( vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, this->output_surface_width[i], this->output_surface_height[i], &this->output_surface[i] );
+ if ( vdpau_reinit_error( st, "Can't create output surface !!" ) ) {
+ int j;
+ for ( j=0; j<i; ++j )
+ vdp_output_surface_destroy( this->output_surface[j] );
+ vdp_video_surface_destroy( this->soft_surface );
+ DO_UNLOCKDISPLAY;
+ return;
+ }
+ }
+
+ this->num_big_output_surfaces_created = 0;
+ for (i = 0; i < this->output_surface_buffer_size; ++i)
+ this->output_surface_buffer[i].surface = VDP_INVALID_HANDLE;
+
+ this->ovl_layer_surface = VDP_INVALID_HANDLE;
+ this->ovl_main_render_surface.surface = VDP_INVALID_HANDLE;
+ for (i = 0; i < this->num_ovls; ++i)
+ this->overlays[i].render_surface.surface = VDP_INVALID_HANDLE;
+ this->num_ovls = 0;
+ this->ovl_changed = 1;
+
+ VdpVideoMixerFeature features[15];
+ int features_count = 0;
+ if ( this->noise_reduction_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION;
+ ++features_count;
+ }
+ if ( this->sharpness_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS;
+ ++features_count;
+ }
+ if ( this->temporal_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL;
+ ++features_count;
+ }
+ if ( this->temporal_spatial_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL;
+ ++features_count;
+ }
+ if ( this->inverse_telecine_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE;
+ ++features_count;
+ }
+#ifdef VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1
+ for ( i=0; i<this->scaling_level_max; ++i ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + i;
+ ++features_count;
+ }
+#endif
+ VdpVideoMixerParameter params[] = { VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH, VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT, VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE, VDP_VIDEO_MIXER_PARAMETER_LAYERS };
+ int num_layers = 1;
+ void const *param_values[] = { &this->video_mixer_width, &this->video_mixer_height, &chroma, &num_layers };
+ st = vdp_video_mixer_create( vdp_device, features_count, features, 4, params, param_values, &this->video_mixer );
+ if ( vdpau_reinit_error( st, "Can't create video mixer !!" ) ) {
+ orig_vdp_video_surface_destroy( this->soft_surface );
+ for ( i=0; i<this->queue_length; ++i )
+ vdp_output_surface_destroy( this->output_surface[i] );
+ DO_UNLOCKDISPLAY;
+ return;
+ }
+ this->video_mixer_chroma = chroma;
+ vdpau_set_deinterlace( this_gen );
+ vdpau_set_scaling_level( this_gen );
+ vdpau_set_inverse_telecine( this_gen );
+ vdpau_update_noise( this );
+ vdpau_update_sharpness( this );
+ vdpau_update_csc( this );
+ vdpau_update_skip_chroma( this );
+ vdpau_update_background( this );
+
+ vdp_preemption_callback_register(vdp_device, &vdp_preemption_callback, (void*)this);
+
+ this->vdp_runtime_nr++;
+ this->reinit_needed = 0;
+ DO_UNLOCKDISPLAY;
+ fprintf(stderr,"vo_vdpau: Reinit done.\n");
+}
+
+
+
+static void vdp_preemption_callback(VdpDevice device, void *context)
+{
+ fprintf(stderr,"vo_vdpau: VDPAU preemption callback\n");
+ vdpau_driver_t *this = (vdpau_driver_t *)context;
+ this->reinit_needed = 1;
+}
+
+
+
+static int vdpau_init_error( VdpStatus st, const char *msg, vo_driver_t *driver, int error_string )
+{
+ if ( st != VDP_STATUS_OK ) {
+ if ( error_string )
+ fprintf(stderr, "vo_vdpau: %s : %s\n", msg, vdp_get_error_string( st ) );
+ else
+ fprintf(stderr, "vo_vdpau: %s\n", msg );
+ vdpau_dispose( driver );
+ return 1;
+ }
+ return 0;
+}
+
+
+
+static vo_driver_t *vdpau_open_plugin (video_driver_class_t *class_gen, const void *visual_gen)
+{
+ vdpau_class_t *class = (vdpau_class_t *) class_gen;
+ x11_visual_t *visual = (x11_visual_t *) visual_gen;
+ vdpau_driver_t *this;
+ config_values_t *config = class->xine->config;
+ int i;
+
+ this = (vdpau_driver_t *) calloc(1, sizeof(vdpau_driver_t));
+
+ if (!this)
+ return NULL;
+
+#ifdef LOCKDISPLAY
+ guarded_display = visual->display;
+#endif
+
+ this->display = visual->display;
+ this->screen = visual->screen;
+ this->drawable = visual->d;
+ pthread_mutex_init(&this->drawable_lock, 0);
+
+ _x_vo_scale_init(&this->sc, 1, 0, config);
+ this->sc.frame_output_cb = visual->frame_output_cb;
+ this->sc.dest_size_cb = visual->dest_size_cb;
+ this->sc.user_data = visual->user_data;
+ this->sc.user_ratio = XINE_VO_ASPECT_AUTO;
+
+ this->zoom_x = 100;
+ this->zoom_y = 100;
+
+ this->xine = class->xine;
+ this->config = config;
+
+ this->vo_driver.get_capabilities = vdpau_get_capabilities;
+ this->vo_driver.alloc_frame = vdpau_alloc_frame;
+ this->vo_driver.update_frame_format = vdpau_update_frame_format;
+ this->vo_driver.overlay_begin = vdpau_overlay_begin;
+ this->vo_driver.overlay_blend = vdpau_overlay_blend;
+ this->vo_driver.overlay_end = vdpau_overlay_end;
+ this->vo_driver.display_frame = vdpau_display_frame;
+ this->vo_driver.get_property = vdpau_get_property;
+ this->vo_driver.set_property = vdpau_set_property;
+ this->vo_driver.get_property_min_max = vdpau_get_property_min_max;
+ this->vo_driver.gui_data_exchange = vdpau_gui_data_exchange;
+ this->vo_driver.dispose = vdpau_dispose;
+ this->vo_driver.redraw_needed = vdpau_redraw_needed;
+ this->vo_driver.new_grab_video_frame = vdpau_new_grab_video_frame;
+
+ this->surface_cleared_nr = 0;
+
+ this->video_mixer = VDP_INVALID_HANDLE;
+ for ( i=0; i<NOUTPUTSURFACE; ++i )
+ this->output_surface[i] = VDP_INVALID_HANDLE;
+ this->soft_surface = VDP_INVALID_HANDLE;
+ vdp_queue = VDP_INVALID_HANDLE;
+ vdp_queue_target = VDP_INVALID_HANDLE;
+ vdp_device = VDP_INVALID_HANDLE;
+
+ vdp_output_surface_destroy = NULL;
+ vdp_device_destroy = NULL;
+
+ this->sharpness_is_supported = 0;
+ this->noise_reduction_is_supported = 0;
+ this->temporal_is_supported = 0;
+ this->temporal_spatial_is_supported = 0;
+ this->inverse_telecine_is_supported = 0;
+ this->skip_chroma_is_supported = 0;
+ this->background_is_supported = 0;
+
+ this->ovl_changed = 0;
+ this->num_ovls = 0;
+ this->old_num_ovls = 0;
+ this->ovl_layer_surface = VDP_INVALID_HANDLE;
+ this->ovl_main_render_surface.surface = VDP_INVALID_HANDLE;
+ this->ovl_pixmap = NULL;
+ this->ovl_pixmap_size = 0;
+ this->ovl_src_rect.x0 = 0;
+ this->ovl_src_rect.y0 = 0;
+
+ VdpStatus st = vdp_device_create_x11( visual->display, visual->screen, &vdp_device, &vdp_get_proc_address );
+ if ( st != VDP_STATUS_OK ) {
+ fprintf(stderr, "vo_vdpau: Can't create vdp device : " );
+ if ( st == VDP_STATUS_NO_IMPLEMENTATION )
+ fprintf(stderr, "No vdpau implementation.\n" );
+ else
+ fprintf(stderr, "unsupported GPU?\n" );
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_GET_ERROR_STRING , (void*)&vdp_get_error_string );
+ if ( vdpau_init_error( st, "Can't get GET_ERROR_STRING proc address !!", &this->vo_driver, 0 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_GET_API_VERSION , (void*)&vdp_get_api_version );
+ if ( vdpau_init_error( st, "Can't get GET_API_VERSION proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ uint32_t tmp;
+ vdp_get_api_version( &tmp );
+ fprintf(stderr, "vo_vdpau: vdpau API version : %d\n", tmp );
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_GET_INFORMATION_STRING , (void*)&vdp_get_information_string );
+ if ( vdpau_init_error( st, "Can't get GET_INFORMATION_STRING proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ const char *s;
+ st = vdp_get_information_string( &s );
+ fprintf(stderr, "vo_vdpau: vdpau implementation description : %s\n", s );
+ VdpBool ok;
+ uint32_t max_surface_width, max_surface_height;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES , (void*)&vdp_video_surface_query_capabilities );
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_QUERY_CAPABILITIES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_video_surface_query_capabilities( vdp_device, VDP_CHROMA_TYPE_422, &ok, &max_surface_width, &max_surface_height );
+ if ( vdpau_init_error( st, "Failed to check vdpau chroma type 4:2:2 capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: VideoSurface doesn't support chroma type 4:2:2, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ fprintf(stderr, "vo_vdpau: maximum video surface size for chroma type 4:2:2 is %dx%d\n", (int)max_surface_width, (int)max_surface_height );
+ st = vdp_video_surface_query_capabilities( vdp_device, VDP_CHROMA_TYPE_420, &ok, &max_surface_width, &max_surface_height );
+ if ( vdpau_init_error( st, "Failed to check vdpau chroma type 4:2:0 capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: VideoSurface doesn't support chroma type 4:2:0, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ fprintf(stderr, "vo_vdpau: maximum video surface size for chroma type 4:2:0 is %dx%d\n", (int)max_surface_width, (int)max_surface_height );
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES , (void*)&vdp_video_surface_query_get_put_bits_ycbcr_capabilities );
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_video_surface_query_get_put_bits_ycbcr_capabilities( vdp_device, VDP_CHROMA_TYPE_422, VDP_YCBCR_FORMAT_YUYV, &ok );
+ if ( vdpau_init_error( st, "Failed to check vdpau yuy2 capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: VideoSurface doesn't support yuy2, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ st = vdp_video_surface_query_get_put_bits_ycbcr_capabilities( vdp_device, VDP_CHROMA_TYPE_420, VDP_YCBCR_FORMAT_YV12, &ok );
+ if ( vdpau_init_error( st, "Failed to check vdpau yv12 capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: VideoSurface doesn't support yv12, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES , (void*)&vdp_output_surface_query_capabilities );
+ if ( vdpau_init_error( st, "Can't get OUTPUT_SURFACE_QUERY_CAPABILITIES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_output_surface_query_capabilities( vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, &ok, &max_surface_width, &max_surface_height );
+ if ( vdpau_init_error( st, "Failed to check vdpau rgba capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: OutputSurface doesn't support rgba, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ fprintf(stderr, "vo_vdpau: maximum output surface size is %dx%d\n", (int)max_surface_width, (int)max_surface_height );
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES , (void*)&vdp_output_surface_query_get_put_bits_native_capabilities );
+ if ( vdpau_init_error( st, "Can't get OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_output_surface_query_get_put_bits_native_capabilities( vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, &ok );
+ if ( vdpau_init_error( st, "Failed to check vdpau get/put bits native capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: OutputSurface doesn't support get/put bits native, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES , (void*)&vdp_output_surface_query_put_bits_ycbcr_capabilities );
+ if ( vdpau_init_error( st, "Can't get OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_output_surface_query_put_bits_ycbcr_capabilities( vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, VDP_YCBCR_FORMAT_V8U8Y8A8, &ok );
+ if ( vdpau_init_error( st, "Failed to check vdpau put bits ycbcr capability", &this->vo_driver, 1 ) )
+ return NULL;
+ if ( !ok ) {
+ fprintf(stderr, "vo_vdpau: OutputSurface doesn't support put bits ycbcr, sorry.\n");
+ vdpau_dispose( &this->vo_driver );
+ return NULL;
+ }
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_DEVICE_DESTROY , (void*)&vdp_device_destroy );
+ if ( vdpau_init_error( st, "Can't get DEVICE_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_CREATE , (void*)&orig_vdp_video_surface_create ); vdp_video_surface_create = guarded_vdp_video_surface_create;
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_CREATE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_DESTROY , (void*)&orig_vdp_video_surface_destroy ); vdp_video_surface_destroy = guarded_vdp_video_surface_destroy;
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR , (void*)&orig_vdp_video_surface_putbits_ycbcr ); vdp_video_surface_putbits_ycbcr = guarded_vdp_video_surface_putbits_ycbcr;
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_PUT_BITS_Y_CB_CR proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR , (void*)&vdp_video_surface_getbits_ycbcr );
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_GET_BITS_Y_CB_CR proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS , (void*)&vdp_video_surface_get_parameters );
+ if ( vdpau_init_error( st, "Can't get VIDEO_SURFACE_GET_PARAMETERS proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_CREATE , (void*)&orig_vdp_output_surface_create ); vdp_output_surface_create = guarded_vdp_output_surface_create;
+ if ( vdpau_init_error( st, "Can't get OUTPUT_SURFACE_CREATE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY , (void*)&orig_vdp_output_surface_destroy ); vdp_output_surface_destroy = guarded_vdp_output_surface_destroy;
+ if ( vdpau_init_error( st, "Can't get OUTPUT_SURFACE_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE , (void*)&vdp_output_surface_render_output_surface );
+ if ( vdpau_init_error( st, "Can't get OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE , (void*)&vdp_output_surface_put_bits );
+ if ( vdpau_init_error( st, "Can't get VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR , (void*)&vdp_output_surface_put_bits_ycbcr );
+ if ( vdpau_init_error( st, "Can't get VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE , (void*)&vdp_output_surface_get_bits );
+ if ( vdpau_init_error( st, "Can't get VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_CREATE , (void*)&vdp_video_mixer_create );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_CREATE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_DESTROY , (void*)&vdp_video_mixer_destroy );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_RENDER , (void*)&vdp_video_mixer_render );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_RENDER proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES , (void*)&vdp_video_mixer_set_attribute_values );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_SET_ATTRIBUTE_VALUES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES , (void*)&vdp_video_mixer_set_feature_enables );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_SET_FEATURE_ENABLES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES , (void*)&vdp_video_mixer_get_feature_enables );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_GET_FEATURE_ENABLES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT , (void*)&vdp_video_mixer_query_feature_support );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_QUERY_FEATURE_SUPPORT proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT , (void*)&vdp_video_mixer_query_parameter_support );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_QUERY_PARAMETER_SUPPORT proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT , (void*)&vdp_video_mixer_query_attribute_support );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE , (void*)&vdp_video_mixer_query_parameter_value_range );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE , (void*)&vdp_video_mixer_query_attribute_value_range );
+ if ( vdpau_init_error( st, "Can't get VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_GENERATE_CSC_MATRIX , (void*)&vdp_generate_csc_matrix );
+ if ( vdpau_init_error( st, "Can't get GENERATE_CSC_MATRIX proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 , (void*)&vdp_queue_target_create_x11 );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_TARGET_CREATE_X11 proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY , (void*)&vdp_queue_target_destroy );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_TARGET_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE , (void*)&vdp_queue_create );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_CREATE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY , (void*)&vdp_queue_destroy );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY , (void*)&vdp_queue_display );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_DISPLAY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE , (void*)&vdp_queue_block );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR , (void*)&vdp_queue_set_background_color );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_SET_BACKGROUND_COLOR proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME , (void*)&vdp_queue_get_time );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_GET_TIME proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS , (void*)&vdp_queue_query_surface_status );
+ if ( vdpau_init_error( st, "Can't get PRESENTATION_QUEUE_QUERY_SURFACE_STATUS proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES , (void*)&vdp_decoder_query_capabilities );
+ if ( vdpau_init_error( st, "Can't get DECODER_QUERY_CAPABILITIES proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_DECODER_CREATE , (void*)&orig_vdp_decoder_create ); vdp_decoder_create = guarded_vdp_decoder_create;
+ if ( vdpau_init_error( st, "Can't get DECODER_CREATE proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_DECODER_DESTROY , (void*)&orig_vdp_decoder_destroy ); vdp_decoder_destroy = guarded_vdp_decoder_destroy;
+ if ( vdpau_init_error( st, "Can't get DECODER_DESTROY proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_DECODER_RENDER , (void*)&orig_vdp_decoder_render ); vdp_decoder_render = guarded_vdp_decoder_render;
+ if ( vdpau_init_error( st, "Can't get DECODER_RENDER proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER, (void*)&vdp_preemption_callback_register );
+ if ( vdpau_init_error( st, "Can't get PREEMPTION_CALLBACK_REGISTER proc address !!", &this->vo_driver, 1 ) )
+ return NULL;
+
+ st = vdp_preemption_callback_register(vdp_device, &vdp_preemption_callback, (void*)this);
+ if ( vdpau_init_error( st, "Can't register preemption callback !!", &this->vo_driver, 1 ) )
+ return NULL;
+
+ st = vdp_queue_target_create_x11( vdp_device, this->drawable, &vdp_queue_target );
+ if ( vdpau_init_error( st, "Can't create presentation queue target !!", &this->vo_driver, 1 ) )
+ return NULL;
+ st = vdp_queue_create( vdp_device, vdp_queue_target, &vdp_queue );
+ if ( vdpau_init_error( st, "Can't create presentation queue !!", &this->vo_driver, 1 ) )
+ return NULL;
+
+ /* choose almost black as backcolor for color keying */
+ this->back_color.red = 0.02;
+ this->back_color.green = 0.01;
+ this->back_color.blue = 0.03;
+ this->back_color.alpha = 1;
+ vdp_queue_set_background_color( vdp_queue, &this->back_color );
+
+ this->soft_surface_width = 320;
+ this->soft_surface_height = 240;
+ this->soft_surface_format = XINE_IMGFMT_YV12;
+ VdpChromaType chroma = VDP_CHROMA_TYPE_420;
+ st = vdp_video_surface_create( vdp_device, chroma, this->soft_surface_width, this->soft_surface_height, &this->soft_surface );
+ if ( vdpau_init_error( st, "Can't create video surface !!", &this->vo_driver, 1 ) )
+ return NULL;
+
+ this->output_surface_buffer_size = config->register_num (config, "video.output.vdpau_output_surface_buffer_size", 10, /* default */
+ _("maximum number of output surfaces buffered for reuse"),
+ _("The maximum number of video output surfaces buffered for reuse"),
+ 20, NULL, this);
+ if (this->output_surface_buffer_size < 2)
+ this->output_surface_buffer_size = 2;
+ if (this->output_surface_buffer_size > NOUTPUTSURFACEBUFFER)
+ this->output_surface_buffer_size = NOUTPUTSURFACEBUFFER;
+ fprintf(stderr, "vo_vdpau: hold a maximum of %d video output surfaces for reuse\n", this->output_surface_buffer_size);
+
+ this->num_big_output_surfaces_created = 0;
+ for (i = 0; i < this->output_surface_buffer_size; ++i)
+ this->output_surface_buffer[i].surface = VDP_INVALID_HANDLE;
+
+ vdpau_update_display_dimension(this);
+
+ this->queue_length = config->register_num (config, "video.output.vdpau_display_queue_length", 3, /* default */
+ _("default length of display queue"),
+ _("The default number of video output surfaces to create for the display queue"),
+ 20, NULL, this);
+ if (this->queue_length < 2)
+ this->queue_length = 2;
+ if (this->queue_length > NOUTPUTSURFACE)
+ this->queue_length = NOUTPUTSURFACE;
+ fprintf(stderr, "vo_vdpau: using %d output surfaces of size %dx%d for display queue\n", this->queue_length, this->display_width, this->display_height);
+
+ this->current_output_surface = 0;
+ this->init_queue = 0;
+ for ( i=0; i<this->queue_length; ++i ) {
+ this->output_surface_width[i] = this->display_width;
+ this->output_surface_height[i] = this->display_height;
+ st = vdp_output_surface_create( vdp_device, VDP_RGBA_FORMAT_B8G8R8A8, this->output_surface_width[i], this->output_surface_height[i], &this->output_surface[i] );
+ if ( vdpau_init_error( st, "Can't create output surface !!", &this->vo_driver, 1 ) ) {
+ int j;
+ for ( j=0; j<i; ++j )
+ vdp_output_surface_destroy( this->output_surface[j] );
+ vdp_video_surface_destroy( this->soft_surface );
+ return NULL;
+ }
+ }
+
+ this->scaling_level_max = this->scaling_level_current = 0;
+#ifdef VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1
+ VdpBool hqscaling;
+ for ( i=0; i<9; ++i ) {
+ st = vdp_video_mixer_query_feature_support( vdp_device, VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + i, &hqscaling );
+ if ( ( st != VDP_STATUS_OK ) || !hqscaling ) {
+ /*printf("unsupported scaling quality=%d\n", i);*/
+ break;
+ }
+ else {
+ /*printf("supported scaling quality=%d\n", i);*/
+ ++this->scaling_level_max;
+ }
+ }
+#endif
+
+ vdp_video_mixer_query_feature_support( vdp_device, VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL, &this->temporal_is_supported );
+ vdp_video_mixer_query_feature_support( vdp_device, VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL, &this->temporal_spatial_is_supported );
+ vdp_video_mixer_query_feature_support( vdp_device, VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION, &this->noise_reduction_is_supported );
+ vdp_video_mixer_query_feature_support( vdp_device, VDP_VIDEO_MIXER_FEATURE_SHARPNESS, &this->sharpness_is_supported );
+ vdp_video_mixer_query_feature_support( vdp_device, VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE, &this->inverse_telecine_is_supported );
+ vdp_video_mixer_query_attribute_support( vdp_device, VDP_VIDEO_MIXER_ATTRIBUTE_SKIP_CHROMA_DEINTERLACE, &this->skip_chroma_is_supported );
+ vdp_video_mixer_query_attribute_support( vdp_device, VDP_VIDEO_MIXER_ATTRIBUTE_BACKGROUND_COLOR, &this->background_is_supported );
+
+ this->color_standard = VDP_COLOR_STANDARD_ITUR_BT_601;
+ this->video_mixer_chroma = chroma;
+ this->video_mixer_width = this->soft_surface_width;
+ this->video_mixer_height = this->soft_surface_height;
+ VdpVideoMixerFeature features[15];
+ int features_count = 0;
+ if ( this->noise_reduction_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_NOISE_REDUCTION;
+ ++features_count;
+ }
+ if ( this->sharpness_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_SHARPNESS;
+ ++features_count;
+ }
+ if ( this->temporal_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL;
+ ++features_count;
+ }
+ if ( this->temporal_spatial_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_DEINTERLACE_TEMPORAL_SPATIAL;
+ ++features_count;
+ }
+ if ( this->inverse_telecine_is_supported ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_INVERSE_TELECINE;
+ ++features_count;
+ }
+#ifdef VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1
+ for ( i=0; i<this->scaling_level_max; ++i ) {
+ features[features_count] = VDP_VIDEO_MIXER_FEATURE_HIGH_QUALITY_SCALING_L1 + i;
+ ++features_count;
+ }
+#endif
+ VdpVideoMixerParameter params[] = { VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH, VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT,
+ VDP_VIDEO_MIXER_PARAMETER_CHROMA_TYPE, VDP_VIDEO_MIXER_PARAMETER_LAYERS };
+ int num_layers = 1;
+ void const *param_values[] = { &this->video_mixer_width, &this->video_mixer_height, &chroma, &num_layers };
+ st = vdp_video_mixer_create( vdp_device, features_count, features, 4, params, param_values, &this->video_mixer );
+ if ( vdpau_init_error( st, "Can't create video mixer !!", &this->vo_driver, 1 ) ) {
+ vdp_video_surface_destroy( this->soft_surface );
+ for ( i=0; i<this->queue_length; ++i )
+ vdp_output_surface_destroy( this->output_surface[i] );
+ return NULL;
+ }
+
+ char deinterlacers_description[1024];
+ memset( deinterlacers_description, 0, 1024 );
+ int deint_count = 0;
+ int deint_default = 0;
+ this->deinterlacers_name[deint_count] = vdpau_deinterlacer_name[0];
+ this->deinterlacers_method[deint_count] = DEINT_BOB;
+ strcat( deinterlacers_description, vdpau_deinterlacer_description[0] );
+ ++deint_count;
+ if ( this->temporal_is_supported ) {
+ this->deinterlacers_name[deint_count] = vdpau_deinterlacer_name[1];
+ this->deinterlacers_method[deint_count] = DEINT_HALF_TEMPORAL;
+ strcat( deinterlacers_description, vdpau_deinterlacer_description[1] );
+ ++deint_count;
+ }
+ if ( this->temporal_spatial_is_supported ) {
+ this->deinterlacers_name[deint_count] = vdpau_deinterlacer_name[2];
+ this->deinterlacers_method[deint_count] = DEINT_HALF_TEMPORAL_SPATIAL;
+ strcat( deinterlacers_description, vdpau_deinterlacer_description[2] );
+ ++deint_count;
+ }
+ if ( this->temporal_is_supported ) {
+ this->deinterlacers_name[deint_count] = vdpau_deinterlacer_name[3];
+ this->deinterlacers_method[deint_count] = DEINT_TEMPORAL;
+ strcat( deinterlacers_description, vdpau_deinterlacer_description[3] );
+ deint_default = deint_count;
+ ++deint_count;
+ }
+ if ( this->temporal_spatial_is_supported ) {
+ this->deinterlacers_name[deint_count] = vdpau_deinterlacer_name[4];
+ this->deinterlacers_method[deint_count] = DEINT_TEMPORAL_SPATIAL;
+ strcat( deinterlacers_description, vdpau_deinterlacer_description[4] );
+ ++deint_count;
+ }
+ this->deinterlacers_name[deint_count] = NULL;
+
+ if ( this->scaling_level_max ) {
+ this->scaling_level_current = config->register_range( config, "video.output.vdpau_scaling_quality", 0,
+ 0, this->scaling_level_max, _("vdpau: Scaling Quality"),
+ _("Scaling Quality Level"),
+ 10, vdpau_update_scaling_level, this );
+ }
+
+ this->deinterlace_method_hd = config->register_enum( config, "video.output.vdpau_hd_deinterlace_method", deint_default,
+ this->deinterlacers_name, _("vdpau: HD deinterlace method"),
+ deinterlacers_description,
+ 10, vdpau_update_deinterlace_method_hd, this );
+
+ this->deinterlace_method_sd = config->register_enum( config, "video.output.vdpau_sd_deinterlace_method", deint_default,
+ this->deinterlacers_name, _("vdpau: SD deinterlace method"),
+ deinterlacers_description,
+ 10, vdpau_update_deinterlace_method_sd, this );
+
+ if ( this->inverse_telecine_is_supported ) {
+ this->enable_inverse_telecine = config->register_bool( config, "video.output.vdpau_enable_inverse_telecine", 1,
+ _("vdpau: Try to recreate progressive frames from pulldown material"),
+ _("Enable this to detect bad-flagged progressive content to which\n"
+ "a 2:2 or 3:2 pulldown was applied.\n\n"),
+ 10, vdpau_update_enable_inverse_telecine, this );
+ }
+
+ this->honor_progressive = config->register_bool( config, "video.output.vdpau_honor_progressive", 0,
+ _("vdpau: disable deinterlacing when progressive_frame flag is set"),
+ _("Set to true if you want to trust the progressive_frame stream's flag.\n"
+ "This flag is not always reliable.\n\n"),
+ 10, vdpau_honor_progressive_flag, this );
+
+ if ( this->skip_chroma_is_supported ) {
+ this->skip_chroma = config->register_bool( config, "video.output.vdpau_skip_chroma_deinterlace", 0,
+ _("vdpau: disable advanced deinterlacers chroma filter"),
+ _("Setting to true may help if your video card isn't able to run advanced deinterlacers.\n\n"),
+ 10, vdpau_set_skip_chroma, this );
+ }
+
+ this->studio_levels = config->register_bool( config, "video.output.vdpau_studio_levels", 0,
+ _("vdpau: disable studio level"),
+ _("Setting to true enables studio levels (16-219) instead of PC levels (0-255) in RGB colors.\n\n"),
+ 10, vdpau_set_studio_levels, this );
+
+ if ( this->background_is_supported ) {
+ this->background = config->register_num( config, "video.output.vdpau_background_color", 0,
+ _("vdpau: color of none video area in output window"),
+ _("Displaying 4:3 images on 16:9 plasma TV sets lets the inactive pixels outside the video age slower than the pixels in the active area. Setting a different background color (e. g. 8421504) makes all pixels age similarly. The number to enter for a certain color can be derived from its 6 digit hexadecimal RGB value.\n\n"),
+ 10, vdpau_set_background, this );
+ }
+
+ this->sd_only_properties = config->register_enum( config, "video.output.vdpau_sd_only_properties", 0, vdpau_sd_only_properties,
+ _("vdpau: restrict enabling video properties for SD video only"),
+ _("none\n"
+ "No restrictions\n\n"
+ "noise\n"
+ "Restrict noise reduction property.\n\n"
+ "sharpness\n"
+ "Restrict sharpness property.\n\n"
+ "noise+sharpness"
+ "Restrict noise and sharpness properties.\n\n"),
+ 10, vdpau_update_sd_only_properties, this );
+
+ /* number of video frames from config - register it with the default value. */
+ int frame_num = config->register_num (config, "engine.buffers.video_num_frames", 15, /* default */
+ _("default number of video frames"),
+ _("The default number of video frames to request "
+ "from xine video out driver. Some drivers will "
+ "override this setting with their own values."),
+ 20, NULL, this);
+
+ /* now make sure we have at least 22 frames, to prevent
+ * locks with vdpau_h264 */
+ if(frame_num < 22)
+ config->update_num(config,"engine.buffers.video_num_frames",22);
+
+ this->capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_CROP | VO_CAP_UNSCALED_OVERLAY | VO_CAP_CUSTOM_EXTENT_OVERLAY | VO_CAP_ARGB_LAYER_OVERLAY | VO_CAP_VIDEO_WINDOW_OVERLAY;
+
+ this->capabilities |= VO_CAP_HUE;
+ this->capabilities |= VO_CAP_SATURATION;
+ this->capabilities |= VO_CAP_CONTRAST;
+ this->capabilities |= VO_CAP_BRIGHTNESS;
+ if (this->sharpness_is_supported)
+ this->capabilities |= VO_CAP_SHARPNESS;
+ if (this->noise_reduction_is_supported)
+ this->capabilities |= VO_CAP_NOISE_REDUCTION;
+
+ ok = 0;
+ uint32_t mw, mh, ml, mr;
+ st = vdp_decoder_query_capabilities( vdp_device, VDP_DECODER_PROFILE_H264_MAIN, &ok, &ml, &mr, &mw, &mh );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: getting h264_supported failed! : %s\n", vdp_get_error_string( st ) );
+ else if ( !ok )
+ fprintf(stderr, "vo_vdpau: this hardware doesn't support h264.\n" );
+ else
+ this->capabilities |= VO_CAP_VDPAU_H264;
+
+ st = vdp_decoder_query_capabilities( vdp_device, VDP_DECODER_PROFILE_VC1_MAIN, &ok, &ml, &mr, &mw, &mh );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: getting vc1_supported failed! : %s\n", vdp_get_error_string( st ) );
+ else if ( !ok )
+ fprintf(stderr, "vo_vdpau: this hardware doesn't support vc1.\n" );
+ else
+ this->capabilities |= VO_CAP_VDPAU_VC1;
+
+ st = vdp_decoder_query_capabilities( vdp_device, VDP_DECODER_PROFILE_MPEG2_MAIN, &ok, &ml, &mr, &mw, &mh );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: getting mpeg12_supported failed! : %s\n", vdp_get_error_string( st ) );
+ else if ( !ok )
+ fprintf(stderr, "vo_vdpau: this hardware doesn't support mpeg1/2.\n" );
+ else
+ this->capabilities |= VO_CAP_VDPAU_MPEG12;
+
+#ifdef VDP_DECODER_PROFILE_MPEG4_PART2_ASP
+ st = vdp_decoder_query_capabilities( vdp_device, VDP_DECODER_PROFILE_MPEG4_PART2_ASP, &ok, &ml, &mr, &mw, &mh );
+ if ( st != VDP_STATUS_OK )
+ fprintf(stderr, "vo_vdpau: getting mpeg4-part2_supported failed! : %s\n", vdp_get_error_string( st ) );
+ else if ( !ok )
+ fprintf(stderr, "vo_vdpau: this hardware doesn't support mpeg4-part2.\n" );
+ else
+ this->capabilities |= VO_CAP_VDPAU_MPEG4;
+#endif
+
+ for ( i=0; i<NUM_FRAMES_BACK; i++)
+ this->back_frame[i] = NULL;
+
+ this->hue = 0;
+ this->saturation = 100;
+ this->contrast = 100;
+ this->brightness = 0;
+ this->sharpness = 0;
+ this->noise = 0;
+ this->deinterlace = 0;
+
+ this->allocated_surfaces = 0;
+
+ this->vdp_runtime_nr = 1;
+
+ this->pending_grab_request = NULL;
+ pthread_mutex_init(&this->grab_lock, NULL);
+ pthread_cond_init(&this->grab_cond, NULL);
+
+ return &this->vo_driver;
+}
+
+/*
+ * class functions
+ */
+
+static void *vdpau_init_class (xine_t *xine, void *visual_gen)
+{
+ vdpau_class_t *this = (vdpau_class_t *) calloc(1, sizeof(vdpau_class_t));
+
+ this->driver_class.open_plugin = vdpau_open_plugin;
+ this->driver_class.identifier = "vdpau";
+ this->driver_class.description = N_("xine video output plugin using VDPAU hardware acceleration");
+ this->driver_class.dispose = default_video_driver_class_dispose;
+ this->xine = xine;
+
+ return this;
+}
+
+
+
+static const vo_info_t vo_info_vdpau = {
+ 11, /* priority */
+ XINE_VISUAL_TYPE_X11 /* visual type */
+};
+
+
+/*
+ * exported plugin catalog entry
+ */
+
+const plugin_info_t xine_plugin_info[] EXPORTED = {
+ /* type, API, "name", version, special_info, init_function */
+ { PLUGIN_VIDEO_OUT, 22, "vdpau", XINE_VERSION_CODE, &vo_info_vdpau, vdpau_init_class },
+ { PLUGIN_NONE, 0, "", 0, NULL, NULL }
+};
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 0a7f6a8f6..41406fb58 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.c
@@ -57,10 +57,10 @@
#define LOG
*/
-#include "video_out.h"
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#ifdef HAVE_X11
#include "x11osd.h"
@@ -737,12 +737,12 @@ static int vidix_set_property (vo_driver_t *this_gen,
this->props[property].value = value;
if ( property == VO_PROP_ASPECT_RATIO) {
- lprintf("video_out_vidix: aspect ratio changed to %s\n",
- _x_vo_scale_aspect_ratio_name(value));
-
- if(value == XINE_VO_ASPECT_NUM_RATIOS)
+ if(value >= XINE_VO_ASPECT_NUM_RATIOS)
value = this->props[property].value = XINE_VO_ASPECT_AUTO;
+ lprintf("video_out_vidix: aspect ratio changed to %s\n",
+ _x_vo_scale_aspect_ratio_name_table[value]);
+
this->sc.user_ratio = value;
vidix_compute_ideal_size (this);
this->sc.force_redraw = 1;
@@ -968,7 +968,7 @@ static vidix_driver_t *open_plugin (video_driver_class_t *class_gen) {
this->config = config;
this->got_frame_data = 0;
- this->capabilities = VO_CAP_CROP;
+ this->capabilities = VO_CAP_CROP | VO_CAP_ZOOM_X | VO_CAP_ZOOM_Y;
/* Find what equalizer flags are supported */
if(this->vidix_cap.flags & FLAG_EQUALIZER) {
@@ -977,24 +977,28 @@ static vidix_driver_t *open_plugin (video_driver_class_t *class_gen) {
"video_out_vidix: couldn't get equalizer capabilities: %s\n", strerror(err));
} else {
if(this->vidix_eq.cap & VEQ_CAP_BRIGHTNESS) {
+ this->capabilities |= VO_CAP_BRIGHTNESS;
this->props[VO_PROP_BRIGHTNESS].value = 0;
this->props[VO_PROP_BRIGHTNESS].min = -1000;
this->props[VO_PROP_BRIGHTNESS].max = 1000;
}
if(this->vidix_eq.cap & VEQ_CAP_CONTRAST) {
+ this->capabilities |= VO_CAP_CONTRAST;
this->props[VO_PROP_CONTRAST].value = 0;
this->props[VO_PROP_CONTRAST].min = -1000;
this->props[VO_PROP_CONTRAST].max = 1000;
}
if(this->vidix_eq.cap & VEQ_CAP_SATURATION) {
+ this->capabilities |= VO_CAP_SATURATION;
this->props[VO_PROP_SATURATION].value = 0;
this->props[VO_PROP_SATURATION].min = -1000;
this->props[VO_PROP_SATURATION].max = 1000;
}
if(this->vidix_eq.cap & VEQ_CAP_HUE) {
+ this->capabilities |= VO_CAP_HUE;
this->props[VO_PROP_HUE].value = 0;
this->props[VO_PROP_HUE].min = -1000;
this->props[VO_PROP_HUE].max = 1000;
@@ -1129,14 +1133,6 @@ static void *init_class (xine_t *xine, void *visual_gen) {
return this;
}
-static void dispose_class (video_driver_class_t *this_gen) {
- vidix_class_t *this = (vidix_class_t *) this_gen;
-
-
-
- free (this);
-}
-
#ifdef HAVE_X11
static vo_driver_t *vidix_open_plugin (video_driver_class_t *class_gen, const void *visual_gen) {
vidix_driver_t *this = open_plugin(class_gen);
@@ -1209,23 +1205,15 @@ static vo_driver_t *vidix_open_plugin (video_driver_class_t *class_gen, const vo
return &this->vo_driver;
}
-static char* vidix_get_identifier (video_driver_class_t *this_gen) {
- return "vidix";
-}
-
-static char* vidix_get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using libvidix for x11");
-}
-
static void *vidix_init_class (xine_t *xine, void *visual_gen) {
vidix_class_t *this = init_class (xine, visual_gen);
if(this) {
this->driver_class.open_plugin = vidix_open_plugin;
- this->driver_class.get_identifier = vidix_get_identifier;
- this->driver_class.get_description = vidix_get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "vidix";
+ this->driver_class.description = N_("xine video output plugin using libvidix for x11");
+ this->driver_class.dispose = default_video_driver_class_dispose;
}
return this;
@@ -1291,23 +1279,15 @@ static vo_driver_t *vidixfb_open_plugin (video_driver_class_t *class_gen, const
return &this->vo_driver;
}
-static char* vidixfb_get_identifier (video_driver_class_t *this_gen) {
- return "vidixfb";
-}
-
-static char* vidixfb_get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using libvidix for linux frame buffer");
-}
-
static void *vidixfb_init_class (xine_t *xine, void *visual_gen) {
vidix_class_t *this = init_class (xine, visual_gen);
if(this) {
this->driver_class.open_plugin = vidixfb_open_plugin;
- this->driver_class.get_identifier = vidixfb_get_identifier;
- this->driver_class.get_description = vidixfb_get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "vidixfb";
+ this->driver_class.description = N_("xine video output plugin using libvidix for linux frame buffer");
+ this->driver_class.dispose = default_video_driver_class_dispose;
}
return this;
@@ -1326,10 +1306,10 @@ static const vo_info_t vo_info_vidixfb = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
#ifdef HAVE_X11
- { PLUGIN_VIDEO_OUT, 21, "vidix", XINE_VERSION_CODE, &vo_info_vidix, vidix_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "vidix", XINE_VERSION_CODE, &vo_info_vidix, vidix_init_class },
#endif
#ifdef HAVE_FB
- { PLUGIN_VIDEO_OUT, 21, "vidixfb", XINE_VERSION_CODE, &vo_info_vidixfb, vidixfb_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "vidixfb", XINE_VERSION_CODE, &vo_info_vidixfb, vidixfb_init_class },
#endif
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c
index e3556d8e7..eb211e75d 100644
--- a/src/video_out/video_out_xcbshm.c
+++ b/src/video_out/video_out_xcbshm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2003, 2007 the xine project
+ * Copyright (C) 2000-2003, 2007-2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -37,7 +37,7 @@
#include <math.h>
#include "xine.h"
-#include "video_out.h"
+#include <xine/video_out.h>
#include <errno.h>
@@ -50,16 +50,22 @@
#include <pthread.h>
#include <netinet/in.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#define LOG_MODULE "video_out_xcbshm"
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "xcbosd.h"
typedef struct {
@@ -76,8 +82,6 @@ typedef struct {
int bytes_per_line;
xcb_shm_seg_t shmseg;
- uint8_t *chunk[3]; /* mem alloc by xmalloc_aligned */
-
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */
uint8_t *rgb_dst;
@@ -147,8 +151,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;
}
@@ -156,8 +161,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;
}
@@ -167,8 +173,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;
}
@@ -218,7 +225,7 @@ static void dispose_ximage(xshm_driver_t *this, xshm_frame_t *frame)
static uint32_t xshm_get_capabilities (vo_driver_t *this_gen) {
xshm_driver_t *this = (xshm_driver_t *) this_gen;
- uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2;
+ uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS | VO_CAP_CONTRAST | VO_CAP_SATURATION;
if( this->xoverlay )
capabilities |= VO_CAP_UNSCALED_OVERLAY;
@@ -284,9 +291,9 @@ static void xshm_frame_dispose (vo_frame_t *vo_img) {
frame->yuv2rgb->dispose (frame->yuv2rgb);
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
free (frame);
}
@@ -434,18 +441,9 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
dispose_ximage(this, frame);
- 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;
- }
+ av_freep(&frame->vo_frame.base[0]);
+ av_freep(&frame->vo_frame.base[1]);
+ av_freep(&frame->vo_frame.base[2]);
}
create_ximage(this, frame, frame->sc.output_width, frame->sc.output_height);
@@ -456,14 +454,12 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), (void **) &frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), (void **) &frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
} else {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
}
lprintf ("stripe out_ht=%i, deliv_ht=%i\n",
@@ -737,7 +733,7 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) {
return this->cur_frame->sc.output_yoffset;
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;
@@ -747,47 +743,45 @@ static int xshm_set_property (vo_driver_t *this_gen,
int property, int value) {
xshm_driver_t *this = (xshm_driver_t *) this_gen;
- if ( property == VO_PROP_ASPECT_RATIO) {
-
+ switch (property) {
+ case VO_PROP_ASPECT_RATIO:
if (value>=XINE_VO_ASPECT_NUM_RATIOS)
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));
-
- } else if (property == VO_PROP_BRIGHTNESS) {
+ LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
+ break;
+ case VO_PROP_BRIGHTNESS:
this->yuv2rgb_brightness = value;
this->yuv2rgb_factory->set_csc_levels (this->yuv2rgb_factory,
this->yuv2rgb_brightness,
this->yuv2rgb_contrast,
this->yuv2rgb_saturation);
-
this->sc.force_redraw = 1;
+ break;
- } else if (property == VO_PROP_CONTRAST) {
-
+ case VO_PROP_CONTRAST:
this->yuv2rgb_contrast = value;
this->yuv2rgb_factory->set_csc_levels (this->yuv2rgb_factory,
this->yuv2rgb_brightness,
this->yuv2rgb_contrast,
this->yuv2rgb_saturation);
-
this->sc.force_redraw = 1;
+ break;
- } else if (property == VO_PROP_SATURATION) {
-
+ case VO_PROP_SATURATION:
this->yuv2rgb_saturation = value;
this->yuv2rgb_factory->set_csc_levels (this->yuv2rgb_factory,
this->yuv2rgb_brightness,
this->yuv2rgb_contrast,
this->yuv2rgb_saturation);
-
this->sc.force_redraw = 1;
+ break;
- } else {
+ default:
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;
@@ -963,7 +957,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];
@@ -975,8 +969,8 @@ static int ImlibPaletteLUTGet(xshm_driver_t *this) {
return 0;
}
-
-static char *visual_class_name(xcb_visualtype_t *visual) {
+/* TODO replace this with a string table. */
+static const char *visual_class_name(xcb_visualtype_t *visual) {
switch (visual->_class) {
case XCB_VISUAL_CLASS_STATIC_GRAY:
@@ -1111,7 +1105,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;
}
@@ -1149,8 +1143,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 ",
@@ -1210,7 +1204,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;
}
@@ -1234,28 +1228,13 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void
/*
* class functions
*/
-
-static char* xshm_get_identifier (video_driver_class_t *this_gen) {
- return "XShm";
-}
-
-static char* xshm_get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the MIT X shared memory extension");
-}
-
-static void xshm_dispose_class (video_driver_class_t *this_gen) {
- xshm_class_t *this = (xshm_class_t *) this_gen;
-
- free (this);
-}
-
static void *xshm_init_class (xine_t *xine, void *visual_gen) {
xshm_class_t *this = (xshm_class_t *) calloc(1, sizeof(xshm_class_t));
this->driver_class.open_plugin = xshm_open_plugin;
- this->driver_class.get_identifier = xshm_get_identifier;
- this->driver_class.get_description = xshm_get_description;
- this->driver_class.dispose = xshm_dispose_class;
+ this->driver_class.identifier = "XShm";
+ this->driver_class.description = N_("xine video output plugin using the MIT X shared memory extension");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -1275,6 +1254,6 @@ static const vo_info_t vo_info_xshm = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c
index 1f580bd69..f098ceed8 100644
--- a/src/video_out/video_out_xcbxv.c
+++ b/src/video_out/video_out_xcbxv.c
@@ -58,12 +58,11 @@
*/
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
/* #include "overlay.h" */
-#include "deinterlace.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "xcbosd.h"
#include "xv_common.h"
@@ -131,10 +130,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;
@@ -267,8 +262,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 +272,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 +282,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 +294,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 +364,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 +400,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 + this->deinterlace_frame.xv_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 +454,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 +573,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");
*/
/*
@@ -720,17 +601,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
*/
@@ -763,7 +633,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");
*/
}
@@ -791,7 +661,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;
}
@@ -836,25 +706,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);
@@ -866,7 +724,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;
@@ -880,7 +738,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;
@@ -992,15 +850,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;
@@ -1073,12 +922,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);
xcb_free_gc(this->connection, this->gc);
@@ -1166,7 +1009,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 */
@@ -1211,13 +1054,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_attr (void *this_gen, xine_cfg_entry_t *entry,
@@ -1355,7 +1191,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;
}
@@ -1367,7 +1203,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;
}
@@ -1382,8 +1218,8 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
if (xv_port != 0) {
if (! xv_open_port(this, xv_port)) {
xprintf(class->xine, XINE_VERBOSITY_NONE,
- _("%s: could not open Xv port %d - autodetecting\n"),
- LOG_MODULE, xv_port);
+ _("%s: could not open Xv port %lu - autodetecting\n"),
+ LOG_MODULE, (unsigned long)xv_port);
adaptor_it = adaptor_first;
xv_port = xv_autodetect_port (this, &adaptor_it, xv_port, prefer_type);
} else
@@ -1406,16 +1242,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 "
- "colour space conversion and scaling.\n"), xv_port,
+ _("%s: using Xv port %d from adaptor %s for hardware "
+ "colour space conversion and scaling.\n"), LOG_MODULE, xv_port,
xcb_xv_adaptor_info_name(adaptor_it.data));
this->xv_port = xv_port;
@@ -1426,10 +1263,8 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
this->gc = xcb_generate_id(this->connection);
xcb_create_gc(this->connection, this->gc, this->window, 0, NULL);
- this->capabilities = VO_CAP_CROP;
+ this->capabilities = VO_CAP_CROP | VO_CAP_ZOOM_X | VO_CAP_ZOOM_Y;
this->use_shm = 1;
- this->deinterlace_method = 0;
- this->deinterlace_frame.image = NULL;
this->use_colorkey = 0;
this->colorkey = 0;
this->xoverlay = NULL;
@@ -1463,7 +1298,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;
@@ -1488,34 +1322,41 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
if(!strcmp(name, "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 {
+ this->capabilities |= VO_CAP_HUE;
xv_check_capability (this, VO_PROP_HUE, attribute_it.data,
adaptor_it.data->base_id,
NULL, NULL, NULL);
}
} else if(!strcmp(name, "XV_SATURATION")) {
+ this->capabilities |= VO_CAP_SATURATION;
xv_check_capability (this, VO_PROP_SATURATION, attribute_it.data,
adaptor_it.data->base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_BRIGHTNESS")) {
+ this->capabilities |= VO_CAP_BRIGHTNESS;
xv_check_capability (this, VO_PROP_BRIGHTNESS, attribute_it.data,
adaptor_it.data->base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_CONTRAST")) {
+ this->capabilities |= VO_CAP_CONTRAST;
xv_check_capability (this, VO_PROP_CONTRAST, attribute_it.data,
adaptor_it.data->base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_GAMMA")) {
+ this->capabilities |= VO_CAP_GAMMA;
xv_check_capability (this, VO_PROP_GAMMA, attribute_it.data,
adaptor_it.data->base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_COLORKEY")) {
+ this->capabilities |= VO_CAP_COLORKEY;
xv_check_capability (this, VO_PROP_COLORKEY, attribute_it.data,
adaptor_it.data->base_id,
"video.device.xv_colorkey",
VIDEO_DEVICE_XV_COLORKEY_HELP);
} else if(!strcmp(name, "XV_AUTOPAINT_COLORKEY")) {
+ this->capabilities |= VO_CAP_AUTOPAINT_COLORKEY;
xv_check_capability (this, VO_PROP_AUTOPAINT_COLORKEY, attribute_it.data,
adaptor_it.data->base_id,
"video.device.xv_autopaint_colorkey",
@@ -1559,7 +1400,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);
/*
@@ -1580,16 +1421,21 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
(format_it.data->format == XCB_XV_IMAGE_FORMAT_INFO_FORMAT_PACKED)
? "packed" : "planar");
- if (format_it.data->id == XINE_IMGFMT_YV12) {
+ switch (format_it.data->id) {
+ case XINE_IMGFMT_YV12:
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"));
- } else if (format_it.data->id == XINE_IMGFMT_YUY2) {
+ _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YV12");
+ break;
+ case 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 %s format.\n"), LOG_MODULE, "YUY2");
+ break;
+ default:
+ break;
}
}
@@ -1600,39 +1446,6 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
VIDEO_DEVICE_XV_PITCH_ALIGNMENT_HELP,
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);
@@ -1652,28 +1465,13 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis
/*
* class functions
*/
-
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "Xv";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the MIT X video extension");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- xv_class_t *this = (xv_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *visual_gen) {
xv_class_t *this = (xv_class_t *) calloc(1, sizeof(xv_class_t));
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->driver_class.identifier = "Xv";
+ this->driver_class.description = N_("xine video output plugin using the MIT X video extension");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -1692,6 +1490,6 @@ static const vo_info_t vo_info_xv = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c
index 3d4dae3f9..5dfc2c34e 100644
--- a/src/video_out/video_out_xshm.c
+++ b/src/video_out/video_out_xshm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2003 the xine project
+ * Copyright (C) 2000-2003, 2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -34,9 +34,6 @@
#include <string.h>
#include <math.h>
-#include "xine.h"
-#include "video_out.h"
-
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
@@ -51,16 +48,24 @@
#include <pthread.h>
#include <netinet/in.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#define LOG_MODULE "video_out_xshm"
#define LOG_VERBOSE
/*
#define LOG
*/
-#include "xine_internal.h"
+#include "xine.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
#include "yuv2rgb.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "x11osd.h"
#define LOCK_DISPLAY(this) {if(this->lock_display) this->lock_display(this->user_data); \
@@ -80,8 +85,6 @@ typedef struct {
XImage *image;
XShmSegmentInfo shminfo;
- uint8_t *chunk[3]; /* mem alloc by xmalloc_aligned */
-
yuv2rgb_t *yuv2rgb; /* yuv2rgb converter set up for this frame */
uint8_t *rgb_dst;
@@ -145,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;
@@ -191,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;
}
@@ -207,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;
}
@@ -217,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;
@@ -233,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;
@@ -310,7 +317,7 @@ static void dispose_ximage (xshm_driver_t *this,
static uint32_t xshm_get_capabilities (vo_driver_t *this_gen) {
xshm_driver_t *this = (xshm_driver_t *) this_gen;
- uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2;
+ uint32_t capabilities = VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_BRIGHTNESS | VO_CAP_CONTRAST | VO_CAP_SATURATION;
if( this->xoverlay )
capabilities |= VO_CAP_UNSCALED_OVERLAY;
@@ -376,9 +383,9 @@ static void xshm_frame_dispose (vo_frame_t *vo_img) {
frame->yuv2rgb->dispose (frame->yuv2rgb);
- free (frame->chunk[0]);
- free (frame->chunk[1]);
- free (frame->chunk[2]);
+ av_free (frame->vo_frame.base[0]);
+ av_free (frame->vo_frame.base[1]);
+ av_free (frame->vo_frame.base[2]);
free (frame);
}
@@ -526,18 +533,9 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
dispose_ximage (this, &frame->shminfo, frame->image);
- 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;
- }
+ av_freep(&frame->vo_frame.base[0]);
+ av_freep(&frame->vo_frame.base[1]);
+ av_freep(&frame->vo_frame.base[2]);
frame->image = NULL;
}
@@ -551,14 +549,12 @@ static void xshm_update_frame_format (vo_driver_t *this_gen,
frame->vo_frame.pitches[0] = 8*((width + 7) / 8);
frame->vo_frame.pitches[1] = 8*((width + 15) / 16);
frame->vo_frame.pitches[2] = 8*((width + 15) / 16);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->vo_frame.base[1] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[1] * ((height+1)/2), (void **) &frame->chunk[1]);
- frame->vo_frame.base[2] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[2] * ((height+1)/2), (void **) &frame->chunk[2]);
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
+ frame->vo_frame.base[1] = av_mallocz(frame->vo_frame.pitches[1] * ((height+1)/2));
+ frame->vo_frame.base[2] = av_mallocz(frame->vo_frame.pitches[2] * ((height+1)/2));
} else {
frame->vo_frame.pitches[0] = 8*((width + 3) / 4);
- frame->vo_frame.base[0] = xine_xmalloc_aligned (16, frame->vo_frame.pitches[0] * height, (void **) &frame->chunk[0]);
- frame->chunk[1] = NULL;
- frame->chunk[2] = NULL;
+ frame->vo_frame.base[0] = av_mallocz(frame->vo_frame.pitches[0] * height);
}
lprintf ("stripe out_ht=%i, deliv_ht=%i\n",
@@ -825,7 +821,7 @@ static int xshm_get_property (vo_driver_t *this_gen, int property) {
return this->cur_frame->sc.output_yoffset;
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;
@@ -835,47 +831,45 @@ static int xshm_set_property (vo_driver_t *this_gen,
int property, int value) {
xshm_driver_t *this = (xshm_driver_t *) this_gen;
- if ( property == VO_PROP_ASPECT_RATIO) {
-
+ switch (property) {
+ case VO_PROP_ASPECT_RATIO:
if (value>=XINE_VO_ASPECT_NUM_RATIOS)
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));
-
- } else if (property == VO_PROP_BRIGHTNESS) {
+ LOG_MODULE ": aspect ratio changed to %s\n", _x_vo_scale_aspect_ratio_name_table[value]);
+ break;
+ case VO_PROP_BRIGHTNESS:
this->yuv2rgb_brightness = value;
this->yuv2rgb_factory->set_csc_levels (this->yuv2rgb_factory,
this->yuv2rgb_brightness,
this->yuv2rgb_contrast,
this->yuv2rgb_saturation);
-
this->sc.force_redraw = 1;
+ break;
- } else if (property == VO_PROP_CONTRAST) {
-
+ case VO_PROP_CONTRAST:
this->yuv2rgb_contrast = value;
this->yuv2rgb_factory->set_csc_levels (this->yuv2rgb_factory,
this->yuv2rgb_brightness,
this->yuv2rgb_contrast,
this->yuv2rgb_saturation);
-
this->sc.force_redraw = 1;
+ break;
- } else if (property == VO_PROP_SATURATION) {
-
+ case VO_PROP_SATURATION:
this->yuv2rgb_saturation = value;
this->yuv2rgb_factory->set_csc_levels (this->yuv2rgb_factory,
this->yuv2rgb_brightness,
this->yuv2rgb_contrast,
this->yuv2rgb_saturation);
-
this->sc.force_redraw = 1;
+ break;
- } else {
+ default:
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;
@@ -1049,7 +1043,7 @@ static int ImlibPaletteLUTGet(xshm_driver_t *this) {
}
-static char *visual_class_name(Visual *visual) {
+static const char *visual_class_name(Visual *visual) {
switch (visual->class) {
case StaticGray:
@@ -1167,7 +1161,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 +1182,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 +1245,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;
}
@@ -1294,28 +1288,13 @@ static vo_driver_t *xshm_open_plugin_old (video_driver_class_t *class_gen, const
/*
* class functions
*/
-
-static char* xshm_get_identifier (video_driver_class_t *this_gen) {
- return "XShm";
-}
-
-static char* xshm_get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the MIT X shared memory extension");
-}
-
-static void xshm_dispose_class (video_driver_class_t *this_gen) {
- xshm_class_t *this = (xshm_class_t *) this_gen;
-
- free (this);
-}
-
static void *xshm_init_class (xine_t *xine, void *visual_gen) {
xshm_class_t *this = (xshm_class_t *) calloc(1, sizeof(xshm_class_t));
this->driver_class.open_plugin = xshm_open_plugin_old;
- this->driver_class.get_identifier = xshm_get_identifier;
- this->driver_class.get_description = xshm_get_description;
- this->driver_class.dispose = xshm_dispose_class;
+ this->driver_class.identifier = "XShm";
+ this->driver_class.description = N_("xine video output plugin using the MIT X shared memory extension");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -1348,7 +1327,7 @@ static const vo_info_t vo_info_xshm_2 = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
- { PLUGIN_VIDEO_OUT, 21, "xshm", XINE_VERSION_CODE, &vo_info_xshm_2, xshm_init_class_2 },
+ { PLUGIN_VIDEO_OUT, 22, "xshm", XINE_VERSION_CODE, &vo_info_xshm, xshm_init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xshm", XINE_VERSION_CODE, &vo_info_xshm_2, xshm_init_class_2 },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index af1752158..edff2905a 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.c
@@ -63,12 +63,11 @@
*/
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
/* #include "overlay.h" */
-#include "deinterlace.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "x11osd.h"
#include "xv_common.h"
@@ -136,10 +135,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;
@@ -295,8 +290,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;
}
@@ -321,16 +317,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;
}
@@ -339,14 +337,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;
}
@@ -360,12 +358,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;
}
@@ -448,7 +447,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);
@@ -486,120 +485,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 + this->deinterlace_frame.image->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;
@@ -647,14 +532,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,
@@ -784,7 +661,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");
*/
/*
@@ -812,17 +689,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
*/
@@ -868,7 +734,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");
*/
}
@@ -896,7 +762,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;
}
@@ -916,6 +782,8 @@ static int xv_set_property (vo_driver_t *this_gen,
int property, int value) {
xv_driver_t *this = (xv_driver_t *) this_gen;
+ printf("xv_set_property: property=%d, value=%d\n", property, value );
+
if (this->props[property].atom != None) {
/* value is out of bound */
@@ -938,24 +806,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);
@@ -967,7 +824,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;
@@ -981,7 +838,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;
@@ -1082,15 +939,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;
@@ -1147,17 +995,9 @@ 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);
@@ -1202,9 +1042,9 @@ static int xv_check_yv12 (Display *display, XvPortID port) {
/* called xlocked */
static void xv_check_capability (xv_driver_t *this,
int property, XvAttribute attr, int base_id,
- char *config_name,
- char *config_desc,
- char *config_help) {
+ const char *config_name,
+ const char *config_desc,
+ const char *config_help) {
int int_default;
cfg_entry_t *entry;
const char *str_prop = attr.name;
@@ -1223,7 +1063,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 */
@@ -1268,13 +1108,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_attr (void *this_gen, xine_cfg_entry_t *entry,
@@ -1404,7 +1237,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;
}
@@ -1414,7 +1247,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;
}
@@ -1448,8 +1281,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);
@@ -1457,8 +1291,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 "
- "colour space conversion and scaling.\n"), xv_port,
+ _("%s: using Xv port %ld from adaptor %s for hardware "
+ "colour space conversion and scaling.\n"), LOG_MODULE, xv_port,
adaptor_info[adaptor_num].name);
UNLOCK_DISPLAY(this);
@@ -1473,10 +1307,8 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
LOCK_DISPLAY(this);
this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
UNLOCK_DISPLAY(this);
- this->capabilities = VO_CAP_CROP;
+ this->capabilities = VO_CAP_CROP | VO_CAP_ZOOM_X | VO_CAP_ZOOM_Y;
this->use_shm = 1;
- this->deinterlace_method = 0;
- this->deinterlace_frame.image = NULL;
this->use_colorkey = 0;
this->colorkey = 0;
this->xoverlay = NULL;
@@ -1517,7 +1349,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;
@@ -1541,34 +1372,41 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
if(!strcmp(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 {
+ this->capabilities |= VO_CAP_HUE;
xv_check_capability (this, VO_PROP_HUE, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
}
} else if(!strcmp(name, "XV_SATURATION")) {
+ this->capabilities |= VO_CAP_SATURATION;
xv_check_capability (this, VO_PROP_SATURATION, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_BRIGHTNESS")) {
+ this->capabilities |= VO_CAP_BRIGHTNESS;
xv_check_capability (this, VO_PROP_BRIGHTNESS, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_CONTRAST")) {
+ this->capabilities |= VO_CAP_CONTRAST;
xv_check_capability (this, VO_PROP_CONTRAST, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_GAMMA")) {
+ this->capabilities |= VO_CAP_GAMMA;
xv_check_capability (this, VO_PROP_GAMMA, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_COLORKEY")) {
+ this->capabilities |= VO_CAP_COLORKEY;
xv_check_capability (this, VO_PROP_COLORKEY, attr[k],
adaptor_info[adaptor_num].base_id,
"video.device.xv_colorkey",
VIDEO_DEVICE_XV_COLORKEY_HELP);
} else if(!strcmp(name, "XV_AUTOPAINT_COLORKEY")) {
+ this->capabilities |= VO_CAP_AUTOPAINT_COLORKEY;
xv_check_capability (this, VO_PROP_AUTOPAINT_COLORKEY, attr[k],
adaptor_info[adaptor_num].base_id,
"video.device.xv_autopaint_colorkey",
@@ -1612,7 +1450,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);
/*
@@ -1630,16 +1468,21 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
fo[i].id, (char*)&fo[i].id,
(fo[i].format == XvPacked) ? "packed" : "planar");
- if (fo[i].id == XINE_IMGFMT_YV12) {
+ switch (fo[i].id) {
+ case XINE_IMGFMT_YV12:
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"));
- } else if (fo[i].id == XINE_IMGFMT_YUY2) {
+ _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YV12");
+ break;
+ case 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 %s format.\n"), LOG_MODULE, "YUY2");
+ break;
+ default:
+ break;
}
}
@@ -1664,39 +1507,6 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void *
VIDEO_DEVICE_XV_PITCH_ALIGNMENT_HELP,
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,
@@ -1735,28 +1545,13 @@ static vo_driver_t *open_plugin_old (video_driver_class_t *class_gen, const void
/*
* class functions
*/
-
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "Xv";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the MIT X video extension");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- xv_class_t *this = (xv_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *visual_gen) {
xv_class_t *this = (xv_class_t *) calloc(1, sizeof(xv_class_t));
this->driver_class.open_plugin = open_plugin_old;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "Xv";
+ this->driver_class.description = N_("xine video output plugin using the MIT X video extension");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -1788,7 +1583,7 @@ static const vo_info_t vo_info_xv_2 = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
- { PLUGIN_VIDEO_OUT, 21, "xv", XINE_VERSION_CODE, &vo_info_xv_2, init_class_2 },
+ { PLUGIN_VIDEO_OUT, 22, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xv", XINE_VERSION_CODE, &vo_info_xv_2, init_class_2 },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c
index aeb50271a..3158840a0 100644
--- a/src/video_out/video_out_xvmc.c
+++ b/src/video_out/video_out_xvmc.c
@@ -66,15 +66,12 @@
*/
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
#include "accel_xvmc.h"
-/* TODO - delete these? */
-#include "deinterlace.h"
-
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "xv_common.h"
/* #define LOG1 */
@@ -197,11 +194,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,
@@ -488,9 +480,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");
@@ -563,6 +555,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;
@@ -978,24 +971,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);
@@ -1071,16 +1053,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;
@@ -1312,14 +1284,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;
@@ -1353,6 +1317,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
lprintf ("open_plugin\n");
+ /* TODO ??? */
this = calloc(1, sizeof (xvmc_driver_t));
if (!this)
@@ -1376,7 +1341,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
XLockDisplay(this->display);
this->gc = XCreateGC(this->display, this->drawable, 0, NULL);
XUnlockDisplay(this->display);
- this->capabilities = VO_CAP_XVMC_MOCOMP | VO_CAP_CROP;
+ this->capabilities = VO_CAP_XVMC_MOCOMP | VO_CAP_CROP | VO_CAP_ZOOM_X | VO_CAP_ZOOM_Y;
this->surface_type_id = class->surface_type_id;
this->max_surface_width = class->max_surface_width;
@@ -1388,7 +1353,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;
@@ -1446,32 +1410,39 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
if (!strncmp(adaptor_info[adaptor_num].name, "NV", 2)) {
xprintf (this->xine, XINE_VERBOSITY_NONE, LOG_MODULE ": ignoring broken XV_HUE settings on NVidia cards\n");
} else {
+ this->capabilities |= VO_CAP_HUE;
xvmc_check_capability (this, VO_PROP_HUE, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
}
} else if(!strcmp(name, "XV_SATURATION")) {
+ this->capabilities |= VO_CAP_SATURATION;
xvmc_check_capability (this, VO_PROP_SATURATION, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(attr[k].name, "XV_BRIGHTNESS")) {
+ this->capabilities |= VO_CAP_BRIGHTNESS;
xvmc_check_capability (this, VO_PROP_BRIGHTNESS, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_CONTRAST")) {
+ this->capabilities |= VO_CAP_CONTRAST;
xvmc_check_capability (this, VO_PROP_CONTRAST, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_GAMMA")) {
+ this->capabilities |= VO_CAP_GAMMA;
xvmc_check_capability (this, VO_PROP_GAMMA, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_COLORKEY")) {
+ this->capabilities |= VO_CAP_COLORKEY;
xvmc_check_capability (this, VO_PROP_COLORKEY, attr[k],
adaptor_info[adaptor_num].base_id,
"video.device.xv_colorkey",
VIDEO_DEVICE_XV_COLORKEY_HELP);
} else if(!strcmp(name, "XV_AUTOPAINT_COLORKEY")) {
+ this->capabilities |= VO_CAP_AUTOPAINT_COLORKEY;
xvmc_check_capability (this, VO_PROP_AUTOPAINT_COLORKEY, attr[k],
adaptor_info[adaptor_num].base_id,
"video.device.xv_autopaint_colorkey",
@@ -1505,15 +1476,21 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
fo[i].id, (char*)&fo[i].id,
(fo[i].format == XvPacked) ? "packed" : "planar");
- if (fo[i].id == XINE_IMGFMT_YV12) {
+ switch (fo[i].id) {
+ case XINE_IMGFMT_YV12:
this->xvmc_format_yv12 = fo[i].id;
- this->capabilities |= VO_CAP_YV12;
- lprintf("this adaptor supports the yv12 format.\n");
- }
- else if (fo[i].id == XINE_IMGFMT_YUY2) {
+ this->capabilities |= VO_CAP_YV12;
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YV12");
+ break;
+ case XINE_IMGFMT_YUY2:
this->xvmc_format_yuy2 = fo[i].id;
- this->capabilities |= VO_CAP_YUY2;
- lprintf("this adaptor supports the yuy2 format.\n");
+ this->capabilities |= VO_CAP_YUY2;
+ xprintf(this->xine, XINE_VERBOSITY_LOG,
+ _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YUY2");
+ break;
+ default:
+ break;
}
}
@@ -1535,65 +1512,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
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;
}
@@ -1602,14 +1520,6 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
* class functions
*/
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "XvMC";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the XvMC X video extension");
-}
-
static void dispose_class (video_driver_class_t *this_gen) {
xvmc_class_t *this = (xvmc_class_t *) this_gen;
@@ -1782,8 +1692,8 @@ static void *init_class (xine_t *xine, void *visual_gen) {
return NULL;
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
+ this->driver_class.identifier = "XvMC";
+ this->driver_class.description = N_("xine video output plugin using the XvMC X video extension");
this->driver_class.dispose = dispose_class;
this->display = display;
@@ -1815,7 +1725,7 @@ static const vo_info_t vo_info_xvmc = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xvmc", XINE_VERSION_CODE, &vo_info_xvmc, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xvmc", XINE_VERSION_CODE, &vo_info_xvmc, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c
index f8caec755..14fcbce97 100644
--- a/src/video_out/video_out_xxmc.c
+++ b/src/video_out/video_out_xxmc.c
@@ -163,10 +163,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);
- memset(handler->surfInUse, 0, sizeof(handler->surfInUse));
- memset(handler->surfValid, 0, sizeof(handler->surfValid));
- memset(handler->subInUse, 0, sizeof(handler->subInUse));
- memset(handler->subValid, 0, sizeof(handler->subValid));
+ 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)
@@ -236,7 +236,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);
@@ -256,7 +256,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);
@@ -316,7 +316,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);
@@ -337,7 +337,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);
@@ -365,15 +365,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;
}
@@ -404,7 +404,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;
@@ -452,6 +452,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;
@@ -566,6 +567,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");
@@ -636,8 +638,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;
}
@@ -646,16 +649,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;
}
@@ -664,14 +669,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;
}
@@ -685,12 +690,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;
}
@@ -755,13 +761,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);
@@ -801,10 +807,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)) &&
@@ -835,7 +841,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,
@@ -868,7 +874,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) {
/*
@@ -884,7 +890,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;
}
}
@@ -979,8 +985,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);
@@ -1000,17 +1006,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;
@@ -1046,9 +1052,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;
@@ -1213,10 +1219,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) ||
@@ -1232,7 +1245,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) {
@@ -1246,6 +1259,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) {
@@ -1253,7 +1293,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);
}
}
@@ -1775,7 +1815,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;
}
@@ -1838,7 +1878,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;
@@ -1848,7 +1888,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);
@@ -1860,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_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;
@@ -1874,7 +1914,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;
@@ -2021,7 +2061,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);
@@ -2085,7 +2125,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.
@@ -2277,7 +2317,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) {
@@ -2293,7 +2333,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;
@@ -2317,10 +2357,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;
@@ -2329,21 +2369,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);
}
}
}
@@ -2374,9 +2411,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;
@@ -2433,7 +2469,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;
}
@@ -2443,7 +2479,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;
}
@@ -2477,8 +2513,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);
@@ -2486,8 +2523,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 "
- "colour space conversion and scaling.\n"), xv_port,
+ _("%s: using Xv port %ld from adaptor %s for hardware "
+ "colour space conversion and scaling.\n"), LOG_MODULE, xv_port,
adaptor_info[adaptor_num].name);
XUnlockDisplay(this->display);
@@ -2502,7 +2539,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
XLockDisplay (this->display);
this->gc = XCreateGC (this->display, this->drawable, 0, NULL);
XUnlockDisplay (this->display);
- this->capabilities = VO_CAP_CROP;
+ this->capabilities = VO_CAP_CROP | VO_CAP_ZOOM_X | VO_CAP_ZOOM_Y;
this->use_shm = 1;
this->use_colorkey = 0;
this->colorkey = 0;
@@ -2564,38 +2601,43 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
const char *const name = attr[k].name;
if(!strcmp(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 {
+ this->capabilities |= VO_CAP_HUE;
xxmc_check_capability (this, VO_PROP_HUE, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
}
} else if(!strcmp(name, "XV_SATURATION")) {
+ this->capabilities |= VO_CAP_SATURATION;
xxmc_check_capability (this, VO_PROP_SATURATION, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
-
} else if(!strcmp(name, "XV_BRIGHTNESS")) {
+ this->capabilities |= VO_CAP_BRIGHTNESS;
xxmc_check_capability (this, VO_PROP_BRIGHTNESS, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
-
} else if(!strcmp(name, "XV_CONTRAST")) {
+ this->capabilities |= VO_CAP_CONTRAST;
xxmc_check_capability (this, VO_PROP_CONTRAST, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_GAMMA")) {
+ this->capabilities |= VO_CAP_GAMMA;
xxmc_check_capability (this, VO_PROP_GAMMA, attr[k],
adaptor_info[adaptor_num].base_id,
NULL, NULL, NULL);
} else if(!strcmp(name, "XV_COLORKEY")) {
+ this->capabilities |= VO_CAP_COLORKEY;
xxmc_check_capability (this, VO_PROP_COLORKEY, attr[k],
adaptor_info[adaptor_num].base_id,
"video.device.xv_colorkey",
VIDEO_DEVICE_XV_COLORKEY_HELP);
} else if(!strcmp(name, "XV_AUTOPAINT_COLORKEY")) {
+ this->capabilities |= VO_CAP_AUTOPAINT_COLORKEY;
xxmc_check_capability (this, VO_PROP_AUTOPAINT_COLORKEY, attr[k],
adaptor_info[adaptor_num].base_id,
"video.device.xv_autopaint_colorkey",
@@ -2626,7 +2668,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);
/*
@@ -2651,16 +2693,21 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
fo[i].id, (char*)&fo[i].id,
(fo[i].format == XvPacked) ? "packed" : "planar");
- if (fo[i].id == XINE_IMGFMT_YV12) {
+ switch (fo[i].id) {
+ case XINE_IMGFMT_YV12:
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"));
- } else if (fo[i].id == XINE_IMGFMT_YUY2) {
+ _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YV12");
+ break;
+ case 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 %s format.\n"), LOG_MODULE, "YUY2");
+ break;
+ default:
+ break;
}
}
@@ -2731,10 +2778,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.;
@@ -2771,28 +2818,13 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
/*
* class functions
*/
-
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "XxMC";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the MIT X video extension");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- xxmc_class_t *this = (xxmc_class_t *) this_gen;
-
- free (this);
-}
-
static void *init_class (xine_t *xine, void *visual_gen) {
xxmc_class_t *this = calloc(1, sizeof (xxmc_class_t));
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->driver_class.identifier = "XxMC";
+ this->driver_class.description = N_("xine video output plugin using the MIT X video extension");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -2814,7 +2846,7 @@ static const vo_info_t vo_info_xxmc = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "xxmc", XINE_VERSION_CODE, &vo_info_xxmc, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "xxmc", XINE_VERSION_CODE, &vo_info_xxmc, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
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/drivers/Makefile.am b/src/video_out/vidix/drivers/Makefile.am
deleted file mode 100644
index 2a90f8591..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/x11osd.c b/src/video_out/x11osd.c
index d6354a6e5..8d8a78127 100644
--- a/src/video_out/x11osd.c
+++ b/src/video_out/x11osd.c
@@ -51,7 +51,7 @@
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "x11osd.h"
struct x11osd
diff --git a/src/video_out/x11osd.h b/src/video_out/x11osd.h
index b7726e144..15ea3dcc0 100644
--- a/src/video_out/x11osd.h
+++ b/src/video_out/x11osd.h
@@ -28,7 +28,7 @@
#ifndef X11OSD_H
#define X11OSD_H
-#include "vo_scale.h"
+#include <xine/vo_scale.h>
typedef struct x11osd x11osd;
enum x11osd_mode {X11OSD_SHAPED, X11OSD_COLORKEY};
diff --git a/src/video_out/xcbosd.c b/src/video_out/xcbosd.c
index ca51664a2..1e991347f 100644
--- a/src/video_out/xcbosd.c
+++ b/src/video_out/xcbosd.c
@@ -49,7 +49,7 @@
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "xcbosd.h"
struct xcbosd
diff --git a/src/video_out/xcbosd.h b/src/video_out/xcbosd.h
index 8b91b1b6e..89c317f3e 100644
--- a/src/video_out/xcbosd.h
+++ b/src/video_out/xcbosd.h
@@ -29,7 +29,7 @@
#ifndef XCBOSD_H
#define XCBOSD_H
-#include "vo_scale.h"
+#include <xine/vo_scale.h>
typedef struct xcbosd xcbosd;
enum xcbosd_mode {XCBOSD_SHAPED, XCBOSD_COLORKEY};
diff --git a/src/video_out/xvmc_mocomp.c b/src/video_out/xvmc_mocomp.c
index 197037206..9bb3c5d10 100644
--- a/src/video_out/xvmc_mocomp.c
+++ b/src/video_out/xvmc_mocomp.c
@@ -70,9 +70,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 9eb68972f..87373c96b 100644
--- a/src/video_out/xvmc_vld.c
+++ b/src/video_out/xvmc_vld.c
@@ -32,12 +32,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;
@@ -104,7 +104,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 bc9ceb3ef..7ea60bec9 100644
--- a/src/video_out/xxmc.h
+++ b/src/video_out/xxmc.h
@@ -89,11 +89,10 @@
*/
#include "xine.h"
-#include "video_out.h"
-#include "xine_internal.h"
-#include "deinterlace.h"
-#include "xineutils.h"
-#include "vo_scale.h"
+#include <xine/video_out.h>
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/vo_scale.h>
#include "x11osd.h"
#include "accel_xvmc.h"
diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c
index b237bfafa..7aea37be7 100644
--- a/src/video_out/yuv2rgb.c
+++ b/src/video_out/yuv2rgb.c
@@ -31,6 +31,12 @@
#include <string.h>
#include <inttypes.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#include "yuv2rgb.h"
#define LOG_MODULE "yuv2rgb"
@@ -39,7 +45,7 @@
#define LOG
*/
-#include "xineutils.h"
+#include <xine/xineutils.h>
static int prof_scale_line = -1;
@@ -1261,7 +1267,7 @@ static scale_line_func_t find_scale_line_func(int step) {
int src_step;
int dest_step;
scale_line_func_t func;
- char *desc;
+ const char *desc; /* FIXME: consider moving this to a char[] to avoid reloc */
} scale_line[] = {
{ 15, 16, scale_line_15_16, "dvd 4:3(pal)" },
{ 45, 64, scale_line_45_64, "dvd 16:9(pal), fullscreen(1024x768)" },
@@ -3182,7 +3188,7 @@ static yuv2rgb_t *yuv2rgb_create_converter (yuv2rgb_factory_t *factory) {
static void yuv2rgb_factory_dispose (yuv2rgb_factory_t *this) {
free (this->table_base);
- free (this->table_mmx_base);
+ av_free(this->table_mmx);
free (this);
}
@@ -3203,7 +3209,6 @@ yuv2rgb_factory_t* yuv2rgb_factory_init (int mode, int swapped,
this->matrix_coefficients = 6;
this->table_base = NULL;
this->table_mmx = NULL;
- this->table_mmx_base = NULL;
yuv2rgb_set_csc_levels (this, 0, 128, 128);
diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c
index a10503d55..cde7941bc 100644
--- a/src/video_out/yuv2rgb_mlib.c
+++ b/src/video_out/yuv2rgb_mlib.c
@@ -34,8 +34,8 @@
#include <mlib_algebra.h>
#include <mlib_video.h>
-#include "attributes.h"
-#include "xineutils.h"
+#include <xine/attributes.h>
+#include <xine/xineutils.h>
#include "yuv2rgb.h"
static void mlib_yuv420_rgb24(yuv2rgb_t *this,
diff --git a/src/video_out/yuv2rgb_mmx.c b/src/video_out/yuv2rgb_mmx.c
index 46db48179..9cbb675bb 100644
--- a/src/video_out/yuv2rgb_mmx.c
+++ b/src/video_out/yuv2rgb_mmx.c
@@ -31,8 +31,15 @@
#include <string.h>
#include <inttypes.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
#include "yuv2rgb.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
+#include "xine_mmx.h"
#define CPU_MMXEXT 0
#define CPU_MMX 1
@@ -70,7 +77,7 @@ void mmx_yuv2rgb_set_csc_levels(yuv2rgb_factory_t *this,
/* 'table_mmx' is 64bit aligned for better performance */
if (this->table_mmx == NULL) {
- this->table_mmx = xine_xmalloc_aligned (8, sizeof(mmx_csc_t), &this->table_mmx_base);
+ this->table_mmx = av_mallocz(sizeof(mmx_csc_t));
}
if( brightness <= 16 ) {
diff --git a/src/xine-engine/Makefile.am b/src/xine-engine/Makefile.am
index 67ae63fae..616da19a5 100644
--- a/src/xine-engine/Makefile.am
+++ b/src/xine-engine/Makefile.am
@@ -1,55 +1,76 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 = -I$(top_srcdir)/src/video_out $(DEFAULT_OCFLAGS) $(X_CFLAGS) $(FT2_CFLAGS) $(FONTCONFIG_CFLAGS) \
+ $(AVUTIL_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
+
+YUV_LIB = $(top_builddir)/src/video_out/libyuv2rgb.la
+
+# FIXME: these are currently unused:
+EXTRA_DIST = lrb.c lrb.h accel_vdpau.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) $(LDFLAGS_NOUNDEFINED)
+else
+DEF_FILE =
endif
+noinst_HEADERS = bswap.h ffmpeg_bswap.h xine_private.h
+
+lib_LTLIBRARIES = libxine.la
+
+# Technically, this is a lie; it just makes sure that we get a static lib.
+noinst_LTLIBRARIES = libxine-interface.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 \
- xine_interface.c post.c tvmode.c broadcaster.c io_helper.c \
+ video_overlay.c osd.c spu.c scratch.c demux.c vo_scale.c \
+ xine_interface.c post.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
+ alphablend.c \
+ xine_private.h
-libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) \
- $(pthread_dep) $(LIBXINEPOSIX)
+libxine_la_DEPENDENCIES = $(XINEUTILS_LIB) $(YUV_LIB) $(XDG_BASEDIR_DEPS) \
+ $(pthread_dep) $(LIBXINEPOSIX) \
+ libxine-interface.la
+libxine_la_CFLAGS = $(AM_CFLAGS) -fno-strict-aliasing
libxine_la_LIBADD = $(PTHREAD_LIBS) $(DYNAMIC_LD_LIBS) $(LTLIBINTL) $(ZLIB_LIBS) \
- -lm $(XINEUTILS_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \
- $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS)
+ -lm $(XINEUTILS_LIB) $(YUV_LIB) $(LTLIBICONV) $(FT2_LIBS) $(FONTCONFIG_LIBS) \
+ $(LIBXINEPOSIX) $(RT_LIBS) $(NET_LIBS) $(XDG_BASEDIR_LIBS) \
+ $(AVUTIL_LIBS)
-libxine_la_LDFLAGS = \
- -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE) \
- $(def_ldflags)
+libxine_la_LDFLAGS = $(AM_LDFLAGS) $(def_ldflags) $(GCSECTIONS) \
+ -weak libxine-interface.la \
+ -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE)
+libxine_interface_la_SOURCES =
-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
+libxine_interface_la_LDFLAGS = $(AM_LDFLAGS) $(def_ldflags) \
+ -version-info $(XINE_LT_CURRENT):$(XINE_LT_REVISION):$(XINE_LT_AGE)
-noinst_HEADERS = bswap.h ffmpeg_bswap.h xine_private.h
+# Yes, we need to install this.
+install-exec-hook: libxine-interface.la
+ $(INSTALL_DATA) libxine-interface.la "$(DESTDIR)$(libdir)"/libxine-interface.la
+
+clean-local:
+ rm -f libxine-interface.la
+
+$(XINEUTILS_LIB):
+ $(MAKE) -C $(top_builddir)/src/xine-utils libxineutils.la
+
+$(YUV_LIB):
+ $(MAKE) -C $(top_builddir)/src/video_out libyuv2rgb.la
if WIN32
install-exec-local:
cp -p $(DEF_FILE) $(DESTDIR)$(libdir)
-
-uninstall-local:
- rm -f $(DEF_FILE)
endif
-$(XINEUTILS_LIB):
- $(MAKE) -C $(top_builddir)/src/xine-utils libxineutils.la
+uninstall-local:
+ rm -f $(DEF_FILE) "$(DESTDIR)$(libdir)"/libxine-interface.la
diff --git a/src/xine-engine/accel_vdpau.h b/src/xine-engine/accel_vdpau.h
new file mode 100644
index 000000000..6f9590114
--- /dev/null
+++ b/src/xine-engine/accel_vdpau.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2008 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, USA
+ *
+ *
+ * Common acceleration definitions for vdpau
+ *
+ *
+ */
+
+#ifndef HAVE_XINE_ACCEL_VDPAU_H
+#define HAVE_XINE_ACCEL_VDPAU_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <vdpau/vdpau.h>
+
+
+typedef struct {
+ vo_frame_t *vo_frame;
+
+ VdpDevice vdp_device;
+
+ VdpGetErrorString *vdp_get_error_string;
+ VdpDecoderCreate *vdp_decoder_create;
+ VdpDecoderDestroy *vdp_decoder_destroy;
+ VdpDecoderRender *vdp_decoder_render;
+
+ VdpVideoSurface surface;
+ VdpChromaType chroma;
+
+ VdpColorStandard color_standard;
+
+ int vdp_runtime_nr; /* this is used to keep in sync on preemptions */
+ int *current_vdp_runtime_nr;
+
+} vdpau_accel_t;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/src/xine-engine/accel_xvmc.h b/src/xine-engine/accel_xvmc.h
index 197b76050..f7deeeb52 100644
--- a/src/xine-engine/accel_xvmc.h
+++ b/src/xine-engine/accel_xvmc.h
@@ -65,6 +65,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],
@@ -74,6 +75,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 {
/*
@@ -108,6 +112,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 4727740bd..15fc538ab 100644
--- a/src/xine-engine/alphablend.c
+++ b/src/xine-engine/alphablend.c
@@ -36,9 +36,9 @@
#include <stdlib.h>
#include <stdio.h>
-#include "xine_internal.h"
-#include "video_out.h"
-#include "alphablend.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/alphablend.h>
#include "bswap.h"
diff --git a/src/xine-engine/alphablend.h b/src/xine-engine/alphablend.h
deleted file mode 100644
index 86cc68302..000000000
--- a/src/xine-engine/alphablend.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *
- * Copyright (C) 2000 Thomas Mirlacher
- *
- * 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, USA.
- *
- * The author may be reached as <dent@linuxvideo.org>
- *
- *------------------------------------------------------------
- *
- */
-
-#ifndef __ALPHABLEND_H__
-#define __ALPHABLEND_H__
-
-#include "video_out.h"
-
-typedef struct {
- void *buffer;
- int buffer_size;
-
- int disable_exact_blending;
-
- int offset_x, offset_y;
-} alphablend_t;
-
-void _x_alphablend_init(alphablend_t *extra_data, xine_t *xine) XINE_PROTECTED;
-void _x_alphablend_free(alphablend_t *extra_data) XINE_PROTECTED;
-
-#if !SUPPORT_ATTRIBUTE_PACKED
-#pragma pack(8)
-#endif
-
-typedef struct { /* CLUT == Color LookUp Table */
- uint8_t cb;
- uint8_t cr;
- uint8_t y;
- uint8_t foo;
-} XINE_PACKED clut_t;
-
-
-#if !SUPPORT_ATTRIBUTE_PACKED
-#pragma pack()
-#endif
-
-#define XX44_PALETTE_SIZE 32
-
-typedef struct {
- unsigned size;
- unsigned max_used;
- uint32_t cluts[XX44_PALETTE_SIZE];
- /* cache palette entries for both colors and hili_colors */
- int lookup_cache[OVL_PALETTE_SIZE*2];
-} xx44_palette_t;
-
-
-void _x_blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl,
- int img_width, int img_height,
- int dst_width, int dst_height,
- alphablend_t *extra_data) XINE_PROTECTED;
-
-void _x_blend_rgb24 (uint8_t * img, vo_overlay_t * img_overl,
- int img_width, int img_height,
- int dst_width, int dst_height,
- alphablend_t *extra_data) XINE_PROTECTED;
-
-void _x_blend_rgb32 (uint8_t * img, vo_overlay_t * img_overl,
- int img_width, int img_height,
- int dst_width, int dst_height,
- alphablend_t *extra_data) XINE_PROTECTED;
-
-void _x_blend_yuv (uint8_t *dst_base[3], vo_overlay_t * img_overl,
- int dst_width, int dst_height, int dst_pitches[3],
- alphablend_t *extra_data) XINE_PROTECTED;
-
-void _x_blend_yuy2 (uint8_t * dst_img, vo_overlay_t * img_overl,
- int dst_width, int dst_height, int dst_pitch,
- alphablend_t *extra_data) XINE_PROTECTED;
-
-/*
- * This function isn't too smart about blending. We want to avoid creating new
- * colors in the palette as a result from two non-zero colors needed to be
- * blended. Instead we choose the color with the highest alpha value to be
- * visible. Some parts of the code taken from the "VeXP" project.
- */
-
-void _x_blend_xx44 (uint8_t *dst_img, vo_overlay_t *img_overl,
- int dst_width, int dst_height, int dst_pitch,
- alphablend_t *extra_data,
- xx44_palette_t *palette,int ia44) XINE_PROTECTED;
-
-/*
- * Functions to handle the xine-specific palette.
- */
-
-void _x_clear_xx44_palette(xx44_palette_t *p) XINE_PROTECTED;
-void _x_init_xx44_palette(xx44_palette_t *p, unsigned num_entries) XINE_PROTECTED;
-void _x_dispose_xx44_palette(xx44_palette_t *p) XINE_PROTECTED;
-
-/*
- * Convert the xine-specific palette to something useful.
- */
-
-void _x_xx44_to_xvmc_palette(const xx44_palette_t *p,unsigned char *xvmc_palette,
- unsigned first_xx44_entry, unsigned num_xx44_entries,
- unsigned num_xvmc_components, char *xvmc_components) XINE_PROTECTED;
-
-
-#endif
diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c
index 10c20f231..39604ee9b 100644
--- a/src/xine-engine/audio_decoder.c
+++ b/src/xine-engine/audio_decoder.c
@@ -39,8 +39,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include "xine_private.h"
static void *audio_decoder_loop (void *stream_gen) {
diff --git a/src/xine-engine/audio_decoder.h b/src/xine-engine/audio_decoder.h
deleted file mode 100644
index 9f695685f..000000000
--- a/src/xine-engine/audio_decoder.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * xine audio decoder plugin interface
- */
-
-#ifndef HAVE_AUDIO_DECODER_H
-#define HAVE_AUDIO_DECODER_H
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-# include "buffer.h"
-#else
-# include <xine/os_types.h>
-# include <xine/buffer.h>
-#endif
-
-#define AUDIO_DECODER_IFACE_VERSION 15
-
-/*
- * generic xine audio decoder plugin interface
- */
-
-typedef struct audio_decoder_class_s audio_decoder_class_t;
-typedef struct audio_decoder_s audio_decoder_t;
-
-struct audio_decoder_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- audio_decoder_t* (*open_plugin) (audio_decoder_class_t *this, xine_stream_t *stream);
-
- /*
- * return short, human readable identifier for this plugin class
- */
- char* (*get_identifier) (audio_decoder_class_t *this);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- char* (*get_description) (audio_decoder_class_t *this);
-
- /*
- * free all class-related resources
- */
-
- void (*dispose) (audio_decoder_class_t *this);
-};
-
-
-struct audio_decoder_s {
-
- /*
- * decode data from buf and feed decoded samples to
- * audio output
- */
- void (*decode_data) (audio_decoder_t *this, buf_element_t *buf);
-
- /*
- * reset decoder after engine flush (prepare for new
- * audio data not related to recently decoded data)
- */
- void (*reset) (audio_decoder_t *this);
-
- /*
- * inform decoder that a time reference discontinuity has happened.
- * that is, it must forget any currently held pts value
- */
- void (*discontinuity) (audio_decoder_t *this);
-
- /*
- * close down, free all resources
- */
- void (*dispose) (audio_decoder_t *this);
-
- void *node; /* used by plugin loader */
-
-};
-
-#endif
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index b9738595b..4b2398bef 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -16,14 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * 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
*/
-/*
+/**
+ * @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>
+ *
+ *
* General Programming Guidelines: -
* New concept of an "audio_frame".
* An audio_frame consists of all the samples required to fill every
@@ -85,11 +89,11 @@
#define LOG_RESAMPLE_SYNC 0
-#include "xine_internal.h"
-#include "xineutils.h"
-#include "audio_out.h"
-#include "resample.h"
-#include "metronom.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include <xine/audio_out.h>
+#include <xine/resample.h>
+#include <xine/metronom.h>
#define NUM_AUDIO_BUFFERS 32
@@ -287,6 +291,7 @@ struct audio_fifo_s {
pthread_cond_t empty;
int num_buffers;
+ int num_buffers_max;
};
static int ao_get_property (xine_audio_port_t *this_gen, int property);
@@ -301,9 +306,10 @@ static audio_fifo_t *XINE_MALLOC fifo_new (xine_t *xine) {
if (!fifo)
return NULL;
- fifo->first = NULL;
- fifo->last = NULL;
- fifo->num_buffers = 0;
+ fifo->first = NULL;
+ fifo->last = NULL;
+ fifo->num_buffers = 0;
+ fifo->num_buffers_max = 0;
pthread_mutex_init (&fifo->mutex, NULL);
pthread_cond_init (&fifo->not_empty, NULL);
pthread_cond_init (&fifo->empty, NULL);
@@ -330,6 +336,10 @@ static void fifo_append_int (audio_fifo_t *fifo,
fifo->num_buffers++;
}
+
+ if (fifo->num_buffers_max < fifo->num_buffers)
+ fifo->num_buffers_max = fifo->num_buffers;
+
pthread_cond_signal (&fifo->not_empty);
}
@@ -589,18 +599,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;
+ int i;
+ const int total_frames = num_frames * _x_ao_mode2channels (this->input.mode);
- num_channels = _x_ao_mode2channels (this->input.mode);
- if (!num_channels)
+ 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;
}
@@ -608,7 +616,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) {
@@ -625,7 +633,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) {
@@ -1777,6 +1785,14 @@ static int ao_get_property (xine_audio_port_t *this_gen, int property) {
ret = this->audio_loop_running ? this->out_fifo->num_buffers : -1;
break;
+ case AO_PROP_BUFS_FREE:
+ ret = this->audio_loop_running ? this->free_fifo->num_buffers : -1;
+ break;
+
+ case AO_PROP_BUFS_TOTAL:
+ ret = this->audio_loop_running ? this->free_fifo->num_buffers_max : -1;
+ break;
+
case AO_PROP_NUM_STREAMS:
pthread_mutex_lock(&this->streams_lock);
ret = xine_list_size(this->streams);
@@ -2077,8 +2093,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver,
int i, err;
pthread_attr_t pth_attrs;
pthread_mutexattr_t attr;
- static const char* resample_modes[] = {"auto", "off", "on", NULL};
- static const char* av_sync_methods[] = {"metronom feedback", "resample", NULL};
+ static const char *const resample_modes[] = {"auto", "off", "on", NULL};
+ static const char *const av_sync_methods[] = {"metronom feedback", "resample", NULL};
this = calloc(1, sizeof(aos_t)) ;
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
deleted file mode 100644
index 832c65a9e..000000000
--- a/src/xine-engine/audio_out.h
+++ /dev/null
@@ -1,343 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-#ifndef HAVE_AUDIO_OUT_H
-#define HAVE_AUDIO_OUT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(XINE_COMPILE)
-#include <inttypes.h>
-#include "metronom.h"
-#include "configfile.h"
-#include "xineutils.h"
-#else
-#include <xine/os_types.h>
-#include <xine/metronom.h>
-#include <xine/configfile.h>
-#include <xine/xineutils.h>
-#endif
-
-
-#define AUDIO_OUT_IFACE_VERSION 8
-
-/*
- * ao_driver_s contains the driver every audio output
- * driver plugin has to implement.
- */
-
-typedef struct ao_driver_s ao_driver_t;
-
-struct ao_driver_s {
-
- /*
- *
- * find out what output modes + capatilities are supported by
- * this plugin (constants for the bit vector to return see above)
- *
- * See AO_CAP_* bellow.
- */
- uint32_t (*get_capabilities) (ao_driver_t *);
-
- /*
- * open the driver and make it ready to receive audio data
- * buffers may be flushed(!)
- *
- * return value: 0 : failure, >0 : output sample rate
- */
- int (*open)(ao_driver_t *, uint32_t bits, uint32_t rate, int mode);
-
- /* return the number of audio channels
- */
- int (*num_channels)(ao_driver_t *self_gen);
-
- /* return the number of bytes per frame.
- * A frame is equivalent to one sample being output on every audio channel.
- */
- int (*bytes_per_frame)(ao_driver_t *self_gen);
-
- /* return the delay is frames measured by
- * looking at pending samples in the audio output device
- */
- int (*delay)(ao_driver_t *self_gen);
-
- /*
- * return gap tolerance (in pts) needed for this driver
- */
- int (*get_gap_tolerance) (ao_driver_t *self_gen);
-
- /*
- * write audio data to audio output device
- * return value:
- * >0 => audio samples were processed ok
- * 0 => audio samples were not yet processed,
- * call write_audio_data with the _same_ samples again
- */
- int (*write)(ao_driver_t *,
- int16_t* audio_data, uint32_t num_samples);
-
- /*
- * this is called when the decoder no longer uses the audio
- * output driver - the driver should get ready to get opened() again
- */
- void (*close)(ao_driver_t *);
-
- /*
- * shut down this audio output driver plugin and
- * free all resources allocated
- */
- void (*exit) (ao_driver_t *);
-
- /*
- * Get, Set a property of audio driver.
- *
- * get_property() return 1 in success, 0 on failure.
- * set_property() return value on success, ~value on failure.
- *
- * See AO_PROP_* below for available properties.
- */
- int (*get_property) (ao_driver_t *, int property);
-
- int (*set_property) (ao_driver_t *, int property, int value);
-
-
- /*
- * misc control operations on the audio device.
- *
- * See AO_CTRL_* below.
- */
- int (*control) (ao_driver_t *, int cmd, /* arg */ ...);
-
- void *node;
-};
-
-typedef struct ao_format_s ao_format_t;
-
-struct ao_format_s {
- uint32_t bits;
- uint32_t rate;
- int mode;
-};
-
-typedef struct audio_fifo_s audio_fifo_t;
-
-typedef struct audio_buffer_s audio_buffer_t;
-
-struct audio_buffer_s {
-
- audio_buffer_t *next;
-
- int16_t *mem;
- int mem_size;
- int num_frames;
-
- int64_t vpts;
- uint32_t frame_header_count;
- uint32_t first_access_unit;
-
- /* extra info coming from input or demuxers */
- extra_info_t *extra_info;
-
- xine_stream_t *stream; /* stream that send that buffer */
-
- ao_format_t format; /* let each buffer carry it's own format info */
-};
-
-/*
- * xine_audio_port_s contains the port every audio decoder talks to
- *
- * Remember that adding new functions to this structure requires
- * adaption of the post plugin decoration layer. Be sure to look into
- * src/xine-engine/post.[ch].
- */
-
-struct xine_audio_port_s {
- uint32_t (*get_capabilities) (xine_audio_port_t *); /* for constants see below */
-
- /* * Get/Set audio property
- *
- * See AO_PROP_* bellow
- */
- int (*get_property) (xine_audio_port_t *, int property);
- int (*set_property) (xine_audio_port_t *, int property, int value);
-
- /* open audio driver for audio output
- * return value: 0:failure, >0:output sample rate
- */
- /* when you are not a full-blown stream, but still need to open the port
- * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
- int (*open) (xine_audio_port_t *, xine_stream_t *stream,
- uint32_t bits, uint32_t rate, int mode);
-
- /*
- * get a piece of memory for audio data
- */
- audio_buffer_t * (*get_buffer) (xine_audio_port_t *);
-
- /*
- * append a buffer filled with audio data to the audio fifo
- * for output
- */
- /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */
- void (*put_buffer) (xine_audio_port_t *, audio_buffer_t *buf, xine_stream_t *stream);
-
- /* audio driver is no longer used by decoder => close */
- /* when you are not a full-blown stream, but still need to close the port
- * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
- void (*close) (xine_audio_port_t *self, xine_stream_t *stream);
-
- /* called on xine exit */
- void (*exit) (xine_audio_port_t *);
-
- /*
- * misc control operations on the audio device.
- *
- * See AO_CTRL_* below.
- */
- int (*control) (xine_audio_port_t *, int cmd, /* arg */ ...);
-
- /*
- * Flush audio_out fifo.
- */
- void (*flush) (xine_audio_port_t *);
-
- /*
- * Check if port is opened for this stream and get parameters.
- * The stream can be anonymous.
- */
- int (*status) (xine_audio_port_t *, xine_stream_t *stream,
- uint32_t *bits, uint32_t *rate, int *mode);
-
-};
-
-typedef struct audio_driver_class_s audio_driver_class_t;
-
-struct audio_driver_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- ao_driver_t* (*open_plugin) (audio_driver_class_t *, const void *data);
-
- /*
- * return short, human readable identifier for this plugin class
- */
- char* (*get_identifier) (audio_driver_class_t *);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- char* (*get_description) (audio_driver_class_t *);
-
- /*
- * free all class-related resources
- */
-
- void (*dispose) (audio_driver_class_t *);
-};
-
-/*
- * this initiates the audio_out sync routines
- * found in ./src/xine-engine/audio_out.c
- */
-xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, int grab_only) XINE_MALLOC XINE_PROTECTED;
-
-/*
- * audio output modes + capabilities
- */
-
-#define AO_CAP_NOCAP 0x00000000 /* driver has no capabilities */
-#define AO_CAP_MODE_A52 0x00000001 /* driver supports A/52 output */
-#define AO_CAP_MODE_AC5 0x00000002 /* driver supports AC5 output */
-/* 1 sample == 2 bytes (C) */
-#define AO_CAP_MODE_MONO 0x00000004 /* driver supports mono output */
-/* 1 sample == 4 bytes (L,R) */
-#define AO_CAP_MODE_STEREO 0x00000008 /* driver supports stereo output */
-/* 1 sample == 8 bytes (L,R,LR,RR) */
-#define AO_CAP_MODE_4CHANNEL 0x00000010 /* driver supports 4 channels */
-/*
- * Sound cards generally support, 1,2,4,6 channels, but rarely 5.
- * So xine will take 4.1, 5 and 6 channel a52 streams and
- * down or upmix it correctly to fill the 6 output channels.
- * Are there any requests for 2.1 out there?
- */
-/* 1 sample == 12 bytes (L,R,LR,RR,Null,LFE) */
-#define AO_CAP_MODE_4_1CHANNEL 0x00000020 /* driver supports 4.1 channels */
-/* 1 sample == 12 bytes (L,R,LR,RR,C, Null) */
-#define AO_CAP_MODE_5CHANNEL 0x00000040 /* driver supports 5 channels */
-/* 1 sample == 12 bytes (L,R,LR,RR,C,LFE) */
-#define AO_CAP_MODE_5_1CHANNEL 0x00000080 /* driver supports 5.1 channels */
-
-/*
- * converts the audio output mode into the number of channels
- */
-int _x_ao_mode2channels( int mode ) XINE_PROTECTED;
-/*
- * converts the number of channels into the audio output mode
- */
-int _x_ao_channels2mode( int channels ) XINE_PROTECTED;
-
-#define AO_CAP_MIXER_VOL 0x00000100 /* driver supports mixer control */
-#define AO_CAP_PCM_VOL 0x00000200 /* driver supports pcm control */
-#define AO_CAP_MUTE_VOL 0x00000400 /* driver can mute volume */
-#define AO_CAP_8BITS 0x00000800 /* driver support 8-bit samples */
-#define AO_CAP_16BITS 0x00001000 /* driver support 16-bit samples */
-#define AO_CAP_24BITS 0x00002000 /* driver support 24-bit samples */
-#define AO_CAP_FLOAT32 0x00004000 /* driver support 32-bit samples. i.e. Floats */
-
-/* properties supported by get/set_property() */
-#define AO_PROP_MIXER_VOL 0
-#define AO_PROP_PCM_VOL 1
-#define AO_PROP_MUTE_VOL 2
-#define AO_PROP_COMPRESSOR 3
-#define AO_PROP_DISCARD_BUFFERS 4
-#define AO_PROP_BUFS_IN_FIFO 5 /* read-only */
-#define AO_PROP_AMP 6 /* amplifier */
-#define AO_PROP_EQ_30HZ 7 /* equalizer */
-#define AO_PROP_EQ_60HZ 8 /* equalizer */
-#define AO_PROP_EQ_125HZ 9 /* equalizer */
-#define AO_PROP_EQ_250HZ 10 /* equalizer */
-#define AO_PROP_EQ_500HZ 11 /* equalizer */
-#define AO_PROP_EQ_1000HZ 12 /* equalizer */
-#define AO_PROP_EQ_2000HZ 13 /* equalizer */
-#define AO_PROP_EQ_4000HZ 14 /* equalizer */
-#define AO_PROP_EQ_8000HZ 15 /* equalizer */
-#define AO_PROP_EQ_16000HZ 16 /* equalizer */
-#define AO_PROP_CLOSE_DEVICE 17 /* force closing audio device */
-#define AO_PROP_AMP_MUTE 18 /* amplifier mute */
-#define AO_PROP_NUM_STREAMS 19 /* read-only */
-#define AO_PROP_CLOCK_SPEED 20 /* inform audio_out that speed has changed */
-#define AO_NUM_PROPERTIES 21
-
-/* audio device control ops */
-#define AO_CTRL_PLAY_PAUSE 0
-#define AO_CTRL_PLAY_RESUME 1
-#define AO_CTRL_FLUSH_BUFFERS 2
-
-/* above that value audio frames are discarded */
-#define AO_MAX_GAP 15000
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c
index 435ec2df6..0c2f2d4b2 100644
--- a/src/xine-engine/broadcaster.c
+++ b/src/xine-engine/broadcaster.c
@@ -61,9 +61,9 @@
#include <dlfcn.h>
#include <pthread.h>
-#include "xine_internal.h"
-#include "buffer.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
#include "xine_private.h"
#define QLEN 5 /* maximum connection queue length */
@@ -113,9 +113,10 @@ static int sock_check_opened(int socket) {
/*
* Write to socket.
*/
-static int sock_data_write(xine_t *xine, int socket, char *buf, int len) {
+static int sock_data_write(xine_t *xine, int socket, void *buf_gen, int len) {
ssize_t size;
int wlen = 0;
+ uint8_t *buf = buf_gen;
if((socket < 0) || (buf == NULL))
return -1;
@@ -140,7 +141,7 @@ static int sock_data_write(xine_t *xine, int socket, char *buf, int len) {
}
static int XINE_FORMAT_PRINTF(3, 4)
-sock_string_write(xine_t *xine, int socket, char *msg, ...) {
+sock_string_write(xine_t *xine, int socket, const char *msg, ...) {
char buf[_BUFSIZ];
va_list args;
@@ -159,7 +160,7 @@ sock_string_write(xine_t *xine, int socket, char *msg, ...) {
* this is the most important broadcaster function.
* it sends data to every connected client (slaves).
*/
-static void broadcaster_data_write(broadcaster_t *this, char *buf, int len) {
+static void broadcaster_data_write(broadcaster_t *this, void *buf, int len) {
xine_list_iterator_t ite;
ite = xine_list_front (this->connections);
@@ -182,7 +183,7 @@ static void broadcaster_data_write(broadcaster_t *this, char *buf, int len) {
}
static void XINE_FORMAT_PRINTF(2, 3)
-broadcaster_string_write(broadcaster_t *this, char *msg, ...) {
+broadcaster_string_write(broadcaster_t *this, const char *msg, ...) {
char buf[_BUFSIZ];
va_list args;
@@ -254,7 +255,7 @@ static void *manager_loop (void *this_gen) {
/*
* receive xine buffers and send them through the broadcaster
*/
-static void send_buf (broadcaster_t *this, char *from, buf_element_t *buf) {
+static void send_buf (broadcaster_t *this, const char *from, buf_element_t *buf) {
int i;
/* ignore END buffers since they would stop the slavery */
diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c
index 77c0abc9d..50ffb57cd 100644
--- a/src/xine-engine/buffer.c
+++ b/src/xine-engine/buffer.c
@@ -36,6 +36,12 @@
#include <stdlib.h>
#include <assert.h>
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <mem.h>
+#else
+# include <libavutil/mem.h>
+#endif
+
/********** logging **********/
#define LOG_MODULE "buffer"
#define LOG_VERBOSE
@@ -43,9 +49,9 @@
#define LOG
*/
-#include "buffer.h"
-#include "xineutils.h"
-#include "xine_internal.h"
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include <xine/xine_internal.h>
/*
* put a previously allocated buffer element back into the buffer pool
@@ -358,7 +364,7 @@ static void fifo_buffer_dispose (fifo_buffer_t *this) {
received++;
}
- free (this->buffer_pool_base);
+ av_free (this->buffer_pool_base);
pthread_mutex_destroy(&this->mutex);
pthread_cond_destroy(&this->not_empty);
pthread_mutex_destroy(&this->buffer_pool_mutex);
@@ -497,7 +503,6 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) {
fifo_buffer_t *this;
int i;
- int alignment = 2048;
unsigned char *multi_buffer = NULL;
this = calloc(1, sizeof(fifo_buffer_t));
@@ -527,15 +532,11 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) {
*/
- if (buf_size % alignment != 0)
- buf_size += alignment - (buf_size % alignment);
-
/*
- printf ("Allocating %d buffers of %ld bytes in one chunk (alignment = %d)\n",
- num_buffers, (long int) buf_size, alignment);
+ printf ("Allocating %d buffers of %ld bytes in one chunk\n",
+ num_buffers, (long int) buf_size);
*/
- multi_buffer = xine_xmalloc_aligned (alignment, num_buffers * buf_size,
- &this->buffer_pool_base);
+ multi_buffer = this->buffer_pool_base = av_mallocz (num_buffers * buf_size);
this->buffer_pool_top = NULL;
diff --git a/src/xine-engine/buffer.h b/src/xine-engine/buffer.h
deleted file mode 100644
index 2c13919b8..000000000
--- a/src/xine-engine/buffer.h
+++ /dev/null
@@ -1,698 +0,0 @@
-/*
- * Copyright (C) 2000-2008 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, USA
- *
- *
- * contents:
- *
- * buffer_entry structure - serves as a transport encapsulation
- * of the mpeg audio/video data through xine
- *
- * free buffer pool management routines
- *
- * FIFO buffer structures/routines
- */
-
-#ifndef HAVE_BUFFER_H
-#define HAVE_BUFFER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <string.h>
-#include <stdio.h>
-#include <pthread.h>
-#include <sys/types.h>
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-# include "attributes.h"
-#else
-# include <xine/os_types.h>
-# include <xine/attributes.h>
-#endif
-
-#define BUF_MAX_CALLBACKS 5
-
-/*
- * buffer types
- *
- * a buffer type ID describes the contents of a buffer
- * it consists of three fields:
- *
- * buf_type = 0xMMDDCCCC
- *
- * MM : major buffer type (CONTROL, VIDEO, AUDIO, SPU)
- * 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 */
-
-#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_NOP 0x01040000
-#define BUF_CONTROL_AUDIO_CHANNEL 0x01050000
-#define BUF_CONTROL_SPU_CHANNEL 0x01060000
-#define BUF_CONTROL_NEWPTS 0x01070000
-#define BUF_CONTROL_RESET_DECODER 0x01080000
-#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) */
-
-#define BUF_VIDEO_BASE 0x02000000
-#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
-#define BUF_VIDEO_SORENSON_V1 0x02030000
-#define BUF_VIDEO_MSMPEG4_V2 0x02040000
-#define BUF_VIDEO_MSMPEG4_V3 0x02050000
-#define BUF_VIDEO_MJPEG 0x02060000
-#define BUF_VIDEO_IV50 0x02070000
-#define BUF_VIDEO_IV41 0x02080000
-#define BUF_VIDEO_IV32 0x02090000
-#define BUF_VIDEO_IV31 0x020a0000
-#define BUF_VIDEO_ATIVCR1 0x020b0000
-#define BUF_VIDEO_ATIVCR2 0x020c0000
-#define BUF_VIDEO_I263 0x020d0000
-#define BUF_VIDEO_RV10 0x020e0000
-#define BUF_VIDEO_RGB 0x02100000
-#define BUF_VIDEO_YUY2 0x02110000
-#define BUF_VIDEO_JPEG 0x02120000
-#define BUF_VIDEO_WMV7 0x02130000
-#define BUF_VIDEO_WMV8 0x02140000
-#define BUF_VIDEO_MSVC 0x02150000
-#define BUF_VIDEO_DV 0x02160000
-#define BUF_VIDEO_REAL 0x02170000
-#define BUF_VIDEO_VP31 0x02180000
-#define BUF_VIDEO_H263 0x02190000
-#define BUF_VIDEO_3IVX 0x021A0000
-#define BUF_VIDEO_CYUV 0x021B0000
-#define BUF_VIDEO_DIVX5 0x021C0000
-#define BUF_VIDEO_XVID 0x021D0000
-#define BUF_VIDEO_SMC 0x021E0000
-#define BUF_VIDEO_RPZA 0x021F0000
-#define BUF_VIDEO_QTRLE 0x02200000
-#define BUF_VIDEO_MSRLE 0x02210000
-#define BUF_VIDEO_DUCKTM1 0x02220000
-#define BUF_VIDEO_FLI 0x02230000
-#define BUF_VIDEO_ROQ 0x02240000
-#define BUF_VIDEO_SORENSON_V3 0x02250000
-#define BUF_VIDEO_MSMPEG4_V1 0x02260000
-#define BUF_VIDEO_MSS1 0x02270000
-#define BUF_VIDEO_IDCIN 0x02280000
-#define BUF_VIDEO_PGVV 0x02290000
-#define BUF_VIDEO_ZYGO 0x022A0000
-#define BUF_VIDEO_TSCC 0x022B0000
-#define BUF_VIDEO_YVU9 0x022C0000
-#define BUF_VIDEO_VQA 0x022D0000
-#define BUF_VIDEO_GREY 0x022E0000
-#define BUF_VIDEO_XXAN 0x022F0000
-#define BUF_VIDEO_WC3 0x02300000
-#define BUF_VIDEO_YV12 0x02310000
-#define BUF_VIDEO_SEGA 0x02320000
-#define BUF_VIDEO_RV20 0x02330000
-#define BUF_VIDEO_RV30 0x02340000
-#define BUF_VIDEO_MVI2 0x02350000
-#define BUF_VIDEO_UCOD 0x02360000
-#define BUF_VIDEO_WMV9 0x02370000
-#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_HUFFYUV 0x023C0000
-#define BUF_VIDEO_IMAGE 0x023D0000
-#define BUF_VIDEO_THEORA 0x023E0000
-#define BUF_VIDEO_4XM 0x023F0000
-#define BUF_VIDEO_I420 0x02400000
-#define BUF_VIDEO_VP4 0x02410000
-#define BUF_VIDEO_VP5 0x02420000
-#define BUF_VIDEO_VP6 0x02430000
-#define BUF_VIDEO_VMD 0x02440000
-#define BUF_VIDEO_MSZH 0x02450000
-#define BUF_VIDEO_ZLIB 0x02460000
-#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_FLV1 0x024C0000
-#define BUF_VIDEO_H264 0x024D0000
-#define BUF_VIDEO_MJPEG_B 0x024E0000
-#define BUF_VIDEO_H261 0x024F0000
-#define BUF_VIDEO_AASC 0x02500000
-#define BUF_VIDEO_LOCO 0x02510000
-#define BUF_VIDEO_QDRW 0x02520000
-#define BUF_VIDEO_QPEG 0x02530000
-#define BUF_VIDEO_ULTI 0x02540000
-#define BUF_VIDEO_WNV1 0x02550000
-#define BUF_VIDEO_XL 0x02560000
-#define BUF_VIDEO_RT21 0x02570000
-#define BUF_VIDEO_FPS1 0x02580000
-#define BUF_VIDEO_DUCKTM2 0x02590000
-#define BUF_VIDEO_CSCD 0x025A0000
-#define BUF_VIDEO_ALGMM 0x025B0000
-#define BUF_VIDEO_ZMBV 0x025C0000
-#define BUF_VIDEO_AVS 0x025D0000
-#define BUF_VIDEO_SMACKER 0x025E0000
-#define BUF_VIDEO_NUV 0x025F0000
-#define BUF_VIDEO_KMVC 0x02600000
-#define BUF_VIDEO_FLASHSV 0x02610000
-#define BUF_VIDEO_CAVS 0x02620000
-#define BUF_VIDEO_VP6F 0x02630000
-#define BUF_VIDEO_THEORA_RAW 0x02640000
-#define BUF_VIDEO_VC1 0x02650000
-#define BUF_VIDEO_VMNC 0x02660000
-#define BUF_VIDEO_SNOW 0x02670000
-#define BUF_VIDEO_VP8 0x02680000
-
-/* audio buffer types: (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_A52 0x03000000
-#define BUF_AUDIO_MPEG 0x03010000
-#define BUF_AUDIO_LPCM_BE 0x03020000
-#define BUF_AUDIO_LPCM_LE 0x03030000
-#define BUF_AUDIO_WMAV1 0x03040000
-#define BUF_AUDIO_DTS 0x03050000
-#define BUF_AUDIO_MSADPCM 0x03060000
-#define BUF_AUDIO_MSIMAADPCM 0x03070000
-#define BUF_AUDIO_MSGSM 0x03080000
-#define BUF_AUDIO_VORBIS 0x03090000
-#define BUF_AUDIO_IMC 0x030a0000
-#define BUF_AUDIO_LH 0x030b0000
-#define BUF_AUDIO_VOXWARE 0x030c0000
-#define BUF_AUDIO_ACELPNET 0x030d0000
-#define BUF_AUDIO_AAC 0x030e0000
-#define BUF_AUDIO_DNET 0x030f0000
-#define BUF_AUDIO_VIVOG723 0x03100000
-#define BUF_AUDIO_DK3ADPCM 0x03110000
-#define BUF_AUDIO_DK4ADPCM 0x03120000
-#define BUF_AUDIO_ROQ 0x03130000
-#define BUF_AUDIO_QTIMAADPCM 0x03140000
-#define BUF_AUDIO_MAC3 0x03150000
-#define BUF_AUDIO_MAC6 0x03160000
-#define BUF_AUDIO_QDESIGN1 0x03170000
-#define BUF_AUDIO_QDESIGN2 0x03180000
-#define BUF_AUDIO_QCLP 0x03190000
-#define BUF_AUDIO_SMJPEG_IMA 0x031A0000
-#define BUF_AUDIO_VQA_IMA 0x031B0000
-#define BUF_AUDIO_MULAW 0x031C0000
-#define BUF_AUDIO_ALAW 0x031D0000
-#define BUF_AUDIO_GSM610 0x031E0000
-#define BUF_AUDIO_EA_ADPCM 0x031F0000
-#define BUF_AUDIO_WMAV2 0x03200000
-#define BUF_AUDIO_COOK 0x03210000
-#define BUF_AUDIO_ATRK 0x03220000
-#define BUF_AUDIO_14_4 0x03230000
-#define BUF_AUDIO_28_8 0x03240000
-#define BUF_AUDIO_SIPRO 0x03250000
-#define BUF_AUDIO_WMAPRO 0x03260000
-#define BUF_AUDIO_WMAV3 BUF_AUDIO_WMAPRO
-#define BUF_AUDIO_INTERPLAY 0x03270000
-#define BUF_AUDIO_XA_ADPCM 0x03280000
-#define BUF_AUDIO_WESTWOOD 0x03290000
-#define BUF_AUDIO_DIALOGIC_IMA 0x032A0000
-#define BUF_AUDIO_NSF 0x032B0000
-#define BUF_AUDIO_FLAC 0x032C0000
-#define BUF_AUDIO_DV 0x032D0000
-#define BUF_AUDIO_WMAV 0x032E0000
-#define BUF_AUDIO_SPEEX 0x032F0000
-#define BUF_AUDIO_RAWPCM 0x03300000
-#define BUF_AUDIO_4X_ADPCM 0x03310000
-#define BUF_AUDIO_VMD 0x03320000
-#define BUF_AUDIO_XAN_DPCM 0x03330000
-#define BUF_AUDIO_ALAC 0x03340000
-#define BUF_AUDIO_MPC 0x03350000
-#define BUF_AUDIO_SHORTEN 0x03360000
-#define BUF_AUDIO_WESTWOOD_SND1 0x03370000
-#define BUF_AUDIO_WMALL 0x03380000
-#define BUF_AUDIO_TRUESPEECH 0x03390000
-#define BUF_AUDIO_TTA 0x033A0000
-#define BUF_AUDIO_SMACKER 0x033B0000
-#define BUF_AUDIO_FLVADPCM 0x033C0000
-#define BUF_AUDIO_WAVPACK 0x033D0000
-#define BUF_AUDIO_MP3ADU 0x033E0000
-#define BUF_AUDIO_AMR_NB 0x033F0000
-#define BUF_AUDIO_AMR_WB 0x03400000
-#define BUF_AUDIO_EAC3 0x03410000
-#define BUF_AUDIO_AAC_LATM 0x03420000
-
-/* spu buffer types: */
-
-#define BUF_SPU_BASE 0x04000000
-#define BUF_SPU_DVD 0x04000000
-#define BUF_SPU_TEXT 0x04010000
-#define BUF_SPU_CC 0x04020000
-#define BUF_SPU_DVB 0x04030000
-#define BUF_SPU_SVCD 0x04040000
-#define BUF_SPU_CVD 0x04050000
-#define BUF_SPU_OGM 0x04060000
-#define BUF_SPU_CMML 0x04070000
-#define BUF_SPU_HDMV 0x04080000
-
-/* 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.
- */
-
-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 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 */
-};
-
-
-#define BUF_NUM_DEC_INFO 5
-
-typedef struct buf_element_s buf_element_t;
-struct buf_element_s {
- buf_element_t *next;
-
- unsigned char *mem;
- 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 */
-
- extra_info_t *extra_info; /* extra info will be passed to frames */
-
- uint32_t decoder_flags; /* stuff like keyframe, is_header ... see below */
-
- /* additional decoder flags and other dec-spec. stuff */
- uint32_t decoder_info[BUF_NUM_DEC_INFO];
- /* 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 */
-
-} ;
-
-/* 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 */
-#define BUF_FLAG_FRAME_START 0x0002
-#define BUF_FLAG_FRAME_END 0x0004
-
-/* 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
- * 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 */
-#define BUF_FLAG_END_USER 0x0020
-
-/* set when stream finished naturaly */
-#define BUF_FLAG_END_STREAM 0x0040
-
-/* decoder_info[0] carries the frame step (1/90000). */
-#define BUF_FLAG_FRAMERATE 0x0080
-
-/* hint to metronom that seeking has occurred */
-#define BUF_FLAG_SEEK 0x0100
-
-/* special information inside, see below. */
-#define BUF_FLAG_SPECIAL 0x0200
-
-/* 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[2] carries denominator for display aspect ratio */
-#define BUF_FLAG_ASPECT 0x0800
-
-/* represent the state of gapless_switch at the time buf was enqueued */
-#define BUF_FLAG_GAPLESS_SW 0x1000
-
-/* Amount of audio padding added by encoder (mp3, aac). These empty
- * audio frames are causing a gap when switching between mp3 files.
- * decoder_info[1] carries amount of audio frames padded at the
- * beginning of the buffer
- * decoder_info[2] carries amount of audio frames padded at the end of
- * the buffer */
-#define BUF_FLAG_AUDIO_PADDING 0x2000
-
-/* 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
- * offers a way to communicate this or any other custom, format-specific
- * data to the decoder.
- *
- * The interface was designed in a way that did not require an API
- * version bump. To send a special buffer type, set a buffer's flags field
- * to BUF_FLAG_SPECIAL. Set the buffer's decoder_info[1] field to a
- * number according to one of the special buffer subtypes defined below.
- * The second and third decoder_info[] fields are defined according to
- * your buffer type's requirements.
- *
- * Finally, remember to set the buffer's size to 0. This way, if a special
- * buffer is sent to a decode that does not know how to handle it, the
- * 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
- * decoder_info_ptr[2] = pointer to palette table
- * This buffer type is used to provide a file- and decoder-independent
- * facility to transport RGB color palettes from demuxers to decoders.
- * A palette table is an array of palette_entry_t structures. A decoder
- * should not count on this array to exist for the duration of the
- * program's execution and should copy, manipulate, and store the palette
- * data privately if it needs the palette information.
- */
-#define BUF_SPECIAL_PALETTE 1
-
-
-/* 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
- * decoder_info[3] = stream scale prohibitions
- * This buffer is used to force mpeg decoders to use a certain aspect.
- * Currently xine-dvdnav uses this, because it has more accurate information
- * about the aspect from the dvd ifo-data.
- * The stream scale prohibitions are also delivered, with bit 0 meaning
- * "deny letterboxing" and bit 1 meaning "deny pan&scan"
- */
-#define BUF_SPECIAL_ASPECT 3
-
-/*
- * In a BUF_SPECIAL_DECODER_CONFIG buffer:
- * decoder_info[1] = BUF_SPECIAL_DECODER_CONFIG
- * decoder_info[2] = data size
- * decoder_info_ptr[2] = pointer to data
- * This buffer is used to pass config information from .mp4 files
- * (atom esds) to decoders. both mpeg4 and aac streams use that.
- */
-#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
- * four length bytes at the beginning
- * decoder_info_ptr[2] = pointer to ImageDescription atom, starting with
- * the codec fourcc
- * Some Quicktime decoders need information contained within the
- * ImageDescription atom inside a Quicktime file's stsd atom. This
- * special buffer carries the ImageDescription atom from the QT demuxer
- * to an A/V decoder.
- */
-#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
- * lpcm data encoded into mpeg2 streams have a format configuration
- * byte in every frame. this is used to detect the sample rate,
- * number of bits and channels.
- */
-#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
- * decoder_info_ptr[2] = pointer to charset encoding string
- * This is used mostly with subtitle buffers when encoding is
- * known at demuxer level (take precedence over xine config
- * settings such as subtitles.separate.src_encoding)
- */
-#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
- * decoder_info[3] =
- * This buffer is pass SPU subtypes from DVDs
- */
-#define BUF_SPECIAL_SPU_DVD_SUBTYPE 8
-
-
-#define SPU_DVD_SUBTYPE_CLUT 1
-#define SPU_DVD_SUBTYPE_PACKAGE 2
-#define SPU_DVD_SUBTYPE_VOBSUB_PACKAGE 3
-#define SPU_DVD_SUBTYPE_NAV 4
-
-/* 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
- * decoder_info[3] =
- *
- * This buffer is used to tell a DVBSUB decoder when the stream
- * changes. For more information on how to write a DVBSUB decoder,
- * see the comment at the top of src/demuxers/demux_ts.c
- **/
-#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
- * decoder_info_ptr[2] = pointer to the chunk table
- *
- * 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
-{
- char lang[4];
- long comp_page_id;
- long aux_page_id;
-} ;
-
-typedef struct palette_entry_s palette_entry_t;
-struct palette_entry_s
-{
- unsigned char r, g, b;
-} ;
-
-typedef struct fifo_buffer_s fifo_buffer_t;
-struct fifo_buffer_s
-{
- buf_element_t *first, *last;
-
- int fifo_size;
- uint32_t fifo_data_size;
- void *fifo_empty_cb_data;
-
- pthread_mutex_t mutex;
- pthread_cond_t not_empty;
-
- /*
- * functions to access this fifo:
- */
-
- void (*put) (fifo_buffer_t *fifo, buf_element_t *buf);
-
- buf_element_t *(*get) (fifo_buffer_t *fifo);
-
- void (*clear) (fifo_buffer_t *fifo) ;
-
- int (*size) (fifo_buffer_t *fifo);
-
- int (*num_free) (fifo_buffer_t *fifo);
-
- uint32_t (*data_size) (fifo_buffer_t *fifo);
-
- void (*dispose) (fifo_buffer_t *fifo);
-
- /*
- * alloc buffer for this fifo from global buf pool
- * you don't have to use this function to allocate a buffer,
- * an input plugin can decide to implement it's own
- * buffer allocation functions
- */
-
- buf_element_t *(*buffer_pool_alloc) (fifo_buffer_t *self);
-
-
- /*
- * special functions, not used by demuxers
- */
-
- /* the same as buffer_pool_alloc but may fail if none is available */
- buf_element_t *(*buffer_pool_try_alloc) (fifo_buffer_t *self);
-
- /* the same as put but insert at the head of the fifo */
- void (*insert) (fifo_buffer_t *fifo, buf_element_t *buf);
-
- /* callbacks */
- void (*register_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *), void *cb_data);
- void (*register_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data);
- void (*register_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *), void *cb_data);
- void (*unregister_alloc_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, void *));
- void (*unregister_put_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *));
- void (*unregister_get_cb) (fifo_buffer_t *fifo, void (*cb)(fifo_buffer_t *fifo, buf_element_t *buf, void *));
-
- /*
- * private variables for buffer pool management
- */
- buf_element_t *buffer_pool_top; /* a stack actually */
- pthread_mutex_t buffer_pool_mutex;
- pthread_cond_t buffer_pool_cond_not_empty;
- int buffer_pool_num_free;
- int buffer_pool_capacity;
- int buffer_pool_buf_size;
- void *buffer_pool_base; /*used to free mem chunk */
- void (*alloc_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, void *data_cb);
- void (*put_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb);
- void (*get_cb[BUF_MAX_CALLBACKS])(fifo_buffer_t *fifo, buf_element_t *buf, void *data_cb);
- void *alloc_cb_data[BUF_MAX_CALLBACKS];
- void *put_cb_data[BUF_MAX_CALLBACKS];
- 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
- */
-
-fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC XINE_PROTECTED;
-fifo_buffer_t *_x_dummy_fifo_buffer_new (int num_buffers, uint32_t buf_size) XINE_MALLOC XINE_PROTECTED;
-
-
-/* return BUF_VIDEO_xxx given the fourcc
- * fourcc_int must be read in machine endianness
- * 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 */
-const char * _x_buf_video_name( uint32_t buf_type ) XINE_PROTECTED;
-
-/* return BUF_AUDIO_xxx given the formattag */
-uint32_t _x_formattag_to_buf_audio( uint32_t formattag ) XINE_PROTECTED;
-
-/* return codec name given BUF_AUDIO_xxx */
-const char * _x_buf_audio_name( uint32_t buf_type ) XINE_PROTECTED;
-
-
-#ifndef SUPPORT_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.
- */
-typedef struct XINE_PACKED {
- int32_t biSize;
- int32_t biWidth;
- int32_t biHeight;
- int16_t biPlanes;
- int16_t biBitCount;
- uint32_t biCompression;
- int32_t biSizeImage;
- int32_t biXPelsPerMeter;
- int32_t biYPelsPerMeter;
- int32_t biClrUsed;
- int32_t biClrImportant;
-} xine_bmiheader;
-
-/* this is xine version of WAVEFORMATEX
- * (the same comments from xine_bmiheader)
- */
-typedef struct XINE_PACKED {
- int16_t wFormatTag;
- int16_t nChannels;
- int32_t nSamplesPerSec;
- int32_t nAvgBytesPerSec;
- int16_t nBlockAlign;
- int16_t wBitsPerSample;
- int16_t cbSize;
-} xine_waveformatex;
-#ifndef SUPPORT_ATTRIBUTE_PACKED
-#pragma pack()
-#endif
-
-/* convert xine_bmiheader struct from little endian */
-void _x_bmiheader_le2me( xine_bmiheader *bih ) XINE_PROTECTED;
-
-/* convert xine_waveformatex struct from little endian */
-void _x_waveformatex_le2me( xine_waveformatex *wavex ) XINE_PROTECTED;
-
-static __inline int _x_is_fourcc(const void *ptr, const void *tag) {
- return memcmp(ptr, tag, 4) == 0;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/xine-engine/buffer_types.c b/src/xine-engine/buffer_types.c
index 20b2d0754..31ee4443a 100644
--- a/src/xine-engine/buffer_types.c
+++ b/src/xine-engine/buffer_types.c
@@ -32,7 +32,9 @@
#include <string.h>
#include <stdlib.h>
#include <inttypes.h>
-#include "buffer.h"
+#include <xine/buffer.h>
+#include <xine/xineutils.h>
+#include <xine/xine_internal.h>
#include "bswap.h"
typedef struct video_db_s {
@@ -1274,6 +1276,43 @@ int i;
return "";
}
+
+static void code_to_text (char ascii[5], uint32_t code)
+{
+ int i;
+ for (i = 0; i < 4; ++i)
+ {
+ int byte = code & 0xFF;
+ ascii[i] = (byte < ' ') ? ' ' : (byte >= 0x7F) ? '.' : (char) byte;
+ code >>= 8;
+ }
+}
+
+void _x_report_video_fourcc (xine_t *xine, const char *module, uint32_t code)
+{
+ if (code)
+ {
+ char ascii[5];
+ code_to_text (ascii, code);
+ xprintf (xine, XINE_VERBOSITY_LOG,
+ _("%s: unknown video FourCC code %#x \"%s\"\n"),
+ module, code, ascii);
+ }
+}
+
+void _x_report_audio_format_tag (xine_t *xine, const char *module, uint32_t code)
+{
+ if (code)
+ {
+ char ascii[5];
+ code_to_text (ascii, code);
+ xprintf (xine, XINE_VERBOSITY_LOG,
+ _("%s: unknown audio format tag code %#x \"%s\"\n"),
+ module, code, ascii);
+ }
+}
+
+
void _x_bmiheader_le2me( xine_bmiheader *bih ) {
/* OBS: fourcc must be read using machine endianness
* so don't play with biCompression here!
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index cc53e646c..b334dfaa5 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -32,7 +32,13 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include "configfile.h"
+#include <xine/configfile.h>
+#include "bswap.h"
+#ifdef HAVE_FFMPEG_AVUTIL_H
+# include <base64.h>
+#else
+# include <libavutil/base64.h>
+#endif
#define LOG_MODULE "configfile"
#define LOG_VERBOSE
@@ -40,8 +46,8 @@
#define LOG
*/
-#include "xineutils.h"
-#include "xine_internal.h"
+#include <xine/xineutils.h>
+#include <xine/xine_internal.h>
static const xine_config_entry_translation_t *config_entry_translation_user = NULL;
static const xine_config_entry_translation_t config_entry_translation[] = {
@@ -183,8 +189,6 @@ static const xine_config_entry_translation_t config_entry_translation[] = {
{ "video.pgx64_overlay_mode", "" },
{ "video.pgx64_saturation", "video.output.pgx64_saturation" },
{ "video.sdl_hw_accel", "video.device.sdl_hw_accel" },
- { "video.syncfb_default_repeat", "video.device.syncfb_default_repeat" },
- { "video.syncfb_device", "video.device.syncfb_device" },
{ "video.unichrome_cpu_save", "video.device.unichrome_cpu_save" },
{ "video.vertical_position", "video.output.vertical_position" },
{ "video.vidix_blue_intensity", "video.output.vidix_blue_intensity" },
@@ -208,7 +212,7 @@ static const xine_config_entry_translation_t config_entry_translation[] = {
static int config_section_enum(const char *sect) {
- static char *known_section[] = {
+ static const char *const known_section[] = {
"gui",
"ui",
"audio",
@@ -461,6 +465,8 @@ static void config_reset_value(cfg_entry_t *entry) {
entry->num_value = 0;
}
+static void config_shallow_copy(xine_cfg_entry_t *dest, cfg_entry_t *src);
+
static cfg_entry_t *config_register_key (config_values_t *this,
const char *key,
int exp_level,
@@ -494,6 +500,14 @@ static cfg_entry_t *config_register_key (config_values_t *this,
entry->callback_data = cb_data;
}
+ /* we created a new entry, call the callback */
+ if (this->new_entry_cb) {
+ xine_cfg_entry_t cb_entry;
+
+ config_shallow_copy(&cb_entry, entry);
+ this->new_entry_cb(this->new_entry_cbdata, &cb_entry);
+ }
+
return entry;
}
@@ -1211,6 +1225,328 @@ static void config_unregister_cb (config_values_t *this, const char *key) {
}
}
+static void config_set_new_entry_callback (config_values_t *this, xine_config_cb_t new_entry_cb, void* cbdata) {
+ pthread_mutex_lock(&this->config_lock);
+ this->new_entry_cb = new_entry_cb;
+ this->new_entry_cbdata = cbdata;
+ pthread_mutex_unlock(&this->config_lock);
+}
+
+static void config_unset_new_entry_callback (config_values_t *this) {
+ pthread_mutex_lock(&this->config_lock);
+ this->new_entry_cb = NULL;
+ this->new_entry_cbdata = NULL;
+ pthread_mutex_unlock(&this->config_lock);
+}
+
+static int put_int(uint8_t *buffer, int pos, int value) {
+ int32_t value_int32 = (int32_t)value;
+
+ buffer[pos] = value_int32 & 0xFF;
+ buffer[pos + 1] = (value_int32 >> 8) & 0xFF;
+ buffer[pos + 2] = (value_int32 >> 16) & 0xFF;
+ buffer[pos + 3] = (value_int32 >> 24) & 0xFF;
+
+ return 4;
+}
+
+static int put_string(uint8_t *buffer, int pos, const char *value, int value_len) {
+ pos += put_int(buffer, pos, value_len);
+ memcpy(&buffer[pos], value, value_len);
+
+ return 4 + value_len;
+}
+
+static char* config_get_serialized_entry (config_values_t *this, const char *key) {
+ char *output = NULL;
+ cfg_entry_t *entry, *prev;
+
+ pthread_mutex_lock(&this->config_lock);
+ config_lookup_entry_int(this, key, &entry, &prev);
+
+ if (entry) {
+ /* now serialize this stuff
+ fields to serialize :
+ int type;
+ int range_min;
+ int range_max;
+ int exp_level;
+ int num_default;
+ int num_value;
+ char *key;
+ char *str_default;
+ char *description;
+ char *help;
+ char **enum_values;
+ */
+
+ int key_len = 0;
+ int str_default_len = 0;
+ int description_len = 0;
+ int help_len = 0;
+ unsigned long total_len;
+ int value_count;
+ int value_len[10];
+ int pos = 0;
+ int i;
+
+ if (entry->key)
+ key_len = strlen(entry->key);
+ if (entry->str_default)
+ str_default_len = strlen(entry->str_default);
+ if (entry->description)
+ description_len = strlen(entry->description);
+ if (entry->help)
+ help_len = strlen(entry->help);
+
+ /* integers */
+ /* value: 4 bytes */
+ total_len = 6 * sizeof(int32_t);
+
+ /* strings (size + char buffer)
+ * length: 4 bytes
+ * buffer: length bytes
+ */
+ total_len += sizeof(int32_t) + key_len;
+ total_len += sizeof(int32_t) + str_default_len;
+ total_len += sizeof(int32_t) + description_len;
+ total_len += sizeof(int32_t) + help_len;
+
+ /* enum values...
+ * value count: 4 bytes
+ * for each value:
+ * length: 4 bytes
+ * buffer: length bytes
+ */
+ value_count = 0;
+ total_len += sizeof(int32_t); /* value count */
+
+ char **cur_value = entry->enum_values;
+ if (cur_value) {
+ while (*cur_value && (value_count < (sizeof(value_len) / sizeof(int) ))) {
+ value_len[value_count] = strlen(*cur_value);
+ total_len += sizeof(int32_t) + value_len[value_count];
+ value_count++;
+ cur_value++;
+ }
+ }
+
+ /* Now we have the length needed to serialize the entry and the length of each string */
+ uint8_t *buffer = malloc (total_len);
+ if (!buffer) return NULL;
+
+ /* Let's go */
+
+ /* the integers */
+ pos += put_int(buffer, pos, entry->type);
+ pos += put_int(buffer, pos, entry->range_min);
+ pos += put_int(buffer, pos, entry->range_max);
+ pos += put_int(buffer, pos, entry->exp_level);
+ pos += put_int(buffer, pos, entry->num_default);
+ pos += put_int(buffer, pos, entry->num_value);
+
+ /* the strings */
+ pos += put_string(buffer, pos, entry->key, key_len);
+ pos += put_string(buffer, pos, entry->str_default, str_default_len);
+ pos += put_string(buffer, pos, entry->description, description_len);
+ pos += put_string(buffer, pos, entry->help, help_len);
+
+ /* the enum stuff */
+ pos += put_int(buffer, pos, value_count);
+ cur_value = entry->enum_values;
+
+ for (i = 0; i < value_count; i++) {
+ pos += put_string(buffer, pos, *cur_value, value_len[i]);
+ cur_value++;
+ }
+
+ /* and now the output encoding */
+ /* We're going to encode total_len bytes in base64
+ * libavutil's base64 encoding functions want the size to
+ * be at least len * 4 / 3 + 12, so let's use that!
+ */
+ output = malloc(total_len * 4 / 3 + 12);
+ av_base64_encode(output, total_len * 4 / 3 + 12, buffer, total_len);
+
+ free(buffer);
+ }
+ pthread_mutex_unlock(&this->config_lock);
+
+ return output;
+
+}
+
+static int get_int(uint8_t *buffer, int buffer_size, int pos, int *value) {
+ int32_t value_int32;
+
+ if ((pos + sizeof(int32_t)) > buffer_size)
+ return 0;
+
+ value_int32 = _X_LE_32(&buffer[pos]);
+ *value = (int)value_int32;
+ return sizeof(int32_t);
+}
+
+static int get_string(uint8_t *buffer, int buffer_size, int pos, char **value) {
+ int len;
+ int bytes = get_int(buffer, buffer_size, pos, &len);
+ *value = NULL;
+
+ if (!bytes || (len < 0) || (len > 1024*64))
+ return 0;
+
+ char *str = malloc(len + 1);
+ pos += bytes;
+ memcpy(str, &buffer[pos], len);
+ str[len] = 0;
+
+ *value = str;
+ return bytes + len;
+}
+
+static char* config_register_serialized_entry (config_values_t *this, const char *value) {
+ /*
+ fields serialized :
+ int type;
+ int range_min;
+ int range_max;
+ int exp_level;
+ int num_default;
+ int num_value;
+ char *key;
+ char *str_default;
+ char *description;
+ char *help;
+ char **enum_values;
+ */
+ int type;
+ int range_min;
+ int range_max;
+ int exp_level;
+ int num_default;
+ int num_value;
+ char *key = NULL;
+ char *str_default = NULL;
+ char *description = NULL;
+ char *help = NULL;
+ char **enum_values = NULL;
+
+ int bytes;
+ int pos;
+ void *output = NULL;
+ size_t output_len;
+ int value_count = 0;
+ int i;
+
+ output_len = strlen(value) * 3 / 4 + 1;
+ output = malloc(output_len);
+ av_base64_decode(output, value, output_len);
+
+ pos = 0;
+ pos += bytes = get_int(output, output_len, pos, &type);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_int(output, output_len, pos, &range_min);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_int(output, output_len, pos, &range_max);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_int(output, output_len, pos, &exp_level);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_int(output, output_len, pos, &num_default);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_int(output, output_len, pos, &num_value);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_string(output, output_len, pos, &key);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_string(output, output_len, pos, &str_default);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_string(output, output_len, pos, &description);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_string(output, output_len, pos, &help);
+ if (!bytes) goto exit;
+
+ pos += bytes = get_int(output, output_len, pos, &value_count);
+ if (!bytes) goto exit;
+ if ((value_count < 0) || (value_count > 256)) goto exit;
+
+ enum_values = calloc (value_count + 1, sizeof(void*));
+ for (i = 0; i < value_count; i++) {
+ pos += bytes = get_string(output, output_len, pos, &enum_values[i]);
+ if (!bytes) goto exit;
+ }
+ enum_values[value_count] = NULL;
+
+#ifdef LOG
+ printf("config entry deserialization:\n");
+ printf(" key : %s\n", key);
+ printf(" type : %d\n", type);
+ printf(" exp_level : %d\n", exp_level);
+ printf(" num_default: %d\n", num_default);
+ printf(" num_value : %d\n", num_value);
+ printf(" str_default: %s\n", str_default);
+ printf(" range_min : %d\n", range_min);
+ printf(" range_max : %d\n", range_max);
+ printf(" description: %s\n", description);
+ printf(" help : %s\n", help);
+ printf(" enum : %d values\n", value_count);
+
+ for (i = 0; i < value_count; i++) {
+ printf(" enum[%2d]: %s\n", i, enum_values[i]);
+ }
+ printf("\n");
+#endif
+
+ switch (type) {
+ case XINE_CONFIG_TYPE_STRING:
+ switch (num_value) {
+ case 0:
+ this->register_string(this, key, str_default, description, help, exp_level, NULL, NULL);
+ break;
+ default:
+ this->register_filename(this, key, str_default, num_value, description, help, exp_level, NULL, NULL);
+ break;
+ }
+ break;
+ case XINE_CONFIG_TYPE_RANGE:
+ this->register_range(this, key, num_default, range_min, range_max, description, help, exp_level, NULL, NULL);
+ break;
+ case XINE_CONFIG_TYPE_ENUM:
+ this->register_enum(this, key, num_default, enum_values, description, help, exp_level, NULL, NULL);
+ break;
+ case XINE_CONFIG_TYPE_NUM:
+ this->register_num(this, key, num_default, description, help, exp_level, NULL, NULL);
+ break;
+ case XINE_CONFIG_TYPE_BOOL:
+ this->register_bool(this, key, num_default, description, help, exp_level, NULL, NULL);
+ break;
+ case XINE_CONFIG_TYPE_UNKNOWN:
+ break;
+ }
+
+exit:
+ /* cleanup */
+ free(str_default);
+ free(description);
+ free(help);
+ free(output);
+
+ if (enum_values) {
+ for (i = 0; i < value_count; i++) {
+ free(enum_values[i]);
+ }
+ free(enum_values);
+ }
+
+ return key;
+}
config_values_t *_x_config_init (void) {
@@ -1237,18 +1573,22 @@ config_values_t *_x_config_init (void) {
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&this->config_lock, &attr);
- this->register_string = config_register_string;
- this->register_filename = config_register_filename;
- this->register_range = config_register_range;
- this->register_enum = config_register_enum;
- this->register_num = config_register_num;
- this->register_bool = config_register_bool;
- this->update_num = config_update_num;
- this->update_string = config_update_string;
- this->parse_enum = config_parse_enum;
- this->lookup_entry = config_lookup_entry;
- this->unregister_callback = config_unregister_cb;
- this->dispose = config_dispose;
+ this->register_string = config_register_string;
+ this->register_filename = config_register_filename;
+ this->register_range = config_register_range;
+ this->register_enum = config_register_enum;
+ this->register_num = config_register_num;
+ this->register_bool = config_register_bool;
+ this->register_serialized_entry = config_register_serialized_entry;
+ this->update_num = config_update_num;
+ this->update_string = config_update_string;
+ this->parse_enum = config_parse_enum;
+ this->lookup_entry = config_lookup_entry;
+ this->unregister_callback = config_unregister_cb;
+ this->dispose = config_dispose;
+ this->set_new_entry_callback = config_set_new_entry_callback;
+ this->unset_new_entry_callback = config_unset_new_entry_callback;
+ this->get_serialized_entry = config_get_serialized_entry;
return this;
}
diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h
deleted file mode 100644
index 4622f87fe..000000000
--- a/src/xine-engine/configfile.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * config file management
- */
-
-#ifndef HAVE_CONFIGFILE_H
-#define HAVE_CONFIGFILE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <pthread.h>
-
-#ifdef XINE_COMPILE
-# include "xine.h"
-#else
-# include <xine.h>
-#endif
-
-#define CONFIG_FILE_VERSION 2
-
-/*
- * config entries above this experience
- * level must never be changed from MRL
- */
-#define XINE_CONFIG_SECURITY 30
-
-
-typedef struct cfg_entry_s cfg_entry_t;
-typedef struct config_values_s config_values_t;
-
-struct cfg_entry_s {
- cfg_entry_t *next;
- config_values_t *config;
-
- char *key;
- int type;
-
- /* type unknown */
- char *unknown_value;
-
- /* type string */
- char *str_value;
- char *str_default;
-
- /* common to range, enum, num, bool: */
-
- int num_value;
- int num_default;
-
- /* type range specific: */
- int range_min;
- int range_max;
-
- /* type enum specific: */
- char **enum_values;
-
- /* help info for the user */
- char *description;
- char *help;
-
- /* user experience level */
- int exp_level;
-
- /* callback function and data for live changeable values */
- xine_config_cb_t callback;
- void *callback_data;
-};
-
-struct config_values_s {
-
- /*
- * register config values
- *
- * these functions return the current value of the
- * registered item, i.e. the default value if it was
- * not found in the config file or the current value
- * from the config file otherwise
- */
-
- char* (*register_string) (config_values_t *self,
- const char *key,
- const char *def_value,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data);
-
- char* (*register_filename) (config_values_t *self,
- const char *key,
- const char *def_value,
- int req_type,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data);
-
- int (*register_range) (config_values_t *self,
- const char *key,
- int def_value,
- int min, int max,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data);
-
- int (*register_enum) (config_values_t *self,
- const char *key,
- int def_value,
- char **values,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data);
-
- int (*register_num) (config_values_t *self,
- const char *key,
- int def_value,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data);
-
- int (*register_bool) (config_values_t *self,
- const char *key,
- int def_value,
- const char *description,
- const char *help,
- int exp_level,
- xine_config_cb_t changed_cb,
- void *cb_data);
-
- /* 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 */
- void (*update_string) (config_values_t *self, const char *key, const char *value);
-
- /* small utility function for enum handling */
- int (*parse_enum) (const char *str, const char **values);
-
- /*
- * lookup config entries
- *
- * remember to call the changed_cb if it exists
- * and you changed the value of this item
- */
-
- 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);
-
- /*
- * config values are stored here:
- */
- 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
- */
-config_values_t *_x_config_init (void) XINE_MALLOC XINE_PROTECTED;
-
-/*
- * interpret stream_setup part of mrls for config value changes
- */
-
-int _x_config_change_opt(config_values_t *config, const char *opt) XINE_PROTECTED;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c
index 87cc18011..d61ca963a 100644
--- a/src/xine-engine/demux.c
+++ b/src/xine-engine/demux.c
@@ -42,9 +42,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "demuxers/demux.h"
-#include "buffer.h"
+#include <xine/xine_internal.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
#ifdef WIN32
#include <winsock.h>
@@ -200,7 +200,7 @@ void _x_demux_control_headers_done (xine_stream_t *stream) {
buf_element_t *buf_video, *buf_audio;
/* we use demux_action_pending to wake up sleeping spu decoders */
- stream->demux_action_pending = 1;
+ _x_action_raise(stream);
/* allocate the buffers before grabbing the lock to prevent cyclic wait situations */
buf_video = stream->video_fifo->buffer_pool_alloc (stream->video_fifo);
@@ -252,7 +252,7 @@ void _x_demux_control_headers_done (xine_stream_t *stream) {
}
}
- stream->demux_action_pending = 0;
+ _x_action_lower(stream);
pthread_cond_signal(&stream->demux_resume);
lprintf ("headers processed.\n");
@@ -342,7 +342,7 @@ static void *demux_loop (void *stream_gen) {
status = stream->demux_plugin->send_chunk(stream->demux_plugin);
/* someone may want to interrupt us */
- if( stream->demux_action_pending ) {
+ if (_x_action_pending(stream)) {
struct timespec ts;
ts = _x_compute_interval(100);
pthread_cond_timedwait (&stream->demux_resume, &stream->demux_lock, &ts);
@@ -429,9 +429,9 @@ int _x_demux_start_thread (xine_stream_t *stream) {
lprintf ("start thread called\n");
- stream->demux_action_pending = 1;
+ _x_action_raise(stream);
pthread_mutex_lock( &stream->demux_lock );
- stream->demux_action_pending = 0;
+ _x_action_lower(stream);
pthread_cond_signal(&stream->demux_resume);
if( !stream->demux_thread_running ) {
@@ -460,10 +460,10 @@ int _x_demux_stop_thread (xine_stream_t *stream) {
lprintf ("stop thread called\n");
- stream->demux_action_pending = 1;
+ _x_action_raise(stream);
pthread_mutex_lock( &stream->demux_lock );
stream->demux_thread_running = 0;
- stream->demux_action_pending = 0;
+ _x_action_lower(stream);
pthread_cond_signal(&stream->demux_resume);
/* At that point, the demuxer has sent the last audio/video buffer,
@@ -492,7 +492,7 @@ int _x_demux_stop_thread (xine_stream_t *stream) {
return 0;
}
-int _x_demux_read_header( input_plugin_t *input, unsigned char *buffer, off_t size){
+int _x_demux_read_header( input_plugin_t *input, void *buffer, off_t size){
int read_size;
unsigned char *buf;
@@ -517,6 +517,11 @@ int _x_demux_read_header( input_plugin_t *input, unsigned char *buffer, off_t si
int _x_demux_check_extension (const char *mrl, const char *extensions){
char *last_dot, *e, *ext_copy, *ext_work;
+ int found = 0;
+
+ /* An empty extensions string means that the by-extension method can't
+ be used, so consider those cases as always passing. */
+ if ( extensions == NULL ) return 1;
ext_copy = strdup(extensions);
ext_work = ext_copy;
@@ -524,15 +529,23 @@ int _x_demux_check_extension (const char *mrl, const char *extensions){
last_dot = strrchr (mrl, '.');
if (last_dot) {
last_dot++;
- while ( ( e = xine_strsep(&ext_work, " ")) != NULL ) {
+ }
+
+ while ( ( e = xine_strsep(&ext_work, " ")) != NULL ) {
+ if ( strstr(e, ":/") ) {
+ if ( strncasecmp (mrl, e, strlen (e)) == 0 ) {
+ found = 1;
+ break;
+ }
+ } else if (last_dot) {
if (strcasecmp (last_dot, e) == 0) {
- free(ext_copy);
- return 1;
+ found = 1;
+ break;
}
}
}
free(ext_copy);
- return 0;
+ return found;
}
@@ -567,7 +580,7 @@ off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) {
/* aborts current read if action pending. otherwise xine
* cannot be stopped when no more data is available.
*/
- if( stream->demux_action_pending )
+ if (_x_action_pending(stream))
return total;
} else {
break;
@@ -608,6 +621,22 @@ int _x_action_pending (xine_stream_t *stream) {
return stream->demux_action_pending;
}
+/* set demux_action_pending in a thread-safe way */
+void _x_action_raise (xine_stream_t *stream)
+{
+ pthread_mutex_lock(&stream->demux_action_lock);
+ stream->demux_action_pending++;
+ pthread_mutex_unlock(&stream->demux_action_lock);
+}
+
+/* reset demux_action_pending in a thread-safe way */
+void _x_action_lower (xine_stream_t *stream)
+{
+ pthread_mutex_lock(&stream->demux_action_lock);
+ stream->demux_action_pending--;
+ pthread_mutex_unlock(&stream->demux_action_lock);
+}
+
/*
* demuxer helper function to send data to fifo, breaking into smaller
* pieces (bufs) as needed.
diff --git a/src/xine-engine/events.c b/src/xine-engine/events.c
index a5680476f..5bd827c45 100644
--- a/src/xine-engine/events.c
+++ b/src/xine-engine/events.c
@@ -26,7 +26,7 @@
#define XINE_ENGINE_INTERNAL
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
xine_event_t *xine_event_get (xine_event_queue_t *queue) {
diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c
index 9d0302cc1..85f43b357 100644
--- a/src/xine-engine/info_helper.c
+++ b/src/xine-engine/info_helper.c
@@ -35,7 +35,7 @@
#define XINE_ENGINE_INTERNAL
-#include "info_helper.h"
+#include <xine/info_helper.h>
/* ******************* Stream Info *************************** */
diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c
index e761fed38..40aaba660 100644
--- a/src/xine-engine/input_cache.c
+++ b/src/xine-engine/input_cache.c
@@ -33,7 +33,8 @@
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
+#include "xine_private.h"
#include <assert.h>
#define DEFAULT_BUFFER_SIZE 1024
@@ -61,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;
@@ -344,7 +346,7 @@ static void cache_plugin_dispose(input_plugin_t *this_gen) {
/*
* create self instance,
*/
-input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) {
+input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream) {
cache_input_plugin_t *this;
input_plugin_t *main_plugin = stream->input_plugin;
diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c
index faeaae62d..c1cbbf043 100644
--- a/src/xine-engine/input_rip.c
+++ b/src/xine-engine/input_rip.c
@@ -64,7 +64,8 @@
# define CLR_RST "\e[0;39m"
#endif
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
+#include "xine_private.h"
#ifndef HAVE_FSEEKO
# define fseeko fseek
@@ -98,8 +99,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/io_helper.c b/src/xine-engine/io_helper.c
index eef843906..1336fc790 100644
--- a/src/xine-engine/io_helper.c
+++ b/src/xine-engine/io_helper.c
@@ -38,7 +38,7 @@
#define XINE_ENGINE_INTERNAL
-#include "io_helper.h"
+#include <xine/io_helper.h>
/* private constants */
#define XIO_FILE_READ 0
@@ -246,7 +246,7 @@ int _x_io_select (xine_stream_t *stream, int fd, int state, int timeout_msec) {
* aborts current read if action pending. otherwise xine
* cannot be stopped when no more data is available.
*/
- if (stream && stream->demux_action_pending)
+ if (stream && _x_action_pending(stream))
return XIO_ABORTED;
break;
case WAIT_ABANDONED:
@@ -290,7 +290,7 @@ int _x_io_select (xine_stream_t *stream, int fd, int state, int timeout_msec) {
* aborts current read if action pending. otherwise xine
* cannot be stopped when no more data is available.
*/
- if (stream && stream->demux_action_pending)
+ if (stream && _x_action_pending(stream))
return XIO_ABORTED;
total_time_usec += XIO_POLLING_INTERVAL;
@@ -326,7 +326,8 @@ int _x_io_tcp_connect_finish(xine_stream_t *stream, int fd, int timeout_msec) {
}
-static off_t xio_rw_abort(xine_stream_t *stream, int fd, int cmd, char *buf, off_t todo) {
+static off_t xio_rw_abort(xine_stream_t *stream, int fd, int cmd, void *buf_gen, off_t todo) {
+ uint8_t *buf = buf_gen;
off_t ret = -1;
off_t total = 0;
@@ -413,19 +414,19 @@ static off_t xio_rw_abort(xine_stream_t *stream, int fd, int cmd, char *buf, off
return total;
}
-off_t _x_io_tcp_read (xine_stream_t *stream, int s, char *buf, off_t todo) {
+off_t _x_io_tcp_read (xine_stream_t *stream, int s, void *buf, off_t todo) {
return xio_rw_abort (stream, s, XIO_TCP_READ, buf, todo);
}
-off_t _x_io_tcp_write (xine_stream_t *stream, int s, char *buf, off_t todo) {
+off_t _x_io_tcp_write (xine_stream_t *stream, int s, void *buf, off_t todo) {
return xio_rw_abort (stream, s, XIO_TCP_WRITE, buf, todo);
}
-off_t _x_io_file_read (xine_stream_t *stream, int s, char *buf, off_t todo) {
+off_t _x_io_file_read (xine_stream_t *stream, int s, void *buf, off_t todo) {
return xio_rw_abort (stream, s, XIO_FILE_READ, buf, todo);
}
-off_t _x_io_file_write (xine_stream_t *stream, int s, char *buf, off_t todo) {
+off_t _x_io_file_write (xine_stream_t *stream, int s, void *buf, off_t todo) {
return xio_rw_abort (stream, s, XIO_FILE_WRITE, buf, todo);
}
diff --git a/src/xine-engine/io_helper.h b/src/xine-engine/io_helper.h
deleted file mode 100644
index 3e96e8dc1..000000000
--- a/src/xine-engine/io_helper.h
+++ /dev/null
@@ -1,141 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * abortable i/o helper functions
- */
-
-#ifndef IO_HELPER_H
-#define IO_HELPER_H
-
-#include "xine_internal.h"
-
-
-/* select states */
-#define XIO_READ_READY 1
-#define XIO_WRITE_READY 2
-
-/* xine select return codes */
-#define XIO_READY 0
-#define XIO_ERROR 1
-#define XIO_ABORTED 2
-#define XIO_TIMEOUT 3
-
-
-/*
- * Waits for a file descriptor/socket to change status.
- *
- * network input plugins should use this function in order to
- * not freeze the engine.
- *
- * params :
- * stream needed for aborting and reporting errors but may be NULL
- * fd file/socket descriptor
- * state XIO_READ_READY, XIO_WRITE_READY
- * timeout_sec timeout in seconds
- *
- * An other thread can abort this function if stream != NULL by setting
- * stream->demux_action_pending.
- *
- * return value :
- * XIO_READY the file descriptor is ready for cmd
- * XIO_ERROR an i/o error occured
- * XIO_ABORTED command aborted by an other thread
- * XIO_TIMEOUT the file descriptor is not ready after timeout_msec milliseconds
- */
-int _x_io_select (xine_stream_t *stream, int fd, int state, int timeout_msec) XINE_PROTECTED;
-
-
-/*
- * open a tcp connection
- *
- * params :
- * stream needed for reporting errors but may be NULL
- * host address of target
- * port port on target
- *
- * returns a socket descriptor or -1 if an error occured
- */
-int _x_io_tcp_connect(xine_stream_t *stream, const char *host, int port) XINE_PROTECTED;
-
-/*
- * wait for finish connection
- *
- * params :
- * stream needed for aborting and reporting errors but may be NULL
- * fd socket descriptor
- * timeout_msec timeout in milliseconds
- *
- * return value:
- * XIO_READY host respond, the socket is ready for cmd
- * XIO_ERROR an i/o error occured
- * XIO_ABORTED command aborted by an other thread
- * XIO_TIMEOUT the file descriptor is not ready after timeout
- */
-int _x_io_tcp_connect_finish(xine_stream_t *stream, int fd, int timeout_msec) XINE_PROTECTED;
-
-/*
- * read from tcp socket checking demux_action_pending
- *
- * network input plugins should use this function in order to
- * not freeze the engine.
- *
- * aborts with zero if no data is available and *abort is set
- */
-off_t _x_io_tcp_read (xine_stream_t *stream, int s, char *buf, off_t todo) XINE_PROTECTED;
-
-
-/*
- * write to a tcp socket checking demux_action_pending
- *
- * network input plugins should use this function in order to
- * not freeze the engine.
- *
- * aborts with zero if no data is available and *abort is set
- */
-off_t _x_io_tcp_write (xine_stream_t *stream, int s, char *buf, off_t todo) XINE_PROTECTED;
-
-/*
- * read from a file descriptor checking demux_action_pending
- *
- * the fifo input plugin should use this function in order to
- * not freeze the engine.
- *
- * aborts with zero if no data is available and *abort is set
- */
-off_t _x_io_file_read (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_PROTECTED;
-
-
-/*
- * write to a file descriptor checking demux_action_pending
- *
- * the fifo input plugin should use this function in order to
- * not freeze the engine.
- *
- * aborts with zero if *abort is set
- */
-off_t _x_io_file_write (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_PROTECTED;
-
-/*
- * read a string from socket, return string length (same as strlen)
- * the string is always '\0' terminated but given buffer size is never exceeded
- * that is, _x_io_tcp_read_line(,,,X) <= (X-1) ; X > 0
- */
-int _x_io_tcp_read_line(xine_stream_t *stream, int sock, char *str, int size) XINE_PROTECTED;
-
-#endif
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index 206f259e5..c86cc5f6e 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.c
@@ -40,26 +40,33 @@
#include <ctype.h>
#include <signal.h>
+#include <basedir.h>
+
#define LOG_MODULE "load_plugins"
#define LOG_VERBOSE
/*
#define LOG
+#define DEBUG
*/
#define XINE_ENABLE_EXPERIMENTAL_FEATURES 1
#define XINE_ENGINE_INTERNAL
-#include "xine_internal.h"
-#include "xine_plugin.h"
-#include "plugin_catalog.h"
-#include "demuxers/demux.h"
-#include "input/input_plugin.h"
-#include "video_out.h"
-#include "post.h"
-#include "metronom.h"
-#include "configfile.h"
-#include "xineutils.h"
-#include "compat.h"
+#include <xine/xine_internal.h>
+#include <xine/xine_plugin.h>
+#include <xine/plugin_catalog.h>
+#include <xine/demux.h>
+#include <xine/input_plugin.h>
+#include <xine/video_out.h>
+#include <xine/post.h>
+#include <xine/metronom.h>
+#include <xine/configfile.h>
+#include <xine/xineutils.h>
+#include <xine/compat.h>
+
+#include "xine_private.h"
+
+#define LINE_MAX_LENGTH (1024 * 32) /* 32 KiB */
#if 0
@@ -92,6 +99,7 @@ static void remove_segv_handler(void){
#endif
#endif /* 0 */
+#define CACHE_CATALOG_VERSION 4
static const int plugin_iface_versions[] = {
INPUT_PLUGIN_IFACE_VERSION,
@@ -245,26 +253,26 @@ static void _decoder_priority_cb(void *data, xine_cfg_entry_t *cfg) {
map_decoders((xine_t *)data);
}
-static plugin_info_t *_get_cached_info (xine_t *this,
+static plugin_node_t *_get_cached_node (xine_t *this,
char *filename, off_t filesize, time_t filemtime,
- plugin_info_t *previous_info) {
+ plugin_node_t *previous_node) {
xine_sarray_t *list = this->plugin_catalog->cache_list;
int list_id, list_size;
list_size = xine_sarray_size (list);
for (list_id = 0; list_id < list_size; list_id++) {
plugin_node_t *node = xine_sarray_get (list, list_id);
- if( !previous_info &&
+ if( !previous_node &&
node->file->filesize == filesize &&
node->file->filemtime == filemtime &&
!strcmp( node->file->filename, filename )) {
- return node->info;
+ return node;
}
/* skip previously returned items */
- if( node->info == previous_info )
- previous_info = NULL;
+ if( node == previous_node )
+ previous_node = NULL;
}
return NULL;
@@ -294,6 +302,7 @@ static plugin_file_t *_insert_file (xine_t *this,
static void _insert_node (xine_t *this,
xine_sarray_t *list,
plugin_file_t *file,
+ plugin_node_t *node_cache,
plugin_info_t *info,
int api_version){
@@ -333,6 +342,7 @@ static void _insert_node (xine_t *this,
entry->file = file;
entry->ref = 0;
entry->priority = 0; /* default priority */
+ entry->config_entry_list = (node_cache) ? node_cache->config_entry_list : NULL;
switch (info->type & PLUGIN_TYPE_MASK){
@@ -377,9 +387,6 @@ 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);
- /* 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] = _x_asprintf(_("priority for %s decoder"), info->id);
this->config->register_num (this->config,
@@ -479,7 +486,8 @@ static plugin_catalog_t *XINE_MALLOC _new_catalog(void){
return catalog;
}
-static void _register_plugins_internal(xine_t *this, plugin_file_t *file, plugin_info_t *info) {
+static void _register_plugins_internal(xine_t *this, plugin_file_t *file,
+ plugin_node_t *node_cache, plugin_info_t *info) {
_x_assert(this);
_x_assert(info);
@@ -505,7 +513,7 @@ static void _register_plugins_internal(xine_t *this, plugin_file_t *file, plugin
int plugin_type = info->type & PLUGIN_TYPE_MASK;
if ((plugin_type > 0) && (plugin_type <= PLUGIN_TYPE_MAX)) {
- _insert_node (this, this->plugin_catalog->plugin_lists[plugin_type - 1], file, info,
+ _insert_node (this, this->plugin_catalog->plugin_lists[plugin_type - 1], file, node_cache, info,
plugin_iface_versions[plugin_type - 1]);
if ((plugin_type == PLUGIN_AUDIO_DECODER) ||
@@ -529,7 +537,8 @@ static void _register_plugins_internal(xine_t *this, plugin_file_t *file, plugin
/* get next info */
if( file && !file->lib_handle ) {
lprintf("get cached info\n");
- info = _get_cached_info (this, file->filename, file->filesize, file->filemtime, info);
+ node_cache = _get_cached_node (this, file->filename, file->filesize, file->filemtime, node_cache);
+ info = (node_cache) ? node_cache->info : NULL;
} else {
info++;
}
@@ -537,7 +546,7 @@ static void _register_plugins_internal(xine_t *this, plugin_file_t *file, plugin
}
void xine_register_plugins(xine_t *self, plugin_info_t *info) {
- _register_plugins_internal(self, NULL, info);
+ _register_plugins_internal(self, NULL, NULL, info);
}
/*
@@ -563,6 +572,7 @@ static void collect_plugins(xine_t *this, char *path){
while ((pEntry = readdir (dir)) != NULL) {
void *lib = NULL;
plugin_info_t *info = NULL;
+ plugin_node_t *node = NULL;
struct stat statbuffer;
@@ -605,7 +615,8 @@ static void collect_plugins(xine_t *this, char *path){
lib = NULL;
/* get the first plugin_info_t */
- info = _get_cached_info (this, str, statbuffer.st_size, statbuffer.st_mtime, NULL);
+ node = _get_cached_node (this, str, statbuffer.st_size, statbuffer.st_mtime, NULL);
+ info = (node) ? node->info : NULL;
#ifdef LOG
if( info )
printf("load_plugins: using cached %s\n", str);
@@ -626,7 +637,7 @@ static void collect_plugins(xine_t *this, char *path){
file = _insert_file(this, this->plugin_catalog->file_list, str, &statbuffer, lib);
- _register_plugins_internal(this, file, info);
+ _register_plugins_internal(this, file, node, info);
}
else {
const char *error = dlerror();
@@ -683,6 +694,25 @@ static inline int _plugin_info_equal(const plugin_info_t *a,
return 1;
}
+static void _attach_entry_to_node (plugin_node_t *node, char *key) {
+
+ if (!node->config_entry_list) {
+ node->config_entry_list = xine_list_new();
+ }
+
+ xine_list_push_back(node->config_entry_list, key);
+}
+
+/*
+ * This callback is called by the config entry system when a plugin register a
+ * new config entry.
+ */
+static void _new_entry_cb (void *user_data, xine_cfg_entry_t *entry) {
+ plugin_node_t *node = (plugin_node_t *)user_data;
+
+ _attach_entry_to_node(node, strdup(entry->key));
+}
+
static int _load_plugin_class(xine_t *this,
plugin_node_t *node,
void *data) {
@@ -710,9 +740,17 @@ static int _load_plugin_class(xine_t *this,
if ((info = dlsym(node->file->lib_handle, "xine_plugin_info"))) {
/* TODO: use sigsegv handler */
- while (info->type != PLUGIN_NONE){
- if (_plugin_info_equal(info, target)){
- if ((node->plugin_class = info->init(this, data))) {
+ while (info->type != PLUGIN_NONE) {
+ if (_plugin_info_equal(info, target)) {
+ config_values_t *config = this->config;
+
+ /* the callback is called for each entry registered by this plugin */
+ lprintf("plugin init %s\n", node->info->id);
+ config->set_new_entry_callback(config, _new_entry_cb, node);
+ node->plugin_class = info->init(this, data);
+ config->unset_new_entry_callback(config);
+
+ if (node->plugin_class) {
inc_file_ref(node->file);
return 1;
} else {
@@ -791,7 +829,11 @@ static void _load_required_plugins(xine_t *this, xine_sarray_t *list) {
while (list_id < list_size) {
plugin_node_t *node = xine_sarray_get(list, list_id);
- if( (node->info->type & PLUGIN_MUST_PRELOAD) && !node->plugin_class ) {
+ /*
+ * preload plugins if not cached
+ */
+ if( (node->info->type & PLUGIN_MUST_PRELOAD) && !node->plugin_class &&
+ node->file->lib_handle ) {
lprintf("preload plugin %s from %s\n", node->info->id, node->file->filename);
@@ -821,7 +863,7 @@ static void load_required_plugins(xine_t *this) {
/*
* save plugin list information to file (cached catalog)
*/
-static void save_plugin_list(FILE *fp, xine_sarray_t *list) {
+static void save_plugin_list(xine_t *this, FILE *fp, xine_sarray_t *list) {
const plugin_node_t *node;
const plugin_file_t *file;
@@ -831,7 +873,6 @@ static void save_plugin_list(FILE *fp, xine_sarray_t *list) {
const vo_info_t *vo_info;
const ao_info_t *ao_info;
const post_info_t *post_info;
-
int i;
int list_id = 0;
int list_size;
@@ -886,8 +927,25 @@ static void save_plugin_list(FILE *fp, xine_sarray_t *list) {
case PLUGIN_POST:
post_info = node->info->special_info;
- fprintf(fp, "post_type=%lu\n", (unsigned long)post_info->type);
- break;
+ fprintf(fp, "post_type=%lu\n", (unsigned long)post_info->type);
+ break;
+ }
+
+ /* config entries */
+ if (node->config_entry_list) {
+ xine_list_iterator_t ite = xine_list_front(node->config_entry_list);
+ while (ite) {
+ char *key = xine_list_get_value(node->config_entry_list, ite);
+
+ /* now serialize the config key */
+ char *key_value = this->config->get_serialized_entry(this->config, key);
+
+ lprintf(" config key: %s, serialization: %d bytes\n", key, strlen(key_value));
+ fprintf(fp, "config_key=%s\n", key_value);
+
+ free (key_value);
+ ite = xine_list_next(node->config_entry_list, ite);
+ }
}
fprintf(fp, "\n");
@@ -898,7 +956,7 @@ static void save_plugin_list(FILE *fp, xine_sarray_t *list) {
/*
* load plugin list information from file (cached catalog)
*/
-static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
+static void load_plugin_list(xine_t *this, FILE *fp, xine_sarray_t *plugins) {
plugin_node_t *node;
plugin_file_t *file;
@@ -911,20 +969,29 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
int i;
uint64_t llu;
unsigned long lu;
- char line[1024];
+ char *line;
char *value;
+ size_t line_len;
int version_ok = 0;
+ line = malloc(LINE_MAX_LENGTH);
+ if (!line)
+ return;
+
node = NULL;
file = NULL;
- while (fgets (line, 1023, fp)) {
+ while (fgets (line, LINE_MAX_LENGTH, fp)) {
if (line[0] == '#')
continue;
+ line_len = strlen(line);
+ if (line_len < 3)
+ continue;
- if( (value = strchr(line, '\r')) || (value = strchr(line, '\n')) )
- *value = (char) 0; /* eliminate any cr/lf */
+ value = &line[line_len - 1];
+ if( (*value == '\r') || (*value == '\n') )
+ *value-- = (char) 0; /* eliminate any cr/lf */
- if( (value = strchr(line, '\r')) || (value = strchr(line, '\n')) )
+ if( (*value == '\r') || (*value == '\n') )
*value = (char) 0; /* eliminate any cr/lf */
if (line[0] == '[' && version_ok) {
@@ -1018,15 +1085,16 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
vo_info->visual_type = i;
} else if( !strcmp("supported_types",line) && decoder_info ) {
char *s;
+ uint32_t *supported_types;
for( s = value, i = 0; s && sscanf(s," %lu",&lu) > 0; i++ ) {
s = strchr(s+1, ' ');
}
- decoder_info->supported_types = calloc((i+1), sizeof(uint32_t));
- for( s = value, i = 0; s && sscanf(s," %lu",&lu) > 0; i++ ) {
- decoder_info->supported_types[i] = lu;
+ supported_types = calloc((i+1), sizeof(uint32_t));
+ for( s = value, i = 0; s && sscanf(s," %"SCNu32,&supported_types[i]) > 0; i++ ) {
s = strchr(s+1, ' ');
}
+ decoder_info->supported_types = supported_types;
} else if( !strcmp("vo_priority",line) && vo_info ) {
sscanf(value," %d",&i);
vo_info->priority = i;
@@ -1043,8 +1111,18 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
sscanf(value," %d",&i);
input_info->priority = i;
} else if( !strcmp("post_type",line) && post_info ) {
- sscanf(value," %lu",&lu);
- post_info->type = lu;
+ sscanf(value," %lu",&lu);
+ post_info->type = lu;
+ } else if( !strcmp("config_key",line) ) {
+ char* cfg_key;
+
+ cfg_key = this->config->register_serialized_entry(this->config, value);
+ if (cfg_key) {
+ /* this node is a cached node */
+ _attach_entry_to_node(node, cfg_key);
+ } else {
+ lprintf("failed to deserialize config entry key\n");
+ }
}
}
}
@@ -1053,29 +1131,76 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) {
if( node ) {
xine_sarray_add (plugins, node);
}
+
+ free (line);
}
+/**
+ * @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, *cachefile_new, *dirfile;
- const char *relname = CACHE_CATALOG_FILE;
- const char *dirname = CACHE_CATALOG_DIR;
+ char *const cachefile = catalog_filename(this, 1);
+ char *cachefile_new;
- const char *const homedir = xine_get_homedir();
+ if ( ! cachefile ) return;
- cachefile = _x_asprintf("%s/%s", homedir, relname);
cachefile_new = _x_asprintf("%s.new", cachefile);
- /* make sure homedir (~/.xine) exists */
- dirfile = _x_asprintf("%s/%s", homedir, dirname);
- mkdir (dirfile, 0755);
- free (dirfile);
-
if( (fp = fopen(cachefile_new,"w")) != NULL ) {
int i;
@@ -1083,7 +1208,7 @@ static void save_catalog (xine_t *this) {
fprintf(fp, "cache_catalog_version=%d\n\n", CACHE_CATALOG_VERSION);
for (i = 0; i < PLUGIN_TYPE_MAX; i++) {
- save_plugin_list (fp, this->plugin_catalog->plugin_lists[i]);
+ save_plugin_list (this, fp, this->plugin_catalog->plugin_lists[i]);
}
if (fclose(fp))
{
@@ -1116,13 +1241,11 @@ 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 = _x_asprintf("%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);
+ load_plugin_list (this, fp, this->plugin_catalog->cache_list);
fclose(fp);
}
free(cachefile);
@@ -1158,7 +1281,7 @@ void _x_scan_plugins (xine_t *this) {
homedir = strdup(xine_get_homedir());
this->plugin_catalog = _new_catalog();
- load_cached_catalog (this);
+ XINE_PROFILE(load_cached_catalog (this));
if ((pluginpath = getenv("XINE_PLUGIN_PATH")) != NULL && *pluginpath) {
char *p = pluginpath;
@@ -1201,11 +1324,11 @@ void _x_scan_plugins (xine_t *this) {
xine_list_delete (plugindirs);
free(homedir);
- if ((_x_flags & XINE_FLAG_NO_WRITE_CACHE) == 0)
- save_catalog (this);
-
load_required_plugins (this);
+ if ((_x_flags & XINE_FLAG_NO_WRITE_CACHE) == 0)
+ XINE_PROFILE(save_catalog (this));
+
map_decoders (this);
}
@@ -1247,6 +1370,7 @@ void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) {
plugin_node_t *node = input->node;
input->dispose(input);
+
if (node) {
pthread_mutex_lock(&catalog->lock);
dec_node_ref(node);
@@ -1261,7 +1385,7 @@ static int probe_mime_type (xine_t *self, plugin_node_t *node, const char *mime_
{
const unsigned int mime_type_len = strlen (mime_type);
demux_class_t *cls = (demux_class_t *)node->plugin_class;
- const char *mime = cls->get_mimetypes (cls);
+ const char *mime = cls->mimetypes;
while (mime)
{
while (*mime == ';' || isspace (*mime))
@@ -1311,7 +1435,7 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth
/* If detecting by MRL, try the MIME type first (but not text/plain)... */
stream->content_detection_method = METHOD_EXPLICIT;
- if (methods[i] == METHOD_BY_EXTENSION &&
+ if (methods[i] == METHOD_BY_MRL &&
stream->input_plugin->get_optional_data &&
stream->input_plugin->get_optional_data (stream->input_plugin, NULL, INPUT_OPTIONAL_DATA_DEMUX_MIME_TYPE) != INPUT_OPTIONAL_UNSUPPORTED &&
stream->input_plugin->get_optional_data (stream->input_plugin, &mime_type, INPUT_OPTIONAL_DATA_MIME_TYPE) != INPUT_OPTIONAL_UNSUPPORTED &&
@@ -1326,6 +1450,12 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth
/* ... then try the extension */
stream->content_detection_method = methods[i];
+ if ( stream->content_detection_method == METHOD_BY_MRL &&
+ ! _x_demux_check_extension(input->get_mrl(input),
+ ((demux_class_t *)node->plugin_class)->extensions)
+ )
+ continue;
+
if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
inc_node_ref(node);
plugin->node = node;
@@ -1347,16 +1477,16 @@ demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *inp
switch (stream->xine->demux_strategy) {
case XINE_DEMUX_DEFAULT_STRATEGY:
- return probe_demux (stream, METHOD_BY_CONTENT, METHOD_BY_EXTENSION, input);
+ return probe_demux (stream, METHOD_BY_CONTENT, METHOD_BY_MRL, input);
case XINE_DEMUX_REVERT_STRATEGY:
- return probe_demux (stream, METHOD_BY_EXTENSION, METHOD_BY_CONTENT, input);
+ return probe_demux (stream, METHOD_BY_MRL, METHOD_BY_CONTENT, input);
case XINE_DEMUX_CONTENT_STRATEGY:
return probe_demux (stream, METHOD_BY_CONTENT, -1, input);
case XINE_DEMUX_EXTENSION_STRATEGY:
- return probe_demux (stream, METHOD_BY_EXTENSION, -1, input);
+ return probe_demux (stream, METHOD_BY_MRL, -1, input);
default:
xprintf (stream->xine, XINE_VERBOSITY_LOG,
@@ -1385,6 +1515,13 @@ demux_plugin_t *_x_find_demux_plugin_by_name(xine_stream_t *stream, const char *
if (strcasecmp(node->info->id, name) == 0) {
if (node->plugin_class || _load_plugin_class(stream->xine, node, NULL)) {
+
+ if ( stream->content_detection_method == METHOD_BY_MRL &&
+ ! _x_demux_check_extension(input->get_mrl(input),
+ ((demux_class_t *)node->plugin_class)->extensions)
+ )
+ continue;
+
if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
inc_node_ref(node);
plugin->node = node;
@@ -1417,7 +1554,7 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha
demux_plugin_t *plugin = NULL;
methods[0] = METHOD_BY_CONTENT;
- methods[1] = METHOD_BY_EXTENSION;
+ methods[1] = METHOD_BY_MRL;
methods[2] = -1;
i = 0;
@@ -1442,6 +1579,14 @@ demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const cha
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
"load_plugin: probing '%s' (method %d)...\n", node->info->id, stream->content_detection_method );
if (node->plugin_class || _load_plugin_class(xine, node, NULL)) {
+
+ if ( stream->content_detection_method == METHOD_BY_MRL &&
+ ! _x_demux_check_extension(input->get_mrl(input),
+ ((demux_class_t *)node->plugin_class)->extensions)
+ )
+ continue;
+
+
if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) {
xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
"load_plugins: using demuxer '%s' (instead of '%s')\n", node->info->id, last_demux_name);
@@ -1485,6 +1630,7 @@ void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) {
plugin_node_t *node = demux->node;
demux->dispose(demux);
+
if (node) {
pthread_mutex_lock(&catalog->lock);
dec_node_ref(node);
@@ -1664,7 +1810,7 @@ xine_video_port_t *xine_new_framegrab_video_port (xine_t *this) {
vo_driver_t *driver;
xine_video_port_t *port;
plugin_catalog_t *catalog = this->plugin_catalog;
- char *id;
+ const char *id;
int list_id, list_size;
driver = NULL;
@@ -1878,8 +2024,8 @@ void xine_close_video_driver (xine_t *this, xine_video_port_t *vo_port) {
* get autoplay mrl list from input plugin
*/
-char **xine_get_autoplay_mrls (xine_t *this, const char *plugin_id,
- int *num_mrls) {
+const char * const *xine_get_autoplay_mrls (xine_t *this, const char *plugin_id,
+ int *num_mrls) {
plugin_catalog_t *catalog;
plugin_node_t *node;
@@ -1976,7 +2122,13 @@ video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_typ
vd = ((video_decoder_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream);
- if (vd) {
+ if (vd == (video_decoder_t*)1) {
+ /* HACK: plugin failed to instantiate because required resources are unavailable at that time,
+ but may be available later, so don't remove this plugin from catalog. */
+ xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
+ "load_plugins: plugin %s failed to instantiate, resources temporarily unavailable.\n", node->info->id);
+ }
+ else if (vd) {
inc_node_ref(node);
vd->node = node;
xprintf(stream->xine, XINE_VERBOSITY_DEBUG,
@@ -2314,7 +2466,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;
@@ -2352,7 +2504,7 @@ const char *const *xine_list_post_plugins_typed(xine_t *xine, int type) {
else \
return NULL; \
} \
- return ic->get_description(ic); \
+ return dgettext(ic->text_domain ? : XINE_TEXTDOMAIN, ic->description); \
} \
} \
return NULL; \
@@ -2480,7 +2632,7 @@ void xine_post_dispose(xine_t *xine, xine_post_t *post_gen) {
* @param joining String to use to join the various strings together.
* @param final_length The pre-calculated final length of the string.
*/
-static char *_x_concatenate_with_string(char const **strings, size_t count, char *joining, size_t final_length) {
+static char *_x_concatenate_with_string(char const **strings, size_t count, const char *joining, size_t final_length) {
size_t i;
char *const result = malloc(final_length+1); /* Better be safe */
char *str = result;
@@ -2517,7 +2669,7 @@ char *xine_get_file_extensions (xine_t *self) {
plugin_node_t *const node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
demux_class_t *const cls = (demux_class_t *)node->plugin_class;
- if( (extensions[list_id] = cls->get_extensions(cls)) != NULL )
+ if( (extensions[list_id] = cls->extensions) != NULL )
len += strlen(extensions[list_id]) +1;
}
}
@@ -2556,7 +2708,7 @@ char *xine_get_mime_types (xine_t *self) {
plugin_node_t *const node = xine_sarray_get (catalog->plugin_lists[PLUGIN_DEMUX - 1], list_id);
if (node->plugin_class || _load_plugin_class(self, node, NULL)) {
demux_class_t *const cls = (demux_class_t *)node->plugin_class;
- if( (mimetypes[list_id] = cls->get_mimetypes(cls)) != NULL )
+ if( (mimetypes[list_id] = cls->mimetypes) != NULL )
len += strlen(mimetypes[list_id]);
}
}
@@ -2602,7 +2754,7 @@ char *xine_get_demux_for_mime_type (xine_t *self, const char *mime_type) {
}
-static void dispose_plugin_list (xine_sarray_t *list) {
+static void dispose_plugin_list (xine_sarray_t *list, int is_cache) {
plugin_node_t *node;
decoder_info_t *decoder_info;
@@ -2629,7 +2781,7 @@ static void dispose_plugin_list (xine_sarray_t *list) {
case PLUGIN_VIDEO_DECODER:
decoder_info = (decoder_info_t *)node->info->special_info;
- free (decoder_info->supported_types);
+ free ((void *)decoder_info->supported_types);
default:
free ((void *)node->info->special_info);
@@ -2637,8 +2789,21 @@ static void dispose_plugin_list (xine_sarray_t *list) {
}
/* free info structure and string copies */
- free (node->info->id);
+ free ((void *)node->info->id);
free (node->info);
+
+ /* don't free the entry list if the node is cache */
+ if (!is_cache) {
+ if (node->config_entry_list) {
+ xine_list_iterator_t ite = xine_list_front (node->config_entry_list);
+ while (ite) {
+ char *key = xine_list_get_value (node->config_entry_list, ite);
+ free (key);
+ ite = xine_list_next (node->config_entry_list, ite);
+ }
+ xine_list_delete(node->config_entry_list);
+ }
+ }
free (node);
}
xine_sarray_delete(list);
@@ -2671,10 +2836,10 @@ void _x_dispose_plugins (xine_t *this) {
int i;
for (i = 0; i < PLUGIN_TYPE_MAX; i++) {
- dispose_plugin_list (this->plugin_catalog->plugin_lists[i]);
+ dispose_plugin_list (this->plugin_catalog->plugin_lists[i], 0);
}
- dispose_plugin_list (this->plugin_catalog->cache_list);
+ dispose_plugin_list (this->plugin_catalog->cache_list, 1);
dispose_plugin_file_list (this->plugin_catalog->file_list);
for (i = 0; this->plugin_catalog->prio_desc[i]; i++)
diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c
index 89d4b2654..9acc2f1b6 100644
--- a/src/xine-engine/lrb.c
+++ b/src/xine-engine/lrb.c
@@ -23,7 +23,7 @@
#endif
#include "lrb.h"
-#include "xineutils.h"
+#include <xine/xineutils.h>
lrb_t *lrb_new (int max_num_entries,
fifo_buffer_t *fifo) {
diff --git a/src/xine-engine/lrb.h b/src/xine-engine/lrb.h
index f64e50eab..dfac5e543 100644
--- a/src/xine-engine/lrb.h
+++ b/src/xine-engine/lrb.h
@@ -24,11 +24,7 @@
#ifndef HAVE_LRB_H
#define HAVE_LRB_H
-#ifdef XINE_COMPILE
-# include "buffer.h"
-#else
-# include <xine/buffer.h>
-#endif
+#include <xine/buffer.h>
typedef struct {
diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c
index 8cd36f70f..0ee481d35 100644
--- a/src/xine-engine/metronom.c
+++ b/src/xine-engine/metronom.c
@@ -40,9 +40,9 @@
#define METRONOM_INTERNAL
#define METRONOM_CLOCK_INTERNAL
-#include "xine_internal.h"
-#include "metronom.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/metronom.h>
+#include <xine/xineutils.h>
#define MAX_AUDIO_DELTA 1600
#define AUDIO_SAMPLE_NUM 32768
@@ -848,7 +848,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;
@@ -871,7 +872,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) {
@@ -987,7 +988,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
deleted file mode 100644
index 946aa0991..000000000
--- a/src/xine-engine/metronom.h
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * metronom: general pts => virtual calculation/assoc
- *
- * virtual pts: unit 1/90000 sec, always increasing
- * can be used for synchronization
- * video/audio frame with same pts also have same vpts
- * but pts is likely to differ from vpts
- *
- * the basic idea is:
- * video_pts + video_wrap_offset = video_vpts
- * audio_pts + audio_wrap_offset = audio_vpts
- *
- * - video_wrap_offset should be equal to audio_wrap_offset as to have
- * perfect audio and video sync. They will differ on brief periods due
- * discontinuity correction.
- * - metronom should also interpolate vpts values most of the time as
- * video_pts and audio_vpts are not given for every frame.
- * - corrections to the frame rate may be needed to cope with bad
- * encoded streams.
- */
-
-#ifndef HAVE_METRONOM_H
-#define HAVE_METRONOM_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <pthread.h>
-
-#ifdef XINE_COMPILE
-# include "video_out.h"
-# include "xine.h"
-#else
-# include <xine/video_out.h>
-# include <xine.h>
-#endif
-
-typedef struct metronom_s metronom_t ;
-typedef struct metronom_clock_s metronom_clock_t;
-typedef struct scr_plugin_s scr_plugin_t;
-
-/* metronom prebuffer can be adjusted with XINE_PARAM_METRONOM_PREBUFFER.
- * it sets how much the first video/audio frame should be delayed to
- * have some prebuffering at the output layers. reducing this value (about
- * 1/8 sec) may result in faster seeking (good to simulate play backwards,
- * for example).
- */
-#define PREBUFFER_PTS_OFFSET 12000
-
- /* see below */
-#define DISC_STREAMSTART 0
-#define DISC_RELATIVE 1
-#define DISC_ABSOLUTE 2
-#define DISC_STREAMSEEK 3
-
-struct metronom_s {
-
- /*
- * called by audio output driver to inform metronom about current audio
- * samplerate
- *
- * parameter pts_per_smpls : 1/90000 sec per 65536 samples
- */
- void (*set_audio_rate) (metronom_t *self, int64_t pts_per_smpls);
-
- /*
- * called by video output driver for *every* frame
- *
- * parameter frame containing pts, scr, ... information
- *
- * will set vpts field in frame
- *
- * this function will also update video_wrap_offset if a discontinuity
- * is detected (read the comentaries below about discontinuities).
- *
- */
-
- void (*got_video_frame) (metronom_t *self, vo_frame_t *frame);
-
- /*
- * called by audio output driver whenever audio samples are delivered to it
- *
- * parameter pts : pts for audio data if known, 0 otherwise
- * nsamples : number of samples delivered
- *
- * return value: virtual pts for audio data
- *
- * this function will also update audio_wrap_offset if a discontinuity
- * is detected (read the comentaries below about discontinuities).
- *
- */
-
- int64_t (*got_audio_samples) (metronom_t *self, int64_t pts,
- int nsamples);
-
- /*
- * called by SPU decoder whenever a packet is delivered to it
- *
- * parameter pts : pts for SPU packet if known, 0 otherwise
- *
- * return value: virtual pts for SPU packet
- * (this is the only pts to vpts function that cannot update the wrap_offset
- * due to the lack of regularity on spu packets)
- */
-
- int64_t (*got_spu_packet) (metronom_t *self, int64_t pts);
-
- /*
- * tell metronom about discontinuities.
- *
- * these functions are called due to a discontinuity detected at
- * demux stage.
- *
- * there are different types of discontinuities:
- *
- * DISC_STREAMSTART : new stream starts, expect pts values to start
- * from zero immediately
- * DISC_RELATIVE : typically a wrap-around, expect pts with
- * a specified offset from the former ones soon
- * DISC_ABSOLUTE : typically a new menu stream (nav packets)
- * pts will start from given value soon
- * DISC_STREAMSEEK : used by video and audio decoder loop,
- * when a buffer with BUF_FLAG_SEEK set is encountered;
- * applies the necessary vpts offset for the seek in
- * metronom, but keeps the vpts difference between
- * audio and video, so that metronom doesn't cough
- */
- void (*handle_audio_discontinuity) (metronom_t *self, int type, int64_t disc_off);
- void (*handle_video_discontinuity) (metronom_t *self, int type, int64_t disc_off);
-
- /*
- * set/get options for metronom, constants see below
- */
- void (*set_option) (metronom_t *self, int option, int64_t value);
- int64_t (*get_option) (metronom_t *self, int option);
-
- /*
- * set a master metronom
- * this is currently useful to sync independently generated streams
- * (e.g. by post plugins) to the discontinuity domain of another
- * metronom
- */
- void (*set_master) (metronom_t *self, metronom_t *master);
-
- void (*exit) (metronom_t *self);
-
-#ifdef METRONOM_INTERNAL
- /*
- * metronom internal stuff
- */
- xine_t *xine;
-
- metronom_t *master;
-
- int64_t pts_per_smpls;
-
- int64_t video_vpts;
- int64_t spu_vpts;
- int64_t audio_vpts;
- int64_t audio_vpts_rmndr; /* the remainder for integer division */
-
- int64_t vpts_offset;
-
- int64_t video_drift;
- int64_t video_drift_step;
-
- int audio_samples;
- int64_t audio_drift_step;
-
- int64_t prebuffer;
- int64_t av_offset;
- int64_t spu_offset;
-
- pthread_mutex_t lock;
-
- int have_video;
- int have_audio;
- int video_discontinuity_count;
- int audio_discontinuity_count;
- int discontinuity_handled_count;
- pthread_cond_t video_discontinuity_reached;
- pthread_cond_t audio_discontinuity_reached;
-
- int force_video_jump;
- int force_audio_jump;
-
- int64_t img_duration;
- int img_cpt;
- int64_t last_video_pts;
- int64_t last_audio_pts;
-
- int video_mode;
-#endif
-};
-
-/*
- * metronom options
- */
-
-#define METRONOM_AV_OFFSET 2
-#define METRONOM_ADJ_VPTS_OFFSET 3
-#define METRONOM_FRAME_DURATION 4
-#define METRONOM_SPU_OFFSET 5
-#define METRONOM_VPTS_OFFSET 6
-#define METRONOM_PREBUFFER 7
-
-metronom_t *_x_metronom_init (int have_video, int have_audio, xine_t *xine) XINE_MALLOC XINE_PROTECTED;
-
-/* FIXME: reorder this structure on the next cleanup to remove the dummies */
-struct metronom_clock_s {
-
- /*
- * set/get options for clock, constants see below
- */
- void (*set_option) (metronom_clock_t *self, int option, int64_t value);
- int64_t (*get_option) (metronom_clock_t *self, int option);
-
- /*
- * system clock reference (SCR) functions
- */
-
-#ifdef METRONOM_CLOCK_INTERNAL
- /*
- * start clock (no clock reset)
- * at given pts
- */
- void (*start_clock) (metronom_clock_t *self, int64_t pts);
-
-
- /*
- * stop metronom clock
- */
- void (*stop_clock) (metronom_clock_t *self);
-
-
- /*
- * resume clock from where it was stopped
- */
- void (*resume_clock) (metronom_clock_t *self);
-#else
- void *dummy1;
- void *dummy2;
- void *dummy3;
-#endif
-
-
- /*
- * get current clock value in vpts
- */
- int64_t (*get_current_time) (metronom_clock_t *self);
-
-
- /*
- * adjust master clock to external timer (e.g. audio hardware)
- */
- void (*adjust_clock) (metronom_clock_t *self, int64_t desired_pts);
-
-#ifdef METRONOM_CLOCK_INTERNAL
- /*
- * set clock speed
- * for constants see xine_internal.h
- */
-
- int (*set_fine_speed) (metronom_clock_t *self, int speed);
-#else
- void *dummy4;
-#endif
-
- /*
- * (un)register a System Clock Reference provider at the metronom
- */
- int (*register_scr) (metronom_clock_t *self, scr_plugin_t *scr);
- void (*unregister_scr) (metronom_clock_t *self, scr_plugin_t *scr);
-
-#ifdef METRONOM_CLOCK_INTERNAL
- void (*exit) (metronom_clock_t *self);
-
- xine_t *xine;
-
- scr_plugin_t *scr_master;
- scr_plugin_t **scr_list;
- pthread_t sync_thread;
- int thread_running;
- int scr_adjustable;
-#else
- void *dummy5;
- void *dummy6;
- void *dummy7;
- void *dummy8;
- pthread_t dummy9;
- int dummy10;
- int dummy11;
-#endif
-
- int speed;
-
-#ifdef METRONOM_CLOCK_INTERNAL
- pthread_mutex_t lock;
- pthread_cond_t cancel;
-#endif
-};
-
-metronom_clock_t *_x_metronom_clock_init(xine_t *xine) XINE_MALLOC XINE_PROTECTED;
-
-/*
- * clock options
- */
-
-#define CLOCK_SCR_ADJUSTABLE 1
-
-/*
- * SCR (system clock reference) plugins
- */
-
-struct scr_plugin_s
-{
- int interface_version;
-
- int (*get_priority) (scr_plugin_t *self);
-
- /*
- * set/get clock speed
- *
- * for speed constants see xine_internal.h
- * returns actual speed
- */
-
- int (*set_fine_speed) (scr_plugin_t *self, int speed);
-
- void (*adjust) (scr_plugin_t *self, int64_t vpts);
-
- void (*start) (scr_plugin_t *self, int64_t start_vpts);
-
- int64_t (*get_current) (scr_plugin_t *self);
-
- void (*exit) (scr_plugin_t *self);
-
- metronom_clock_t *clock;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index 6914f6386..cf54cac84 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -20,8 +20,6 @@
* OSD stuff (text and graphic primitives)
*/
-#define __OSD_C__
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -40,6 +38,8 @@
# include <iconv.h>
#endif
+#include <basedir.h>
+
#define LOG_MODULE "osd"
#define LOG_VERBOSE
/*
@@ -48,11 +48,11 @@
#define XINE_ENGINE_INTERNAL
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#include "xine-engine/bswap.h"
-#include "xineutils.h"
-#include "video_out.h"
-#include "osd.h"
+#include <xine/xineutils.h>
+#include <xine/video_out.h>
+#include <xine/osd.h>
#ifdef HAVE_FT2
#include <ft2build.h>
@@ -97,6 +97,100 @@
# define FT_LOAD_FLAGS (FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING)
#endif
+/* This text descriptions are used for config screen */
+static const char *const textpalettes_str[NUMBER_OF_TEXT_PALETTES+1] = {
+ "white-black-transparent",
+ "white-none-transparent",
+ "white-none-translucid",
+ "yellow-black-transparent",
+ NULL};
+
+/*
+ Palette entries as used by osd fonts:
+
+ 0: not used by font, always transparent
+ 1: font background, usually transparent, may be used to implement
+ translucid boxes where the font will be printed.
+ 2-5: transition between background and border (usually only alpha
+ value changes).
+ 6: font border. if the font is to be displayed without border this
+ will probably be adjusted to font background or near.
+ 7-9: transition between border and foreground
+ 10: font color (foreground)
+*/
+
+/*
+ The palettes below were made by hand, ie, i just throw
+ values that seemed to do the transitions i wanted.
+ This can surelly be improved a lot. [Miguel]
+*/
+
+static const clut_t textpalettes_color[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = {
+/* white, black border, transparent */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/
+ CLUT_Y_CR_CB_INIT(0x40, 0x80, 0x80), /*7*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*8*/
+ CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*9*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/
+ },
+ /* white, no border, transparent */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*1*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*2*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*3*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*4*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*5*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*6*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*7*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*8*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*9*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/
+ },
+ /* white, no border, translucid */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*1*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*2*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*3*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*4*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*5*/
+ CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*6*/
+ CLUT_Y_CR_CB_INIT(0xa0, 0x80, 0x80), /*7*/
+ CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*8*/
+ CLUT_Y_CR_CB_INIT(0xe0, 0x80, 0x80), /*9*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/
+ },
+ /* yellow, black border, transparent */
+ {
+ CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/
+ CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/
+ CLUT_Y_CR_CB_INIT(0x40, 0x84, 0x60), /*7*/
+ CLUT_Y_CR_CB_INIT(0x70, 0x88, 0x40), /*8*/
+ CLUT_Y_CR_CB_INIT(0xb0, 0x8a, 0x20), /*9*/
+ CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00), /*10*/
+ },
+};
+
+static const uint8_t textpalettes_trans[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = {
+ {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 },
+ {0, 0, 0, 0, 0, 0, 2, 6, 9, 12, 15 },
+ {0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15 },
+ {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 },
+};
+
typedef struct osd_fontchar_s {
uint8_t *bmp;
uint16_t code;
@@ -157,9 +251,16 @@ static osd_object_t *XINE_MALLOC osd_new_object (osd_renderer_t *this, int width
osd->next = this->osds;
this->osds = osd;
+ osd->video_window_x = 0;
+ osd->video_window_y = 0;
+ osd->video_window_width = 0;
+ osd->video_window_height = 0;
+ osd->extent_width = 0;
+ osd->extent_height = 0;
osd->width = width;
osd->height = height;
osd->area = calloc(width, height);
+ osd->area_touched = 0;
osd->x1 = width;
osd->y1 = height;
@@ -183,6 +284,66 @@ static osd_object_t *XINE_MALLOC osd_new_object (osd_renderer_t *this, int width
return osd;
}
+/*
+ * osd extent must be set to achive video resolution independent osds
+ * both sizes must be > 0 to take effect. otherwise, video resolution
+ * will still be used. the extent defines the reference coordinate
+ * system which is matched to the video output area.
+ */
+static void osd_set_extent (osd_object_t *osd, int extent_width, int extent_height) {
+
+ osd->extent_width = extent_width;
+ osd->extent_height = extent_height;
+}
+
+/*
+ * osd video window defines an area withing osd extent where the
+ * video shall be scaled to while an osd is displayed on screen.
+ * both width and height must be > 0 to take effect.
+ */
+static void osd_set_video_window (osd_object_t *osd, int window_x, int window_y, int window_width, int window_height) {
+
+ osd->video_window_x = window_x;
+ osd->video_window_y = window_y;
+ osd->video_window_width = window_width;
+ osd->video_window_height = window_height;
+}
+
+static argb_layer_t *argb_layer_create() {
+
+ argb_layer_t *argb_layer = (argb_layer_t *)calloc(1, sizeof (argb_layer_t));
+
+ pthread_mutex_init(&argb_layer->mutex, NULL);
+ return argb_layer;
+}
+
+static void argb_layer_destroy(argb_layer_t *argb_layer) {
+
+ pthread_mutex_destroy(&argb_layer->mutex);
+ free(argb_layer);
+}
+
+void set_argb_layer_ptr(argb_layer_t **dst, argb_layer_t *src) {
+
+ if (src) {
+ pthread_mutex_lock(&src->mutex);
+ ++src->ref_count;
+ pthread_mutex_unlock(&src->mutex);
+ }
+
+ if (*dst) {
+ int free_argb_layer;
+
+ pthread_mutex_lock(&(*dst)->mutex);
+ free_argb_layer = (0 == --(*dst)->ref_count);
+ pthread_mutex_unlock(&(*dst)->mutex);
+
+ if (free_argb_layer)
+ argb_layer_destroy(*dst);
+ }
+
+ *dst = src;
+}
/*
@@ -242,12 +403,23 @@ static int _osd_show (osd_object_t *osd, int64_t vpts, int unscaled ) {
this->event.object.handle = osd->handle;
memset( this->event.object.overlay, 0, sizeof(*this->event.object.overlay) );
+
+ set_argb_layer_ptr(&this->event.object.overlay->argb_layer, osd->argb_layer);
+
this->event.object.overlay->unscaled = unscaled;
this->event.object.overlay->x = osd->display_x + osd->x1;
this->event.object.overlay->y = osd->display_y + osd->y1;
this->event.object.overlay->width = osd->x2 - osd->x1;
this->event.object.overlay->height = osd->y2 - osd->y1;
+ this->event.object.overlay->video_window_x = osd->video_window_x;
+ this->event.object.overlay->video_window_y = osd->video_window_y;
+ this->event.object.overlay->video_window_width = osd->video_window_width;
+ this->event.object.overlay->video_window_height = osd->video_window_height;
+
+ this->event.object.overlay->extent_width = osd->extent_width;
+ this->event.object.overlay->extent_height = osd->extent_height;
+
this->event.object.overlay->hili_top = 0;
this->event.object.overlay->hili_bottom = this->event.object.overlay->height;
this->event.object.overlay->hili_left = 0;
@@ -255,57 +427,65 @@ static int _osd_show (osd_object_t *osd, int64_t vpts, int unscaled ) {
/* there will be at least that many rle objects (one for each row) */
this->event.object.overlay->num_rle = 0;
- /* We will never need more rle objects than columns in any row
- Rely on lazy page allocation to avoid us actually taking up
- this much RAM */
- this->event.object.overlay->data_size = osd->width * osd->height;
- rle_p = this->event.object.overlay->rle =
- malloc(this->event.object.overlay->data_size * sizeof(rle_elem_t) );
-
- for( y = osd->y1; y < osd->y2; y++ ) {
+ if (!osd->area_touched) {
+ /* avoid rle encoding when only argb_layer is modified */
+ this->event.object.overlay->data_size = 0;
+ rle_p = this->event.object.overlay->rle = NULL;
+ } else {
+ /* We will never need more rle objects than columns in any row
+ Rely on lazy page allocation to avoid us actually taking up
+ this much RAM */
+ this->event.object.overlay->data_size = osd->width * osd->height;
+ rle_p = this->event.object.overlay->rle =
+ malloc(this->event.object.overlay->data_size * sizeof(rle_elem_t) );
+
+ for( y = osd->y1; y < osd->y2; y++ ) {
#ifdef DEBUG_RLE
- lprintf("osd_show %p y = %d: ", osd, y);
+ lprintf("osd_show %p y = %d: ", osd, y);
#endif
- c = osd->area + y * osd->width + osd->x1;
+ c = osd->area + y * osd->width + osd->x1;
- /* initialize a rle object with the first pixel's color */
- rle.len = 1;
- rle.color = *c++;
+ /* initialize a rle object with the first pixel's color */
+ rle.len = 1;
+ rle.color = *c++;
- /* loop over the remaining pixels in the row */
- for( x = osd->x1 + rle.len; x < osd->x2; x++, c++ ) {
- if( rle.color != *c ) {
+ /* loop over the remaining pixels in the row */
+ for( x = osd->x1 + rle.len; x < osd->x2; x++, c++ ) {
+ if( rle.color != *c ) {
#ifdef DEBUG_RLE
- lprintf("(%d, %d), ", rle.len, rle.color);
+ lprintf("(%d, %d), ", rle.len, rle.color);
#endif
- *rle_p++ = rle;
- this->event.object.overlay->num_rle++;
+ *rle_p++ = rle;
+ this->event.object.overlay->num_rle++;
- rle.color = *c;
- rle.len = 1;
- } else {
- rle.len++;
+ rle.color = *c;
+ rle.len = 1;
+ } else {
+ rle.len++;
+ }
}
- }
#ifdef DEBUG_RLE
- lprintf("(%d, %d)\n", rle.len, rle.color);
+ lprintf("(%d, %d)\n", rle.len, rle.color);
#endif
- *rle_p++ = rle;
- this->event.object.overlay->num_rle++;
- }
+ *rle_p++ = rle;
+ this->event.object.overlay->num_rle++;
+ }
#ifdef DEBUG_RLE
- lprintf("osd_show %p rle ends\n", osd);
+ lprintf("osd_show %p rle ends\n", osd);
#endif
- lprintf("num_rle = %d\n", this->event.object.overlay->num_rle);
+ lprintf("num_rle = %d\n", this->event.object.overlay->num_rle);
- memcpy(this->event.object.overlay->hili_color, osd->color, sizeof(osd->color));
- memcpy(this->event.object.overlay->hili_trans, osd->trans, sizeof(osd->trans));
- memcpy(this->event.object.overlay->color, osd->color, sizeof(osd->color));
- memcpy(this->event.object.overlay->trans, osd->trans, sizeof(osd->trans));
+ memcpy(this->event.object.overlay->hili_color, osd->color, sizeof(osd->color));
+ memcpy(this->event.object.overlay->hili_trans, osd->trans, sizeof(osd->trans));
+ memcpy(this->event.object.overlay->color, osd->color, sizeof(osd->color));
+ memcpy(this->event.object.overlay->trans, osd->trans, sizeof(osd->trans));
+ }
this->event.event_type = OVERLAY_EVENT_SHOW;
this->event.vpts = vpts;
ovl_manager->add_event(ovl_manager, (void *)&this->event);
+
+ set_argb_layer_ptr(&this->event.object.overlay->argb_layer, NULL);
} else {
/* osd empty - hide it */
_osd_hide(osd, vpts);
@@ -385,11 +565,24 @@ static int osd_hide (osd_object_t *osd, int64_t vpts) {
static void osd_clear (osd_object_t *osd) {
lprintf("osd=%p\n",osd);
- memset(osd->area, 0, osd->width * osd->height);
+ if (osd->area_touched) {
+ osd->area_touched = 0;
+ memset(osd->area, 0, osd->width * osd->height);
+ }
+
osd->x1 = osd->width;
osd->y1 = osd->height;
osd->x2 = 0;
osd->y2 = 0;
+
+ if (osd->argb_layer) {
+ pthread_mutex_lock(&osd->argb_layer->mutex);
+ osd->argb_layer->x1 = osd->x1;
+ osd->argb_layer->y1 = osd->y1;
+ osd->argb_layer->x2 = osd->x2;
+ osd->argb_layer->y2 = osd->y2;
+ pthread_mutex_unlock(&osd->argb_layer->mutex);
+ }
}
/*
@@ -411,6 +604,7 @@ static void osd_point (osd_object_t *osd, int x, int y, int color) {
osd->x2 = MAX(osd->x2, (x + 1));
osd->y1 = MIN(osd->y1, y);
osd->y2 = MAX(osd->y2, (y + 1));
+ osd->area_touched = 1;
c = osd->area + y * osd->width + x;
*c = color;
@@ -470,6 +664,7 @@ static void osd_line (osd_object_t *osd,
osd->x2 = MAX( osd->x2, x2 );
osd->y1 = MIN( osd->y1, y1 );
osd->y2 = MAX( osd->y2, y2 );
+ osd->area_touched = 1;
dx = x2 - x1;
dy = y2 - y1;
@@ -583,6 +778,7 @@ static void osd_filled_rect (osd_object_t *osd,
osd->x2 = MAX( osd->x2, dx );
osd->y1 = MIN( osd->y1, y );
osd->y2 = MAX( osd->y2, dy );
+ osd->area_touched = 1;
dx -= x;
dy -= y;
@@ -819,6 +1015,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;
+ fontpath = _x_asprintf("%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 = calloc(1, sizeof(osd_ft2context_t));
@@ -836,67 +1119,18 @@ static int osd_set_font_freetype2( osd_object_t *osd, const char *fontname, int
osd->ft2->face = NULL;
}
+ 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;
- osd_free_ft2 (osd);
- return 0;
+ osd_free_ft2 (osd);
+ 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"));
@@ -1143,6 +1377,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1,
if( x1 < osd->x1 ) osd->x1 = x1;
if( y1 < osd->y1 ) osd->y1 = y1;
+ osd->area_touched = 1;
inbuf = text;
inbytesleft = strlen(text);
@@ -1467,6 +1702,12 @@ static void osd_free_object (osd_object_t *osd_to_close) {
osd_to_close->handle = -1; /* handle will be freed */
}
+ if (osd_to_close->argb_layer) {
+ /* clear argb buffer pointer so that buffer may be freed safely after returning */
+ this->set_argb_buffer(osd_to_close, NULL, 0, 0, 0, 0);
+ set_argb_layer_ptr(&osd_to_close->argb_layer, NULL);
+ }
+
pthread_mutex_lock (&this->osd_mutex);
last = NULL;
@@ -1528,6 +1769,7 @@ static void osd_draw_bitmap(osd_object_t *osd, uint8_t *bitmap,
osd->x2 = MAX( osd->x2, x1+width );
osd->y1 = MIN( osd->y1, y1 );
osd->y2 = MAX( osd->y2, y1+height );
+ osd->area_touched = 1;
for( y=0; y<height; y++ ) {
if ( palette_map ) {
@@ -1546,21 +1788,64 @@ static void osd_draw_bitmap(osd_object_t *osd, uint8_t *bitmap,
}
}
+static void osd_set_argb_buffer(osd_object_t *osd, uint32_t *argb_buffer,
+ int dirty_x, int dirty_y, int dirty_width, int dirty_height)
+{
+ if (!osd->argb_layer)
+ set_argb_layer_ptr(&osd->argb_layer, argb_layer_create());
+
+ if (osd->argb_layer->buffer != argb_buffer) {
+ dirty_x = 0;
+ dirty_y = 0;
+ dirty_width = osd->width;
+ dirty_height = osd->height;
+ }
+
+ /* keep osd_object clipping behavior */
+ osd->x1 = MIN( osd->x1, dirty_x );
+ osd->x2 = MAX( osd->x2, dirty_x + dirty_width );
+ osd->y1 = MIN( osd->y1, dirty_y );
+ osd->y2 = MAX( osd->y2, dirty_y + dirty_height );
+
+ pthread_mutex_lock(&osd->argb_layer->mutex);
+
+ /* argb layer update area accumulation */
+ osd->argb_layer->x1 = MIN( osd->argb_layer->x1, dirty_x );
+ osd->argb_layer->x2 = MAX( osd->argb_layer->x2, dirty_x + dirty_width );
+ osd->argb_layer->y1 = MIN( osd->argb_layer->y1, dirty_y );
+ osd->argb_layer->y2 = MAX( osd->argb_layer->y2, dirty_y + dirty_height );
+
+ osd->argb_layer->buffer = argb_buffer;
+
+ pthread_mutex_unlock(&osd->argb_layer->mutex);
+}
+
static uint32_t osd_get_capabilities (osd_object_t *osd) {
osd_renderer_t *this = osd->renderer;
uint32_t capabilities = 0;
+ uint32_t vo_capabilities;
#ifdef HAVE_FT2
capabilities |= XINE_OSD_CAP_FREETYPE2;
#endif
this->stream->xine->port_ticket->acquire(this->stream->xine->port_ticket, 1);
- if( this->stream->video_out->get_capabilities(this->stream->video_out) &
- VO_CAP_UNSCALED_OVERLAY)
- capabilities |= XINE_OSD_CAP_UNSCALED;
+ vo_capabilities = this->stream->video_out->get_capabilities(this->stream->video_out);
this->stream->xine->port_ticket->release(this->stream->xine->port_ticket, 1);
+ if (vo_capabilities & VO_CAP_UNSCALED_OVERLAY)
+ capabilities |= XINE_OSD_CAP_UNSCALED;
+
+ if (vo_capabilities & VO_CAP_CUSTOM_EXTENT_OVERLAY)
+ capabilities |= XINE_OSD_CAP_CUSTOM_EXTENT;
+
+ if (vo_capabilities & VO_CAP_ARGB_LAYER_OVERLAY)
+ capabilities |= XINE_OSD_CAP_ARGB_LAYER;
+
+ if (vo_capabilities & VO_CAP_VIDEO_WINDOW_OVERLAY)
+ capabilities |= XINE_OSD_CAP_VIDEO_WINDOW;
+
return capabilities;
}
@@ -1572,7 +1857,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 = calloc(1, sizeof(osd_renderer_t));
this->stream = stream;
@@ -1583,12 +1867,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);
+ osd_preload_fonts(this, fontpath);
- snprintf (str, 1024, "%s/.xine/fonts", xine_get_homedir ());
+ free(fontpath);
- osd_preload_fonts (this, str);
+ data_dirs++;
+ }
+ }
this->textpalette = this->stream->xine->config->register_enum (this->stream->xine->config,
"ui.osd.text_palette", 0,
@@ -1621,8 +1915,11 @@ osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) {
this->get_text_size = osd_get_text_size;
this->close = osd_renderer_close;
this->draw_bitmap = osd_draw_bitmap;
+ this->set_argb_buffer = osd_set_argb_buffer;
this->show_unscaled = osd_show_unscaled;
this->get_capabilities = osd_get_capabilities;
+ this->set_extent = osd_set_extent;
+ this->set_video_window = osd_set_video_window;
return this;
}
diff --git a/src/xine-engine/osd.h b/src/xine-engine/osd.h
deleted file mode 100644
index 768fcb418..000000000
--- a/src/xine-engine/osd.h
+++ /dev/null
@@ -1,365 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * OSD stuff (text and graphic primitives)
- */
-
-#ifndef HAVE_OSD_H
-#define HAVE_OSD_H
-
-#ifdef HAVE_ICONV
-# include <iconv.h>
-#endif
-
-#ifdef XINE_COMPILE
-# include "video_overlay.h"
-# ifdef __OSD_C__
-# include "alphablend.h"
-# endif
-#else
-# include <xine/video_overlay.h>
-#endif
-
-typedef struct osd_object_s osd_object_t;
-typedef struct osd_renderer_s osd_renderer_t;
-typedef struct osd_font_s osd_font_t;
-typedef struct osd_ft2context_s osd_ft2context_t;
-
-struct osd_object_s {
- osd_object_t *next;
- osd_renderer_t *renderer;
-
- int width, height; /* work area dimentions */
- uint8_t *area; /* work area */
- int display_x,display_y; /* where to display it in screen */
-
- /* clipping box inside work area */
- int x1, y1;
- int x2, y2;
-
- 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 */
-#endif
-
- osd_font_t *font;
- osd_ft2context_t *ft2;
-};
-
-/* this one is public */
-struct xine_osd_s {
- osd_object_t osd;
-};
-
-struct osd_renderer_s {
-
- /*
- * open a new osd object. this will allocated an empty (all zero) drawing
- * area where graphic primitives may be used.
- * It is ok to specify big width and height values. The render will keep
- * track of the smallest changed area to not generate too big overlays.
- * A default palette is initialized (i sugest keeping color 0 as transparent
- * for the sake of simplicity)
- */
- osd_object_t* (*new_object) (osd_renderer_t *this, int width, int height);
-
- /*
- * free osd object
- */
- void (*free_object) (osd_object_t *osd_to_close);
-
-
- /*
- * send the osd to be displayed at given pts (0=now)
- * the object is not changed. there may be subsequent drawing on it.
- */
- int (*show) (osd_object_t *osd, int64_t vpts );
-
- /*
- * send event to hide osd at given pts (0=now)
- * the object is not changed. there may be subsequent drawing on it.
- */
- int (*hide) (osd_object_t *osd, int64_t vpts );
-
- /*
- * draw point.
- */
- void (*point) (osd_object_t *osd, int x, int y, int color);
-
- /*
- * Bresenham line implementation on osd object
- */
- void (*line) (osd_object_t *osd,
- int x1, int y1, int x2, int y2, int color );
-
- /*
- * filled rectangle
- */
- void (*filled_rect) (osd_object_t *osd,
- int x1, int y1, int x2, int y2, int color );
-
- /*
- * set palette (color and transparency)
- */
- void (*set_palette) (osd_object_t *osd, const uint32_t *color, const uint8_t *trans );
-
- /*
- * set on existing text palette
- * (-1 to set used specified palette)
- *
- * color_base specifies the first color index to use for this text
- * palette. The OSD palette is then modified starting at this
- * color index, up to the size of the text palette.
- *
- * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices.
- */
- void (*set_text_palette) (osd_object_t *osd, int palette_number,
- int color_base );
-
- /*
- * get palette (color and transparency)
- */
- void (*get_palette) (osd_object_t *osd, uint32_t *color,
- uint8_t *trans);
-
- /*
- * set position were overlay will be blended
- */
- void (*set_position) (osd_object_t *osd, int x, int y);
-
- /*
- * set the font of osd object
- */
-
- int (*set_font) (osd_object_t *osd, const char *fontname, int size);
-
- /*
- * set encoding of text
- *
- * NULL ... no conversion (iso-8859-1)
- * "" ... locale encoding
- */
- int (*set_encoding) (osd_object_t *osd, const char *encoding);
-
- /*
- * render text in current encoding on x,y position
- * no \n yet
- *
- * The text is assigned the colors starting at the index specified by
- * color_base up to the size of the text palette.
- *
- * Use OSD_TEXT1, OSD_TEXT2, ... for some preasssigned color indices.
- */
- int (*render_text) (osd_object_t *osd, int x1, int y1,
- const char *text, int color_base);
-
- /*
- * get width and height of how text will be renderized
- */
- int (*get_text_size) (osd_object_t *osd, const char *text,
- int *width, int *height);
-
- /*
- * close osd rendering engine
- * loaded fonts are unloaded
- * osd objects are closed
- */
- void (*close) (osd_renderer_t *this);
-
- /*
- * clear an osd object (empty drawing area)
- */
- void (*clear) (osd_object_t *osd );
-
- /*
- * paste a bitmap with optional palette mapping
- */
- void (*draw_bitmap) (osd_object_t *osd, uint8_t *bitmap,
- int x1, int y1, int width, int height,
- uint8_t *palette_map);
-
- /*
- * send the osd to be displayed (unscaled) at given pts (0=now)
- * the object is not changed. there may be subsequent drawing on it.
- * overlay is blended at output (screen) resolution.
- */
- int (*show_unscaled) (osd_object_t *osd, int64_t vpts );
-
- /*
- * see xine.h for defined XINE_OSD_CAP_ values.
- */
- uint32_t (*get_capabilities) (osd_object_t *osd);
-
- /* private stuff */
-
- pthread_mutex_t osd_mutex;
- video_overlay_event_t event;
- osd_object_t *osds; /* instances of osd */
- osd_font_t *fonts; /* loaded fonts */
- int textpalette; /* default textpalette */
-
- xine_stream_t *stream;
-
-};
-
-/*
- * initialize the osd rendering engine
- */
-osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) XINE_MALLOC;
-
-
-/*
- * The size of a text palette
- */
-
-#define TEXT_PALETTE_SIZE 11
-
-/*
- * Preassigned color indices for rendering text
- * (more can be added, not exceeding OVL_PALETTE_SIZE)
- */
-
-#define OSD_TEXT1 (0 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT2 (1 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT3 (2 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT4 (3 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT5 (4 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT6 (5 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT7 (6 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT8 (7 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT9 (8 * TEXT_PALETTE_SIZE)
-#define OSD_TEXT10 (9 * TEXT_PALETTE_SIZE)
-
-/*
- * Defined palettes for rendering osd text
- * (more can be added later)
- */
-
-#define NUMBER_OF_TEXT_PALETTES 4
-#define TEXTPALETTE_WHITE_BLACK_TRANSPARENT 0
-#define TEXTPALETTE_WHITE_NONE_TRANSPARENT 1
-#define TEXTPALETTE_WHITE_NONE_TRANSLUCID 2
-#define TEXTPALETTE_YELLOW_BLACK_TRANSPARENT 3
-
-#ifdef __OSD_C__
-
-/* This text descriptions are used for config screen */
-static const char *textpalettes_str[NUMBER_OF_TEXT_PALETTES+1] = {
- "white-black-transparent",
- "white-none-transparent",
- "white-none-translucid",
- "yellow-black-transparent",
- NULL};
-
-
-/*
- Palette entries as used by osd fonts:
-
- 0: not used by font, always transparent
- 1: font background, usually transparent, may be used to implement
- translucid boxes where the font will be printed.
- 2-5: transition between background and border (usually only alpha
- value changes).
- 6: font border. if the font is to be displayed without border this
- will probably be adjusted to font background or near.
- 7-9: transition between border and foreground
- 10: font color (foreground)
-*/
-
-/*
- The palettes below were made by hand, ie, i just throw
- values that seemed to do the transitions i wanted.
- This can surelly be improved a lot. [Miguel]
-*/
-
-static const clut_t textpalettes_color[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = {
-/* white, black border, transparent */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/
- CLUT_Y_CR_CB_INIT(0x40, 0x80, 0x80), /*7*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*8*/
- CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*9*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/
- },
- /* white, no border, transparent */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*1*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*2*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*3*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*4*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*5*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*6*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*7*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*8*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*9*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/
- },
- /* white, no border, translucid */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*1*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*2*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*3*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*4*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*5*/
- CLUT_Y_CR_CB_INIT(0x80, 0x80, 0x80), /*6*/
- CLUT_Y_CR_CB_INIT(0xa0, 0x80, 0x80), /*7*/
- CLUT_Y_CR_CB_INIT(0xc0, 0x80, 0x80), /*8*/
- CLUT_Y_CR_CB_INIT(0xe0, 0x80, 0x80), /*9*/
- CLUT_Y_CR_CB_INIT(0xff, 0x80, 0x80), /*10*/
- },
- /* yellow, black border, transparent */
- {
- CLUT_Y_CR_CB_INIT(0x00, 0x00, 0x00), /*0*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*1*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*2*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*3*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*4*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*5*/
- CLUT_Y_CR_CB_INIT(0x00, 0x80, 0x80), /*6*/
- CLUT_Y_CR_CB_INIT(0x40, 0x84, 0x60), /*7*/
- CLUT_Y_CR_CB_INIT(0x70, 0x88, 0x40), /*8*/
- CLUT_Y_CR_CB_INIT(0xb0, 0x8a, 0x20), /*9*/
- CLUT_Y_CR_CB_INIT(0xff, 0x90, 0x00), /*10*/
- },
-};
-
-static const uint8_t textpalettes_trans[NUMBER_OF_TEXT_PALETTES][TEXT_PALETTE_SIZE] = {
- {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 },
- {0, 0, 0, 0, 0, 0, 2, 6, 9, 12, 15 },
- {0, 8, 9, 10, 11, 12, 13, 14, 15, 15, 15 },
- {0, 0, 3, 6, 8, 10, 12, 14, 15, 15, 15 },
-};
-
-#endif /* __OSD_C__ */
-
-#endif
-
diff --git a/src/xine-engine/plugin_catalog.h b/src/xine-engine/plugin_catalog.h
deleted file mode 100644
index 010ec53bb..000000000
--- a/src/xine-engine/plugin_catalog.h
+++ /dev/null
@@ -1,99 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * xine-internal header: Definitions for plugin lists
- */
-
-#ifndef _PLUGIN_CATALOG_H
-#define _PLUGIN_CATALOG_H
-
-#ifdef XINE_COMPILE
-# include "xine_plugin.h"
-# include "xineutils.h"
-#else
-# include <xine/xine_plugin.h>
-# include <xine/xineutils.h>
-#endif
-
-#define DECODER_MAX 128
-#define PLUGIN_MAX 256
-
-/* 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 no_unload; /* set if the file can't be unloaded */
-} plugin_file_t ;
-
-typedef struct {
- plugin_file_t *file;
- plugin_info_t *info;
- void *plugin_class;
- int ref; /* count intances of plugins */
- int priority;
-} plugin_node_t ;
-
-struct plugin_catalog_s {
- xine_sarray_t *plugin_lists[PLUGIN_TYPE_MAX];
-
- xine_sarray_t *cache_list;
- xine_list_t *file_list;
-
- plugin_node_t *audio_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
- plugin_node_t *video_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
- plugin_node_t *spu_decoder_map[DECODER_MAX][PLUGINS_PER_TYPE];
-
- const char *ids[PLUGIN_MAX];
-
- /* memory block for the decoder priority config entry descriptions */
- char *prio_desc[DECODER_MAX];
-
- pthread_mutex_t lock;
-
- int plugin_count;
- int decoder_count;
-};
-typedef struct plugin_catalog_s plugin_catalog_t;
-
-/*
- * load plugins into catalog
- *
- * all input+demux plugins will be fully loaded+initialized
- * decoder plugins are loaded on demand
- * video/audio output plugins have special load/probe functions
- */
-void _x_scan_plugins (xine_t *this) XINE_PROTECTED;
-
-
-/*
- * dispose all currently loaded plugins (shutdown)
- */
-
-void _x_dispose_plugins (xine_t *this) XINE_PROTECTED;
-
-#endif
diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c
index cb1da8acf..30e61acd4 100644
--- a/src/xine-engine/post.c
+++ b/src/xine-engine/post.c
@@ -25,7 +25,7 @@
#define POST_INTERNAL
#define XINE_ENGINE_INTERNAL
-#include "post.h"
+#include <xine/post.h>
#include <stdarg.h>
@@ -90,6 +90,16 @@ static vo_frame_t *post_video_get_last_frame(xine_video_port_t *port_gen) {
return frame;
}
+static xine_grab_video_frame_t *post_video_new_grab_video_frame(xine_video_port_t *port_gen) {
+ post_video_port_t *port = (post_video_port_t *)port_gen;
+ xine_grab_video_frame_t *frame;
+
+ if (port->port_lock) pthread_mutex_lock(port->port_lock);
+ frame = port->original_port->new_grab_video_frame(port->original_port);
+ if (port->port_lock) pthread_mutex_unlock(port->port_lock);
+ return frame;
+}
+
static void post_video_enable_ovl(xine_video_port_t *port_gen, int ovl_enable) {
post_video_port_t *port = (post_video_port_t *)port_gen;
@@ -144,6 +154,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;
@@ -187,6 +205,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,
@@ -197,6 +216,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;
}
@@ -213,11 +233,13 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_
port->new_port.open = post_video_open;
port->new_port.get_frame = post_video_get_frame;
port->new_port.get_last_frame = post_video_get_last_frame;
+ port->new_port.new_grab_video_frame = post_video_new_grab_video_frame;
port->new_port.enable_ovl = post_video_enable_ovl;
port->new_port.close = post_video_close;
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;
@@ -378,9 +400,10 @@ vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *
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)
@@ -696,6 +719,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,
@@ -706,6 +730,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;
}
@@ -873,7 +898,7 @@ int _x_post_dispose(post_plugin_t *this) {
/* since the plugin loader does not know, when the plugin gets disposed,
* we have to handle the reference counter here */
pthread_mutex_lock(&this->xine->plugin_catalog->lock);
- ((plugin_node_t *)this->node)->ref--;
+ this->node->ref--;
pthread_mutex_unlock(&this->xine->plugin_catalog->lock);
return 1;
diff --git a/src/xine-engine/post.h b/src/xine-engine/post.h
deleted file mode 100644
index f97b9ffca..000000000
--- a/src/xine-engine/post.h
+++ /dev/null
@@ -1,390 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * post plugin definitions
- */
-
-#ifndef XINE_POST_H
-#define XINE_POST_H
-
-#ifdef XINE_COMPILE
-# include "xine.h"
-# include "video_out.h"
-# include "audio_out.h"
-# include "xine_internal.h"
-# include "xineutils.h"
-#else
-# include <xine.h>
-# include <xine/video_out.h>
-# include <xine/audio_out.h>
-# include <xine/xine_internal.h>
-# include <xine/xineutils.h>
-#endif
-
-#define POST_PLUGIN_IFACE_VERSION 9
-
-
-typedef struct post_class_s post_class_t;
-typedef struct post_plugin_s post_plugin_t;
-typedef struct post_in_s post_in_t;
-typedef struct post_out_s post_out_t;
-
-struct post_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- post_plugin_t* (*open_plugin) (post_class_t *this, int inputs,
- xine_audio_port_t **audio_target,
- xine_video_port_t **video_target);
-
- /*
- * return short, human readable identifier for this plugin class
- */
- char* (*get_identifier) (post_class_t *this);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- char* (*get_description) (post_class_t *this);
-
- /*
- * free all class-related resources
- */
-
- void (*dispose) (post_class_t *this);
-};
-
-struct post_plugin_s {
-
- /* public part of the plugin */
- xine_post_t xine_post;
-
- /*
- * the connections announced by the plugin
- * the plugin must fill these with xine_post_{in,out}_t on init
- */
- xine_list_t *input;
- xine_list_t *output;
-
- /*
- * close down, free all resources
- */
- void (*dispose) (post_plugin_t *this);
-
- /* has dispose been called */
- int dispose_pending;
-
- /* plugins don't have to init the stuff below */
-
- /*
- * the running ticket
- *
- * the plugin must assure to check for ticket revocation in
- * intervals of finite length; this means that you must release
- * the ticket before any operation that might block;
- * note that all port functions are safe in this respect
- *
- * the running ticket is assigned to you by the engine
- */
- xine_ticket_t *running_ticket;
-
- /* this is needed by the engine to decrement the reference counter
- * on disposal of the plugin, but since this is useful, we expose it */
- xine_t *xine;
-
- /* used when the user requests a list of all inputs/outputs */
- const char **input_ids;
- const char **output_ids;
-
- /* used by plugin loader */
- void *node;
-};
-
-/* helper function to initialize a post_plugin_t */
-void _x_post_init(post_plugin_t *post, int num_audio_inputs, int num_video_inputs) XINE_PROTECTED;
-
-struct post_in_s {
-
- /* public part of the input */
- xine_post_in_t xine_in;
-
- /* backward reference so that you have access to the post plugin */
- post_plugin_t *post;
-
- /* you can fill this to your liking */
- void *user_data;
-};
-
-struct post_out_s {
-
- /* public part of the output */
- xine_post_out_t xine_out;
-
- /* backward reference so that you have access to the post plugin */
- post_plugin_t *post;
-
- /* you can fill this to your liking */
- void *user_data;
-};
-
-
-/* Post plugins work by intercepting calls to video or audio ports
- * in the sense of the decorator design pattern. They reuse the
- * functions of a given target port, but add own functionality in
- * front of that port by creating a new port structure and filling in
- * the function pointers with pointers to own functions that
- * would do something and then call the original port function.
- *
- * Much the same is done with video frames which have their own
- * set of functions attached that you might need to decorate.
- */
-
-
-/* helper structure for intercepting video port calls */
-typedef struct post_video_port_s post_video_port_t;
-struct post_video_port_s {
-
- /* the new public port with replaced function pointers */
- xine_video_port_t new_port;
-
- /* the original port to call its functions from inside yours */
- xine_video_port_t *original_port;
-
- /* if you want to decide yourself, whether a given frame should
- * be intercepted, fill in this function; get_frame() acts as
- * a template method and asks your function; return a boolean;
- * the default is to intercept all frames */
- int (*intercept_frame)(post_video_port_t *self, vo_frame_t *frame);
-
- /* the new frame function pointers */
- vo_frame_t *new_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;
- * the default is _not_ to intercept the overlay manager */
- int (*intercept_ovl)(post_video_port_t *self);
-
- /* the new public overlay manager with replaced function pointers */
- video_overlay_manager_t *new_manager;
-
- /* the original manager to call its functions from inside yours */
- video_overlay_manager_t *original_manager;
-
- /* 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;
-
- /* point to a mutex here, if you need some synchronization */
- pthread_mutex_t *port_lock;
- pthread_mutex_t *frame_lock;
- pthread_mutex_t *manager_lock;
-
- /* backward reference so that you have access to the post plugin
- * when the call only gives you the port */
- post_plugin_t *post;
-
- /* you can fill this to your liking */
- void *user_data;
-
-#ifdef POST_INTERNAL
- /* some of the above members are to be directly included here, but
- * adding the structures would mean that post_video_port_t becomes
- * depended of the sizes of these structs; solution: we add pointers
- * above and have them point into the memory provided here;
- * note that the overlay manager needs to be first so that we can
- * reconstruct the post_video_port_t* from overlay manager calls */
-
- /* any change here requires a change in _x_post_ovl_manager_to_port()
- * below! */
-
- video_overlay_manager_t manager_storage;
- vo_frame_t frame_storage;
-
- /* this is used to keep a linked list of free vo_frame_t's */
- vo_frame_t *free_frame_slots;
- pthread_mutex_t free_frames_lock;
-#endif
-};
-
-/* use this to create a new decorated video port in which
- * port functions will be replaced with own implementations;
- * for convenience, this can also create a related post_in_t and post_out_t */
-post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *port,
- post_in_t **input, post_out_t **output) XINE_PROTECTED;
-
-/* use this to decorate and to undecorate a frame so that its functions
- * can be replaced with own implementations, decoration is usually done in
- * get_frame(), undecoration in frame->free() */
-vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED;
-vo_frame_t *_x_post_restore_video_frame(vo_frame_t *frame, post_video_port_t *port) XINE_PROTECTED;
-
-/* when you want to pass a frame call on to the original issuer of the frame,
- * you need to propagate potential changes up and down the pipe, so the usual
- * procedure for this situation would be:
- *
- * _x_post_frame_copy_down(frame, frame->next);
- * frame->next->function(frame->next);
- * _x_post_frame_copy_up(frame, frame->next);
- */
-void _x_post_frame_copy_down(vo_frame_t *from, vo_frame_t *to) XINE_PROTECTED;
-void _x_post_frame_copy_up(vo_frame_t *to, vo_frame_t *from) XINE_PROTECTED;
-
-/* when you shortcut a frames usual draw() travel so that it will never reach
- * the draw() function of the original issuer, you still have to do some
- * housekeeping on the frame, before returning control up the pipe */
-void _x_post_frame_u_turn(vo_frame_t *frame, xine_stream_t *stream) XINE_PROTECTED;
-
-/* use this to create a new, trivially decorated overlay manager in which
- * port functions can be replaced with own implementations */
-void _x_post_intercept_overlay_manager(video_overlay_manager_t *manager, post_video_port_t *port) XINE_PROTECTED;
-
-/* pointer retrieval functions */
-static inline post_video_port_t *_x_post_video_frame_to_port(vo_frame_t *frame) {
- return (post_video_port_t *)frame->port;
-}
-
-static inline post_video_port_t *_x_post_ovl_manager_to_port(video_overlay_manager_t *manager) {
-#ifdef POST_INTERNAL
- return (post_video_port_t *)( (uint8_t *)manager -
- (uint8_t*)&(((post_video_port_t *)NULL)->manager_storage) );
-#else
- return (post_video_port_t *)( (uint8_t *)manager - sizeof(post_video_port_t) );
-#endif
-}
-
-
-/* helper structure for intercepting audio port calls */
-typedef struct post_audio_port_s post_audio_port_t;
-struct post_audio_port_s {
-
- /* the new public port with replaced function pointers */
- xine_audio_port_t new_port;
-
- /* 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() */
- uint32_t bits;
- uint32_t rate;
- uint32_t mode;
-
- /* point to a mutex here, if you need some synchronization */
- pthread_mutex_t *port_lock;
-
- /* backward reference so that you have access to the post plugin
- * when the call only gives you the port */
- post_plugin_t *post;
-
- /* you can fill this to your liking */
- void *user_data;
-};
-
-/* use this to create a new decorated audio port in which
- * port functions will be replaced with own implementations */
-post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *port,
- post_in_t **input, post_out_t **output) XINE_PROTECTED;
-
-
-/* this will allow pending rewire operations, calling this at the beginning
- * of decoder-called functions like get_buffer() and open() is a good idea
- * (if you do not intercept get_buffer() or open(), this will be done automatically) */
-static inline void _x_post_rewire(post_plugin_t *post) {
- if (post->running_ticket->ticket_revoked)
- post->running_ticket->renew(post->running_ticket, 1);
-}
-
-/* with these functions you can switch interruptions like rewiring or engine pausing
- * off for a block of code; use this only when really necessary */
-static inline void _x_post_lock(post_plugin_t *post) {
- post->running_ticket->acquire(post->running_ticket, 1);
-}
-static inline void _x_post_unlock(post_plugin_t *post) {
- post->running_ticket->release(post->running_ticket, 1);
- _x_post_rewire(post);
-}
-
-/* the standard disposal operation; returns 1 if the plugin is really
- * disposed and you should free everything you malloc()ed yourself */
-int _x_post_dispose(post_plugin_t *post) XINE_PROTECTED;
-
-
-/* macros to handle usage counter */
-
-/* WARNING!
- * note that _x_post_dec_usage() can call dispose, so be sure to
- * not use any potentially already freed memory after this */
-
-#define _x_post_inc_usage(port) \
-do { \
- pthread_mutex_lock(&(port)->usage_lock); \
- (port)->usage_count++; \
- pthread_mutex_unlock(&(port)->usage_lock); \
-} while(0)
-
-#define _x_post_dec_usage(port) \
-do { \
- pthread_mutex_lock(&(port)->usage_lock); \
- (port)->usage_count--; \
- if ((port)->usage_count == 0) { \
- if ((port)->post->dispose_pending) { \
- pthread_mutex_unlock(&(port)->usage_lock); \
- (port)->post->dispose((port)->post); \
- } else \
- pthread_mutex_unlock(&(port)->usage_lock); \
- } else \
- pthread_mutex_unlock(&(port)->usage_lock); \
-} while(0)
-
-
-/* macros to create parameter descriptors */
-
-#define START_PARAM_DESCR( param_t ) \
-static param_t temp_s; \
-static xine_post_api_parameter_t temp_p[] = {
-
-#define PARAM_ITEM( param_type, var, enumv, min, max, readonly, descr ) \
-{ param_type, #var, sizeof(temp_s.var), \
- (char*)&temp_s.var-(char*)&temp_s, enumv, min, max, readonly, descr },
-
-#define END_PARAM_DESCR( name ) \
- { POST_PARAM_TYPE_LAST, NULL, 0, 0, NULL, 0, 0, 1, NULL } \
-}; \
-static xine_post_api_descr_t name = { \
- sizeof( temp_s ), \
- temp_p \
-};
-
-#endif
diff --git a/src/xine-engine/refcounter.c b/src/xine-engine/refcounter.c
index 23da4bdbc..216693e88 100644
--- a/src/xine-engine/refcounter.c
+++ b/src/xine-engine/refcounter.c
@@ -28,8 +28,8 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "refcounter.h"
+#include <xine/xine_internal.h>
+#include <xine/refcounter.h>
refcounter_t* _x_new_refcounter(void *object, void (*destructor)(void *))
{
diff --git a/src/xine-engine/refcounter.h b/src/xine-engine/refcounter.h
deleted file mode 100644
index f157d8b6c..000000000
--- a/src/xine-engine/refcounter.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-#ifndef HAVE_REFCOUNTER_H
-#define HAVE_REFCOUNTER_H
-
-#include <pthread.h>
-
-typedef struct {
- pthread_mutex_t lock;
- int count;
- void* object; /* referenced object */
- void (*destructor)(void *); /* object destructor */
-} refcounter_t;
-
-typedef void (*refcounter_destructor)(void*);
-
-refcounter_t* _x_new_refcounter(void *object, refcounter_destructor destructor) XINE_MALLOC XINE_PROTECTED;
-
-int _x_refcounter_inc(refcounter_t *refcounter) XINE_PROTECTED;
-
-int _x_refcounter_dec(refcounter_t *refcounter) XINE_PROTECTED;
-
-void _x_refcounter_dispose(refcounter_t *refcounter) XINE_PROTECTED;
-
-#endif /* HAVE_REFCOUNTER_H */
diff --git a/src/xine-engine/resample.c b/src/xine-engine/resample.c
index dcf14a215..c354bbd68 100644
--- a/src/xine-engine/resample.c
+++ b/src/xine-engine/resample.c
@@ -24,8 +24,8 @@
#include <string.h>
#include <inttypes.h>
-#include "attributes.h"
-#include "resample.h"
+#include <xine/attributes.h>
+#include <xine/resample.h>
/* contributed by paul flinders */
diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c
index 39bb5927a..a15cd42d1 100644
--- a/src/xine-engine/scratch.c
+++ b/src/xine-engine/scratch.c
@@ -26,7 +26,6 @@
#include <stdio.h>
#include <stdarg.h>
-#include <string.h> /* For memset */
#define LOG_MODULE "scratch"
#define LOG_VERBOSE
@@ -34,8 +33,8 @@
#define LOG
*/
-#include "xineutils.h"
-#include "scratch.h"
+#include <xine/xineutils.h>
+#include <xine/scratch.h>
static void XINE_FORMAT_PRINTF(2, 0)
scratch_printf (scratch_buffer_t *this, const char *format, va_list argp)
diff --git a/src/xine-engine/spu.c b/src/xine-engine/spu.c
new file mode 100644
index 000000000..9bc1de84c
--- /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/xine_internal.h>
+#include <xine/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_decoder.h b/src/xine-engine/spu_decoder.h
deleted file mode 100644
index 4897a32a2..000000000
--- a/src/xine-engine/spu_decoder.h
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * spu_decoder_api.h
- *
- * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
- *
- * This file is part of xine, a unix 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 GNU Make; see the file COPYING. If not, write to
- * the Free Software Foundation,
- *
- */
-
-#ifndef HAVE_SPU_API_H
-#define HAVE_SPU_API_H
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-# include "buffer.h"
-#else
-# include <xine/os_types.h>
-# include <xine/buffer.h>
-#endif
-
-#define SPU_DECODER_IFACE_VERSION 16
-
-/*
- * generic xine spu decoder plugin interface
- */
-
-typedef struct spu_decoder_class_s spu_decoder_class_t;
-typedef struct spu_decoder_s spu_decoder_t;
-
-struct spu_decoder_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- spu_decoder_t* (*open_plugin) (spu_decoder_class_t *this, xine_stream_t *stream);
-
- /*
- * return short, human readable identifier for this plugin class
- */
- char* (*get_identifier) (spu_decoder_class_t *this);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- char* (*get_description) (spu_decoder_class_t *this);
-
- /*
- * free all class-related resources
- */
- void (*dispose) (spu_decoder_class_t *this);
-};
-
-
-struct spu_decoder_s {
-
- /*
- * decode data from buf and feed the overlay to overlay manager
- */
- void (*decode_data) (spu_decoder_t *this, buf_element_t *buf);
-
- /*
- * reset decoder after engine flush (prepare for new
- * SPU data not related to recently decoded data)
- */
- void (*reset) (spu_decoder_t *this);
-
- /*
- * inform decoder that a time reference discontinuity has happened.
- * that is, it must forget any currently held pts value
- */
- void (*discontinuity) (spu_decoder_t *this);
-
- /*
- * close down, free all resources
- */
- void (*dispose) (spu_decoder_t *this);
-
- /*
- * When the SPU decoder also handles data used in user interaction,
- * you can query the related information here. The typical example
- * for this is DVD NAV packets which are handled by the SPU decoder
- * and can be received readily parsed from here.
- * The caller and the decoder must agree on the structure which is
- * passed here.
- * This function pointer may be NULL, if the plugin does not have
- * such functionality.
- */
- int (*get_interact_info) (spu_decoder_t *this, void *data);
-
- /*
- * When the SPU decoder also handles menu overlays for user inter-
- * action, you can set a menu button here. The typical example for
- * this is DVD menus.
- * This function pointer may be NULL, if the plugin does not have
- * such functionality.
- */
- void (*set_button) (spu_decoder_t *this_gen, int32_t button, int32_t mode);
-
- void *node; /* used by plugin loader */
-};
-
-
-/* SPU decoders differ from video and audio decoders in one significant
- * way: unlike audio and video, SPU streams are not continuous;
- * this results in another difference, programmers have to consider:
- * while both audio and video decoders are automatically blocked in
- * their get_buffer()/get_frame() methods when the output cannot take
- * any more data, this does not work for SPU, because it could take
- * minutes before the next free slot becomes available and we must not
- * block the decoder thread for that long;
- * therefore, we provide a convenience function for SPU decoders which
- * implements a wait until a timestamp sufficiently close to the VPTS
- * of the next SPU is reached, but the waiting will end before that,
- * if some outside condition requires us to release the decoder thread
- * to other tasks;
- * if this functions returns with 1, noone needs the decoder thread and
- * you may continue waiting; if it returns 0, finish whatever you are
- * doing and return;
- * the usual pattern for SPU decoders is this:
- *
- * do {
- * spu = prepare_spu();
- * int thread_vacant = _x_spu_decoder_sleep(this->stream, spu->vpts);
- * int success = process_spu(spu);
- * } while (!success && thread_vacant);
- */
-int _x_spu_decoder_sleep(xine_stream_t *, int64_t next_spu_vpts) XINE_PROTECTED;
-
-#endif /* HAVE_SPUDEC_H */
diff --git a/src/xine-engine/tvmode.c b/src/xine-engine/tvmode.c
deleted file mode 100644
index 1d6660f4f..000000000
--- a/src/xine-engine/tvmode.c
+++ /dev/null
@@ -1,65 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * tvmode - TV output selection
- *
- * Currently uses nvtvd (Dirk Thierbach <dthierbach@gmx.de>)
- * for setting TV mode
- * xine support hacked in by Matthias Hopf <mat@mshopf.de>
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include "xine_internal.h"
-#include "xineutils.h"
-
-/* nvtv support is deprecated (and will be removed)
- * these dummy functions are only here to prevent serious breakage
- * until front ends are updated.
- */
-
-int xine_tvmode_switch (xine_t *this, int type, int width, int height, double fps) {
- /* not supported: return regular mode */
- return 0;
-}
-
-void xine_tvmode_size (xine_t *this, int *width, int *height,
- double *pixelratio, double *fps) {
-}
-
-int xine_tvmode_init (xine_t *this) {
- return 0;
-}
-
-void xine_tvmode_exit (xine_t *this) {
-}
-
-void xine_tvmode_set_tvsystem(xine_t *self, xine_tvsystem system) {
-}
-
-int xine_tvmode_use(xine_t *self, int use_tvmode) {
- return 0;
-}
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c
index 8e8502968..7b0ac72c1 100644
--- a/src/xine-engine/video_decoder.c
+++ b/src/xine-engine/video_decoder.c
@@ -36,8 +36,9 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/xineutils.h>
+#include "xine_private.h"
#include <sched.h>
#define SPU_SLEEP_INTERVAL (90000/2)
@@ -96,7 +97,7 @@ int _x_spu_decoder_sleep(xine_stream_t *stream, int64_t next_spu_vpts)
thread_vacant = (stream->video_fifo->first->type != BUF_CONTROL_FLUSH_DECODER);
/* we have to return if the demuxer needs us to release a buffer */
if (thread_vacant)
- thread_vacant = !stream->demux_action_pending;
+ thread_vacant = !_x_action_pending(stream);
} while (wait == SPU_SLEEP_INTERVAL && thread_vacant);
diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h
deleted file mode 100644
index f7068cc13..000000000
--- a/src/xine-engine/video_decoder.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * xine video decoder plugin interface
- */
-
-#ifndef HAVE_VIDEO_DECODER_H
-#define HAVE_VIDEO_DECODER_H
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-# include "buffer.h"
-#else
-# include <xine/os_types.h>
-# include <xine/buffer.h>
-#endif
-
-#define VIDEO_DECODER_IFACE_VERSION 18
-
-
-/*
- * generic xine video decoder plugin interface
- */
-
-typedef struct video_decoder_class_s video_decoder_class_t;
-typedef struct video_decoder_s video_decoder_t;
-
-struct video_decoder_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- video_decoder_t* (*open_plugin) (video_decoder_class_t *this, xine_stream_t *stream);
-
- /*
- * return short, human readable identifier for this plugin class
- */
- char* (*get_identifier) (video_decoder_class_t *this);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- char* (*get_description) (video_decoder_class_t *this);
-
- /*
- * free all class-related resources
- */
- void (*dispose) (video_decoder_class_t *this);
-};
-
-
-struct video_decoder_s {
-
- /*
- * decode data from buf and feed decoded frames to
- * video output
- */
- void (*decode_data) (video_decoder_t *this, buf_element_t *buf);
-
- /*
- * reset decoder after engine flush (prepare for new
- * video data not related to recently decoded data)
- */
- void (*reset) (video_decoder_t *this);
-
- /*
- * inform decoder that a time reference discontinuity has happened.
- * that is, it must forget any currently held pts value
- */
- void (*discontinuity) (video_decoder_t *this);
-
- /*
- * flush out any frames that are still stored in the decoder
- */
- void (*flush) (video_decoder_t *this);
-
- /*
- * close down, free all resources
- */
- void (*dispose) (video_decoder_t *this);
-
-
- void *node; /*used by plugin loader */
-
-};
-
-#endif
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index a6d39f23f..cc428137e 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_out.c
@@ -45,10 +45,11 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "video_out.h"
-#include "metronom.h"
-#include "xineutils.h"
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+#include <xine/metronom.h>
+#include <xine/xineutils.h>
+#include <yuv2rgb.h>
#define NUM_FRAME_BUFFERS 15
#define MAX_USEC_TO_SLEEP 20000
@@ -66,6 +67,24 @@
static vo_frame_t * crop_frame( xine_video_port_t *this_gen, vo_frame_t *img );
+typedef struct vos_grab_video_frame_s vos_grab_video_frame_t;
+struct vos_grab_video_frame_s {
+ xine_grab_video_frame_t grab_frame;
+
+ vos_grab_video_frame_t *next;
+ int finished;
+ xine_video_port_t *video_port;
+ vo_frame_t *vo_frame;
+ yuv2rgb_factory_t *yuv2rgb_factory;
+ yuv2rgb_t *yuv2rgb;
+ int vo_width, vo_height;
+ int grab_width, grab_height;
+ int y_stride, uv_stride;
+ int img_size;
+ uint8_t *img;
+};
+
+
typedef struct {
vo_frame_t *first;
vo_frame_t *last;
@@ -91,9 +110,13 @@ typedef struct {
img_buf_fifo_t *free_img_buf_queue;
img_buf_fifo_t *display_img_buf_queue;
- vo_frame_t *last_frame;
vo_frame_t *img_backup;
+ vo_frame_t *last_frame;
+ vos_grab_video_frame_t *pending_grab_request;
+ pthread_mutex_t grab_lock;
+ pthread_cond_t grab_cond;
+
uint32_t video_loop_running:1;
uint32_t video_opened:1;
@@ -133,6 +156,9 @@ typedef struct {
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;
@@ -327,6 +353,288 @@ static void vo_frame_dec_lock (vo_frame_t *img) {
pthread_mutex_unlock (&img->mutex);
}
+
+/*
+ * functions for grabbing RGB images from displayed frames
+ */
+static void vo_dispose_grab_video_frame(xine_grab_video_frame_t *frame_gen)
+{
+ vos_grab_video_frame_t *frame = (vos_grab_video_frame_t *) frame_gen;
+
+ if (frame->vo_frame)
+ vo_frame_dec_lock(frame->vo_frame);
+
+ if (frame->yuv2rgb)
+ frame->yuv2rgb->dispose(frame->yuv2rgb);
+
+ if (frame->yuv2rgb_factory)
+ frame->yuv2rgb_factory->dispose(frame->yuv2rgb_factory);
+
+ free(frame->img);
+ free(frame->grab_frame.img);
+ free(frame);
+}
+
+
+static int vo_grab_grab_video_frame (xine_grab_video_frame_t *frame_gen) {
+ vos_grab_video_frame_t *frame = (vos_grab_video_frame_t *) frame_gen;
+ vos_t *this = (vos_t *) frame->video_port;
+ vo_frame_t *vo_frame;
+ int format, y_stride, uv_stride;
+ uint8_t *base[3];
+
+ if (frame->grab_frame.flags & XINE_GRAB_VIDEO_FRAME_FLAGS_WAIT_NEXT) {
+ struct timeval tvnow, tvdiff, tvtimeout;
+ struct timespec ts;
+
+ /* calculate absolute timeout time */
+ tvdiff.tv_sec = frame->grab_frame.timeout / 1000;
+ tvdiff.tv_usec = frame->grab_frame.timeout % 1000;
+ tvdiff.tv_usec *= 1000;
+ gettimeofday(&tvnow, NULL);
+ timeradd(&tvnow, &tvdiff, &tvtimeout);
+ ts.tv_sec = tvtimeout.tv_sec;
+ ts.tv_nsec = tvtimeout.tv_usec;
+ ts.tv_nsec *= 1000;
+
+ pthread_mutex_lock(&this->grab_lock);
+
+ /* insert grab request into grab queue */
+ frame->next = this->pending_grab_request;
+ this->pending_grab_request = frame;
+
+ /* wait until our request is finished */
+ frame->finished = 0;
+ while (!frame->finished) {
+ if (pthread_cond_timedwait(&this->grab_cond, &this->grab_lock, &ts) == ETIMEDOUT) {
+ vos_grab_video_frame_t *prev = this->pending_grab_request;
+ while (prev) {
+ if (prev == frame) {
+ this->pending_grab_request = frame->next;
+ break;
+ } else if (prev->next == frame) {
+ prev->next = frame->next;
+ break;
+ }
+ prev = prev->next;
+ }
+ frame->next = NULL;
+ pthread_mutex_unlock(&this->grab_lock);
+ return 1; /* no frame available */
+ }
+ }
+
+ pthread_mutex_unlock(&this->grab_lock);
+
+ vo_frame = frame->vo_frame;
+ frame->vo_frame = NULL;
+ if (!vo_frame)
+ return -1; /* error happened */
+ } else {
+ pthread_mutex_lock(&this->grab_lock);
+
+ /* use last displayed frame */
+ vo_frame = this->last_frame;
+ if (!vo_frame) {
+ pthread_mutex_unlock(&this->grab_lock);
+ return 1; /* no frame available */
+ }
+ if (vo_frame->format != XINE_IMGFMT_YV12 && vo_frame->format != XINE_IMGFMT_YUY2 && !vo_frame->proc_provide_standard_frame_data) {
+ pthread_mutex_unlock(&this->grab_lock);
+ return -1; /* error happened */
+ }
+ vo_frame_inc_lock(vo_frame);
+ pthread_mutex_unlock(&this->grab_lock);
+ frame->grab_frame.vpts = vo_frame->vpts;
+ }
+
+ int width = vo_frame->width;
+ int height = vo_frame->height;
+
+ if (vo_frame->format == XINE_IMGFMT_YV12 || vo_frame->format == XINE_IMGFMT_YUY2) {
+ format = vo_frame->format;
+ y_stride = vo_frame->pitches[0];
+ uv_stride = vo_frame->pitches[1];
+ base[0] = vo_frame->base[0];
+ base[1] = vo_frame->base[1];
+ base[2] = vo_frame->base[2];
+ } else {
+ /* retrieve standard format image data from output driver */
+ xine_current_frame_data_t data;
+ memset(&data, 0, sizeof(data));
+ vo_frame->proc_provide_standard_frame_data(vo_frame, &data);
+ if (data.img_size > frame->img_size) {
+ free(frame->img);
+ frame->img_size = data.img_size;
+ frame->img = calloc(data.img_size, sizeof(uint8_t));
+ if (!frame->img) {
+ vo_frame_dec_lock(vo_frame);
+ return -1; /* error happened */
+ }
+ }
+ data.img = frame->img;
+ vo_frame->proc_provide_standard_frame_data(vo_frame, &data);
+ format = data.format;
+ if (format == XINE_IMGFMT_YV12) {
+ y_stride = width;
+ uv_stride = width / 2;
+ base[0] = data.img;
+ base[1] = data.img + width * height;
+ base[2] = data.img + width * height + width * height / 4;
+ } else { // XINE_IMGFMT_YUY2
+ y_stride = width * 2;
+ uv_stride = 0;
+ base[0] = data.img;
+ base[1] = NULL;
+ base[2] = NULL;
+ }
+ }
+
+ /* take cropping parameters into account */
+ int crop_left = (vo_frame->crop_left + frame->grab_frame.crop_left) & ~1;
+ int crop_right = (vo_frame->crop_right + frame->grab_frame.crop_right) & ~1;
+ int crop_top = vo_frame->crop_top + frame->grab_frame.crop_top;
+ int crop_bottom = vo_frame->crop_bottom + frame->grab_frame.crop_bottom;
+
+ if (crop_left || crop_right || crop_top || crop_bottom) {
+ if ((width - crop_left - crop_right) >= 8)
+ width = width - crop_left - crop_right;
+ else
+ crop_left = crop_right = 0;
+
+ if ((height - crop_top - crop_bottom) >= 8)
+ height = height - crop_top - crop_bottom;
+ else
+ crop_top = crop_bottom = 0;
+
+ if (format == XINE_IMGFMT_YV12) {
+ base[0] += crop_top * y_stride + crop_left;
+ base[1] += crop_top/2 * uv_stride + crop_left/2;
+ base[2] += crop_top/2 * uv_stride + crop_left/2;
+ } else { // XINE_IMGFMT_YUY2
+ base[0] += crop_top * y_stride + crop_left*2;
+ }
+ }
+
+ /* if caller does not specify frame size we return the actual size of grabbed frame */
+ if (frame->grab_frame.width <= 0)
+ frame->grab_frame.width = width;
+ if (frame->grab_frame.height <= 0)
+ frame->grab_frame.height = height;
+
+ /* allocate grab frame image buffer */
+ if (frame->grab_frame.width != frame->grab_width || frame->grab_frame.height != frame->grab_height) {
+ free(frame->grab_frame.img);
+ frame->grab_frame.img = NULL;
+ }
+ if (frame->grab_frame.img == NULL) {
+ frame->grab_frame.img = (uint8_t *) calloc(frame->grab_frame.width * frame->grab_frame.height, 3);
+ if (frame->grab_frame.img == NULL) {
+ vo_frame_dec_lock(vo_frame);
+ return -1; /* error happened */
+ }
+ }
+
+ /* initialize yuv2rgb factory */
+ if (!frame->yuv2rgb_factory) {
+ frame->yuv2rgb_factory = yuv2rgb_factory_init(MODE_24_RGB, 0, NULL);
+ if (!frame->yuv2rgb_factory) {
+ vo_frame_dec_lock(vo_frame);
+ return -1; /* error happened */
+ }
+ frame->yuv2rgb_factory->matrix_coefficients = 1; /* ITU-R Rec. 709 (1990) */
+ frame->yuv2rgb_factory->set_csc_levels (frame->yuv2rgb_factory, 0, 128, 128);
+ }
+
+ /* retrieve a yuv2rgb converter */
+ if (!frame->yuv2rgb) {
+ frame->yuv2rgb = frame->yuv2rgb_factory->create_converter(frame->yuv2rgb_factory);
+ if (!frame->yuv2rgb) {
+ vo_frame_dec_lock(vo_frame);
+ return -1; /* error happened */
+ }
+ }
+
+ /* configure yuv2rgb converter */
+ if (width != frame->vo_width ||
+ height != frame->vo_height ||
+ frame->grab_frame.width != frame->grab_width ||
+ frame->grab_frame.height != frame->grab_height ||
+ y_stride != frame->y_stride ||
+ uv_stride != frame->uv_stride) {
+ frame->vo_width = width;
+ frame->vo_height = height;
+ frame->grab_width = frame->grab_frame.width;
+ frame->grab_height = frame->grab_frame.height;
+ frame->y_stride = y_stride;
+ frame->uv_stride = uv_stride;
+ frame->yuv2rgb->configure(frame->yuv2rgb, width, height, y_stride, uv_stride, frame->grab_width, frame->grab_height, frame->grab_width * 3);
+ }
+
+ /* convert YUV to RGB image taking possible scaling into account */
+ /* FIXME: have to swap U and V planes to get correct colors for YV12 frames?? */
+ if(format == XINE_IMGFMT_YV12)
+ frame->yuv2rgb->yuv2rgb_fun(frame->yuv2rgb, frame->grab_frame.img, base[0], base[2], base[1]);
+ else
+ frame->yuv2rgb->yuy22rgb_fun(frame->yuv2rgb, frame->grab_frame.img, base[0]);
+
+ vo_frame_dec_lock(vo_frame);
+ return 0;
+}
+
+
+static xine_grab_video_frame_t *vo_new_grab_video_frame(xine_video_port_t *this_gen)
+{
+ vos_grab_video_frame_t *frame = calloc(1, sizeof(vos_grab_video_frame_t));
+ if (frame) {
+ frame->grab_frame.dispose = vo_dispose_grab_video_frame;
+ frame->grab_frame.grab = vo_grab_grab_video_frame;
+ frame->grab_frame.vpts = -1;
+ frame->grab_frame.timeout = XINE_GRAB_VIDEO_FRAME_DEFAULT_TIMEOUT;
+ frame->video_port = this_gen;
+ }
+ return (xine_grab_video_frame_t *)frame;
+}
+
+
+static void vo_grab_current_frame (vos_t *this, vo_frame_t *vo_frame, int64_t vpts)
+{
+ pthread_mutex_lock(&this->grab_lock);
+
+ /* hold current frame for snapshot feature */
+ if (this->last_frame)
+ vo_frame_dec_lock(this->last_frame);
+ vo_frame_inc_lock(vo_frame);
+ this->last_frame = vo_frame;
+
+ /* process grab queue */
+ vos_grab_video_frame_t *frame = this->pending_grab_request;
+ if (frame) {
+ while (frame) {
+ if (frame->vo_frame)
+ vo_frame_dec_lock(frame->vo_frame);
+ frame->vo_frame = NULL;
+
+ if (vo_frame->format == XINE_IMGFMT_YV12 || vo_frame->format == XINE_IMGFMT_YUY2 || vo_frame->proc_provide_standard_frame_data) {
+ vo_frame_inc_lock(vo_frame);
+ frame->vo_frame = vo_frame;
+ frame->grab_frame.vpts = vpts;
+ }
+
+ frame->finished = 1;
+ vos_grab_video_frame_t *next = frame->next;
+ frame->next = NULL;
+ frame = next;
+ }
+
+ this->pending_grab_request = NULL;
+ pthread_cond_broadcast(&this->grab_cond);
+ }
+
+ pthread_mutex_unlock(&this->grab_lock);
+}
+
+
/* call vo_driver->proc methods for the entire frame */
static void vo_frame_driver_proc(vo_frame_t *img)
{
@@ -954,8 +1262,8 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts,
img->vpts = cur_vpts;
/* extra info of the backup is thrown away, because it is not up to date */
_x_extra_info_reset(img->extra_info);
+ img->future_frame = NULL;
}
-
return img;
} else {
@@ -1014,6 +1322,13 @@ static vo_frame_t *get_next_frame (vos_t *this, int64_t cur_vpts,
* remove frame from display queue and show it
*/
+ if ( img ) {
+ if ( img->next )
+ img->future_frame = img->next;
+ else
+ img->future_frame = NULL;
+ }
+
img = vo_remove_from_img_buf_queue_int (this->display_img_buf_queue, 1, 0, 0, 0, 0, 0);
pthread_mutex_unlock(&this->display_img_buf_queue->mutex);
@@ -1050,12 +1365,7 @@ static void overlay_and_display_frame (vos_t *this,
this->video_loop_running && this->overlay_enabled);
}
- /* hold current frame for snapshot feature */
- if( this->last_frame ) {
- vo_frame_dec_lock( this->last_frame );
- }
- vo_frame_inc_lock( img );
- this->last_frame = img;
+ vo_grab_current_frame (this, img, vpts);
this->driver->display_frame (this->driver, img);
@@ -1092,6 +1402,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.
@@ -1137,7 +1473,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 );
}
@@ -1280,7 +1616,11 @@ 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);
+ {
+ /* honor trigger update only when a backup img is available */
+ if (0 == interruptable_sleep(this, usec_to_sleep) && this->img_backup)
+ break;
+ }
if (this->discard_frames)
break;
@@ -1307,10 +1647,13 @@ static void *video_out_loop (void *this_gen) {
vo_frame_dec_lock( this->img_backup );
this->img_backup = NULL;
}
+
+ pthread_mutex_lock(&this->grab_lock);
if (this->last_frame) {
vo_frame_dec_lock( this->last_frame );
this->last_frame = NULL;
}
+ pthread_mutex_unlock(&this->grab_lock);
return NULL;
}
@@ -1442,6 +1785,14 @@ static int vo_get_property (xine_video_port_t *this_gen, int property) {
ret = this->video_loop_running ? this->display_img_buf_queue->num_buffers : -1;
break;
+ case VO_PROP_BUFS_FREE:
+ ret = this->video_loop_running ? this->free_img_buf_queue->num_buffers : -1;
+ break;
+
+ case VO_PROP_BUFS_TOTAL:
+ ret = this->video_loop_running ? this->free_img_buf_queue->num_buffers_max : -1;
+ break;
+
case VO_PROP_NUM_STREAMS:
pthread_mutex_lock(&this->streams_lock);
ret = xine_list_size(this->streams);
@@ -1464,6 +1815,8 @@ static int vo_get_property (xine_video_port_t *this_gen, int property) {
ret = this->crop_bottom;
break;
+ case XINE_PARAM_VO_SHARPNESS:
+ case XINE_PARAM_VO_NOISE_REDUCTION:
case XINE_PARAM_VO_HUE:
case XINE_PARAM_VO_SATURATION:
case XINE_PARAM_VO_CONTRAST:
@@ -1558,6 +1911,8 @@ static int vo_set_property (xine_video_port_t *this_gen, int property, int value
ret = this->crop_bottom = value;
break;
+ case XINE_PARAM_VO_SHARPNESS:
+ case XINE_PARAM_VO_NOISE_REDUCTION:
case XINE_PARAM_VO_HUE:
case XINE_PARAM_VO_SATURATION:
case XINE_PARAM_VO_CONTRAST:
@@ -1669,12 +2024,28 @@ 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);
+
+ pthread_mutex_destroy(&this->grab_lock);
+ pthread_cond_destroy(&this->grab_cond);
+
free (this);
}
static vo_frame_t *vo_get_last_frame (xine_video_port_t *this_gen) {
vos_t *this = (vos_t *) this_gen;
- return this->last_frame;
+ vo_frame_t *last_frame;
+
+ pthread_mutex_lock(&this->grab_lock);
+
+ last_frame = this->last_frame;
+ if (last_frame)
+ vo_frame_inc_lock(last_frame);
+
+ pthread_mutex_unlock(&this->grab_lock);
+
+ return last_frame;
}
/*
@@ -1738,6 +2109,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.
*/
@@ -1827,12 +2207,14 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
this->vo.open = vo_open;
this->vo.get_frame = vo_get_frame;
this->vo.get_last_frame = vo_get_last_frame;
+ this->vo.new_grab_video_frame = vo_new_grab_video_frame;
this->vo.close = vo_close;
this->vo.exit = vo_exit;
this->vo.get_capabilities = vo_get_capabilities;
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;
@@ -1845,9 +2227,13 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon
this->display_img_buf_queue = vo_new_img_buf_queue ();
this->video_loop_running = 0;
- this->last_frame = NULL;
this->img_backup = NULL;
+ this->last_frame = NULL;
+ this->pending_grab_request = NULL;
+ pthread_mutex_init(&this->grab_lock, NULL);
+ pthread_cond_init(&this->grab_cond, NULL);
+
this->overlay_source = _x_video_overlay_new_manager(xine);
this->overlay_source->init (this->overlay_source);
this->overlay_enabled = 1;
@@ -1926,6 +2312,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
deleted file mode 100644
index 9a4bd56c9..000000000
--- a/src/xine-engine/video_out.h
+++ /dev/null
@@ -1,455 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- *
- * xine version of video_out.h
- *
- * vo_frame : frame containing yuv data and timing info,
- * transferred between video_decoder and video_output
- *
- * vo_driver : lowlevel, platform-specific video output code
- *
- * vo_port : generic frame_handling code, uses
- * a vo_driver for output
- */
-
-#ifndef HAVE_VIDEO_OUT_H
-#define HAVE_VIDEO_OUT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <pthread.h>
-
-#ifdef XINE_COMPILE
-# include "xine.h"
-# include "buffer.h"
-#else
-# include <xine.h>
-# include <xine/buffer.h>
-#endif
-
-
-typedef struct vo_frame_s vo_frame_t;
-typedef struct vo_driver_s vo_driver_t;
-typedef struct video_driver_class_s video_driver_class_t;
-typedef struct vo_overlay_s vo_overlay_t;
-typedef struct video_overlay_manager_s video_overlay_manager_t;
-
-/* public part, video drivers may add private fields
- *
- * Remember that adding new functions to this structure requires
- * adaption of the post plugin decoration layer. Be sure to look into
- * src/xine-engine/post.[ch].
- */
-struct vo_frame_s {
- /*
- * member functions
- */
-
- /* Duplicate picture data and acceleration specific data of a frame. */
- /* if the image format isn't already known by Xine. Currently this is needed */
- /* For all image formats except XINE_IMGFMT_YV12 and XINE_IMGFMT_YUY2 */
- void (*proc_duplicate_frame_data) (vo_frame_t *vo_img, vo_frame_t *src);
-
- /* tell video driver to copy/convert the whole of this frame, may be NULL */
- /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */
- void (*proc_frame) (vo_frame_t *vo_img);
-
- /* tell video driver to copy/convert a slice of this frame, may be NULL */
- /* at least one of proc_frame() and proc_slice() MUST set the variable proc_called to 1 */
- void (*proc_slice) (vo_frame_t *vo_img, uint8_t **src);
-
- /* tell video driver that the decoder starts a new field */
- void (*field) (vo_frame_t *vo_img, int which_field);
-
- /* append this frame to the display queue,
- returns number of frames to skip if decoder is late */
- /* when the frame does not originate from a stream, it is legal to pass an anonymous stream */
- int (*draw) (vo_frame_t *vo_img, xine_stream_t *stream);
-
- /* lock frame as reference, must be paired with free.
- * most decoders/drivers do not need to call this function since
- * newly allocated frames are already locked once.
- */
- void (*lock) (vo_frame_t *vo_img);
-
- /* this frame is no longer used by the decoder, video driver, etc */
- void (*free) (vo_frame_t *vo_img);
-
- /* free memory/resources for this frame */
- void (*dispose) (vo_frame_t *vo_img);
-
- /*
- * public variables to decoders and vo drivers
- * changing anything here will require recompiling them both
- */
- int64_t pts; /* presentation time stamp (1/90000 sec) */
- int64_t vpts; /* virtual pts, generated by metronom */
- int bad_frame; /* e.g. frame skipped or based on skipped frame */
- int duration; /* frame length in time, in 1/90000 sec */
-
- /* yv12 (planar) base[0]: y, base[1]: u, base[2]: v */
- /* yuy2 (interleaved) base[0]: yuyv..., base[1]: --, base[2]: -- */
- uint8_t *base[3];
- int pitches[3];
-
- /* info that can be used for interlaced output (e.g. tv-out) */
- int top_field_first;
- int repeat_first_field;
- /* note: progressive_frame is set wrong on many mpeg2 streams. for
- * that reason, this flag should be interpreted as a "hint".
- */
- int progressive_frame;
- int picture_coding_type;
-
- /* cropping to be done */
- int crop_left, crop_right, crop_top, crop_bottom;
-
- /* extra info coming from input or demuxers */
- extra_info_t *extra_info;
-
- /* additional information to be able to duplicate frames: */
- int width, height;
- double ratio; /* aspect ratio */
- int format; /* IMGFMT_YV12 or IMGFMT_YUY2 */
-
- int drawn; /* used by decoder, frame has already been drawn */
- int flags; /* remember the frame flags */
- int proc_called; /* track use of proc_*() methods */
-
- /* Used to carry private data for accelerated plugins.*/
- void *accel_data;
-
- /* "backward" references to where this frame originates from */
- xine_video_port_t *port;
- vo_driver_t *driver;
- xine_stream_t *stream;
-
- /* displacement for overlays */
- int overlay_offset_x, overlay_offset_y;
-
- /*
- * that part is used only by video_out.c for frame management
- * 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;
-};
-
-
-/*
- * Remember that adding new functions to this structure requires
- * adaption of the post plugin decoration layer. Be sure to look into
- * src/xine-engine/post.[ch].
- */
-struct xine_video_port_s {
-
- uint32_t (*get_capabilities) (xine_video_port_t *self); /* for constants see below */
-
- /* open display driver for video output */
- /* when you are not a full-blown stream, but still need to open the port
- * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
- void (*open) (xine_video_port_t *self, xine_stream_t *stream);
-
- /*
- * get_frame - allocate an image buffer from display driver
- *
- * params : width == width of video to display.
- * height == height of video to display.
- * ratio == aspect ration information
- * format == FOURCC descriptor of image format
- * flags == field/prediction flags
- */
- vo_frame_t* (*get_frame) (xine_video_port_t *self, uint32_t width,
- uint32_t height, double ratio,
- int format, int flags);
-
- /* retrieves the last displayed frame (useful for taking snapshots) */
- vo_frame_t* (*get_last_frame) (xine_video_port_t *self);
-
- /* overlay stuff */
- void (*enable_ovl) (xine_video_port_t *self, int ovl_enable);
-
- /* get overlay manager */
- video_overlay_manager_t* (*get_overlay_manager) (xine_video_port_t *self);
-
- /* flush video_out fifo */
- void (*flush) (xine_video_port_t *self);
-
- /* Get/Set video property
- *
- * See VO_PROP_* bellow
- */
- int (*get_property) (xine_video_port_t *self, int property);
- int (*set_property) (xine_video_port_t *self, int property, int value);
-
- /* return true if port is opened for this stream, stream can be anonymous */
- int (*status) (xine_video_port_t *self, xine_stream_t *stream,
- int *width, int *height, int64_t *img_duration);
-
- /* video driver is no longer used by decoder => close */
- /* when you are not a full-blown stream, but still need to close the port
- * (e.g. you are a post plugin) it is legal to pass an anonymous stream */
- void (*close) (xine_video_port_t *self, xine_stream_t *stream);
-
- /* called on xine exit */
- void (*exit) (xine_video_port_t *self);
-
- /* the driver in use */
- vo_driver_t *driver;
-
-};
-
-/* constants for the get/set property functions */
-#define VO_PROP_INTERLACED 0
-#define VO_PROP_ASPECT_RATIO 1
-#define VO_PROP_HUE 2
-#define VO_PROP_SATURATION 3
-#define VO_PROP_CONTRAST 4
-#define VO_PROP_BRIGHTNESS 5
-#define VO_PROP_COLORKEY 6
-#define VO_PROP_AUTOPAINT_COLORKEY 7
-#define VO_PROP_ZOOM_X 8
-#define VO_PROP_PAN_SCAN 9
-#define VO_PROP_TVMODE 10
-#define VO_PROP_MAX_NUM_FRAMES 11
-#define VO_PROP_GAMMA 12
-#define VO_PROP_ZOOM_Y 13
-#define VO_PROP_DISCARD_FRAMES 14 /* not used by drivers */
-#define VO_PROP_WINDOW_WIDTH 15 /* read-only */
-#define VO_PROP_WINDOW_HEIGHT 16 /* read-only */
-#define VO_PROP_BUFS_IN_FIFO 17 /* read-only */
-#define VO_PROP_NUM_STREAMS 18 /* read-only */
-#define VO_PROP_OUTPUT_WIDTH 19 /* read-only */
-#define VO_PROP_OUTPUT_HEIGHT 20 /* read-only */
-#define VO_PROP_OUTPUT_XOFFSET 21 /* read-only */
-#define VO_PROP_OUTPUT_YOFFSET 22 /* read-only */
-#define VO_NUM_PROPERTIES 23
-
-/* 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. */
-#define OVL_PALETTE_SIZE 256
-
-#define OVL_MAX_OPACITY 0x0f
-
-/* number of recent frames to keep in memory
- these frames are needed by some deinterlace algorithms
- FIXME: we need a method to flush the recent frames (new stream)
-*/
-#define VO_NUM_RECENT_FRAMES 2
-
-/* get_frame flags */
-#define VO_TOP_FIELD 1
-#define VO_BOTTOM_FIELD 2
-#define VO_BOTH_FIELDS (VO_TOP_FIELD | VO_BOTTOM_FIELD)
-#define VO_PAN_SCAN_FLAG 4
-#define VO_INTERLACED_FLAG 8
-#define VO_NEW_SEQUENCE_FLAG 16 /* set after MPEG2 Sequence Header Code (used by XvMC) */
-
-/* video driver capabilities */
-#define VO_CAP_YV12 0x00000001 /* driver can handle YUV 4:2:0 pictures */
-#define VO_CAP_YUY2 0x00000002 /* driver can handle YUY2 pictures */
-#define VO_CAP_XVMC_MOCOMP 0x00000004 /* driver can use XvMC motion compensation */
-#define VO_CAP_XVMC_IDCT 0x00000008 /* driver can use XvMC idct acceleration */
-#define VO_CAP_UNSCALED_OVERLAY 0x00000010 /* driver can blend overlay at output resolution */
-#define VO_CAP_CROP 0x00000020 /* driver can crop */
-#define VO_CAP_XXMC 0x00000040 /* driver can use extended XvMC */
-
-
-/*
- * vo_driver_s contains the functions every display driver
- * has to implement. The vo_new_port function (see below)
- * should then be used to construct a vo_port using this
- * driver. Some of the function pointers will be copied
- * directly into xine_video_port_s, others will be called
- * from generic vo functions.
- */
-
-#define VIDEO_OUT_DRIVER_IFACE_VERSION 21
-
-struct vo_driver_s {
-
- uint32_t (*get_capabilities) (vo_driver_t *self); /* for constants see above */
-
- /*
- * allocate an vo_frame_t struct,
- * the driver must supply the copy, field and dispose functions
- */
- vo_frame_t* (*alloc_frame) (vo_driver_t *self);
-
- /*
- * check if the given image fullfills the format specified
- * (re-)allocate memory if necessary
- */
- void (*update_frame_format) (vo_driver_t *self, vo_frame_t *img,
- uint32_t width, uint32_t height,
- double ratio, int format, int flags);
-
- /* display a given frame */
- void (*display_frame) (vo_driver_t *self, vo_frame_t *vo_img);
-
- /* overlay_begin and overlay_end are used by drivers suporting
- * persistent overlays. they can be optimized to update only when
- * overlay image has changed.
- *
- * sequence of operation (pseudo-code):
- * overlay_begin(this,img,true_if_something_changed_since_last_blend );
- * while(visible_overlays)
- * overlay_blend(this,img,overlay[i]);
- * overlay_end(this,img);
- *
- * any function pointer from this group may be set to NULL.
- */
- void (*overlay_begin) (vo_driver_t *self, vo_frame_t *vo_img, int changed);
- void (*overlay_blend) (vo_driver_t *self, vo_frame_t *vo_img, vo_overlay_t *overlay);
- void (*overlay_end) (vo_driver_t *self, vo_frame_t *vo_img);
-
- /*
- * these can be used by the gui directly:
- */
- int (*get_property) (vo_driver_t *self, int property);
- int (*set_property) (vo_driver_t *self,
- int property, int value);
- void (*get_property_min_max) (vo_driver_t *self,
- int property, int *min, int *max);
-
- /*
- * general purpose communication channel between gui and driver
- *
- * this should be used to propagate events, display data, window sizes
- * etc. to the driver
- */
- int (*gui_data_exchange) (vo_driver_t *self, int data_type,
- void *data);
-
- /* check if a redraw is needed (due to resize)
- * this is only used for still frames, normal video playback
- * must call that inside display_frame() function.
- */
- int (*redraw_needed) (vo_driver_t *self);
-
- /*
- * free all resources, close driver
- */
- void (*dispose) (vo_driver_t *self);
-
- void *node; /* needed by plugin_loader */
-};
-
-struct video_driver_class_s {
-
- /*
- * open a new instance of this plugin class
- */
- vo_driver_t* (*open_plugin) (video_driver_class_t *self, const void *visual);
-
- /*
- * return short, human readable identifier for this plugin class
- */
- char* (*get_identifier) (video_driver_class_t *self);
-
- /*
- * return human readable (verbose = 1 line) description for
- * this plugin class
- */
- char* (*get_description) (video_driver_class_t *self);
-
- /*
- * free all class-related resources
- */
- void (*dispose) (video_driver_class_t *self);
-};
-
-
-typedef struct rle_elem_s {
- uint16_t len;
- uint16_t color;
-} rle_elem_t;
-
-struct vo_overlay_s {
-
- rle_elem_t *rle; /* rle code buffer */
- int data_size; /* useful for deciding realloc */
- int num_rle; /* number of active rle codes */
- int x; /* x start of subpicture area */
- int y; /* y start of subpicture area */
- int width; /* width of subpicture area */
- int height; /* height of subpicture area */
-
- uint32_t color[OVL_PALETTE_SIZE]; /* color lookup table */
- uint8_t trans[OVL_PALETTE_SIZE]; /* mixer key table */
- int rgb_clut; /* true if clut was converted to rgb */
-
- /* define a highlight area with different colors */
- int hili_top;
- int hili_bottom;
- int hili_left;
- int hili_right;
- uint32_t hili_color[OVL_PALETTE_SIZE];
- uint8_t hili_trans[OVL_PALETTE_SIZE];
- int hili_rgb_clut; /* true if clut was converted to rgb */
-
- int unscaled; /* true if it should be blended unscaled */
-};
-
-
-/* API to video_overlay manager
- *
- * Remember that adding new functions to this structure requires
- * adaption of the post plugin decoration layer. Be sure to look into
- * src/xine-engine/post.[ch].
- */
-struct video_overlay_manager_s {
- void (*init) (video_overlay_manager_t *this_gen);
-
- void (*dispose) (video_overlay_manager_t *this_gen);
-
- int32_t (*get_handle) (video_overlay_manager_t *this_gen, int object_type );
-
- void (*free_handle) (video_overlay_manager_t *this_gen, int32_t handle);
-
- int32_t (*add_event) (video_overlay_manager_t *this_gen, void *event);
-
- void (*flush_events) (video_overlay_manager_t *this_gen );
-
- int (*redraw_needed) (video_overlay_manager_t *this_gen, int64_t vpts );
-
- void (*multiple_overlay_blend) (video_overlay_manager_t *this_gen, int64_t vpts,
- vo_driver_t *output, vo_frame_t *vo_img, int enabled);
-};
-
-/*
- * build a video_out_port from
- * a given video driver
- */
-xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabonly) XINE_MALLOC XINE_PROTECTED;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c
index 3216950e8..0052375bb 100644
--- a/src/xine-engine/video_overlay.c
+++ b/src/xine-engine/video_overlay.c
@@ -29,11 +29,11 @@
#include <sys/stat.h>
#include <fcntl.h>
-#include "buffer.h"
-#include "xine_internal.h"
+#include <xine/buffer.h>
+#include <xine/xine_internal.h>
#include "bswap.h"
-#include "xineutils.h"
-#include "video_overlay.h"
+#include <xine/xineutils.h>
+#include <xine/video_overlay.h>
/*
#define LOG_DEBUG
@@ -174,6 +174,8 @@ static void internal_video_overlay_free_handle(video_overlay_t *this, int32_t ha
pthread_mutex_lock( &this->objects_mutex );
if( this->objects[handle].overlay ) {
+ set_argb_layer_ptr(&this->objects[handle].overlay->argb_layer, NULL);
+
if( this->objects[handle].overlay->rle )
free( this->objects[handle].overlay->rle );
free( this->objects[handle].overlay );
@@ -396,6 +398,8 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
#endif
/* free any overlay associated with this event */
if (this->events[this_event].event->object.overlay != NULL) {
+ set_argb_layer_ptr(&this->events[this_event].event->object.overlay->argb_layer, NULL);
+
if( this->events[this_event].event->object.overlay->rle != NULL )
free( this->events[this_event].event->object.overlay->rle );
free(this->events[this_event].event->object.overlay);
@@ -410,6 +414,8 @@ static int video_overlay_event( video_overlay_t *this, int64_t vpts ) {
#endif
/* free any overlay associated with this event */
if( this->events[this_event].event->object.overlay != NULL) {
+ set_argb_layer_ptr(&this->events[this_event].event->object.overlay->argb_layer, NULL);
+
if( this->events[this_event].event->object.overlay->rle != NULL )
free( this->events[this_event].event->object.overlay->rle );
free(this->events[this_event].event->object.overlay);
diff --git a/src/xine-engine/video_overlay.h b/src/xine-engine/video_overlay.h
deleted file mode 100644
index f2deb8a2b..000000000
--- a/src/xine-engine/video_overlay.h
+++ /dev/null
@@ -1,103 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- */
-
-#ifndef HAVE_VIDEO_OVERLAY_H
-#define HAVE_VIDEO_OVERLAY_H
-
-#ifdef XINE_COMPILE
-# include "xine_internal.h"
-#else
-# include <xine/xine_internal.h>
-#endif
-
-#ifdef __GNUC__
-#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) {y: (_y), cr: (_cr), cb: (_cb)}
-#else
-#define CLUT_Y_CR_CB_INIT(_y,_cr,_cb) { (_cb), (_cr), (_y) }
-#endif
-
-#define MAX_OBJECTS 50
-#define MAX_EVENTS 50
-#define MAX_SHOWING 16
-
-#define OVERLAY_EVENT_NULL 0
-#define OVERLAY_EVENT_SHOW 1
-#define OVERLAY_EVENT_HIDE 2
-#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 */
-} 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.
- */
- video_overlay_object_t object; /* The image data. */
-} video_overlay_event_t;
-
-video_overlay_manager_t *_x_video_overlay_new_manager(xine_t *) XINE_MALLOC XINE_PROTECTED;
-
-#endif
diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c
index e2b7ac9e4..e44fc4966 100644
--- a/src/xine-engine/vo_scale.c
+++ b/src/xine-engine/vo_scale.c
@@ -36,8 +36,8 @@
#define LOG
*/
-#include "xine_internal.h"
-#include "vo_scale.h"
+#include <xine/xine_internal.h>
+#include <xine/vo_scale.h>
/*
* convert delivered height/width to ideal width/height
@@ -315,28 +315,21 @@ void _x_vo_scale_translate_gui2video(vo_scale_t *this,
*vid_y = y;
}
-/*
- * Returns description of a given ratio code
+/*/
+ * @brief Table for description of a given ratio code.
+ *
+ * @note changing the size of the elements of the array will break
+ * ABI, so please don't do that unless you absolutely can't continue
+ * with the current size.
*/
-
-char *_x_vo_scale_aspect_ratio_name(int a) {
-
- switch (a) {
- case XINE_VO_ASPECT_AUTO:
- return "auto";
- case XINE_VO_ASPECT_SQUARE:
- return "square";
- case XINE_VO_ASPECT_4_3:
- return "4:3";
- case XINE_VO_ASPECT_ANAMORPHIC:
- return "16:9";
- case XINE_VO_ASPECT_DVB:
- return "2:1";
- default:
- return "unknown";
- }
-}
-
+const char _x_vo_scale_aspect_ratio_name_table[][8] = {
+ "auto", /* XINE_VO_ASPECT_AUTO */
+ "square", /* XINE_VO_ASPECT_SQUARE */
+ "4:3", /* XINE_VO_ASPECT_4_3 */
+ "16:9", /* XINE_VO_ASPECT_ANAMORPHIC */
+ "2:1", /* XINE_VO_ASPECT_DVB */
+ "unknown" /* All the rest */
+};
/*
* config callbacks
diff --git a/src/xine-engine/vo_scale.h b/src/xine-engine/vo_scale.h
deleted file mode 100644
index fe2594eeb..000000000
--- a/src/xine-engine/vo_scale.h
+++ /dev/null
@@ -1,200 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * vo_scale.h
- *
- * keeps video scaling information
- */
-
-#ifndef HAVE_VO_SCALE_H
-#define HAVE_VO_SCALE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef XINE_COMPILE
-# include "configfile.h"
-#else
-# include <xine/configfile.h>
-#endif
-
-typedef struct {
- int x, y;
- int w, h;
-} vo_scale_rect_t;
-
-struct vo_scale_s {
-
- /* true if driver supports frame zooming */
- int support_zoom;
-
- /* forces direct mapping between frame pixels and screen pixels */
- int scaling_disabled;
-
- /* size / aspect ratio calculations */
-
- /*
- * "delivered" size:
- * frame dimension / aspect as delivered by the decoder
- * used (among other things) to detect frame size changes
- * units: frame pixels
- */
- int delivered_width;
- int delivered_height;
- double delivered_ratio;
-
- /*
- * required cropping:
- * units: frame pixels
- */
- int crop_left;
- int crop_right;
- int crop_top;
- int crop_bottom;
-
- /*
- * displayed part of delivered images,
- * taking zoom into account
- * units: frame pixels
- */
- int displayed_xoffset;
- int displayed_yoffset;
- int displayed_width;
- int displayed_height;
- double zoom_factor_x, zoom_factor_y;
-
- /*
- * user's aspect selection
- */
- int user_ratio;
-
- /*
- * "gui" size / offset:
- * what gui told us about where to display the video
- * units: screen pixels
- */
- int gui_x, gui_y;
- int gui_width, gui_height;
- int gui_win_x, gui_win_y;
-
- /*
- * video + display pixel aspect
- * One pixel of height 1 has this width
- * This may be corrected by the driver in order to fit the video seamlessly
- */
- double gui_pixel_aspect;
- double video_pixel_aspect;
-
- /*
- * "output" size:
- *
- * this is finally the ideal size "fitted" into the
- * gui size while maintaining the aspect ratio
- * units: screen pixels
- */
- int output_width;
- int output_height;
- int output_xoffset;
- int output_yoffset;
-
-
- /* */
- int force_redraw;
-
-
- /* gui callbacks */
-
- void *user_data;
- void (*frame_output_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_x, int *dest_y,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect,
- int *win_x, int *win_y);
-
- void (*dest_size_cb) (void *user_data,
- int video_width, int video_height,
- double video_pixel_aspect,
- int *dest_width, int *dest_height,
- double *dest_pixel_aspect);
-
- /* borders */
- vo_scale_rect_t border[4];
-
- /*
- * border ratios to determine image position in the
- * viewport; these are set by user config
- */
- double output_horizontal_position;
- double output_vertical_position;
-
-};
-
-typedef struct vo_scale_s vo_scale_t;
-
-
-/*
- * convert delivered height/width to ideal width/height
- * taking into account aspect ratio and zoom factor
- */
-
-void _x_vo_scale_compute_ideal_size (vo_scale_t *self) XINE_PROTECTED;
-
-
-/*
- * make ideal width/height "fit" into the gui
- */
-
-void _x_vo_scale_compute_output_size (vo_scale_t *self) XINE_PROTECTED;
-
-/*
- * return true if a redraw is needed due resizing, zooming,
- * aspect ratio changing, etc.
- */
-
-int _x_vo_scale_redraw_needed (vo_scale_t *self) XINE_PROTECTED;
-
-/*
- *
- */
-
-void _x_vo_scale_translate_gui2video(vo_scale_t *self,
- int x, int y,
- int *vid_x, int *vid_y) XINE_PROTECTED;
-
-/*
- * Returns description of a given ratio code
- */
-
-char *_x_vo_scale_aspect_ratio_name(int a) XINE_PROTECTED;
-
-/*
- * initialize rescaling struct
- */
-
-void _x_vo_scale_init(vo_scale_t *self, int support_zoom,
- int scaling_disabled, config_values_t *config ) XINE_PROTECTED;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 5a180c212..9a7e28a7f 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -47,36 +47,41 @@
#include <locale.h>
#endif
+#include <basedir.h>
+
#define LOG_MODULE "xine"
#define LOG_VERBOSE
/*
#define LOG
+#define DEBUG
*/
#define XINE_ENABLE_EXPERIMENTAL_FEATURES
#define XINE_ENGINE_INTERNAL
#define METRONOM_CLOCK_INTERNAL
-#include "xine_internal.h"
-#include "plugin_catalog.h"
-#include "audio_out.h"
-#include "video_out.h"
-#include "demuxers/demux.h"
-#include "buffer.h"
-#include "spu_decoder.h"
-#include "input/input_plugin.h"
-#include "metronom.h"
-#include "configfile.h"
-#include "osd.h"
-
-#include "xineutils.h"
-#include "compat.h"
+#include <xine/xine_internal.h>
+#include <xine/plugin_catalog.h>
+#include <xine/audio_out.h>
+#include <xine/video_out.h>
+#include <xine/demux.h>
+#include <xine/buffer.h>
+#include <xine/spu_decoder.h>
+#include <xine/input_plugin.h>
+#include <xine/metronom.h>
+#include <xine/configfile.h>
+#include <xine/osd.h>
+#include <xine/spu.h>
+
+#include <xine/xineutils.h>
+#include <xine/compat.h>
#ifdef WIN32
# include <fcntl.h>
# include <winsock.h>
#endif /* WIN32 */
+#include "xine_private.h"
/* FIXME-ABI Global variable. Done this way for ABI & API reasons... */
int _x_flags = 0;
@@ -298,8 +303,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);
@@ -321,12 +355,15 @@ static xine_ticket_t *XINE_MALLOC 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);
@@ -528,6 +565,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)) {
@@ -538,6 +576,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;
}
@@ -552,6 +591,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)) {
@@ -562,6 +602,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;
}
@@ -642,6 +683,7 @@ xine_stream_t *xine_stream_new (xine_t *this,
pthread_mutex_init (&stream->info_mutex, NULL);
pthread_mutex_init (&stream->meta_mutex, NULL);
pthread_mutex_init (&stream->demux_lock, NULL);
+ pthread_mutex_init (&stream->demux_action_lock, NULL);
pthread_mutex_init (&stream->demux_mutex, NULL);
pthread_cond_init (&stream->demux_resume, NULL);
pthread_mutex_init (&stream->event_queues_lock, NULL);
@@ -708,9 +750,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;
/*
@@ -877,11 +920,12 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
int res;
xine_log (stream->xine, XINE_LOG_MSG, _("xine: found input plugin : %s\n"),
- stream->input_plugin->input_class->get_description(stream->input_plugin->input_class));
+ dgettext(stream->input_plugin->input_class->text_domain ? : XINE_TEXTDOMAIN,
+ stream->input_plugin->input_class->description));
if (stream->input_plugin->input_class->eject_media)
stream->eject_class = stream->input_plugin->input_class;
_x_meta_info_set_utf8(stream, XINE_META_INFO_INPUT_PLUGIN,
- (stream->input_plugin->input_class->get_identifier (stream->input_plugin->input_class)));
+ stream->input_plugin->input_class->identifier);
res = (stream->input_plugin->open) (stream->input_plugin);
switch(res) {
@@ -935,7 +979,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
}
_x_meta_info_set_utf8(stream, XINE_META_INFO_SYSTEMLAYER,
- (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)));
+ stream->demux_plugin->demux_class->identifier);
free(demux_name);
} else {
xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n"));
@@ -1011,7 +1055,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
lprintf ("demux and input plugin found\n");
_x_meta_info_set_utf8(stream, XINE_META_INFO_SYSTEMLAYER,
- (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)));
+ stream->demux_plugin->demux_class->identifier);
free(demux_name);
} else {
xprintf(stream->xine, XINE_VERBOSITY_LOG, _("xine: error while parsing mrl\n"));
@@ -1198,7 +1242,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
if( !no_cache )
/* enable buffered input plugin (request optimizer) */
- stream->input_plugin = _x_cache_plugin_get_instance(stream, 0);
+ stream->input_plugin = _x_cache_plugin_get_instance(stream);
/* Let the plugin request a specific demuxer (if the user hasn't).
* This overrides find-by-content & find-by-extension.
@@ -1214,7 +1258,7 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
{
lprintf ("demux and input plugin found\n");
_x_meta_info_set_utf8 (stream, XINE_META_INFO_SYSTEMLAYER,
- stream->demux_plugin->demux_class->get_identifier (stream->demux_plugin->demux_class));
+ stream->demux_plugin->demux_class->identifier);
}
else
xine_log (stream->xine, XINE_LOG_MSG, _("xine: couldn't load plugin-specified demux %s for >%s<\n"), default_demux, mrl);
@@ -1240,11 +1284,12 @@ static int open_internal (xine_stream_t *stream, const char *mrl) {
lprintf ("demux and input plugin found\n");
_x_meta_info_set_utf8(stream, XINE_META_INFO_SYSTEMLAYER,
- (stream->demux_plugin->demux_class->get_identifier(stream->demux_plugin->demux_class)));
+ stream->demux_plugin->demux_class->identifier);
}
xine_log (stream->xine, XINE_LOG_MSG, _("xine: found demuxer plugin: %s\n"),
- stream->demux_plugin->demux_class->get_description(stream->demux_plugin->demux_class));
+ dgettext(stream->demux_plugin->demux_class->text_domain ? : XINE_TEXTDOMAIN,
+ stream->demux_plugin->demux_class->description));
_x_extra_info_reset( stream->current_extra_info );
_x_extra_info_reset( stream->video_decoder_extra_info );
@@ -1339,7 +1384,7 @@ static int play_internal (xine_stream_t *stream, int start_pos, int start_time)
}
/* hint demuxer thread we want to interrupt it */
- stream->demux_action_pending = 1;
+ _x_action_raise(stream);
/* set normal speed */
if (_x_get_speed(stream) != XINE_SPEED_NORMAL)
@@ -1358,7 +1403,7 @@ static int play_internal (xine_stream_t *stream, int start_pos, int start_time)
pthread_mutex_lock( &stream->demux_lock );
/* demux_lock taken. now demuxer is suspended */
- stream->demux_action_pending = 0;
+ _x_action_lower(stream);
pthread_cond_signal(&stream->demux_resume);
/* set normal speed again (now that demuxer/input pair is suspended)
@@ -1495,6 +1540,7 @@ static void xine_dispose_internal (xine_stream_t *stream) {
pthread_cond_destroy (&stream->counter_changed);
pthread_mutex_destroy (&stream->demux_mutex);
pthread_cond_destroy (&stream->demux_resume);
+ pthread_mutex_destroy (&stream->demux_action_lock);
pthread_mutex_destroy (&stream->demux_lock);
pthread_mutex_destroy (&stream->first_frame_lock);
pthread_cond_destroy (&stream->first_frame_reached);
@@ -1575,6 +1621,8 @@ void xine_exit (xine_t *this) {
WSACleanup();
#endif
+ xdgWipeHandle(&this->basedir_handle);
+
free (this);
}
@@ -1674,9 +1722,9 @@ static void config_demux_strategy_cb (void *this_gen, xine_cfg_entry_t *entry) {
static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) {
xine_t *this = (xine_t *)this_gen;
- char *homedir_trail_slash;
+ char homedir_trail_slash[strlen(xine_get_homedir()) + 2];
- homedir_trail_slash = _x_asprintf("%s/", xine_get_homedir());
+ sprintf(homedir_trail_slash, "%s/", xine_get_homedir());
if (entry->str_value[0] &&
(entry->str_value[0] != '/' || strstr(entry->str_value, "/.") ||
strcmp(entry->str_value, xine_get_homedir()) == 0 ||
@@ -1695,7 +1743,6 @@ static void config_save_cb (void *this_gen, xine_cfg_entry_t *entry) {
pthread_mutex_unlock(&this->streams_lock);
}
- free(homedir_trail_slash);
this->save_path = entry->str_value;
}
@@ -1706,8 +1753,12 @@ void xine_set_flags (xine_t *this, int flags)
}
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. */
+ setenv ("HOME", xine_get_homedir (), 0); /* libxdg-basedir needs $HOME */
+ xdgInitHandle(&this->basedir_handle);
/*
* locks
@@ -1723,7 +1774,7 @@ void xine_init (xine_t *this) {
/*
* plugins
*/
- _x_scan_plugins(this);
+ XINE_PROFILE(_x_scan_plugins(this));
#ifdef HAVE_SETLOCALE
if (!setlocale(LC_CTYPE, ""))
@@ -1985,7 +2036,7 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
int flags, int img_size_unknown) {
vo_frame_t *frame;
- size_t required_size;
+ size_t required_size = 0;
stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0);
frame = stream->video_out->get_last_frame (stream->video_out);
@@ -2020,6 +2071,30 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
switch (frame->format) {
+ default:
+ if (frame->proc_provide_standard_frame_data) {
+ uint8_t *img = data->img;
+ size_t img_size = data->img_size;
+ data->img = 0;
+ data->img_size = 0;
+
+ /* ask frame implementation for required img buffer size */
+ frame->proc_provide_standard_frame_data(frame, data);
+ required_size = data->img_size;
+
+ data->img = img;
+ data->img_size = img_size;
+ break;
+ }
+
+ if (!data->img && !(flags & XINE_FRAME_DATA_ALLOCATE_IMG))
+ break; /* not interested in image data */
+
+ xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
+ "xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
+ /* fall though and provide "green" YV12 image */
+ data->format = XINE_IMGFMT_YV12;
+
case XINE_IMGFMT_YV12:
required_size = frame->width * frame->height
+ ((frame->width + 1) / 2) * ((frame->height + 1) / 2)
@@ -2032,26 +2107,21 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
+ ((frame->width + 1) / 2) * frame->height;
break;
- default:
- if (data->img || (flags & XINE_FRAME_DATA_ALLOCATE_IMG)) {
- xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
- "xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
- _x_abort ();
- }
-
- required_size = 0;
}
if (flags & XINE_FRAME_DATA_ALLOCATE_IMG) {
/* return allocated buffer size */
data->img_size = required_size;
/* allocate img or fail */
- if (!(data->img = calloc(1, required_size)))
+ if (!(data->img = calloc(1, required_size))) {
+ frame->free(frame);
return 0;
+ }
} else {
/* fail if supplied buffer is to small */
if (data->img && !img_size_unknown && data->img_size < required_size) {
data->img_size = required_size;
+ frame->free(frame);
return 0;
}
/* return used buffer size */
@@ -2087,11 +2157,14 @@ static int _x_get_current_frame_data (xine_stream_t *stream,
break;
default:
- xprintf (stream->xine, XINE_VERBOSITY_DEBUG,
- "xine: error, snapshot function not implemented for format 0x%x\n", frame->format);
- _x_abort ();
+ if (frame->proc_provide_standard_frame_data)
+ frame->proc_provide_standard_frame_data(frame, data);
+ else if (!(flags & XINE_FRAME_DATA_ALLOCATE_IMG))
+ memset(data->img, 0, data->img_size);
}
}
+
+ frame->free(frame);
return 1;
}
@@ -2158,16 +2231,15 @@ int xine_get_current_frame (xine_stream_t *stream, int *width, int *height,
return result;
}
-int xine_get_video_frame (xine_stream_t *stream,
- int timestamp, /* msec */
- int *width, int *height,
- int *ratio_code,
- int *duration, /* msec */
- int *format,
- uint8_t *img) {
- xprintf (stream->xine, XINE_VERBOSITY_DEBUG, "xine: xine_get_video_frame not implemented yet.\n");
- _x_abort ();
- return 0;
+xine_grab_video_frame_t* xine_new_grab_video_frame (xine_stream_t *stream) {
+ xine_grab_video_frame_t *frame;
+
+ if (stream->video_out->driver->new_grab_video_frame)
+ frame = stream->video_out->driver->new_grab_video_frame(stream->video_out->driver);
+ else
+ frame = stream->video_out->new_grab_video_frame(stream->video_out);
+
+ return frame;
}
int xine_get_spu_lang (xine_stream_t *stream, int channel, char *lang) {
@@ -2313,11 +2385,6 @@ int xine_get_error (xine_stream_t *stream) {
return stream->err;
}
-int xine_trick_mode (xine_stream_t *stream, int mode, int value) {
- printf ("xine: xine_trick_mode not implemented yet.\n");
- _x_abort ();
-}
-
int xine_stream_master_slave(xine_stream_t *master, xine_stream_t *slave,
int affection) {
master->slave = slave;
@@ -2356,3 +2423,146 @@ int _x_query_buffer_usage(xine_stream_t *stream, int *num_video_buffers, int *nu
return ticket_acquired != 0;
}
+
+static void _x_query_buffers_fix_data(xine_query_buffers_data_t *data)
+{
+ if (data->total < 0)
+ data->total = 0;
+
+ if (data->ready < 0)
+ data->ready = 0;
+
+ if (data->avail < 0)
+ data->avail = 0;
+
+ /* fix race condition of not filling data atomically */
+ if (data->ready + data->avail > data->total)
+ data->avail = data->total - data->ready;
+}
+
+int _x_query_buffers(xine_stream_t *stream, xine_query_buffers_t *query)
+{
+ int ticket_acquired = -1;
+
+ memset(query, 0, sizeof (*query));
+
+ if (stream->video_fifo)
+ {
+ query->vi.total = stream->video_fifo->buffer_pool_capacity;
+ query->vi.ready = stream->video_fifo->size(stream->video_fifo);
+ query->vi.avail = stream->video_fifo->num_free(stream->video_fifo);
+ _x_query_buffers_fix_data(&query->vi);
+ }
+
+ if (stream->audio_fifo)
+ {
+ query->ai.total = stream->audio_fifo->buffer_pool_capacity;
+ query->ai.ready = stream->audio_fifo->size(stream->audio_fifo);
+ query->ai.avail = stream->audio_fifo->num_free(stream->audio_fifo);
+ _x_query_buffers_fix_data(&query->ai);
+ }
+
+ if (stream->video_out || stream->audio_out)
+ ticket_acquired = stream->xine->port_ticket->acquire_nonblocking(stream->xine->port_ticket, 1);
+
+ if (ticket_acquired > 0)
+ {
+ if (stream->video_out)
+ {
+ query->vo.total = stream->video_out->get_property(stream->video_out, VO_PROP_BUFS_TOTAL);
+ query->vo.ready = stream->video_out->get_property(stream->video_out, VO_PROP_BUFS_IN_FIFO);
+ query->vo.avail = stream->video_out->get_property(stream->video_out, VO_PROP_BUFS_FREE);
+ }
+
+ if (stream->audio_out)
+ {
+ query->ao.total = stream->audio_out->get_property(stream->audio_out, AO_PROP_BUFS_TOTAL);
+ query->ao.ready = stream->audio_out->get_property(stream->audio_out, AO_PROP_BUFS_IN_FIFO);
+ query->ao.avail = stream->audio_out->get_property(stream->audio_out, AO_PROP_BUFS_FREE);
+ }
+
+ stream->xine->port_ticket->release_nonblocking(stream->xine->port_ticket, 1);
+ }
+
+ 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_interface.c b/src/xine-engine/xine_interface.c
index 62de42678..ab1bafa1e 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.c
@@ -40,11 +40,11 @@
#define XINE_ENGINE_INTERNAL
-#include "xine_internal.h"
-#include "audio_out.h"
-#include "video_out.h"
-#include "demuxers/demux.h"
-#include "post.h"
+#include <xine/xine_internal.h>
+#include <xine/audio_out.h>
+#include <xine/video_out.h>
+#include <xine/demux.h>
+#include <xine/post.h>
/*
* version information / checking
@@ -322,15 +322,6 @@ void xine_config_reset (xine_t *this) {
pthread_mutex_unlock(&config->config_lock);
}
-#ifndef XINE_DISABLE_DEPRECATED_FEATURES
-int xine_gui_send_vo_data (xine_stream_t *stream,
- int type, void *data) {
-
- return stream->video_driver->gui_data_exchange (stream->video_driver,
- type, data);
-}
-#endif
-
int xine_port_send_gui_data (xine_video_port_t *vo,
int type, void *data) {
@@ -474,6 +465,8 @@ void xine_set_param (xine_stream_t *stream, int param, int value) {
stream->xine->verbosity = value;
break;
+ case XINE_PARAM_VO_SHARPNESS:
+ case XINE_PARAM_VO_NOISE_REDUCTION:
case XINE_PARAM_VO_HUE:
case XINE_PARAM_VO_SATURATION:
case XINE_PARAM_VO_CONTRAST:
@@ -639,6 +632,8 @@ int xine_get_param (xine_stream_t *stream, int param) {
ret = stream->xine->verbosity;
break;
+ case XINE_PARAM_VO_SHARPNESS:
+ case XINE_PARAM_VO_NOISE_REDUCTION:
case XINE_PARAM_VO_HUE:
case XINE_PARAM_VO_SATURATION:
case XINE_PARAM_VO_CONTRAST:
@@ -860,6 +855,20 @@ void xine_osd_draw_bitmap(xine_osd_t *this, uint8_t *bitmap,
this->osd.renderer->draw_bitmap(&this->osd, bitmap, x1, y1, width, height, palette_map);
}
+void xine_osd_set_argb_buffer(xine_osd_t *this, uint32_t *argb_buffer,
+ int dirty_x, int dirty_y, int dirty_width, int dirty_height) {
+ this->osd.renderer->set_argb_buffer(&this->osd, argb_buffer, dirty_x, dirty_y, dirty_width, dirty_height);
+}
+
+void xine_osd_set_extent(xine_osd_t *this, int extent_width, int extent_height) {
+ this->osd.renderer->set_extent(&this->osd, extent_width, extent_height);
+}
+
+void xine_osd_set_video_window(xine_osd_t *this, int window_x, int window_y, int window_width, int window_height) {
+ this->osd.renderer->set_video_window(&this->osd, window_x, window_y, window_width, window_height);
+}
+
+
const char *const *xine_post_list_inputs(xine_post_t *this_gen) {
post_plugin_t *this = (post_plugin_t *)this_gen;
return this->input_ids;
@@ -957,7 +966,7 @@ int _x_message(xine_stream_t *stream, int type, ...) {
va_list ap;
char *s, *params;
char *args[1025];
- static const char *std_explanation[] = {
+ static const char *const std_explanation[] = {
"",
N_("Warning:"),
N_("Unknown host:"),
diff --git a/src/xine-engine/xine_internal.h b/src/xine-engine/xine_internal.h
deleted file mode 100644
index af8817ac5..000000000
--- a/src/xine-engine/xine_internal.h
+++ /dev/null
@@ -1,543 +0,0 @@
-/*
- * Copyright (C) 2000-2005 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, USA
- */
-
-#ifndef HAVE_XINE_INTERNAL_H
-#define HAVE_XINE_INTERNAL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * include public part of xine header
- */
-
-#ifdef XINE_COMPILE
-# include "xine.h"
-# include "refcounter.h"
-# include "input/input_plugin.h"
-# include "demuxers/demux.h"
-# include "video_out.h"
-# include "audio_out.h"
-# include "metronom.h"
-# include "osd.h"
-# include "xineintl.h"
-# include "plugin_catalog.h"
-# include "video_decoder.h"
-# include "audio_decoder.h"
-# include "spu_decoder.h"
-# include "scratch.h"
-# include "broadcaster.h"
-# include "io_helper.h"
-# include "info_helper.h"
-# include "alphablend.h"
-#else
-# include <xine.h>
-# include <xine/refcounter.h>
-# include <xine/input_plugin.h>
-# include <xine/demux.h>
-# include <xine/video_out.h>
-# include <xine/audio_out.h>
-# include <xine/metronom.h>
-# include <xine/osd.h>
-# include <xine/xineintl.h>
-# include <xine/plugin_catalog.h>
-# include <xine/video_decoder.h>
-# include <xine/audio_decoder.h>
-# include <xine/spu_decoder.h>
-# include <xine/scratch.h>
-# include <xine/broadcaster.h>
-# include <xine/io_helper.h>
-# include <xine/info_helper.h>
-# include <xine/alphablend.h>
-#endif
-
-
-#define XINE_MAX_EVENT_LISTENERS 50
-#define XINE_MAX_EVENT_TYPES 100
-#define XINE_MAX_TICKET_HOLDER_THREADS 64
-
-/* used by plugin loader */
-#define XINE_VERSION_CODE XINE_MAJOR_VERSION*10000+XINE_MINOR_VERSION*100+XINE_SUB_VERSION
-
-
-/*
- * log constants
- */
-
-#define XINE_LOG_MSG 0 /* warnings, errors, ... */
-#define XINE_LOG_PLUGIN 1
-#define XINE_LOG_TRACE 2
-#define XINE_LOG_NUM 3 /* # of log buffers defined */
-
-#define XINE_STREAM_INFO_MAX 99
-
-typedef struct xine_ticket_s xine_ticket_t;
-
-/*
- * the "big" xine struct, holding everything together
- */
-
-struct xine_s {
-
- config_values_t *config;
-
- plugin_catalog_t *plugin_catalog;
-
- 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;
-
-#ifdef XINE_ENGINE_INTERNAL
- xine_ticket_t *port_ticket;
- pthread_mutex_t log_lock;
-
- xine_log_cb_t log_cb;
- void *log_cb_user_data;
-#endif
-};
-
-/* FIXME-ABI Some global flag bits */
-/* See xine_set_flags() */
-#ifdef XINE_ENGINE_INTERNAL
-extern int _x_flags XINE_PROTECTED;
-#endif
-
-/*
- * xine thread tickets
- */
-
-struct xine_ticket_s {
-
- /* the ticket owner must assure to check for ticket revocation in
- * intervals of finite length; this means that you must release
- * the ticket before any operation that might block
- *
- * you must never write to this member directly
- */
- int ticket_revoked;
-
- /* apply for a ticket; between acquire and relese of an irrevocable
- * ticket (be sure to pair them properly!), it is guaranteed that you
- * will never be blocked by ticket revocation */
- void (*acquire)(xine_ticket_t *self, int irrevocable);
-
- /* give a ticket back */
- void (*release)(xine_ticket_t *self, int irrevocable);
-
- /* renew a ticket, when it has been revoked, see ticket_revoked above;
- * irrevocable must be set to one, if your thread might have acquired
- * irrevocable tickets you don't know of; set it to zero only when
- * you know that this is impossible */
- void (*renew)(xine_ticket_t *self, int irrevocable);
-
-#ifdef XINE_ENGINE_INTERNAL
- /* allow handing out new tickets */
- void (*issue)(xine_ticket_t *self, int atomic);
-
- /* revoke all tickets and deny new ones;
- * a pair of atomic revoke and issue cannot be interrupted by another
- * revocation or by other threads acquiring tickets */
- void (*revoke)(xine_ticket_t *self, int atomic);
-
- /* behaves like acquire() but doesn't block the calling thread; when
- * the thread would have been blocked, 0 is returned otherwise 1
- * this function acquires a ticket even if ticket revocation is active */
- int (*acquire_nonblocking)(xine_ticket_t *self, int irrevocable);
-
- /* behaves like release() but doesn't block the calling thread; should
- * be used in combination with acquire_nonblocking() */
- void (*release_nonblocking)(xine_ticket_t *self, int irrevocable);
-
- void (*dispose)(xine_ticket_t *self);
-
- pthread_mutex_t lock;
- pthread_mutex_t revoke_lock;
- pthread_cond_t issued;
- pthread_cond_t revoked;
- int tickets_granted;
- int irrevocable_tickets;
- int pending_revocations;
- int atomic_revoke;
- pthread_t atomic_revoker_thread;
- struct {
- int count;
- pthread_t holder;
- } *holder_threads;
- unsigned holder_thread_count;
-#endif
-};
-
-/*
- * xine event queue
- */
-
-struct xine_event_queue_s {
- xine_list_t *events;
- pthread_mutex_t lock;
- pthread_cond_t new_event;
- pthread_cond_t events_processed;
- xine_stream_t *stream;
- pthread_t *listener_thread;
- xine_event_listener_cb_t callback;
- int callback_running;
- void *user_data;
-};
-
-/*
- * xine_stream - per-stream parts of the xine engine
- */
-
-struct xine_stream_s {
-
- /* reference to xine context */
- xine_t *xine;
-
- /* metronom instance used by current stream */
- metronom_t *metronom;
-
- /* 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;
-
- /* demuxers send data to video decoders using this fifo */
- fifo_buffer_t *video_fifo;
-
- /* used by audio decoders */
- xine_audio_port_t *audio_out;
-
- /* demuxers send data to audio decoders using this fifo */
- fifo_buffer_t *audio_fifo;
-
- /* provide access to osd api */
- osd_renderer_t *osd_renderer;
-
- /* master/slave streams */
- xine_stream_t *master; /* usually a pointer to itself */
- xine_stream_t *slave;
-
- /* input_dvd uses this one. is it possible to add helper functions instead? */
- spu_decoder_t *spu_decoder_plugin;
-
- /* dxr3 use this one, should be possible to fix to use the port instead */
- vo_driver_t *video_driver;
-
- /* these definitely should be made private! */
- int audio_channel_auto;
- int spu_decoder_streamtype;
- int spu_channel_user;
- int spu_channel_auto;
- int spu_channel_letterbox;
- int spu_channel;
-
-#ifdef XINE_ENGINE_INTERNAL
- /* these are private variables, plugins must not access them */
-
- int status;
-
- /* lock controlling speed change access */
- pthread_mutex_t speed_change_lock;
- int ignore_speed_change; /* speed changes during stop can be disastrous */
-
- 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_channel;
-
- 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)
- >=0 => respect the user's choice
- */
- int audio_channel_user;
-/* int audio_channel_auto; */
-
-/* spu_decoder_t *spu_decoder_plugin; */
-/* int spu_decoder_streamtype; */
- uint32_t spu_track_map[50];
- int spu_track_map_entries;
-/* int spu_channel_user; */
-/* int spu_channel_auto; */
-/* int spu_channel_letterbox; */
- int spu_channel_pan_scan;
-/* int spu_channel; */
-
- /* lock for public xine player functions */
- pthread_mutex_t frontend_lock;
-
- /* stream meta information */
- /* NEVER access directly, use helpers (see info_helper.c) */
- pthread_mutex_t info_mutex;
- int stream_info_public[XINE_STREAM_INFO_MAX];
- int stream_info[XINE_STREAM_INFO_MAX];
- pthread_mutex_t meta_mutex;
- char *meta_info_public[XINE_STREAM_INFO_MAX];
- 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;
-
- /* wait for headers sent / stream decoding finished */
- pthread_mutex_t counter_lock;
- pthread_cond_t counter_changed;
- int header_count_audio;
- int header_count_video;
- int finished_count_audio;
- int finished_count_video;
-
- /* event mechanism */
- xine_list_t *event_queues;
- pthread_mutex_t event_queues_lock;
-
- /* 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_cond_t demux_resume;
- 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 slave_affection; /* what operations need to be propagated down to the slave? */
-
- int err;
-
- 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 */
- int keep_ao_driver_open;
-#endif
-};
-
-/* when explicitly noted, some functions accept an anonymous stream,
- * which is a valid stream that does not want to be addressed. */
-#define XINE_ANON_STREAM ((xine_stream_t *)-1)
-
-
-/*
- * private function prototypes:
- */
-
-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;
-
-void _x_handle_stream_end (xine_stream_t *stream, int non_user) XINE_PROTECTED;
-
-/* report message to UI. usually these are async errors */
-
-int _x_message(xine_stream_t *stream, int type, ...) XINE_SENTINEL XINE_PROTECTED;
-
-/* flush the message queues */
-
-void _x_flush_events_queues (xine_stream_t *stream) XINE_PROTECTED;
-
-
-/* find and instantiate input and demux plugins */
-
-input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) XINE_PROTECTED;
-demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED;
-demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const char *name, input_plugin_t *input) XINE_PROTECTED;
-demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) XINE_PROTECTED;
-input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) XINE_MALLOC XINE_PROTECTED;
-input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahead_size) XINE_MALLOC XINE_PROTECTED;
-void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) XINE_PROTECTED;
-void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) XINE_PROTECTED;
-
-/* create decoder fifos and threads */
-
-int _x_video_decoder_init (xine_stream_t *stream) XINE_PROTECTED;
-void _x_video_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED;
-
-int _x_audio_decoder_init (xine_stream_t *stream) XINE_PROTECTED;
-void _x_audio_decoder_shutdown (xine_stream_t *stream) XINE_PROTECTED;
-
-/* extra_info operations */
-void _x_extra_info_reset( extra_info_t *extra_info ) XINE_PROTECTED;
-
-void _x_extra_info_merge( extra_info_t *dst, extra_info_t *src ) XINE_PROTECTED;
-
-void _x_get_current_info (xine_stream_t *stream, extra_info_t *extra_info, int size) XINE_PROTECTED;
-
-
-/* demuxer helper functions from demux.c */
-
-/*
- * Flush audio and video buffers. It is called from demuxers on
- * seek/stop, and may be useful when user input changes a stream and
- * xine-lib has cached buffers that have yet to be played.
- *
- * warning: after clearing decoders fifos an absolute discontinuity
- * indication must be sent. relative discontinuities are likely
- * to cause "jumps" on metronom.
- */
-void _x_demux_flush_engine (xine_stream_t *stream) XINE_PROTECTED;
-
-void _x_demux_control_nop (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED;
-void _x_demux_control_newpts (xine_stream_t *stream, int64_t pts, uint32_t flags) XINE_PROTECTED;
-void _x_demux_control_headers_done (xine_stream_t *stream) XINE_PROTECTED;
-void _x_demux_control_start (xine_stream_t *stream) XINE_PROTECTED;
-void _x_demux_control_end (xine_stream_t *stream, uint32_t flags) XINE_PROTECTED;
-int _x_demux_start_thread (xine_stream_t *stream) XINE_PROTECTED;
-int _x_demux_stop_thread (xine_stream_t *stream) XINE_PROTECTED;
-int _x_demux_read_header (input_plugin_t *input, unsigned char *buffer, off_t size) XINE_PROTECTED;
-int _x_demux_check_extension (const char *mrl, const char *extensions) XINE_PROTECTED;
-
-off_t _x_read_abort (xine_stream_t *stream, int fd, char *buf, off_t todo) XINE_PROTECTED;
-
-int _x_action_pending (xine_stream_t *stream) XINE_PROTECTED;
-
-void _x_demux_send_data(fifo_buffer_t *fifo, uint8_t *data, int size,
- int64_t pts, uint32_t type, uint32_t decoder_flags,
- int input_normpos, int input_time, int total_time,
- uint32_t frame_number) XINE_PROTECTED;
-
-int _x_demux_read_send_data(fifo_buffer_t *fifo, input_plugin_t *input,
- int size, int64_t pts, uint32_t type,
- uint32_t decoder_flags, off_t input_normpos,
- int input_time, int total_time,
- uint32_t frame_number) XINE_PROTECTED;
-
-void _x_demux_send_mrl_reference (xine_stream_t *stream, int alternative,
- const char *mrl, const char *title,
- int start_time, int duration) XINE_PROTECTED;
-
-/*
- * MRL escaped-character decoding (overwrites the source string)
- */
-void _x_mrl_unescape(char *mrl) XINE_PROTECTED;
-
-/*
- * plugin_loader functions
- *
- */
-
-/* on-demand loading of audio/video/spu decoder plugins */
-
-video_decoder_t *_x_get_video_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED;
-void _x_free_video_decoder (xine_stream_t *stream, video_decoder_t *decoder) XINE_PROTECTED;
-audio_decoder_t *_x_get_audio_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED;
-void _x_free_audio_decoder (xine_stream_t *stream, audio_decoder_t *decoder) XINE_PROTECTED;
-spu_decoder_t *_x_get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) XINE_PROTECTED;
-void _x_free_spu_decoder (xine_stream_t *stream, spu_decoder_t *decoder) XINE_PROTECTED;
-/* check for decoder availability - but don't try to initialize it */
-int _x_decoder_available (xine_t *xine, uint32_t buftype) XINE_PROTECTED;
-
-/*
- * load_video_output_plugin
- *
- * load a specific video output plugin
- */
-
-vo_driver_t *_x_load_video_output_plugin(xine_t *this,
- char *id, int visual_type, void *visual) XINE_PROTECTED;
-
-/*
- * audio output plugin dynamic loading stuff
- */
-
-/*
- * load_audio_output_plugin
- *
- * load a specific audio output plugin
- */
-
-ao_driver_t *_x_load_audio_output_plugin (xine_t *self, const char *id) XINE_PROTECTED;
-
-
-void _x_set_speed (xine_stream_t *stream, int speed) XINE_PROTECTED;
-
-int _x_get_speed (xine_stream_t *stream) XINE_PROTECTED;
-
-void _x_set_fine_speed (xine_stream_t *stream, int speed) XINE_PROTECTED;
-
-int _x_get_fine_speed (xine_stream_t *stream) XINE_PROTECTED;
-
-void _x_select_spu_channel (xine_stream_t *stream, int channel) XINE_PROTECTED;
-
-int _x_get_audio_channel (xine_stream_t *stream) XINE_PROTECTED;
-
-int _x_get_spu_channel (xine_stream_t *stream) XINE_PROTECTED;
-
-/*
- * internal events
- */
-
-/* sent by dvb frontend to inform ts demuxer of new pids */
-#define XINE_EVENT_PIDS_CHANGE 0x80000000
-/* sent by BluRay input plugin to inform ts demuxer about end of clip */
-#define XINE_EVENT_END_OF_CLIP 0x80000001
-
-/*
- * pids change event - inform ts demuxer of new pids
- */
-typedef struct {
- int vpid; /* video program id */
- int apid; /* audio program id */
-} xine_pids_data_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/xine-engine/xine_plugin.h b/src/xine-engine/xine_plugin.h
deleted file mode 100644
index 3aa236ceb..000000000
--- a/src/xine-engine/xine_plugin.h
+++ /dev/null
@@ -1,105 +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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- * generic plugin definitions
- */
-
-#ifndef XINE_PLUGIN_H
-#define XINE_PLUGIN_H
-
-#define PLUGIN_NONE 0
-#define PLUGIN_INPUT 1
-#define PLUGIN_DEMUX 2
-#define PLUGIN_AUDIO_DECODER 3
-#define PLUGIN_VIDEO_DECODER 4
-#define PLUGIN_SPU_DECODER 5
-#define PLUGIN_AUDIO_OUT 6
-#define PLUGIN_VIDEO_OUT 7
-#define PLUGIN_POST 8
-
-#define PLUGIN_TYPE_MAX PLUGIN_POST
-
-/* this flag may be or'ed with type in order to force preloading the plugin.
- * very useful to register config items on xine initialization.
- */
-#define PLUGIN_MUST_PRELOAD (1 << 7)
-
-/* this flag may be or'ed with type to prevent the plugin loader from unloading
- * the plugin
- */
-#define PLUGIN_NO_UNLOAD (1 << 6)
-
-#define PLUGIN_TYPE_MASK ((1 << 6) - 1)
-
-typedef struct {
- uint8_t type; /* one of the PLUGIN_* constants above */
- uint8_t API; /* API version supported by this plugin */
- char *id; /* a name that identifies this plugin */
- uint32_t version; /* version number, increased every release */
- const void *special_info; /* plugin-type specific, see structs below */
- void *(*init)(xine_t *, void *); /* init the plugin class */
-} plugin_info_t;
-
-
-/* special_info for a video output plugin */
-typedef struct {
- int priority; /* priority of this plugin for auto-probing */
- int visual_type; /* visual type supported by this plugin */
-} vo_info_t;
-
-/* special info for a audio output plugin */
-typedef struct {
- int priority;
-} ao_info_t;
-
-/* special_info for a decoder plugin */
-typedef struct {
- uint32_t *supported_types; /* streamtypes this decoder can handle */
- int priority;
-} decoder_info_t;
-
-/* special info for a post plugin */
-typedef struct {
- uint32_t type; /* type of the post plugin, use one of XINE_POST_TYPE_* */
-} post_info_t;
-
-/* special info for a demuxer plugin */
-typedef struct {
- int priority;
-} demuxer_info_t;
-
-/* special info for an input plugin */
-typedef struct {
- int priority;
-} input_info_t;
-
-
-/* register a list of statically linked plugins
- * info is a list of plugin_info_t terminated by PLUGIN_NONE
- * example:
- * plugin_info_t acme_plugin_info[] = {
- * { PLUGIN_VIDEO_OUT, 21, "acme", XINE_VERSION_CODE, &vo_info_acme,
- * init_class_acme },
- * { PLUGIN_NONE, 0, "", 0, NULL, NULL }
- * };
- *
- */
-void xine_register_plugins(xine_t *self, plugin_info_t *info) XINE_PROTECTED;
-
-#endif
diff --git a/src/xine-engine/xine_private.h b/src/xine-engine/xine_private.h
index 6bdebd4eb..6d74e93b6 100644
--- a/src/xine-engine/xine_private.h
+++ b/src/xine-engine/xine_private.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2000-2011 the xine project
+ * Copyright (C) 2000-2008 the xine project
*
* This file is part of xine, a free video player.
*
@@ -18,19 +18,27 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
-#ifndef HAVE_XINE_PRIVATE_H
-#define HAVE_XINE_PRIVATE_H
+/**
+ * @file
+ * @brief Declaration of internal, private functions for xine-lib.
+ *
+ * @internal These functions should not be used by neither plugins nor
+ * frontends.
+ */
+
+#ifndef XINE_PRIVATE_H__
+#define XINE_PRIVATE_H__
#ifndef XINE_LIBRARY_COMPILE
# error xine_private.h is for libxine private use only!
#endif
-#include "configure.h"
+#include <config.h>
+#include <xine/xine_internal.h>
-/* Export internal only for functions that are unavailable to plugins */
-#if defined(SUPPORT_ATTRIBUTE_VISIBILITY_INTERNAL)
-# define INTERNAL __attribute__((__visibility__("internal")))
-#elif defined(SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT)
+#if SUPPORT_ATTRIBUTE_VISIBILITY_INTERNAL
+# define INTERNAL __attribute__((visibility("internal")))
+#elif SUPPORT_ATTRIBUTE_VISIBILITY_DEFAULT
# define INTERNAL __attribute__((__visibility__("default")))
#else
# define INTERNAL
@@ -40,8 +48,64 @@
extern "C" {
#endif
-/*
- * make file descriptors and sockets uninheritable
+/**
+ * @defgroup load_plugins Plugins loading
+ * @brief Functions related with plugins loading.
+ */
+
+/**
+ * @ingroup load_plugins
+ * @brief Load plugins into catalog
+ * @param this xine instance
+ *
+ * All input and demux plugins will be fully loaded and initialized.
+ * Decoder plugins are loaded on demand. Video/audio output plugins
+ * have special load/probe functions
+ */
+void _x_scan_plugins (xine_t *this) INTERNAL;
+
+/**
+ * @ingroup load_plugins
+ * @brief Dispose (shutdown) all currently loaded plugins
+ * @param this xine instance
+ */
+void _x_dispose_plugins (xine_t *this) INTERNAL;
+
+///@{
+/**
+ * @defgroup
+ * @brief find and instantiate input and demux plugins
+ */
+input_plugin_t *_x_find_input_plugin (xine_stream_t *stream, const char *mrl) INTERNAL;
+demux_plugin_t *_x_find_demux_plugin (xine_stream_t *stream, input_plugin_t *input) INTERNAL;
+demux_plugin_t *_x_find_demux_plugin_by_name (xine_stream_t *stream, const char *name, input_plugin_t *input) INTERNAL;
+demux_plugin_t *_x_find_demux_plugin_last_probe(xine_stream_t *stream, const char *last_demux_name, input_plugin_t *input) INTERNAL;
+input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *filename) INTERNAL;
+input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream) INTERNAL;
+void _x_free_input_plugin (xine_stream_t *stream, input_plugin_t *input) INTERNAL;
+void _x_free_demux_plugin (xine_stream_t *stream, demux_plugin_t *demux) INTERNAL;
+///@}
+
+///@{
+/**
+ * @defgroup
+ * @brief create decoder fifos and threads
+*/
+
+int _x_video_decoder_init (xine_stream_t *stream) INTERNAL;
+void _x_video_decoder_shutdown (xine_stream_t *stream) INTERNAL;
+
+int _x_audio_decoder_init (xine_stream_t *stream) INTERNAL;
+void _x_audio_decoder_shutdown (xine_stream_t *stream) INTERNAL;
+///@}
+
+/**
+ * @brief Benchmark available memcpy methods
+ */
+void xine_probe_fast_memcpy(xine_t *xine) INTERNAL;
+
+/**
+ * @brief Make file descriptors and sockets uninheritable
*/
int _x_set_file_close_on_exec(int fd) INTERNAL;
diff --git a/src/xine-utils/Makefile.am b/src/xine-utils/Makefile.am
index 501f489fe..783bc7633 100644
--- a/src/xine-utils/Makefile.am
+++ b/src/xine-utils/Makefile.am
@@ -1,19 +1,21 @@
+include $(top_srcdir)/misc/Makefile.quiet
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 mangle.h xine_mmx.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 \
@@ -32,20 +34,6 @@ libxineutils_la_SOURCES = $(pppc_files) \
pool.c \
ring_buffer.c
-xineinclude_HEADERS = \
- attributes.h \
- compat.h \
- xine_buffer.h \
- xineutils.h \
- xine_mmx.h \
- xmllexer.h \
- xmlparser.h \
- list.h \
- array.h \
- sorted_array.h \
- pool.h \
- ring_buffer.h
-
-
-noinst_HEADERS = ppcasm_string.h mangle.h
-
+noinst_PROGRAMS = xmltest
+xmltest_SOURCES = xmllexer.c xmlparser.c
+xmltest_CFLAGS = -DLOG -DXINE_XML_PARSER_TEST $(AM_CFLAGS)
diff --git a/src/xine-utils/array.c b/src/xine-utils/array.c
index 5cb3100ad..2cc540c34 100644
--- a/src/xine-utils/array.c
+++ b/src/xine-utils/array.c
@@ -23,8 +23,8 @@
#include <stdlib.h>
#include <string.h>
-#include "attributes.h"
-#include "array.h"
+#include <xine/attributes.h>
+#include <xine/array.h>
#define MIN_CHUNK_SIZE 32
diff --git a/src/xine-utils/color.c b/src/xine-utils/color.c
index 3c2388c27..930fb77d0 100644
--- a/src/xine-utils/color.c
+++ b/src/xine-utils/color.c
@@ -62,7 +62,8 @@
* instructions.
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
+#include "xine_mmx.h"
/*
* In search of the perfect colorspace conversion formulae...
diff --git a/src/xine-utils/copy.c b/src/xine-utils/copy.c
index 277cb64af..ed762fad1 100644
--- a/src/xine-utils/copy.c
+++ b/src/xine-utils/copy.c
@@ -25,7 +25,7 @@
#include "config.h"
#endif
-#include "xineutils.h"
+#include <xine/xineutils.h>
void yv12_to_yv12
(const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch,
diff --git a/src/xine-utils/cpu_accel.c b/src/xine-utils/cpu_accel.c
index 3f0140c7a..adcc4edc0 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>
@@ -38,15 +39,18 @@
#define LOG
*/
-#include "xineutils.h"
+#include <xine/xineutils.h>
#if defined(PIC) && ! defined(__PIC__)
#define __PIC__
#endif
-#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) {
@@ -58,10 +62,15 @@ 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
@@ -154,6 +163,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);
@@ -175,9 +187,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;
@@ -262,6 +277,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;
@@ -332,7 +350,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/list.c b/src/xine-utils/list.c
index 48ef0bff6..32c1d8fac 100644
--- a/src/xine-utils/list.c
+++ b/src/xine-utils/list.c
@@ -23,8 +23,8 @@
#endif
#include <stdlib.h>
-#include "attributes.h"
-#include "list.h"
+#include <xine/attributes.h>
+#include <xine/list.h>
#define MIN_CHUNK_SIZE 32
#define MAX_CHUNK_SIZE 65536
diff --git a/src/xine-utils/memcpy.c b/src/xine-utils/memcpy.c
index df514b682..f90ab275a 100644
--- a/src/xine-utils/memcpy.c
+++ b/src/xine-utils/memcpy.c
@@ -1,4 +1,4 @@
-/*
+;/*
* Copyright (C) 2001-2004 the xine project
*
* This file is part of xine, a free video player.
@@ -52,7 +52,8 @@
#define LOG
*/
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
+#include "../xine-engine/xine_private.h"
void *(* xine_fast_memcpy)(void *to, const void *from, size_t len);
@@ -384,30 +385,30 @@ static void *linux_kernel_memcpy(void *to, const void *from, size_t len) {
#endif /* _MSC_VER */
#endif /* ARCH_X86 */
-static struct {
- char *name;
- void *(* function)(void *to, const void *from, size_t len);
-
- uint64_t time; /* This type could be used for non-MSC build too! */
+static const struct {
+ const char name[16];
+ void *(*const function)(void *to, const void *from, size_t len);
uint32_t cpu_require;
} memcpy_method[] =
{
- { NULL, NULL, 0, 0 },
- { "libc memcpy()", memcpy, 0, 0 },
+ { "", NULL, 0 },
+ { "libc", memcpy, 0 },
#if (defined(ARCH_X86) || defined(ARCH_X86_64)) && !defined(_MSC_VER)
- { "linux kernel memcpy()", linux_kernel_memcpy, 0, 0 },
- { "MMX optimized memcpy()", mmx_memcpy, 0, MM_MMX },
- { "MMXEXT optimized memcpy()", mmx2_memcpy, 0, MM_MMXEXT },
- { "SSE optimized memcpy()", sse_memcpy, 0, MM_MMXEXT|MM_SSE },
+ { "linux kernel", linux_kernel_memcpy, 0 },
+ { "MMX ", mmx_memcpy, MM_MMX },
+ { "MMXEXT", mmx2_memcpy, MM_MMXEXT },
+ { "SSE", sse_memcpy, MM_MMXEXT|MM_SSE },
#endif /* ARCH_X86 */
#if defined (ARCH_PPC) && !defined (HOST_OS_DARWIN)
- { "ppcasm_memcpy()", ppcasm_memcpy, 0, 0 },
- { "ppcasm_cacheable_memcpy()", ppcasm_cacheable_memcpy, 0, MM_ACCEL_PPC_CACHE32 },
+ { "ppcasm", ppcasm_memcpy, 0 },
+ { "ppcasm_cached", ppcasm_cacheable_memcpy, MM_ACCEL_PPC_CACHE32 },
#endif /* ARCH_PPC && !HOST_OS_DARWIN */
- { NULL, NULL, 0, 0 }
+ { "", NULL, 0 }
};
+static uint64_t memcpy_timing[sizeof(memcpy_method)/sizeof(memcpy_method[0])] = { 0, };
+
#ifdef HAVE_POSIX_TIMERS
/* Prefer clock_gettime() where available. */
static int64_t _x_gettime(void)
@@ -459,7 +460,7 @@ static void update_fast_memcpy(void *user_data, xine_cfg_entry_t *entry) {
if (method != 0
&& (config_flags & memcpy_method[method].cpu_require) ==
memcpy_method[method].cpu_require ) {
- lprintf("using %s\n", memcpy_method[method].name );
+ lprintf("using %s memcpy()\n", memcpy_method[method].name );
xine_fast_memcpy = memcpy_method[method].function;
return;
} else {
@@ -474,7 +475,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",
@@ -500,7 +501,7 @@ void xine_probe_fast_memcpy(xine_t *xine)
if( best != 0 &&
(config_flags & memcpy_method[best].cpu_require) ==
memcpy_method[best].cpu_require ) {
- lprintf("using %s\n", memcpy_method[best].name );
+ lprintf("using %s memcpy()\n", memcpy_method[best].name );
xine_fast_memcpy = memcpy_method[best].function;
return;
}
@@ -528,7 +529,7 @@ void xine_probe_fast_memcpy(xine_t *xine)
memcpy_method[1].function(buf1,buf2,BUFSIZE);
}
- for(i=1; memcpy_method[i].name; i++)
+ for(i=1; memcpy_method[i].name[0]; i++)
{
if( (config_flags & memcpy_method[i].cpu_require) !=
memcpy_method[i].cpu_require )
@@ -541,11 +542,11 @@ void xine_probe_fast_memcpy(xine_t *xine)
}
t = rdtsc(config_flags) - t;
- memcpy_method[i].time = t;
+ memcpy_timing[i] = t;
- xprintf(xine, XINE_VERBOSITY_LOG, "\t%s : %" PRIu64 "\n", memcpy_method[i].name, t);
+ xprintf(xine, XINE_VERBOSITY_LOG, "\t%s memcpy() : %" PRIu64 "\n", memcpy_method[i].name, t);
- if( best == 0 || t < memcpy_method[best].time )
+ if( best == 0 || t < memcpy_timing[best] )
best = i;
}
diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c
index 3fe83b3f7..0c68cd59b 100644
--- a/src/xine-utils/monitor.c
+++ b/src/xine-utils/monitor.c
@@ -26,7 +26,7 @@
#include <stdio.h>
#include <sys/time.h>
-#include "xineutils.h"
+#include <xine/xineutils.h>
#define MAX_ID 10
diff --git a/src/xine-utils/pool.c b/src/xine-utils/pool.c
index 8b7f6d9f3..a6166bf62 100644
--- a/src/xine-utils/pool.c
+++ b/src/xine-utils/pool.c
@@ -22,9 +22,9 @@
#endif
#include <assert.h>
-#include "attributes.h"
-#include "pool.h"
-#include "array.h"
+#include <xine/attributes.h>
+#include <xine/pool.h>
+#include <xine/array.h>
#define MIN_CHUNK_SIZE 32
#define MAX_CHUNK_SIZE 65536
diff --git a/src/xine-utils/ring_buffer.c b/src/xine-utils/ring_buffer.c
index da3e2450c..1da9d7c4d 100644
--- a/src/xine-utils/ring_buffer.c
+++ b/src/xine-utils/ring_buffer.c
@@ -27,10 +27,10 @@
#include <assert.h>
#include <stdio.h>
#include <string.h>
-#include "attributes.h"
-#include "pool.h"
-#include "list.h"
-#include "ring_buffer.h"
+#include <xine/attributes.h>
+#include <xine/pool.h>
+#include <xine/list.h>
+#include <xine/ring_buffer.h>
#define RING_BUFFER_EXTRA_BUFFER_SIZE (1024 * 8)
diff --git a/src/xine-utils/sorted_array.c b/src/xine-utils/sorted_array.c
index 4bb618d4c..2f4bbeb0f 100644
--- a/src/xine-utils/sorted_array.c
+++ b/src/xine-utils/sorted_array.c
@@ -23,8 +23,8 @@
#include <stdlib.h>
#include <string.h>
-#include "attributes.h"
-#include "sorted_array.h"
+#include <xine/attributes.h>
+#include <xine/sorted_array.h>
/* Array internal struct */
struct xine_sarray_s {
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index 82cf5c0d4..e2aac22f5 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -27,10 +27,10 @@
#include "config.h"
#endif
-#include "xineutils.h"
-#include "xineintl.h"
+#include <xine/xineutils.h>
+#include <xine/xineintl.h>
#ifdef _MSC_VER
-#include "xine_internal.h"
+#include <xine/xine_internal.h>
#endif
#include "xine_private.h"
@@ -38,10 +38,10 @@
#include <pwd.h>
#include <sys/types.h>
#include <sys/time.h>
-#include <sys/socket.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>
+#include <sys/socket.h>
#if HAVE_EXECINFO_H
#include <execinfo.h>
@@ -65,10 +65,10 @@
#endif
typedef struct {
- char *language; /* name of the locale */
- char *encoding; /* typical encoding */
- char *spu_encoding; /* default spu encoding */
- char *modifier;
+ const char language[16]; /* name of the locale */
+ const char encoding[16]; /* typical encoding */
+ const char spu_encoding[16]; /* default spu encoding */
+ const char modifier[8];
} lang_locale_t;
@@ -76,172 +76,172 @@ typedef struct {
* information about locales used in xine
*/
static const lang_locale_t lang_locales[] = {
- { "af_ZA", "iso-8859-1", "iso-8859-1", NULL },
- { "ar_AE", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_BH", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_DZ", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_EG", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_IN", "utf-8", "utf-8", NULL },
- { "ar_IQ", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_JO", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_KW", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_LB", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_LY", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_MA", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_OM", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_QA", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_SA", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_SD", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_SY", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_TN", "iso-8859-6", "iso-8859-6", NULL },
- { "ar_YE", "iso-8859-6", "iso-8859-6", NULL },
- { "be_BY", "cp1251", "cp1251", NULL },
- { "bg_BG", "cp1251", "cp1251", NULL },
- { "br_FR", "iso-8859-1", "iso-88591", NULL },
- { "bs_BA", "iso-8859-2", "cp1250", NULL },
- { "ca_ES", "iso-8859-1", "iso-88591", NULL },
+ { "af_ZA", "iso-8859-1", "iso-8859-1", "" },
+ { "ar_AE", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_BH", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_DZ", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_EG", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_IN", "utf-8", "utf-8", "" },
+ { "ar_IQ", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_JO", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_KW", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_LB", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_LY", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_MA", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_OM", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_QA", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_SA", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_SD", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_SY", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_TN", "iso-8859-6", "iso-8859-6", "" },
+ { "ar_YE", "iso-8859-6", "iso-8859-6", "" },
+ { "be_BY", "cp1251", "cp1251", "" },
+ { "bg_BG", "cp1251", "cp1251", "" },
+ { "br_FR", "iso-8859-1", "iso-88591", "" },
+ { "bs_BA", "iso-8859-2", "cp1250", "" },
+ { "ca_ES", "iso-8859-1", "iso-88591", "" },
{ "ca_ES", "iso-8859-15", "iso-8859-15", "euro" },
- { "cs_CZ", "iso-8859-2", "cp1250", NULL },
- { "cy_GB", "iso-8859-14", "iso-8859-14", NULL },
- { "da_DK", "iso-8859-1", "iso-8859-1", NULL },
- { "de_AT", "iso-8859-1", "iso-8859-1", NULL },
+ { "cs_CZ", "iso-8859-2", "cp1250", "" },
+ { "cy_GB", "iso-8859-14", "iso-8859-14", "" },
+ { "da_DK", "iso-8859-1", "iso-8859-1", "" },
+ { "de_AT", "iso-8859-1", "iso-8859-1", "" },
{ "de_AT", "iso-8859-15", "iso-8859-15", "euro" },
- { "de_BE", "iso-8859-1", "iso-8859-1", NULL },
+ { "de_BE", "iso-8859-1", "iso-8859-1", "" },
{ "de_BE", "iso-8859-15", "iso-8859-15", "euro" },
- { "de_CH", "iso-8859-1", "iso-8859-1", NULL },
- { "de_DE", "iso-8859-1", "iso-8859-1", NULL },
+ { "de_CH", "iso-8859-1", "iso-8859-1", "" },
+ { "de_DE", "iso-8859-1", "iso-8859-1", "" },
{ "de_DE", "iso-8859-15", "iso-8859-15", "euro" },
- { "de_LU", "iso-8859-1", "iso-8859-1", NULL },
+ { "de_LU", "iso-8859-1", "iso-8859-1", "" },
{ "de_LU", "iso-8859-15", "iso-8859-15", "euro" },
- { "el_GR", "iso-8859-7", "iso-8859-7", NULL },
- { "en_AU", "iso-8859-1", "iso-8859-1", NULL },
- { "en_BW", "iso-8859-1", "iso-8859-1", NULL },
- { "en_CA", "iso-8859-1", "iso-8859-1", NULL },
- { "en_DK", "iso-8859-1", "iso-8859-1", NULL },
- { "en_GB", "iso-8859-1", "iso-8859-1", NULL },
- { "en_HK", "iso-8859-1", "iso-8859-1", NULL },
- { "en_IE", "iso-8859-1", "iso-8859-1", NULL },
+ { "el_GR", "iso-8859-7", "iso-8859-7", "" },
+ { "en_AU", "iso-8859-1", "iso-8859-1", "" },
+ { "en_BW", "iso-8859-1", "iso-8859-1", "" },
+ { "en_CA", "iso-8859-1", "iso-8859-1", "" },
+ { "en_DK", "iso-8859-1", "iso-8859-1", "" },
+ { "en_GB", "iso-8859-1", "iso-8859-1", "" },
+ { "en_HK", "iso-8859-1", "iso-8859-1", "" },
+ { "en_IE", "iso-8859-1", "iso-8859-1", "" },
{ "en_IE", "iso-8859-15", "iso-8859-15", "euro" },
- { "en_IN", "utf-8", "utf-8", NULL },
- { "en_NZ", "iso-8859-1", "iso-8859-1", NULL },
- { "en_PH", "iso-8859-1", "iso-8859-1", NULL },
- { "en_SG", "iso-8859-1", "iso-8859-1", NULL },
- { "en_US", "iso-8859-1", "iso-8859-1", NULL },
- { "en_ZA", "iso-8859-1", "iso-8859-1", NULL },
- { "en_ZW", "iso-8859-1", "iso-8859-1", NULL },
- { "es_AR", "iso-8859-1", "iso-8859-1", NULL },
- { "es_BO", "iso-8859-1", "iso-8859-1", NULL },
- { "es_CL", "iso-8859-1", "iso-8859-1", NULL },
- { "es_CO", "iso-8859-1", "iso-8859-1", NULL },
- { "es_CR", "iso-8859-1", "iso-8859-1", NULL },
- { "es_DO", "iso-8859-1", "iso-8859-1", NULL },
- { "es_EC", "iso-8859-1", "iso-8859-1", NULL },
- { "es_ES", "iso-8859-1", "iso-8859-1", NULL },
+ { "en_IN", "utf-8", "utf-8", "" },
+ { "en_NZ", "iso-8859-1", "iso-8859-1", "" },
+ { "en_PH", "iso-8859-1", "iso-8859-1", "" },
+ { "en_SG", "iso-8859-1", "iso-8859-1", "" },
+ { "en_US", "iso-8859-1", "iso-8859-1", "" },
+ { "en_ZA", "iso-8859-1", "iso-8859-1", "" },
+ { "en_ZW", "iso-8859-1", "iso-8859-1", "" },
+ { "es_AR", "iso-8859-1", "iso-8859-1", "" },
+ { "es_BO", "iso-8859-1", "iso-8859-1", "" },
+ { "es_CL", "iso-8859-1", "iso-8859-1", "" },
+ { "es_CO", "iso-8859-1", "iso-8859-1", "" },
+ { "es_CR", "iso-8859-1", "iso-8859-1", "" },
+ { "es_DO", "iso-8859-1", "iso-8859-1", "" },
+ { "es_EC", "iso-8859-1", "iso-8859-1", "" },
+ { "es_ES", "iso-8859-1", "iso-8859-1", "" },
{ "es_ES", "iso-8859-15", "iso-8859-15", "euro" },
- { "es_GT", "iso-8859-1", "iso-8859-1", NULL },
- { "es_HN", "iso-8859-1", "iso-8859-1", NULL },
- { "es_MX", "iso-8859-1", "iso-8859-1", NULL },
- { "es_NI", "iso-8859-1", "iso-8859-1", NULL },
- { "es_PA", "iso-8859-1", "iso-8859-1", NULL },
- { "es_PE", "iso-8859-1", "iso-8859-1", NULL },
- { "es_PR", "iso-8859-1", "iso-8859-1", NULL },
- { "es_PY", "iso-8859-1", "iso-8859-1", NULL },
- { "es_SV", "iso-8859-1", "iso-8859-1", NULL },
- { "es_US", "iso-8859-1", "iso-8859-1", NULL },
- { "es_UY", "iso-8859-1", "iso-8859-1", NULL },
- { "es_VE", "iso-8859-1", "iso-8859-1", NULL },
- { "et_EE", "iso-8859-1", "iso-8859-1", NULL },
- { "eu_ES", "iso-8859-1", "iso-8859-1", NULL },
+ { "es_GT", "iso-8859-1", "iso-8859-1", "" },
+ { "es_HN", "iso-8859-1", "iso-8859-1", "" },
+ { "es_MX", "iso-8859-1", "iso-8859-1", "" },
+ { "es_NI", "iso-8859-1", "iso-8859-1", "" },
+ { "es_PA", "iso-8859-1", "iso-8859-1", "" },
+ { "es_PE", "iso-8859-1", "iso-8859-1", "" },
+ { "es_PR", "iso-8859-1", "iso-8859-1", "" },
+ { "es_PY", "iso-8859-1", "iso-8859-1", "" },
+ { "es_SV", "iso-8859-1", "iso-8859-1", "" },
+ { "es_US", "iso-8859-1", "iso-8859-1", "" },
+ { "es_UY", "iso-8859-1", "iso-8859-1", "" },
+ { "es_VE", "iso-8859-1", "iso-8859-1", "" },
+ { "et_EE", "iso-8859-1", "iso-8859-1", "" },
+ { "eu_ES", "iso-8859-1", "iso-8859-1", "" },
{ "eu_ES", "iso-8859-15", "iso-8859-15", "euro" },
- { "fa_IR", "utf-8", "utf-8", NULL },
- { "fi_FI", "iso-8859-1", "iso-8859-1", NULL },
+ { "fa_IR", "utf-8", "utf-8", "" },
+ { "fi_FI", "iso-8859-1", "iso-8859-1", "" },
{ "fi_FI", "iso-8859-15", "iso-8859-15", "euro" },
- { "fo_FO", "iso-8859-1", "iso-8859-1", NULL },
- { "fr_BE", "iso-8859-1", "iso-8859-1", NULL },
+ { "fo_FO", "iso-8859-1", "iso-8859-1", "" },
+ { "fr_BE", "iso-8859-1", "iso-8859-1", "" },
{ "fr_BE", "iso-8859-15", "iso-8859-15", "euro" },
- { "fr_CA", "iso-8859-1", "iso-8859-1", NULL },
- { "fr_CH", "iso-8859-1", "iso-8859-1", NULL },
- { "fr_FR", "iso-8859-1", "iso-8859-1", NULL },
+ { "fr_CA", "iso-8859-1", "iso-8859-1", "" },
+ { "fr_CH", "iso-8859-1", "iso-8859-1", "" },
+ { "fr_FR", "iso-8859-1", "iso-8859-1", "" },
{ "fr_FR", "iso-8859-15", "iso-8859-15", "euro" },
- { "fr_LU", "iso-8859-1", "iso-8859-1", NULL },
+ { "fr_LU", "iso-8859-1", "iso-8859-1", "" },
{ "fr_LU", "iso-8859-15", "iso-8859-15", "euro" },
- { "ga_IE", "iso-8859-1", "iso-8859-1", NULL },
+ { "ga_IE", "iso-8859-1", "iso-8859-1", "" },
{ "ga_IE", "iso-8859-15", "iso-8859-15", "euro" },
- { "gl_ES", "iso-8859-1", "iso-8859-1", NULL },
+ { "gl_ES", "iso-8859-1", "iso-8859-1", "" },
{ "gl_ES", "iso-8859-15", "iso-8859-15", "euro" },
- { "gv_GB", "iso-8859-1", "iso-8859-1", NULL },
- { "he_IL", "iso-8859-8", "iso-8859-8", NULL },
- { "hi_IN", "utf-8", "utf-8", NULL },
- { "hr_HR", "iso-8859-2", "cp1250", NULL },
- { "hu_HU", "iso-8859-2", "cp1250", NULL },
- { "id_ID", "iso-8859-1", "iso-8859-1", NULL },
- { "is_IS", "iso-8859-1", "iso-8859-1", NULL },
- { "it_CH", "iso-8859-1", "iso-8859-1", NULL },
- { "it_IT", "iso-8859-1", "iso-8859-1", NULL },
+ { "gv_GB", "iso-8859-1", "iso-8859-1", "" },
+ { "he_IL", "iso-8859-8", "iso-8859-8", "" },
+ { "hi_IN", "utf-8", "utf-8", "" },
+ { "hr_HR", "iso-8859-2", "cp1250", "" },
+ { "hu_HU", "iso-8859-2", "cp1250", "" },
+ { "id_ID", "iso-8859-1", "iso-8859-1", "" },
+ { "is_IS", "iso-8859-1", "iso-8859-1", "" },
+ { "it_CH", "iso-8859-1", "iso-8859-1", "" },
+ { "it_IT", "iso-8859-1", "iso-8859-1", "" },
{ "it_IT", "iso-8859-15", "iso-8859-15", "euro" },
- { "iw_IL", "iso-8859-8", "iso-8859-8", NULL },
- { "ja_JP", "euc-jp", "euc-jp", NULL },
- { "ja_JP", "ujis", "ujis", NULL },
- { "japanese", "euc", "euc", NULL },
- { "ka_GE", "georgian-ps", "georgian-ps", NULL },
- { "kl_GL", "iso-8859-1", "iso-8859-1", NULL },
- { "ko_KR", "euc-kr", "euc-kr", NULL },
- { "ko_KR", "utf-8", "utf-8", NULL },
- { "korean", "euc", "euc", NULL },
- { "kw_GB", "iso-8859-1", "iso-8859-1", NULL },
- { "lt_LT", "iso-8859-13", "iso-8859-13", NULL },
- { "lv_LV", "iso-8859-13", "iso-8859-13", NULL },
- { "mi_NZ", "iso-8859-13", "iso-8859-13", NULL },
- { "mk_MK", "iso-8859-5", "cp1251", NULL },
- { "mr_IN", "utf-8", "utf-8", NULL },
- { "ms_MY", "iso-8859-1", "iso-8859-1", NULL },
- { "mt_MT", "iso-8859-3", "iso-8859-3", NULL },
- { "nb_NO", "ISO-8859-1", "ISO-8859-1", NULL },
- { "nl_BE", "iso-8859-1", "iso-8859-1", NULL },
+ { "iw_IL", "iso-8859-8", "iso-8859-8", "" },
+ { "ja_JP", "euc-jp", "euc-jp", "" },
+ { "ja_JP", "ujis", "ujis", "" },
+ { "japanese", "euc", "euc", "" },
+ { "ka_GE", "georgian-ps", "georgian-ps", "" },
+ { "kl_GL", "iso-8859-1", "iso-8859-1", "" },
+ { "ko_KR", "euc-kr", "euc-kr", "" },
+ { "ko_KR", "utf-8", "utf-8", "" },
+ { "korean", "euc", "euc", "" },
+ { "kw_GB", "iso-8859-1", "iso-8859-1", "" },
+ { "lt_LT", "iso-8859-13", "iso-8859-13", "" },
+ { "lv_LV", "iso-8859-13", "iso-8859-13", "" },
+ { "mi_NZ", "iso-8859-13", "iso-8859-13", "" },
+ { "mk_MK", "iso-8859-5", "cp1251", "" },
+ { "mr_IN", "utf-8", "utf-8", "" },
+ { "ms_MY", "iso-8859-1", "iso-8859-1", "" },
+ { "mt_MT", "iso-8859-3", "iso-8859-3", "" },
+ { "nb_NO", "ISO-8859-1", "ISO-8859-1", "" },
+ { "nl_BE", "iso-8859-1", "iso-8859-1", "" },
{ "nl_BE", "iso-8859-15", "iso-8859-15", "euro" },
- { "nl_NL", "iso-8859-1", "iso-8859-1", NULL },
+ { "nl_NL", "iso-8859-1", "iso-8859-1", "" },
{ "nl_NL", "iso-8859-15", "iso-8859-15", "euro" },
- { "nn_NO", "iso-8859-1", "iso-8859-1", NULL },
- { "no_NO", "iso-8859-1", "iso-8859-1", NULL },
- { "oc_FR", "iso-8859-1", "iso-8859-1", NULL },
- { "pl_PL", "iso-8859-2", "cp1250", NULL },
- { "pt_BR", "iso-8859-1", "iso-8859-1", NULL },
- { "pt_PT", "iso-8859-1", "iso-8859-1", NULL },
+ { "nn_NO", "iso-8859-1", "iso-8859-1", "" },
+ { "no_NO", "iso-8859-1", "iso-8859-1", "" },
+ { "oc_FR", "iso-8859-1", "iso-8859-1", "" },
+ { "pl_PL", "iso-8859-2", "cp1250", "" },
+ { "pt_BR", "iso-8859-1", "iso-8859-1", "" },
+ { "pt_PT", "iso-8859-1", "iso-8859-1", "" },
{ "pt_PT", "iso-8859-15", "iso-8859-15", "euro" },
- { "ro_RO", "iso-8859-2", "cp1250", NULL },
- { "ru_RU", "iso-8859-5", "cp1251", NULL },
- { "ru_RU", "koi8-r", "cp1251", NULL },
- { "ru_UA", "koi8-u", "cp1251", NULL },
- { "se_NO", "utf-8", "utf-8", NULL },
- { "sk_SK", "iso-8859-2", "cp1250", NULL },
- { "sl_SI", "iso-8859-2", "cp1250", NULL },
- { "sq_AL", "iso-8859-1", "iso-8859-1", NULL },
- { "sr_YU", "iso-8859-2", "cp1250", NULL },
+ { "ro_RO", "iso-8859-2", "cp1250", "" },
+ { "ru_RU", "iso-8859-5", "cp1251", "" },
+ { "ru_RU", "koi8-r", "cp1251", "" },
+ { "ru_UA", "koi8-u", "cp1251", "" },
+ { "se_NO", "utf-8", "utf-8", "" },
+ { "sk_SK", "iso-8859-2", "cp1250", "" },
+ { "sl_SI", "iso-8859-2", "cp1250", "" },
+ { "sq_AL", "iso-8859-1", "iso-8859-1", "" },
+ { "sr_YU", "iso-8859-2", "cp1250", "" },
{ "sr_YU", "iso-8859-5", "cp1251", "cyrillic" },
- { "sv_FI", "iso-8859-1", "iso-8859-1", NULL },
+ { "sv_FI", "iso-8859-1", "iso-8859-1", "" },
{ "sv_FI", "iso-8859-15", "iso-8859-15", "euro" },
- { "sv_SE", "iso-8859-1", "iso-8859-1", NULL },
- { "ta_IN", "utf-8", "utf-8", NULL },
- { "te_IN", "utf-8", "utf-8", NULL },
- { "tg_TJ", "koi8-t", "cp1251", NULL },
- { "th_TH", "tis-620", "tis-620", NULL },
- { "tl_PH", "iso-8859-1", "iso-8859-1", NULL },
- { "tr_TR", "iso-8859-9", "iso-8859-9", NULL },
- { "uk_UA", "koi8-u", "cp1251", NULL },
- { "ur_PK", "utf-8", "utf-8", NULL },
- { "uz_UZ", "iso-8859-1", "iso-8859-1", NULL },
- { "vi_VN", "tcvn", "tcvn", NULL },
- { "vi_VN", "utf-8", "utf-8", NULL },
- { "wa_BE", "iso-8859-1", "iso-8859-1", NULL },
+ { "sv_SE", "iso-8859-1", "iso-8859-1", "" },
+ { "ta_IN", "utf-8", "utf-8", "" },
+ { "te_IN", "utf-8", "utf-8", "" },
+ { "tg_TJ", "koi8-t", "cp1251", "" },
+ { "th_TH", "tis-620", "tis-620", "" },
+ { "tl_PH", "iso-8859-1", "iso-8859-1", "" },
+ { "tr_TR", "iso-8859-9", "iso-8859-9", "" },
+ { "uk_UA", "koi8-u", "cp1251", "" },
+ { "ur_PK", "utf-8", "utf-8", "" },
+ { "uz_UZ", "iso-8859-1", "iso-8859-1", "" },
+ { "vi_VN", "tcvn", "tcvn", "" },
+ { "vi_VN", "utf-8", "utf-8", "" },
+ { "wa_BE", "iso-8859-1", "iso-8859-1", "" },
{ "wa_BE", "iso-8859-15", "iso-8859-15", "euro" },
- { "yi_US", "cp1255", "cp1255", NULL },
- { "zh_CN", "gb18030", "gb18030", NULL },
- { "zh_CN", "gb2312", "gb2312", NULL },
- { "zh_CN", "gbk", "gbk", NULL },
- { "zh_HK", "big5-hkscs", "big5-hkscs", NULL },
- { "zh_TW", "big-5", "big-5", NULL },
- { "zh_TW", "euc-tw", "euc-tw", NULL },
- { NULL, NULL, NULL, NULL }
+ { "yi_US", "cp1255", "cp1255", "" },
+ { "zh_CN", "gb18030", "gb18030", "" },
+ { "zh_CN", "gb2312", "gb2312", "" },
+ { "zh_CN", "gbk", "gbk", "" },
+ { "zh_HK", "big5-hkscs", "big5-hkscs", "" },
+ { "zh_TW", "big-5", "big-5", "" },
+ { "zh_TW", "euc-tw", "euc-tw", "" },
+ { "" }
};
/**
@@ -279,16 +279,38 @@ void *xine_xmalloc(size_t size) {
return ptr;
}
-void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) {
+/**
+ * @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;
- char *ptr;
+ if((ptr = calloc(nmemb, size)) == NULL) {
+ fprintf(stderr, "%s: calloc() failed: %s.\n",
+ __XINE_FUNCTION__, strerror(errno));
+ return NULL;
+ }
- *base = ptr = calloc(1, size+alignment);
+ return ptr;
+}
- while ((size_t) ptr % alignment)
- ptr++;
+void *xine_memdup (const void *src, size_t length)
+{
+ void *dst = malloc (length);
+ return xine_fast_memcpy (dst, src, length);
+}
- return ptr;
+void *xine_memdup0 (const void *src, size_t length)
+{
+ char *dst = xine_xmalloc (length + 1);
+ dst[length] = 0;
+ return xine_fast_memcpy (dst, src, length);
}
#ifdef WIN32
@@ -493,38 +515,36 @@ 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_gen;
+ 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];
- if ((c>=32) && (c<127))
- printf ("%c", c);
- else
- printf (".");
+
+ for (i=j; i < imax; i++) {
+ fputc ((buf[i] >= 32 && buf[i] <= 126) ? buf[i] : '.', stdout);
}
j=i;
- printf("\n");
+
+ fputc('\n', stdout);
}
- for(j=0; j<69; j++)
- printf("-");
- printf("\n");
+ puts(separator);
}
@@ -541,7 +561,7 @@ static const lang_locale_t *_get_first_lang_locale(const char *lcal) {
else
lang_len = strlen(lcal);
- while(llocale->language) {
+ while(*(llocale->language)) {
if(!strncmp(lcal, llocale->language, lang_len)) {
if ((!mod && !llocale->modifier) || (mod && llocale->modifier && !strcmp(mod, llocale->modifier)))
return llocale;
diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c
index b1cfcf76b..436991b33 100644
--- a/src/xine-utils/xine_buffer.c
+++ b/src/xine-utils/xine_buffer.c
@@ -62,7 +62,7 @@
#define LOG
*/
-#include "xineutils.h"
+#include <xine/xineutils.h>
#define CHECKS
diff --git a/src/xine-utils/xine_buffer.h b/src/xine-utils/xine_buffer.h
deleted file mode 100644
index f88a21aef..000000000
--- a/src/xine-utils/xine_buffer.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
- *
- *
- * generic dynamic buffer functions. The goals
- * of these functions are (in fact many of these points
- * are todos):
- * - dynamic allocation and reallocation depending
- * on the size of data written to it.
- * - fast and transparent access to the data.
- * The user sees only the raw data chunk as it is
- * returned by the well-known malloc function.
- * This is necessary since not all data-accessing
- * functions can be wrapped here.
- * - some additional health checks are made during
- * development (eg boundary checks after direct
- * access to a buffer). This can be turned off in
- * production state for higher performance.
- * - A lot of convenient string and memory manipulation
- * functions are implemented here, where the user
- * do not have to care about memory chunk sizes.
- * - Some garbage collention could be implemented as well;
- * i think of a global structure containing infos
- * about all allocated chunks. This must be implemented
- * in a thread-save way...
- *
- * Here are some drawbacks (aka policies):
- * - The user must not pass indexed buffers to xine_buffer_*
- * functions.
- * - The pointers passed to xine_buffer_* functions may change
- * (eg during reallocation). The user must respect that.
- */
-
-#ifndef HAVE_XINE_BUFFER_H
-#define HAVE_XINE_BUFFER_H
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-#else
-# include <xine/os_types.h>
-#endif
-
-/*
- * returns an initialized pointer to a buffer.
- * The buffer will be allocated in blocks of
- * chunk_size bytes. This will prevent permanent
- * reallocation on slow growing buffers.
- */
-void *xine_buffer_init(int chunk_size) XINE_PROTECTED;
-
-/*
- * frees a buffer, the macro ensures, that a freed
- * buffer pointer is set to NULL
- */
-#define xine_buffer_free(buf) buf=_xine_buffer_free(buf)
-void *_xine_buffer_free(void *buf) XINE_PROTECTED;
-
-/*
- * duplicates a buffer
- */
-void *xine_buffer_dup(const void *buf) XINE_PROTECTED;
-
-/*
- * will copy len bytes of data into buf at position index.
- */
-#define xine_buffer_copyin(buf,i,data,len) \
- buf=_xine_buffer_copyin(buf,i,data,len)
-void *_xine_buffer_copyin(void *buf, int index, const void *data, int len) XINE_PROTECTED;
-
-/*
- * will copy len bytes out of buf+index into data.
- * no checks are made in data. It is treated as an ordinary
- * user-malloced data chunk.
- */
-void xine_buffer_copyout(const void *buf, int index, void *data, int len) XINE_PROTECTED;
-
-/*
- * set len bytes in buf+index to b.
- */
-#define xine_buffer_set(buf,i,b,len) \
- buf=_xine_buffer_set(buf,i,b,len)
-void *_xine_buffer_set(void *buf, int index, uint8_t b, int len) XINE_PROTECTED;
-
-/*
- * concatenates given buf (which should contain a null terminated string)
- * with another string.
- */
-#define xine_buffer_strcat(buf,data) \
- buf=_xine_buffer_strcat(buf,data)
-void *_xine_buffer_strcat(void *buf, const char *data) XINE_PROTECTED;
-
-/*
- * copies given string to buf+index
- */
-#define xine_buffer_strcpy(buf,index,data) \
- buf=_xine_buffer_strcpy(buf,index,data)
-void *_xine_buffer_strcpy(void *buf, int index, const char *data) XINE_PROTECTED;
-
-/*
- * returns a pointer to the first occurence of ch.
- * note, that the returned pointer cannot be used
- * in any other xine_buffer_* functions.
- */
-char *xine_buffer_strchr(const void *buf, int ch) XINE_PROTECTED;
-
-/*
- * get allocated memory size
- */
-int xine_buffer_get_size(const void *buf) XINE_PROTECTED;
-
-/*
- * ensures a specified buffer size if the user want to
- * write directly to the buffer. Normally the special
- * access functions defined here should be used.
- */
-#define xine_buffer_ensure_size(buf,data) \
- buf=_xine_buffer_ensure_size(buf,data)
-void *_xine_buffer_ensure_size(void *buf, int size) XINE_PROTECTED;
-
-#endif
diff --git a/src/xine-utils/xine_check.c b/src/xine-utils/xine_check.c
index 1b8c65130..e6323dceb 100644
--- a/src/xine-utils/xine_check.c
+++ b/src/xine-utils/xine_check.c
@@ -44,7 +44,7 @@
#include <fcntl.h>
#include <unistd.h>
-#include "xineutils.h"
+#include <xine/xineutils.h>
#ifndef O_CLOEXEC
# define O_CLOEXEC 0
diff --git a/src/xine-utils/xine_mutex.c b/src/xine-utils/xine_mutex.c
index e53de574b..64722e0be 100644
--- a/src/xine-utils/xine_mutex.c
+++ b/src/xine-utils/xine_mutex.c
@@ -24,7 +24,7 @@
#include <stdio.h>
#include <pthread.h>
-#include "xineutils.h"
+#include <xine/xineutils.h>
/*
#define DBG_MUTEX
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
deleted file mode 100644
index 5b16e6e3c..000000000
--- a/src/xine-utils/xineutils.h
+++ /dev/null
@@ -1,546 +0,0 @@
-/*
- * Copyright (C) 2000-2006 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, USA
- */
-#ifndef XINEUTILS_H
-#define XINEUTILS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <pthread.h>
-
-#ifdef XINE_COMPILE
-# include <inttypes.h>
-# include "attributes.h"
-# include "compat.h"
-# include "xmlparser.h"
-# include "xine_buffer.h"
-# include "configfile.h"
-# include "list.h"
-# include "array.h"
-# include "sorted_array.h"
-# include "xine_mmx.h"
-#else
-# ifdef WIN32
-# include <winsock.h>
-# else
-# include <sys/time.h>
-# endif
-# include <xine/os_types.h>
-# include <xine/attributes.h>
-# include <xine/compat.h>
-# include <xine/xmlparser.h>
-# include <xine/xine_buffer.h>
-# include <xine/configfile.h>
-# include <xine/list.h>
-# include <xine/array.h>
-# include <xine/sorted_array.h>
-# include <xine/xine_mmx.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-
-/*
- * Mark exported data symbols for link engine library clients with older
- * Win32 compilers
- */
-#if defined(WIN32) && !defined(XINE_LIBRARY_COMPILE)
-# define DL_IMPORT __declspec(dllimport)
-# define extern DL_IMPORT extern
-#endif
-
- /*
- * debugable mutexes
- */
-
- typedef struct {
- pthread_mutex_t mutex;
- char id[80];
- char *locked_by;
- } xine_mutex_t;
-
- int xine_mutex_init (xine_mutex_t *mutex, const pthread_mutexattr_t *mutexattr,
- const char *id) XINE_PROTECTED;
-
- int xine_mutex_lock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED;
- int xine_mutex_unlock (xine_mutex_t *mutex, const char *who) XINE_PROTECTED;
- int xine_mutex_destroy (xine_mutex_t *mutex) XINE_PROTECTED;
-
-
-
- /* CPU Acceleration */
-
-/*
- * 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)
- */
-
-/* generic accelerations */
-#define MM_ACCEL_MLIB 0x00000001
-
-/* x86 accelerations */
-#define MM_ACCEL_X86_MMX 0x80000000
-#define MM_ACCEL_X86_3DNOW 0x40000000
-#define MM_ACCEL_X86_MMXEXT 0x20000000
-#define MM_ACCEL_X86_SSE 0x10000000
-#define MM_ACCEL_X86_SSE2 0x08000000
-
-/* powerpc accelerations and features */
-#define MM_ACCEL_PPC_ALTIVEC 0x04000000
-#define MM_ACCEL_PPC_CACHE32 0x02000000
-
-/* SPARC accelerations */
-
-#define MM_ACCEL_SPARC_VIS 0x01000000
-#define MM_ACCEL_SPARC_VIS2 0x00800000
-
-/* x86 compat defines */
-#define MM_MMX MM_ACCEL_X86_MMX
-#define MM_3DNOW MM_ACCEL_X86_3DNOW
-#define MM_MMXEXT MM_ACCEL_X86_MMXEXT
-#define MM_SSE MM_ACCEL_X86_SSE
-#define MM_SSE2 MM_ACCEL_X86_SSE2
-
-uint32_t xine_mm_accel (void) XINE_CONST XINE_PROTECTED;
-
-
-
- /* Optimized/fast memcpy */
-
-extern void *(* xine_fast_memcpy)(void *to, const void *from, size_t len) XINE_PROTECTED;
-
-#ifdef HAVE_XINE_INTERNAL_H
-/* Benchmark available memcpy methods */
-void xine_probe_fast_memcpy(xine_t *xine) XINE_PROTECTED;
-#endif
-
-
-/*
- * Debug stuff
- */
-/*
- * profiling (unworkable in non DEBUG isn't defined)
- */
-void xine_profiler_init (void) XINE_PROTECTED;
-int xine_profiler_allocate_slot (const char *label) XINE_PROTECTED;
-void xine_profiler_start_count (int id) XINE_PROTECTED;
-void xine_profiler_stop_count (int id) XINE_PROTECTED;
-void xine_profiler_print_results (void) XINE_PROTECTED;
-
-/*
- * Allocate and clean memory size_t 'size', then return the pointer
- * to the allocated memory.
- */
-void *xine_xmalloc(size_t size) XINE_MALLOC XINE_DEPRECATED XINE_PROTECTED;
-
-/*
- * Same as above, but memory is aligned to 'alignement'.
- * **base is used to return pointer to un-aligned memory, use
- * this to free the mem chunk
- */
-void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) XINE_PROTECTED;
-
-/*
- * Get user home directory.
- */
-const char *xine_get_homedir(void) XINE_PROTECTED;
-
-#if defined(WIN32) || defined(__CYGWIN__)
-/*
- * Get other xine directories.
- */
-const char *xine_get_pluginroot(void) XINE_PROTECTED;
-const char *xine_get_plugindir(void) XINE_PROTECTED;
-const char *xine_get_fontdir(void) XINE_PROTECTED;
-const char *xine_get_localedir(void) XINE_PROTECTED;
-#endif
-
-/*
- * Clean a string (remove spaces and '=' at the begin,
- * and '\n', '\r' and spaces at the end.
- */
-char *xine_chomp (char *str) XINE_PROTECTED;
-
-/*
- * A thread-safe usecond sleep
- */
-void xine_usec_sleep(unsigned usec) XINE_PROTECTED;
-
-
- /*
- * Some string functions
- */
-
-
-void xine_strdupa(char *dest, char *src) XINE_PROTECTED XINE_DEPRECATED;
-#define xine_strdupa(d, s) do { \
- (d) = NULL; \
- if((s) != NULL) { \
- (d) = (char *) alloca(strlen((s)) + 1); \
- strcpy((d), (s)); \
- } \
- } while(0)
-
-/* compatibility macros */
-#define xine_strpbrk(S, ACCEPT) strpbrk((S), (ACCEPT))
-#define xine_strsep(STRINGP, DELIM) strsep((STRINGP), (DELIM))
-#define xine_setenv(NAME, VAL, XX) setenv((NAME), (VAL), (XX))
-
-/**
- * append to a string, reallocating
- * normally, updates & returns *dest
- * on error, *dest is unchanged & NULL is returned.
- */
-char *xine_strcat_realloc (char **dest, char *append) XINE_PROTECTED;
-
-/**
- * asprintf wrapper
- * allocate a string large enough to hold the output, and return a pointer to
- * it. This pointer should be passed to free when it is no longer needed.
- * return NULL on error.
- */
-char *_x_asprintf(const char *format, ...) XINE_PROTECTED XINE_MALLOC XINE_FORMAT_PRINTF(1, 2);
-
-/**
- * opens a file, ensuring that the descriptor will be closed
- * automatically after a fork/execute.
- */
-int xine_open_cloexec(const char *name, int flags) XINE_PROTECTED;
-
-/**
- * creates a file, ensuring that the descriptor will be closed
- * automatically after a fork/execute.
- */
-int xine_create_cloexec(const char *name, int flags, mode_t mode) XINE_PROTECTED;
-
-/**
- * creates a socket, ensuring that the descriptor will be closed
- * automatically after a fork/execute.
- */
-int xine_socket_cloexec(int domain, int type, int protocol) XINE_PROTECTED;
-
-/*
- * Color Conversion Utility Functions
- * The following data structures and functions facilitate the conversion
- * of RGB images to packed YUV (YUY2) images. There are also functions to
- * convert from YUV9 -> YV12. All of the meaty details are written in
- * color.c.
- */
-
-typedef struct yuv_planes_s {
-
- unsigned char *y;
- unsigned char *u;
- unsigned char *v;
- unsigned int row_width; /* frame width */
- unsigned int row_count; /* frame height */
-
-} yuv_planes_t;
-
-void init_yuv_conversion(void) XINE_PROTECTED;
-void init_yuv_planes(yuv_planes_t *yuv_planes, int width, int height) XINE_PROTECTED;
-void free_yuv_planes(yuv_planes_t *yuv_planes) XINE_PROTECTED;
-
-extern void (*yuv444_to_yuy2)
- (const yuv_planes_t *yuv_planes, unsigned char *yuy2_map, int pitch) XINE_PROTECTED;
-extern void (*yuv9_to_yv12)
- (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch,
- const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch,
- const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
- int width, int height) XINE_PROTECTED;
-extern void (*yuv411_to_yv12)
- (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dest, int y_dest_pitch,
- const unsigned char *u_src, int u_src_pitch, unsigned char *u_dest, int u_dest_pitch,
- const unsigned char *v_src, int v_src_pitch, unsigned char *v_dest, int v_dest_pitch,
- int width, int height) XINE_PROTECTED;
-extern void (*yv12_to_yuy2)
- (const unsigned char *y_src, int y_src_pitch,
- const unsigned char *u_src, int u_src_pitch,
- const unsigned char *v_src, int v_src_pitch,
- unsigned char *yuy2_map, int yuy2_pitch,
- int width, int height, int progressive) XINE_PROTECTED;
-extern void (*yuy2_to_yv12)
- (const unsigned char *yuy2_map, int yuy2_pitch,
- unsigned char *y_dst, int y_dst_pitch,
- unsigned char *u_dst, int u_dst_pitch,
- unsigned char *v_dst, int v_dst_pitch,
- int width, int height) XINE_PROTECTED;
-
-#define SCALEFACTOR 65536
-#define CENTERSAMPLE 128
-
-#define COMPUTE_Y(r, g, b) \
- (unsigned char) \
- ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR)
-#define COMPUTE_U(r, g, b) \
- (unsigned char) \
- ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE)
-#define COMPUTE_V(r, g, b) \
- (unsigned char) \
- ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE)
-
-#define UNPACK_BGR15(packed_pixel, r, g, b) \
- b = (packed_pixel & 0x7C00) >> 7; \
- g = (packed_pixel & 0x03E0) >> 2; \
- r = (packed_pixel & 0x001F) << 3;
-
-#define UNPACK_BGR16(packed_pixel, r, g, b) \
- b = (packed_pixel & 0xF800) >> 8; \
- g = (packed_pixel & 0x07E0) >> 3; \
- r = (packed_pixel & 0x001F) << 3;
-
-#define UNPACK_RGB15(packed_pixel, r, g, b) \
- r = (packed_pixel & 0x7C00) >> 7; \
- g = (packed_pixel & 0x03E0) >> 2; \
- b = (packed_pixel & 0x001F) << 3;
-
-#define UNPACK_RGB16(packed_pixel, r, g, b) \
- r = (packed_pixel & 0xF800) >> 8; \
- g = (packed_pixel & 0x07E0) >> 3; \
- b = (packed_pixel & 0x001F) << 3;
-
-extern int y_r_table[256] XINE_PROTECTED;
-extern int y_g_table[256] XINE_PROTECTED;
-extern int y_b_table[256] XINE_PROTECTED;
-
-extern int u_r_table[256] XINE_PROTECTED;
-extern int u_g_table[256] XINE_PROTECTED;
-extern int u_b_table[256] XINE_PROTECTED;
-
-extern int v_r_table[256] XINE_PROTECTED;
-extern int v_g_table[256] XINE_PROTECTED;
-extern int v_b_table[256] XINE_PROTECTED;
-
-/* frame copying functions */
-extern void yv12_to_yv12
- (const unsigned char *y_src, int y_src_pitch, unsigned char *y_dst, int y_dst_pitch,
- const unsigned char *u_src, int u_src_pitch, unsigned char *u_dst, int u_dst_pitch,
- const unsigned char *v_src, int v_src_pitch, unsigned char *v_dst, int v_dst_pitch,
- int width, int height) XINE_PROTECTED;
-extern void yuy2_to_yuy2
- (const unsigned char *src, int src_pitch,
- unsigned char *dst, int dst_pitch,
- int width, int height) XINE_PROTECTED;
-
-/* print a hexdump of the given data */
-void xine_hexdump (const char *buf, int length) XINE_PROTECTED;
-
-/*
- * Optimization macros for conditions
- * Taken from the FIASCO L4 microkernel sources
- */
-#if !defined(__GNUC__) || __GNUC__ < 3
-# define EXPECT_TRUE(x) (x)
-# define EXPECT_FALSE(x) (x)
-#else
-# define EXPECT_TRUE(x) __builtin_expect((x),1)
-# define EXPECT_FALSE(x) __builtin_expect((x),0)
-#endif
-
-#ifdef NDEBUG
-#define _x_assert(exp) \
- do { \
- if (!(exp)) \
- fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \
- __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \
- } while(0)
-#else
-#define _x_assert(exp) \
- do { \
- if (!(exp)) { \
- fprintf(stderr, "assert: %s:%d: %s: Assertion `%s' failed.\n", \
- __FILE__, __LINE__, __XINE_FUNCTION__, #exp); \
- abort(); \
- } \
- } while(0)
-#endif
-
-#define _x_abort() \
- do { \
- fprintf(stderr, "abort: %s:%d: %s: Aborting.\n", \
- __FILE__, __LINE__, __XINE_FUNCTION__); \
- abort(); \
- } while(0)
-
-
-/****** logging with xine **********************************/
-
-#ifndef LOG_MODULE
- #define LOG_MODULE __FILE__
-#endif /* LOG_MODULE */
-
-#define LOG_MODULE_STRING printf("%s: ", LOG_MODULE );
-
-#ifdef LOG_VERBOSE
- #define LONG_LOG_MODULE_STRING \
- printf("%s: (%s:%d) ", LOG_MODULE, __XINE_FUNCTION__, __LINE__ );
-#else
- #define LONG_LOG_MODULE_STRING LOG_MODULE_STRING
-#endif /* LOG_VERBOSE */
-
-#ifdef LOG
- #ifdef __GNUC__
- #define lprintf(fmt, args...) \
- do { \
- LONG_LOG_MODULE_STRING \
- printf(fmt, ##args); \
- fflush(stdout); \
- } while(0)
- #else /* __GNUC__ */
- #ifdef _MSC_VER
- #define lprintf(fmtargs) \
- do { \
- LONG_LOG_MODULE_STRING \
- printf("%s", fmtargs); \
- fflush(stdout); \
- } while(0)
- #else /* _MSC_VER */
- #define lprintf(...) \
- do { \
- LONG_LOG_MODULE_STRING \
- printf(__VA_ARGS__); \
- fflush(stdout); \
- } while(0)
- #endif /* _MSC_VER */
- #endif /* __GNUC__ */
-#else /* LOG */
- #ifdef __GNUC__
- #define lprintf(fmt, args...) do {} while(0)
- #else
- #ifdef _MSC_VER
-void __inline lprintf(const char * fmt, ...) {}
- #else
- #define lprintf(...) do {} while(0)
- #endif /* _MSC_VER */
- #endif /* __GNUC__ */
-#endif /* LOG */
-
-#ifdef __GNUC__
- #define llprintf(cat, fmt, args...) \
- do{ \
- if(cat){ \
- LONG_LOG_MODULE_STRING \
- printf( fmt, ##args ); \
- } \
- }while(0)
-#else
-#ifdef _MSC_VER
- #define llprintf(cat, fmtargs) \
- do{ \
- if(cat){ \
- LONG_LOG_MODULE_STRING \
- printf( "%s", fmtargs ); \
- } \
- }while(0)
-#else
- #define llprintf(cat, ...) \
- do{ \
- if(cat){ \
- LONG_LOG_MODULE_STRING \
- printf( __VA_ARGS__ ); \
- } \
- }while(0)
-#endif /* _MSC_VER */
-#endif /* __GNUC__ */
-
-#ifdef __GNUC__
- #define xprintf(xine, verbose, fmt, args...) \
- do { \
- if((xine) && (xine)->verbosity >= verbose){ \
- xine_log(xine, XINE_LOG_TRACE, fmt, ##args); \
- } \
- } while(0)
-#else
-#ifdef _MSC_VER
-void xine_xprintf(xine_t *xine, int verbose, const char *fmt, ...);
- #define xprintf xine_xprintf
-#else
- #define xprintf(xine, verbose, ...) \
- do { \
- if((xine) && (xine)->verbosity >= verbose){ \
- xine_log(xine, XINE_LOG_TRACE, __VA_ARGS__); \
- } \
- } while(0)
-#endif /* _MSC_VER */
-#endif /* __GNUC__ */
-
-/* time measuring macros for profiling tasks */
-
-#ifdef DEBUG
-# define XINE_PROFILE(function) \
- do { \
- struct timeval current_time; \
- double dtime; \
- gettimeofday(&current_time, NULL); \
- dtime = -(current_time.tv_sec + (current_time.tv_usec / 1000000.0)); \
- function; \
- gettimeofday(&current_time, NULL); \
- dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
- printf("%s: (%s:%d) took %lf seconds\n", \
- LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \
- } while(0)
-# define XINE_PROFILE_ACCUMULATE(function) \
- do { \
- struct timeval current_time; \
- static double dtime = 0; \
- gettimeofday(&current_time, NULL); \
- dtime -= current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
- function; \
- gettimeofday(&current_time, NULL); \
- dtime += current_time.tv_sec + (current_time.tv_usec / 1000000.0); \
- printf("%s: (%s:%d) took %lf seconds\n", \
- LOG_MODULE, __XINE_FUNCTION__, __LINE__, dtime); \
- } while(0)
-#else
-# define XINE_PROFILE(function) function
-# define XINE_PROFILE_ACCUMULATE(function) function
-#endif /* DEBUG */
-
-/**
- * get encoding of current locale
- */
-char *xine_get_system_encoding(void) XINE_MALLOC XINE_PROTECTED;
-
-/*
- * guess default encoding for the subtitles
- */
-const char *xine_guess_spu_encoding(void) XINE_PROTECTED;
-
-/*
- * use the best clock reference (API compatible with gettimeofday)
- * note: it will be a monotonic clock, if available.
- */
-int xine_monotonic_clock(struct timeval *tv, struct timezone *tz) XINE_PROTECTED;
-
-/* don't harm following code */
-#ifdef extern
-# undef extern
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c
index fb504f430..a3b395a46 100644
--- a/src/xine-utils/xmllexer.c
+++ b/src/xine-utils/xmllexer.c
@@ -30,11 +30,11 @@
#endif
#ifdef XINE_COMPILE
-#include "xineutils.h"
+#include <xine/xineutils.h>
#else
#define lprintf(...)
#endif
-#include "xmllexer.h"
+#include <xine/xmllexer.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@@ -46,8 +46,6 @@
#include "bswap.h"
/* private constants*/
-#define NORMAL 0 /* normal lex mode */
-#define DATA 1 /* data lex mode */
/* private global variables */
struct lexer * static_lexer;
@@ -98,6 +96,13 @@ void lexer_init(const char * buf, int size) {
static_lexer = lexer_init_r(buf, size);
}
+
+enum {
+ NORMAL,
+ DATA,
+ CDATA,
+};
+
struct lexer *lexer_init_r(const char * buf, int size) {
static const char boms[] = { 0xFF, 0xFE, 0, 0, 0xFE, 0xFF },
bom_utf8[] = { 0xEF, 0xBB, 0xBF };
@@ -134,6 +139,24 @@ void lexer_finalize_r(struct lexer * lexer)
free(lexer);
}
+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;
+
/* for ABI compatibility */
int lexer_get_token_d(char ** _tok, int * _tok_size, int fixed) {
return lexer_get_token_d_r(static_lexer, _tok, _tok_size, fixed);
@@ -144,7 +167,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
int tok_size = *_tok_size;
int tok_pos = 0;
- int state = 0;
+ lexer_state_t state = STATE_IDLE;
char c;
if (tok) {
@@ -152,73 +175,74 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
c = lexer->lexbuf[lexer->lexbuf_pos];
lprintf("c=%c, state=%d, in_comment=%d\n", c, state, lexer->in_comment);
- if (lexer->lex_mode == NORMAL) {
- /* normal mode */
+ switch (lexer->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 (!lexer->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 (!lexer->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;
@@ -227,7 +251,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* end of line */
- case 1:
+ case STATE_EOL:
if (c == '\n' || (c == '\r')) {
tok[tok_pos] = c;
lexer->lexbuf_pos++;
@@ -239,7 +263,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* T_SEPAR */
- case 2:
+ case STATE_SEPAR:
if (c == ' ' || (c == '\t')) {
tok[tok_pos] = c;
lexer->lexbuf_pos++;
@@ -251,7 +275,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* T_M_START < or </ or <! or <? */
- case 3:
+ case STATE_T_M_START:
switch (c) {
case '/':
tok[tok_pos] = c;
@@ -264,7 +288,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
tok[tok_pos] = c;
lexer->lexbuf_pos++;
tok_pos++;
- state = 8;
+ state = STATE_T_COMMENT;
break;
case '?':
tok[tok_pos] = c;
@@ -280,7 +304,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* T_M_STOP_1 */
- case 4:
+ case STATE_T_M_STOP_1:
tok[tok_pos] = '\0';
if (!lexer->in_comment)
lexer->lex_mode = DATA;
@@ -288,7 +312,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* T_M_STOP_2 */
- case 5:
+ case STATE_T_M_STOP_2:
if (c == '>') {
tok[tok_pos] = c;
lexer->lexbuf_pos++;
@@ -304,13 +328,13 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
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;
lexer->lexbuf_pos++;
if (c == '\"') { /* " */
@@ -320,8 +344,8 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
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 '-':
lexer->lexbuf_pos++;
@@ -345,6 +369,17 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
return T_ERROR;
}
break;
+ case '[':
+ lexer->lexbuf_pos++;
+ if (strncmp(lexer->lexbuf + lexer->lexbuf_pos, "CDATA[", 6) == 0) {
+ strncpy (tok + tok_pos, "[CDATA[", 7); /* FIXME */
+ lexer->lexbuf_pos += 6;
+ lexer->lex_mode = CDATA;
+ return T_CDATA_START;
+ } else{
+ return T_ERROR;
+ }
+ break;
default:
/* error */
return T_ERROR;
@@ -352,12 +387,14 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* T_TI_STOP */
- case 9:
+ case STATE_T_TI_STOP:
if (c == '>') {
tok[tok_pos] = c;
lexer->lexbuf_pos++;
tok_pos++; /* FIXME */
tok[tok_pos] = '\0';
+ if (!lexer->in_comment)
+ lexer->lex_mode = DATA;
return T_TI_STOP;
} else {
tok[tok_pos] = '\0';
@@ -366,24 +403,24 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* -- */
- case 10:
+ case STATE_T_DASHDASH:
switch (c) {
case '-':
tok[tok_pos] = c;
tok_pos++;
lexer->lexbuf_pos++;
- state = 11;
+ state = STATE_T_C_STOP;
break;
default:
tok[tok_pos] = c;
tok_pos++;
lexer->lexbuf_pos++;
- state = 100;
+ state = STATE_IDENT;
}
break;
/* --> */
- case 11:
+ case STATE_T_C_STOP:
switch (c) {
case '>':
tok[tok_pos] = c;
@@ -403,12 +440,12 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
tok[tok_pos] = c;
tok_pos++;
lexer->lexbuf_pos++;
- state = 100;
+ state = STATE_IDENT;
}
break;
/* T_STRING (single quotes) */
- case 12:
+ case STATE_T_STRING_SINGLE:
tok[tok_pos] = c;
lexer->lexbuf_pos++;
if (c == '\'') { /* " */
@@ -419,7 +456,7 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
break;
/* IDENT */
- case 100:
+ case STATE_IDENT:
switch (c) {
case '<':
case '>':
@@ -438,13 +475,13 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
tok[tok_pos] = c;
tok_pos++;
lexer->lexbuf_pos++;
- state = 9;
+ state = STATE_T_TI_STOP;
break;
case '-':
tok[tok_pos] = c;
tok_pos++;
lexer->lexbuf_pos++;
- state = 10;
+ state = STATE_T_DASHDASH;
break;
default:
tok[tok_pos] = c;
@@ -456,8 +493,9 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
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 '<':
@@ -469,6 +507,28 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
tok_pos++;
lexer->lexbuf_pos++;
}
+ break;
+
+ case CDATA: /* cdata mode, stop if next token is "]]>" */
+ switch (c)
+ {
+ case ']':
+ if (strncmp(lexer->lexbuf + lexer->lexbuf_pos, "]]>", 3) == 0) {
+ lexer->lexbuf_pos += 3;
+ lexer->lex_mode = DATA;
+ return T_CDATA_STOP;
+ } else {
+ tok[tok_pos] = c;
+ tok_pos++;
+ lexer->lexbuf_pos++;
+ }
+ break;
+ default:
+ tok[tok_pos] = c;
+ tok_pos++;
+ lexer->lexbuf_pos++;
+ }
+ break;
}
}
lprintf ("loop done tok_pos = %d, tok_size=%d, lexbuf_pos=%d, lexbuf_size=%d\n",
@@ -492,27 +552,28 @@ int lexer_get_token_d_r(struct lexer * lexer, char ** _tok, int * _tok_size, int
/* Terminate the current token */
tok[tok_pos] = '\0';
switch (state) {
- case 0:
- case 1:
- case 2:
+ case STATE_IDLE:
+ case STATE_EOL:
+ case STATE_SEPAR:
return T_EOF;
break;
- case 3:
+ case STATE_T_M_START:
return T_M_START_1;
break;
- case 4:
+ case STATE_T_M_STOP_1:
return T_M_STOP_1;
break;
- case 5:
+ case STATE_T_M_STOP_2:
return T_ERROR;
break;
- case 6:
+ case STATE_T_EQUAL:
return T_EQUAL;
break;
- case 7:
+ case STATE_T_STRING_SINGLE:
+ case STATE_T_STRING_DOUBLE:
return T_STRING;
break;
- case 100:
+ case STATE_IDENT:
return T_DATA;
break;
default:
diff --git a/src/xine-utils/xmllexer.h b/src/xine-utils/xmllexer.h
deleted file mode 100644
index bcea7d6b4..000000000
--- a/src/xine-utils/xmllexer.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright (C) 2002-2003,2007 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * The xine-lib XML parser is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * The xine-lib XML parser is distributed in the hope that 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with the Gnome Library; see the file COPYING.LIB. If not,
- * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110, USA
- */
-
-/* xml lexer */
-#ifndef XML_LEXER_H
-#define XML_LEXER_H
-
-#ifndef XINE_DEPRECATED
-#define XINE_DEPRECATED
-#endif
-
-#ifndef XINE_PROTECTED
-#define XINE_PROTECTED
-#endif
-
-/* public constants */
-#define T_ERROR -1 /* lexer error */
-#define T_EOF 0 /* end of file */
-#define T_EOL 1 /* end of line */
-#define T_SEPAR 2 /* separator ' ' '/t' '\n' '\r' */
-#define T_M_START_1 3 /* markup start < */
-#define T_M_START_2 4 /* markup start </ */
-#define T_M_STOP_1 5 /* markup stop > */
-#define T_M_STOP_2 6 /* markup stop /> */
-#define T_EQUAL 7 /* = */
-#define T_QUOTE 8 /* \" or \' */
-#define T_STRING 9 /* "string" */
-#define T_IDENT 10 /* identifier */
-#define T_DATA 11 /* data */
-#define T_C_START 12 /* <!-- */
-#define T_C_STOP 13 /* --> */
-#define T_TI_START 14 /* <? */
-#define T_TI_STOP 15 /* ?> */
-#define T_DOCTYPE_START 16 /* <!DOCTYPE */
-#define T_DOCTYPE_STOP 17 /* > */
-
-
-/* public structure */
-struct lexer
-{
- const char * lexbuf;
- int lexbuf_size;
- int lexbuf_pos;
- int lex_mode;
- int in_comment;
- char *lex_malloc;
-};
-
-
-/* public functions */
-void lexer_init(const char * buf, int size) XINE_DEPRECATED XINE_PROTECTED;
-struct lexer *lexer_init_r(const char * buf, int size) XINE_PROTECTED;
-void lexer_finalize_r(struct lexer * lexer) XINE_PROTECTED;
-int lexer_get_token_d_r(struct lexer * lexer, char ** tok, int * tok_size, int fixed) XINE_PROTECTED;
-int lexer_get_token_d(char ** tok, int * tok_size, int fixed) XINE_DEPRECATED XINE_PROTECTED;
-int lexer_get_token(char * tok, int tok_size) XINE_DEPRECATED XINE_PROTECTED;
-char *lexer_decode_entities (const char *tok) XINE_PROTECTED;
-
-#endif
diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c
index 1b82074fb..deee2550f 100644
--- a/src/xine-utils/xmlparser.c
+++ b/src/xine-utils/xmlparser.c
@@ -22,6 +22,12 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+
+#ifdef XINE_COMPILE
+# include "config.h"
+#endif
+
+#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -40,13 +46,13 @@
*/
#ifdef XINE_COMPILE
-#include "xineutils.h"
+#include <xine/xineutils.h>
#else
#define lprintf(...)
#define XINE_MALLOC
#endif
-#include "xmllexer.h"
-#include "xmlparser.h"
+#include <xine/xmllexer.h>
+#include <xine/xmlparser.h>
#define TOKEN_SIZE 4 * 1024
@@ -80,8 +86,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);
}
@@ -170,23 +179,86 @@ 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;
+ if (asprintf (&newtext, "%s%s", subnode->data, text) < 0)
+ newtext = NULL;
+ 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;
+ if (asprintf (&newtext, "%s%s", node->data, text) < 0)
+ newtext = NULL;
+ 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;
+}
-static int xml_parser_get_node (xml_parser_t *xml_parser, xml_node_t *current_node, char *root_name, int rec);
+#define Q_STATE(CURRENT,NEW) (STATE_##NEW + state - STATE_##CURRENT)
-static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer, int * token_buffer_size,
+
+static int xml_parser_get_node_internal (xml_parser_t *xml_parser,
+ char ** token_buffer, int * token_buffer_size,
char ** pname_buffer, int * pname_buffer_size,
char ** nname_buffer, int * nname_buffer_size,
- xml_node_t *current_node, char *root_name, int rec) {
+ xml_node_t *current_node, char *root_names[], int rec, int flags)
+{
char *tok = *token_buffer;
char *property_name = *pname_buffer;
char *node_name = *nname_buffer;
- 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;
@@ -209,30 +281,33 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
/* 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:
@@ -243,6 +318,7 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
break;
case STATE_NODE:
+ case STATE_Q_NODE:
switch (res) {
case (T_IDENT):
properties = NULL;
@@ -252,14 +328,19 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
if (xml_parser->mode == XML_PARSER_CASE_INSENSITIVE) {
strtoupper(tok);
}
- /* make sure the buffer for the node name is big enough */
- if (*token_buffer_size > *nname_buffer_size) {
- *nname_buffer_size = *token_buffer_size;
- *nname_buffer = realloc (*nname_buffer, *nname_buffer_size);
- node_name = *nname_buffer;
+ if (state == STATE_Q_NODE) {
+ if (asprintf (&node_name, "?%s", tok) < 0)
+ node_name = NULL;
+ free (*nname_buffer);
+ *nname_buffer = node_name;
+ *nname_buffer_size = strlen (node_name) + 1;
+ state = STATE_Q_ATTRIBUTE;
+ } else {
+ free (*nname_buffer);
+ *nname_buffer = node_name = strdup (tok);
+ *nname_buffer_size = strlen (node_name) + 1;
+ state = STATE_ATTRIBUTE;
}
- strcpy(node_name, tok);
- state = 2;
lprintf("info: current node name \"%s\"\n", node_name);
break;
default:
@@ -268,7 +349,8 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
break;
}
break;
- case 2:
+
+ case STATE_ATTRIBUTE:
switch (res) {
case (T_EOL):
case (T_SEPAR):
@@ -284,8 +366,13 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
/* set node propertys */
subtree->props = properties;
lprintf("info: rec %d new subtree %s\n", rec, node_name);
- parse_res = xml_parser_get_node(xml_parser, subtree, node_name, rec + 1);
- if (parse_res != 0) {
+ root_names[rec + 1] = strdup (node_name);
+ parse_res = xml_parser_get_node_internal (xml_parser, token_buffer, token_buffer_size,
+ pname_buffer, pname_buffer_size,
+ nname_buffer, nname_buffer_size,
+ subtree, root_names, rec + 1, flags);
+ free (root_names[rec + 1]);
+ if (parse_res == -1 || parse_res > 0) {
return parse_res;
}
if (current_subtree == NULL) {
@@ -295,11 +382,16 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
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 */
@@ -321,6 +413,7 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
break;
case (T_IDENT):
/* save property name */
+ new_prop:
if (xml_parser->mode == XML_PARSER_CASE_INSENSITIVE) {
strtoupper(tok);
}
@@ -331,7 +424,7 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
property_name = *pname_buffer;
}
strcpy(property_name, tok);
- state = 5;
+ state = Q_STATE(ATTRIBUTE, ATTRIBUTE_EQUALS);
lprintf("info: current property name \"%s\"\n", property_name);
break;
default:
@@ -341,17 +434,50 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
}
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;
@@ -363,10 +489,10 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
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);
@@ -376,18 +502,18 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
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 */
@@ -401,7 +527,42 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
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);
@@ -411,7 +572,8 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
break;
/* string or ident or separator expected */
- case 6:
+ case STATE_STRING:
+ case STATE_Q_STRING:
switch (res) {
case (T_EOL):
case (T_SEPAR):
@@ -430,7 +592,7 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
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);
@@ -446,31 +608,45 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
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;
@@ -491,7 +667,7 @@ static int _xml_parser_get_node (xml_parser_t *xml_parser, char ** token_buffer,
}
}
-static int xml_parser_get_node (xml_parser_t *xml_parser, xml_node_t *current_node, char *root_name, int rec)
+static int xml_parser_get_node (xml_parser_t *xml_parser, xml_node_t *current_node, int flags)
{
int res = 0;
int token_buffer_size = TOKEN_SIZE;
@@ -500,11 +676,14 @@ static int xml_parser_get_node (xml_parser_t *xml_parser, xml_node_t *current_no
char *token_buffer = calloc(1, token_buffer_size);
char *pname_buffer = calloc(1, pname_buffer_size);
char *nname_buffer = calloc(1, nname_buffer_size);
+ char *root_names[MAX_RECURSION + 1];
+ root_names[0] = "";
- res = _xml_parser_get_node(xml_parser, &token_buffer, &token_buffer_size,
+ res = xml_parser_get_node_internal (xml_parser,
+ &token_buffer, &token_buffer_size,
&pname_buffer, &pname_buffer_size,
&nname_buffer, &nname_buffer_size,
- current_node, root_name, rec);
+ current_node, root_names, 0, flags);
free (token_buffer);
free (pname_buffer);
@@ -514,18 +693,48 @@ static int xml_parser_get_node (xml_parser_t *xml_parser, xml_node_t *current_no
}
/* for ABI compatibility */
-int xml_parser_build_tree(xml_node_t **root_node) {
- return xml_parser_build_tree_r(static_xml_parser, root_node);
+int xml_parser_build_tree_with_options(xml_node_t **root_node, int flags) {
+ return xml_parser_build_tree_with_options_r(static_xml_parser, root_node, flags);
}
-int xml_parser_build_tree_r(xml_parser_t *xml_parser, xml_node_t **root_node) {
- xml_node_t *tmp_node;
+int xml_parser_build_tree_with_options_r(xml_parser_t *xml_parser, 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(xml_parser, tmp_node, "", 0);
- if ((tmp_node->child) && (!tmp_node->child->next)) {
- *root_node = tmp_node->child;
+ res = xml_parser_get_node(xml_parser, 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 {
@@ -536,6 +745,15 @@ int xml_parser_build_tree_r(xml_parser_t *xml_parser, xml_node_t **root_node) {
return res;
}
+/* for ABI compatibility */
+int xml_parser_build_tree(xml_node_t **root_node) {
+ return xml_parser_build_tree_with_options_r (static_xml_parser, root_node, 0);
+}
+
+int xml_parser_build_tree_r(xml_parser_t *xml_parser, xml_node_t **root_node) {
+ return xml_parser_build_tree_with_options_r(xml_parser, root_node, 0);
+}
+
const char *xml_parser_get_property (const xml_node_t *node, const char *name) {
xml_property_t *prop;
@@ -637,7 +855,7 @@ static void xml_parser_dump_node (const xml_node_t *node, int indent) {
free (value);
p = p->next;
if (p) {
- printf ("\n%*s", (int)(indent+2+l), "");
+ printf ("\n%*s", indent+2+(int)l, "");
}
}
printf (">\n");
@@ -654,5 +872,78 @@ 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);
}
+
+#ifdef XINE_XML_PARSER_TEST
+#include <sys/mman.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+void *xine_xmalloc (size_t size)
+{
+ return malloc (size);
+}
+
+int main (int argc, char **argv)
+{
+ int i, ret = 0;
+ for (i = 1; argv[i]; ++i)
+ {
+ xml_node_t *tree;
+ int fd;
+ void *buf;
+ struct stat st;
+
+ if (stat (argv[i], &st))
+ {
+ perror (argv[i]);
+ ret = 1;
+ continue;
+ }
+ if (!S_ISREG (st.st_mode))
+ {
+ printf ("%s: not a file\n", argv[i]);
+ ret = 1;
+ continue;
+ }
+ fd = open (argv[i], O_RDONLY);
+ if (!fd)
+ {
+ perror (argv[i]);
+ ret = 1;
+ continue;
+ }
+ buf = mmap (NULL, st.st_size, PROT_READ, MAP_SHARED, fd, 0);
+ if (!buf)
+ {
+ perror (argv[i]);
+ if (close (fd))
+ perror (argv[i]);
+ ret = 1;
+ continue;
+ }
+
+ xml_parser_init (buf, st.st_size, 0);
+ if (!xml_parser_build_tree (&tree))
+ {
+ puts (argv[i]);
+ xml_parser_dump_tree (tree);
+ xml_parser_free_tree (tree);
+ }
+ else
+ printf ("%s: parser failure\n", argv[i]);
+
+ if (close (fd))
+ {
+ perror (argv[i]);
+ ret = 1;
+ }
+ }
+ return ret;
+}
+#endif
diff --git a/src/xine-utils/xmlparser.h b/src/xine-utils/xmlparser.h
deleted file mode 100644
index 832925bd0..000000000
--- a/src/xine-utils/xmlparser.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2002-2003,2007 the xine project
- *
- * This file is part of xine, a free video player.
- *
- * The xine-lib XML parser is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * The xine-lib XML parser is distributed in the hope that 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.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with the Gnome Library; see the file COPYING.LIB. If not,
- * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
- * Floor, Boston, MA 02110, USA
- */
-
-#ifndef XML_PARSER_H
-#define XML_PARSER_H
-
-#ifndef XINE_DEPRECATED
-#define XINE_DEPRECATED
-#endif
-
-#ifndef XINE_PROTECTED
-#define XINE_PROTECTED
-#endif
-
-/* parser modes */
-#define XML_PARSER_CASE_INSENSITIVE 0
-#define XML_PARSER_CASE_SENSITIVE 1
-
-/* return codes */
-#define XML_PARSER_OK 0
-#define XML_PARSER_ERROR 1
-
-
-/* xml property */
-typedef struct xml_property_s {
- char *name;
- char *value;
- struct xml_property_s *next;
-} xml_property_t;
-
-/* xml node */
-typedef struct xml_node_s {
- char *name;
- char *data;
- struct xml_property_s *props;
- struct xml_node_s *child;
- struct xml_node_s *next;
-} xml_node_t;
-
-/* xml parser */
-typedef struct xml_parser_s {
- struct lexer *lexer;
- int mode;
-} xml_parser_t;
-
-void xml_parser_init(const char * buf, int size, int mode) XINE_DEPRECATED XINE_PROTECTED;
-xml_parser_t *xml_parser_init_r(const char * buf, int size, int mode) XINE_PROTECTED;
-void xml_parser_finalize_r(xml_parser_t *xml_parser) XINE_PROTECTED;
-
-int xml_parser_build_tree(xml_node_t **root_node) XINE_DEPRECATED XINE_PROTECTED;
-int xml_parser_build_tree_r(xml_parser_t *xml_parser, xml_node_t **root_node) XINE_PROTECTED;
-
-void xml_parser_free_tree(xml_node_t *root_node) XINE_PROTECTED;
-
-const char *xml_parser_get_property (const xml_node_t *node, const char *name) XINE_PROTECTED;
-int xml_parser_get_property_int (const xml_node_t *node, const char *name,
- int def_value) XINE_PROTECTED;
-int xml_parser_get_property_bool (const xml_node_t *node, const char *name,
- int def_value) XINE_PROTECTED;
-
-/* for output:
- * returns an escaped string (free() it when done)
- * input must be in ASCII or UTF-8
- */
-
-typedef enum {
- XML_ESCAPE_NO_QUOTE,
- XML_ESCAPE_SINGLE_QUOTE,
- XML_ESCAPE_DOUBLE_QUOTE
-} xml_escape_quote_t;
-char *xml_escape_string (const char *s, xml_escape_quote_t quote_type) XINE_PROTECTED;
-
-/* for debugging purposes: dump read-in xml tree in a nicely
- * indented fashion
- */
-
-void xml_parser_dump_tree (const xml_node_t *node) XINE_PROTECTED;
-
-#endif
diff --git a/version.sh b/version.sh
new file mode 100755
index 000000000..09a958e40
--- /dev/null
+++ b/version.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+
+# Making releases:
+# 1. For normal releases
+# Increment XINE_VERSION_SUB
+# Clear XINE_VERSION_PATCH
+# For patch releases
+# Increment XINE_VERSION_PATCH (use ".1", ".2" etc.)
+# 2. Remove .cvsversion before running make dist
+# 3. Adjust the values of XINE_LT_CURRENT, XINE_LT_REVISION, and XINE_LT_AGE
+# according to the following rules:
+#
+# 1. Increment XINE_LT_REVISION.
+# 2. If any interfaces have been added, removed, or changed, set
+# XINE_LT_REVISION to 0 and increment XINE_LT_CURRENT.
+# 3. If any interfaces have been added, increment XINE_LT_AGE.
+# 4. If any interfaces have been removed or incompatibly changed,
+# set XINE_LT_AGE to 0, and rename po/libxine*.pot accordingly
+# (use "hg rename").
+#
+# The most important thing to keep in mind is that the libtool version
+# numbers DO NOT MATCH the xine-lib version numbers, and you should NEVER
+# try to make them match.
+#
+# See the libtool documentation for more information.
+#
+# XINE_LT_CURRENT the current API version
+# XINE_LT_REVISION the current revision of the current API
+# XINE_LT_AGE the number of previous API versions still supported
+
+XINE_VERSION_MAJOR=1
+XINE_VERSION_MINOR=2
+XINE_VERSION_SUB=1
+XINE_VERSION_PATCH=
+# Release series number (usually $XINE_MAJOR.$XINE_MINOR)
+XINE_VERSION_SERIES=1.2
+
+XINE_LT_CURRENT=3
+XINE_LT_REVISION=0
+XINE_LT_AGE=1
+
+test -f "`dirname $0`/.cvsversion" && XINE_VERSION_SUFFIX="hg"
+XINE_VERSION_SPEC="${XINE_VERSION_MAJOR}.${XINE_VERSION_MINOR}.${XINE_VERSION_SUB}${XINE_VERSION_PATCH}${XINE_VERSION_SUFFIX}"
+
+####
+#### You should not need to touch anything beyond this point
+####
+
+echo "m4_define([XINE_VERSION_MAJOR], [${XINE_VERSION_MAJOR}])dnl"
+echo "m4_define([XINE_VERSION_MINOR], [${XINE_VERSION_MINOR}])dnl"
+echo "m4_define([XINE_VERSION_SUB], [${XINE_VERSION_SUB}])dnl"
+echo "m4_define([XINE_VERSION_PATCH], [${XINE_VERSION_PATCH}])dnl"
+echo "m4_define([XINE_VERSION_SUFFIX], [${XINE_VERSION_SUFFIX}])dnl"
+echo "m4_define([XINE_VERSION_SPEC], [${XINE_VERSION_SPEC}])dnl"
+echo "m4_define([XINE_VERSION_SERIES], [${XINE_VERSION_SERIES}])dnl"
+echo "m4_define([__XINE_LT_CURRENT], [${XINE_LT_CURRENT}])dnl"
+echo "m4_define([__XINE_LT_REVISION], [${XINE_LT_REVISION}])dnl"
+echo "m4_define([__XINE_LT_AGE], [${XINE_LT_AGE}])dnl"
diff --git a/win32/Makefile.am b/win32/Makefile.am
index 934ddb81a..94cf95571 100644
--- a/win32/Makefile.am
+++ b/win32/Makefile.am
@@ -1,10 +1,20 @@
+include $(top_srcdir)/misc/Makefile.quiet
include $(top_srcdir)/misc/Makefile.common
-SUBDIRS = include
-
EXTRA_DIST = \
scripts/post_install.bat \
scripts/ffmpeg_win32.patch \
+ include/msvc/sys/time.h \
+ include/msvc/config.h \
+ include/msvc/inttypes.h \
+ include/msvc/stdint.h \
+ include/msvc/unistd.h \
+ include/sys/socket.h \
+ include/netinet/in.h \
+ include/sys/socket.h \
+ include/dlfcn.h \
+ include/netdb.h \
+ include/pwd.h \
config.h \
README \
libdvdnav.def \
diff --git a/win32/README b/win32/README
index 926e2708d..926e2708d 100644..100755
--- a/win32/README
+++ b/win32/README
diff --git a/win32/config.h b/win32/config.h
index 62555cf4e..62555cf4e 100644..100755
--- a/win32/config.h
+++ b/win32/config.h
diff --git a/win32/include/Makefile.am b/win32/include/Makefile.am
deleted file mode 100644
index e7f124586..000000000
--- a/win32/include/Makefile.am
+++ /dev/null
@@ -1,14 +0,0 @@
-include $(top_srcdir)/misc/Makefile.common
-
-EXTRA_DIST = \
- msvc/sys/time.h \
- msvc/config.h \
- msvc/inttypes.h \
- msvc/stdint.h \
- msvc/unistd.h \
- sys/socket.h \
- netinet/in.h \
- sys/socket.h \
- dlfcn.h \
- netdb.h \
- pwd.h
diff --git a/win32/include/msvc/inttypes.h b/win32/include/msvc/inttypes.h
index e1aa46b74..6a4659f68 100644
--- a/win32/include/msvc/inttypes.h
+++ b/win32/include/msvc/inttypes.h
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a unix 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, USA
diff --git a/win32/include/msvc/stdint.h b/win32/include/msvc/stdint.h
index bf0316dd1..120129566 100644
--- a/win32/include/msvc/stdint.h
+++ b/win32/include/msvc/stdint.h
@@ -10,19 +10,19 @@ details. */
/*
* 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 self program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
diff --git a/win32/include/sys/socket.h b/win32/include/sys/socket.h
index e3fd4872a..0a331c562 100644..100755
--- a/win32/include/sys/socket.h
+++ b/win32/include/sys/socket.h
@@ -1,18 +1,18 @@
-/*
+/*
* Copyright (C) 2000-2004 the xine project
- *
+ *
* This file is part of xine, a unix 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, USA
diff --git a/win32/xineplug_dmx_audio.dsp b/win32/xineplug_dmx_audio.dsp
index 6d634a25f..6d634a25f 100644..100755
--- a/win32/xineplug_dmx_audio.dsp
+++ b/win32/xineplug_dmx_audio.dsp
diff --git a/win32/xineplug_dmx_lpcm.dsp b/win32/xineplug_dmx_lpcm.dsp
index f77a2336c..f77a2336c 100644..100755
--- a/win32/xineplug_dmx_lpcm.dsp
+++ b/win32/xineplug_dmx_lpcm.dsp
diff --git a/win32/xineplug_dmx_nsv.dsp b/win32/xineplug_dmx_nsv.dsp
index 95929b5cf..95929b5cf 100644..100755
--- a/win32/xineplug_dmx_nsv.dsp
+++ b/win32/xineplug_dmx_nsv.dsp
diff --git a/win32/xineplug_dmx_pva.dsp b/win32/xineplug_dmx_pva.dsp
index 276d77fd6..276d77fd6 100644..100755
--- a/win32/xineplug_dmx_pva.dsp
+++ b/win32/xineplug_dmx_pva.dsp
diff --git a/win32/xineplug_dmx_real.dsp b/win32/xineplug_dmx_real.dsp
index cdbdad67a..cdbdad67a 100644..100755
--- a/win32/xineplug_dmx_real.dsp
+++ b/win32/xineplug_dmx_real.dsp
diff --git a/win32/xineplug_dmx_slave.dsp b/win32/xineplug_dmx_slave.dsp
index 93315b293..93315b293 100644..100755
--- a/win32/xineplug_dmx_slave.dsp
+++ b/win32/xineplug_dmx_slave.dsp
diff --git a/win32/xineplug_dmx_yuv4mpeg2.dsp b/win32/xineplug_dmx_yuv4mpeg2.dsp
index 6f7db927f..6f7db927f 100644..100755
--- a/win32/xineplug_dmx_yuv4mpeg2.dsp
+++ b/win32/xineplug_dmx_yuv4mpeg2.dsp
diff --git a/win32/xineplug_dmx_yuv_frames.dsp b/win32/xineplug_dmx_yuv_frames.dsp
index e02f4d228..e02f4d228 100644..100755
--- a/win32/xineplug_dmx_yuv_frames.dsp
+++ b/win32/xineplug_dmx_yuv_frames.dsp
diff --git a/win32/xineplug_inp_cdda.dsp b/win32/xineplug_inp_cdda.dsp
index dddde9eb2..dddde9eb2 100644..100755
--- a/win32/xineplug_inp_cdda.dsp
+++ b/win32/xineplug_inp_cdda.dsp
diff --git a/win32/xineplug_inp_http.dsp b/win32/xineplug_inp_http.dsp
index da251d59e..da251d59e 100644..100755
--- a/win32/xineplug_inp_http.dsp
+++ b/win32/xineplug_inp_http.dsp
diff --git a/win32/xineplug_inp_net.dsp b/win32/xineplug_inp_net.dsp
index b8d9bd347..b8d9bd347 100644..100755
--- a/win32/xineplug_inp_net.dsp
+++ b/win32/xineplug_inp_net.dsp
diff --git a/win32/xineplug_vo_out_sdl.dsp b/win32/xineplug_vo_out_sdl.dsp
index 607cd74dc..607cd74dc 100644..100755
--- a/win32/xineplug_vo_out_sdl.dsp
+++ b/win32/xineplug_vo_out_sdl.dsp